Initial commit
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
From 921f4b6d8cb3b997dd5c54fd436bb8223046421e Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <921f4b6d8cb3b997dd5c54fd436bb8223046421e.1668448114.git.stefan@agner.ch>
|
||||
In-Reply-To: <85fb54b621c1ca79f1ec8634b0597a038338e51d.1668448114.git.stefan@agner.ch>
|
||||
References: <85fb54b621c1ca79f1ec8634b0597a038338e51d.1668448114.git.stefan@agner.ch>
|
||||
From: Stefan Agner <stefan@agner.ch>
|
||||
Date: Thu, 14 Apr 2022 12:18:41 +0200
|
||||
Subject: [PATCH] drivers: bcm283x: allow to spawn any PL011 UART
|
||||
|
||||
The current code checks pinmux for the first PL011 only. Raspberry Pi 4
|
||||
has multiple PL011 UARTs. This code prevents probing of other UARTs in
|
||||
case the first PL011 UART is not active.
|
||||
|
||||
Furthermore, U-Boot supports pinmuxing, hence the pins should be muxed
|
||||
at this point anyway. Drop the check entirly.
|
||||
|
||||
This allows to use other UARTs as stdout paths (e.g. stdout-path =
|
||||
"serial5:115200n8").
|
||||
|
||||
Signed-off-by: Stefan Agner <stefan@agner.ch>
|
||||
---
|
||||
drivers/serial/serial_bcm283x_pl011.c | 27 ---------------------------
|
||||
1 file changed, 27 deletions(-)
|
||||
|
||||
diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c
|
||||
index fcba07f1c5..98628e1ca4 100644
|
||||
--- a/drivers/serial/serial_bcm283x_pl011.c
|
||||
+++ b/drivers/serial/serial_bcm283x_pl011.c
|
||||
@@ -11,37 +11,10 @@
|
||||
#include <serial.h>
|
||||
#include "serial_pl01x_internal.h"
|
||||
|
||||
-/*
|
||||
- * Check if this serial device is muxed
|
||||
- *
|
||||
- * The serial device will only work properly if it has been muxed to the serial
|
||||
- * pins by firmware. Check whether that happened here.
|
||||
- *
|
||||
- * Return: true if serial device is muxed, false if not
|
||||
- */
|
||||
-static bool bcm283x_is_serial_muxed(void)
|
||||
-{
|
||||
- int serial_gpio = 15;
|
||||
- struct udevice *dev;
|
||||
-
|
||||
- if (uclass_first_device_err(UCLASS_PINCTRL, &dev))
|
||||
- return false;
|
||||
-
|
||||
- if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT0)
|
||||
- return false;
|
||||
-
|
||||
- return true;
|
||||
-}
|
||||
-
|
||||
static int bcm283x_pl011_serial_probe(struct udevice *dev)
|
||||
{
|
||||
- struct pl01x_serial_plat *plat = dev_get_plat(dev);
|
||||
int ret;
|
||||
|
||||
- /* Don't spawn the device if it's not muxed */
|
||||
- if (!bcm283x_is_serial_muxed())
|
||||
- return -ENODEV;
|
||||
-
|
||||
/*
|
||||
* Read the ofdata here rather than in an of_to_plat() method
|
||||
* since we need the soc simple-bus to be probed so that the 'ranges'
|
||||
--
|
||||
2.38.1
|
||||
|
||||
Reference in New Issue
Block a user