2019-04-23 17:29:23

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 0/7] ARM: dts: sun8i: v40 Rewrite BPi M2 Berry DTS based on BPi M2 Ultra

BPi M2 Berry is a trimmed down version of the BPi M2 Ultra, completely
software compatible.

Changes include:
- 2GiB -> 1GiB
- no eMMC
- no onboard microphone
- no IR
- no blue LED
- no charging (and power jack to USB)
- dropped USB2 and connect USB1 to a 4-port HUB.

Changes in v5:
- Changed commit order
- Removed regulator-always-on from gpio regulators
- Copied commit log for the bluetooth node from the m2-ultra

Changes in v4:
- Went back to v2
- Added GPIO pin-bank regulators (both m2-ultra and m2-berry)

Changes in v3:
- Removed "Sort device node dereferences" (already applied)
- Added basic pio node
- Tied GMAC regulators to the pio (both m2-ultra and m2-berry)

Changes in v2:
- Split into smaller patches

Pablo Greco (7):
ARM: dts: sun8i: r40: bananapi-m2-ultra: Add GPIO pin-bank regulator
supplies
ARM: dts: sun8i: v40: bananapi-m2-berry: Add GPIO pin-bank regulator
supplies
ARM: dts: sun8i: v40: bananapi-m2-berry: Enable GMAC ethernet
controller
ARM: dts: sun8i: v40: bananapi-m2-berry: Enable HDMI output
ARM: dts: sun8i: v40: bananapi-m2-berry: Enable AHCI
ARM: dts: sun8i: v40: bananapi-m2-berry: Fix WiFi regulator
definitions
ARM: dts: sun8i: v40: bananapi-m2-berry: Add Bluetooth device node

arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 6 ++
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 123 ++++++++++++++++++++++
2 files changed, 129 insertions(+)

--
1.8.3.1


2019-04-23 17:27:50

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 5/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable AHCI

Just like the Bananapi M2 Ultra, enable the ahci controller and
the two regulators needed to activate it.

Reviewed-by: Jagan Teki <[email protected]>
Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index e5ea901..f7ad1cf 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -99,6 +99,12 @@
};
};

+&ahci {
+ ahci-supply = <&reg_dldo4>;
+ phy-supply = <&reg_eldo3>;
+ status = "okay";
+};
+
&de {
status = "okay";
};
@@ -234,6 +240,18 @@
regulator-name = "vcc-wifi";
};

+&reg_dldo4 {
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ regulator-name = "vdd2v5-sata";
+};
+
+&reg_eldo3 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-name = "vdd1v2-sata";
+};
+
&tcon_tv0 {
status = "okay";
};
--
1.8.3.1

2019-04-23 17:28:06

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 6/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Fix WiFi regulator definitions

Just like was done for the bananapi-m2-ultra, add the second wifi/bt
regulator and mark both as always-on.

Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index f7ad1cf..c87f2c0 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -234,12 +234,27 @@
regulator-name = "vcc-wifi-io";
};

+/*
+ * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
+ * time, with the two being in sync, to be able to meet maximum power
+ * consumption during transmits. Since this is not really supported
+ * right now, just use the two as always on, and we will fix it later.
+ */
+
&reg_dldo2 {
+ regulator-always-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vcc-wifi";
};

+&reg_dldo3 {
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-wifi-2";
+};
+
&reg_dldo4 {
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
--
1.8.3.1

2019-04-23 17:28:56

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 2/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add GPIO pin-bank regulator supplies

The bananapi-m2-berry has the PMIC providing voltage to all the pin-bank
supply rails from its various regulator outputs, tie them to the pio
node.

Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index f05cabd..2cb2ce0 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -123,6 +123,16 @@
status = "okay";
};

