mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: cadence: support console= and earlycon= fixups
@ 2025-07-14  7:12 Ahmad Fatoum
  2025-07-14  7:12 ` [PATCH 2/2] ARM: zynq: drop the board-specific environment Ahmad Fatoum
  2025-07-15  6:25 ` [PATCH 1/2] serial: cadence: support console= and earlycon= fixups Gwenhael Goavec-Merou
  0 siblings, 2 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2025-07-14  7:12 UTC (permalink / raw)
  To: barebox; +Cc: Gwenhael Goavec-Merou, Ahmad Fatoum

If we tell the serial driver core about the names of the Linux
console and earlycon driver, barebox can fix up the console= and
earlycon= arguments without having to hardcode Linux boot arguments.

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 drivers/serial/serial_cadence.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/serial/serial_cadence.c b/drivers/serial/serial_cadence.c
index bda3269106c7..52b488e80f0a 100644
--- a/drivers/serial/serial_cadence.c
+++ b/drivers/serial/serial_cadence.c
@@ -212,6 +212,9 @@ static int cadence_serial_probe(struct device *dev)
 	cdev->getc = cadence_serial_getc;
 	cdev->flush = cadence_serial_flush;
 	cdev->setbrg = priv->clk ? cadence_serial_setbaudrate : NULL;
+	cdev->linux_console_name = "ttyPS";
+	cdev->linux_earlycon_name = "cdns";
+	cdev->phys_base = priv->regs;
 
 	cadence_serial_init_port(cdev);
 
-- 
2.39.5




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

* [PATCH 2/2] ARM: zynq: drop the board-specific environment
  2025-07-14  7:12 [PATCH 1/2] serial: cadence: support console= and earlycon= fixups Ahmad Fatoum
@ 2025-07-14  7:12 ` Ahmad Fatoum
  2025-07-15  6:25   ` Gwenhael Goavec-Merou
  2025-07-15  6:25 ` [PATCH 1/2] serial: cadence: support console= and earlycon= fixups Gwenhael Goavec-Merou
  1 sibling, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2025-07-14  7:12 UTC (permalink / raw)
  To: barebox; +Cc: Gwenhael Goavec-Merou, Ahmad Fatoum

The Linux device tree hardcodes per DT alias (since 2015) the
stdout-path to uart1, not uart0 and thus the Linux TTY device is called
ttyPS0 and not ttyPS1.

With previous changes to the serial driver to fix up the console device,
hardcoding this option is no longer needed, so drop it along with its
environment overlay that's now empty.

Reported-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console | 1 -
 arch/arm/configs/zynq_defconfig                              | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
 delete mode 100644 arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console

diff --git a/arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console b/arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console
deleted file mode 100644
index 6c9f9dabcf1b..000000000000
--- a/arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyPS1,115200
diff --git a/arch/arm/configs/zynq_defconfig b/arch/arm/configs/zynq_defconfig
index 1a1378d3e079..752068f69196 100644
--- a/arch/arm/configs/zynq_defconfig
+++ b/arch/arm/configs/zynq_defconfig
@@ -17,7 +17,7 @@ CONFIG_BOOTM_VERBOSE=y
 CONFIG_BOOTM_INITRD=y
 CONFIG_BOOTM_OFTREE=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/avnet-zedboard/env"
+CONFIG_DEFAULT_ENVIRONMENT_PATH=""
 CONFIG_DEBUG_LL=y
 CONFIG_LONGHELP=y
 CONFIG_CMD_MEMINFO=y
-- 
2.39.5




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

* Re: [PATCH 1/2] serial: cadence: support console= and earlycon= fixups
  2025-07-14  7:12 [PATCH 1/2] serial: cadence: support console= and earlycon= fixups Ahmad Fatoum
  2025-07-14  7:12 ` [PATCH 2/2] ARM: zynq: drop the board-specific environment Ahmad Fatoum
