[ar71xx] add EARLY_PRINTF support for the rest of the non-AR933x SoCs.

Tested:

* AR934x SoC
This commit is contained in:
adrian 2017-01-15 06:35:00 +00:00
parent a2e0d3fa71
commit bee50de478
2 changed files with 21 additions and 0 deletions

View File

@ -111,6 +111,10 @@
#define PCI_WINDOW7_CONF_ADDR 0x07000000
#define AR71XX_UART_ADDR 0x18020000
#define AR71XX_UART_THR 0x0
#define AR71XX_UART_LSR 0x14
#define AR71XX_UART_LSR_THRE (1 << 5)
#define AR71XX_UART_LSR_TEMT (1 << 6)
#define AR71XX_USB_CTRL_FLADJ 0x18030000
#define USB_CTRL_FLADJ_HOST_SHIFT 12

View File

@ -86,4 +86,21 @@ uart_ar71xx_probe(device_t dev)
return (uart_bus_probe(dev, 2, freq, 0, 0));
}
#ifdef EARLY_PRINTF
static void
ar71xx_early_putc(int c)
{
int i;
for (i = 0; i < 1000; i++) {
if (ATH_READ_REG(AR71XX_UART_ADDR + AR71XX_UART_LSR)
& AR71XX_UART_LSR_THRE)
break;
}
ATH_WRITE_REG(AR71XX_UART_ADDR + AR71XX_UART_THR, (c & 0xff));
}
early_putc_t *early_putc = ar71xx_early_putc;
#endif
DRIVER_MODULE(uart, apb, uart_ar71xx_driver, uart_devclass, 0, 0);