From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Mon, 15 Aug 2016 22:52:08 -0600 Subject: [U-Boot] [PATCH v4 2/2] serial: bcm283x_mu: Detect disabled serial device In-Reply-To: <66ddc3f2-167b-c905-1d13-2559284bcd3c@wwwdotorg.org> References: <1470915512-40855-2-git-send-email-agraf@suse.de> <1471276131-136827-1-git-send-email-agraf@suse.de> <66ddc3f2-167b-c905-1d13-2559284bcd3c@wwwdotorg.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 15 August 2016 at 21:30, Stephen Warren wrote: > > 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 > > 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. > Agreed - yes let's wait until we have another case or two. Reviewed-by: Simon Glass > 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)? - Simon