mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-24 20:54:24 +08:00
net: ravb: Support multiple clocks
The RZ/G2 series uses an external clock as a reference to the AVB. If this clock is controlled by an external programmable clock, it must be requested by the consumer or it will not turn on. In order to do this, update the driver to use bulk enable and disable functions to enable clocks for boards with multiple clocks. Signed-off-by: Adam Ford <aford173@gmail.com>
This commit is contained in:
parent
a1c01b17c5
commit
182754f43a
@ -129,7 +129,7 @@ struct ravb_priv {
|
||||
struct phy_device *phydev;
|
||||
struct mii_dev *bus;
|
||||
void __iomem *iobase;
|
||||
struct clk clk;
|
||||
struct clk_bulk clks;
|
||||
struct gpio_desc reset_gpio;
|
||||
};
|
||||
|
||||
@ -485,7 +485,7 @@ static int ravb_probe(struct udevice *dev)
|
||||
iobase = map_physmem(pdata->iobase, 0x1000, MAP_NOCACHE);
|
||||
eth->iobase = iobase;
|
||||
|
||||
ret = clk_get_by_index(dev, 0, ð->clk);
|
||||
ret = clk_get_bulk(dev, ð->clks);
|
||||
if (ret < 0)
|
||||
goto err_mdio_alloc;
|
||||
|
||||
@ -518,7 +518,7 @@ static int ravb_probe(struct udevice *dev)
|
||||
eth->bus = miiphy_get_dev_by_name(dev->name);
|
||||
|
||||
/* Bring up PHY */
|
||||
ret = clk_enable(ð->clk);
|
||||
ret = clk_enable_bulk(ð->clks);
|
||||
if (ret)
|
||||
goto err_mdio_register;
|
||||
|
||||
@ -533,7 +533,7 @@ static int ravb_probe(struct udevice *dev)
|
||||
return 0;
|
||||
|
||||
err_mdio_reset:
|
||||
clk_disable(ð->clk);
|
||||
clk_release_bulk(ð->clks);
|
||||
err_mdio_register:
|
||||
mdio_free(mdiodev);
|
||||
err_mdio_alloc:
|
||||
@ -545,7 +545,7 @@ static int ravb_remove(struct udevice *dev)
|
||||
{
|
||||
struct ravb_priv *eth = dev_get_priv(dev);
|
||||
|
||||
clk_disable(ð->clk);
|
||||
clk_release_bulk(ð->clks);
|
||||
|
||||
free(eth->phydev);
|
||||
mdio_unregister(eth->bus);
|
||||
|
Loading…
Reference in New Issue
Block a user