[U-Boot] [PATCH v4 2/2] serial: bcm283x_mu: Detect disabled serial device

Stephen Warren swarren at wwwdotorg.org
Tue Aug 16 05:30:24 CEST 2016


On 08/15/2016 09:48 AM, Alexander Graf wrote:
> 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.

Acked-by: Stephen Warren <swarren at wwwdotorg.org>

Nits:

I'd hope for a core DM feature to disable statically created devices 
rather than re-implementing it per driver, so we don't have to re-invent 
this each time we need it. Still, we can refactor this later if it turns 
out to be more generally useful.

Perhaps a separate patch for the raw serial driver feature 
(serial_bcm283x_mu.h, serial_bcm283x_mu.c), and the board-specific logic 
(all the other files)?


More information about the U-Boot mailing list