* [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon
@ 2024-07-06 10:18 Jisheng Zhang
2024-07-06 22:33 ` Yixun Lan
2024-07-10 12:53 ` Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Jisheng Zhang @ 2024-07-06 10:18 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby; +Cc: linux-kernel, linux-serial, linux-riscv
There are two other drivers that bind to "mrvl,mmp-uart": the 8250_of
and the 8250_pxa. The previous one is generic and the latter is binded
to ARCH_PXA || ARCH_MMP. Now we may have pxa programming compatible
HW to support, making use of the generic 8250_of seems a good idea.
However, there's no earlycon support if we go with this solution. So
move the mmp|pxa-uart earlycon code to core 8250_early.c.
At the same, add xscale earlycon support too, only build test since
I have no xscale machine any more.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/tty/serial/8250/8250_early.c | 11 +++++++++++
drivers/tty/serial/8250/8250_pxa.c | 16 ----------------
2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index e3f482fd3de4..6176083d0341 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -171,6 +171,17 @@ OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
OF_EARLYCON_DECLARE(uart, "nvidia,tegra20-uart", early_serial8250_setup);
OF_EARLYCON_DECLARE(uart, "snps,dw-apb-uart", early_serial8250_setup);
+static int __init early_serial8250_rs2_setup(struct earlycon_device *device,
+ const char *options)
+{
+ device->port.regshift = 2;
+
+ return early_serial8250_setup(device, options);
+}
+OF_EARLYCON_DECLARE(uart, "intel,xscale-uart", early_serial8250_rs2_setup);
+OF_EARLYCON_DECLARE(uart, "mrvl,mmp-uart", early_serial8250_rs2_setup);
+OF_EARLYCON_DECLARE(uart, "mrvl,pxa-uart", early_serial8250_rs2_setup);
+
#ifdef CONFIG_SERIAL_8250_OMAP
static int __init early_omap8250_setup(struct earlycon_device *device,
diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c
index ba96fa913e7f..b5d937f6f3f9 100644
--- a/drivers/tty/serial/8250/8250_pxa.c
+++ b/drivers/tty/serial/8250/8250_pxa.c
@@ -165,22 +165,6 @@ static struct platform_driver serial_pxa_driver = {
module_platform_driver(serial_pxa_driver);
-#ifdef CONFIG_SERIAL_8250_CONSOLE
-static int __init early_serial_pxa_setup(struct earlycon_device *device,
- const char *options)
-{
- struct uart_port *port = &device->port;
-
- if (!(device->port.membase || device->port.iobase))
- return -ENODEV;
-
- port->regshift = 2;
- return early_serial8250_setup(device, NULL);
-}
-OF_EARLYCON_DECLARE(early_pxa, "mrvl,pxa-uart", early_serial_pxa_setup);
-OF_EARLYCON_DECLARE(mmp, "mrvl,mmp-uart", early_serial_pxa_setup);
-#endif
-
MODULE_AUTHOR("Sergei Ianovich");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:pxa2xx-uart");
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon
2024-07-06 10:18 [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon Jisheng Zhang
@ 2024-07-06 22:33 ` Yixun Lan
2024-07-08 11:51 ` Jisheng Zhang
2024-07-10 12:53 ` Greg Kroah-Hartman
1 sibling, 1 reply; 4+ messages in thread
From: Yixun Lan @ 2024-07-06 22:33 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-kernel, linux-serial,
linux-riscv
Hi
On 18:18 Sat 06 Jul , Jisheng Zhang wrote:
> There are two other drivers that bind to "mrvl,mmp-uart": the 8250_of
> and the 8250_pxa. The previous one is generic and the latter is binded
> to ARCH_PXA || ARCH_MMP. Now we may have pxa programming compatible
> HW to support, making use of the generic 8250_of seems a good idea.
> However, there's no earlycon support if we go with this solution. So
> move the mmp|pxa-uart earlycon code to core 8250_early.c.
>
> At the same, add xscale earlycon support too, only build test since
> I have no xscale machine any more.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> drivers/tty/serial/8250/8250_early.c | 11 +++++++++++
> drivers/tty/serial/8250/8250_pxa.c | 16 ----------------
> 2 files changed, 11 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
> index e3f482fd3de4..6176083d0341 100644
> --- a/drivers/tty/serial/8250/8250_early.c
> +++ b/drivers/tty/serial/8250/8250_early.c
> @@ -171,6 +171,17 @@ OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
> OF_EARLYCON_DECLARE(uart, "nvidia,tegra20-uart", early_serial8250_setup);
> OF_EARLYCON_DECLARE(uart, "snps,dw-apb-uart", early_serial8250_setup);
>
> +static int __init early_serial8250_rs2_setup(struct earlycon_device *device,
> + const char *options)
> +{
> + device->port.regshift = 2;
just wondering if possible to introduce a generic earlycon sub option? so kernel
can parse reg-shift from command line parameter instead of hardcoding here,
which would benefit more drivers (potentially without adding more OF_EARLYCON_DECLAREs..)
I mean something like this:
Documentation/admin-guide/kernel-parameters.txt
uart[8250],mmio32,<addr>[,options[,reg-shift=0,1,2,4 ..]]
> +
> + return early_serial8250_setup(device, options);
> +}
> +OF_EARLYCON_DECLARE(uart, "intel,xscale-uart", early_serial8250_rs2_setup);
> +OF_EARLYCON_DECLARE(uart, "mrvl,mmp-uart", early_serial8250_rs2_setup);
> +OF_EARLYCON_DECLARE(uart, "mrvl,pxa-uart", early_serial8250_rs2_setup);
> +
> #ifdef CONFIG_SERIAL_8250_OMAP
>
> static int __init early_omap8250_setup(struct earlycon_device *device,
> diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c
> index ba96fa913e7f..b5d937f6f3f9 100644
> --- a/drivers/tty/serial/8250/8250_pxa.c
> +++ b/drivers/tty/serial/8250/8250_pxa.c
> @@ -165,22 +165,6 @@ static struct platform_driver serial_pxa_driver = {
>
> module_platform_driver(serial_pxa_driver);
>
> -#ifdef CONFIG_SERIAL_8250_CONSOLE
> -static int __init early_serial_pxa_setup(struct earlycon_device *device,
> - const char *options)
> -{
> - struct uart_port *port = &device->port;
> -
> - if (!(device->port.membase || device->port.iobase))
> - return -ENODEV;
> -
> - port->regshift = 2;
> - return early_serial8250_setup(device, NULL);
> -}
> -OF_EARLYCON_DECLARE(early_pxa, "mrvl,pxa-uart", early_serial_pxa_setup);
> -OF_EARLYCON_DECLARE(mmp, "mrvl,mmp-uart", early_serial_pxa_setup);
> -#endif
> -
> MODULE_AUTHOR("Sergei Ianovich");
> MODULE_LICENSE("GPL");
> MODULE_ALIAS("platform:pxa2xx-uart");
> --
> 2.43.0
>
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon
2024-07-06 22:33 ` Yixun Lan
@ 2024-07-08 11:51 ` Jisheng Zhang
0 siblings, 0 replies; 4+ messages in thread
From: Jisheng Zhang @ 2024-07-08 11:51 UTC (permalink / raw)
To: Yixun Lan
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-kernel, linux-serial,
linux-riscv
On Sat, Jul 06, 2024 at 10:33:23PM +0000, Yixun Lan wrote:
> Hi
> On 18:18 Sat 06 Jul , Jisheng Zhang wrote:
> > There are two other drivers that bind to "mrvl,mmp-uart": the 8250_of
> > and the 8250_pxa. The previous one is generic and the latter is binded
> > to ARCH_PXA || ARCH_MMP. Now we may have pxa programming compatible
> > HW to support, making use of the generic 8250_of seems a good idea.
> > However, there's no earlycon support if we go with this solution. So
> > move the mmp|pxa-uart earlycon code to core 8250_early.c.
> >
> > At the same, add xscale earlycon support too, only build test since
> > I have no xscale machine any more.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> > drivers/tty/serial/8250/8250_early.c | 11 +++++++++++
> > drivers/tty/serial/8250/8250_pxa.c | 16 ----------------
> > 2 files changed, 11 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
> > index e3f482fd3de4..6176083d0341 100644
> > --- a/drivers/tty/serial/8250/8250_early.c
> > +++ b/drivers/tty/serial/8250/8250_early.c
> > @@ -171,6 +171,17 @@ OF_EARLYCON_DECLARE(ns16550a, "ns16550a", early_serial8250_setup);
> > OF_EARLYCON_DECLARE(uart, "nvidia,tegra20-uart", early_serial8250_setup);
> > OF_EARLYCON_DECLARE(uart, "snps,dw-apb-uart", early_serial8250_setup);
> >
> > +static int __init early_serial8250_rs2_setup(struct earlycon_device *device,
> > + const char *options)
> > +{
> > + device->port.regshift = 2;
> just wondering if possible to introduce a generic earlycon sub option? so kernel
the 8250 ealycon can parse reg-shift from dt too, so no sub option is
needed. The reason I hardcoded here is: pxa-uart and xscale-uart doesn't
mandate "reg-shift" property in the binding, while I did see mmp-uart
mentions "reg-shift" is required in the DT binding.
> can parse reg-shift from command line parameter instead of hardcoding here,
> which would benefit more drivers (potentially without adding more OF_EARLYCON_DECLAREs..)
>
> I mean something like this:
> Documentation/admin-guide/kernel-parameters.txt
> uart[8250],mmio32,<addr>[,options[,reg-shift=0,1,2,4 ..]]
>
> > +
> > + return early_serial8250_setup(device, options);
> > +}
> > +OF_EARLYCON_DECLARE(uart, "intel,xscale-uart", early_serial8250_rs2_setup);
> > +OF_EARLYCON_DECLARE(uart, "mrvl,mmp-uart", early_serial8250_rs2_setup);
> > +OF_EARLYCON_DECLARE(uart, "mrvl,pxa-uart", early_serial8250_rs2_setup);
> > +
> > #ifdef CONFIG_SERIAL_8250_OMAP
> >
> > static int __init early_omap8250_setup(struct earlycon_device *device,
> > diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c
> > index ba96fa913e7f..b5d937f6f3f9 100644
> > --- a/drivers/tty/serial/8250/8250_pxa.c
> > +++ b/drivers/tty/serial/8250/8250_pxa.c
> > @@ -165,22 +165,6 @@ static struct platform_driver serial_pxa_driver = {
> >
> > module_platform_driver(serial_pxa_driver);
> >
> > -#ifdef CONFIG_SERIAL_8250_CONSOLE
> > -static int __init early_serial_pxa_setup(struct earlycon_device *device,
> > - const char *options)
> > -{
> > - struct uart_port *port = &device->port;
> > -
> > - if (!(device->port.membase || device->port.iobase))
> > - return -ENODEV;
> > -
> > - port->regshift = 2;
> > - return early_serial8250_setup(device, NULL);
> > -}
> > -OF_EARLYCON_DECLARE(early_pxa, "mrvl,pxa-uart", early_serial_pxa_setup);
> > -OF_EARLYCON_DECLARE(mmp, "mrvl,mmp-uart", early_serial_pxa_setup);
> > -#endif
> > -
> > MODULE_AUTHOR("Sergei Ianovich");
> > MODULE_LICENSE("GPL");
> > MODULE_ALIAS("platform:pxa2xx-uart");
> > --
> > 2.43.0
> >
>
> --
> Yixun Lan (dlan)
> Gentoo Linux Developer
> GPG Key ID AABEFD55
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon
2024-07-06 10:18 [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon Jisheng Zhang
2024-07-06 22:33 ` Yixun Lan
@ 2024-07-10 12:53 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-07-10 12:53 UTC (permalink / raw)
To: Jisheng Zhang; +Cc: Jiri Slaby, linux-kernel, linux-serial, linux-riscv
On Sat, Jul 06, 2024 at 06:18:56PM +0800, Jisheng Zhang wrote:
> There are two other drivers that bind to "mrvl,mmp-uart": the 8250_of
> and the 8250_pxa. The previous one is generic and the latter is binded
> to ARCH_PXA || ARCH_MMP. Now we may have pxa programming compatible
> HW to support, making use of the generic 8250_of seems a good idea.
> However, there's no earlycon support if we go with this solution. So
> move the mmp|pxa-uart earlycon code to core 8250_early.c.
>
> At the same, add xscale earlycon support too, only build test since
> I have no xscale machine any more.
When you have an "and" in the changelog, that means it should be 2
patches. Please split this up into one that does the move, and one that
adds the new entry.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-10 12:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-06 10:18 [PATCH] serial: 8250: move mmp|pxa uart earlycon code and add xscale earlycon Jisheng Zhang
2024-07-06 22:33 ` Yixun Lan
2024-07-08 11:51 ` Jisheng Zhang
2024-07-10 12:53 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).