+&pio {
+ pinctrl-names = "default";
+ vcc-pa-supply = <&reg_aldo2>;
+ vcc-pc-supply = <&reg_dcdc1>;
+ vcc-pd-supply = <&reg_dcdc1>;
+ vcc-pe-supply = <&reg_eldo1>;
+ vcc-pf-supply = <&reg_dcdc1>;
+ vcc-pg-supply = <&reg_dldo1>;
+};
+
&reg_aldo3 {
regulator-always-on;
regulator-min-microvolt = <2700000>;
--
1.8.3.1

2019-04-23 17:29:05

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 4/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable HDMI output

This patch adds the hdmi nodes to the Bananapi M2 Berry, the same way it
was done to the Bananapi M2 Ultra

Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 29 +++++++++++++++++++++++
1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 561319b..e5ea901 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -58,6 +58,17 @@
stdout-path = "serial0:115200n8";
};

+ connector {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint = <&hdmi_out_con>;
+ };
+ };
+ };
+
leds {
compatible = "gpio-leds";

@@ -88,6 +99,10 @@
};
};

+&de {
+ status = "okay";
+};
+
&ehci1 {
/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
status = "okay";
@@ -109,6 +124,16 @@
};
};

+&hdmi {
+ status = "okay";
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
&i2c0 {
status = "okay";

@@ -209,6 +234,10 @@
regulator-name = "vcc-wifi";
};

+&tcon_tv0 {
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pb_pins>;
--
1.8.3.1

2019-04-23 17:29:05

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 3/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable GMAC ethernet controller

Just like the Bananapi M2 Ultra, the Bananapi M2 Berry has a Realtek
RTL8211E RGMII PHY tied to the GMAC.
The PMIC's DC1SW output provides power for the PHY, while the ALDO2
output provides I/O voltages on both sides.

Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 29 +++++++++++++++++++++++
1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index 2cb2ce0..561319b 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -50,6 +50,7 @@
compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";

aliases {
+ ethernet0 = &gmac;
serial0 = &uart0;
};

@@ -92,6 +93,22 @@
status = "okay";
};

+&gmac {
+ pinctrl-names = "default";
+ pinctrl-0 = <&gmac_rgmii_pins>;
+ phy-handle = <&phy1>;
+ phy-mode = "rgmii";
+ phy-supply = <&reg_dc1sw>;
+ status = "okay";
+};
+
+&gmac_mdio {
+ phy1: ethernet-phy@1 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <1>;
+ };
+};
+
&i2c0 {
status = "okay";

@@ -133,6 +150,12 @@
vcc-pg-supply = <&reg_dldo1>;
};

+&reg_aldo2 {
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ regulator-name = "vcc-pa";
+};
+
&reg_aldo3 {
regulator-always-on;
regulator-min-microvolt = <2700000>;
@@ -140,6 +163,12 @@
regulator-name = "avcc";
};

+&reg_dc1sw {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-name = "vcc-gmac-phy";
+};
+
&reg_dcdc1 {
regulator-always-on;
regulator-min-microvolt = <3000000>;
--
1.8.3.1

2019-04-23 17:29:31

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 1/7] ARM: dts: sun8i: r40: bananapi-m2-ultra: Add GPIO pin-bank regulator supplies

The bananapi-m2-ultra has the PMIC providing voltage to all the pin-bank
supply rails from its various regulator outputs, tie them to the pio
node.

Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index c488aaa..699579d 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -201,6 +201,12 @@
&pio {
pinctrl-names = "default";
pinctrl-0 = <&clk_out_a_pin>;
+ vcc-pa-supply = <&reg_aldo2>;
+ vcc-pc-supply = <&reg_dcdc1>;
+ vcc-pd-supply = <&reg_dcdc1>;
+ vcc-pe-supply = <&reg_eldo1>;
+ vcc-pf-supply = <&reg_dcdc1>;
+ vcc-pg-supply = <&reg_dldo1>;
};

