DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH 1/3] MIPS(EL): barebox: add /chosen/stdout-path properties for all boards
@ 2024-08-22 13:45 Ahmad Fatoum
  2024-08-22 13:45 ` [DistroKit] [PATCH 2/3] MIPS: qemu-run: fix barebox Malta image name Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2024-08-22 13:45 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum, ore

A lot of MIPS boards lack a /chosen/stdout-path property, instead
relying on the options CONFIG_CONSOLE_ACTIVATE_ALL/FIRST to select an
appropriate console. To allow usage of the barebox console with
CONFIG_CONSOLE_ACTIVATE_NONE, let's add explicit console activation.

The patches have already been submitted for upstream inclusion[1].

[1]: https://lore.barebox.org/barebox/20240822115701.1184099-1-a.fatoum@pengutronix.de

Fixes: 4c0d7cecdd75 ("mips/mipsel: barebox: use CONSOLE_ACTIVATE_NONE")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 ...osen-stdout-path-where-it-is-missing.patch | 99 +++++++++++++++++++
 ...emu-malta-explicitly-set-stdout-path.patch | 35 +++++++
 .../patches/barebox-2021.02.0/series          |  2 +
 ...osen-stdout-path-where-it-is-missing.patch | 99 +++++++++++++++++++
 ...emu-malta-explicitly-set-stdout-path.patch | 35 +++++++
 .../patches/barebox-2021.06.0/series          |  2 +
 6 files changed, 272 insertions(+)
 create mode 100644 configs/platform-mips/patches/barebox-2021.02.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
 create mode 100644 configs/platform-mips/patches/barebox-2021.02.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
 create mode 100644 configs/platform-mips/patches/barebox-2021.02.0/series
 create mode 100644 configs/platform-mipsel/patches/barebox-2021.06.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
 create mode 100644 configs/platform-mipsel/patches/barebox-2021.06.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
 create mode 100644 configs/platform-mipsel/patches/barebox-2021.06.0/series

diff --git a/configs/platform-mips/patches/barebox-2021.02.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch b/configs/platform-mips/patches/barebox-2021.02.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
new file mode 100644
index 000000000000..fbe71b59f523
--- /dev/null
+++ b/configs/platform-mips/patches/barebox-2021.02.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
@@ -0,0 +1,99 @@
+From 9af92b9cd64cb4a2df8ad03685e38fedf4ca78b4 Mon Sep 17 00:00:00 2001
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Wed, 21 Aug 2024 15:02:02 +0200
+Subject: [PATCH 1/2] MIPS: dts: add /chosen/stdout-path where it is missing
+
+A number of MIPS boards don't have a stdout-path set and instead rely on
+CONFIG_CONSOLE_ACTIVATE_ALL/FIRST to enable a console.
+
+This can get problematic if more consoles are added in future, or
+CONFIG_CONSOLE_ACTIVATE_NONE is to be used. So on systems that currently
+have a single console, let's have /chosen/stdout-path point at it.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+---
+ arch/mips/dts/black-swift.dts   | 4 ++++
+ arch/mips/dts/dlink-dir-320.dts | 4 ++++
+ arch/mips/dts/img-ci20.dts      | 4 ++++
+ arch/mips/dts/loongson-ls1b.dts | 4 ++++
+ arch/mips/dts/rzx50.dts         | 4 ++++
+ 5 files changed, 20 insertions(+)
+
+diff --git a/arch/mips/dts/black-swift.dts b/arch/mips/dts/black-swift.dts
+index af817dbfc7e1..6bb26d427f2d 100644
+--- a/arch/mips/dts/black-swift.dts
++++ b/arch/mips/dts/black-swift.dts
+@@ -13,6 +13,10 @@ aliases {
+ 		spiflash = &spiflash;
+ 	};
+ 
++	chosen {
++		stdout-path = &uart;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x00000000 0x4000000>;
+diff --git a/arch/mips/dts/dlink-dir-320.dts b/arch/mips/dts/dlink-dir-320.dts
+index d19c3087d017..beec40f3dcc5 100644
+--- a/arch/mips/dts/dlink-dir-320.dts
++++ b/arch/mips/dts/dlink-dir-320.dts
+@@ -7,6 +7,10 @@ / {
+ 	#address-cells = <1>;
+ 	#size-cells = <1>;
+ 
++	chosen {
++		stdout-path = &serial0;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x00000000 0x2000000>;
+diff --git a/arch/mips/dts/img-ci20.dts b/arch/mips/dts/img-ci20.dts
+index e1d3280c4e11..71038890d977 100644
+--- a/arch/mips/dts/img-ci20.dts
++++ b/arch/mips/dts/img-ci20.dts
+@@ -14,6 +14,10 @@ / {
+ 	model = "MIPS Creator CI20";
+ 	compatible = "img,ci20";
+ 
++	chosen {
++		stdout-path = &uart0;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x0 0x10000000>;
+diff --git a/arch/mips/dts/loongson-ls1b.dts b/arch/mips/dts/loongson-ls1b.dts
+index 89cce5636bcf..30520a34f53b 100644
+--- a/arch/mips/dts/loongson-ls1b.dts
++++ b/arch/mips/dts/loongson-ls1b.dts
+@@ -6,6 +6,10 @@ / {
+ 	model = "Loongson Tech LS1B Demo Board";
+ 	compatible = "loongson,ls1b";
+ 
++	chosen {
++		stdout-path = &serial2;
++	};
++
+ 	oscillator: oscillator {
+ 			#clock-cells = <0>;
+ 			compatible = "fixed-clock";
+diff --git a/arch/mips/dts/rzx50.dts b/arch/mips/dts/rzx50.dts
+index bd3631f7c451..93211a97a59f 100644
+--- a/arch/mips/dts/rzx50.dts
++++ b/arch/mips/dts/rzx50.dts
+@@ -6,6 +6,10 @@ / {
+ 	model = "Ritmix RZX-50";
+ 	compatible = "ritmix,rzx50";
+ 
++	chosen {
++		stdout-path = &serial1;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x00000000 0x4000000>;
+-- 
+2.39.2
+
diff --git a/configs/platform-mips/patches/barebox-2021.02.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch b/configs/platform-mips/patches/barebox-2021.02.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
new file mode 100644
index 000000000000..074b8c70036a
--- /dev/null
+++ b/configs/platform-mips/patches/barebox-2021.02.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
@@ -0,0 +1,35 @@
+From 0da08cd25a0bacfa22cde380d5ead90077b6c7b3 Mon Sep 17 00:00:00 2001
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Wed, 21 Aug 2024 15:12:02 +0200
+Subject: [PATCH 2/2] MIPS: qemu-malta: explicitly set stdout-path
+
+The Malta device tree describes and enables two consoles, but doesn't
+specify which one to use for barebox console.
+
+In configurations with CONFIG_CONSOLE_ACTIVATE_FIRST, it's thus
+dependent on device tree probe order, which console ends up being used
+by barebox.
+
+Fix this by explicitly pointing stdout-path at the first console.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+---
+ arch/mips/dts/qemu-malta.dts | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
+index c2bc03dd4631..6cf7513ff5fa 100644
+--- a/arch/mips/dts/qemu-malta.dts
++++ b/arch/mips/dts/qemu-malta.dts
+@@ -8,6 +8,8 @@ / {
+ 	#size-cells = <1>;
+ 
+ 	chosen {
++		stdout-path = &uart0;
++
+ 		environment {
+ 			compatible = "barebox,environment";
+ 			device-path = &env_nor;
+-- 
+2.39.2
+
diff --git a/configs/platform-mips/patches/barebox-2021.02.0/series b/configs/platform-mips/patches/barebox-2021.02.0/series
new file mode 100644
index 000000000000..b9b6f404fa41
--- /dev/null
+++ b/configs/platform-mips/patches/barebox-2021.02.0/series
@@ -0,0 +1,2 @@
+0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
+0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
diff --git a/configs/platform-mipsel/patches/barebox-2021.06.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch b/configs/platform-mipsel/patches/barebox-2021.06.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
new file mode 100644
index 000000000000..fbe71b59f523
--- /dev/null
+++ b/configs/platform-mipsel/patches/barebox-2021.06.0/0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
@@ -0,0 +1,99 @@
+From 9af92b9cd64cb4a2df8ad03685e38fedf4ca78b4 Mon Sep 17 00:00:00 2001
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Wed, 21 Aug 2024 15:02:02 +0200
+Subject: [PATCH 1/2] MIPS: dts: add /chosen/stdout-path where it is missing
+
+A number of MIPS boards don't have a stdout-path set and instead rely on
+CONFIG_CONSOLE_ACTIVATE_ALL/FIRST to enable a console.
+
+This can get problematic if more consoles are added in future, or
+CONFIG_CONSOLE_ACTIVATE_NONE is to be used. So on systems that currently
+have a single console, let's have /chosen/stdout-path point at it.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+---
+ arch/mips/dts/black-swift.dts   | 4 ++++
+ arch/mips/dts/dlink-dir-320.dts | 4 ++++
+ arch/mips/dts/img-ci20.dts      | 4 ++++
+ arch/mips/dts/loongson-ls1b.dts | 4 ++++
+ arch/mips/dts/rzx50.dts         | 4 ++++
+ 5 files changed, 20 insertions(+)
+
+diff --git a/arch/mips/dts/black-swift.dts b/arch/mips/dts/black-swift.dts
+index af817dbfc7e1..6bb26d427f2d 100644
+--- a/arch/mips/dts/black-swift.dts
++++ b/arch/mips/dts/black-swift.dts
+@@ -13,6 +13,10 @@ aliases {
+ 		spiflash = &spiflash;
+ 	};
+ 
++	chosen {
++		stdout-path = &uart;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x00000000 0x4000000>;
+diff --git a/arch/mips/dts/dlink-dir-320.dts b/arch/mips/dts/dlink-dir-320.dts
+index d19c3087d017..beec40f3dcc5 100644
+--- a/arch/mips/dts/dlink-dir-320.dts
++++ b/arch/mips/dts/dlink-dir-320.dts
+@@ -7,6 +7,10 @@ / {
+ 	#address-cells = <1>;
+ 	#size-cells = <1>;
+ 
++	chosen {
++		stdout-path = &serial0;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x00000000 0x2000000>;
+diff --git a/arch/mips/dts/img-ci20.dts b/arch/mips/dts/img-ci20.dts
+index e1d3280c4e11..71038890d977 100644
+--- a/arch/mips/dts/img-ci20.dts
++++ b/arch/mips/dts/img-ci20.dts
+@@ -14,6 +14,10 @@ / {
+ 	model = "MIPS Creator CI20";
+ 	compatible = "img,ci20";
+ 
++	chosen {
++		stdout-path = &uart0;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x0 0x10000000>;
+diff --git a/arch/mips/dts/loongson-ls1b.dts b/arch/mips/dts/loongson-ls1b.dts
+index 89cce5636bcf..30520a34f53b 100644
+--- a/arch/mips/dts/loongson-ls1b.dts
++++ b/arch/mips/dts/loongson-ls1b.dts
+@@ -6,6 +6,10 @@ / {
+ 	model = "Loongson Tech LS1B Demo Board";
+ 	compatible = "loongson,ls1b";
+ 
++	chosen {
++		stdout-path = &serial2;
++	};
++
+ 	oscillator: oscillator {
+ 			#clock-cells = <0>;
+ 			compatible = "fixed-clock";
+diff --git a/arch/mips/dts/rzx50.dts b/arch/mips/dts/rzx50.dts
+index bd3631f7c451..93211a97a59f 100644
+--- a/arch/mips/dts/rzx50.dts
++++ b/arch/mips/dts/rzx50.dts
+@@ -6,6 +6,10 @@ / {
+ 	model = "Ritmix RZX-50";
+ 	compatible = "ritmix,rzx50";
+ 
++	chosen {
++		stdout-path = &serial1;
++	};
++
+ 	memory@0 {
+ 		device_type = "memory";
+ 		reg = <0x00000000 0x4000000>;
+-- 
+2.39.2
+
diff --git a/configs/platform-mipsel/patches/barebox-2021.06.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch b/configs/platform-mipsel/patches/barebox-2021.06.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
new file mode 100644
index 000000000000..074b8c70036a
--- /dev/null
+++ b/configs/platform-mipsel/patches/barebox-2021.06.0/0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
@@ -0,0 +1,35 @@
+From 0da08cd25a0bacfa22cde380d5ead90077b6c7b3 Mon Sep 17 00:00:00 2001
+From: Ahmad Fatoum <a.fatoum@pengutronix.de>
+Date: Wed, 21 Aug 2024 15:12:02 +0200
+Subject: [PATCH 2/2] MIPS: qemu-malta: explicitly set stdout-path
+
+The Malta device tree describes and enables two consoles, but doesn't
+specify which one to use for barebox console.
+
+In configurations with CONFIG_CONSOLE_ACTIVATE_FIRST, it's thus
+dependent on device tree probe order, which console ends up being used
+by barebox.
+
+Fix this by explicitly pointing stdout-path at the first console.
+
+Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
+---
+ arch/mips/dts/qemu-malta.dts | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/mips/dts/qemu-malta.dts b/arch/mips/dts/qemu-malta.dts
+index c2bc03dd4631..6cf7513ff5fa 100644
+--- a/arch/mips/dts/qemu-malta.dts
++++ b/arch/mips/dts/qemu-malta.dts
+@@ -8,6 +8,8 @@ / {
+ 	#size-cells = <1>;
+ 
+ 	chosen {
++		stdout-path = &uart0;
++
+ 		environment {
+ 			compatible = "barebox,environment";
+ 			device-path = &env_nor;
+-- 
+2.39.2
+
diff --git a/configs/platform-mipsel/patches/barebox-2021.06.0/series b/configs/platform-mipsel/patches/barebox-2021.06.0/series
new file mode 100644
index 000000000000..b9b6f404fa41
--- /dev/null
+++ b/configs/platform-mipsel/patches/barebox-2021.06.0/series
@@ -0,0 +1,2 @@
+0001-MIPS-dts-add-chosen-stdout-path-where-it-is-missing.patch
+0002-MIPS-qemu-malta-explicitly-set-stdout-path.patch
-- 
2.39.2




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-22 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22 13:45 [DistroKit] [PATCH 1/3] MIPS(EL): barebox: add /chosen/stdout-path properties for all boards Ahmad Fatoum
2024-08-22 13:45 ` [DistroKit] [PATCH 2/3] MIPS: qemu-run: fix barebox Malta image name Ahmad Fatoum
2024-08-22 13:45 ` [DistroKit] [PATCH 3/3] mipsel: qemu-run: enable emulation of little endian barebox Ahmad Fatoum
2024-08-22 17:26 ` [DistroKit] [PATCH 1/3] MIPS(EL): barebox: add /chosen/stdout-path properties for all boards Oleksij Rempel
2024-08-22 17:39 ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox