From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Sun, 27 Dec 2015 16:21:54 +0800 Subject: [U-Boot] [PATCH v4 4/8] mips: ath79: add serial driver for ar933x SOC In-Reply-To: References: <1451069788-6786-1-git-send-email-wills.wang@live.com> <567E941C.9090300@gmail.com> Message-ID: <567F9FA2.9080809@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wills, On 2015?12?27? 14:28, Wills Wang wrote: >>> +static int ar933x_serial_putc(struct udevice *dev, const char c) >>> +{ >>> + u32 data; >>> + >>> + if (c == '\n') >>> + ar933x_serial_putc(dev, '\r'); >> remove this, the serial core driver takes care of it >> >>> + >>> + do { >>> + data = ar933x_serial_read(dev, AR933X_UART_DATA_REG); >>> + } while (!(data & AR933X_UART_DATA_TX_CSR)); >> remove this, the serial core driver takes care of it via your pending >> callback (ar933x_serial_pending) >> > > Serial core driver don't query and wait the pending function before > "serial_getc" and "serial_putc", so these statements can't remove, > or board don't work. As I wrote in the v3 patch review, both the getc() and putc() should return -EAGAIN if there is no available data to read or not ready to write. The polling is done in the serial-uclass.c Regards, Thomas