A non-trivial amount of RT288x/Au1xxx code is encapsulated into...
ifdeffery in 8250_port / 8250_early and some if UPIO_AU blocks.
Create a separate file from them. Add mapsize, bugs, and divisor latch
read/write functions into plat_serial8250_port to carry the setup
necessary for these devices over to uart port.
Also handle errors properly in the cases where RT288x/Au1xxx code is
not configured.
It seems that 0x1000 mapsize is likely overkill but I've kept it the
same as previously (the value was shrunk to that value in b2b13cdfd05e
("SERIAL 8250: Fixes for Alchemy UARTs.")). Seemingly, the driver only
needs to access register at 0x28 for the divisor latch.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
--- a/include/linux/serial_8250.h...
+++ b/include/linux/serial_8250.h
@@ -28,8 +32,11 @@ struct plat_serial8250_port {
unsigned char has_sysrq; /* supports magic SysRq */
upf_t flags; /* UPF_* flags */
unsigned int type; /* If UPF_FIXED_TYPE */
+ unsigned short bugs; /* port bugs */
unsigned int (*serial_in)(struct uart_port *, int);
void (*serial_out)(struct uart_port *, int, int);
+ int (*dl_read)(struct uart_8250_port *);
+ void (*dl_write)(struct uart_8250_port *, int);
void (*set_termios)(struct uart_port *,
struct ktermios *new,
const struct ktermios *old);