summaryrefslogtreecommitdiff
path: root/plat/st
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2019-06-04 18:23:10 +0200
committerYann Gautier <yann.gautier@st.com>2019-09-02 17:51:06 +0200
commitb2182cde098307a59ed389cff251bd4932654bf8 (patch)
tree4a460968548ba38a5d7d7d96434fe89b1b3c7aa5 /plat/st
parent10e7a9e904dfddd62ee839098e2d0737a3afad15 (diff)
stm32mp1: check if the SoC is single core
Among the variants of STM32MP, the STM32MP151 is a single Cortex-A7 chip. A function is added to check the part number of the SoC. If it corresponds to STM32MP151A or STM32MP151C, then the chip has a single Cortex-A7. Change-Id: Icac2015c5d03ce0bcb8e99bbaf1ec8ada34be49c Signed-off-by: Yann Gautier <yann.gautier@st.com> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Diffstat (limited to 'plat/st')
-rw-r--r--plat/st/common/include/stm32mp_common.h2
-rw-r--r--plat/st/stm32mp1/stm32mp1_private.c24
2 files changed, 26 insertions, 0 deletions
diff --git a/plat/st/common/include/stm32mp_common.h b/plat/st/common/include/stm32mp_common.h
index f0573903..0d0a9c66 100644
--- a/plat/st/common/include/stm32mp_common.h
+++ b/plat/st/common/include/stm32mp_common.h
@@ -16,6 +16,8 @@
void stm32mp_save_boot_ctx_address(uintptr_t address);
uintptr_t stm32mp_get_boot_ctx_address(void);
+bool stm32mp_is_single_core(void);
+
/* Return the base address of the DDR controller */
uintptr_t stm32mp_ddrctrl_base(void);
diff --git a/plat/st/stm32mp1/stm32mp1_private.c b/plat/st/stm32mp1/stm32mp1_private.c
index c334cd1e..38ebcef6 100644
--- a/plat/st/stm32mp1/stm32mp1_private.c
+++ b/plat/st/stm32mp1/stm32mp1_private.c
@@ -254,6 +254,30 @@ void stm32mp_print_boardinfo(void)
}
}
+/* Return true when SoC provides a single Cortex-A7 core, and false otherwise */
+bool stm32mp_is_single_core(void)
+{
+ uint32_t part_number;
+ bool ret = false;
+
+ if (get_part_number(&part_number) < 0) {
+ ERROR("Invalid part number, assume single core chip");
+ return true;
+ }
+
+ switch (part_number) {
+ case STM32MP151A_PART_NB:
+ case STM32MP151C_PART_NB:
+ ret = true;
+ break;
+
+ default:
+ break;
+ }
+
+ return ret;
+}
+
uint32_t stm32_iwdg_get_instance(uintptr_t base)
{
switch (base) {