#define RT288X_DL 0x28
-#define UART_REG_UNMAPPED -1
-
/* Au1x00/RT288x UART hardware has a weird register layout */
-static const s8 au_io_in_map[8] = {
+static const u8 au_io_in_map[7] = {
[UART_RX] = 0,
[UART_IER] = 2,
[UART_IIR] = 3,
[UART_MCR] = 6,
[UART_LSR] = 7,
[UART_MSR] = 8,
- [UART_SCR] = UART_REG_UNMAPPED,
};
-static const s8 au_io_out_map[8] = {
+static const u8 au_io_out_map[5] = {
[UART_TX] = 1,
[UART_IER] = 2,
[UART_FCR] = 4,
[UART_LCR] = 5,
[UART_MCR] = 6,
- [UART_LSR] = UART_REG_UNMAPPED,
- [UART_MSR] = UART_REG_UNMAPPED,
- [UART_SCR] = UART_REG_UNMAPPED,
};
static unsigned int au_serial_in(struct uart_port *p, int offset)
if (offset >= ARRAY_SIZE(au_io_in_map))
return UINT_MAX;
offset = au_io_in_map[offset];
- if (offset == UART_REG_UNMAPPED)
- return UINT_MAX;
+
return __raw_readl(p->membase + (offset << p->regshift));
}
if (offset >= ARRAY_SIZE(au_io_out_map))
return;
offset = au_io_out_map[offset];
- if (offset == UART_REG_UNMAPPED)
- return;
+
__raw_writel(value, p->membase + (offset << p->regshift));
}