&reg_aldo2 {
--
1.8.3.1

2019-04-23 17:29:50

by Pablo Greco

[permalink] [raw]
Subject: [PATCH v5 7/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add Bluetooth device node

The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side
identifies as BCM43430, while the Bluetooth side identifies as BCM43438.

The Bluetooth side is connected to UART3 in a 4 wire configuration. Same
as the WiFi side, due to being the same chip and package, DLDO1 and
DLDO2 regulator outputs from the PMIC provide overall power via VBAT and
I/O power via VDDIO. The CLK_OUT_A clock output from the SoC provides
the LPO low power clock at 32.768 kHz.

This patch enables Bluetooth on this board, and also adds the missing
LPO clock on the WiFi side. There is also a PCM connection for
Bluetooth, but this is not covered here.

The LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin
PI12. This can be represented in multiple ways. This patch puts the
pinctrl property in the pin controller node. This is due to limitations
in Linux, where pinmux settings, even the same one, can not be shared
by multiple devices. Thus we cannot put it in both the WiFi and
Bluetooth device nodes. Putting it the CCU node is another option, but
Linux's CCU driver does not handle pinctrl. Also the pin controller is
guaranteed to be initialized after the CCU, when clocks are available.
And any other devices that use muxed pins are guaranteed to be
initialized after the pin controller. Thus having the CLK_OUT_A pinmux
reference be in the pin controller node is a good choice without having
to deal with implementation issues.

Signed-off-by: Pablo Greco <[email protected]>
---
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
index c87f2c0..15c22b0 100644
--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -96,6 +96,8 @@
wifi_pwrseq: wifi_pwrseq {
compatible = "mmc-pwrseq-simple";
reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
+ clocks = <&ccu CLK_OUTA>;
+ clock-names = "ext_clock";
};
};

@@ -173,6 +175,7 @@

&pio {
pinctrl-names = "default";
+ pinctrl-0 = <&clk_out_a_pin>;
vcc-pa-supply = <&reg_aldo2>;
vcc-pc-supply = <&reg_dcdc1>;
vcc-pd-supply = <&reg_dcdc1>;
@@ -277,6 +280,25 @@
status = "okay";
};

+&uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
+ uart-has-rtscts;
+ status = "okay";
+
+ bluetooth {
+ compatible = "brcm,bcm43438-bt";
+ clocks = <&ccu CLK_OUTA>;
+ clock-names = "lpo";
+ vbat-supply = <&reg_dldo2>;
+ vddio-supply = <&reg_dldo1>;
+ device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+ /* TODO host wake line connected to PMIC GPIO pins */
+ shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
+ max-speed = <1500000>;
+ };
+};
+
&usbphy {
usb1_vbus-supply = <&reg_vcc5v0>;
status = "okay";
--
1.8.3.1

2019-05-02 07:38:20

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v5 1/7] ARM: dts: sun8i: r40: bananapi-m2-ultra: Add GPIO pin-bank regulator supplies

On Tue, Apr 23, 2019 at 02:25:58PM -0300, Pablo Greco wrote:
> The bananapi-m2-ultra has the PMIC providing voltage to all the pin-bank
> supply rails from its various regulator outputs, tie them to the pio
> node.
>
> Signed-off-by: Pablo Greco <[email protected]>

Queued for 5.3, thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (404.00 B)
signature.asc (235.00 B)
Download all attachments

2019-05-02 07:39:26

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v5 2/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add GPIO pin-bank regulator supplies

On Tue, Apr 23, 2019 at 02:25:59PM -0300, Pablo Greco wrote:
> The bananapi-m2-berry has the PMIC providing voltage to all the pin-bank
> supply rails from its various regulator outputs, tie them to the pio
> node.
>
> Signed-off-by: Pablo Greco <[email protected]>
> ---
> arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> index f05cabd..2cb2ce0 100644
> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> @@ -123,6 +123,16 @@
> status = "okay";
> };
>
> +&pio {
> + pinctrl-names = "default";

A pinctrl-names property without any other one?

Looks good otherwise, thanks
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (945.00 B)
signature.asc (235.00 B)
Download all attachments

2019-05-02 07:41:27

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v5 3/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable GMAC ethernet controller

On Tue, Apr 23, 2019 at 02:26:00PM -0300, Pablo Greco wrote:
> Just like the Bananapi M2 Ultra, the Bananapi M2 Berry has a Realtek
> RTL8211E RGMII PHY tied to the GMAC.
> The PMIC's DC1SW output provides power for the PHY, while the ALDO2
> output provides I/O voltages on both sides.
>
> Signed-off-by: Pablo Greco <[email protected]>
> ---
> arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 29 +++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> index 2cb2ce0..561319b 100644
> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> @@ -50,6 +50,7 @@
> compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
>
> aliases {
> + ethernet0 = &gmac;
> serial0 = &uart0;
> };
>
> @@ -92,6 +93,22 @@
> status = "okay";
> };
>
> +&gmac {
> + pinctrl-names = "default";
> + pinctrl-0 = <&gmac_rgmii_pins>;
> + phy-handle = <&phy1>;
> + phy-mode = "rgmii";
> + phy-supply = <&reg_dc1sw>;
> + status = "okay";
> +};
> +
> +&gmac_mdio {
> + phy1: ethernet-phy@1 {
> + compatible = "ethernet-phy-ieee802.3-c22";
> + reg = <1>;
> + };
> +};
> +
> &i2c0 {
> status = "okay";
>
> @@ -133,6 +150,12 @@
> vcc-pg-supply = <&reg_dldo1>;
> };
>
> +&reg_aldo2 {
> + regulator-min-microvolt = <2500000>;
> + regulator-max-microvolt = <2500000>;
> + regulator-name = "vcc-pa";
> +};
> +

