aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2023-05-19 12:43:52 +0200
committerStefano Babic <sbabic@denx.de>2023-07-11 14:40:04 +0200
commit875752adc8b6a25ebaf9f45cb3fd206065a80f0e (patch)
tree8bfd3270db32cf3a24cb934d7eabab69f4717ae2 /drivers
parentfdef5e1502a6b847acf3252c0f21739a3a4e181c (diff)
downloadu-boot-875752adc8b6a25ebaf9f45cb3fd206065a80f0e.zip
u-boot-875752adc8b6a25ebaf9f45cb3fd206065a80f0e.tar.gz
u-boot-875752adc8b6a25ebaf9f45cb3fd206065a80f0e.tar.bz2
serial: pl01x: Prepare the driver to support SPL_OF_PLATDATA
This commit prepares the pl01x serial driver to be used with SPL_OF_PLATDATA enabled. Signed-off-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_pl01x.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 18332c2..dbf2b2d 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -291,8 +291,16 @@ int pl01x_serial_probe(struct udevice *dev)
struct pl01x_serial_plat *plat = dev_get_plat(dev);
struct pl01x_priv *priv = dev_get_priv(dev);
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+ struct dtd_serial_pl01x *dtplat = &plat->dtplat;
+
+ priv->regs = (struct pl01x_regs *)dtplat->reg[0];
+ plat->type = dtplat->type;
+#else
priv->regs = (struct pl01x_regs *)plat->base;
+#endif
priv->type = plat->type;
+
if (!plat->skip_init)
return pl01x_generic_serial_init(priv->regs, priv->type);
else
@@ -380,8 +388,10 @@ int pl01x_serial_of_to_plat(struct udevice *dev)
U_BOOT_DRIVER(serial_pl01x) = {
.name = "serial_pl01x",
.id = UCLASS_SERIAL,
+#if CONFIG_IS_ENABLED(OF_REAL)
.of_match = of_match_ptr(pl01x_serial_id),
.of_to_plat = of_match_ptr(pl01x_serial_of_to_plat),
+#endif
.plat_auto = sizeof(struct pl01x_serial_plat),
.probe = pl01x_serial_probe,
.ops = &pl01x_serial_ops,
@@ -389,6 +399,8 @@ U_BOOT_DRIVER(serial_pl01x) = {
.priv_auto = sizeof(struct pl01x_priv),
};
+DM_DRIVER_ALIAS(serial_pl01x, arm_pl011)
+DM_DRIVER_ALIAS(serial_pl01x, arm_pl010)
#endif
#if defined(CONFIG_DEBUG_UART_PL010) || defined(CONFIG_DEBUG_UART_PL011)