summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-11-16 21:10:28 +0300
committerTom Rini <trini@konsulko.com>2022-12-06 00:06:07 +0300
commit91092132bac0ae768beb76c12ef8be732ea6ba3a (patch)
tree31ccd29d50d1410aa84bbfc0c2384feaf97181f3 /drivers
parent9591b63531fa5a34698ee7bb3800af6c4ea6ba2f (diff)
downloadu-boot-91092132bac0ae768beb76c12ef8be732ea6ba3a.tar.xz
global: Move remaining CONFIG_SYS_NS16550_* to CFG_SYS_NS16550_*
The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_NS16550 namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/Kconfig2
-rw-r--r--drivers/serial/ns16550.c8
-rw-r--r--drivers/serial/serial_mtk.c40
-rw-r--r--drivers/serial/serial_ns16550.c64
-rw-r--r--drivers/serial/serial_omap.c6
5 files changed, 60 insertions, 60 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 4978a65715..14b0febd1a 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -737,7 +737,7 @@ config SYS_NS16550
Support NS16550 UART or compatible. This can be enabled in the
device tree with the correct input clock frequency. If the input
clock frequency is not defined in the device tree, the macro
- CONFIG_SYS_NS16550_CLK defined in a legacy board header file will
+ CFG_SYS_NS16550_CLK defined in a legacy board header file will
be used. It can be a constant or a function to get clock, eg,
get_serial_clock().
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 5a693d2f02..772dd6fef8 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -92,8 +92,8 @@ static inline int serial_in_shift(void *addr, int shift)
#if CONFIG_IS_ENABLED(DM_SERIAL)
-#ifndef CONFIG_SYS_NS16550_CLK
-#define CONFIG_SYS_NS16550_CLK 0
+#ifndef CFG_SYS_NS16550_CLK
+#define CFG_SYS_NS16550_CLK 0
#endif
/*
@@ -567,9 +567,9 @@ int ns16550_serial_of_to_plat(struct udevice *dev)
if (!plat->clock)
plat->clock = dev_read_u32_default(dev, "clock-frequency",
- CONFIG_SYS_NS16550_CLK);
+ CFG_SYS_NS16550_CLK);
if (!plat->clock)
- plat->clock = CONFIG_SYS_NS16550_CLK;
+ plat->clock = CFG_SYS_NS16550_CLK;
if (!plat->clock) {
debug("ns16550 clock not defined\n");
return -EINVAL;
diff --git a/drivers/serial/serial_mtk.c b/drivers/serial/serial_mtk.c
index 03b9e86bfc..6fb4cb65c2 100644
--- a/drivers/serial/serial_mtk.c
+++ b/drivers/serial/serial_mtk.c
@@ -284,8 +284,8 @@ DECLARE_GLOBAL_DATA_PTR;
#define DECLARE_HSUART_PRIV(port) \
static struct mtk_serial_priv mtk_hsuart##port = { \
- .regs = (struct mtk_serial_regs *)CONFIG_SYS_NS16550_COM##port, \
- .fixed_clk_rate = CONFIG_SYS_NS16550_CLK \
+ .regs = (struct mtk_serial_regs *)CFG_SYS_NS16550_COM##port, \
+ .fixed_clk_rate = CFG_SYS_NS16550_CLK \
};
#define DECLARE_HSUART_FUNCTIONS(port) \
@@ -356,36 +356,36 @@ DECLARE_GLOBAL_DATA_PTR;
#error "Invalid console index value."
#endif
-#if CONFIG_CONS_INDEX == 1 && !defined(CONFIG_SYS_NS16550_COM1)
+#if CONFIG_CONS_INDEX == 1 && !defined(CFG_SYS_NS16550_COM1)
#error "Console port 1 defined but not configured."
-#elif CONFIG_CONS_INDEX == 2 && !defined(CONFIG_SYS_NS16550_COM2)
+#elif CONFIG_CONS_INDEX == 2 && !defined(CFG_SYS_NS16550_COM2)
#error "Console port 2 defined but not configured."
-#elif CONFIG_CONS_INDEX == 3 && !defined(CONFIG_SYS_NS16550_COM3)
+#elif CONFIG_CONS_INDEX == 3 && !defined(CFG_SYS_NS16550_COM3)
#error "Console port 3 defined but not configured."
-#elif CONFIG_CONS_INDEX == 4 && !defined(CONFIG_SYS_NS16550_COM4)
+#elif CONFIG_CONS_INDEX == 4 && !defined(CFG_SYS_NS16550_COM4)
#error "Console port 4 defined but not configured."
-#elif CONFIG_CONS_INDEX == 5 && !defined(CONFIG_SYS_NS16550_COM5)
+#elif CONFIG_CONS_INDEX == 5 && !defined(CFG_SYS_NS16550_COM5)
#error "Console port 5 defined but not configured."
-#elif CONFIG_CONS_INDEX == 6 && !defined(CONFIG_SYS_NS16550_COM6)
+#elif CONFIG_CONS_INDEX == 6 && !defined(CFG_SYS_NS16550_COM6)
#error "Console port 6 defined but not configured."
#endif
-#if defined(CONFIG_SYS_NS16550_COM1)
+#if defined(CFG_SYS_NS16550_COM1)
DECLARE_HSUART(1, "mtk-hsuart0");
#endif
-#if defined(CONFIG_SYS_NS16550_COM2)
+#if defined(CFG_SYS_NS16550_COM2)
DECLARE_HSUART(2, "mtk-hsuart1");
#endif
-#if defined(CONFIG_SYS_NS16550_COM3)
+#if defined(CFG_SYS_NS16550_COM3)
DECLARE_HSUART(3, "mtk-hsuart2");
#endif
-#if defined(CONFIG_SYS_NS16550_COM4)
+#if defined(CFG_SYS_NS16550_COM4)
DECLARE_HSUART(4, "mtk-hsuart3");
#endif
-#if defined(CONFIG_SYS_NS16550_COM5)
+#if defined(CFG_SYS_NS16550_COM5)
DECLARE_HSUART(5, "mtk-hsuart4");
#endif
-#if defined(CONFIG_SYS_NS16550_COM6)
+#if defined(CFG_SYS_NS16550_COM6)
DECLARE_HSUART(6, "mtk-hsuart5");
#endif
@@ -410,22 +410,22 @@ __weak struct serial_device *default_serial_console(void)
void mtk_serial_initialize(void)
{
-#if defined(CONFIG_SYS_NS16550_COM1)
+#if defined(CFG_SYS_NS16550_COM1)
serial_register(&mtk_hsuart1_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM2)
+#if defined(CFG_SYS_NS16550_COM2)
serial_register(&mtk_hsuart2_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM3)
+#if defined(CFG_SYS_NS16550_COM3)
serial_register(&mtk_hsuart3_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM4)
+#if defined(CFG_SYS_NS16550_COM4)
serial_register(&mtk_hsuart4_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM5)
+#if defined(CFG_SYS_NS16550_COM5)
serial_register(&mtk_hsuart5_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM6)
+#if defined(CFG_SYS_NS16550_COM6)
serial_register(&mtk_hsuart6_device);
#endif
}
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 76aa1e5afb..4014f68204 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -20,17 +20,17 @@ DECLARE_GLOBAL_DATA_PTR;
#error "Invalid console index value."
#endif
-#if CONFIG_CONS_INDEX == 1 && !defined(CONFIG_SYS_NS16550_COM1)
+#if CONFIG_CONS_INDEX == 1 && !defined(CFG_SYS_NS16550_COM1)
#error "Console port 1 defined but not configured."
-#elif CONFIG_CONS_INDEX == 2 && !defined(CONFIG_SYS_NS16550_COM2)
+#elif CONFIG_CONS_INDEX == 2 && !defined(CFG_SYS_NS16550_COM2)
#error "Console port 2 defined but not configured."
-#elif CONFIG_CONS_INDEX == 3 && !defined(CONFIG_SYS_NS16550_COM3)
+#elif CONFIG_CONS_INDEX == 3 && !defined(CFG_SYS_NS16550_COM3)
#error "Console port 3 defined but not configured."
-#elif CONFIG_CONS_INDEX == 4 && !defined(CONFIG_SYS_NS16550_COM4)
+#elif CONFIG_CONS_INDEX == 4 && !defined(CFG_SYS_NS16550_COM4)
#error "Console port 4 defined but not configured."
-#elif CONFIG_CONS_INDEX == 5 && !defined(CONFIG_SYS_NS16550_COM5)
+#elif CONFIG_CONS_INDEX == 5 && !defined(CFG_SYS_NS16550_COM5)
#error "Console port 5 defined but not configured."
-#elif CONFIG_CONS_INDEX == 6 && !defined(CONFIG_SYS_NS16550_COM6)
+#elif CONFIG_CONS_INDEX == 6 && !defined(CFG_SYS_NS16550_COM6)
#error "Console port 6 defined but not configured."
#endif
@@ -38,33 +38,33 @@ DECLARE_GLOBAL_DATA_PTR;
* the array is 0 based.
*/
static struct ns16550 *serial_ports[6] = {
-#ifdef CONFIG_SYS_NS16550_COM1
- (struct ns16550 *)CONFIG_SYS_NS16550_COM1,
+#ifdef CFG_SYS_NS16550_COM1
+ (struct ns16550 *)CFG_SYS_NS16550_COM1,
#else
NULL,
#endif
-#ifdef CONFIG_SYS_NS16550_COM2
- (struct ns16550 *)CONFIG_SYS_NS16550_COM2,
+#ifdef CFG_SYS_NS16550_COM2
+ (struct ns16550 *)CFG_SYS_NS16550_COM2,
#else
NULL,
#endif
-#ifdef CONFIG_SYS_NS16550_COM3
- (struct ns16550 *)CONFIG_SYS_NS16550_COM3,
+#ifdef CFG_SYS_NS16550_COM3
+ (struct ns16550 *)CFG_SYS_NS16550_COM3,
#else
NULL,
#endif
-#ifdef CONFIG_SYS_NS16550_COM4
- (struct ns16550 *)CONFIG_SYS_NS16550_COM4,
+#ifdef CFG_SYS_NS16550_COM4
+ (struct ns16550 *)CFG_SYS_NS16550_COM4,
#else
NULL,
#endif
-#ifdef CONFIG_SYS_NS16550_COM5
- (struct ns16550 *)CONFIG_SYS_NS16550_COM5,
+#ifdef CFG_SYS_NS16550_COM5
+ (struct ns16550 *)CFG_SYS_NS16550_COM5,
#else
NULL,
#endif
-#ifdef CONFIG_SYS_NS16550_COM6
- (struct ns16550 *)CONFIG_SYS_NS16550_COM6
+#ifdef CFG_SYS_NS16550_COM6
+ (struct ns16550 *)CFG_SYS_NS16550_COM6
#else
NULL
#endif
@@ -78,7 +78,7 @@ static struct ns16550 *serial_ports[6] = {
{ \
int clock_divisor; \
clock_divisor = ns16550_calc_divisor(serial_ports[port-1], \
- CONFIG_SYS_NS16550_CLK, gd->baudrate); \
+ CFG_SYS_NS16550_CLK, gd->baudrate); \
ns16550_init(serial_ports[port - 1], clock_divisor); \
return 0 ; \
} \
@@ -144,7 +144,7 @@ static void _serial_setbrg(const int port)
{
int clock_divisor;
- clock_divisor = ns16550_calc_divisor(PORT, CONFIG_SYS_NS16550_CLK,
+ clock_divisor = ns16550_calc_divisor(PORT, CFG_SYS_NS16550_CLK,
gd->baudrate);
ns16550_reinit(PORT, clock_divisor);
}
@@ -179,32 +179,32 @@ serial_setbrg_dev(unsigned int dev_index)
_serial_setbrg(dev_index);
}
-#if defined(CONFIG_SYS_NS16550_COM1)
+#if defined(CFG_SYS_NS16550_COM1)
DECLARE_ESERIAL_FUNCTIONS(1);
struct serial_device eserial1_device =
INIT_ESERIAL_STRUCTURE(1, "eserial0");
#endif
-#if defined(CONFIG_SYS_NS16550_COM2)
+#if defined(CFG_SYS_NS16550_COM2)
DECLARE_ESERIAL_FUNCTIONS(2);
struct serial_device eserial2_device =
INIT_ESERIAL_STRUCTURE(2, "eserial1");
#endif
-#if defined(CONFIG_SYS_NS16550_COM3)
+#if defined(CFG_SYS_NS16550_COM3)
DECLARE_ESERIAL_FUNCTIONS(3);
struct serial_device eserial3_device =
INIT_ESERIAL_STRUCTURE(3, "eserial2");
#endif
-#if defined(CONFIG_SYS_NS16550_COM4)
+#if defined(CFG_SYS_NS16550_COM4)
DECLARE_ESERIAL_FUNCTIONS(4);
struct serial_device eserial4_device =
INIT_ESERIAL_STRUCTURE(4, "eserial3");
#endif
-#if defined(CONFIG_SYS_NS16550_COM5)
+#if defined(CFG_SYS_NS16550_COM5)
DECLARE_ESERIAL_FUNCTIONS(5);
struct serial_device eserial5_device =
INIT_ESERIAL_STRUCTURE(5, "eserial4");
#endif
-#if defined(CONFIG_SYS_NS16550_COM6)
+#if defined(CFG_SYS_NS16550_COM6)
DECLARE_ESERIAL_FUNCTIONS(6);
struct serial_device eserial6_device =
INIT_ESERIAL_STRUCTURE(6, "eserial5");
@@ -231,22 +231,22 @@ __weak struct serial_device *default_serial_console(void)
void ns16550_serial_initialize(void)
{
-#if defined(CONFIG_SYS_NS16550_COM1)
+#if defined(CFG_SYS_NS16550_COM1)
serial_register(&eserial1_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM2)
+#if defined(CFG_SYS_NS16550_COM2)
serial_register(&eserial2_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM3)
+#if defined(CFG_SYS_NS16550_COM3)
serial_register(&eserial3_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM4)
+#if defined(CFG_SYS_NS16550_COM4)
serial_register(&eserial4_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM5)
+#if defined(CFG_SYS_NS16550_COM5)
serial_register(&eserial5_device);
#endif
-#if defined(CONFIG_SYS_NS16550_COM6)
+#if defined(CFG_SYS_NS16550_COM6)
serial_register(&eserial6_device);
#endif
}
diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c
index e9ff61a0ba..904f7d21bf 100644
--- a/drivers/serial/serial_omap.c
+++ b/drivers/serial/serial_omap.c
@@ -15,8 +15,8 @@
#include <clk.h>
#include <linux/err.h>
-#ifndef CONFIG_SYS_NS16550_CLK
-#define CONFIG_SYS_NS16550_CLK 0
+#ifndef CFG_SYS_NS16550_CLK
+#define CFG_SYS_NS16550_CLK 0
#endif
#ifdef CONFIG_DEBUG_UART_OMAP
@@ -128,7 +128,7 @@ static int omap_serial_of_to_plat(struct udevice *dev)
if (!plat->clock)
plat->clock = dev_read_u32_default(dev, "clock-frequency",
- CONFIG_SYS_NS16550_CLK);
+ CFG_SYS_NS16550_CLK);
if (!plat->clock) {
debug("omap serial clock not defined\n");
return -EINVAL;