X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fdebug_uart.h;h=6f0b0c5e1575a0fabd81cea633d6b3daad5a7e8a;hb=c10b1c43fdd80fe01ad527e6d024bfaa19eb361a;hp=0d640b96e7b11337cb2cffb045a5d5887c415fdf;hpb=e6de55ec5bf306df3b3cc8e7a4cc17fa1e78ca6c;p=u-boot diff --git a/include/debug_uart.h b/include/debug_uart.h index 0d640b96e7..6f0b0c5e15 100644 --- a/include/debug_uart.h +++ b/include/debug_uart.h @@ -111,21 +111,38 @@ void printhex8(uint value); #define _DEBUG_UART_ANNOUNCE #endif +#define serial_dout(reg, value) \ + serial_out_shift((char *)com_port + \ + ((char *)reg - (char *)com_port) * \ + (1 << CONFIG_DEBUG_UART_SHIFT), \ + CONFIG_DEBUG_UART_SHIFT, value) +#define serial_din(reg) \ + serial_in_shift((char *)com_port + \ + ((char *)reg - (char *)com_port) * \ + (1 << CONFIG_DEBUG_UART_SHIFT), \ + CONFIG_DEBUG_UART_SHIFT) + /* * Now define some functions - this should be inserted into the serial driver */ #define DEBUG_UART_FUNCS \ - void printch(int ch) \ +\ + static inline void _printch(int ch) \ { \ if (ch == '\n') \ _debug_uart_putc('\r'); \ _debug_uart_putc(ch); \ } \ +\ + void printch(int ch) \ + { \ + _printch(ch); \ + } \ \ void printascii(const char *str) \ { \ while (*str) \ - printch(*str++); \ + _printch(*str++); \ } \ \ static inline void printhex1(uint digit) \