diff options
author | Tom Rini <trini@konsulko.com> | 2016-07-31 20:31:13 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-07-31 20:31:13 -0400 |
commit | 26fb8db0f4d1e7c118b5e8f3a8849f359b91c166 (patch) | |
tree | e804df1f0dc8fdf6cfe825f711f930c80d545f02 /drivers | |
parent | fcada3b05e56c9b22bf5f92ba94fa80449452e76 (diff) | |
parent | dd63fbc70a5fa59677c86695ebad341834fec172 (diff) | |
download | u-boot-imx-26fb8db0f4d1e7c118b5e8f3a8849f359b91c166.zip u-boot-imx-26fb8db0f4d1e7c118b5e8f3a8849f359b91c166.tar.gz u-boot-imx-26fb8db0f4d1e7c118b5e8f3a8849f359b91c166.tar.bz2 |
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/mmc-uclass.c | 6 | ||||
-rw-r--r-- | drivers/pinctrl/rockchip/pinctrl_rk3288.c | 21 |
2 files changed, 22 insertions, 5 deletions
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 38ced41..f262c6e 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -111,18 +111,18 @@ struct mmc *find_mmc_device(int dev_num) int get_mmc_num(void) { - return max(blk_find_max_devnum(IF_TYPE_MMC), 0); + return max((blk_find_max_devnum(IF_TYPE_MMC) + 1), 0); } int mmc_get_next_devnum(void) { int ret; - ret = get_mmc_num(); + ret = blk_find_max_devnum(IF_TYPE_MMC); if (ret < 0) return ret; - return ret + 1; + return ret; } struct blk_desc *mmc_get_blk_desc(struct mmc *mmc) diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3288.c b/drivers/pinctrl/rockchip/pinctrl_rk3288.c index ae8a4f1..0322264 100644 --- a/drivers/pinctrl/rockchip/pinctrl_rk3288.c +++ b/drivers/pinctrl/rockchip/pinctrl_rk3288.c @@ -588,6 +588,7 @@ static int rk3288_pinctrl_set_pins(struct udevice *dev, int banknum, int index, struct rk3288_pinctrl_priv *priv = dev_get_priv(dev); uint shift, ind = index; uint mask; + uint value; u32 *addr; int ret; @@ -596,7 +597,18 @@ static int rk3288_pinctrl_set_pins(struct udevice *dev, int banknum, int index, &mask); if (ret) return ret; - rk_clrsetreg(addr, mask << shift, muxval << shift); + + /* + * PMU_GPIO0 registers cannot be selectively written so we cannot use + * rk_clrsetreg() here. However, the upper 16 bits are reserved and + * are ignored when written, so we can use the same code as for the + * other GPIO banks providing that we preserve the value of the other + * bits. + */ + value = readl(addr); + value &= ~(mask << shift); + value |= (mask << (shift + 16)) | (muxval << shift); + writel(value, addr); /* Handle pullup/pulldown */ if (flags) { @@ -614,7 +626,12 @@ static int rk3288_pinctrl_set_pins(struct udevice *dev, int banknum, int index, addr = &priv->grf->gpio1_p[banknum - 1][ind]; debug("%s: addr=%p, val=%x, shift=%x\n", __func__, addr, val, shift); - rk_clrsetreg(addr, 3 << shift, val << shift); + + /* As above, rk_clrsetreg() cannot be used here. */ + value = readl(addr); + value &= ~(mask << shift); + value |= (3 << (shift + 16)) | (val << shift); + writel(value, addr); } return 0; |