[PATCH v2 1/2] arm: dts: bcm283x: Allow UARTs to work before relocation

At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc) ---
Changes in v2: - Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/bcm283x-u-boot.dtsi b/arch/arm/dts/bcm283x-u-boot.dtsi index 36548dad62..68d03627f4 100644 --- a/arch/arm/dts/bcm283x-u-boot.dtsi +++ b/arch/arm/dts/bcm283x-u-boot.dtsi @@ -19,3 +19,11 @@ &gpio { u-boot,dm-pre-reloc; }; + +&uart0_gpio14 { + u-boot,dm-pre-reloc; +}; + +&uart1_gpio14 { + u-boot,dm-pre-reloc; +};

We cannot rely on a parent bus that needs to be probed, until we know that it is probed. That means that code in the ofdata_to_platdata() method cannot rely on the parent bus being probed.
Move the ofdata code in the two serial drivers into a probe() method.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org ---
Changes in v2: - Add new patch to move ofdata reading to probe() method
drivers/serial/serial_bcm283x_mu.c | 21 +++++++++------------ drivers/serial/serial_bcm283x_pl011.c | 12 ++++++++---- 2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index a6ffc84b96..febb5ceea2 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -74,16 +74,6 @@ out: return 0; }
-static int bcm283x_mu_serial_probe(struct udevice *dev) -{ - struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); - struct bcm283x_mu_priv *priv = dev_get_priv(dev); - - priv->regs = (struct bcm283x_mu_regs *)plat->base; - - return 0; -} - static int bcm283x_mu_serial_getc(struct udevice *dev) { struct bcm283x_mu_priv *priv = dev_get_priv(dev); @@ -165,15 +155,21 @@ static bool bcm283x_is_serial_muxed(void) return true; }
-static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) +static int bcm283x_mu_serial_probe(struct udevice *dev) { struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); + struct bcm283x_mu_priv *priv = dev_get_priv(dev); fdt_addr_t addr;
/* 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 ofdata_to_platdata() method + * since we need the soc simple-bus to be probed so that the 'ranges' + * property is used. + */ addr = devfdt_get_addr(dev); if (addr == FDT_ADDR_T_NONE) return -EINVAL; @@ -187,6 +183,8 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) */ plat->skip_init = true;
+ priv->regs = (struct bcm283x_mu_regs *)plat->base; + return 0; } #endif @@ -195,7 +193,6 @@ U_BOOT_DRIVER(serial_bcm283x_mu) = { .name = "serial_bcm283x_mu", .id = UCLASS_SERIAL, .of_match = of_match_ptr(bcm283x_mu_serial_id), - .ofdata_to_platdata = of_match_ptr(bcm283x_mu_serial_ofdata_to_platdata), .platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata), .probe = bcm283x_mu_serial_probe, .ops = &bcm283x_mu_serial_ops, diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c index 7d8ab7b716..923f402fbe 100644 --- a/drivers/serial/serial_bcm283x_pl011.c +++ b/drivers/serial/serial_bcm283x_pl011.c @@ -33,7 +33,7 @@ static bool bcm283x_is_serial_muxed(void) return true; }
-static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) +static int bcm283x_pl011_serial_probe(struct udevice *dev) { struct pl01x_serial_platdata *plat = dev_get_platdata(dev); int ret; @@ -42,6 +42,11 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) if (!bcm283x_is_serial_muxed()) return -ENODEV;
+ /* + * Read the ofdata here rather than in an ofdata_to_platdata() method + * since we need the soc simple-bus to be probed so that the 'ranges' + * property is used. + */ ret = pl01x_serial_ofdata_to_platdata(dev); if (ret) return ret; @@ -52,7 +57,7 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) */ plat->skip_init = true;
- return 0; + return pl01x_serial_probe(dev); }
static int bcm283x_pl011_serial_setbrg(struct udevice *dev, int baudrate) @@ -86,9 +91,8 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = { .name = "bcm283x_pl011", .id = UCLASS_SERIAL, .of_match = of_match_ptr(bcm283x_pl011_serial_id), - .ofdata_to_platdata = of_match_ptr(bcm283x_pl011_serial_ofdata_to_platdata), + .probe = bcm283x_pl011_serial_probe, .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), - .probe = pl01x_serial_probe, .ops = &bcm283x_pl011_serial_ops, #if !CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_BOARD) .flags = DM_FLAG_PRE_RELOC,

