public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/7] rpi: Remove runtime disabling support for serial
Date: Wed, 17 Jan 2018 09:54:54 +0100	[thread overview]
Message-ID: <20180117085458.27293-4-agraf@suse.de> (raw)
In-Reply-To: <20180117085458.27293-1-agraf@suse.de>

We are switching to a model where our board file can directly fail probing
of serial devices when they're not usable, so remove the current runtime
hack we have.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/arm/mach-bcm283x/include/mach/gpio.h |  1 -
 board/raspberrypi/rpi/rpi.c               | 43 -------------------------------
 drivers/gpio/bcm2835_gpio.c               |  2 +-
 3 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/arch/arm/mach-bcm283x/include/mach/gpio.h b/arch/arm/mach-bcm283x/include/mach/gpio.h
index 751594d09f..1bcb5846ca 100644
--- a/arch/arm/mach-bcm283x/include/mach/gpio.h
+++ b/arch/arm/mach-bcm283x/include/mach/gpio.h
@@ -61,7 +61,6 @@ struct bcm2835_gpio_platdata {
 	unsigned long base;
 };
 
-int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio);
 void bcm2835_gpio_set_pinmux(struct udevice *dev, int handle);
 
 #endif /* _BCM2835_GPIO_H_ */
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 3b7a54f519..a96d5d8952 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -419,54 +419,11 @@ static void get_board_rev(void)
 	printf("RPI %s (0x%x)\n", model->name, revision);
 }
 
-#ifndef CONFIG_PL01X_SERIAL
-static bool rpi_is_serial_active(void)
-{
-	int serial_gpio = 15;
-	struct udevice *dev;
-
-	/*
-	 * The RPi3 disables the mini uart by default. The easiest way to find
-	 * out whether it is available is to check if the RX pin is muxed.
-	 */
-
-	if (uclass_first_device(UCLASS_GPIO, &dev) || !dev)
-		return true;
-
-	if (bcm2835_gpio_get_func_id(dev, serial_gpio) != BCM2835_GPIO_ALT5)
-		return false;
-
-	return true;
-}
-
-/* Disable mini-UART I/O if it's not pinmuxed to our pins.
- * The firmware only enables it if explicitly done in config.txt: enable_uart=1
- */
-static void rpi_disable_inactive_uart(void)
-{
-	struct udevice *dev;
-	struct bcm283x_mu_serial_platdata *plat;
-
-	if (uclass_get_device_by_driver(UCLASS_SERIAL,
-					DM_GET_DRIVER(serial_bcm283x_mu),
-					&dev) || !dev)
-		return;
-
-	if (!rpi_is_serial_active()) {
-		plat = dev_get_platdata(dev);
-		plat->disabled = true;
-	}
-}
-#endif
-
 int board_init(void)
 {
 #ifdef CONFIG_HW_WATCHDOG
 	hw_watchdog_init();
 #endif
-#ifndef CONFIG_PL01X_SERIAL
-	rpi_disable_inactive_uart();
-#endif
 
 	get_board_rev();
 
diff --git a/drivers/gpio/bcm2835_gpio.c b/drivers/gpio/bcm2835_gpio.c
index 209cbed9e6..3edd90ea97 100644
--- a/drivers/gpio/bcm2835_gpio.c
+++ b/drivers/gpio/bcm2835_gpio.c
@@ -73,7 +73,7 @@ static int bcm2835_gpio_set_value(struct udevice *dev, unsigned gpio,
 	return 0;
 }
 
-int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio)
+static int bcm2835_gpio_get_func_id(struct udevice *dev, unsigned gpio)
 {
 	struct bcm2835_gpios *gpios = dev_get_priv(dev);
 	u32 val;
-- 
2.12.3

  parent reply	other threads:[~2018-01-17  8:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  8:54 [U-Boot] [PATCH v2 0/7] RPi: Properly handle dynamic serial configuration Alexander Graf
2018-01-17  8:54 ` [U-Boot] [PATCH v2 1/7] serial: Use next serial device if probing fails Alexander Graf
2018-01-17 10:54   ` Heinrich Schuchardt
2018-01-17 19:34   ` Simon Glass
2018-01-17 22:02     ` Alexander Graf
2018-01-17  8:54 ` [U-Boot] [PATCH v2 2/7] serial: Allow boards to determine whether a serial device is usable Alexander Graf
2018-01-17 19:39   ` Simon Glass
2018-01-17 22:03     ` Alexander Graf
2018-01-17 22:11       ` Simon Glass
2018-01-17 22:37         ` Alexander Graf
2018-01-17 23:18           ` Simon Glass
2018-01-17  8:54 ` Alexander Graf [this message]
2018-01-17  8:54 ` [U-Boot] [PATCH v2 4/7] serial: bcm283x_mu: Remove support for post-init disabling Alexander Graf
2018-01-17  8:54 ` [U-Boot] [PATCH v2 5/7] rpi: Properly detect which serial device is active Alexander Graf
2018-01-17 19:46   ` Simon Glass
2018-01-17 22:05     ` Alexander Graf
2018-01-17 23:18       ` Simon Glass
2018-01-17  8:54 ` [U-Boot] [PATCH v2 6/7] rpi: Determine PL011/Mini-UART availability at runtime Alexander Graf
2018-01-17  8:54 ` [U-Boot] [PATCH v2 7/7] rpi: Force skip_init on serial devices Alexander Graf
2018-01-17 19:40   ` Simon Glass
2018-01-17 22:08     ` Alexander Graf
2018-01-17 23:18       ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180117085458.27293-4-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox