summaryrefslogtreecommitdiffstats
path: root/arch/arm
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
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')
-rw-r--r--arch/arm/boards/stm32mp157c-dk2/lowlevel.c12
-rw-r--r--arch/arm/dts/Makefile2
2 files changed, 11 insertions, 3 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());
}
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index af061bd292..fe5b6e4398 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -110,7 +110,7 @@ lwl-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += imx6dl-hummingboard.dtb.o imx6q-hummingb
imx6dl-hummingboard2.dtb.o imx6q-hummingboard2.dtb.o \
imx6q-h100.dtb.o
lwl-$(CONFIG_MACH_SEEED_ODYSSEY) += stm32mp157c-odyssey.dtb.o
-lwl-$(CONFIG_MACH_STM32MP157C_DK2) += stm32mp157c-dk2.dtb.o
+lwl-$(CONFIG_MACH_STM32MP157C_DK2) += stm32mp157c-dk2.dtb.o stm32mp157a-dk1.dtb.o
lwl-$(CONFIG_MACH_LXA_MC1) += stm32mp157c-lxa-mc1.dtb.o
lwl-$(CONFIG_MACH_SCB9328) += imx1-scb9328.dtb.o
lwl-$(CONFIG_MACH_TECHNEXION_WANDBOARD) += imx6q-wandboard.dtb.o imx6dl-wandboard.dtb.o