@ 2025-07-15  6:25 ` Gwenhael Goavec-Merou
  1 sibling, 0 replies; 4+ messages in thread
From: Gwenhael Goavec-Merou @ 2025-07-15  6:25 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox; +Cc: Gwenhael Goavec-Merou

Hi,

Le 14/07/2025 à 9:12 AM, Ahmad Fatoum a écrit :
> If we tell the serial driver core about the names of the Linux
> console and earlycon driver, barebox can fix up the console= and
> earlycon= arguments without having to hardcode Linux boot arguments.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
> ---
>   drivers/serial/serial_cadence.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/serial/serial_cadence.c b/drivers/serial/serial_cadence.c
> index bda3269106c7..52b488e80f0a 100644
> --- a/drivers/serial/serial_cadence.c
> +++ b/drivers/serial/serial_cadence.c
> @@ -212,6 +212,9 @@ static int cadence_serial_probe(struct device *dev)
>   	cdev->getc = cadence_serial_getc;
>   	cdev->flush = cadence_serial_flush;
>   	cdev->setbrg = priv->clk ? cadence_serial_setbaudrate : NULL;
> +	cdev->linux_console_name = "ttyPS";
> +	cdev->linux_earlycon_name = "cdns";
> +	cdev->phys_base = priv->regs;
>   
>   	cadence_serial_init_port(cdev);
>   
Tested-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>

Thanks

Gwen



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

* Re: [PATCH 2/2] ARM: zynq: drop the board-specific environment
  2025-07-14  7:12 ` [PATCH 2/2] ARM: zynq: drop the board-specific environment Ahmad Fatoum
@ 2025-07-15  6:25   ` Gwenhael Goavec-Merou
  0 siblings, 0 replies; 4+ messages in thread
From: Gwenhael Goavec-Merou @ 2025-07-15  6:25 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox; +Cc: Gwenhael Goavec-Merou

Hi,

Le 14/07/2025 à 9:12 AM, Ahmad Fatoum a écrit :
> The Linux device tree hardcodes per DT alias (since 2015) the
> stdout-path to uart1, not uart0 and thus the Linux TTY device is called
> ttyPS0 and not ttyPS1.
> 
> With previous changes to the serial driver to fix up the console device,
> hardcoding this option is no longer needed, so drop it along with its
> environment overlay that's now empty.
> 
> Reported-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
> ---
>   arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console | 1 -
>   arch/arm/configs/zynq_defconfig                              | 2 +-
>   2 files changed, 1 insertion(+), 2 deletions(-)
>   delete mode 100644 arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console
> 
> diff --git a/arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console b/arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console
> deleted file mode 100644
> index 6c9f9dabcf1b..000000000000
> --- a/arch/arm/boards/avnet-zedboard/env/nv/linux.bootargs.console
> +++ /dev/null
> @@ -1 +0,0 @@
> -console=ttyPS1,115200
> diff --git a/arch/arm/configs/zynq_defconfig b/arch/arm/configs/zynq_defconfig
> index 1a1378d3e079..752068f69196 100644
> --- a/arch/arm/configs/zynq_defconfig
> +++ b/arch/arm/configs/zynq_defconfig
> @@ -17,7 +17,7 @@ CONFIG_BOOTM_VERBOSE=y
>   CONFIG_BOOTM_INITRD=y
>   CONFIG_BOOTM_OFTREE=y
>   CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
> -CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/avnet-zedboard/env"
> +CONFIG_DEFAULT_ENVIRONMENT_PATH=""
>   CONFIG_DEBUG_LL=y
>   CONFIG_LONGHELP=y
>   CONFIG_CMD_MEMINFO=y
Tested-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>

Thanks

Gwen



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

end of thread, other threads:[~2025-07-15  6:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-14  7:12 [PATCH 1/2] serial: cadence: support console= and earlycon= fixups Ahmad Fatoum
2025-07-14  7:12 ` [PATCH 2/2] ARM: zynq: drop the board-specific environment Ahmad Fatoum
2025-07-15  6:25   ` Gwenhael Goavec-Merou
2025-07-15  6:25 ` [PATCH 1/2] serial: cadence: support console= and earlycon= fixups Gwenhael Goavec-Merou

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