From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Wed, 18 Nov 2015 09:59:42 +0800 Subject: [U-Boot] [PATCH 04/12] ns16550: add generic binding to unify the drivers In-Reply-To: References: <1447684616-10297-1-git-send-email-thomas@wytron.com.tw> <1447684616-10297-5-git-send-email-thomas@wytron.com.tw> Message-ID: <564BDB8E.3070304@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bin, On 2015?11?18? 09:03, Bin Meng wrote: >> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c >> index 8d028de..f0a9aac 100644 >> --- a/drivers/serial/ns16550.c >> +++ b/drivers/serial/ns16550.c >> @@ -56,6 +56,10 @@ DECLARE_GLOBAL_DATA_PTR; >> >> #ifdef CONFIG_DM_SERIAL >> >> +#ifndef CONFIG_SYS_NS16550_CLK >> +#define CONFIG_SYS_NS16550_CLK 0 >> +#endif >> + >> static inline void serial_out_shift(void *addr, int shift, int value) >> { >> #ifdef CONFIG_SYS_NS16550_PORT_MAPPED >> @@ -400,6 +404,15 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) >> plat->base = addr; >> plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset, >> "reg-shift", 1); >> +#ifdef CONFIG_NS16550_SERIAL > > Is this #ifdef necessary? > >> + plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, >> + "clock-frequency", >> + CONFIG_SYS_NS16550_CLK); >> + if (!plat->clock) { >> + debug("ns16550 clock not defined\n"); >> + return -EINVAL; >> + } >> +#endif /* CONFIG_NS16550_SERIAL */ >> >> return 0; >> } >> @@ -411,4 +424,35 @@ const struct dm_serial_ops ns16550_serial_ops = { >> .getc = ns16550_serial_getc, >> .setbrg = ns16550_serial_setbrg, >> }; >> + >> +#ifdef CONFIG_NS16550_SERIAL > > Ditto. These #ifdef is needed during the transition. They will be removed as a follow-up of this series. > >> +#if CONFIG_IS_ENABLED(OF_CONTROL) > > This line should be removed too? > Some spl build with DM platdata but not of_control. So this is needed. Best regards, Thomas