Hi Anand, On Thu, Feb 7, 2019 at 7:33 AM Anand Moon <linux.amoon@xxxxxxxxx> wrote: > > Hi Martin, > > On Wed, 6 Feb 2019 at 16:58, Martin Blumenstingl > <martin.blumenstingl@xxxxxxxxxxxxxx> wrote: > > > > Hi Anand, > > > > On Tue, Feb 5, 2019 at 8:53 PM Anand Moon <linux.amoon@xxxxxxxxx> wrote: > > [...] > > > > my interpretationfor the Amlogic SoCs is: > > > > - vusb_a and vusb_d are generated internally, not sure if there's an > > > > external fixed regulator > > > > - there is no phy-supply (the PHY itself is powered by clock-gating > > > > using the CLKID_USB clock) > > > > - usb0 VBUS is controlled by GPIOAO_5 > > > > > > > > > > But as per the device tree binding > > > > > > [0] https://elixir.bootlin.com/linux/v5.0-rc5/source/Documentation/devicetree/bindings/phy/meson8b-usb2-phy.txt > > > [1] https://elixir.bootlin.com/linux/v5.0-rc5/source/Documentation/devicetree/bindings/phy/phy-bindings.txt > > > > > > its uses phy-supply to enable power to usb phy which seem to be correct option. > > phy-bindings.txt states that "phy-supply" is a "Phandle to a regulator > > that provides power to the PHY". > > I have written the example in meson8b-usb2-phy.txt and I think it's > > wrong (back when I wrote it I didn't know about the "vbus-supply" > > property on the controller and I didn't know about the VBUS > > constraints). > > > > I believe that the phy-supply property is intended for PHYs which need > > an external power supply (for example because they are not embedded > > into a SoC or if the SoC has separate voltage inputs for the PHY). > > I'm not aware of any PHY supply voltage on the Amlogic SoCs (I believe > > this is done internally within the SoC). instead they use clock gating > > to power down the PHY. > > > > as far as I understand the VBUS signal it depends on the USB mode: > > - host provides VBUS > > - peripheral devices are powered using this voltage > > - with OTG VBUS needs to be turned on or off depending on the current > > mode (host or peripheral) > > with the "phy-supply" property there's no way to manage the regulator > > depending on the USB mode (host or peripheral), it will always be > > "on". > > > > > > Regards > > Martin > > Thanks for the clarification. > But this dose not work setting the usb1_phy to use vbus-supply. > > &usb1_phy { > status = "okay"; > + vbus-supply = <&usb_vbus>; > }; > > I am attaching a small patch for testing. > [0] usbvbus.patch indeed, this is not working for me either. I checked my old notes at [0] -> it works for me when setting "vbus-supply" at the usb controller (not the PHY). with the following snippet: &usb1 { status = "okay"; vbus-supply = <&usb_vbus>; }; I get: # cat /sys/kernel/debug/regulator/regulator_summary | grep -i usb c90c0000.usb 1 0mA 0mV 0mV c90c0000.usb 1 0mA 0mV 0mV USB_VBUS 1 1 0 unknown 5000mV 0mA 5000mV 5000mV c90c0000.usb 1 0mA 0mV 0mV can you please try this on your board as well? > Here is the summary of the above patch. > > 1. hot-plugins of usb device is not working. > 2. only cold/warm boot let the device come up. > 3. not power is supplied to the usb ports. > 4. no power module is registered with the regulator summary. with "vbus-supply" moved to the usb1 node I get the following result: 1. same: hot-plugins of usb device is not working 2. different: a reboot doesn't make devices come up 3. same: no power is supplied to the USB ports (in my case this causes #2, but it's not clear why there's no power...) 4. different: the regulator is registered with the USB controller in debugfs Regards Martin [0] https://lkml.org/lkml/2019/1/18/960