X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fserial%2Fserial_pl01x.c;h=552c945264c8d549c6da6fbbb311beb188fcb66c;hb=b81406db51a68ddd482d4ea3641dd7ad2e910771;hp=3a5c1d0eaabcd514752eb6c139af95ce17dd0bcc;hpb=68282f55b8465660af105086ad327ecdd8f35c67;p=oweals%2Fu-boot.git diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 3a5c1d0eaa..552c945264 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -367,3 +367,31 @@ U_BOOT_DRIVER(serial_pl01x) = { }; #endif + +#if defined(CONFIG_DEBUG_UART_PL010) || defined(CONFIG_DEBUG_UART_PL011) + +#include + +static void _debug_uart_init(void) +{ +#ifndef CONFIG_DEBUG_UART_SKIP_INIT + struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE; + enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ? + TYPE_PL011 : TYPE_PL010; + + pl01x_generic_serial_init(regs, type); + pl01x_generic_setbrg(regs, type, + CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE); +#endif +} + +static inline void _debug_uart_putc(int ch) +{ + struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE; + + pl01x_putc(regs, ch); +} + +DEBUG_UART_FUNCS + +#endif