summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-02-21 11:36:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-03-08 09:59:59 +0100
commitc7bb31362687174027660c2d393e7686523be856 (patch)
treea6f4aa936c066bbe5da4d28a81f304ba59dbb496
parentba35a497d411468fe3b920ad42628fa8b9b479b4 (diff)
downloadbarebox-c7bb31362687174027660c2d393e7686523be856.tar.gz
barebox-c7bb31362687174027660c2d393e7686523be856.tar.xz
ARM: stm32mp: add board support for STM32MP135F-DK
We already have the needed drivers in place to support the upcoming STM32MP131. Linux already has a basic DT for the DK board. Add a barebox board that leverages it. To try it out modify the existing FIP with: fiptool update --nt-fw build/images/barebox-stm32mp-generic-bl33.img \ --hw-config build/arch/arm/dts/stm32mp135f-dk.dtb \ mmcblk0p3 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220221103625.3728055-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--Documentation/boards/stm32mp.rst1
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/stm32mp13xx-dk/Makefile2
-rw-r--r--arch/arm/boards/stm32mp13xx-dk/lowlevel.c19
-rw-r--r--arch/arm/dts/Makefile1
-rw-r--r--arch/arm/dts/stm32mp131.dtsi14
-rw-r--r--arch/arm/dts/stm32mp135f-dk.dts12
-rw-r--r--arch/arm/mach-stm32mp/Kconfig8
-rw-r--r--images/Makefile.stm32mp1
9 files changed, 59 insertions, 0 deletions
diff --git a/Documentation/boards/stm32mp.rst b/Documentation/boards/stm32mp.rst
index 55bdafe785..6f4b14049a 100644
--- a/Documentation/boards/stm32mp.rst
+++ b/Documentation/boards/stm32mp.rst
@@ -33,6 +33,7 @@ There's a single ``stm32mp_defconfig`` for all STM32MP boards::
The resulting images will be placed under ``images/``::
barebox-stm32mp-generic-bl33.img
+ barebox-stm32mp13xx-dk.stm32
barebox-stm32mp15xx-dkx.stm32
barebox-stm32mp15x-ev1.stm32
barebox-stm32mp157c-lxa-mc1.stm32
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index a15963c775..8557e1dca8 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -139,6 +139,7 @@ obj-$(CONFIG_MACH_SOCFPGA_TERASIC_SOCKIT) += terasic-sockit/
obj-$(CONFIG_MACH_SOLIDRUN_CUBOX) += solidrun-cubox/
obj-$(CONFIG_MACH_SOLIDRUN_MICROSOM) += solidrun-microsom/
obj-$(CONFIG_MACH_STM32MP15XX_DKX) += stm32mp15xx-dkx/
+obj-$(CONFIG_MACH_STM32MP13XX_DK) += stm32mp13xx-dk/
obj-$(CONFIG_MACH_LXA_MC1) += lxa-mc1/
obj-$(CONFIG_MACH_STM32MP15X_EV1) += stm32mp15x-ev1/
obj-$(CONFIG_MACH_TECHNEXION_PICO_HOBBIT) += technexion-pico-hobbit/
diff --git a/arch/arm/boards/stm32mp13xx-dk/Makefile b/arch/arm/boards/stm32mp13xx-dk/Makefile
new file mode 100644
index 0000000000..9961af02a3
--- /dev/null
+++ b/arch/arm/boards/stm32mp13xx-dk/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/stm32mp13xx-dk/lowlevel.c b/arch/arm/boards/stm32mp13xx-dk/lowlevel.c
new file mode 100644
index 0000000000..ac4fa40e19
--- /dev/null
+++ b/arch/arm/boards/stm32mp13xx-dk/lowlevel.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <mach/entry.h>
+#include <debug_ll.h>
+
+extern char __dtb_z_stm32mp135f_dk_start[];
+
+ENTRY_FUNCTION(start_stm32mp13xx_dk, r0, r1, r2)
+{
+ void *fdt;
+
+ stm32mp_cpu_lowlevel_init();
+
+ putc_ll('>');
+
+ fdt = __dtb_z_stm32mp135f_dk_start + get_runtime_offset();
+
+ stm32mp1_barebox_entry(fdt);
+}
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d419e8394d..e0bb66580f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -127,6 +127,7 @@ lwl-$(CONFIG_MACH_SKOV_IMX6) += imx6s-skov-imx6.dtb.o imx6dl-skov-imx6.dtb.o imx
lwl-$(CONFIG_MACH_SKOV_ARM9CPU) += at91-skov-arm9cpu.dtb.o
lwl-$(CONFIG_MACH_SEEED_ODYSSEY) += stm32mp157c-odyssey.dtb.o
lwl-$(CONFIG_MACH_STM32MP15XX_DKX) += stm32mp157c-dk2.dtb.o stm32mp157a-dk1.dtb.o
+lwl-$(CONFIG_MACH_STM32MP13XX_DK) += stm32mp135f-dk.dtb.o
lwl-$(CONFIG_MACH_LXA_MC1) += stm32mp157c-lxa-mc1.dtb.o
lwl-$(CONFIG_MACH_STM32MP15X_EV1) += stm32mp157c-ev1.dtb.o
lwl-$(CONFIG_MACH_SCB9328) += imx1-scb9328.dtb.o
diff --git a/arch/arm/dts/stm32mp131.dtsi b/arch/arm/dts/stm32mp131.dtsi
new file mode 100644
index 0000000000..2ecad85f08
--- /dev/null
+++ b/arch/arm/dts/stm32mp131.dtsi
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/ {
+ aliases {
+ mmc0 = &sdmmc1;
+ };
+};
+
+&{/soc} {
+ memory-controller@5a003000 {
+ compatible = "st,stm32mp13-ddr";
+ reg = <0x5a003000 0x1000>;
+ };
+};
diff --git a/arch/arm/dts/stm32mp135f-dk.dts b/arch/arm/dts/stm32mp135f-dk.dts
new file mode 100644
index 0000000000..104886e8af
--- /dev/null
+++ b/arch/arm/dts/stm32mp135f-dk.dts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+
+#include <arm/stm32mp135f-dk.dts>
+#include "stm32mp131.dtsi"
+
+/ {
+ model = "STM32MP153F-DK";
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+};
diff --git a/arch/arm/mach-stm32mp/Kconfig b/arch/arm/mach-stm32mp/Kconfig
index 38c1a44770..57c1691591 100644
--- a/arch/arm/mach-stm32mp/Kconfig
+++ b/arch/arm/mach-stm32mp/Kconfig
@@ -6,10 +6,18 @@ config ARCH_NR_GPIO
int
default 416
+config ARCH_STM32MP13
+ select ARM_PSCI_CLIENT
+ bool
+
config ARCH_STM32MP157
select ARM_PSCI_CLIENT
bool
+config MACH_STM32MP13XX_DK
+ select ARCH_STM32MP13
+ bool "STM32MP137F DK board"
+
config MACH_STM32MP15XX_DKX
select ARCH_STM32MP157
bool "STM32MP157 DK1 and DK2 boards"
diff --git a/images/Makefile.stm32mp b/images/Makefile.stm32mp
index fa79e09f95..abe70a6a50 100644
--- a/images/Makefile.stm32mp
+++ b/images/Makefile.stm32mp
@@ -30,6 +30,7 @@ pblb-$(CONFIG_ARCH_STM32MP) += start_stm32mp_bl33
FILE_barebox-stm32mp-generic-bl33.img = start_stm32mp_bl33.pblb
image-$(CONFIG_ARCH_STM32MP) += barebox-stm32mp-generic-bl33.img
+$(call build_stm32mp_image, CONFIG_MACH_STM32MP13XX_DK, start_stm32mp13xx_dk, stm32mp13xx-dk)
$(call build_stm32mp_image, CONFIG_MACH_STM32MP15XX_DKX, start_stm32mp15xx_dkx, stm32mp15xx-dkx)
$(call build_stm32mp_image, CONFIG_MACH_STM32MP15X_EV1, start_stm32mp15x_ev1, stm32mp15x-ev1)