* [PATCH] serial: Enable Freescale 16550 workaround on arm
@ 2015-10-02 0:16 Scott Wood
2015-10-02 22:22 ` Arnd Bergmann
2015-10-07 22:31 ` [PATCH v2] " Scott Wood
0 siblings, 2 replies; 6+ messages in thread
From: Scott Wood @ 2015-10-02 0:16 UTC (permalink / raw)
To: linux-arm-kernel
The same serial hardware is present on LS2080A which is arm64, and
LS1021A which is arm32, so don't limit the workaround to PPC.
Unlike PPC which uses arch/powerpc/kernel/legacy_serial.c, the ARM
targets use drivers/tty/serial/of_serial.c, so add the handle_irq
override check there as well.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
drivers/tty/serial/8250/Kconfig | 4 ++--
drivers/tty/serial/of_serial.c | 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index e1de118..5a2ae57 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -274,8 +274,8 @@ config SERIAL_8250_ACORN
config SERIAL_8250_FSL
bool
- depends on SERIAL_8250_CONSOLE && PPC_UDBG_16550
- default PPC
+ depends on SERIAL_8250_CONSOLE
+ default PPC || ARM || ARM64
config SERIAL_8250_DW
tristate "Support for Synopsys DesignWare 8250 quirks"
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 6823df9..9cd0061 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -150,6 +150,12 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
break;
}
+#ifdef CONFIG_SERIAL_8250_FSL
+ if (of_device_is_compatible(np, "fsl,ns16550") ||
+ of_device_is_compatible(np, "fsl,16550-FIFO64"))
+ port->handle_irq = fsl8250_handle_irq;
+#endif
+
return 0;
out:
if (info->clk)
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] serial: Enable Freescale 16550 workaround on arm
2015-10-02 0:16 [PATCH] serial: Enable Freescale 16550 workaround on arm Scott Wood
@ 2015-10-02 22:22 ` Arnd Bergmann
2015-10-02 23:49 ` Scott Wood
2015-10-07 22:31 ` [PATCH v2] " Scott Wood
1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2015-10-02 22:22 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 01 October 2015 19:16:16 Scott Wood wrote:
>
> +#ifdef CONFIG_SERIAL_8250_FSL
> + if (of_device_is_compatible(np, "fsl,ns16550") ||
> + of_device_is_compatible(np, "fsl,16550-FIFO64"))
> + port->handle_irq = fsl8250_handle_irq;
> +#endif
> +
>
Can you change this to use
if (IS_ENABLED(CONFIG_SERIAL_8250_FSL)) && ...
The resulting code will be the same, it just get a little easier
on the eye.
Other than that, I wonder if we should do this completely differently
and have the respective entries in of_platform_serial_table[] with
an appropriate PORT_* constant to handle the freescale case.
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] serial: Enable Freescale 16550 workaround on arm
2015-10-02 22:22 ` Arnd Bergmann
@ 2015-10-02 23:49 ` Scott Wood
2015-10-06 13:09 ` Arnd Bergmann
0 siblings, 1 reply; 6+ messages in thread
From: Scott Wood @ 2015-10-02 23:49 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 2015-10-03 at 00:22 +0200, Arnd Bergmann wrote:
> On Thursday 01 October 2015 19:16:16 Scott Wood wrote:
> >
> > +#ifdef CONFIG_SERIAL_8250_FSL
> > + if (of_device_is_compatible(np, "fsl,ns16550") ||
> > + of_device_is_compatible(np, "fsl,16550-FIFO64"))
> > + port->handle_irq = fsl8250_handle_irq;
> > +#endif
> > +
> >
>
> Can you change this to use
>
> if (IS_ENABLED(CONFIG_SERIAL_8250_FSL)) && ...
>
> The resulting code will be the same, it just get a little easier
> on the eye.
Sure.
> Other than that, I wonder if we should do this completely differently
> and have the respective entries in of_platform_serial_table[] with
> an appropriate PORT_* constant to handle the freescale case.
I'd considered that, but it seemed like it would be more complicated, with no
real benefit. We'd need to add a new PORT for the non-fifo64 case, and it
would need to otherwise behave like PORT_16550A. There's no room for an
extra 8250-style PORT number unless we break PORT_MAX_8250 or renumber the
"ARM specific type numbers", and for some reason these PORT numbers are
defined in uapi (even if there's some legacy reason for that, do we really
need to keep adding to it?). We'd also need to make sure that autoconfig()
doesn't overwrite the new PORT number (or ignore the fact that it gets
overwritten after using it to substitute handle_irq). It would also increase
the discrepancy between how the same issue is handled on ARM versus PPC (with
the latter using arch/powerpc/kernel/legacy_serial.c which doesn't supply
PORT numbers).
The above check wouldn't go away, as it's not something currently addressed
by struct serial8250_config (unless you're also asking for a new flag for
that struct, in which case it would merely be moved elsewhere); it would just
require a bunch of changes elsewhere to support changing it from a simple
compatible check to a PORT check.
-Scott
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] serial: Enable Freescale 16550 workaround on arm
2015-10-02 23:49 ` Scott Wood
@ 2015-10-06 13:09 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-10-06 13:09 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 02 October 2015 18:49:24 Scott Wood wrote:
> > Other than that, I wonder if we should do this completely differently
> > and have the respective entries in of_platform_serial_table[] with
> > an appropriate PORT_* constant to handle the freescale case.
>
> I'd considered that, but it seemed like it would be more complicated, with no
> real benefit. We'd need to add a new PORT for the non-fifo64 case, and it
> would need to otherwise behave like PORT_16550A. There's no room for an
> extra 8250-style PORT number unless we break PORT_MAX_8250 or renumber the
> "ARM specific type numbers", and for some reason these PORT numbers are
> defined in uapi (even if there's some legacy reason for that, do we really
> need to keep adding to it?). We'd also need to make sure that autoconfig()
> doesn't overwrite the new PORT number (or ignore the fact that it gets
> overwritten after using it to substitute handle_irq). It would also increase
> the discrepancy between how the same issue is handled on ARM versus PPC (with
> the latter using arch/powerpc/kernel/legacy_serial.c which doesn't supply
> PORT numbers).
>
> The above check wouldn't go away, as it's not something currently addressed
> by struct serial8250_config (unless you're also asking for a new flag for
> that struct, in which case it would merely be moved elsewhere); it would just
> require a bunch of changes elsewhere to support changing it from a simple
> compatible check to a PORT check.
Ok, let's keep your version then, unless someone has a better idea.
FWIW, I think we should just move of_serial.c to drivers/tty/serial/8250/
now and remove the nwp specific bits.
Looking for a volunteer to actually do that work ;-)
Arnd
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] serial: Enable Freescale 16550 workaround on arm
2015-10-02 0:16 [PATCH] serial: Enable Freescale 16550 workaround on arm Scott Wood
2015-10-02 22:22 ` Arnd Bergmann
@ 2015-10-07 22:31 ` Scott Wood
2015-10-08 7:45 ` Arnd Bergmann
1 sibling, 1 reply; 6+ messages in thread
From: Scott Wood @ 2015-10-07 22:31 UTC (permalink / raw)
To: linux-arm-kernel
The same serial hardware is present on LS2080A which is arm64, and
LS1021A which is arm32, so don't limit the workaround to PPC.
Unlike PPC which uses arch/powerpc/kernel/legacy_serial.c, the ARM
targets use drivers/tty/serial/of_serial.c, so add the handle_irq
override check there as well.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
v2: Use IS_ENABLED rather than ifdef
drivers/tty/serial/8250/Kconfig | 4 ++--
drivers/tty/serial/of_serial.c | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index e1de118..5a2ae57 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -274,8 +274,8 @@ config SERIAL_8250_ACORN
config SERIAL_8250_FSL
bool
- depends on SERIAL_8250_CONSOLE && PPC_UDBG_16550
- default PPC
+ depends on SERIAL_8250_CONSOLE
+ default PPC || ARM || ARM64
config SERIAL_8250_DW
tristate "Support for Synopsys DesignWare 8250 quirks"
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 6823df9..fe241bd 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -150,6 +150,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
break;
}
+ if (IS_ENABLED(CONFIG_SERIAL_8250_FSL) &&
+ (of_device_is_compatible(np, "fsl,ns16550") ||
+ of_device_is_compatible(np, "fsl,16550-FIFO64")))
+ port->handle_irq = fsl8250_handle_irq;
+
return 0;
out:
if (info->clk)
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] serial: Enable Freescale 16550 workaround on arm
2015-10-07 22:31 ` [PATCH v2] " Scott Wood
@ 2015-10-08 7:45 ` Arnd Bergmann
0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2015-10-08 7:45 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 07 October 2015 17:31:21 Scott Wood wrote:
> The same serial hardware is present on LS2080A which is arm64, and
> LS1021A which is arm32, so don't limit the workaround to PPC.
>
> Unlike PPC which uses arch/powerpc/kernel/legacy_serial.c, the ARM
> targets use drivers/tty/serial/of_serial.c, so add the handle_irq
> override check there as well.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-08 7:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02 0:16 [PATCH] serial: Enable Freescale 16550 workaround on arm Scott Wood
2015-10-02 22:22 ` Arnd Bergmann
2015-10-02 23:49 ` Scott Wood
2015-10-06 13:09 ` Arnd Bergmann
2015-10-07 22:31 ` [PATCH v2] " Scott Wood
2015-10-08 7:45 ` Arnd Bergmann
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).