diff options
author | Hanna Hawa <hannah@marvell.com> | 2017-08-25 16:45:12 +0300 |
---|---|---|
committer | Kostya Porotchkin <kostap@marvell.com> | 2017-08-28 10:11:08 +0300 |
commit | fbd11e4013b554240897ecb20d93e7ec7b4c2d53 (patch) | |
tree | 1beb02c3ac81d6e6dcbad3c04b3223cecff4b1df | |
parent | 2fe99bba4353756b4e74c93269b5e054bde31d04 (diff) |
plat: mvebu: add check of north bridge number to marvell_check_mpidr function
Part of AP810 preparation and driver changes, add check of north
bridge number to marvell_check_mpidr function.
For Armada-8k family and Armada-37xx family, no functional change,
they have single north bridge die.
Armada-8k-plus family can contain 4 north bridge dies, so need
to check the value of the die number.
Change-Id: I1f3b9fa46e6b099f83024e411828f586bb8927c2
Signed-off-by: Hanna Hawa <hannah@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/43400
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Hua Jing <jinghua@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
-rw-r--r-- | include/plat/marvell/a3700/common/arm_def.h | 2 | ||||
-rw-r--r-- | plat/marvell/a8k/common/include/platform_def.h | 2 | ||||
-rw-r--r-- | plat/marvell/common/marvell_topology.c | 13 |
3 files changed, 13 insertions, 4 deletions
diff --git a/include/plat/marvell/a3700/common/arm_def.h b/include/plat/marvell/a3700/common/arm_def.h index f7ace8e0..d0f771aa 100644 --- a/include/plat/marvell/a3700/common/arm_def.h +++ b/include/plat/marvell/a3700/common/arm_def.h @@ -77,6 +77,8 @@ /* Special value used to verify platform parameters from BL2 to BL31 */ #define MARVELL_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL +#define PLAT_MARVELL_NORTHB_COUNT 1 + #define PLAT_MARVELL_CLUSTER_COUNT 1 #define MARVELL_CACHE_WRITEBACK_SHIFT 6 diff --git a/plat/marvell/a8k/common/include/platform_def.h b/plat/marvell/a8k/common/include/platform_def.h index 9b7e60eb..3683c6c7 100644 --- a/plat/marvell/a8k/common/include/platform_def.h +++ b/plat/marvell/a8k/common/include/platform_def.h @@ -115,6 +115,8 @@ 0x20000) #define PLAT_MARVELL_FIP_MAX_SIZE 0x4000000 +#define PLAT_MARVELL_NORTHB_COUNT 1 + #define PLAT_MARVELL_CLUSTER_COUNT 2 #define PLAT_MARVELL_CLUSTER_CORE_COUNT 2 diff --git a/plat/marvell/common/marvell_topology.c b/plat/marvell/common/marvell_topology.c index dfd9ce6d..20770b19 100644 --- a/plat/marvell/common/marvell_topology.c +++ b/plat/marvell/common/marvell_topology.c @@ -97,15 +97,20 @@ const unsigned char *plat_get_power_domain_tree_desc(void) ******************************************************************************/ int marvell_check_mpidr(u_register_t mpidr) { - unsigned int cluster_id, cpu_id; + unsigned int nb_id, cluster_id, cpu_id; mpidr &= MPIDR_AFFINITY_MASK; - if (mpidr & ~(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)) + if (mpidr & ~(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK | MPIDR_AFFLVL_MASK << MPIDR_AFF2_SHIFT)) return -1; - cluster_id = (mpidr >> MPIDR_AFF1_SHIFT) & MPIDR_AFFLVL_MASK; - cpu_id = (mpidr >> MPIDR_AFF0_SHIFT) & MPIDR_AFFLVL_MASK; + /* Get north bridge ID */ + nb_id = MPIDR_AFFLVL3_VAL(mpidr); + cluster_id = MPIDR_AFFLVL1_VAL(mpidr); + cpu_id = MPIDR_AFFLVL0_VAL(mpidr); + + if (nb_id >= PLAT_MARVELL_CLUSTER_COUNT) + return -1; if (cluster_id >= PLAT_MARVELL_CLUSTER_COUNT) return -1; |