Go to the documentation of this file.
11 #ifndef _ASM_UNIT_SERIAL_H
12 #define _ASM_UNIT_SERIAL_H
18 #define SERIAL_PORT0_BASE_ADDRESS 0xA6FB0000
19 #define ASB2305_DEBUG_MCR __SYSREG(0xA6FB0000 + UART_MCR * 2, u8)
21 #define SERIAL_IRQ XIRQ0
26 #define BASE_BAUD (18432000 / 16)
31 #ifndef CONFIG_GDBSTUB_ON_TTYSx
33 #define SERIAL_PORT_DFNS \
35 .baud_base = BASE_BAUD, \
37 .flags = STD_COM_FLAGS, \
38 .iomem_base = (u8 *) SERIAL_PORT0_BASE_ADDRESS, \
39 .iomem_reg_shift = 2, \
40 .io_type = SERIAL_IO_MEM, \
45 static inline void __debug_to_serial(
const char *
p,
int n)
53 #define SERIAL_PORT_DFNS
55 #if defined(CONFIG_GDBSTUB_ON_TTYS0)
56 #define GDBPORT_SERIAL_RX __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_RX * 4, u8)
57 #define GDBPORT_SERIAL_TX __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_TX * 4, u8)
58 #define GDBPORT_SERIAL_DLL __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_DLL * 4, u8)
59 #define GDBPORT_SERIAL_DLM __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_DLM * 4, u8)
60 #define GDBPORT_SERIAL_IER __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_IER * 4, u8)
61 #define GDBPORT_SERIAL_IIR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_IIR * 4, u8)
62 #define GDBPORT_SERIAL_FCR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_FCR * 4, u8)
63 #define GDBPORT_SERIAL_LCR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_LCR * 4, u8)
64 #define GDBPORT_SERIAL_MCR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_MCR * 4, u8)
65 #define GDBPORT_SERIAL_LSR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_LSR * 4, u8)
66 #define GDBPORT_SERIAL_MSR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_MSR * 4, u8)
67 #define GDBPORT_SERIAL_SCR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_SCR * 4, u8)
68 #define GDBPORT_SERIAL_IRQ SERIAL_IRQ
70 #elif defined(CONFIG_GDBSTUB_ON_TTYS1)
71 #error The ASB2305 doesnt have a /dev/ttyS1
76 #define TTYS0_TX __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_TX * 4, u8)
77 #define TTYS0_MCR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_MCR * 4, u8)
78 #define TTYS0_LSR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_LSR * 4, u8)
79 #define TTYS0_MSR __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_MSR * 4, u8)
81 #define LSR_WAIT_FOR(STATE) \
83 while (!(TTYS0_LSR & UART_LSR_##STATE)) {} \
85 #define FLOWCTL_WAIT_FOR(LINE) \
87 while (!(TTYS0_MSR & UART_MSR_##LINE)) {} \
89 #define FLOWCTL_CLEAR(LINE) \
91 TTYS0_MCR &= ~UART_MCR_##LINE; \
93 #define FLOWCTL_SET(LINE) \
95 TTYS0_MCR |= UART_MCR_##LINE; \
97 #define FLOWCTL_QUERY(LINE) ({ TTYS0_MSR & UART_MSR_##LINE; })
99 static inline void __debug_to_serial(
const char *
p,
int n)