Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
85320724
Commit
85320724
authored
Feb 09, 2016
by
danh-arm
Browse files
Merge pull request #516 from vikramkanigiri/vk/ccn-fix-dvm-entry
Bug fix: Rectify logic to enter or exit from DVM domain
parents
a1411b29
3105f7ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
drivers/arm/ccn/ccn.c
View file @
85320724
...
@@ -268,7 +268,7 @@ static unsigned long long ccn_master_to_rn_id_map(unsigned long long master_map)
...
@@ -268,7 +268,7 @@ static unsigned long long ccn_master_to_rn_id_map(unsigned long long master_map)
/*******************************************************************************
/*******************************************************************************
* This function executes the necessary operations to add or remove Request node
* This function executes the necessary operations to add or remove Request node
* IDs specified in the 'rn_id_map' bitmap from the snoop/DVM domains specified
* IDs specified in the 'rn_id_map' bitmap from the snoop/DVM domains specified
* in the 'hn_id_map'. The 'region_id' specifies the ID of the first HN-F/
HN-I
* in the 'hn_id_map'. The 'region_id' specifies the ID of the first HN-F/
MN
* on which the operation should be performed. 'op_reg_offset' specifies the
* on which the operation should be performed. 'op_reg_offset' specifies the
* type of operation (add/remove). 'stat_reg_offset' specifies the register
* type of operation (add/remove). 'stat_reg_offset' specifies the register
* which should be polled to determine if the operation has completed or not.
* which should be polled to determine if the operation has completed or not.
...
@@ -309,35 +309,6 @@ static void ccn_snoop_dvm_do_op(unsigned long long rn_id_map,
...
@@ -309,35 +309,6 @@ static void ccn_snoop_dvm_do_op(unsigned long long rn_id_map,
#endif
#endif
}
}
/*******************************************************************************
* This function reads the bitmap of Home nodes on the basis of the
* 'mn_hn_id_reg_offset' parameter from the Miscellaneous node's (MN)
* programmer's view. The MN has a register which carries the bitmap of present
* Home nodes of each type i.e. HN-Fs, HN-Is & HN-Ds. It calls
* 'ccn_snoop_dvm_do_op()' with this information to perform the actual
* operation.
******************************************************************************/
static
void
ccn_snoop_dvm_domain_common
(
unsigned
long
long
rn_id_map
,
unsigned
int
hn_op_reg_offset
,
unsigned
int
hn_stat_reg_offset
,
unsigned
int
mn_hn_id_reg_offset
,
unsigned
int
hn_region_id
)
{
unsigned
long
long
mn_hn_id_map
;
assert
(
ccn_plat_desc
);
assert
(
ccn_plat_desc
->
periphbase
);
mn_hn_id_map
=
ccn_reg_read
(
ccn_plat_desc
->
periphbase
,
MN_REGION_ID
,
mn_hn_id_reg_offset
);
ccn_snoop_dvm_do_op
(
rn_id_map
,
mn_hn_id_map
,
hn_region_id
,
hn_op_reg_offset
,
hn_stat_reg_offset
);
}
/*******************************************************************************
/*******************************************************************************
* The following functions provide the boot and runtime API to the platform for
* The following functions provide the boot and runtime API to the platform for
* adding and removing master interfaces from the snoop/DVM domains. A bitmap of
* adding and removing master interfaces from the snoop/DVM domains. A bitmap of
...
@@ -357,17 +328,18 @@ void ccn_enter_snoop_dvm_domain(unsigned long long master_iface_map)
...
@@ -357,17 +328,18 @@ void ccn_enter_snoop_dvm_domain(unsigned long long master_iface_map)
unsigned
long
long
rn_id_map
;
unsigned
long
long
rn_id_map
;
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
ccn_snoop_dvm_domain_common
(
rn_id_map
,
ccn_snoop_dvm_do_op
(
rn_id_map
,
HNF_SDC_SET_OFFSET
,
CCN_GET_HN_NODEID_MAP
(
ccn_plat_desc
->
periphbase
,
HNF_SDC_STAT_OFFSET
,
MN_HNF_NODEID_OFFSET
),
MN_HNF_NODEID_OFFSET
,
HNF_REGION_ID_START
,
HNF_REGION_ID_START
);
HNF_SDC_SET_OFFSET
,
HNF_SDC_STAT_OFFSET
);
ccn_snoop_dvm_domain_common
(
rn_id_map
,
MN_DDC_SET_OFF
,
ccn_snoop_dvm_do_op
(
rn_id_map
,
MN_DDC_STAT_OFFSET
,
CCN_GET_MN_NODEID_MAP
(
ccn_plat_desc
->
periphbase
),
MN_HNI_NODEID_OFFSET
,
MN_REGION_ID
,
MN_REGION_ID
);
MN_DDC_SET_OFFSET
,
MN_DDC_STAT_OFFSET
);
}
}
void
ccn_exit_snoop_dvm_domain
(
unsigned
long
long
master_iface_map
)
void
ccn_exit_snoop_dvm_domain
(
unsigned
long
long
master_iface_map
)
...
@@ -375,17 +347,18 @@ void ccn_exit_snoop_dvm_domain(unsigned long long master_iface_map)
...
@@ -375,17 +347,18 @@ void ccn_exit_snoop_dvm_domain(unsigned long long master_iface_map)
unsigned
long
long
rn_id_map
;
unsigned
long
long
rn_id_map
;
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
ccn_snoop_dvm_domain_common
(
rn_id_map
,
ccn_snoop_dvm_do_op
(
rn_id_map
,
HNF_SDC_CLR_OFFSET
,
CCN_GET_HN_NODEID_MAP
(
ccn_plat_desc
->
periphbase
,
HNF_SDC_STAT_OFFSET
,
MN_HNF_NODEID_OFFSET
),
MN_HNF_NODEID_OFFSET
,
HNF_REGION_ID_START
,
HNF_REGION_ID_START
);
HNF_SDC_CLR_OFFSET
,
HNF_SDC_STAT_OFFSET
);
ccn_snoop_dvm_domain_common
(
rn_id_map
,
MN_DDC_CLR_OFFSET
,
ccn_snoop_dvm_do_op
(
rn_id_map
,
MN_DDC_STAT_OFFSET
,
CCN_GET_MN_NODEID_MAP
(
ccn_plat_desc
->
periphbase
),
MN_HNI_NODEID_OFFSET
,
MN_REGION_ID
,
MN_REGION_ID
);
MN_DDC_CLR_OFFSET
,
MN_DDC_STAT_OFFSET
);
}
}
void
ccn_enter_dvm_domain
(
unsigned
long
long
master_iface_map
)
void
ccn_enter_dvm_domain
(
unsigned
long
long
master_iface_map
)
...
@@ -393,11 +366,11 @@ void ccn_enter_dvm_domain(unsigned long long master_iface_map)
...
@@ -393,11 +366,11 @@ void ccn_enter_dvm_domain(unsigned long long master_iface_map)
unsigned
long
long
rn_id_map
;
unsigned
long
long
rn_id_map
;
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
ccn_snoop_dvm_do
main_common
(
rn_id_map
,
ccn_snoop_dvm_do
_op
(
rn_id_map
,
MN_DDC_SET_OFF
,
CCN_GET_MN_NODEID_MAP
(
ccn_plat_desc
->
periphbase
)
,
MN_
DDC_STAT_OFFSET
,
MN_
REGION_ID
,
MN_
HNI_NODEID
_OFFSET
,
MN_
DDC_SET
_OFFSET
,
MN_
REGION_ID
);
MN_
DDC_STAT_OFFSET
);
}
}
void
ccn_exit_dvm_domain
(
unsigned
long
long
master_iface_map
)
void
ccn_exit_dvm_domain
(
unsigned
long
long
master_iface_map
)
...
@@ -405,11 +378,11 @@ void ccn_exit_dvm_domain(unsigned long long master_iface_map)
...
@@ -405,11 +378,11 @@ void ccn_exit_dvm_domain(unsigned long long master_iface_map)
unsigned
long
long
rn_id_map
;
unsigned
long
long
rn_id_map
;
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
rn_id_map
=
ccn_master_to_rn_id_map
(
master_iface_map
);
ccn_snoop_dvm_do
main_common
(
rn_id_map
,
ccn_snoop_dvm_do
_op
(
rn_id_map
,
MN_DDC_CLR_OFFSET
,
CCN_GET_MN_NODEID_MAP
(
ccn_plat_desc
->
periphbase
)
,
MN_
DDC_STAT_OFFSET
,
MN_
REGION_ID
,
MN_
HNI_NODEID
_OFFSET
,
MN_
DDC_CLR
_OFFSET
,
MN_
REGION_ID
);
MN_
DDC_STAT_OFFSET
);
}
}
/*******************************************************************************
/*******************************************************************************
...
...
drivers/arm/ccn/ccn_private.h
View file @
85320724
...
@@ -147,7 +147,7 @@ typedef enum rn_types {
...
@@ -147,7 +147,7 @@ typedef enum rn_types {
#define MN_HNI_NODEID_OFFSET 0x01C0
#define MN_HNI_NODEID_OFFSET 0x01C0
#define MN_SN_NODEID_OFFSET 0x01D0
#define MN_SN_NODEID_OFFSET 0x01D0
#define MN_DDC_STAT_OFFSET DOMAIN_CTRL_STAT_OFFSET
#define MN_DDC_STAT_OFFSET DOMAIN_CTRL_STAT_OFFSET
#define MN_DDC_SET_OFF
DOMAIN_CTRL_SET_OFFSET
#define MN_DDC_SET_OFF
SET
DOMAIN_CTRL_SET_OFFSET
#define MN_DDC_CLR_OFFSET DOMAIN_CTRL_CLR_OFFSET
#define MN_DDC_CLR_OFFSET DOMAIN_CTRL_CLR_OFFSET
#define MN_ID_OFFSET REGION_ID_OFFSET
#define MN_ID_OFFSET REGION_ID_OFFSET
...
@@ -236,4 +236,21 @@ static inline unsigned int count_set_bits(uint64_t bitmap)
...
@@ -236,4 +236,21 @@ static inline unsigned int count_set_bits(uint64_t bitmap)
*/
*/
#define FOR_EACH_PRESENT_MASTER_INTERFACE(iface_id, bit_map) \
#define FOR_EACH_PRESENT_MASTER_INTERFACE(iface_id, bit_map) \
FOR_EACH_BIT(iface_id, bit_map)
FOR_EACH_BIT(iface_id, bit_map)
/*
* Macro that returns the node id bit map for the Miscellaneous Node
*/
#define CCN_GET_MN_NODEID_MAP(periphbase) \
(1 << get_node_id(ccn_reg_read(periphbase, MN_REGION_ID, \
REGION_ID_OFFSET)))
/*
* This macro returns the bitmap of Home nodes on the basis of the
* 'mn_hn_id_reg_offset' parameter from the Miscellaneous node's (MN)
* programmer's view. The MN has a register which carries the bitmap of present
* Home nodes of each type i.e. HN-Fs, HN-Is & HN-Ds.
*/
#define CCN_GET_HN_NODEID_MAP(periphbase, mn_hn_id_reg_offset) \
ccn_reg_read(periphbase, MN_REGION_ID, mn_hn_id_reg_offset)
#endif
/* __CCN_PRIVATE_H__ */
#endif
/* __CCN_PRIVATE_H__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment