2015-08-02 16:18:52

by Timo Sigurdsson

[permalink] [raw]
Subject: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
driver, so add them to allow for voltage-scaling with cpufreq-dt.

Signed-off-by: Timo Sigurdsson <[email protected]>
---
Changes since v1 (RFC):

- Dropped the changes to the cpufreq operating points and renamed the patch
accordingly
- Limited the CPU voltage range so it doesn't exceed the SOC specifications
---
arch/arm/boot/dts/sun7i-a20-bananapi.dts | 35 ++++++++++++++++++++++++++++----
1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
index 9f7b472..74382f3 100644
--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
@@ -92,6 +92,10 @@
status = "okay";
};

+&cpu0 {
+ cpu-supply = <&reg_dcdc2>;
+};
+
&ehci0 {
status = "okay";
};
@@ -119,13 +123,9 @@
status = "okay";

axp209: pmic@34 {
- compatible = "x-powers,axp209";
reg = <0x34>;
interrupt-parent = <&nmi_intc>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
- interrupt-controller;
- #interrupt-cells = <1>;
};
};

@@ -182,6 +182,33 @@
};
};

+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+ regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-name = "avcc";
+};
+
&reg_usb1_vbus {
status = "okay";
};
--
2.1.4


2015-08-03 09:47:28

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

On Sun, Aug 02, 2015 at 06:18:25PM +0200, Timo Sigurdsson wrote:
> sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
> driver, so add them to allow for voltage-scaling with cpufreq-dt.
>
> Signed-off-by: Timo Sigurdsson <[email protected]>
> ---
> Changes since v1 (RFC):
>
> - Dropped the changes to the cpufreq operating points and renamed the patch
> accordingly
> - Limited the CPU voltage range so it doesn't exceed the SOC specifications
> ---
> arch/arm/boot/dts/sun7i-a20-bananapi.dts | 35 ++++++++++++++++++++++++++++----
> 1 file changed, 31 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> index 9f7b472..74382f3 100644
> --- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> +++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> @@ -92,6 +92,10 @@
> status = "okay";
> };
>
> +&cpu0 {
> + cpu-supply = <&reg_dcdc2>;
> +};
> +
> &ehci0 {
> status = "okay";
> };
> @@ -119,13 +123,9 @@
> status = "okay";
>
> axp209: pmic@34 {
> - compatible = "x-powers,axp209";
> reg = <0x34>;
> interrupt-parent = <&nmi_intc>;
> interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> -
> - interrupt-controller;
> - #interrupt-cells = <1>;
> };
> };
>
> @@ -182,6 +182,33 @@
> };
> };
>
> +#include "axp209.dtsi"
> +
> +&reg_dcdc2 {
> + regulator-always-on;
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-name = "vdd-cpu";
> +};
> +
> +&reg_dcdc3 {
> + regulator-always-on;
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-name = "vdd-int-dll";
> +};
> +
> +&reg_ldo1 {
> + regulator-name = "vdd-rtc";
> +};
> +
> +&reg_ldo2 {
> + regulator-always-on;
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3000000>;
> + regulator-name = "avcc";
> +};

