[PATCH 3/8] serial: amba-pl011: add $global.bootm.earlycon fixup support

Ahmad Fatoum a.fatoum at pengutronix.de
Mon May 23 02:25:21 PDT 2022


Allow barebox compute a suitable earlycon parameter.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/serial/amba-pl011.c | 2 ++
 drivers/serial/stm-serial.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 345c58e27426..b53ff6877b77 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -202,6 +202,8 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 	cdev->getc = pl011_getc;
 	cdev->setbrg = pl011_setbaudrate;
 	cdev->linux_console_name = "ttyAMA";
+	cdev->linux_earlycon_name = "pl011";
+	cdev->phys_base = uart->base;
 
 	pl011_init_port(cdev);
 
diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c
index 30aaba94f0ef..b4b2c4cc8f71 100644
--- a/drivers/serial/stm-serial.c
+++ b/drivers/serial/stm-serial.c
@@ -149,12 +149,14 @@ static int stm_serial_probe(struct device_d *dev)
 	cdev->setbrg = stm_serial_setbaudrate;
 	cdev->dev = dev;
 	cdev->linux_console_name = "ttyAMA";
+	cdev->linux_earlycon_name = "pl011";
 
 	dev->priv = priv;
 	iores = dev_request_mem_resource(dev, 0);
 	if (IS_ERR(iores))
 		return PTR_ERR(iores);
 	priv->base = IOMEM(iores->start);
+	cdev->phys_base = priv->base;
 	priv->clk = clk_get(dev, NULL);
 	if (IS_ERR(priv->clk))
 		return PTR_ERR(priv->clk);
-- 
2.30.2




More information about the barebox mailing list