diff options
author | Alexandru Gagniuc <alex.g@adaptrum.com> | 2017-03-27 12:54:19 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-04-13 11:43:23 -0600 |
commit | 6f8c351e98726ec9b569bf16f7efa2a4e4648727 (patch) | |
tree | 823955ee5b6fb7e727bbebd8ac97c6045d652dec | |
parent | 40a808f173008729a0c631ab84693b6a2b0dcfc9 (diff) | |
download | u-boot-6f8c351e98726ec9b569bf16f7efa2a4e4648727.zip u-boot-6f8c351e98726ec9b569bf16f7efa2a4e4648727.tar.gz u-boot-6f8c351e98726ec9b569bf16f7efa2a4e4648727.tar.bz2 |
serial: ns16550: Link in the DM driver when when using platdata
Do not condition the compilation of the U_BOOT_DRIVER by !OF_PLATDATA.
This is inconsistent with the majority of other drivers. This also
blocks OF_PLATDATA boards with an 16550-compatible serial from using
serial in SPL.
Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Added tweak for rock to avoid a TPL build failure:
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | configs/rock_defconfig | 1 | ||||
-rw-r--r-- | drivers/serial/ns16550.c | 13 |
2 files changed, 9 insertions, 5 deletions
diff --git a/configs/rock_defconfig b/configs/rock_defconfig index 20a065a..b61286e 100644 --- a/configs/rock_defconfig +++ b/configs/rock_defconfig @@ -40,6 +40,7 @@ CONFIG_PMIC_ACT8846=y CONFIG_REGULATOR_ACT8846=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_RAM=y +# CONFIG_TPL_DM_SERIAL is not set CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_BASE=0x20064000 CONFIG_DEBUG_UART_CLOCK=24000000 diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 1f819d4..4f86780 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -452,8 +452,7 @@ const struct dm_serial_ops ns16550_serial_ops = { .setbrg = ns16550_serial_setbrg, }; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) -#if CONFIG_IS_ENABLED(OF_CONTROL) +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) /* * Please consider existing compatible strings before adding a new * one to keep this table compact. Or you may add a generic "ns16550" @@ -473,13 +472,16 @@ static const struct udevice_id ns16550_serial_ids[] = { { .compatible = "ti,dra742-uart", .data = PORT_NS16550 }, {} }; -#endif +#endif /* OF_CONTROL && !OF_PLATDATA */ #if CONFIG_IS_ENABLED(SERIAL_PRESENT) + +/* TODO(sjg@chromium.org): Integrate this into a macro like CONFIG_IS_ENABLED */ +#if !defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_DM_SERIAL) U_BOOT_DRIVER(ns16550_serial) = { .name = "ns16550_serial", .id = UCLASS_SERIAL, -#if CONFIG_IS_ENABLED(OF_CONTROL) +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .of_match = ns16550_serial_ids, .ofdata_to_platdata = ns16550_serial_ofdata_to_platdata, .platdata_auto_alloc_size = sizeof(struct ns16550_platdata), @@ -490,5 +492,6 @@ U_BOOT_DRIVER(ns16550_serial) = { .flags = DM_FLAG_PRE_RELOC, }; #endif -#endif /* !OF_PLATDATA */ +#endif /* SERIAL_PRESENT */ + #endif /* CONFIG_DM_SERIAL */ |