[U-Boot] [PATCH v2] serial: ns16550: Add register shift variable

Alexander Graf agraf at suse.de
Tue Jul 17 09:12:01 UTC 2018


On 07/17/2018 09:55 AM, Lokesh Vutla wrote:
>
> On Tuesday 17 July 2018 12:32 PM, Felix Brack wrote:
>> This patch adds a new Kconfig variable that allows setting
>> the register offset shift value for the ns16550 driver to some
>> other value then 0 if not defined by the DT. All credit for this
>> patch goes to Lokesh Vutla as it was his idea.
>>
>> The motivation for writing this patch originates in the
>> effort of synchronizing U-Boot DT to Linux DT for am33xx SOCs.
>> The current am33xx.dtsi file from U-Boot defines the <reg-shift>
>> property for all UART nodes. The actual (4.18+) am33xx.dtsi
>> file from Linux does not define <reg-shift> anymore. To prevent
>> (probably difficult) changes in many .dts and .dtsi files once
>> the synchronization is done, one can use this new variable. For
>> the pdu001 board, for example, SYS_NS16550_REG_SHIFT is set
>> to 2; no need to clutter U-Boot and board specific dts files
>> with <reg-shift> properties.
>>
>> Signed-off-by: Felix Brack <fb at ltec.ch>

NAK. Please determine the shift value from the compatible instead. 
Ideally you would create a subclass of the ns16550 device class and set 
reg_shift in there.

Take a look at drivers/serial/serial_rockchip.c for an example.


Alex



More information about the U-Boot mailing list