[U-Boot] [EXT] Re: [PATCH v2 4/7] mvebu: usb: xhci: Add support for VBUS controlled by GPIO

Marek Vasut marex at denx.de
Mon Feb 6 19:32:37 UTC 2017


On 02/06/2017 02:26 PM, Kostya Porotchkin wrote:
> Hi, Marek,

Hi,

(please stop top-posting)

> I added a regulator to the board DTS and connected it to the USB port:
> 
> /{
> 	model = "MACCHIATOBin-8040";
> 	compatible = "marvell,armada8040-mcbin",
> 		     "marvell,armada8040";
> ...
> ...
> 	regulators {
> 		compatible = "simple-bus";
> 		#address-cells = <1>;
> 		#size-cells = <0>;
> 
> 		reg_usb3h0_vbus: usb3-vbus0 {
> 			compatible = "regulator-fixed";
> 			pinctrl-names = "default";
> 			pinctrl-0 = <&cpm_xhci_vbus_pins>;
> 			regulator-name = "reg-usb3h0-vbus";
> 			regulator-min-microvolt = <5000000>;
> 			regulator-max-microvolt = <5000000>;
> 			startup-delay-us = <500000>;
> 			enable-active-high;
> 			regulator-always-on;
> 			gpio = <&cpm_gpio1 15 GPIO_ACTIVE_HIGH>; /* GPIO[47] */
> 		};
> 	};
> };
> 
> &cps_usb3_0 {
> 	vcc-supply = <&reg_usb3h0_vbus>;
> 	status = "okay";
> };
> 
> However the regulator is not activated when I issue "usb reset" command.
> I can either call to " uclass_first_device(UCLASS_REGULATOR, &dev)" during arch early init stage,
> or select the regulator with "regulator dev" command.
> 
> Only then the VBUS GPIO enables the USB power.
> 
> Is it the expected behavior or I am missing something in my configuration?

You should request and enable the regulator in your driver , ie using
regulator_set_enable()

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list