2 * Copyright (c) 2014 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0+
13 DECLARE_GLOBAL_DATA_PTR;
15 #ifdef CONFIG_OF_CONTROL
16 static const struct udevice_id omap_serial_ids[] = {
17 { .compatible = "ti,omap3-uart" },
21 static int omap_serial_ofdata_to_platdata(struct udevice *dev)
23 struct ns16550_platdata *plat = dev_get_platdata(dev);
26 ret = ns16550_serial_ofdata_to_platdata(dev);
29 plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
30 "clock-frequency", -1);
37 U_BOOT_DRIVER(serial_omap_ns16550) = {
38 .name = "serial_omap",
40 .of_match = of_match_ptr(omap_serial_ids),
41 .ofdata_to_platdata = of_match_ptr(omap_serial_ofdata_to_platdata),
42 .platdata_auto_alloc_size = sizeof(struct ns16550_platdata),
43 .priv_auto_alloc_size = sizeof(struct NS16550),
44 .probe = ns16550_serial_probe,
45 .ops = &ns16550_serial_ops,
46 .flags = DM_FLAG_PRE_RELOC,