2 * Copyright (c) 2015 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <debug_uart.h>
10 #include <dt-structs.h>
13 #include <asm/arch/clock.h>
15 struct rockchip_uart_platdata {
16 struct dtd_rockchip_rk3288_uart dtplat;
17 struct ns16550_platdata plat;
20 struct dtd_rockchip_rk3288_uart *dtplat, s_dtplat;
22 static int rockchip_serial_probe(struct udevice *dev)
24 struct rockchip_uart_platdata *plat = dev_get_platdata(dev);
26 /* Create some new platform data for the standard driver */
27 plat->plat.base = plat->dtplat.reg[0];
28 plat->plat.reg_shift = plat->dtplat.reg_shift;
29 plat->plat.clock = plat->dtplat.clock_frequency;
30 dev->platdata = &plat->plat;
32 return ns16550_serial_probe(dev);
35 U_BOOT_DRIVER(rockchip_rk3288_uart) = {
36 .name = "rockchip_rk3288_uart",
38 .priv_auto_alloc_size = sizeof(struct NS16550),
39 .platdata_auto_alloc_size = sizeof(struct rockchip_uart_platdata),
40 .probe = rockchip_serial_probe,
41 .ops = &ns16550_serial_ops,
42 .flags = DM_FLAG_PRE_RELOC,