summaryrefslogtreecommitdiffstats
path: root/configs/platform-v7a/patches
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-04-26 10:38:21 +0200
committerRobert Schwebel <r.schwebel@pengutronix.de>2022-04-26 15:23:37 +0200
commit17e0620b641f671a91a4e439e2789a87b9124d41 (patch)
treeeed77846af3cf990a4e20630500d35a27437ef4a /configs/platform-v7a/patches
parentf586445a24ac00dd841deb6b2d8e365a99d9f870 (diff)
downloadDistroKit-17e0620b641f671a91a4e439e2789a87b9124d41.tar.gz
DistroKit-17e0620b641f671a91a4e439e2789a87b9124d41.tar.xz
v7a: rpi: unify rpi{2, 3, cm3}.hdimg into common rpi.hdimg
barebox has had the ability to generate an extra image that's bootable like a kernel for a while now. With small adjustment, we can let the videocore use this image and pass it the appropriate device tree depending on the board used. Moving this decision into the VideoCore allows us to use the same image for both Raspberry Pi 2, Rasperry Pi 3 and Raspberry Pi CM3. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.pengutronix.de/20220426083821.1829442-3-a.fatoum@pengutronix.de Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Diffstat (limited to 'configs/platform-v7a/patches')
-rw-r--r--configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch40
-rw-r--r--configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch37
-rw-r--r--configs/platform-v7a/patches/barebox-2022.04.0/series2
3 files changed, 79 insertions, 0 deletions
diff --git a/configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch b/configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch
new file mode 100644
index 0000000..b0b825e
--- /dev/null
+++ b/configs/platform-v7a/patches/barebox-2022.04.0/0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch
@@ -0,0 +1,40 @@
+From 92473f8169118472f0f40179eb60cb2cde765bb7 Mon Sep 17 00:00:00 2001
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Sat, 23 Apr 2022 12:24:34 +0200
+Subject: [PATCH 4/5] ARM: cpu: board-dt-2nd: call arm_cpu_lowlevel_init
+
+The generic DT image could be started by boot firmware that doesn't do
+all the initialization that we do in arm_cpu_lowlevel_init(), so call it
+always for good measure. This enables using the generic image as second
+stage to the Raspberry Pi videocore.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+---
+ arch/arm/cpu/board-dt-2nd.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c
+index 0731aecd1a51..6f4a6f26a8c7 100644
+--- a/arch/arm/cpu/board-dt-2nd.c
++++ b/arch/arm/cpu/board-dt-2nd.c
+@@ -21,6 +21,8 @@ void dt_2nd_aarch64(void *fdt)
+
+ /* entry point already set up stack */
+
++ arm_cpu_lowlevel_init();
++
+ relocate_to_current_adr();
+ setup_c();
+
+@@ -50,6 +52,8 @@ ENTRY_FUNCTION(start_dt_2nd, r0, r1, r2)
+ {
+ unsigned long image_start = (unsigned long)_text + global_variable_offset();
+
++ arm_cpu_lowlevel_init();
++
+ arm_setup_stack(image_start);
+
+ relocate_to_current_adr();
+--
+2.30.2
+
diff --git a/configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch b/configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch
new file mode 100644
index 0000000..0586085
--- /dev/null
+++ b/configs/platform-v7a/patches/barebox-2022.04.0/0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch
@@ -0,0 +1,37 @@
+From 675a65a3b42ef74ae37638f780912139a7c31cc6 Mon Sep 17 00:00:00 2001
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Sat, 23 Apr 2022 12:54:55 +0200
+Subject: [PATCH 5/5] ARM: rpi: don't warn about lack of videocore fdt
+
+When barebox is booted as generic second stage DT image, it will throw
+an annoying but harmless error that the videocore FDT saved in PBL has
+invalid magic. This is expected because the generic code doesn't store
+the device tree, instead it passes it to barebox proper to probe from.
+Storing the DT in /vd.dtb would thus just be duplication.
+
+Remove the error message in this case.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+---
+ arch/arm/boards/raspberry-pi/rpi-common.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
+index 9aa150de5680..82da4d646482 100644
+--- a/arch/arm/boards/raspberry-pi/rpi-common.c
++++ b/arch/arm/boards/raspberry-pi/rpi-common.c
+@@ -328,10 +328,8 @@ static void rpi_vc_fdt(void)
+ return;
+ }
+
+- if (magic != FDT_MAGIC) {
+- pr_err("videocore fdt saved in pbl has invalid magic\n");
++ if (magic != FDT_MAGIC)
+ return;
+- }
+
+ size = be32_to_cpu(oftree->totalsize);
+ if (write_file("/vc.dtb", saved_vc_fdt, size)) {
+--
+2.30.2
+
diff --git a/configs/platform-v7a/patches/barebox-2022.04.0/series b/configs/platform-v7a/patches/barebox-2022.04.0/series
index 8947868..be48ede 100644
--- a/configs/platform-v7a/patches/barebox-2022.04.0/series
+++ b/configs/platform-v7a/patches/barebox-2022.04.0/series
@@ -1,3 +1,5 @@
0001-ARM-asm-fix-miscompilation-of-32-bit-ENTRY_FUNCTION_.patch
0002-clk-add-BCM2835-auxiliary-peripheral-clock-driver.patch
0003-clocksource-assign-non-zero-priorities-to-all-clocks.patch
+0004-ARM-cpu-board-dt-2nd-call-arm_cpu_lowlevel_init.patch
+0005-ARM-rpi-don-t-warn-about-lack-of-videocore-fdt.patch