struct bcm283x_mu_regs *regs = priv->regs;
u32 divider;
- if (plat->disabled || plat->skip_init)
+ if (plat->skip_init)
return 0;
divider = plat->clock / (baudrate * 8);
struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
struct bcm283x_mu_priv *priv = dev_get_priv(dev);
- if (plat->disabled)
- return -ENODEV;
-
priv->regs = (struct bcm283x_mu_regs *)plat->base;
return 0;
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;
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;
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;
- if (plat->disabled)
- return 0;
-
lsr = readl(®s->lsr);
if (input) {
1);
plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
"skip-init");
- plat->disabled = false;
return 0;
}
#endif