[OpenWrt-Devel] [PATCH] ramips: mir3g: reduce usb power flapping at boot

Mathias Kresin dev at kresin.me
Mon Jun 11 10:56:56 EDT 2018


08.06.2018 20:45, Kevin Darbyshire-Bryant:
> Define USB port power as set on by bootloader (which it is)  The power
> gets cycled at kernel boot, but by defining as 'regulator-boot-on'
> reduces the power off to power on at driver initial load & setup from
> around 5 seconds to around 2 seconds.
> 
> Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
> ---
>   target/linux/ramips/dts/MIR3G.dts | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/MIR3G.dts
> index 44dfc1796c..1ca085e6c4 100644
> --- a/target/linux/ramips/dts/MIR3G.dts
> +++ b/target/linux/ramips/dts/MIR3G.dts
> @@ -72,6 +72,7 @@
>   		regulator-min-microvolt = <5000000>;
>   		regulator-max-microvolt = <5000000>;
>   		gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
> +		regulator-boot-on;
>   		enable-active-high;
>   	};

NAK on this one.

Following our conversation on IRC, I had a look at the fixed regulator 
code to see what it really does. By default the regulator is disabled 
during driver load[0]. The "regulator-boot-on" inverts the logic and 
enables the regulator while loading the fixed regulator driver.

In my opinion, enabling the fixed regulator unconditionally on boot 
contradicts your initial "switch to fixed regulator" patch. Without the 
"regulator-boot-on", the GPIO is pulled LOW (usb pwr disabled) on boot 
and it's the usb driver which enables the usb pwr (pulls HIGH) == 
controls the power supply. This way the usb pwr stays/is off, if someone 
decides to not include or load the usb driver.

Mathias

[0] 
https://github.com/torvalds/linux/blob/master/drivers/regulator/fixed.c#L159

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/listinfo/openwrt-devel



More information about the openwrt-devel mailing list