diff options
author | Tom Rini <trini@konsulko.com> | 2018-03-14 13:27:14 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-03-14 13:27:14 -0400 |
commit | b75643ad0a2429e7efc7317517b47203c3c2f7c9 (patch) | |
tree | b502e94a80977a8ddeee441da37211a3b5d955a1 /drivers | |
parent | 218da804ef0971ecee8063c45deae0345e344812 (diff) | |
parent | 341c05865478e259c1c9d889c74c43dcd5192cc0 (diff) | |
download | u-boot-b75643ad0a2429e7efc7317517b47203c3c2f7c9.tar.gz u-boot-b75643ad0a2429e7efc7317517b47203c3c2f7c9.tar.xz u-boot-b75643ad0a2429e7efc7317517b47203c3c2f7c9.zip |
Merge git://git.denx.de/u-boot-sunxi
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/sunxi_mmc.c | 10 | ||||
-rw-r--r-- | drivers/net/phy/Kconfig | 7 | ||||
-rw-r--r-- | drivers/net/sun8i_emac.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index 4edb4be46c..df6f32850e 100644 --- a/drivers/mmc/sunxi_mmc.c +++ b/drivers/mmc/sunxi_mmc.c @@ -30,6 +30,7 @@ struct sunxi_mmc_priv { uint32_t *mclkreg; unsigned fatal_err; struct gpio_desc cd_gpio; /* Change Detect GPIO */ + int cd_inverted; /* Inverted Card Detect */ struct sunxi_mmc *reg; struct mmc_config cfg; }; @@ -544,9 +545,11 @@ static int sunxi_mmc_getcd(struct udevice *dev) { struct sunxi_mmc_priv *priv = dev_get_priv(dev); - if (dm_gpio_is_valid(&priv->cd_gpio)) - return dm_gpio_get_value(&priv->cd_gpio); + if (dm_gpio_is_valid(&priv->cd_gpio)) { + int cd_state = dm_gpio_get_value(&priv->cd_gpio); + return cd_state ^ priv->cd_inverted; + } return 1; } @@ -610,6 +613,9 @@ static int sunxi_mmc_probe(struct udevice *dev) sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP); } + /* Check if card detect is inverted */ + priv->cd_inverted = dev_read_bool(dev, "cd-inverted"); + upriv->mmc = &plat->mmc; /* Reset controller */ diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 7fd4a8d261..25de3fb226 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -13,6 +13,13 @@ menuconfig PHYLIB if PHYLIB +config PHY_ADDR + int "PHY address" + default 1 if ARCH_SUNXI + default 0 + help + The address of PHY on MII bus. Usually in range of 0 to 31. + config B53_SWITCH bool "Broadcom BCM53xx (RoboSwitch) Ethernet switch PHY support." help diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index 3ccc6b0bb6..be43472b1a 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -431,7 +431,7 @@ static int _sun8i_emac_eth_init(struct emac_eth_dev *priv, u8 *enetaddr) tx_descs_init(priv); /* PHY Start Up */ - genphy_parse_link(priv->phydev); + phy_startup(priv->phydev); sun8i_adjust_link(priv, priv->phydev); |