All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc
@ 2013-01-25 10:50 John Crispin
  2013-01-25 10:50 ` [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF John Crispin
  2013-01-25 11:40 ` [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc Sergei Shtylyov
  0 siblings, 2 replies; 7+ messages in thread
From: John Crispin @ 2013-01-25 10:50 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-serial, linux-mips, John Crispin

The MIPS based Ralink WiSoC platform has 1 or more 8250 compatible serial cores.
To make them work we require the same quirks that are used by AU1x00.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/tty/serial/8250/8250.c  |    6 +++---
 drivers/tty/serial/8250/Kconfig |    8 ++++++++
 include/linux/serial_core.h     |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index f932043..b727779 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -324,9 +324,9 @@ static void default_serial_dl_write(struct uart_8250_port *up, int value)
 	serial_out(up, UART_DLM, value >> 8 & 0xff);
 }
 
-#ifdef CONFIG_MIPS_ALCHEMY
+#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
 
-/* Au1x00 UART hardware has a weird register layout */
+/* Au1x00 RT288x UART hardware has a weird register layout */
 static const u8 au_io_in_map[] = {
 	[UART_RX]  = 0,
 	[UART_IER] = 2,
@@ -506,7 +506,7 @@ static void set_io_from_upio(struct uart_port *p)
 		break;
 #endif
 
-#ifdef CONFIG_MIPS_ALCHEMY
+#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
 	case UPIO_AU:
 		p->serial_in = au_serial_in;
 		p->serial_out = au_serial_out;
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index c31133a..c583799 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -249,6 +249,14 @@ config SERIAL_8250_ACORN
 	  system, say Y to this option.  The driver can handle 1, 2, or 3 port
 	  cards.  If unsure, say N.
 
+config SERIAL_8250_RT288X
+	bool "Ralink RT288x/RT305x/RT3662/RT3883 serial port support"
+	depends on SERIAL_8250 != n && (SOC_RT288X || SOC_RT305X || SOC_RT3883)
+	help
+	  If you have a Ralink RT288x/RT305x SoC based board and want to use the
+	  serial port, say Y to this option. The driver can handle up to 2 serial
+	  ports. If unsure, say N.
+
 config SERIAL_8250_RM9K
 	bool "Support for MIPS RM9xxx integrated serial port"
 	depends on SERIAL_8250 != n && SERIAL_RM9000
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c6690a2..0b428d6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -134,7 +134,7 @@ struct uart_port {
 #define UPIO_HUB6		(1)
 #define UPIO_MEM		(2)
 #define UPIO_MEM32		(3)
-#define UPIO_AU			(4)			/* Au1x00 type IO */
+#define UPIO_AU			(4)			/* Au1x00 and RT288x type IO */
 #define UPIO_TSI		(5)			/* Tsi108/109 type IO */
 #define UPIO_RM9000		(6)			/* RM9000 type IO */
 
-- 
1.7.10.4

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

* [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF
  2013-01-25 10:50 [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc John Crispin
@ 2013-01-25 10:50 ` John Crispin
  2013-01-25 11:44   ` Sergei Shtylyov
  2013-03-20 19:59   ` John Crispin
  2013-01-25 11:40 ` [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc Sergei Shtylyov
  1 sibling, 2 replies; 7+ messages in thread
From: John Crispin @ 2013-01-25 10:50 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-serial, linux-mips, John Crispin

In order to make serial_8250 loadable via OF on Au1x00 and Ralink WiSoC we need
to default the iotype to UPIO_AU.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 drivers/tty/serial/of_serial.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index e7cae1c..72e9743 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -97,7 +97,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
 		port->regshift = prop;
 
 	port->irq = irq_of_parse_and_map(np, 0);
+#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
+	port->iotype = UPIO_AU;
+#else
 	port->iotype = UPIO_MEM;
+#endif
 	if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
 		switch (prop) {
 		case 1:
-- 
1.7.10.4

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

* Re: [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc
  2013-01-25 10:50 [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc John Crispin
  2013-01-25 10:50 ` [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF John Crispin
@ 2013-01-25 11:40 ` Sergei Shtylyov
  1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2013-01-25 11:40 UTC (permalink / raw)
  To: John Crispin; +Cc: Alan Cox, linux-serial, linux-mips

Hello.

On 25-01-2013 14:50, John Crispin wrote:

> The MIPS based Ralink WiSoC platform has 1 or more 8250 compatible serial cores.
> To make them work we require the same quirks that are used by AU1x00.

> Signed-off-by: John Crispin <blogic@openwrt.org>
> ---
>   drivers/tty/serial/8250/8250.c  |    6 +++---
>   drivers/tty/serial/8250/Kconfig |    8 ++++++++
>   include/linux/serial_core.h     |    2 +-
>   3 files changed, 12 insertions(+), 4 deletions(-)

> diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
> index f932043..b727779 100644
> --- a/drivers/tty/serial/8250/8250.c
> +++ b/drivers/tty/serial/8250/8250.c
> @@ -324,9 +324,9 @@ static void default_serial_dl_write(struct uart_8250_port *up, int value)
>   	serial_out(up, UART_DLM, value >> 8 & 0xff);
>   }
>
> -#ifdef CONFIG_MIPS_ALCHEMY
> +#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
>
> -/* Au1x00 UART hardware has a weird register layout */
> +/* Au1x00 RT288x UART hardware has a weird register layout */
             ^
    You need either comma or slash or "and" between those...

WBR, Sergei

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

* Re: [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF
  2013-01-25 10:50 ` [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF John Crispin
@ 2013-01-25 11:44   ` Sergei Shtylyov
  2013-01-25 12:40     ` Greg KH
  2013-03-20 19:59   ` John Crispin
  1 sibling, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2013-01-25 11:44 UTC (permalink / raw)
  To: John Crispin; +Cc: Alan Cox, linux-serial, linux-mips

Hello.

On 25-01-2013 14:50, John Crispin wrote:

> In order to make serial_8250 loadable via OF on Au1x00 and Ralink WiSoC we need
> to default the iotype to UPIO_AU.

    Alan Cox no longer works on Linux, Greg KH looks after the serial drivers 
snow.

> Signed-off-by: John Crispin <blogic@openwrt.org>

WBR, Sergei

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

* Re: [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF
  2013-01-25 11:44   ` Sergei Shtylyov
@ 2013-01-25 12:40     ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2013-01-25 12:40 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: John Crispin, Alan Cox, linux-serial, linux-mips

On Fri, Jan 25, 2013 at 03:44:33PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 25-01-2013 14:50, John Crispin wrote:
> 
> >In order to make serial_8250 loadable via OF on Au1x00 and Ralink WiSoC we need
> >to default the iotype to UPIO_AU.
> 
>    Alan Cox no longer works on Linux, Greg KH looks after the serial
> drivers snow.

It's ok, I'm on the mailing list and pick this stuff up, no need to
resend.

greg k-h

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

* Re: [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF
  2013-01-25 10:50 ` [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF John Crispin
  2013-01-25 11:44   ` Sergei Shtylyov
@ 2013-03-20 19:59   ` John Crispin
  2013-03-21 16:59     ` John Crispin
  1 sibling, 1 reply; 7+ messages in thread
From: John Crispin @ 2013-03-20 19:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-serial

On 25/01/13 11:50, John Crispin wrote:
> In order to make serial_8250 loadable via OF on Au1x00 and Ralink WiSoC we need
> to default the iotype to UPIO_AU.
>
> Signed-off-by: John Crispin<blogic@openwrt.org>
> ---
>   drivers/tty/serial/of_serial.c |    4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
> index e7cae1c..72e9743 100644
> --- a/drivers/tty/serial/of_serial.c
> +++ b/drivers/tty/serial/of_serial.c
> @@ -97,7 +97,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
>   		port->regshift = prop;
>
>   	port->irq = irq_of_parse_and_map(np, 0);
> +#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
> +	port->iotype = UPIO_AU;
> +#else
>   	port->iotype = UPIO_MEM;
> +#endif
>   	if (of_property_read_u32(np, "reg-io-width",&prop) == 0) {
>   		switch (prop) {
>   		case 1:

Hi Greg,

i have the impression that this patch got lost somewhere on the way to 
linus. I can see the 1/2 got merged with 3.9-rc1. 2/2 is missing however

Thanks for you help,

     John

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

* Re: [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF
  2013-03-20 19:59   ` John Crispin
@ 2013-03-21 16:59     ` John Crispin
  0 siblings, 0 replies; 7+ messages in thread
From: John Crispin @ 2013-03-21 16:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-serial

On 20/03/13 20:59, John Crispin wrote:
> On 25/01/13 11:50, John Crispin wrote:
>> In order to make serial_8250 loadable via OF on Au1x00 and Ralink
>> WiSoC we need
>> to default the iotype to UPIO_AU.
>>
>> Signed-off-by: John Crispin<blogic@openwrt.org>
>> ---
>> drivers/tty/serial/of_serial.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/tty/serial/of_serial.c
>> b/drivers/tty/serial/of_serial.c
>> index e7cae1c..72e9743 100644
>> --- a/drivers/tty/serial/of_serial.c
>> +++ b/drivers/tty/serial/of_serial.c
>> @@ -97,7 +97,11 @@ static int of_platform_serial_setup(struct
>> platform_device *ofdev,
>> port->regshift = prop;
>>
>> port->irq = irq_of_parse_and_map(np, 0);
>> +#if defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_SERIAL_8250_RT288X)
>> + port->iotype = UPIO_AU;
>> +#else
>> port->iotype = UPIO_MEM;
>> +#endif
>> if (of_property_read_u32(np, "reg-io-width",&prop) == 0) {
>> switch (prop) {
>> case 1:
>
> Hi Greg,
>
> i have the impression that this patch got lost somewhere on the way to
> linus. I can see the 1/2 got merged with 3.9-rc1. 2/2 is missing however
>
> Thanks for you help,
>
> John


Hi Greg,

please ignore this patch, I will send a better one without #ifdef'ery 
for 3.10. There are 2 other fixes to make the serial work for another 
SoC I that will get merged in 3.10. I will put all 3 patches into a new 
series

	John

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

end of thread, other threads:[~2013-03-21 17:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 10:50 [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc John Crispin
2013-01-25 10:50 ` [PATCH 2/2] serial: of: allow au1x00 and rt288x to load from OF John Crispin
2013-01-25 11:44   ` Sergei Shtylyov
2013-01-25 12:40     ` Greg KH
2013-03-20 19:59   ` John Crispin
2013-03-21 16:59     ` John Crispin
2013-01-25 11:40 ` [PATCH 1/2] serial: ralink: adds support for the serial core found on ralink wisoc Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.