All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Anand <panand@redhat.com>
To: Geoff Levand <geoff@infradead.org>
Cc: takahiro.akashi@linaro.org, kexec@lists.infradead.org
Subject: Re: [PATCH V2 11/11] arm64: wait for transmit completion before next character transmission
Date: Tue, 20 Oct 2015 08:11:53 +0530	[thread overview]
Message-ID: <20151020024153.GA31893@dhcppc13.redhat.com> (raw)
In-Reply-To: <1445293795.30908.50.camel@infradead.org>

On 19/10/2015:03:29:55 PM, Geoff Levand wrote:
Hi Geoff,
> 
> I tested this on the foundation model and it hangs.

Thanks for testing it.

Which uart model has been used in foundation model?
Does it have LSR register at offset 0x14? Should we expect 0x60 in LSR for TX
buffer to be empty? May be I can do a V3 of this patch where we pass
--port="uart_base","LSR","TX_EMPTY" (like --port=0x1c020000,0x14,0x60).

~Pratyush

> 
> -Geoff
> 
> On Thu, 2015-05-14 at 11:25 +0530, Pratyush Anand wrote:
> > Previous transmission must be completed before next character to be
> > transmitted, otherwise TX buffer may saturate and we will not see all
> > the characters on screen.
> > 
> > Signed-off-by: Pratyush Anand <panand@redhat.com>
> > ---
> >  purgatory/arch/arm64/purgatory-arm64.c | 24 +++++++++++++++++++++++-
> >  1 file changed, 23 insertions(+), 1 deletion(-)
> > 
> > diff --git a/purgatory/arch/arm64/purgatory-arm64.c
> > b/purgatory/arch/arm64/purgatory-arm64.c
> > index 25960c30bd05..3a1c9243bfa2 100644
> > --- a/purgatory/arch/arm64/purgatory-arm64.c
> > +++ b/purgatory/arch/arm64/purgatory-arm64.c
> > @@ -11,15 +11,37 @@ extern uint32_t *arm64_sink;
> >  extern void (*arm64_kernel_entry)(uint64_t);
> >  extern uint64_t arm64_dtb_addr;
> >  
> > +static void wait_for_xmit_complete(void)
> > +{
> > +	volatile uint32_t status;
> > +	volatile uint32_t *status_reg;
> > +
> > +	/*
> > +	 * Since most of the UART with ARM platform has LSR register
> > at
> > +	 * offset 0x14 and should have value as 0x60 for TX empty,
> > so we
> > +	 * have hardcoded these values. Can modify in future if need
> > +	 * arises.
> > +	 */
> > +	status_reg = (volatile uint32_t *)((uint64_t)arm64_sink +
> > 0x14);
> > +	while (1) {
> > +		status = *status_reg;
> > +		if ((status & 0x60) == 0x60)
> > +			break;
> > +	}
> > +}
> > +
> >  void putchar(int ch)
> >  {
> >  	if (!arm64_sink)
> >  		return;
> >  
> > +	wait_for_xmit_complete();
> >  	*arm64_sink = ch;
> >  
> > -	if (ch == '\n')
> > +	if (ch == '\n') {
> > +		wait_for_xmit_complete();
> >  		*arm64_sink = '\r';
> > +	}
> >  }
> >  
> >  void setup_arch(void)

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-10-20  2:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  5:55 [PATCH V2 00/11] ARM64 Binary Image Support Pratyush Anand
2015-05-14  5:55 ` [PATCH V2 01/11] arm64: Kexec: Add support for binary image Pratyush Anand
2015-05-14  5:55 ` [PATCH V2 10/11] arm64: kdump: " Pratyush Anand
2015-05-14  5:55 ` [PATCH V2 11/11] arm64: wait for transmit completion before next character transmission Pratyush Anand
2015-10-19 22:29   ` Geoff Levand
2015-10-20  2:41     ` Pratyush Anand [this message]
2015-10-20 17:04       ` Geoff Levand
2015-10-29 10:35         ` Pratyush Anand
2015-06-05  5:29 ` [PATCH V2 00/11] ARM64 Binary Image Support Pratyush Anand

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=20151020024153.GA31893@dhcppc13.redhat.com \
    --to=panand@redhat.com \
    --cc=geoff@infradead.org \
    --cc=kexec@lists.infradead.org \
    --cc=takahiro.akashi@linaro.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 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.