mbox series

[0/7] RPi: Properly handle dynamic serial configuration

Message ID 20180116134741.4103-1-agraf@suse.de
Headers show
Series RPi: Properly handle dynamic serial configuration | expand

Message

Alexander Graf Jan. 16, 2018, 1:47 p.m. UTC
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.

Alexander Graf (7):
  serial: Use next serial device if probing fails
  serial: Allow boards to determine whether a serial device is usable
  rpi: Remove runtime disabling support for serial
  serial: bcm283x_mu: Remove support for post-init disabling
  rpi: Properly detect which serial device is active
  rpi: Determine PL011/Mini-UART availability at runtime
  rpi: Force skip_init on serial devices

 arch/arm/mach-bcm283x/include/mach/gpio.h    |  1 -
 board/raspberrypi/rpi/rpi.c                  | 91 +++++++++++++++++++---------
 drivers/gpio/bcm2835_gpio.c                  |  2 +-
 drivers/serial/serial-uclass.c               | 34 +++++++++--
 drivers/serial/serial_bcm283x_mu.c           | 20 +-----
 drivers/serial/serial_pl01x.c                |  2 +-
 include/configs/rpi.h                        |  5 +-
 include/dm/platform_data/serial_bcm283x_mu.h |  1 -
 include/serial.h                             | 11 ++++
 9 files changed, 108 insertions(+), 59 deletions(-)