diff mbox

[2/3] tty/serial: of_serial: add support for PXA/MMP uarts

Message ID 54C91E67.2070501@hurleysoftware.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Hurley Jan. 28, 2015, 5:37 p.m. UTC
On 01/27/2015 11:44 AM, Rob Herring wrote:
> On Tue, Jan 27, 2015 at 9:09 AM, Peter Hurley <peter@hurleysoftware.com> wrote:

[...]

>> Maybe Kconfig should warn if they're both built-in or both modules?
> 
> Is there a way to do that?

Well, it's not what I had in mind originally, but the diff below
generates a broken dependencies warning without causing build problems:
	$ scripts/kconfig/mconf Kconfig
	warning: (SERIAL_PXA) selects TTYS_DRIVER_PXA which has unmet direct dependencies (TTY && HAS_IOMEM && !TTYS_DRIVER)

(My original idea was thwarted by the requirement that choice/endchoice
requires prompts).

That said, for PXA, I think we agree splitting out a standalone 8250 platform
driver is the solution.

Regards,
Peter Hurley

--

Comments

Rob Herring (Arm) Jan. 30, 2015, 7:51 p.m. UTC | #1
On Wed, Jan 28, 2015 at 11:37 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
> On 01/27/2015 11:44 AM, Rob Herring wrote:
>> On Tue, Jan 27, 2015 at 9:09 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
>
> [...]
>
>>> Maybe Kconfig should warn if they're both built-in or both modules?
>>
>> Is there a way to do that?
>
> Well, it's not what I had in mind originally, but the diff below
> generates a broken dependencies warning without causing build problems:
>         $ scripts/kconfig/mconf Kconfig
>         warning: (SERIAL_PXA) selects TTYS_DRIVER_PXA which has unmet direct dependencies (TTY && HAS_IOMEM && !TTYS_DRIVER)
>
> (My original idea was thwarted by the requirement that choice/endchoice
> requires prompts).

Okay, but this should be a separate patch. The problem exists with or
without my patch.

> That said, for PXA, I think we agree splitting out a standalone 8250 platform
> driver is the solution.

So after all the discussion, you are okay with the original patch?

Rob

>
> Regards,
> Peter Hurley
>
> --
> diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
> index 0fcbcd2..c367542 100644
> --- a/drivers/tty/serial/8250/Kconfig
> +++ b/drivers/tty/serial/8250/Kconfig
> @@ -6,6 +6,7 @@
>  config SERIAL_8250
>         tristate "8250/16550 and compatible serial support"
>         select SERIAL_CORE
> +       select TTYS_DRIVER
>         ---help---
>           This selects whether you want to include the driver for the standard
>           serial ports.  The standard answer is Y.  People who might say N
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index c79b43c..10c3e27 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -7,6 +7,13 @@ if TTY
>  menu "Serial drivers"
>         depends on HAS_IOMEM
>
> +config TTYS_DRIVER
> +       tristate
> +
> +config TTYS_DRIVER_PXA
> +       tristate
> +       depends on !TTYS_DRIVER
> +
>  config SERIAL_EARLYCON
>         bool
>         help
> @@ -438,6 +445,7 @@ config SERIAL_PXA
>         bool "PXA serial port support"
>         depends on ARCH_PXA || ARCH_MMP
>         select SERIAL_CORE
> +       select TTYS_DRIVER_PXA
>         help
>           If you have a machine based on an Intel XScale PXA2xx CPU you
>           can enable its onboard serial ports by enabling this option.
>
>
Peter Hurley Jan. 30, 2015, 8:24 p.m. UTC | #2
On 01/30/2015 02:51 PM, Rob Herring wrote:
> On Wed, Jan 28, 2015 at 11:37 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
>> On 01/27/2015 11:44 AM, Rob Herring wrote:
>>> On Tue, Jan 27, 2015 at 9:09 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
>>
>> [...]
>>
>>>> Maybe Kconfig should warn if they're both built-in or both modules?
>>>
>>> Is there a way to do that?
>>
>> Well, it's not what I had in mind originally, but the diff below
>> generates a broken dependencies warning without causing build problems:
>>         $ scripts/kconfig/mconf Kconfig
>>         warning: (SERIAL_PXA) selects TTYS_DRIVER_PXA which has unmet direct dependencies (TTY && HAS_IOMEM && !TTYS_DRIVER)
>>
>> (My original idea was thwarted by the requirement that choice/endchoice
>> requires prompts).
> 
> Okay, but this should be a separate patch. The problem exists with or
> without my patch.

Yeah, don't worry about this. The solution of how to deal with multiple
ttyS drivers needs to address this problem.

>> That said, for PXA, I think we agree splitting out a standalone 8250 platform
>> driver is the solution.
> 
> So after all the discussion, you are okay with the original patch?

With a more specific commit log, yes. At a minimum, noting under what
circumstances the 8250 driver replaces the pxa2xx-uart driver. (And maybe
noting that this doesn't break hardware that needs those workarounds in
pxa.c).

Regards,
Peter Hurley
Peter Hurley Feb. 1, 2015, 5:07 p.m. UTC | #3
On 01/30/2015 03:24 PM, Peter Hurley wrote:
> On 01/30/2015 02:51 PM, Rob Herring wrote:
>> On Wed, Jan 28, 2015 at 11:37 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
>>> On 01/27/2015 11:44 AM, Rob Herring wrote:
>> So after all the discussion, you are okay with the original patch?
> 
> With a more specific commit log, yes. At a minimum, noting under what
> circumstances the 8250 driver replaces the pxa2xx-uart driver. (And maybe
> noting that this doesn't break hardware that needs those workarounds in
> pxa.c).

nvm; upstreamed.
diff mbox

Patch

diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 0fcbcd2..c367542 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -6,6 +6,7 @@ 
 config SERIAL_8250
 	tristate "8250/16550 and compatible serial support"
 	select SERIAL_CORE
+	select TTYS_DRIVER
 	---help---
 	  This selects whether you want to include the driver for the standard
 	  serial ports.  The standard answer is Y.  People who might say N
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index c79b43c..10c3e27 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -7,6 +7,13 @@  if TTY
 menu "Serial drivers"
 	depends on HAS_IOMEM
 
+config TTYS_DRIVER
+       tristate
+
+config TTYS_DRIVER_PXA
+       tristate
+       depends on !TTYS_DRIVER
+
 config SERIAL_EARLYCON
 	bool
 	help
@@ -438,6 +445,7 @@  config SERIAL_PXA
 	bool "PXA serial port support"
 	depends on ARCH_PXA || ARCH_MMP
 	select SERIAL_CORE
+	select TTYS_DRIVER_PXA
 	help
 	  If you have a machine based on an Intel XScale PXA2xx CPU you
 	  can enable its onboard serial ports by enabling this option.