Skip to content

RPi: Properly handle dynamic serial configuration

Alexander Graf u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 0 repliesNew
  2. v27 patches 0 repliesSuperseded
  3. v17 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Use bcm2835 specific serial devices to determine pinctrl state
- New: Convert PL01* to Kconfig
- New: Convert PL01* to dev_read
- New: Convert BCM2835_MU to Kconfig
- New: Add myself as maintainer
- Use pinctrl driver to determine pinctrl state

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15serial: Use next serial device if probing failsdrivers/serial/serial-uclass.c+19 -62 replies
1/15serial: Use next serial device if probing fails+0 -00 replies
1/15serial: Use next serial device if probing fails+0 -00 replies
2/15rpi: Remove runtime disabling support for serialboard/raspberrypi/rpi/rpi.c+0 -431 reply
3/15serial: bcm283x_mu: Remove support for post-init disablingdrivers/serial/serial_bcm283x_mu.c include/dm/platform_data/serial_bcm283x_mu.h+1 -181 reply
4/15rpi: Determine PL011/Mini-UART availability at runtimeinclude/configs/rpi.h+1 -41 reply
5/15serial_bcm283x_mu: Convert to dev_readdrivers/serial/serial_bcm283x_mu.c+3 -71 reply
6/15serial_bcm283x_mu: Always skip initdrivers/serial/serial_bcm283x_mu.c+6 -11 reply
7/15serial_bcm283x_mu: Fail loading if not muxeddrivers/serial/serial_bcm283x_mu.c+28 -01 reply
8/15pl01x: Convert to dev_readdrivers/serial/serial_pl01x.c+3 -51 reply
9/15pl010: Convert CONFIG_PL010_SERIAL to Kconfigarch/arm/Kconfig drivers/serial/Kconfig include/configs/edb93xx.h +1 more+7 -21 reply
10/15pl011: Convert CONFIG_PL011_SERIAL to Kconfigarch/arm/Kconfig drivers/serial/Kconfig include/configs/highbank.h +6 more+25 -71 reply
11/15pl01x: Convert CONFIG_PL01X_SERIAL to Kconfigarch/arm/Kconfig drivers/serial/Kconfig include/configs/hikey.h +8 more+17 -181 reply
12/15bcm2835_mu_serial: Convert to Kconfigdrivers/serial/Kconfig include/configs/rpi.h scripts/config_whitelist.txt+7 -41 reply
13/15MAINTAINERS: Take over BCM2835 maintainershipMAINTAINERS+2 -22 replies
13/15MAINTAINERS: Take over BCM2835 maintainership+0 -01 reply
14/15bcm2835_pl011_serial: Add BCM2835 specific serial driverMAINTAINERS drivers/serial/Kconfig drivers/serial/Makefile +3 more+101 -91 reply
15/15bcm2835_pinctrl: Probe pre-relocarch/arm/dts/bcm283x-uboot.dtsi drivers/pinctrl/broadcom/pinctrl-bcm283x.c+6 -11 reply

Reviews trailers per patch

3 of 18 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/15R-b
1/15R-b
1/15R-b
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15
11/15
12/15
13/15
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [U-Boot] [PATCH v3 00/15] RPi: Properly handle dynamic serial configuration

The RPi has proprietary firmware that can be configured (using config.txt) to expose either the PL11, Mini-UART or no serial device to the UART pins on the GPIO pin bar of the RPi.

So far we've only half-heartedly dealt with that, with lost of heuristics that ended up falling apart at times. For example the RPi3 CM uses PL011 when serial is enabled in config.txt, but we disabled PL11 support for BCM2837 because the RPi3 uses the Mini-UART with enable_uart=1 is set in config.txt.

This patch set always enables both serial outputs and determines at probe time whether a serial device is actually muxed to the UART pins on the board. Only in that case, it will be probed and thus used for in- and output in U-Boot.

With this patch set applied, I have successfully used the same U-Boot binary with CONFIG_OF_BOARD=y and a RPi firmware provided device tree with both enable_uart=1 and without on both a RPi3 and RPi3 CM.

This patch set depends on v3 of the patch set "Rpi: Add support for second sd host controller".

v1 -> v2:

- Make search logic easier to follow

v2 -> v3:

- Use bcm2835 specific serial devices to determine pinctrl state
- New: Convert PL01* to Kconfig
- New: Convert PL01* to dev_read
- New: Convert BCM2835_MU to Kconfig
- New: Add myself as maintainer
- Use pinctrl driver to determine pinctrl state

Alexander Graf (15):
serial: Use next serial device if probing fails
rpi: Remove runtime disabling support for serial
serial: bcm283x_mu: Remove support for post-init disabling
rpi: Determine PL011/Mini-UART availability at runtime
serial_bcm283x_mu: Convert to dev_read
serial_bcm283x_mu: Always skip init
serial_bcm283x_mu: Fail loading if not muxed
pl01x: Convert to dev_read
pl010: Convert CONFIG_PL010_SERIAL to Kconfig
pl011: Convert CONFIG_PL011_SERIAL to Kconfig
pl01x: Convert CONFIG_PL01X_SERIAL to Kconfig
bcm2835_mu_serial: Convert to Kconfig
MAINTAINERS: Take over BCM2835 maintainership
bcm2835_pl011_serial: Add BCM2835 specific serial driver
bcm2835_pinctrl: Probe pre-reloc

 MAINTAINERS                                  |  5 +-
 arch/arm/Kconfig                             | 31 ++++++++++++
 arch/arm/dts/bcm283x-uboot.dtsi              |  4 ++
 board/raspberrypi/rpi/rpi.c                  | 43 ----------------
 drivers/pinctrl/broadcom/pinctrl-bcm283x.c   |  3 +-
 drivers/serial/Kconfig                       | 34 +++++++++++++
 drivers/serial/Makefile                      |  1 +
 drivers/serial/serial-uclass.c               | 25 +++++++---
 drivers/serial/serial_bcm283x_mu.c           | 61 ++++++++++++++---------
 drivers/serial/serial_bcm283x_pl011.c        | 73 ++++++++++++++++++++++++++++
 drivers/serial/serial_pl01x.c                | 19 +++-----
 drivers/serial/serial_pl01x_internal.h       | 15 +++++-
 include/configs/edb93xx.h                    |  1 -
 include/configs/highbank.h                   |  1 -
 include/configs/hikey.h                      |  3 --
 include/configs/integrator-common.h          |  2 -
 include/configs/mxs.h                        |  1 -
 include/configs/poplar.h                     |  3 --
 include/configs/qemu-arm.h                   |  3 --
 include/configs/rpi.h                        |  7 ---
 include/configs/spear-common.h               |  1 -
 include/configs/stv0991.h                    |  3 --
 include/configs/thunderx_88xx.h              |  1 -
 include/configs/vexpress_aemv8a.h            |  2 -
 include/configs/vexpress_common.h            |  1 -
 include/configs/x600.h                       |  1 -
 include/dm/platform_data/serial_bcm283x_mu.h |  1 -
 scripts/config_whitelist.txt                 |  4 --
 28 files changed, 224 insertions(+), 125 deletions(-)
 create mode 100644 drivers/serial/serial_bcm283x_pl011.c
Signature · 1 line
2.12.3