diff --git a/patches/29-usb2phy-no-otg-sm-in-host.patch b/patches/29-usb2phy-no-blind-otg-sm.patch similarity index 58% rename from patches/29-usb2phy-no-otg-sm-in-host.patch rename to patches/29-usb2phy-no-blind-otg-sm.patch index 932a12b..9e4f297 100644 --- a/patches/29-usb2phy-no-otg-sm-in-host.patch +++ b/patches/29-usb2phy-no-blind-otg-sm.patch @@ -17,7 +17,39 @@ diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchi }; /** -@@ -649,11 +651,52 @@ +@@ -239,6 +241,8 @@ + * @dcd_retries: The retry count used to track Data contact + * detection process. + * @edev: extcon device for notification registration ++ * @edev_self_allocated: no extcon phandle in DT, so the OTG state machine ++ * has no external role signal at all + * @irq: muxed interrupt for single irq configuration + * @phy_cfg: phy register configuration, assigned by driver data. + * @ports: phy port instance. +@@ -257,6 +261,7 @@ + enum power_supply_type chg_type; + u8 dcd_retries; + struct extcon_dev *edev; ++ bool edev_self_allocated; + int irq; + const struct rockchip_usb2phy_cfg *phy_cfg; + struct rockchip_usb2phy_port ports[USB2PHY_NUM_PORTS]; +@@ -459,6 +464,14 @@ + if (ret) + return dev_err_probe(rphy->dev, ret, + "failed to register extcon device\n"); ++ ++ /* ++ * Nothing external drives the role on this board. The extcon ++ * below is ours, and no code ever sets a cable state on it, so ++ * the OTG state machine's view of the world is permanently ++ * blank rather than merely stale. ++ */ ++ rphy->edev_self_allocated = true; + } + + rphy->edev = edev; +@@ -649,11 +662,52 @@ return 0; } @@ -70,23 +102,33 @@ diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchi .owner = THIS_MODULE, }; -@@ -667,6 +710,10 @@ +@@ -667,6 +721,15 @@ unsigned long delay; bool vbus_attach, sch_work, notify_charger; -+ /* In host role this machine can only get the answer wrong. */ -+ if (rport->host_mode) ++ /* ++ * This machine can only get the answer wrong here. In host role its ++ * verdict suspends a phy that is enumerating a device (#160); with a ++ * self-allocated extcon it has no role signal in EITHER direction, and ++ * in device role it strands the gadget the same way (#168). ++ */ ++ if (rport->host_mode || rphy->edev_self_allocated) + return; + vbus_attach = property_enabled(rphy->grf, &rport->port_cfg->utmi_bvalid); -@@ -825,6 +872,10 @@ +@@ -825,6 +888,15 @@ bool is_dcd, tmout, vout, vbus_attach; unsigned long delay; -+ /* Never probe the front end of a port that is hosting a device. */ -+ if (rport->host_mode) ++ /* ++ * Never probe the front end of a port that is hosting a device, and ++ * never at all on a board whose bvalid is pinned high by the VBUS ++ * bypass: charger detection cannot be meaningful there, and its DCP ++ * verdict powers the phy off underneath a working link (#160, #168). ++ */ ++ if (rport->host_mode || rphy->edev_self_allocated) + return; + vbus_attach = property_enabled(rphy->grf, &rport->port_cfg->utmi_bvalid); diff --git a/patches/README.md b/patches/README.md index 14f1e34..41dcb04 100644 --- a/patches/README.md +++ b/patches/README.md @@ -19,7 +19,7 @@ with `../build/warden_defconfig` -> `zImage` + `rv1106-warden.dtb`). | `20-arch-dts-bindings.patch` | `arch/arm` DTs (`rv1106.dtsi`, `rv1106-warden.dts`, pinctrl), mach, configs, `include/dt-bindings` | | `25-usb-phy.patch` | inno-usb2 phy | | `27-usb-phy-tuning.patch` | inno-usb2 phy: RV1106 signal-quality register tuning | -| `29-usb2phy-no-otg-sm-in-host.patch` | inno-usb2 phy: keep the OTG/charger state machines out of host role | +| `29-usb2phy-no-blind-otg-sm.patch` | inno-usb2 phy: stop the OTG/charger state machines running blind | | `30-drm-vop-panel-rgb.patch` | VOP (`rgb_dclk_pol`=0 + WIN1 scanout), panel-simple bus-format, rockchip_rgb | | `35-mailbox-hpmcu.patch` | rockchip-mailbox (rv1106 num_chans=1) | | `40-pvtm-soc.patch` | PVTM (core+pmu) + `include/soc/rockchip/pvtm.h` |