What regulator provides the 3.3V regulator used in the rest of this DT
then (MMC, GMAC) ?

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (2.05 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-08-03 13:11:48

by Hans de Goede

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

Hi,

On 03-08-15 11:47, Maxime Ripard wrote:
> On Sun, Aug 02, 2015 at 06:18:25PM +0200, Timo Sigurdsson wrote:
>> sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
>> driver, so add them to allow for voltage-scaling with cpufreq-dt.
>>
>> Signed-off-by: Timo Sigurdsson <[email protected]>
>> ---
>> Changes since v1 (RFC):
>>
>> - Dropped the changes to the cpufreq operating points and renamed the patch
>> accordingly
>> - Limited the CPU voltage range so it doesn't exceed the SOC specifications
>> ---
>> arch/arm/boot/dts/sun7i-a20-bananapi.dts | 35 ++++++++++++++++++++++++++++----
>> 1 file changed, 31 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
>> index 9f7b472..74382f3 100644
>> --- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
>> +++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
>> @@ -92,6 +92,10 @@
>> status = "okay";
>> };
>>
>> +&cpu0 {
>> + cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>> &ehci0 {
>> status = "okay";
>> };
>> @@ -119,13 +123,9 @@
>> status = "okay";
>>
>> axp209: pmic@34 {
>> - compatible = "x-powers,axp209";
>> reg = <0x34>;
>> interrupt-parent = <&nmi_intc>;
>> interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>> -
>> - interrupt-controller;
>> - #interrupt-cells = <1>;
>> };
>> };
>>
>> @@ -182,6 +182,33 @@
>> };
>> };
>>
>> +#include "axp209.dtsi"
>> +
>> +&reg_dcdc2 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <1000000>;
>> + regulator-max-microvolt = <1400000>;
>> + regulator-name = "vdd-cpu";
>> +};
>> +
>> +&reg_dcdc3 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <1000000>;
>> + regulator-max-microvolt = <1400000>;
>> + regulator-name = "vdd-int-dll";
>> +};
>> +
>> +&reg_ldo1 {
>> + regulator-name = "vdd-rtc";
>> +};
>> +
>> +&reg_ldo2 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <3000000>;
>> + regulator-max-microvolt = <3000000>;
>> + regulator-name = "avcc";
>> +};
>
> What regulator provides the 3.3V regulator used in the rest of this DT
> then (MMC, GMAC) ?

A separate fixed regulator, like most (all?) other axp209 using boards,
e.g. the cubieboard has a TCS4199 regulator for this, and the banana
boards use a XL8206/UP1746 for this, according to the schematics I
have.

Regards,

Hans

>
> Maxime
>

2015-08-04 09:02:52

by Timo Sigurdsson

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

Hi Maxime,

Maxime Ripard schrieb am 03.08.2015 11:47:
> What regulator provides the 3.3V regulator used in the rest of this DT
> then (MMC, GMAC) ?

For GMAC, there is a reg_gmac_3v3 defined in sun7i-a20-bananapi.dts [1].
MMC uses reg_vcc3v3 included from sunxi-common-regulators.dtsi. Am I
missing something? Is this not sufficient?


Thanks,

Timo

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun7i-a20-bananapi.dts?id=v4.2-rc5#n78

2015-08-08 15:35:44

by Hans de Goede

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

Hi,

On 02-08-15 18:18, Timo Sigurdsson wrote:
> sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
> driver, so add them to allow for voltage-scaling with cpufreq-dt.
>
> Signed-off-by: Timo Sigurdsson <[email protected]>

Thanks for doing this, looks good to me:

Acked-by: Hans de Goede <[email protected]>

Regards,

Hans


p.s.

I've replaced my own patch with this one in my sunxi-wip branch.


> ---
> Changes since v1 (RFC):
>
> - Dropped the changes to the cpufreq operating points and renamed the patch
> accordingly
> - Limited the CPU voltage range so it doesn't exceed the SOC specifications
> ---
> arch/arm/boot/dts/sun7i-a20-bananapi.dts | 35 ++++++++++++++++++++++++++++----
> 1 file changed, 31 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> index 9f7b472..74382f3 100644
> --- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> +++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> @@ -92,6 +92,10 @@
> status = "okay";
> };
>
> +&cpu0 {
> + cpu-supply = <&reg_dcdc2>;
> +};
> +
> &ehci0 {
> status = "okay";
> };
> @@ -119,13 +123,9 @@
> status = "okay";
>
> axp209: pmic@34 {
> - compatible = "x-powers,axp209";
> reg = <0x34>;
> interrupt-parent = <&nmi_intc>;
> interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> -
> - interrupt-controller;
> - #interrupt-cells = <1>;
> };
> };
>
> @@ -182,6 +182,33 @@
> };
> };
>
> +#include "axp209.dtsi"
> +
> +&reg_dcdc2 {
> + regulator-always-on;
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-name = "vdd-cpu";
> +};
> +
> +&reg_dcdc3 {
> + regulator-always-on;
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-name = "vdd-int-dll";
> +};
> +
> +&reg_ldo1 {
> + regulator-name = "vdd-rtc";
> +};
> +
> +&reg_ldo2 {
> + regulator-always-on;
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3000000>;
> + regulator-name = "avcc";
> +};
> +
> &reg_usb1_vbus {
> status = "okay";
> };
>

2015-08-18 15:32:12

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

