From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 22 Aug 2024 15:46:01 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sh88X-00CGRa-2k for lore@lore.pengutronix.de; Thu, 22 Aug 2024 15:46:01 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1sh88X-0001wy-AO; Thu, 22 Aug 2024 15:46:01 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sh88P-0001rp-03; Thu, 22 Aug 2024 15:45:53 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sh88O-002GJh-Id; Thu, 22 Aug 2024 15:45:52 +0200 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1sh88O-00DKOR-1X; Thu, 22 Aug 2024 15:45:52 +0200 From: Ahmad Fatoum To: distrokit@pengutronix.de Date: Thu, 22 Aug 2024 15:45:49 +0200 Message-Id: <20240822134551.3176638-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH 1/3] MIPS(EL): barebox: add /chosen/stdout-path properties for all boards X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ahmad Fatoum , ore@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false 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 --- ...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 +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 +--- + 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 +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 +--- + 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 +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 +--- + 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 +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 +--- + 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