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>
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 4978a65..14b0feb 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -737,7 +737,7 @@
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 5a693d2..772dd6f 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -92,8 +92,8 @@
#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 @@
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 03b9e86..6fb4cb6 100644
--- a/drivers/serial/serial_mtk.c
+++ b/drivers/serial/serial_mtk.c
@@ -284,8 +284,8 @@
#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 @@
#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 @@
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 76aa1e5..4014f68 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -20,17 +20,17 @@
#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 @@
* 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 @@
{ \
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 @@
{
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_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 @@
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 e9ff61a..904f7d2 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 @@
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;