Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1189856 > unrolled thread
| Started by | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| First post | 2015-07-22 14:20 +0200 |
| Last post | 2015-07-23 08:20 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 1/4] serial: 8250_dw: Add support for big-endian MMIO accesses Peter Hurley <peter@hurleysoftware.com> - 2015-07-22 14:20 +0200
Re: [PATCH 1/4] serial: 8250_dw: Add support for big-endian MMIO accesses Peter Hurley <peter@hurleysoftware.com> - 2015-07-22 14:50 +0200
RE: [PATCH 1/4] serial: 8250_dw: Add support for big-endian MMIO accesses Noam Camus <noamc@ezchip.com> - 2015-07-23 08:20 +0200
RE: [PATCH 1/4] serial: 8250_dw: Add support for big-endian MMIO accesses Noam Camus <noamc@ezchip.com> - 2015-07-23 08:20 +0200
| From | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| Date | 2015-07-22 14:20 +0200 |
| Subject | Re: [PATCH 1/4] serial: 8250_dw: Add support for big-endian MMIO accesses |
| Message-ID | <pP1a9-6y6-5@gated-at.bofh.it> |
Hi Noam,
On 07/22/2015 05:34 AM, Noam Camus wrote:
> From: Noam Camus <noamc@ezchip.com>
>
> Add support for UPIO_MEM32BE in addition to UPIO_MEM32.
This is not an adequate changelog.
Please describe the refactoring.
Regards,
Peter Hurley
> Signed-off-by: Noam Camus <noamc@ezchip.com>
> ---
> drivers/tty/serial/8250/8250_dw.c | 42 ++++++++++++++++++++++++++++++------
> 1 files changed, 35 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index d48b506..fe0b487 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -173,15 +173,13 @@ static void dw8250_serial_outq(struct uart_port *p, int offset, int value)
> }
> #endif /* CONFIG_64BIT */
>
> -static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
> +static void dw8250_check_control(struct uart_port *p, int offset, int value)
> {
> struct dw8250_data *d = p->private_data;
>
> if (offset == UART_MCR)
> d->last_mcr = value;
>
> - writel(value, p->membase + (offset << p->regshift));
> -
> /* Make sure LCR write wasn't ignored */
> if (offset == UART_LCR) {
> int tries = 1000;
> @@ -190,7 +188,12 @@ static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
> if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR))
> return;
> dw8250_force_idle(p);
> - writel(value, p->membase + (UART_LCR << p->regshift));
> + if (p->iotype == UPIO_MEM32BE)
> + iowrite32be(value,
> + p->membase + (UART_LCR << p->regshift));
> + else
> + writel(value,
> + p->membase + (UART_LCR << p->regshift));
> }
> /*
> * FIXME: this deadlocks if port->lock is already held
> @@ -199,6 +202,12 @@ static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
> }
> }
>
> +static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
> +{
> + writel(value, p->membase + (offset << p->regshift));
> + dw8250_check_control(p, offset, value);
> +}
> +
> static unsigned int dw8250_serial_in32(struct uart_port *p, int offset)
> {
> unsigned int value = readl(p->membase + (offset << p->regshift));
> @@ -206,6 +215,19 @@ static unsigned int dw8250_serial_in32(struct uart_port *p, int offset)
> return dw8250_modify_msr(p, offset, value);
> }
>
> +static void dw8250_serial_out32be(struct uart_port *p, int offset, int value)
> +{
> + iowrite32be(value, p->membase + (offset << p->regshift));
> + dw8250_check_control(p, offset, value);
> +}
> +
> +static unsigned int dw8250_serial_in32be(struct uart_port *p, int offset)
> +{
> + unsigned int value = ioread32be(p->membase + (offset << p->regshift));
> +
> + return dw8250_modify_msr(p, offset, value);
> +}
> +
> static int dw8250_handle_irq(struct uart_port *p)
> {
> struct dw8250_data *d = p->private_data;
> @@ -322,9 +344,15 @@ static int dw8250_probe_of(struct uart_port *p,
> case 1:
> break;
> case 4:
> - p->iotype = UPIO_MEM32;
> - p->serial_in = dw8250_serial_in32;
> - p->serial_out = dw8250_serial_out32;
> + p->iotype = of_device_is_big_endian(np) ?
> + UPIO_MEM32BE : UPIO_MEM32;
> + if (p->iotype == UPIO_MEM32) {
> + p->serial_in = dw8250_serial_in32;
> + p->serial_out = dw8250_serial_out32;
> + } else {
> + p->serial_in = dw8250_serial_in32be;
> + p->serial_out = dw8250_serial_out32be;
> + }
> break;
> default:
> dev_err(p->dev, "unsupported reg-io-width (%u)\n", val);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Peter Hurley <peter@hurleysoftware.com> |
|---|---|
| Date | 2015-07-22 14:50 +0200 |
| Message-ID | <pP1Db-765-11@gated-at.bofh.it> |
| In reply to | #1189856 |
On 07/22/2015 08:19 AM, Peter Hurley wrote:
> Hi Noam,
>
> On 07/22/2015 05:34 AM, Noam Camus wrote:
>> From: Noam Camus <noamc@ezchip.com>
>>
>> Add support for UPIO_MEM32BE in addition to UPIO_MEM32.
>
> This is not an adequate changelog.
> Please describe the refactoring.
>
> Regards,
> Peter Hurley
>
>> Signed-off-by: Noam Camus <noamc@ezchip.com>
>> ---
>> drivers/tty/serial/8250/8250_dw.c | 42 ++++++++++++++++++++++++++++++------
>> 1 files changed, 35 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
>> index d48b506..fe0b487 100644
>> --- a/drivers/tty/serial/8250/8250_dw.c
>> +++ b/drivers/tty/serial/8250/8250_dw.c
>> @@ -173,15 +173,13 @@ static void dw8250_serial_outq(struct uart_port *p, int offset, int value)
>> }
>> #endif /* CONFIG_64BIT */
>>
>> -static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
>> +static void dw8250_check_control(struct uart_port *p, int offset, int value)
Also, I think this fn name should be dw8250_check_LCR() to distinguish it
from modem control.
Regards,
Peter Hurley
>> {
>> struct dw8250_data *d = p->private_data;
>>
>> if (offset == UART_MCR)
>> d->last_mcr = value;
>>
>> - writel(value, p->membase + (offset << p->regshift));
>> -
>> /* Make sure LCR write wasn't ignored */
>> if (offset == UART_LCR) {
>> int tries = 1000;
>> @@ -190,7 +188,12 @@ static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
>> if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR))
>> return;
>> dw8250_force_idle(p);
>> - writel(value, p->membase + (UART_LCR << p->regshift));
>> + if (p->iotype == UPIO_MEM32BE)
>> + iowrite32be(value,
>> + p->membase + (UART_LCR << p->regshift));
>> + else
>> + writel(value,
>> + p->membase + (UART_LCR << p->regshift));
>> }
>> /*
>> * FIXME: this deadlocks if port->lock is already held
>> @@ -199,6 +202,12 @@ static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
>> }
>> }
>>
>> +static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
>> +{
>> + writel(value, p->membase + (offset << p->regshift));
>> + dw8250_check_control(p, offset, value);
>> +}
>> +
>> static unsigned int dw8250_serial_in32(struct uart_port *p, int offset)
>> {
>> unsigned int value = readl(p->membase + (offset << p->regshift));
>> @@ -206,6 +215,19 @@ static unsigned int dw8250_serial_in32(struct uart_port *p, int offset)
>> return dw8250_modify_msr(p, offset, value);
>> }
>>
>> +static void dw8250_serial_out32be(struct uart_port *p, int offset, int value)
>> +{
>> + iowrite32be(value, p->membase + (offset << p->regshift));
>> + dw8250_check_control(p, offset, value);
>> +}
>> +
>> +static unsigned int dw8250_serial_in32be(struct uart_port *p, int offset)
>> +{
>> + unsigned int value = ioread32be(p->membase + (offset << p->regshift));
>> +
>> + return dw8250_modify_msr(p, offset, value);
>> +}
>> +
>> static int dw8250_handle_irq(struct uart_port *p)
>> {
>> struct dw8250_data *d = p->private_data;
>> @@ -322,9 +344,15 @@ static int dw8250_probe_of(struct uart_port *p,
>> case 1:
>> break;
>> case 4:
>> - p->iotype = UPIO_MEM32;
>> - p->serial_in = dw8250_serial_in32;
>> - p->serial_out = dw8250_serial_out32;
>> + p->iotype = of_device_is_big_endian(np) ?
>> + UPIO_MEM32BE : UPIO_MEM32;
>> + if (p->iotype == UPIO_MEM32) {
>> + p->serial_in = dw8250_serial_in32;
>> + p->serial_out = dw8250_serial_out32;
>> + } else {
>> + p->serial_in = dw8250_serial_in32be;
>> + p->serial_out = dw8250_serial_out32be;
>> + }
>> break;
>> default:
>> dev_err(p->dev, "unsupported reg-io-width (%u)\n", val);
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Noam Camus <noamc@ezchip.com> |
|---|---|
| Date | 2015-07-23 08:20 +0200 |
| Message-ID | <pPi1j-6Nv-7@gated-at.bofh.it> |
| In reply to | #1189875 |
RnJvbTogUGV0ZXIgSHVybGV5IFttYWlsdG86cGV0ZXJAaHVybGV5c29mdHdhcmUuY29tXSANClNl bnQ6IFdlZG5lc2RheSwgSnVseSAyMiwgMjAxNSAzOjQxIFBNDQoNCj4+IGRpZmYgLS1naXQgYS9k cml2ZXJzL3R0eS9zZXJpYWwvODI1MC84MjUwX2R3LmMgDQo+PiBiL2RyaXZlcnMvdHR5L3Nlcmlh bC84MjUwLzgyNTBfZHcuYw0KPj4gaW5kZXggZDQ4YjUwNi4uZmUwYjQ4NyAxMDA2NDQNCj4+IC0t LSBhL2RyaXZlcnMvdHR5L3NlcmlhbC84MjUwLzgyNTBfZHcuYw0KPj4gKysrIGIvZHJpdmVycy90 dHkvc2VyaWFsLzgyNTAvODI1MF9kdy5jDQo+PiBAQCAtMTczLDE1ICsxNzMsMTMgQEAgc3RhdGlj IHZvaWQgZHc4MjUwX3NlcmlhbF9vdXRxKHN0cnVjdCB1YXJ0X3BvcnQgDQo+PiAqcCwgaW50IG9m ZnNldCwgaW50IHZhbHVlKSAgfSAgI2VuZGlmIC8qIENPTkZJR182NEJJVCAqLw0KPj4gIA0KPj4g LXN0YXRpYyB2b2lkIGR3ODI1MF9zZXJpYWxfb3V0MzIoc3RydWN0IHVhcnRfcG9ydCAqcCwgaW50 IG9mZnNldCwgaW50IA0KPj4gdmFsdWUpDQo+PiArc3RhdGljIHZvaWQgZHc4MjUwX2NoZWNrX2Nv bnRyb2woc3RydWN0IHVhcnRfcG9ydCAqcCwgaW50IG9mZnNldCwgDQo+PiAraW50IHZhbHVlKQ0K DQo+IEFsc28sIEkgdGhpbmsgdGhpcyBmbiBuYW1lIHNob3VsZCBiZSBkdzgyNTBfY2hlY2tfTENS KCkgdG8gZGlzdGluZ3Vpc2ggaXQgZnJvbSBtb2RlbSBjb250cm9sLg0KDQpObyBwcm9ibGVtIHdp bGwgcmVuYW1lIGluIG15IHYyDQo= -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Noam Camus <noamc@ezchip.com> |
|---|---|
| Date | 2015-07-23 08:20 +0200 |
| Message-ID | <pPi1j-6Nv-5@gated-at.bofh.it> |
| In reply to | #1189856 |
RnJvbTogUGV0ZXIgSHVybGV5IFttYWlsdG86cGV0ZXJAaHVybGV5c29mdHdhcmUuY29tXSANClNl bnQ6IFdlZG5lc2RheSwgSnVseSAyMiwgMjAxNSAzOjE5IFBNDQoNCj4gVGhpcyBpcyBub3QgYW4g YWRlcXVhdGUgY2hhbmdlbG9nLg0KPiBQbGVhc2UgZGVzY3JpYmUgdGhlIHJlZmFjdG9yaW5nLg0K DQpJIHdpbGwgaW4gbXkgdjIgcGF0Y2ggc2V0DQoNCk5vYW0NCg== -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web