[3/3] arm64: dts: rk3399: Add init voltage for vdd_log
diff mbox series

Message ID 20191111005158.25070-3-kever.yang@rock-chips.com
State New
Headers show
Series
  • [1/3] arm64: dts: rockchip: Fix min voltage for rk3399-firefly vdd_log
Related show

Commit Message

Kever Yang Nov. 11, 2019, 12:51 a.m. UTC
Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
will be 'enable' with the dts node at a default PWM state with high or low
output. Both too high or too low for vdd_log is not good for the board,
add init voltage for driver to make the regulator get into a know output.

Note that this will be used by U-Boot for init voltage output, and this
is very important for it may get system hang somewhere during system
boot up with regulator enable and without this init value.

CC: Elaine Zhang <zhangqing@rock-chips.com>
CC: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm64/boot/dts/rockchip/rk3399-evb.dts          | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-firefly.dts      | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts   | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts    | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts     | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts       | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts    | 1 +
 arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi    | 1 +
 9 files changed, 9 insertions(+)

Comments

Soeren Moch Nov. 11, 2019, 8:42 a.m. UTC | #1
On 11.11.19 01:51, Kever Yang wrote:
> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
> will be 'enable' with the dts node at a default PWM state with high or low
> output. Both too high or too low for vdd_log is not good for the board,
> add init voltage for driver to make the regulator get into a know output.
>
> Note that this will be used by U-Boot for init voltage output, and this
> is very important for it may get system hang somewhere during system
> boot up with regulator enable and without this init value.
I think it's a good idea to include this setting in the main dts for the
boards (not in u-boot specific additions as is done now). But there is
(for some reason?) no documented binding for regulator-init-microvolt in
linux.

Regards,
Soeren
>
> CC: Elaine Zhang <zhangqing@rock-chips.com>
> CC: Peter Robinson <pbrobinson@gmail.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  arch/arm64/boot/dts/rockchip/rk3399-evb.dts          | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-firefly.dts      | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts   | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts    | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts     | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts       | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts    | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi    | 1 +
>  9 files changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> index 77008dca45bc..fa241aeb11b0 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> @@ -65,6 +65,7 @@
>  		regulator-name = "vdd_center";
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		regulator-always-on;
>  		regulator-boot-on;
>  		status = "okay";
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> index 92de83dd4dbc..4e45269fcdff 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> @@ -208,6 +208,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <430000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> index c133e8d64b2a..692f3154edc3 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> @@ -100,6 +100,7 @@
>  		regulator-name = "vdd_log";
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		regulator-always-on;
>  		regulator-boot-on;
>  	};
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> index 4944d78a0a1c..c2ac80d99301 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> @@ -79,6 +79,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vsys_3v3>;
>  	};
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> index 73be38a53796..c32abcc4ddc1 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> @@ -101,6 +101,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc5v0_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> index 0541dfce924d..9d674c51f025 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> @@ -164,6 +164,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> index 19f7732d728c..7d856ce1d156 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> @@ -129,6 +129,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc3v3_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> index e544deb61d28..8fbccbc8bf47 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> @@ -174,6 +174,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1700000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc5v0_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> index 1bc1579674e5..f8e2cb8c0624 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> @@ -133,6 +133,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc_sys>;
>  	};
>  };
Kever Yang Nov. 12, 2019, 8:04 a.m. UTC | #2
On 2019/11/11 下午4:42, Soeren Moch wrote:
> On 11.11.19 01:51, Kever Yang wrote:
>> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
>> will be 'enable' with the dts node at a default PWM state with high or low
>> output. Both too high or too low for vdd_log is not good for the board,
>> add init voltage for driver to make the regulator get into a know output.
>>
>> Note that this will be used by U-Boot for init voltage output, and this
>> is very important for it may get system hang somewhere during system
>> boot up with regulator enable and without this init value.
> I think it's a good idea to include this setting in the main dts for the
> boards (not in u-boot specific additions as is done now). But there is
> (for some reason?) no documented binding for regulator-init-microvolt in
> linux.


Ohh, I forgot the kernel driver does not support this property.

@Heiko, can we add this 'regulator-init-microvolt' without driver 
support but adding document for

it at dt-binding?


