]> git.dujemihanovic.xyz Git - u-boot.git/commit
serial: bcm283x_mu: Detect disabled serial device
authorAlexander Graf <agraf@suse.de>
Mon, 15 Aug 2016 15:48:51 +0000 (17:48 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 6 Sep 2016 17:18:19 +0000 (13:18 -0400)
commit601147b06a708900c5352dc3dcc5d64271bf0d62
tree6edb09d09ac433ea4b296a7c1a8dcc3482c0972e
parent04a993fe116604b8c81fb116857dbc78e2500133
serial: bcm283x_mu: Detect disabled serial device

On the raspberry pi, you can disable the serial port to gain dynamic frequency
scaling which can get handy at times.

However, in such a configuration the serial controller gets its rx queue filled
up with zero bytes which then happily get transmitted on to whoever calls
getc() today.

This patch adds detection logic for that case by checking whether the RX pin is
mapped to GPIO15 and disables the mini uart if it is not mapped properly.

That way we can leave the driver enabled in the tree and can determine during
runtime whether serial is usable or not, having a single binary that allows for
uart and non-uart operation.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
board/raspberrypi/rpi/rpi.c
configs/rpi_3_32b_defconfig
configs/rpi_3_defconfig
drivers/gpio/bcm2835_gpio.c
drivers/serial/serial_bcm283x_mu.c
include/configs/rpi.h
include/dm/platform_data/serial_bcm283x_mu.h