On 23/03/2020 04:15, Simon Glass wrote:
We cannot rely on a parent bus that needs to be probed, until we know that it is probed. That means that code in the ofdata_to_platdata() method cannot rely on the parent bus being probed.
Move the ofdata code in the two serial drivers into a probe() method.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org
Pushed not to rpi-next, sorry for the delay and thanks for the patch :)
Changes in v2:
- Add new patch to move ofdata reading to probe() method
drivers/serial/serial_bcm283x_mu.c | 21 +++++++++------------ drivers/serial/serial_bcm283x_pl011.c | 12 ++++++++---- 2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index a6ffc84b96..febb5ceea2 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -74,16 +74,6 @@ out: return 0; }
-static int bcm283x_mu_serial_probe(struct udevice *dev) -{
- struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
- struct bcm283x_mu_priv *priv = dev_get_priv(dev);
- priv->regs = (struct bcm283x_mu_regs *)plat->base;
- return 0;
-}
static int bcm283x_mu_serial_getc(struct udevice *dev) { struct bcm283x_mu_priv *priv = dev_get_priv(dev); @@ -165,15 +155,21 @@ static bool bcm283x_is_serial_muxed(void) return true; }
-static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) +static int bcm283x_mu_serial_probe(struct udevice *dev) { struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
struct bcm283x_mu_priv *priv = dev_get_priv(dev); fdt_addr_t addr;
/* 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 ofdata_to_platdata() method
* since we need the soc simple-bus to be probed so that the 'ranges'
* property is used.
*/
addr = devfdt_get_addr(dev); if (addr == FDT_ADDR_T_NONE) return -EINVAL;
@@ -187,6 +183,8 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev) */ plat->skip_init = true;
- priv->regs = (struct bcm283x_mu_regs *)plat->base;
- return 0;
} #endif @@ -195,7 +193,6 @@ U_BOOT_DRIVER(serial_bcm283x_mu) = { .name = "serial_bcm283x_mu", .id = UCLASS_SERIAL, .of_match = of_match_ptr(bcm283x_mu_serial_id),
- .ofdata_to_platdata = of_match_ptr(bcm283x_mu_serial_ofdata_to_platdata), .platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata), .probe = bcm283x_mu_serial_probe, .ops = &bcm283x_mu_serial_ops,
diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c index 7d8ab7b716..923f402fbe 100644 --- a/drivers/serial/serial_bcm283x_pl011.c +++ b/drivers/serial/serial_bcm283x_pl011.c @@ -33,7 +33,7 @@ static bool bcm283x_is_serial_muxed(void) return true; }
-static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) +static int bcm283x_pl011_serial_probe(struct udevice *dev) { struct pl01x_serial_platdata *plat = dev_get_platdata(dev); int ret; @@ -42,6 +42,11 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) if (!bcm283x_is_serial_muxed()) return -ENODEV;
- /*
* Read the ofdata here rather than in an ofdata_to_platdata() method
* since we need the soc simple-bus to be probed so that the 'ranges'
* property is used.
ret = pl01x_serial_ofdata_to_platdata(dev); if (ret) return ret;*/
@@ -52,7 +57,7 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev) */ plat->skip_init = true;
- return 0;
- return pl01x_serial_probe(dev);
}
static int bcm283x_pl011_serial_setbrg(struct udevice *dev, int baudrate) @@ -86,9 +91,8 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = { .name = "bcm283x_pl011", .id = UCLASS_SERIAL, .of_match = of_match_ptr(bcm283x_pl011_serial_id),
- .ofdata_to_platdata = of_match_ptr(bcm283x_pl011_serial_ofdata_to_platdata),
- .probe = bcm283x_pl011_serial_probe, .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
- .probe = pl01x_serial_probe, .ops = &bcm283x_pl011_serial_ops,
#if !CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_BOARD) .flags = DM_FLAG_PRE_RELOC,

Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
Regards, Simon

On Tue, Apr 14, 2020 at 08:23:10PM -0600, Simon Glass wrote:
Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
I don't know if the problem is my firmware is too old (and so works) or your firmware is too old (and so fails) or if there's some phase-of-the-moon problem. So while I'd like to know _why_ my 3B is fine and yours is not, we should just take this I suppose.

Hi Tom,
On Wed, 15 Apr 2020 at 13:59, Tom Rini trini@konsulko.com wrote:
On Tue, Apr 14, 2020 at 08:23:10PM -0600, Simon Glass wrote:
Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
I don't know if the problem is my firmware is too old (and so works) or your firmware is too old (and so fails) or if there's some phase-of-the-moon problem. So while I'd like to know _why_ my 3B is fine and yours is not, we should just take this I suppose.
It should not harm anything.
For now I am unable to run rpi tests on mainline.
Regards, Simon

Hi all,
On 29/04/2020 22:11, Simon Glass wrote:
Hi Tom,
On Wed, 15 Apr 2020 at 13:59, Tom Rini trini@konsulko.com wrote:
On Tue, Apr 14, 2020 at 08:23:10PM -0600, Simon Glass wrote:
Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
I don't know if the problem is my firmware is too old (and so works) or your firmware is too old (and so fails) or if there's some phase-of-the-moon problem. So while I'd like to know _why_ my 3B is fine and yours is not, we should just take this I suppose.
It should not harm anything.
For now I am unable to run rpi tests on mainline.
Sorry for being silent for such a long time. I'll have a look and provide a PR.
Regards, Matthias

On 15/04/2020 21:59, Tom Rini wrote:
On Tue, Apr 14, 2020 at 08:23:10PM -0600, Simon Glass wrote:
Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
I don't know if the problem is my firmware is too old (and so works) or your firmware is too old (and so fails) or if there's some phase-of-the-moon problem. So while I'd like to know _why_ my 3B is fine and yours is not, we should just take this I suppose.
I agree with Tom, we should try to find out what's the problem. Do you know which version (e.g. git commit or which version of rasbian etc) of the RPi FW you are using? If not, can you provide me with the md5sum's so that I can try to reproduce this.
Regards, Matthias

Hi Matthias,
On Thu, 14 May 2020 at 02:56, Matthias Brugger mbrugger@suse.com wrote:
On 15/04/2020 21:59, Tom Rini wrote:
On Tue, Apr 14, 2020 at 08:23:10PM -0600, Simon Glass wrote:
Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
I don't know if the problem is my firmware is too old (and so works) or your firmware is too old (and so fails) or if there's some phase-of-the-moon problem. So while I'd like to know _why_ my 3B is fine and yours is not, we should just take this I suppose.
I agree with Tom, we should try to find out what's the problem. Do you know which version (e.g. git commit or which version of rasbian etc) of the RPi FW you are using? If not, can you provide me with the md5sum's so that I can try to reproduce this.
Yes, also put a link to it at https://drive.google.com/open?id=1RcPlf4DYM_uwTJ_cRuWtVT9fIjOjTf-2
md5sum /media/rpi3_b_boot/* 9e6d4b16b76053392d2a0619a83e0862 /media/rpi3_b_boot/bcm2709-rpi-2-b.dtb 4acc2947ae6c228681bcb2f5dc944e22 /media/rpi3_b_boot/bcm2710-rpi-2-b.dtb c41f6a4b6cad196a0682f2c900c43f20 /media/rpi3_b_boot/bcm2710-rpi-3-b.dtb 8b7952dc4b46015efc3afa32a846b2e5 /media/rpi3_b_boot/bcm2710-rpi-3-b-plus.dtb 4ac8deb1874c38697db02ee40cec49e1 /media/rpi3_b_boot/bcm2710-rpi-cm3.dtb 951de137ec43729c2fdb627e06932b05 /media/rpi3_b_boot/bcm2711-rpi-4-b.dtb cf109cce99e2e5dc7698f0358070d449 /media/rpi3_b_boot/bootcode.bin db16856cf351712423fab8baad803cce /media/rpi3_b_boot/config.old 1fe66e87c7a7104110b399db8a93b746 /media/rpi3_b_boot/config.orig 1fe66e87c7a7104110b399db8a93b746 /media/rpi3_b_boot/config.txt 76eb905d83343d67957af61fbb8ca775 /media/rpi3_b_boot/config.txt~ md5sum: /media/rpi3_b_boot/EFI: Is a directory 1ebf06f40ff4b6b00af1ad961b2ed67a /media/rpi3_b_boot/fixup4cd.dat 97a38853ecfe7725388e68b8fdcf119d /media/rpi3_b_boot/fixup4.dat 9c7a11bc8484fc841f8738ef20c086d6 /media/rpi3_b_boot/fixup4db.dat 5315d39bb99f7bc6c19f1704ce3c356c /media/rpi3_b_boot/fixup4x.dat 73e9049c81e9735c84a4bad8b35141eb /media/rpi3_b_boot/fixup_cd.dat 9530c2f1f9b2a3e54776af0a34a62ecf /media/rpi3_b_boot/fixup.dat 1ac2cd69abe26488c494d3b387e50ad3 /media/rpi3_b_boot/fixup_db.dat 1a701837aeb101c8212805c1ed9d6088 /media/rpi3_b_boot/fixup_x.dat md5sum: /media/rpi3_b_boot/overlays: Is a directory 3e63383a9ccf7b91a0859f87111548ac /media/rpi3_b_boot/rpi2-u-boot.bin 6c5fee58664a254fbf557e882b9eb4f8 /media/rpi3_b_boot/rpi3-u-boot.bin 47b2304cbdb4fe5518896c2bb610d59d /media/rpi3_b_boot/rpi3-u-boot.bin.old 95a23183100d9979d34d0e07f766ac47 /media/rpi3_b_boot/rpi3-u-boot.bin.orig d629e0c0274103f264dde957b2af3c27 /media/rpi3_b_boot/start4cd.elf 2368d21eab5e72db9e223c7b15aba75c /media/rpi3_b_boot/start4db.elf 3822926e480806825d9f9cce3e494b8e /media/rpi3_b_boot/start4.elf 3eb84d324d39ab018ef952594cb38778 /media/rpi3_b_boot/start4x.elf 41f5923ad1373b9b99f26086f991cbd8 /media/rpi3_b_boot/start_cd.elf 8e0addb0054ae9a58f82af020ec3871d /media/rpi3_b_boot/start_db.elf b91a980720ccad9dbfb5ad51ef04bda4 /media/rpi3_b_boot/start.elf ad1e957d1d8fd7beeaa2d0b15f037008 /media/rpi3_b_boot/start_x.elf
cat /media/rpi3_b_boot/config.txt # Raspberry Pi 2 [pi2] kernel=rpi2-u-boot.bin
# Raspberry Pi 3 [pi3] kernel=rpi3-u-boot.bin
# Raspberry Pi 4 [pi4] kernel=rpi4-u-boot.bin
# Default Fedora configs for all Raspberry Pi Revisions [all] # Enable UART # Only enable UART if you're going to use it as it has speed implications # Serial console is ttyS0 on RPi3 and ttyAMA0 on all other variants # u-boot will auto detect serial and pass corrent options to kernel if enabled # Speed details: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=141195 enable_uart = 1
# Early boot delay in the hope monitors are initialised enough to provide EDID bootcode_delay=1
# We need this to be 32Mb to support VCHI services and drivers which use them # but this isn't used by mainline VC4 driver so reduce to lowest supported value # You need to set this to at least 80 for using the camera gpu_mem=32
# Use eXtended firmware by default start_x=1
# New option to allow the firmware to load upstream dtb # Will allow things like camera, touchscreen etc to work OOTB upstream_kernel=1
# HAT and DT overlays. Documentation at Raspberry Pi here: # https://www.raspberrypi.org/documentation/configuration/device-tree.md # Each dtoverlay line is an individual HAT/overlay, multiple lines allowed # The dtoverlay=upstream must be present for Fedora kernels dtoverlay=upstream # dtoverlay=rpi-sense #dtoverlay=miniuart-bt #dtoverlay=disable-bt
# Allow OS rather than firmware control CEC mask_gpu_interrupt1=0x100
# Without this sdram runs at 400mhz, instead of 450 # https://github.com/Hexxeh/rpi-firmware/issues/172 audio_pwm_mode=0
# Other options you can adjust for all Raspberry Pi Revisions # https://www.raspberrypi.org/documentation/configuration/config-txt/README.md # All options documented at http://elinux.org/RPiconfig # for more options see http://elinux.org/RPi_config.txt
#dtparam=i2c_arm=on #dtparam=spi=on gpu_freq=250
# --- added by elecro_pilft-setup hdmi_force_hotplug=1 max_usb_current=1 hdmi_drive=1 hdmi_group=2 hdmi_mode=1 hdmi_cvt 800 480 60 6 0 0 0 dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=1,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900 display_rotate=0 # --- end elecro_pilft-setup
Regards, Simon

Hi Matthias,
On Thu, 14 May 2020 at 07:49, Simon Glass sjg@chromium.org wrote:
Hi Matthias,
On Thu, 14 May 2020 at 02:56, Matthias Brugger mbrugger@suse.com wrote:
On 15/04/2020 21:59, Tom Rini wrote:
On Tue, Apr 14, 2020 at 08:23:10PM -0600, Simon Glass wrote:
Hi,
On Sun, 22 Mar 2020 at 21:16, Simon Glass sjg@chromium.org wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
Any thoughts on this series? At present all my lab tests fail.
I don't know if the problem is my firmware is too old (and so works) or your firmware is too old (and so fails) or if there's some phase-of-the-moon problem. So while I'd like to know _why_ my 3B is fine and yours is not, we should just take this I suppose.
I agree with Tom, we should try to find out what's the problem. Do you know which version (e.g. git commit or which version of rasbian etc) of the RPi FW you are using? If not, can you provide me with the md5sum's so that I can try to reproduce this.
Yes, also put a link to it at https://drive.google.com/open?id=1RcPlf4DYM_uwTJ_cRuWtVT9fIjOjTf-2
As mentioned on the other thread, this seems to be fixed by:
28ff144662e drivers: Descend to drivers/soc unconditionally
[..]
Regards, Simon
md5sum /media/rpi3_b_boot/* 9e6d4b16b76053392d2a0619a83e0862 /media/rpi3_b_boot/bcm2709-rpi-2-b.dtb 4acc2947ae6c228681bcb2f5dc944e22 /media/rpi3_b_boot/bcm2710-rpi-2-b.dtb c41f6a4b6cad196a0682f2c900c43f20 /media/rpi3_b_boot/bcm2710-rpi-3-b.dtb 8b7952dc4b46015efc3afa32a846b2e5 /media/rpi3_b_boot/bcm2710-rpi-3-b-plus.dtb 4ac8deb1874c38697db02ee40cec49e1 /media/rpi3_b_boot/bcm2710-rpi-cm3.dtb 951de137ec43729c2fdb627e06932b05 /media/rpi3_b_boot/bcm2711-rpi-4-b.dtb cf109cce99e2e5dc7698f0358070d449 /media/rpi3_b_boot/bootcode.bin db16856cf351712423fab8baad803cce /media/rpi3_b_boot/config.old 1fe66e87c7a7104110b399db8a93b746 /media/rpi3_b_boot/config.orig 1fe66e87c7a7104110b399db8a93b746 /media/rpi3_b_boot/config.txt 76eb905d83343d67957af61fbb8ca775 /media/rpi3_b_boot/config.txt~ md5sum: /media/rpi3_b_boot/EFI: Is a directory 1ebf06f40ff4b6b00af1ad961b2ed67a /media/rpi3_b_boot/fixup4cd.dat 97a38853ecfe7725388e68b8fdcf119d /media/rpi3_b_boot/fixup4.dat 9c7a11bc8484fc841f8738ef20c086d6 /media/rpi3_b_boot/fixup4db.dat 5315d39bb99f7bc6c19f1704ce3c356c /media/rpi3_b_boot/fixup4x.dat 73e9049c81e9735c84a4bad8b35141eb /media/rpi3_b_boot/fixup_cd.dat 9530c2f1f9b2a3e54776af0a34a62ecf /media/rpi3_b_boot/fixup.dat 1ac2cd69abe26488c494d3b387e50ad3 /media/rpi3_b_boot/fixup_db.dat 1a701837aeb101c8212805c1ed9d6088 /media/rpi3_b_boot/fixup_x.dat md5sum: /media/rpi3_b_boot/overlays: Is a directory 3e63383a9ccf7b91a0859f87111548ac /media/rpi3_b_boot/rpi2-u-boot.bin 6c5fee58664a254fbf557e882b9eb4f8 /media/rpi3_b_boot/rpi3-u-boot.bin 47b2304cbdb4fe5518896c2bb610d59d /media/rpi3_b_boot/rpi3-u-boot.bin.old 95a23183100d9979d34d0e07f766ac47 /media/rpi3_b_boot/rpi3-u-boot.bin.orig d629e0c0274103f264dde957b2af3c27 /media/rpi3_b_boot/start4cd.elf 2368d21eab5e72db9e223c7b15aba75c /media/rpi3_b_boot/start4db.elf 3822926e480806825d9f9cce3e494b8e /media/rpi3_b_boot/start4.elf 3eb84d324d39ab018ef952594cb38778 /media/rpi3_b_boot/start4x.elf 41f5923ad1373b9b99f26086f991cbd8 /media/rpi3_b_boot/start_cd.elf 8e0addb0054ae9a58f82af020ec3871d /media/rpi3_b_boot/start_db.elf b91a980720ccad9dbfb5ad51ef04bda4 /media/rpi3_b_boot/start.elf ad1e957d1d8fd7beeaa2d0b15f037008 /media/rpi3_b_boot/start_x.elf
cat /media/rpi3_b_boot/config.txt # Raspberry Pi 2 [pi2] kernel=rpi2-u-boot.bin
# Raspberry Pi 3 [pi3] kernel=rpi3-u-boot.bin
# Raspberry Pi 4 [pi4] kernel=rpi4-u-boot.bin
# Default Fedora configs for all Raspberry Pi Revisions [all] # Enable UART # Only enable UART if you're going to use it as it has speed implications # Serial console is ttyS0 on RPi3 and ttyAMA0 on all other variants # u-boot will auto detect serial and pass corrent options to kernel if enabled # Speed details: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=141195 enable_uart = 1
# Early boot delay in the hope monitors are initialised enough to provide EDID bootcode_delay=1
# We need this to be 32Mb to support VCHI services and drivers which use them # but this isn't used by mainline VC4 driver so reduce to lowest supported value # You need to set this to at least 80 for using the camera gpu_mem=32
# Use eXtended firmware by default start_x=1
# New option to allow the firmware to load upstream dtb # Will allow things like camera, touchscreen etc to work OOTB upstream_kernel=1
# HAT and DT overlays. Documentation at Raspberry Pi here: # https://www.raspberrypi.org/documentation/configuration/device-tree.md # Each dtoverlay line is an individual HAT/overlay, multiple lines allowed # The dtoverlay=upstream must be present for Fedora kernels dtoverlay=upstream # dtoverlay=rpi-sense #dtoverlay=miniuart-bt #dtoverlay=disable-bt
# Allow OS rather than firmware control CEC mask_gpu_interrupt1=0x100
# Without this sdram runs at 400mhz, instead of 450 # https://github.com/Hexxeh/rpi-firmware/issues/172 audio_pwm_mode=0
# Other options you can adjust for all Raspberry Pi Revisions # https://www.raspberrypi.org/documentation/configuration/config-txt/README.md # All options documented at http://elinux.org/RPiconfig # for more options see http://elinux.org/RPi_config.txt
#dtparam=i2c_arm=on #dtparam=spi=on gpu_freq=250
# --- added by elecro_pilft-setup hdmi_force_hotplug=1 max_usb_current=1 hdmi_drive=1 hdmi_group=2 hdmi_mode=1 hdmi_cvt 800 480 60 6 0 0 0 dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=1,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900 display_rotate=0 # --- end elecro_pilft-setup
Regards, Simon

On 23/03/2020 04:15, Simon Glass wrote:
At present the pinctrl nodes are not enabled in pre-relocation U-Boot so the UARTs do not correctly select the pinconfig to enable the UART pins. Fix this so that the U-Boot banner is printed.
This fixes serial output on rpi_3b_32b with the following config.txt options:
enable_uart=1 gpu_freq=250
Signed-off-by: Simon Glass sjg@chromium.org Fixes: 9821636b64 (bcm2835_pinctrl: Probe pre-reloc)
Pushed not to rpi-next, sorry for the delay and thanks for the patch :)
Changes in v2:
- Update commit message
arch/arm/dts/bcm283x-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/dts/bcm283x-u-boot.dtsi b/arch/arm/dts/bcm283x-u-boot.dtsi index 36548dad62..68d03627f4 100644 --- a/arch/arm/dts/bcm283x-u-boot.dtsi +++ b/arch/arm/dts/bcm283x-u-boot.dtsi @@ -19,3 +19,11 @@ &gpio { u-boot,dm-pre-reloc; };
+&uart0_gpio14 {
- u-boot,dm-pre-reloc;
+};
+&uart1_gpio14 {
- u-boot,dm-pre-reloc;
+};
participants (3)
-
Matthias Brugger
-
Simon Glass
-
Tom Rini