Thanks,

- Kever

>
> Regards,
> Soeren
>> CC: Elaine Zhang <zhangqing@rock-chips.com>
>> CC: Peter Robinson <pbrobinson@gmail.com>
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>> ---
>>
>>   arch/arm64/boot/dts/rockchip/rk3399-evb.dts          | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-firefly.dts      | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts   | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts    | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts     | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts       | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts    | 1 +
>>   arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi    | 1 +
>>   9 files changed, 9 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
>> index 77008dca45bc..fa241aeb11b0 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
>> @@ -65,6 +65,7 @@
>>   		regulator-name = "vdd_center";
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		regulator-always-on;
>>   		regulator-boot-on;
>>   		status = "okay";
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
>> index 92de83dd4dbc..4e45269fcdff 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
>> @@ -208,6 +208,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <430000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vcc_sys>;
>>   	};
>>   };
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
>> index c133e8d64b2a..692f3154edc3 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
>> @@ -100,6 +100,7 @@
>>   		regulator-name = "vdd_log";
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		regulator-always-on;
>>   		regulator-boot-on;
>>   	};
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
>> index 4944d78a0a1c..c2ac80d99301 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
>> @@ -79,6 +79,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vsys_3v3>;
>>   	};
>>
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
>> index 73be38a53796..c32abcc4ddc1 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
>> @@ -101,6 +101,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vcc5v0_sys>;
>>   	};
>>   };
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
>> index 0541dfce924d..9d674c51f025 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
>> @@ -164,6 +164,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vcc_sys>;
>>   	};
>>   };
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
>> index 19f7732d728c..7d856ce1d156 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
>> @@ -129,6 +129,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vcc3v3_sys>;
>>   	};
>>   };
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
>> index e544deb61d28..8fbccbc8bf47 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
>> @@ -174,6 +174,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1700000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vcc5v0_sys>;
>>   	};
>>   };
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
>> index 1bc1579674e5..f8e2cb8c0624 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
>> @@ -133,6 +133,7 @@
>>   		regulator-boot-on;
>>   		regulator-min-microvolt = <800000>;
>>   		regulator-max-microvolt = <1400000>;
>> +		regulator-init-microvolt = <950000>;
>>   		vin-supply = <&vcc_sys>;
>>   	};
>>   };
Heiko Stuebner Nov. 12, 2019, 8:10 a.m. UTC | #3
Hi Kever,

Am Dienstag, 12. November 2019, 09:04:49 CET schrieb Kever Yang:
> 
> On 2019/11/11 下午4:42, Soeren Moch wrote:
> > On 11.11.19 01:51, Kever Yang wrote:
> >> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
> >> will be 'enable' with the dts node at a default PWM state with high or low
> >> output. Both too high or too low for vdd_log is not good for the board,
> >> add init voltage for driver to make the regulator get into a know output.
> >>
> >> Note that this will be used by U-Boot for init voltage output, and this
> >> is very important for it may get system hang somewhere during system
> >> boot up with regulator enable and without this init value.
> > I think it's a good idea to include this setting in the main dts for the
> > boards (not in u-boot specific additions as is done now). But there is
> > (for some reason?) no documented binding for regulator-init-microvolt in
> > linux.
> 
> 
> Ohh, I forgot the kernel driver does not support this property.
> 
> @Heiko, can we add this 'regulator-init-microvolt' without driver 
> support but adding document for
> 
> it at dt-binding?

In theory yes, but you would still need to get DT maintainers
and Mark Brown (regulator maintainer) involved before that.

Especially as this is a individual property you will need to have
a good excuse why you're not implementing it in the kernel as well.

And of course you will need to keep in mind that it might be
in the kernel in the future.


Heiko



