linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc
@ 2016-06-28  3:17 Kefeng Wang
  2016-06-28  3:17 ` [PATCH 1/2] serial: 8250_dw: make dw8250_set_termios as default set_termios callback Kefeng Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kefeng Wang @ 2016-06-28  3:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Andy Shevchenko,
	z.liuxinliang, guohanjun, Kefeng Wang

Make dw8250_set_termios() as the default set_termios callback for 8250 dw uart, correct me
if I am wrong.

Then add ACPI support for uart on Hisilicon Hip05 soc, be careful that it is not 16500
compatible. Note, the build(no ACPI) depends on https://patchwork.kernel.org/patch/9141207/,
which was already accepted in net-next.

Meanwhile, set dw8250_serial_out32 to keep consistent between serial_out
and serial_in in ACPI.

Kefeng Wang (2):
  serial: 8250_dw: make dw8250_set_termios as default set_termios
    callback
  serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc

 drivers/tty/serial/8250/8250_dw.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

-- 
1.7.12.4

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

* [PATCH 1/2] serial: 8250_dw: make dw8250_set_termios as default set_termios callback
  2016-06-28  3:17 [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
@ 2016-06-28  3:17 ` Kefeng Wang
  2016-06-28  3:17 ` [PATCH 2/2] serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
  2016-06-29 12:52 ` [PATCH 0/2] serial: 8250_dw: Add " Andy Shevchenko
  2 siblings, 0 replies; 7+ messages in thread
From: Kefeng Wang @ 2016-06-28  3:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Andy Shevchenko,
	z.liuxinliang, guohanjun, Kefeng Wang

We can safely use dw8250_set_termios() as the default set_termios
callback instead of serial8250_do_set_termios(), so do it.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/tty/serial/8250/8250_dw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index e199696..65f3da7 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -301,7 +301,6 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 		p->iotype = UPIO_MEM32;
 		p->regshift = 2;
 		p->serial_in = dw8250_serial_in32;
-		p->set_termios = dw8250_set_termios;
 		/* So far none of there implement the Busy Functionality */
 		data->uart_16550_compatible = true;
 	}
