From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lokesh Vutla Date: Tue, 17 Jul 2018 15:01:12 +0530 Subject: [U-Boot] [PATCH v2] serial: ns16550: Add register shift variable In-Reply-To: <34d48d02-901f-56de-a12f-636eaa2068b2@suse.de> References: <1531810943-3417-1-git-send-email-fb@ltec.ch> <73fa69c3-552b-e1d9-bbbf-2825a0b9c5ca@ti.com> <2e208e94-a428-fe7f-0e7c-4ee288904d3d@ti.com> <34d48d02-901f-56de-a12f-636eaa2068b2@suse.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Tuesday 17 July 2018 02:57 PM, Alexander Graf wrote: > On 07/17/2018 11:21 AM, Lokesh Vutla wrote: >> >> On Tuesday 17 July 2018 02:42 PM, Alexander Graf wrote: >>> 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 >>>>> property for all UART nodes. The actual (4.18+) am33xx.dtsi >>>>> file from Linux does not define 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 properties. >>>>> >>>>> Signed-off-by: Felix Brack >>> 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. >> There was a separate driver for omap_serial initially but was deleted by >> the below commit: >> >> commit c7b9686d5d482c8e952598841ea467e6ec0ec0de >> Author: Thomas Chou >> Date:   Thu Nov 19 21:48:12 2015 +0800 >> >>      ns16550: unify serial_omap >> >>      Unify serial_omap, and use the generic binding. >> >>      Signed-off-by: Thomas Chou >>      Reviewed-by: Tom Rini >>      Acked-by: Simon Glass > > Sounds like that wasn't a terribly smart move :). > > If you really don't want a separate driver (and I'm not sure why you > wouldn't), declare a separate PORT for ti,omap3-uart in > ns16550_serial_ids and set the shift value based on that in > ns16550_serial_ofdata_to_platdata() if DT doesn't describe one. I do prefer a separate driver. But I don't want to see a patch again reverting the driver :P. Tom, Simon, What do you prefer? Thanks and regards, Lokesh