> 
> 
> Thanks,
> 
> - Kever
> 
> >
> > Regards,
> > Soeren
> >> CC: Elaine Zhang <zhangqing@rock-chips.com>
> >> CC: Peter Robinson <pbrobinson@gmail.com>
> >> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> >> ---
> >>
> >>   arch/arm64/boot/dts/rockchip/rk3399-evb.dts          | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-firefly.dts      | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts   | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts    | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts     | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts       | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts    | 1 +
> >>   arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi    | 1 +
> >>   9 files changed, 9 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> >> index 77008dca45bc..fa241aeb11b0 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> >> @@ -65,6 +65,7 @@
> >>   		regulator-name = "vdd_center";
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		regulator-always-on;
> >>   		regulator-boot-on;
> >>   		status = "okay";
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> >> index 92de83dd4dbc..4e45269fcdff 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> >> @@ -208,6 +208,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <430000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vcc_sys>;
> >>   	};
> >>   };
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> >> index c133e8d64b2a..692f3154edc3 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> >> @@ -100,6 +100,7 @@
> >>   		regulator-name = "vdd_log";
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		regulator-always-on;
> >>   		regulator-boot-on;
> >>   	};
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> >> index 4944d78a0a1c..c2ac80d99301 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> >> @@ -79,6 +79,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vsys_3v3>;
> >>   	};
> >>
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> >> index 73be38a53796..c32abcc4ddc1 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> >> @@ -101,6 +101,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vcc5v0_sys>;
> >>   	};
> >>   };
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> >> index 0541dfce924d..9d674c51f025 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> >> @@ -164,6 +164,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vcc_sys>;
> >>   	};
> >>   };
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> >> index 19f7732d728c..7d856ce1d156 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> >> @@ -129,6 +129,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vcc3v3_sys>;
> >>   	};
> >>   };
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> >> index e544deb61d28..8fbccbc8bf47 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> >> @@ -174,6 +174,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1700000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vcc5v0_sys>;
> >>   	};
> >>   };
> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> >> index 1bc1579674e5..f8e2cb8c0624 100644
> >> --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> >> +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> >> @@ -133,6 +133,7 @@
> >>   		regulator-boot-on;
> >>   		regulator-min-microvolt = <800000>;
> >>   		regulator-max-microvolt = <1400000>;
> >> +		regulator-init-microvolt = <950000>;
> >>   		vin-supply = <&vcc_sys>;
> >>   	};
> >>   };
> 
> 
>
Markus Reichl Nov. 12, 2019, 8:16 a.m. UTC | #4
Hi Kever,

have a rk3399-roc-pc running mainline U-Boot and kernel and vdd_log is 
showing 1118 mV.
Is this a danger for the board?
How to fix it?
Btw. vin-supply for this pwm-regulator is ignored and I could not find it 
in bindings doc. 

Gruß,
Soeren Moch Nov. 12, 2019, 8:44 a.m. UTC | #5
On 12.11.19 09:16, Markus Reichl wrote:
> Hi Kever,
>
> have a rk3399-roc-pc running mainline U-Boot and kernel and vdd_log is
> showing 1118 mV.
> Is this a danger for the board?
I think yes. What I read vdd_log on rk3399 must not exceed 1.0V.
> How to fix it?
You probably need to do something like [1].

[1] https://patchwork.kernel.org/patch/11173465/

Gruß,
Sören
> Btw. vin-supply for this pwm-regulator is ignored and I could not find it
> in bindings doc.
>
> Gruß,
Markus Reichl Nov. 12, 2019, 8:51 a.m. UTC | #6
Thanks Sören,

Am 12.11.19 um 09:44 schrieb Sören Moch:
> On 12.11.19 09:16, Markus Reichl wrote:
>> Hi Kever,
>>
>> have a rk3399-roc-pc running mainline U-Boot and kernel and vdd_log is
>> showing 1118 mV.
>> Is this a danger for the board?
> I think yes. What I read vdd_log on rk3399 must not exceed 1.0V.
>> How to fix it?
> You probably need to do something like [1].

will measure and come up with a patch.

> 
> [1] https://patchwork.kernel.org/patch/11173465/
> 
> Gruß,
> Sören
>> Btw. vin-supply for this pwm-regulator is ignored and I could not find it
>> in bindings doc.
>>
> Gruß,
Kever Yang Nov. 12, 2019, 10:02 a.m. UTC | #7
Markus,


On 2019/11/12 下午4:16, Markus Reichl wrote:
> Hi Kever,
>
> have a rk3399-roc-pc running mainline U-Boot and kernel and vdd_log is
> showing 1118 mV.

The rk3399-roc-pc have the same vdd_log circuit in schematic, so it 
should like the patch 1/3 of

