Unify serial_omap, and use the generic binding.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
};
U_BOOT_DEVICE(igep_uart) = {
- "serial_omap",
+ "ns16550_serial",
&igep_serial
};
};
U_BOOT_DEVICE(sniper_serial) = {
- .name = "serial_omap",
+ .name = "ns16550_serial",
.platdata = &serial_omap_platdata
};
};
U_BOOT_DEVICE(omap3logic_uart) = {
- "serial_omap",
+ "ns16550_serial",
&omap3logic_serial
};
};
U_BOOT_DEVICE(zoom1_uart) = {
- "serial_omap",
+ "ns16550_serial",
&zoom1_serial
};
};
U_BOOT_DEVICE(overo_uart) = {
- "serial_omap",
+ "ns16550_serial",
&overo_serial
};
};
U_BOOT_DEVICE(cairo_uart) = {
- "serial_omap",
+ "ns16550_serial",
&cairo_serial
};
};
U_BOOT_DEVICE(beagle_uart) = {
- "serial_omap",
+ "ns16550_serial",
&beagle_serial
};
};
U_BOOT_DEVICE(devkit8000_uart) = {
- "serial_omap",
+ "ns16550_serial",
&devkit8000_serial
};
obj-$(CONFIG_MXS_AUART) += mxs_auart.o
obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
-obj-$(CONFIG_OMAP_SERIAL) += serial_omap.o
obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
ifndef CONFIG_SPL_BUILD
+++ /dev/null
-/*
- * Copyright (c) 2014 Google, Inc
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <dm.h>
-#include <fdtdec.h>
-#include <ns16550.h>
-#include <serial.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define DEFAULT_CLK_SPEED 48000000 /* 48Mhz */
-
-#if CONFIG_IS_ENABLED(OF_CONTROL)
-static const struct udevice_id omap_serial_ids[] = {
- { .compatible = "ti,omap2-uart" },
- { .compatible = "ti,omap3-uart" },
- { .compatible = "ti,omap4-uart" },
- { .compatible = "ti,am3352-uart" },
- { .compatible = "ti,am4372-uart" },
- { .compatible = "ti,dra742-uart" },
- { }
-};
-
-static int omap_serial_ofdata_to_platdata(struct udevice *dev)
-{
- struct ns16550_platdata *plat = dev_get_platdata(dev);
- int ret;
-
- ret = ns16550_serial_ofdata_to_platdata(dev);
- if (ret)
- return ret;
- plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
- "clock-frequency", DEFAULT_CLK_SPEED);
- plat->reg_shift = 2;
-
- return 0;
-}
-#endif
-
-U_BOOT_DRIVER(serial_omap_ns16550) = {
- .name = "serial_omap",
- .id = UCLASS_SERIAL,
- .of_match = of_match_ptr(omap_serial_ids),
- .ofdata_to_platdata = of_match_ptr(omap_serial_ofdata_to_platdata),
- .platdata_auto_alloc_size = sizeof(struct ns16550_platdata),
- .priv_auto_alloc_size = sizeof(struct NS16550),
- .probe = ns16550_serial_probe,
- .ops = &ns16550_serial_ops,
- .flags = DM_FLAG_PRE_RELOC,
-};
/* NS16550 Configuration */
#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_CLK 48000000
#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_SERIAL)
#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_CLK 48000000
#define CONFIG_SYS_NS16550_REG_SIZE (-4)
#else
-#define CONFIG_OMAP_SERIAL
+#define CONFIG_NS16550_SERIAL
#endif
/* I2C Configuration */
#include <asm/arch/omap.h>
/* Serial support */
-#define CONFIG_OMAP_SERIAL
+#define CONFIG_NS16550_SERIAL
#define CONFIG_DM_SERIAL
#define CONFIG_SYS_NS16550
#define CONFIG_SYS_NS16550_SERIAL
/*
* NS16550 Configuration
*/
-#undef CONFIG_OMAP_SERIAL
+#undef CONFIG_NS16550_SERIAL
+#undef CONFIG_SYS_NS16550_CLK
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE (-4)
#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
#ifndef CONFIG_SPL_BUILD
-#define CONFIG_OMAP_SERIAL
+#define CONFIG_NS16550_SERIAL
#else
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE (-4)
-#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
#endif
#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
#define CONFIG_CONS_INDEX 3
#define CONFIG_SERIAL3 3
#define CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
#ifndef CONFIG_SPL_BUILD
-# define CONFIG_OMAP_SERIAL
+# define CONFIG_NS16550_SERIAL
#endif
#include <asm/arch/omap.h>
#include <asm/arch/omap.h>
#ifndef CONFIG_SPL_BUILD
-# define CONFIG_OMAP_SERIAL
+# define CONFIG_NS16550_SERIAL
#endif
/* Common ARM Erratas */
/* NS16550 Configuration */
#define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
#ifdef CONFIG_SPL_BUILD
# define CONFIG_SYS_NS16550_SERIAL
# define CONFIG_SYS_NS16550_REG_SIZE (-4)
-# define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
#endif
#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \
115200}
* Hardware drivers
*/
#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_CLK 48000000
#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_SERIAL)
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE (-4)
-#define CONFIG_SYS_NS16550_CLK 48000000
#define CONFIG_SYS_NS16550_COM3 UART3_BASE
#else
-#define CONFIG_OMAP_SERIAL
+#define CONFIG_NS16550_SERIAL
#endif
#define CONFIG_CONS_INDEX 3
* Hardware drivers
*/
#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_CLK 48000000
#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_SERIAL)
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE (-4)
-#define CONFIG_SYS_NS16550_CLK 48000000
#else
-#define CONFIG_OMAP_SERIAL
+#define CONFIG_NS16550_SERIAL
#endif
/*