2 * Copyright (c) 2015 Texas Instruments, <www.ti.com>
4 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/clock.h>
14 DECLARE_GLOBAL_DATA_PTR;
16 #if CONFIG_IS_ENABLED(OF_CONTROL)
17 static const struct udevice_id keystone_serial_ids[] = {
18 { .compatible = "ti,keystone-uart" },
19 { .compatible = "ns16550a" },
23 static int keystone_serial_ofdata_to_platdata(struct udevice *dev)
25 struct ns16550_platdata *plat = dev_get_platdata(dev);
28 ret = ns16550_serial_ofdata_to_platdata(dev);
31 plat->clock = CONFIG_SYS_NS16550_CLK;
36 U_BOOT_DRIVER(serial_keystone_ns16550) = {
37 .name = "serial_keystone",
39 #if CONFIG_IS_ENABLED(OF_CONTROL)
40 .of_match = of_match_ptr(keystone_serial_ids),
41 .ofdata_to_platdata = of_match_ptr(keystone_serial_ofdata_to_platdata),
42 .platdata_auto_alloc_size = sizeof(struct ns16550_platdata),
44 .priv_auto_alloc_size = sizeof(struct NS16550),
45 .probe = ns16550_serial_probe,
46 .ops = &ns16550_serial_ops,
47 .flags = DM_FLAG_PRE_RELOC,