Files
operating-system/buildroot-external/board/raspberrypi/yellow/patches/uboot/0002-drivers-bcm283x-allow-to-spawn-any-PL011-UART.patch
2022-04-26 00:54:42 +02:00

69 lines
2.2 KiB
Diff

From c2447aa922068cebd9bbaac45acae3d853abf687 Mon Sep 17 00:00:00 2001
Message-Id: <c2447aa922068cebd9bbaac45acae3d853abf687.1650924333.git.stefan@agner.ch>
In-Reply-To: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch>
References: <78704bc154d695ee16fdf8396f4d60b740190014.1650924333.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Thu, 14 Apr 2022 12:18:41 +0200
Subject: [PATCH 2/5] 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 182274036c..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(UCLASS_PINCTRL, &dev) || !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.36.0