this patch set.

I don't understand who is setting this value, maybe the default value 
without pwm regulator enabled?

> Is this a danger for the board?
> How to fix it?

The best way is to set correct min/max microvolt of the 
regulator(measure with PWM output low and high),

(note that if  no driver touch the regulator, the PWM is default input, 
not output;)

and set a init-microvolt for U-Boot driver, and I think no kernel driver 
touch this regulator now.


Thanks,

- Kever

> Btw. vin-supply for this pwm-regulator is ignored and I could not find it
> in bindings doc.
>
> Gruß,
Soeren Moch Nov. 12, 2019, 10:19 a.m. UTC | #8
On 12.11.19 11:02, Kever Yang wrote:
> Markus,
>
>
> On 2019/11/12 下午4:16, Markus Reichl wrote:
>> Hi Kever,
>>
>> have a rk3399-roc-pc running mainline U-Boot and kernel and vdd_log is
>> showing 1118 mV.
>
> The rk3399-roc-pc have the same vdd_log circuit in schematic, so it
> should like the patch 1/3 of
>
> this patch set.
>
> I don't understand who is setting this value, maybe the default value
> without pwm regulator enabled?
>
>> Is this a danger for the board?
>> How to fix it?
>
> The best way is to set correct min/max microvolt of the
> regulator(measure with PWM output low and high),
I didn't look into the schematic of this board, but if it is similar to
RockPro64, setting the pwm regulator to the max voltage of 1.7V will
probably kill the rk3399 immediately. So I recommend not to do this...

Regards,
Soeren
>
> (note that if  no driver touch the regulator, the PWM is default
> input, not output;)
> to
> and set a init-microvolt for U-Boot driver, and I think no kernel
> driver touch this regulator now.
>
>
> Thanks,
>
> - Kever
>
>> Btw. vin-supply for this pwm-regulator is ignored and I could not
>> find it
>> in bindings doc.
>>
>> Gruß,
>
>
Markus Reichl Nov. 12, 2019, 11:06 a.m. UTC | #9
Dear Sore, Kever,

Am 12.11.19 um 11:19 schrieb Soeren Moch:
> 
> 
> On 12.11.19 11:02, Kever Yang wrote:
>> Markus,
>>
>>
>> On 2019/11/12 下午4:16, Markus Reichl wrote:
>>> Hi Kever,
>>>
>>> have a rk3399-roc-pc running mainline U-Boot and kernel and vdd_log is
>>> showing 1118 mV.
>>
>> The rk3399-roc-pc have the same vdd_log circuit in schematic, so it
>> should like the patch 1/3 of
>>
>> this patch set.
>>
>> I don't understand who is setting this value, maybe the default value
>> without pwm regulator enabled?
>>
>>> Is this a danger for the board?
>>> How to fix it?
>>
>> The best way is to set correct min/max microvolt of the
>> regulator(measure with PWM output low and high),
> I didn't look into the schematic of this board, but if it is similar to
> RockPro64, setting the pwm regulator to the max voltage of 1.7V will
> probably kill the rk3399 immediately. So I recommend not to do this...
> 
It has to be set to 450mV - 1400mV to give 953mV.
I will come out with a patch that fixes this.

> Regards,
> Soeren
>>
>> (note that if  no driver touch the regulator, the PWM is default
>> input, not output;)
>> to
>> and set a init-microvolt for U-Boot driver, and I think no kernel
>> driver touch this regulator now.
>>
>>
>> Thanks,
>>
>> - Kever
>>
>>> Btw. vin-supply for this pwm-regulator is ignored and I could not
>>> find it
>>> in bindings doc.
>>>
>>> Gruß,
>>
>>
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 

Gruß,
Kever Yang Nov. 13, 2019, 3:21 a.m. UTC | #10
Heiko,

     Could you help to just pick the first patch and drop the other 2 
patches?

     I think it's better to fix in the U-Boot first so that the 
stability issue will be fixed,

and the update in kernel dts is not so urgent for kernel driver actually 
not setting

this pwm regulator.

     I want to add a patch for rk3399-roc-pc, since Markus Reichl 
already send it,

so it's OK for that board, and for rock960/Ficus, the vdd_log is removed 
for stability

