[U-Boot] [PATCH v2 2/5] serial: ns16550: Read reg-io-width from device tree
Simon Glass
sjg at chromium.org
Thu Nov 15 19:45:34 UTC 2018
Hi Andy,
On 15 November 2018 at 09:58, Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
> Cache the value of the reg-io-width property for the future use.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> ---
> drivers/serial/ns16550.c | 1 +
> include/ns16550.h | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index f9041aa626..b51b56de9f 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -408,6 +408,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);
>
Is your intent to actually use this for something? It sounds good, as
at present we have all the horrible #ifdefs.
> err = clk_get_by_index(dev, 0, &clk);
> if (!err) {
> diff --git a/include/ns16550.h b/include/ns16550.h
> index 5fcbcd2e74..22b89e4d6d 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -49,14 +49,16 @@
> * 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 clock;
> int reg_offset;
> + int clock;
Should be in a separate patch.
> u32 fcr;
> };
>
> --
> 2.19.1
>
Regards,
Simon
More information about the U-Boot
mailing list