Shouldn't this one be added to the patch 2?

Thanks
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (1.67 kB)
signature.asc (235.00 B)
Download all attachments

2019-05-02 07:42:12

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v5 7/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add Bluetooth device node

On Tue, Apr 23, 2019 at 02:26:04PM -0300, Pablo Greco wrote:
> The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side
> identifies as BCM43430, while the Bluetooth side identifies as BCM43438.
>
> The Bluetooth side is connected to UART3 in a 4 wire configuration. Same
> as the WiFi side, due to being the same chip and package, DLDO1 and
> DLDO2 regulator outputs from the PMIC provide overall power via VBAT and
> I/O power via VDDIO. The CLK_OUT_A clock output from the SoC provides
> the LPO low power clock at 32.768 kHz.
>
> This patch enables Bluetooth on this board, and also adds the missing
> LPO clock on the WiFi side. There is also a PCM connection for
> Bluetooth, but this is not covered here.
>
> The LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin
> PI12. This can be represented in multiple ways. This patch puts the
> pinctrl property in the pin controller node. This is due to limitations
> in Linux, where pinmux settings, even the same one, can not be shared
> by multiple devices. Thus we cannot put it in both the WiFi and
> Bluetooth device nodes. Putting it the CCU node is another option, but
> Linux's CCU driver does not handle pinctrl. Also the pin controller is
> guaranteed to be initialized after the CCU, when clocks are available.
> And any other devices that use muxed pins are guaranteed to be
> initialized after the pin controller. Thus having the CLK_OUT_A pinmux
> reference be in the pin controller node is a good choice without having
> to deal with implementation issues.
>
> Signed-off-by: Pablo Greco <[email protected]>
> ---
> arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> index c87f2c0..15c22b0 100644
> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> @@ -96,6 +96,8 @@
> wifi_pwrseq: wifi_pwrseq {
> compatible = "mmc-pwrseq-simple";
> reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
> + clocks = <&ccu CLK_OUTA>;
> + clock-names = "ext_clock";

So if you don't have that patch (that enables bluetooth) the wifi
doesn't work (even though the previous patch is supposed to enable it)
?

> };
> };
>
> @@ -173,6 +175,7 @@
>
> &pio {
> pinctrl-names = "default";
> + pinctrl-0 = <&clk_out_a_pin>;

This one should bein the previous one as well

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (2.61 kB)
signature.asc (235.00 B)
Download all attachments

2019-05-02 08:21:55

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH v5 7/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add Bluetooth device node

On Thu, May 2, 2019 at 3:41 PM Maxime Ripard <[email protected]> wrote:
>
> On Tue, Apr 23, 2019 at 02:26:04PM -0300, Pablo Greco wrote:
> > The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side
> > identifies as BCM43430, while the Bluetooth side identifies as BCM43438.
> >
> > The Bluetooth side is connected to UART3 in a 4 wire configuration. Same
> > as the WiFi side, due to being the same chip and package, DLDO1 and
> > DLDO2 regulator outputs from the PMIC provide overall power via VBAT and
> > I/O power via VDDIO. The CLK_OUT_A clock output from the SoC provides
> > the LPO low power clock at 32.768 kHz.
> >
> > This patch enables Bluetooth on this board, and also adds the missing
> > LPO clock on the WiFi side. There is also a PCM connection for
> > Bluetooth, but this is not covered here.
> >
> > The LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin
> > PI12. This can be represented in multiple ways. This patch puts the
> > pinctrl property in the pin controller node. This is due to limitations
> > in Linux, where pinmux settings, even the same one, can not be shared
> > by multiple devices. Thus we cannot put it in both the WiFi and
> > Bluetooth device nodes. Putting it the CCU node is another option, but
> > Linux's CCU driver does not handle pinctrl. Also the pin controller is
> > guaranteed to be initialized after the CCU, when clocks are available.
> > And any other devices that use muxed pins are guaranteed to be
> > initialized after the pin controller. Thus having the CLK_OUT_A pinmux
> > reference be in the pin controller node is a good choice without having
> > to deal with implementation issues.
> >
> > Signed-off-by: Pablo Greco <[email protected]>
> > ---
> > arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 22 ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> > index c87f2c0..15c22b0 100644
> > --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> > +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
> > @@ -96,6 +96,8 @@
> > wifi_pwrseq: wifi_pwrseq {
> > compatible = "mmc-pwrseq-simple";
> > reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
> > + clocks = <&ccu CLK_OUTA>;
> > + clock-names = "ext_clock";
>
> So if you don't have that patch (that enables bluetooth) the wifi
> doesn't work (even though the previous patch is supposed to enable it)

Maybe we should just squash the two (WiFi and Bluetooth) together?
After all, they are in the same package, and depend on some of the
same things, such as clocks and regulators.

ChenYu

> > };
> > };
> >
> > @@ -173,6 +175,7 @@
> >
> > &pio {
> > pinctrl-names = "default";
> > + pinctrl-0 = <&clk_out_a_pin>;
>
> This one should bein the previous one as well
>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

2019-05-02 10:26:05

by Pablo Greco

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH v5 2/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add GPIO pin-bank regulator supplies


El 2/5/19 a las 04:38, Maxime Ripard escribió:
> On Tue, Apr 23, 2019 at 02:25:59PM -0300, Pablo Greco wrote:
>> The bananapi-m2-berry has the PMIC providing voltage to all the pin-bank
>> supply rails from its various regulator outputs, tie them to the pio
>> node.
>>
>> Signed-off-by: Pablo Greco <[email protected]>
>> ---
>> arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> index f05cabd..2cb2ce0 100644
>> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> @@ -123,6 +123,16 @@
>> status = "okay";
>> };
>>
>> +&pio {
>> + pinctrl-names = "default";
> A pinctrl-names property without any other one?
>
> Looks good otherwise, thanks
> Maxime
Right, I'll move this to the patch that adds pinctrl-0
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
Pablo

2019-05-02 10:27:00

by Pablo Greco

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH v5 3/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Enable GMAC ethernet controller


El 2/5/19 a las 04:39, Maxime Ripard escribió:
> On Tue, Apr 23, 2019 at 02:26:00PM -0300, Pablo Greco wrote:
>> Just like the Bananapi M2 Ultra, the Bananapi M2 Berry has a Realtek
>> RTL8211E RGMII PHY tied to the GMAC.
>> The PMIC's DC1SW output provides power for the PHY, while the ALDO2
>> output provides I/O voltages on both sides.
>>
>> Signed-off-by: Pablo Greco <[email protected]>
>> ---
>> arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 29 +++++++++++++++++++++++
>> 1 file changed, 29 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> index 2cb2ce0..561319b 100644
>> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>> @@ -50,6 +50,7 @@
>> compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
>>
>> aliases {
>> + ethernet0 = &gmac;
>> serial0 = &uart0;
>> };
>>
>> @@ -92,6 +93,22 @@
>> status = "okay";
>> };
>>
>> +&gmac {
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&gmac_rgmii_pins>;
>> + phy-handle = <&phy1>;
>> + phy-mode = "rgmii";
>> + phy-supply = <&reg_dc1sw>;
>> + status = "okay";
>> +};
>> +
>> +&gmac_mdio {
>> + phy1: ethernet-phy@1 {
>> + compatible = "ethernet-phy-ieee802.3-c22";
>> + reg = <1>;
>> + };
>> +};
>> +
>> &i2c0 {
>> status = "okay";
>>
>> @@ -133,6 +150,12 @@
>> vcc-pg-supply = <&reg_dldo1>;
>> };
>>
>> +&reg_aldo2 {
>> + regulator-min-microvolt = <2500000>;
>> + regulator-max-microvolt = <2500000>;
>> + regulator-name = "vcc-pa";
>> +};
>> +
> Shouldn't this one be added to the patch 2?
>
> Thanks
> Maxime
Yes, I'll do that in next version
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
Pablo.