issue, then we have to update U-Boot first before kernel can add the 
vdd_log back.


Thanks,

- Kever

On 2019/11/12 下午4:10, Heiko Stübner wrote:
> Hi Kever,
>
> Am Dienstag, 12. November 2019, 09:04:49 CET schrieb Kever Yang:
>> On 2019/11/11 下午4:42, Soeren Moch wrote:
>>> On 11.11.19 01:51, Kever Yang wrote:
>>>> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
>>>> will be 'enable' with the dts node at a default PWM state with high or low
>>>> output. Both too high or too low for vdd_log is not good for the board,
>>>> add init voltage for driver to make the regulator get into a know output.
>>>>
>>>> Note that this will be used by U-Boot for init voltage output, and this
>>>> is very important for it may get system hang somewhere during system
>>>> boot up with regulator enable and without this init value.
>>> I think it's a good idea to include this setting in the main dts for the
>>> boards (not in u-boot specific additions as is done now). But there is
>>> (for some reason?) no documented binding for regulator-init-microvolt in
>>> linux.
>>
>> Ohh, I forgot the kernel driver does not support this property.
>>
>> @Heiko, can we add this 'regulator-init-microvolt' without driver
>> support but adding document for
>>
>> it at dt-binding?
> In theory yes, but you would still need to get DT maintainers
> and Mark Brown (regulator maintainer) involved before that.
>
> Especially as this is a individual property you will need to have
> a good excuse why you're not implementing it in the kernel as well.
>
> And of course you will need to keep in mind that it might be
> in the kernel in the future.
>
>
> Heiko
>
>
>
>>
>> Thanks,
>>
>> - Kever
>>
>>> Regards,
>>> Soeren
>>>> CC: Elaine Zhang <zhangqing@rock-chips.com>
>>>> CC: Peter Robinson <pbrobinson@gmail.com>
>>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>>>> ---
>>>>
>>>>    arch/arm64/boot/dts/rockchip/rk3399-evb.dts          | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-firefly.dts      | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts   | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts    | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts     | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts       | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts    | 1 +
>>>>    arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi    | 1 +
>>>>    9 files changed, 9 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
>>>> index 77008dca45bc..fa241aeb11b0 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
>>>> @@ -65,6 +65,7 @@
>>>>    		regulator-name = "vdd_center";
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		regulator-always-on;
>>>>    		regulator-boot-on;
>>>>    		status = "okay";
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
>>>> index 92de83dd4dbc..4e45269fcdff 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
>>>> @@ -208,6 +208,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <430000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vcc_sys>;
>>>>    	};
>>>>    };
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
>>>> index c133e8d64b2a..692f3154edc3 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
>>>> @@ -100,6 +100,7 @@
>>>>    		regulator-name = "vdd_log";
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		regulator-always-on;
>>>>    		regulator-boot-on;
>>>>    	};
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
>>>> index 4944d78a0a1c..c2ac80d99301 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
>>>> @@ -79,6 +79,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vsys_3v3>;
>>>>    	};
>>>>
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
>>>> index 73be38a53796..c32abcc4ddc1 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
>>>> @@ -101,6 +101,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vcc5v0_sys>;
>>>>    	};
>>>>    };
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
>>>> index 0541dfce924d..9d674c51f025 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
>>>> @@ -164,6 +164,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vcc_sys>;
>>>>    	};
>>>>    };
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
>>>> index 19f7732d728c..7d856ce1d156 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
>>>> @@ -129,6 +129,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vcc3v3_sys>;
>>>>    	};
>>>>    };
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
>>>> index e544deb61d28..8fbccbc8bf47 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
>>>> @@ -174,6 +174,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1700000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vcc5v0_sys>;
>>>>    	};
>>>>    };
>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
>>>> index 1bc1579674e5..f8e2cb8c0624 100644
>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
>>>> @@ -133,6 +133,7 @@
>>>>    		regulator-boot-on;
>>>>    		regulator-min-microvolt = <800000>;
>>>>    		regulator-max-microvolt = <1400000>;
>>>> +		regulator-init-microvolt = <950000>;
>>>>    		vin-supply = <&vcc_sys>;
>>>>    	};
>>>>    };
>>
>>
>
>
>
Doug Anderson Nov. 13, 2019, 5:01 p.m. UTC | #11
Hi,

