2 * Copyright (c) 2014 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0+
12 #ifdef CONFIG_OF_CONTROL
13 static const struct udevice_id tegra_serial_ids
[] = {
14 { .compatible
= "nvidia,tegra20-uart" },
18 static int tegra_serial_ofdata_to_platdata(struct udevice
*dev
)
20 struct ns16550_platdata
*plat
= dev_get_platdata(dev
);
23 ret
= ns16550_serial_ofdata_to_platdata(dev
);
26 plat
->clock
= V_NS16550_CLK
;
31 struct ns16550_platdata tegra_serial
= {
32 .base
= CONFIG_SYS_NS16550_COM1
,
34 .clock
= V_NS16550_CLK
,
37 U_BOOT_DEVICE(ns16550_serial
) = {
38 "serial_tegra20", &tegra_serial
42 U_BOOT_DRIVER(serial_ns16550
) = {
43 .name
= "serial_tegra20",
45 #ifdef CONFIG_OF_CONTROL
46 .of_match
= tegra_serial_ids
,
47 .ofdata_to_platdata
= tegra_serial_ofdata_to_platdata
,
48 .platdata_auto_alloc_size
= sizeof(struct ns16550_platdata
),
50 .priv_auto_alloc_size
= sizeof(struct NS16550
),
51 .probe
= ns16550_serial_probe
,
52 .ops
= &ns16550_serial_ops
,
53 .flags
= DM_FLAG_PRE_RELOC
,