Received: from eggs.gnu.org ([2001:4830:134:3::10]:54707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIBN3-0002JW-5L for qemu-devel@nongnu.org; Sat, 07 Sep 2013 01:47:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VIBMy-0002pD-K2 for qemu-devel@nongnu.org; Sat, 07 Sep 2013 01:47:45 -0400 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:44882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VIBMy-0002n0-BA for qemu-devel@nongnu.org; Sat, 07 Sep 2013 01:47:40 -0400 Received: by mail-la0-f42.google.com with SMTP id ep20so3499854lab.29 for ; Fri, 06 Sep 2013 22:47:39 -0700 (PDT) Date: Sat, 7 Sep 2013 09:45:13 +0400 From: Antony Pavlov Message-Id: <20130907094513.f175c6b95d50c0855f7e6348@gmail.com> In-Reply-To: References: <1378367579-1099-1-git-send-email-antonynpavlov@gmail.com> <1378367579-1099-5-git-send-email-antonynpavlov@gmail.com> <20130906105420.3239815a8775ea9bfc2261eb@gmail.com> <20130906170015.9d069ef890a2631a2edf543e@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC v4 4/5] hw/arm/digic: add UART support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On Fri, 6 Sep 2013 14:40:14 +0100 Peter Maydell wrote: > On 6 September 2013 14:00, Antony Pavlov wrote: > > On Fri, 6 Sep 2013 08:25:20 +0100 > > Peter Maydell 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? >=20 > 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 >=20 > 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 c= an 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/m= ach/debug_ll.h#L49 --=A0 Best regards, =A0 Antony Pavlov