From 601147b06a708900c5352dc3dcc5d64271bf0d62 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 15 Aug 2016 17:48:51 +0200 Subject: 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 Acked-by: Stephen Warren Reviewed-by: Simon Glass --- include/configs/rpi.h | 1 + include/dm/platform_data/serial_bcm283x_mu.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/configs/rpi.h b/include/configs/rpi.h index 752cc31..e34814b 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h @@ -16,6 +16,7 @@ /* Architecture, CPU, etc.*/ #define CONFIG_ARCH_CPU_INIT +#define CONFIG_BOARD_EARLY_INIT_F /* Use SoC timer for AArch32, but architected timer for AArch64 */ #ifndef CONFIG_ARM64 diff --git a/include/dm/platform_data/serial_bcm283x_mu.h b/include/dm/platform_data/serial_bcm283x_mu.h index 57ae6ad..c47d3c0 100644 --- a/include/dm/platform_data/serial_bcm283x_mu.h +++ b/include/dm/platform_data/serial_bcm283x_mu.h @@ -19,6 +19,7 @@ struct bcm283x_mu_serial_platdata { unsigned long base; unsigned int clock; bool skip_init; + bool disabled; }; #endif -- cgit v1.1