xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@linaro.org>
To: Julien Grall <julien.grall@linaro.org>
Cc: xen-devel@lists.xen.org, Ian.Campbell@citrix.com,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] pl011: assert RTS signal in case the receiver uses flow control
Date: Tue, 03 Sep 2013 08:07:04 +0200	[thread overview]
Message-ID: <52257C88.6030601@linaro.org> (raw)
In-Reply-To: <5224B462.4020701@linaro.org>

On 09/02/2013 05:53 PM, Julien Grall wrote:
> On 09/02/2013 03:51 PM, Andre Przywara wrote:
>> Although we do not support hardware flow control in the Xen driver
>> for the PL011 UART, the other end may be configured to use it.
>> In this case it waits in vain for the RTS signal to be asserted by
>> the host and will never transmit any characters.
>> This fixes the UART input on Calxeda Midway, which uses hardware
>> flow control for the serial-over-LAN functionality.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
>> ---
>>   xen/drivers/char/pl011.c         | 4 ++--
>>   xen/include/asm-arm/pl011-uart.h | 4 ++++
>>   2 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>> index 3ec6e10..e340961 100644
>> --- a/xen/drivers/char/pl011.c
>> +++ b/xen/drivers/char/pl011.c
>> @@ -120,8 +120,8 @@ static void __init pl011_init_preirq(struct serial_port *port)
>>       pl011_write(uart, IMSC, 0);
>>       pl011_write(uart, ICR, ALLI);
>>
>> -    /* Enable the UART for RX and TX; no flow ctrl */
>> -    pl011_write(uart, CR, RXE | TXE | UARTEN);
>> +    /* Enable the UART for RX and TX; assert RTS in case the other end cares */
>> +    pl011_write(uart, CR, RTS | RXE | TXE | UARTEN);
>>   }
>
> Instead of overriding CR can we read CR and enable the necessary bit?
> It seems that Linux doesn't set RTS but keep the level from the previous
> register value.

Right, that is the way to do it. In fact u-boot already cares about 
this: 
http://git.denx.de/?p=u-boot.git;a=commit;h=10501df05e2d2eef501c92483c134d5f7c9da150

Will send a new version.

> BTW, this patch works on the versatile express :).

Nice, thanks for testing.

Andre.

  reply	other threads:[~2013-09-03  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02 14:51 [PATCH] pl011: assert RTS signal in case the receiver uses flow control Andre Przywara
2013-09-02 15:53 ` Julien Grall
2013-09-03  6:07   ` Andre Przywara [this message]
2013-09-02 16:21 ` Tim Deegan
2013-09-03  6:12   ` Andre Przywara
2013-09-03  6:40     ` Tim Deegan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52257C88.6030601@linaro.org \
    --to=andre.przywara@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).