
27 Dec
2015
27 Dec
'15
9:21 a.m.
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