diff options
| author | Zong Li <[email protected]> | 2022-04-15 02:24:20 +0000 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2022-04-17 13:57:48 +0530 |
| commit | 5c5cbb53a4fd2f7d2a7038b584f8ee01266cef04 (patch) | |
| tree | 6b5b44ba31b880503dc722bd2a707b0d8b14e1f4 /lib/utils/serial | |
| parent | 3383d6a4d1461bb029b21fa53417382e34ae4906 (diff) | |
lib: utils/serial: support 'reg-offset' property
reg-offset property is used for offset to apply to the mapbase
from the start of the registers in 8250 UART. In Linux kernel,
it has been handled in 8250 UART driver.
dt-bindings:
<linux>/Documentation/devicetree/bindings/serial/8250.yaml
Signed-off-by: Zong Li <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/serial')
| -rw-r--r-- | lib/utils/serial/fdt_serial_uart8250.c | 3 | ||||
| -rw-r--r-- | lib/utils/serial/uart8250.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/utils/serial/fdt_serial_uart8250.c b/lib/utils/serial/fdt_serial_uart8250.c index 36f364cf..544b7416 100644 --- a/lib/utils/serial/fdt_serial_uart8250.c +++ b/lib/utils/serial/fdt_serial_uart8250.c @@ -22,7 +22,8 @@ static int serial_uart8250_init(void *fdt, int nodeoff, return rc; return uart8250_init(uart.addr, uart.freq, uart.baud, - uart.reg_shift, uart.reg_io_width); + uart.reg_shift, uart.reg_io_width, + uart.reg_offset); } static const struct fdt_match serial_uart8250_match[] = { diff --git a/lib/utils/serial/uart8250.c b/lib/utils/serial/uart8250.c index 141bd45c..38ea11af 100644 --- a/lib/utils/serial/uart8250.c +++ b/lib/utils/serial/uart8250.c @@ -91,11 +91,11 @@ static struct sbi_console_device uart8250_console = { }; int uart8250_init(unsigned long base, u32 in_freq, u32 baudrate, u32 reg_shift, - u32 reg_width) + u32 reg_width, u32 reg_offset) { u16 bdiv; - uart8250_base = (volatile char *)base; + uart8250_base = (volatile char *)base + reg_offset; uart8250_reg_shift = reg_shift; uart8250_reg_width = reg_width; uart8250_in_freq = in_freq; |