On Tue, Aug 04, 2015 at 11:02:24AM +0200, Timo Sigurdsson wrote:
> Hi Maxime,
>
> Maxime Ripard schrieb am 03.08.2015 11:47:
> > What regulator provides the 3.3V regulator used in the rest of this DT
> > then (MMC, GMAC) ?
>
> For GMAC, there is a reg_gmac_3v3 defined in sun7i-a20-bananapi.dts [1].
> MMC uses reg_vcc3v3 included from sunxi-common-regulators.dtsi. Am I
> missing something? Is this not sufficient?

Well, this 3.3v regulator doesn't appear out of nowhere. Most likely,
it's either one of the AXP output, or a regulator directly taking the
5v output of the DC plug.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (701.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-08-18 15:33:38

by Maxime Ripard

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

On Mon, Aug 03, 2015 at 03:11:41PM +0200, Hans de Goede wrote:
> Hi,
>
> On 03-08-15 11:47, Maxime Ripard wrote:
> >On Sun, Aug 02, 2015 at 06:18:25PM +0200, Timo Sigurdsson wrote:
> >>sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
> >>driver, so add them to allow for voltage-scaling with cpufreq-dt.
> >>
> >>Signed-off-by: Timo Sigurdsson <[email protected]>
> >>---
> >>Changes since v1 (RFC):
> >>
> >>- Dropped the changes to the cpufreq operating points and renamed the patch
> >>accordingly
> >>- Limited the CPU voltage range so it doesn't exceed the SOC specifications
> >>---
> >> arch/arm/boot/dts/sun7i-a20-bananapi.dts | 35 ++++++++++++++++++++++++++++----
> >> 1 file changed, 31 insertions(+), 4 deletions(-)
> >>
> >>diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> >>index 9f7b472..74382f3 100644
> >>--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> >>+++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
> >>@@ -92,6 +92,10 @@
> >> status = "okay";
> >> };
> >>
> >>+&cpu0 {
> >>+ cpu-supply = <&reg_dcdc2>;
> >>+};
> >>+
> >> &ehci0 {
> >> status = "okay";
> >> };
> >>@@ -119,13 +123,9 @@
> >> status = "okay";
> >>
> >> axp209: pmic@34 {
> >>- compatible = "x-powers,axp209";
> >> reg = <0x34>;
> >> interrupt-parent = <&nmi_intc>;
> >> interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> >>-
> >>- interrupt-controller;
> >>- #interrupt-cells = <1>;
> >> };
> >> };
> >>
> >>@@ -182,6 +182,33 @@
> >> };
> >> };
> >>
> >>+#include "axp209.dtsi"
> >>+
> >>+&reg_dcdc2 {
> >>+ regulator-always-on;
> >>+ regulator-min-microvolt = <1000000>;
> >>+ regulator-max-microvolt = <1400000>;
> >>+ regulator-name = "vdd-cpu";
> >>+};
> >>+
> >>+&reg_dcdc3 {
> >>+ regulator-always-on;
> >>+ regulator-min-microvolt = <1000000>;
> >>+ regulator-max-microvolt = <1400000>;
> >>+ regulator-name = "vdd-int-dll";
> >>+};
> >>+
> >>+&reg_ldo1 {
> >>+ regulator-name = "vdd-rtc";
> >>+};
> >>+
> >>+&reg_ldo2 {
> >>+ regulator-always-on;
> >>+ regulator-min-microvolt = <3000000>;
> >>+ regulator-max-microvolt = <3000000>;
> >>+ regulator-name = "avcc";
> >>+};
> >
> >What regulator provides the 3.3V regulator used in the rest of this DT
> >then (MMC, GMAC) ?
>
> A separate fixed regulator, like most (all?) other axp209 using boards,
> e.g. the cubieboard has a TCS4199 regulator for this, and the banana
> boards use a XL8206/UP1746 for this, according to the schematics I
> have.

Ack.

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (2.56 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-08-18 15:36:36

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: dts: sunxi: Add regulators for LeMaker BananaPi

On Sun, Aug 02, 2015 at 06:18:25PM +0200, Timo Sigurdsson wrote:
> sun7i-a20-bananapi.dts doesn't contain regulator nodes for the AXP209 PMU
> driver, so add them to allow for voltage-scaling with cpufreq-dt.
>
> Signed-off-by: Timo Sigurdsson <[email protected]>

Queued, thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (408.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments