summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Huo <mason.huo@starfivetech.com>2023-03-22 08:33:31 +0300
committerHal Feng <hal.feng@starfivetech.com>2023-11-29 05:54:31 +0300
commit9572aaa97604dfc8b46f778e63c15b5ecde34250 (patch)
tree303f9d281dcbba5aa966029f01fcadc2436c9418
parentda983c661a998a9ffd0a20445bdf3585b0380f43 (diff)
downloadu-boot-9572aaa97604dfc8b46f778e63c15b5ecde34250.tar.xz
pinctrl: starfive: Set up usb overcurrent signal
For devkit HW design, there is not GPIO specific for the usb controller overcurrent signal. Config the sys iomux register to hardwire this signal, so that the usb controller can work normally. Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
-rwxr-xr-xdrivers/pinctrl/starfive/pinctrl-jh7110-sys.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/pinctrl/starfive/pinctrl-jh7110-sys.c b/drivers/pinctrl/starfive/pinctrl-jh7110-sys.c
index 4e761641eb..13c1a81e92 100755
--- a/drivers/pinctrl/starfive/pinctrl-jh7110-sys.c
+++ b/drivers/pinctrl/starfive/pinctrl-jh7110-sys.c
@@ -376,10 +376,23 @@ const struct starfive_pinctrl_soc_info jh7110_sys_pinctrl_info = {
static int jh7110_sys_pinctrl_probe(struct udevice *dev)
{
+ u32 value;
+ int ret;
struct starfive_pinctrl_soc_info *info =
(struct starfive_pinctrl_soc_info *)dev_get_driver_data(dev);
+ struct starfive_pinctrl_priv *priv = dev_get_priv(dev);
+
+ ret = starfive_pinctrl_probe(dev, info);
+
+ /* Set up the usb controller overcurrent signal. */
+ if (!ret) {
+ value = readl(priv->base + JH7110_SYS_GPI);
+ value &= ~(0x7f << 16);
+ value |= BIT(16);
+ writel(value, priv->base + JH7110_SYS_GPI);
+ }
- return starfive_pinctrl_probe(dev, info);
+ return ret;
}
static const struct udevice_id jh7110_sys_pinctrl_ids[] = {