aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini2018-02-16 13:56:02 -0500
committerTom Rini2018-02-16 13:56:02 -0500
commitbd650cd404b6dc870b6cc220025f35da4b31d0f4 (patch)
tree5082c02c7320fe0410624ccd1d9d6628905ca9df /drivers
parent7961b9f6db19d039b4e6e9c21a9715b6d5b92393 (diff)
parent5b6ae550a8d88ca8c7b5c39642fe767729422edb (diff)
Merge git://git.denx.de/u-boot-sh
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/renesas/clk-rcar-gen3.c2
-rw-r--r--drivers/net/ravb.c32
-rw-r--r--drivers/serial/serial_sh.c4
3 files changed, 23 insertions, 15 deletions
diff --git a/drivers/clk/renesas/clk-rcar-gen3.c b/drivers/clk/renesas/clk-rcar-gen3.c
index 0c394a8a71b..1be3fe71364 100644
--- a/drivers/clk/renesas/clk-rcar-gen3.c
+++ b/drivers/clk/renesas/clk-rcar-gen3.c
@@ -288,6 +288,8 @@ static ulong gen3_clk_get_rate(struct clk *clk)
static ulong gen3_clk_set_rate(struct clk *clk, ulong rate)
{
+ /* Force correct SD-IF divider configuration if applicable */
+ gen3_clk_setup_sdif_div(clk);
return gen3_clk_get_rate(clk);
}
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index 093288b639f..bd30cba940b 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -399,7 +399,7 @@ static int ravb_dmac_init(struct udevice *dev)
static int ravb_config(struct udevice *dev)
{
struct ravb_priv *eth = dev_get_priv(dev);
- struct phy_device *phy;
+ struct phy_device *phy = eth->phydev;
u32 mask = ECMR_CHG_DM | ECMR_RE | ECMR_TE;
int ret;
@@ -410,13 +410,6 @@ static int ravb_config(struct udevice *dev)
ravb_mac_init(eth);
ravb_write_hwaddr(dev);
- /* Configure phy */
- ret = ravb_phy_config(dev);
- if (ret)
- return ret;
-
- phy = eth->phydev;
-
ret = phy_startup(phy);
if (ret)
return ret;
@@ -443,10 +436,6 @@ static int ravb_start(struct udevice *dev)
struct ravb_priv *eth = dev_get_priv(dev);
int ret;
- ret = clk_enable(&eth->clk);
- if (ret)
- return ret;
-
ret = ravb_reset(dev);
if (ret)
goto err;
@@ -473,8 +462,8 @@ static void ravb_stop(struct udevice *dev)
{
struct ravb_priv *eth = dev_get_priv(dev);
+ phy_shutdown(eth->phydev);
ravb_reset(dev);
- clk_disable(&eth->clk);
}
static int ravb_probe(struct udevice *dev)
@@ -512,8 +501,23 @@ static int ravb_probe(struct udevice *dev)
eth->bus = miiphy_get_dev_by_name(dev->name);
+ /* Bring up PHY */
+ ret = clk_enable(&eth->clk);
+ if (ret)
+ goto err_mdio_register;
+
+ ret = ravb_reset(dev);
+ if (ret)
+ goto err_mdio_reset;
+
+ ret = ravb_phy_config(dev);
+ if (ret)
+ goto err_mdio_reset;
+
return 0;
+err_mdio_reset:
+ clk_disable(&eth->clk);
err_mdio_register:
mdio_free(mdiodev);
err_mdio_alloc:
@@ -525,6 +529,8 @@ static int ravb_remove(struct udevice *dev)
{
struct ravb_priv *eth = dev_get_priv(dev);
+ clk_disable(&eth->clk);
+
free(eth->phydev);
mdio_unregister(eth->bus);
mdio_free(eth->bus);
diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c
index c07ddc70dc8..a17698f90ee 100644
--- a/drivers/serial/serial_sh.c
+++ b/drivers/serial/serial_sh.c
@@ -149,7 +149,7 @@ static int sh_serial_getc_generic(struct uart_port *port)
return ch;
}
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
static int sh_serial_pending(struct udevice *dev, bool input)
{
@@ -204,7 +204,7 @@ static const struct dm_serial_ops sh_serial_ops = {
.setbrg = sh_serial_setbrg,
};
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
static const struct udevice_id sh_serial_id[] ={
{.compatible = "renesas,sci", .data = PORT_SCI},
{.compatible = "renesas,scif", .data = PORT_SCIF},