mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 07:51:38 +00:00
serial: pl01x: set baudrate when probing
It is found that when DM is enabled, only generic init function is called in .probe(). Baudrate is never honored. Add a function call to .setbrg() when probing so that we can update the baudrate of the serial device. Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
This commit is contained in:
parent
be2eb3ad8f
commit
91febe80c9
1 changed files with 8 additions and 3 deletions
|
@ -290,6 +290,7 @@ int pl01x_serial_probe(struct udevice *dev)
|
|||
{
|
||||
struct pl01x_serial_plat *plat = dev_get_plat(dev);
|
||||
struct pl01x_priv *priv = dev_get_priv(dev);
|
||||
int ret;
|
||||
|
||||
#if CONFIG_IS_ENABLED(OF_PLATDATA)
|
||||
struct dtd_serial_pl01x *dtplat = &plat->dtplat;
|
||||
|
@ -301,10 +302,14 @@ int pl01x_serial_probe(struct udevice *dev)
|
|||
#endif
|
||||
priv->type = plat->type;
|
||||
|
||||
if (!plat->skip_init)
|
||||
return pl01x_generic_serial_init(priv->regs, priv->type);
|
||||
else
|
||||
if (!plat->skip_init) {
|
||||
ret = pl01x_generic_serial_init(priv->regs, priv->type);
|
||||
if (ret)
|
||||
return ret;
|
||||
return pl01x_serial_setbrg(dev, gd->baudrate);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int pl01x_serial_getc(struct udevice *dev)
|
||||
|
|
Loading…
Add table
Reference in a new issue