2019-05-02 10:28:54

by Pablo Greco

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH v5 7/7] ARM: dts: sun8i: v40: bananapi-m2-berry: Add Bluetooth device node


El 2/5/19 a las 05:20, Chen-Yu Tsai escribió:
> On Thu, May 2, 2019 at 3:41 PM Maxime Ripard <[email protected]> wrote:
>> On Tue, Apr 23, 2019 at 02:26:04PM -0300, Pablo Greco wrote:
>>> The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side
>>> identifies as BCM43430, while the Bluetooth side identifies as BCM43438.
>>>
>>> The Bluetooth side is connected to UART3 in a 4 wire configuration. Same
>>> as the WiFi side, due to being the same chip and package, DLDO1 and
>>> DLDO2 regulator outputs from the PMIC provide overall power via VBAT and
>>> I/O power via VDDIO. The CLK_OUT_A clock output from the SoC provides
>>> the LPO low power clock at 32.768 kHz.
>>>
>>> This patch enables Bluetooth on this board, and also adds the missing
>>> LPO clock on the WiFi side. There is also a PCM connection for
>>> Bluetooth, but this is not covered here.
>>>
>>> The LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin
>>> PI12. This can be represented in multiple ways. This patch puts the
>>> pinctrl property in the pin controller node. This is due to limitations
>>> in Linux, where pinmux settings, even the same one, can not be shared
>>> by multiple devices. Thus we cannot put it in both the WiFi and
>>> Bluetooth device nodes. Putting it the CCU node is another option, but
>>> Linux's CCU driver does not handle pinctrl. Also the pin controller is
>>> guaranteed to be initialized after the CCU, when clocks are available.
>>> And any other devices that use muxed pins are guaranteed to be
>>> initialized after the pin controller. Thus having the CLK_OUT_A pinmux
>>> reference be in the pin controller node is a good choice without having
>>> to deal with implementation issues.
>>>
>>> Signed-off-by: Pablo Greco <[email protected]>
>>> ---
>>> arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts | 22 ++++++++++++++++++++++
>>> 1 file changed, 22 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>>> index c87f2c0..15c22b0 100644
>>> --- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>>> +++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
>>> @@ -96,6 +96,8 @@
>>> wifi_pwrseq: wifi_pwrseq {
>>> compatible = "mmc-pwrseq-simple";
>>> reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
>>> + clocks = <&ccu CLK_OUTA>;
>>> + clock-names = "ext_clock";
>> So if you don't have that patch (that enables bluetooth) the wifi
>> doesn't work (even though the previous patch is supposed to enable it)
> Maybe we should just squash the two (WiFi and Bluetooth) together?
> After all, they are in the same package, and depend on some of the
> same things, such as clocks and regulators.
>
> ChenYu
That seems better, I was trying to keep the same logic the patches
applied to the ultra.
>>> };
>>> };
>>>
>>> @@ -173,6 +175,7 @@
>>>
>>> &pio {
>>> pinctrl-names = "default";
>>> + pinctrl-0 = <&clk_out_a_pin>;
>> This one should bein the previous one as well
>>
>> Maxime
>>
>> --
>> Maxime Ripard, Bootlin
>> Embedded Linux and Kernel engineering
>> https://bootlin.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
Pablo.