@@ -309,7 +308,6 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 	/* Platforms with iDMA */
 	if (platform_get_resource_byname(to_platform_device(p->dev),
 					 IORESOURCE_MEM, "lpss_priv")) {
-		p->set_termios = dw8250_set_termios;
 		data->dma.rx_param = p->dev->parent;
 		data->dma.tx_param = p->dev->parent;
 		data->dma.fn = dw8250_idma_filter;
@@ -386,6 +384,7 @@ static int dw8250_probe(struct platform_device *pdev)
 	p->iotype	= UPIO_MEM;
 	p->serial_in	= dw8250_serial_in;
 	p->serial_out	= dw8250_serial_out;
+	p->set_termios	= dw8250_set_termios;
 
 	p->membase = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
 	if (!p->membase)
-- 
1.7.12.4

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

* [PATCH 2/2] serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc
  2016-06-28  3:17 [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
  2016-06-28  3:17 ` [PATCH 1/2] serial: 8250_dw: make dw8250_set_termios as default set_termios callback Kefeng Wang
@ 2016-06-28  3:17 ` Kefeng Wang
  2016-06-29  8:51   ` Kefeng Wang
  2016-06-29 12:52 ` [PATCH 0/2] serial: 8250_dw: Add " Andy Shevchenko
  2 siblings, 1 reply; 7+ messages in thread
From: Kefeng Wang @ 2016-06-28  3:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Andy Shevchenko,
	z.liuxinliang, guohanjun, Kefeng Wang

Add ACPI identifier for UART on Hisilicon Hip05 soc, be careful
that it is not 16550 compatibal.

Meanwhile, set dw8250_serial_out32 to keep consistent between serial_out
and serial_in in ACPI.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/tty/serial/8250/8250_dw.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 65f3da7..7571b0f 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -301,8 +301,11 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 		p->iotype = UPIO_MEM32;
 		p->regshift = 2;
 		p->serial_in = dw8250_serial_in32;
-		/* So far none of there implement the Busy Functionality */
-		data->uart_16550_compatible = true;
+		p->serial_out = dw8250_serial_out32;
+
+		/* Hisilicon 8250 dw uart is not 16550 compatible */
+		if (!acpi_dev_found("HISI0031"))
+			data->uart_16550_compatible = true;
 	}
 
 	/* Platforms with iDMA */
@@ -618,6 +621,7 @@ static const struct acpi_device_id dw8250_acpi_match[] = {
 	{ "APMC0D08", 0},
 	{ "AMD0020", 0 },
 	{ "AMDI0020", 0 },
+	{ "HISI0031", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);
-- 
1.7.12.4

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

* Re: [PATCH 2/2] serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc
  2016-06-28  3:17 ` [PATCH 2/2] serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
@ 2016-06-29  8:51   ` Kefeng Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Kefeng Wang @ 2016-06-29  8:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Andy Shevchenko,
	z.liuxinliang, guohanjun, linux-acpi

+cc linux-acpi@vger.kernel.org

On 2016/6/28 11:17, Kefeng Wang wrote:
> Add ACPI identifier for UART on Hisilicon Hip05 soc, be careful
> that it is not 16550 compatibal.
> 
> Meanwhile, set dw8250_serial_out32 to keep consistent between serial_out
> and serial_in in ACPI.
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  drivers/tty/serial/8250/8250_dw.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index 65f3da7..7571b0f 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -301,8 +301,11 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
>  		p->iotype = UPIO_MEM32;
>  		p->regshift = 2;
>  		p->serial_in = dw8250_serial_in32;
> -		/* So far none of there implement the Busy Functionality */
> -		data->uart_16550_compatible = true;
> +		p->serial_out = dw8250_serial_out32;
> +
> +		/* Hisilicon 8250 dw uart is not 16550 compatible */
> +		if (!acpi_dev_found("HISI0031"))
> +			data->uart_16550_compatible = true;
>  	}
>  
>  	/* Platforms with iDMA */
> @@ -618,6 +621,7 @@ static const struct acpi_device_id dw8250_acpi_match[] = {
>  	{ "APMC0D08", 0},
>  	{ "AMD0020", 0 },
>  	{ "AMDI0020", 0 },
> +	{ "HISI0031", 0 },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);
> 

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

* Re: [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc
  2016-06-28  3:17 [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
  2016-06-28  3:17 ` [PATCH 1/2] serial: 8250_dw: make dw8250_set_termios as default set_termios callback Kefeng Wang
  2016-06-28  3:17 ` [PATCH 2/2] serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
@ 2016-06-29 12:52 ` Andy Shevchenko
  2016-06-30  1:19   ` liuxinliang
  2016-06-30  1:24   ` Kefeng Wang
  2 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2016-06-29 12:52 UTC (permalink / raw)
  To: Kefeng Wang, Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, z.liuxinliang, guohanjun

On Tue, 2016-06-28 at 11:17 +0800, Kefeng Wang wrote:
> Make dw8250_set_termios() as the default set_termios callback for 8250
> dw uart, correct me
> if I am wrong.
> 
> Then add ACPI support for uart on Hisilicon Hip05 soc, be careful that
> it is not 16500
> compatible.

You mean it has Busy Functionality implemented?
Is there any public specification to look at?

>  Note, the build(no ACPI) depends on
> https://patchwork.kernel.org/patch/9141207/,
> which was already accepted in net-next.
> 
> Meanwhile, set dw8250_serial_out32 to keep consistent between
> serial_out
> and serial_in in ACPI.
> 
> Kefeng Wang (2):
>   serial: 8250_dw: make dw8250_set_termios as default set_termios
>     callback
>   serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc
> 
>  drivers/tty/serial/8250/8250_dw.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 

-- 

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc
  2016-06-29 12:52 ` [PATCH 0/2] serial: 8250_dw: Add " Andy Shevchenko
@ 2016-06-30  1:19   ` liuxinliang
  2016-06-30  1:24   ` Kefeng Wang
  1 sibling, 0 replies; 7+ messages in thread
From: liuxinliang @ 2016-06-30  1:19 UTC (permalink / raw)
  To: Andy Shevchenko, Kefeng Wang, Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, guohanjun

Hi,

On 2016/6/29 20:52, Andy Shevchenko wrote:
> On Tue, 2016-06-28 at 11:17 +0800, Kefeng Wang wrote:
>> Make dw8250_set_termios() as the default set_termios callback for 8250
>> dw uart, correct me
>> if I am wrong.
>>
>> Then add ACPI support for uart on Hisilicon Hip05 soc, be careful that
>> it is not 16500
>> compatible.
> You mean it has Busy Functionality implemented?

Yes, I think so.

> Is there any public specification to look at?
Sorry, our SoC manual is not that public. But we confirm with SoC guys 
that 8250dw has 16550 compatible and non 16550 compatible version.
Ours is non 16550 compatible version. And we can see the IIR register 
has busy interrupt bit:
"0x7: busy interrupt. When UART is busy (USR[0]=1) in receiving
and transmitting data and the processor operates the LCR register,
this interrupt will be generated."

Thanks,
-xinliang

>
>>   Note, the build(no ACPI) depends on
>> https://patchwork.kernel.org/patch/9141207/,
>> which was already accepted in net-next.
>>
>> Meanwhile, set dw8250_serial_out32 to keep consistent between
>> serial_out
>> and serial_in in ACPI.
>>
>> Kefeng Wang (2):
>>    serial: 8250_dw: make dw8250_set_termios as default set_termios
>>      callback
>>    serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc
>>
>>   drivers/tty/serial/8250/8250_dw.c | 11 +++++++----
>>   1 file changed, 7 insertions(+), 4 deletions(-)
>>

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

* Re: [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc
  2016-06-29 12:52 ` [PATCH 0/2] serial: 8250_dw: Add " Andy Shevchenko
  2016-06-30  1:19   ` liuxinliang
@ 2016-06-30  1:24   ` Kefeng Wang
  1 sibling, 0 replies; 7+ messages in thread
From: Kefeng Wang @ 2016-06-30  1:24 UTC (permalink / raw)
  To: Andy Shevchenko, Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, z.liuxinliang, guohanjun



On 2016/6/29 20:52, Andy Shevchenko wrote:
> On Tue, 2016-06-28 at 11:17 +0800, Kefeng Wang wrote:
>> Make dw8250_set_termios() as the default set_termios callback for 8250
>> dw uart, correct me
>> if I am wrong.
>>
>> Then add ACPI support for uart on Hisilicon Hip05 soc, be careful that
>> it is not 16500
>> compatible.
> 
> You mean it has Busy Functionality implemented?

After check it again with designer, yes.

> Is there any public specification to look at?

I think Xin liang is in a better position to answer this question.

> 
>>  Note, the build(no ACPI) depends on
>> https://patchwork.kernel.org/patch/9141207/,
>> which was already accepted in net-next.
>>
>> Meanwhile, set dw8250_serial_out32 to keep consistent between
>> serial_out
>> and serial_in in ACPI.
>>
>> Kefeng Wang (2):
>>   serial: 8250_dw: make dw8250_set_termios as default set_termios
>>     callback
>>   serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc
>>
>>  drivers/tty/serial/8250/8250_dw.c | 11 +++++++----
>>  1 file changed, 7 insertions(+), 4 deletions(-)
>>
> 

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

end of thread, other threads:[~2016-06-30  1:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28  3:17 [PATCH 0/2] serial: 8250_dw: Add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
2016-06-28  3:17 ` [PATCH 1/2] serial: 8250_dw: make dw8250_set_termios as default set_termios callback Kefeng Wang
2016-06-28  3:17 ` [PATCH 2/2] serial: 8250_dw: add ACPI support for uart on Hisilicon Hip05 soc Kefeng Wang
2016-06-29  8:51   ` Kefeng Wang
2016-06-29 12:52 ` [PATCH 0/2] serial: 8250_dw: Add " Andy Shevchenko
2016-06-30  1:19   ` liuxinliang
2016-06-30  1:24   ` Kefeng Wang

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).