From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 7/7] rpi: Force skip_init on serial devices
Date: Wed, 17 Jan 2018 09:54:58 +0100 [thread overview]
Message-ID: <20180117085458.27293-8-agraf@suse.de> (raw)
In-Reply-To: <20180117085458.27293-1-agraf@suse.de>
The serial devices on the raspberry pi are based on clocks we can't easily
read and influence in U-Boot. However, the serial devices are always already
properly set up when coming up, so all we need to do is leave them alone.
The way to do that is to specify "skip-init" in device tree usually, but
if we set CONFIG_OF_BOARD to get the device tree from the RPi firmware,
that does not have skip-init properly set.
So instead we just force it in board specific code. That way serial devices
also work fine when skip-init is not passed explicitly in DT.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
board/raspberrypi/rpi/rpi.c | 7 +++++++
drivers/serial/serial_bcm283x_mu.c | 2 +-
drivers/serial/serial_pl01x.c | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index b0cdad70f7..ce1286a53a 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -20,6 +20,7 @@
#include <asm/arch/sdhci.h>
#include <asm/global_data.h>
#include <dm/platform_data/serial_bcm283x_mu.h>
+#include <dm/platform_data/serial_pl01x.h>
#ifdef CONFIG_ARM64
#include <asm/armv8/mmu.h>
#endif
@@ -472,9 +473,15 @@ int board_check_serial(struct udevice *dev)
printf("Checking serial %s\n", dev->name);
if (device_is_compatible(dev, "arm,pl011")) {
+ struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
+
func = BCM2835_GPIO_ALT0;
+ plat->skip_init = true;
} else if (device_is_compatible(dev, "brcm,bcm2835-aux-uart")) {
+ struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
+
func = BCM2835_GPIO_ALT5;
+ plat->skip_init = true;
} else {
return 0;
}
diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c
index 7ce990b9b8..8a7ca75d4a 100644
--- a/drivers/serial/serial_bcm283x_mu.c
+++ b/drivers/serial/serial_bcm283x_mu.c
@@ -151,7 +151,7 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev)
plat->base = addr;
plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "clock",
1);
- plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
+ plat->skip_init |= fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
"skip-init");
return 0;
}
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 4ec0f29c42..f957eddc07 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -357,7 +357,7 @@ static int pl01x_serial_ofdata_to_platdata(struct udevice *dev)
plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "clock",
1);
plat->type = dev_get_driver_data(dev);
- plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
+ plat->skip_init |= fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
"skip-init");
return 0;
}
--
2.12.3
next prev 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 ` [U-Boot] [PATCH v2 3/7] rpi: Remove runtime disabling support for serial Alexander Graf
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 ` Alexander Graf [this message]
2018-01-17 19:40 ` [U-Boot] [PATCH v2 7/7] rpi: Force skip_init on serial devices 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-8-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