qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v4 4/5] hw/arm/digic: add UART support


From: Antony Pavlov
Subject: Re: [Qemu-devel] [RFC v4 4/5] hw/arm/digic: add UART support
Date: Sat, 7 Sep 2013 09:45:13 +0400

On Fri, 6 Sep 2013 14:40:14 +0100
Peter Maydell <address@hidden> wrote:

> On 6 September 2013 14:00, Antony Pavlov <address@hidden> wrote:
> > On Fri, 6 Sep 2013 08:25:20 +0100
> > Peter Maydell <address@hidden> wrote:
> >> You can deduce its existence though -- does the
> >> UART let you feed two or three characters to it
> >> at faster than whatever the serial line speed is
> >> before it sets the "stop sending me bits" status
> >> bit, or does it stop after the first?
> >
> > No, I can't :)
> >
> > How can I check this mysterious "stop sending me bits" status bit?
> > Do you mean the UART hardware flow control pin?
> 
> I meant ST_TX_RDY, but looking again at the
> docs perhaps I misinterpreted it. Do you really
> have to do:
>  * write byte to TX register
>  * set TX_RDY bit in status register
> 
> to get it to send out a byte?

I don't want publish Canon firmware disassembled listings and discuss it
in the maillist for legal reasons.

But Canon A1100 firmware can use this routine:
 1. wait TX_RDY bit in status register;
 2. write TX_RDY and some other (unknown behaviour) bit to status register;
 3. write byte to TX register.

IMHO the step 2 is bizarre.

You can easely check me: the disassembly instructions and firmware images can
be found via CHDK site. A puts()-like routine can be found at 0xffff18f0
in the Canon A1100IS firmware image.

> I was expecting a more standard UART interface
> which is typically:
>  * write byte to TX register
>  * if the UART is unable to accept any more
>    bytes (ie FIFO full, or just immediately if
>    no FIFO present) it clears TX_RDY
>  * software has to wait for TX_RDY to be set
>    before writing another byte to TX

IMHO the more standart UART outc() routune is:
   * wait for UART "transmitter is ready to send next char" flag;
   * write char to TX register.

E.g. see
https://github.com/frantony/barebox/blob/master/arch/mips/include/asm/debug_ll_ns16550.h#L60
or
https://github.com/frantony/barebox/blob/master/arch/arm/mach-imx/include/mach/debug_ll.h#L49

-- 
Best regards,
  Antony Pavlov



reply via email to

[Prev in Thread] Current Thread [Next in Thread]