On Sun, Nov 10, 2019 at 4:52 PM Kever Yang <kever.yang@rock-chips.com> wrote:
>
> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
> will be 'enable' with the dts node at a default PWM state with high or low
> output. Both too high or too low for vdd_log is not good for the board,
> add init voltage for driver to make the regulator get into a know output.
>
> Note that this will be used by U-Boot for init voltage output, and this
> is very important for it may get system hang somewhere during system
> boot up with regulator enable and without this init value.

I'm a tad bit confused here.  When U-Boot boots the kernel, how is the
PWM configured?

I remember folks going through a lot of work to make sure that we
could actually _read_ the PWM state that the bootloader gave us and
report it as the initial voltage.  If the kernel ends up needing to
configure the PWM regulator's period for some reason, I remember it
would actually pick something close.  Is that not working for you?

For instance, on rk3288-veyron when I boot up mainline (no devfreq on
rk3288-veyron on mainline) the vdd_logic reports 1.2 volts because it
read what the bootloader left it as.

...are you saying that U-Boot doesn't configure the PWM and you're
trying to fix it up in the kernel?

-Doug


-Doug
Vicente Bergas Nov. 13, 2019, 5:50 p.m. UTC | #12
On Monday, November 11, 2019 1:51:58 AM CET, Kever Yang wrote:
> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
> will be 'enable' with the dts node at a default PWM state with high or low
> output. Both too high or too low for vdd_log is not good for the board,
> add init voltage for driver to make the regulator get into a know output.
>
> Note that this will be used by U-Boot for init voltage output, and this
> is very important for it may get system hang somewhere during system
> boot up with regulator enable and without this init value.

Hi, just for reference: doing the math based on the Sapphire board
schematic, the values for vdd_log are:
|------|-------|
| PWM  | Volts |
|------|-------|
| Hi-Z | 1.136 |
|   0% | 1.356 |
| 100% | .9167 |
|------|-------|
The datasheet states that the acceptable range for vdd_log is 0.8 .. 1.0
So, an option could be to configure GPIO1_C3 as output high and vdd_log
would be at the range's center.

Aside from math on paper, it has been tested. Setting GPIO1_C3 as output
high gives a vdd_log of 0.922 measured volts and the board, so far, works
fine.

Regards,
  Vicente.

> CC: Elaine Zhang <zhangqing@rock-chips.com>
> CC: Peter Robinson <pbrobinson@gmail.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
>  arch/arm64/boot/dts/rockchip/rk3399-evb.dts          | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-firefly.dts      | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts   | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts    | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts     | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts       | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts    | 1 +
>  arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi    | 1 +
>  9 files changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> index 77008dca45bc..fa241aeb11b0 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
> @@ -65,6 +65,7 @@
>  		regulator-name = "vdd_center";
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		regulator-always-on;
>  		regulator-boot-on;
>  		status = "okay";
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> index 92de83dd4dbc..4e45269fcdff 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> @@ -208,6 +208,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <430000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> index c133e8d64b2a..692f3154edc3 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
> @@ -100,6 +100,7 @@
>  		regulator-name = "vdd_log";
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		regulator-always-on;
>  		regulator-boot-on;
>  	};
> diff --git 
> a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi 
> b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> index 4944d78a0a1c..c2ac80d99301 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
> @@ -79,6 +79,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vsys_3v3>;
>  	};
>  
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> index 73be38a53796..c32abcc4ddc1 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
> @@ -101,6 +101,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc5v0_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> index 0541dfce924d..9d674c51f025 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
> @@ -164,6 +164,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> index 19f7732d728c..7d856ce1d156 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
> @@ -129,6 +129,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc3v3_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> index e544deb61d28..8fbccbc8bf47 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
> @@ -174,6 +174,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1700000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc5v0_sys>;
>  	};
>  };
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi 
> b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> index 1bc1579674e5..f8e2cb8c0624 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
> @@ -133,6 +133,7 @@
>  		regulator-boot-on;
>  		regulator-min-microvolt = <800000>;
>  		regulator-max-microvolt = <1400000>;
> +		regulator-init-microvolt = <950000>;
>  		vin-supply = <&vcc_sys>;
>  	};
>  };
Kever Yang Nov. 14, 2019, 1:53 a.m. UTC | #13
Hi Doug,

