From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Brodkin Date: Fri, 11 Jan 2019 08:33:09 +0000 Subject: [U-Boot] [PATCH v1 3/4] serial: add an of-platdata driver for "snps, dw-apb-uart" In-Reply-To: <02cacbce-5906-a2ae-3559-f0e0a22391b7@gmail.com> References: <20190107211423.10151-1-simon.k.r.goldschmidt@gmail.com> <20190107211423.10151-4-simon.k.r.goldschmidt@gmail.com> <4881796E12491D4BB15146FE0209CE64681C1E9A@DE02WEMBXB.internal.synopsys.com> <02cacbce-5906-a2ae-3559-f0e0a22391b7@gmail.com> Message-ID: <4881796E12491D4BB15146FE0209CE64681C361D@DE02WEMBXB.internal.synopsys.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi Simon, [snip] > >> +config DESIGNWARE_SERIAL > >> + bool "DesignWare UART support" > >> + depends on DM_SERIAL && SPL_OF_PLATDATA > > > > Might be a bit na=C3=AFve question but why depend on SPL_OF_PLATDATA on= ly? > > What about CONFIG_OF_EMBED? Ok I completely forgot that standard ns16550 driver already covers DW APB U= ART, see https://elixir.bootlin.com/u-boot/latest/source/drivers/serial/ns16550.= c#L456 > > I'd happily switch my ARC boards on this driver and get rid of all > > CONFIG_SYS_NS16550_xxx nonsense in include/configs/myboardname.h >=20 > I checked include/configs/socfpga_common.h again and by its using > Kconfig and DM_SERIAL, there are no CONFIG_SYS_NS16550_xxx defines left > (other than CONFIG_SYS_NS16550_SERIAL, which I will remove). So it's not that easy apparently :) At least CONFIG_SYS_NS16550_MEM32 is still used really required for getting correct accessor used, see implementation of serial_{in|out}_shift() in drivers/serial/ns16550.c. If CONFIG_SYS_NS16550_MEM32 is not set then simple readb() is used so that 8-bit data offset in 32-bit word is lost and we're dead in the water. That said accessors in ns16550 are begging for significant rework to make the driver completely OF-driven. -Alexey