Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
u-boot-am335xboneblack
0025-serial-bcm283x_mu-support-disabling.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0025-serial-bcm283x_mu-support-disabling.patch of Package u-boot-am335xboneblack
From e0a7c2a11b365b043fde687439aae62bbef9553c Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fvogt@suse.com> Date: Tue, 13 Sep 2016 15:55:19 +0200 Subject: [PATCH] serial: bcm283x_mu: support disabling after initialization --- drivers/serial/serial_bcm283x_mu.c | 18 ++++++++++++++++-- include/dm/platform_data/serial_bcm283x_mu.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c index 930c892..a0d0833 100644 --- a/drivers/serial/serial_bcm283x_mu.c +++ b/drivers/serial/serial_bcm283x_mu.c @@ -59,7 +59,7 @@ static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate) struct bcm283x_mu_regs *regs = priv->regs; u32 divider; - if (plat->skip_init) + if (plat->disabled || plat->skip_init) return 0; divider = plat->clock / (baudrate * 8); @@ -82,10 +82,14 @@ static int bcm283x_mu_serial_probe(struct udevice *dev) static int bcm283x_mu_serial_getc(struct udevice *dev) { + struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); struct bcm283x_mu_regs *regs = priv->regs; u32 data; + if (plat->disabled) + return -EAGAIN; + /* Wait until there is data in the FIFO */ if (!(readl(®s->lsr) & BCM283X_MU_LSR_RX_READY)) return -EAGAIN; @@ -97,9 +101,13 @@ static int bcm283x_mu_serial_getc(struct udevice *dev) static int bcm283x_mu_serial_putc(struct udevice *dev, const char data) { + struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); struct bcm283x_mu_regs *regs = priv->regs; + if (plat->disabled) + return 0; + /* Wait until there is space in the FIFO */ if (!(readl(®s->lsr) & BCM283X_MU_LSR_TX_EMPTY)) return -EAGAIN; @@ -112,9 +120,15 @@ static int bcm283x_mu_serial_putc(struct udevice *dev, const char data) static int bcm283x_mu_serial_pending(struct udevice *dev, bool input) { + struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev); struct bcm283x_mu_priv *priv = dev_get_priv(dev); struct bcm283x_mu_regs *regs = priv->regs; - unsigned int lsr = readl(®s->lsr); + unsigned int lsr; + + if (plat->disabled) + return 0; + + lsr = readl(®s->lsr); if (input) { WATCHDOG_RESET(); 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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor