aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-01-05 12:49:33 -0500
committerTom Rini <trini@konsulko.com>2023-01-05 12:49:33 -0500
commite30734eb226e81ed5d0714907dbf50e8009b3afe (patch)
treeb54cd35a1c4c9e74f097e7900b3c943617de0e86
parent42dd02a4d1b2197ee8a2e3b174df274f57113ee9 (diff)
downloadu-boot-WIP/fixup-serial-stuff.zip
u-boot-WIP/fixup-serial-stuff.tar.gz
u-boot-WIP/fixup-serial-stuff.tar.bz2
ns16550: Rework the logic behind SYS_NS16550_REG_SIZE dependenciesWIP/fixup-serial-stuff
While it's unfortunate that we need to define a SYS_NS16550_REG_SIZE for DM_SERIAL, we can now clean up the Kconfig logic here slightly to enforce that when using NS16650 we are either using NS16550_DYNAMIC or need to specify a value here. Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--drivers/serial/Kconfig6
-rw-r--r--include/ns16550.h12
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index bb50832..41a4b16 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -771,13 +771,15 @@ config SYS_NS16550_PORT_MAPPED
config SYS_NS16550_REG_SIZE
int "ns16550 register width and endianness"
- depends on SYS_NS16550_SERIAL || SPL_SYS_NS16550_SERIAL
+ depends on SYS_NS16550 && !NS16550_DYNAMIC
range -4 4
default -4 if ARCH_OMAP2PLUS || ARCH_SUNXI
+ default -1 if DM_SERIAL || SPL_DM_SERIAL || TPL_DM_SERIAL
default 1
help
Indicates register width and also endianness. If positive, big-endian
- access is used. If negative, little-endian is used.
+ access is used. If negative, little-endian is used. In the case of
+ DM_SERIAL being enabled, this value is ignored.
config SPL_NS16550_MIN_FUNCTIONS
bool "Only provide NS16550_init and NS16550_putc in SPL"
diff --git a/include/ns16550.h b/include/ns16550.h
index 4f64b30..2c3178b 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -26,20 +26,10 @@
#include <linux/types.h>
-#if CONFIG_IS_ENABLED(DM_SERIAL) && !defined(CONFIG_SYS_NS16550_REG_SIZE)
-/*
- * For driver model we always use one byte per register, and sort out the
- * differences in the driver
- */
-#define CONFIG_SYS_NS16550_REG_SIZE (-1)
-#endif
-
#ifdef CONFIG_NS16550_DYNAMIC
#define UART_REG(x) unsigned char x
#else
-#if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
-#error "Please define NS16550 registers size."
-#elif (CONFIG_SYS_NS16550_REG_SIZE > 0)
+#if (CONFIG_SYS_NS16550_REG_SIZE > 0)
#define UART_REG(x) \
unsigned char prepad_##x[CONFIG_SYS_NS16550_REG_SIZE - 1]; \
unsigned char x;