From: Andy Shevchenko Date: Tue, 20 Nov 2018 21:52:35 +0000 (+0200) Subject: serial: ns16550: Read reg-io-width from device tree X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=4e7207791c05b3ecff916c1b1b1b21401ec29b0b;p=u-boot.git serial: ns16550: Read reg-io-width from device tree Cache the value of the reg-io-width property for the future use. Signed-off-by: Andy Shevchenko Reviewed-by: Simon Glass --- diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 25b9d17243..9d78b1ffc4 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -446,6 +446,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) plat->reg_offset = dev_read_u32_default(dev, "reg-offset", 0); plat->reg_shift = dev_read_u32_default(dev, "reg-shift", 0); + plat->reg_width = dev_read_u32_default(dev, "reg-io-width", 1); err = clk_get_by_index(dev, 0, &clk); if (!err) { diff --git a/include/ns16550.h b/include/ns16550.h index f565645d65..22b89e4d6d 100644 --- a/include/ns16550.h +++ b/include/ns16550.h @@ -49,11 +49,13 @@ * struct ns16550_platdata - information about a NS16550 port * * @base: Base register address + * @reg_width: IO accesses size of registers (in bytes) * @reg_shift: Shift size of registers (0=byte, 1=16bit, 2=32bit...) * @clock: UART base clock speed in Hz */ struct ns16550_platdata { unsigned long base; + int reg_width; int reg_shift; int reg_offset; int clock;