summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-10-01 11:48:21 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-02 06:33:11 +0200
commit28a656e96e95367e23b07091fb12a82396009743 (patch)
treef2ab9abf90769aad630a5dab8b15433bcd0f50cb /arch/arm/boards
parent0387f4f9172126b40a82d2cf640b6bdf968efa01 (diff)
downloadbarebox-28a656e96e95367e23b07091fb12a82396009743.tar.gz
barebox-28a656e96e95367e23b07091fb12a82396009743.tar.xz
ARM: stm32mp: dk2: have barebox image support DK1 as well
The STM32MP157C-DK2 and STM32MP157A-DK1 are basically the same board except the DK2 has a MIPI-DSI display attached and the SoC has a crypto block. We can thus use the SoC type to differentiate between them and just include both device trees at tolerable 12K size increase. Cc: Holger Assmann <h.assmann@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/stm32mp157c-dk2/lowlevel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c
index 7261d7a8bc..d79bfa4f4d 100644
--- a/arch/arm/boards/stm32mp157c-dk2/lowlevel.c
+++ b/arch/arm/boards/stm32mp157c-dk2/lowlevel.c
@@ -2,8 +2,10 @@
#include <common.h>
#include <mach/entry.h>
#include <debug_ll.h>
+#include <mach/revision.h>
extern char __dtb_z_stm32mp157c_dk2_start[];
+extern char __dtb_z_stm32mp157a_dk1_start[];
static void setup_uart(void)
{
@@ -14,13 +16,19 @@ static void setup_uart(void)
ENTRY_FUNCTION(start_stm32mp157c_dk2, r0, r1, r2)
{
void *fdt;
+ u32 cputype;
+ int err;
stm32mp_cpu_lowlevel_init();
if (IS_ENABLED(CONFIG_DEBUG_LL))
setup_uart();
- fdt = __dtb_z_stm32mp157c_dk2_start + get_runtime_offset();
+ err = __stm32mp_get_cpu_type(&cputype);
+ if (!err && cputype == CPU_STM32MP157Axx)
+ fdt = __dtb_z_stm32mp157a_dk1_start;
+ else
+ fdt = __dtb_z_stm32mp157c_dk2_start;
- stm32mp1_barebox_entry(fdt);
+ stm32mp1_barebox_entry(fdt + get_runtime_offset());
}