On 2019/11/14 上午1:01, Doug Anderson wrote:
> Hi,
>
> On Sun, Nov 10, 2019 at 4:52 PM Kever Yang <kever.yang@rock-chips.com> wrote:
>> Since there is no devfreq used for vdd_log, so the vdd_log(pwm regulator)
>> will be 'enable' with the dts node at a default PWM state with high or low
>> output. Both too high or too low for vdd_log is not good for the board,
>> add init voltage for driver to make the regulator get into a know output.
>>
>> Note that this will be used by U-Boot for init voltage output, and this
>> is very important for it may get system hang somewhere during system
>> boot up with regulator enable and without this init value.
> I'm a tad bit confused here.  When U-Boot boots the kernel, how is the
> PWM configured?
>
> I remember folks going through a lot of work to make sure that we
> could actually _read_ the PWM state that the bootloader gave us and
> report it as the initial voltage.  If the kernel ends up needing to
> configure the PWM regulator's period for some reason, I remember it
> would actually pick something close.  Is that not working for you?
>
> For instance, on rk3288-veyron when I boot up mainline (no devfreq on
> rk3288-veyron on mainline) the vdd_logic reports 1.2 volts because it
> read what the bootloader left it as.
>
> ...are you saying that U-Boot doesn't configure the PWM and you're
> trying to fix it up in the kernel?

U-Boot will configure the PWM with dts setting(and now U-Boot would like 
to sync the dts

from kernel directly):

- no dts node for pwm regulator, it will be default as input IO without 
any configure;

- with pwm regulator dts enable, no 'init-microvolt', enable PWM with 
default 0% output;

- with pwm regulator dts with 'init-microvolt', enable PWM with 
corresponding duty output;

We should leave it not configure(around 0.9V for most of board) or 
configure to correct

output(some boards need 0.95V while default is 0.9V for stability issue).

For the rk3399 boards on upstream, some of them do not have a vdd_log in 
dts,

and others have dts node but without 'init-microvolt' for init setting, 
that's what I want

to fix to make sure all the boards can work correctly.


Thanks,

- Kever

>
> -Doug
>
>
> -Doug
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>
Heiko Stuebner Nov. 18, 2019, 1:05 a.m. UTC | #14
Hi Kever,

Am Mittwoch, 13. November 2019, 04:21:35 CET schrieb Kever Yang:
> Heiko,
> 
>      Could you help to just pick the first patch and drop the other 2 
> patches?

I did as requested now :-)

Heiko

Patch
diff mbox series

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
index 77008dca45bc..fa241aeb11b0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-evb.dts
@@ -65,6 +65,7 @@ 
 		regulator-name = "vdd_center";
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		regulator-always-on;
 		regulator-boot-on;
 		status = "okay";
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index 92de83dd4dbc..4e45269fcdff 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -208,6 +208,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <430000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vcc_sys>;
 	};
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
index c133e8d64b2a..692f3154edc3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
@@ -100,6 +100,7 @@ 
 		regulator-name = "vdd_log";
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		regulator-always-on;
 		regulator-boot-on;
 	};
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
index 4944d78a0a1c..c2ac80d99301 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
@@ -79,6 +79,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vsys_3v3>;
 	};
 
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
index 73be38a53796..c32abcc4ddc1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
@@ -101,6 +101,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vcc5v0_sys>;
 	};
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
index 0541dfce924d..9d674c51f025 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
@@ -164,6 +164,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vcc_sys>;
 	};
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
index 19f7732d728c..7d856ce1d156 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dts
@@ -129,6 +129,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vcc3v3_sys>;
 	};
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
index e544deb61d28..8fbccbc8bf47 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts
@@ -174,6 +174,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1700000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vcc5v0_sys>;
 	};
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
index 1bc1579674e5..f8e2cb8c0624 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
@@ -133,6 +133,7 @@ 
 		regulator-boot-on;
 		regulator-min-microvolt = <800000>;
 		regulator-max-microvolt = <1400000>;
+		regulator-init-microvolt = <950000>;
 		vin-supply = <&vcc_sys>;
 	};
 };