diff mbox series

[v2,2/5] arm64: qcom: dts: qrb5165-rb5: add qca6391 power device

Message ID 20210128175225.3102958-3-dmitry.baryshkov@linaro.org
State New
Headers show
Series Add support for Qualcomm QCA639x chips family | expand

Commit Message

Dmitry Baryshkov Jan. 28, 2021, 5:52 p.m. UTC
Add qca6391 to device tree as a way to provide power domain to WiFi and
BT parts of the chip.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

---
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 61 ++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

-- 
2.29.2

Comments

Bjorn Andersson Jan. 30, 2021, 3:47 a.m. UTC | #1
On Thu 28 Jan 11:52 CST 2021, Dmitry Baryshkov wrote:

> Add qca6391 to device tree as a way to provide power domain to WiFi and
> BT parts of the chip.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 61 ++++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> index 8aebc3660b11..2b0c1cc9333b 100644
> --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
> @@ -151,6 +151,23 @@ vreg_s4a_1p8: vreg-s4a-1p8 {
>  		regulator-max-microvolt = <1800000>;
>  		regulator-always-on;
>  	};
> +
> +	qca6391: qca6391 {
> +		compatible = "qcom,qca6390";
> +		#power-domain-cells = <0>;
> +
> +		vddaon-supply = <&vreg_s6a_0p95>;
> +		vddpmu-supply = <&vreg_s2f_0p95>;
> +		vddrfa1-supply = <&vreg_s2f_0p95>;
> +		vddrfa2-supply = <&vreg_s8c_1p3>;
> +		vddrfa3-supply = <&vreg_s5a_1p9>;
> +		vddpcie1-supply = <&vreg_s8c_1p3>;
> +		vddpcie2-supply = <&vreg_s5a_1p9>;
> +		vddio-supply = <&vreg_s4a_1p8>;
> +		pinctrl-names = "default", "active";
> +		pinctrl-0 = <&wlan_default_state &bt_default_state>;
> +		pinctrl-1 = <&wlan_active_state &bt_active_state>;

I dislike the use of pinctrl states for toggling the level of the gpio
and would prefer that you use the gpio binding and api for this instead.

> +	};
>  };
>  
>  &adsp {
> @@ -1013,6 +1030,28 @@ &tlmm {
>  		"HST_WLAN_UART_TX",
>  		"HST_WLAN_UART_RX";
>  
> +	bt_default_state: bt-default-state {

Are you sure you need to drive the BT_EN pin in order to have WiFi
working? On QCA6174 I believe the "WL_EN" was actually RESET_N and BT_EN
was actually "blueooth enable" - so we wired that in the bluetooth node
instead.

> +		bt-en {
> +			pins = "gpio21";
> +			function = "gpio";
> +
> +			drive-strength = <16>;
> +			output-low;
> +			bias-pull-up;
> +		};
> +	};
> +
> +	bt_active_state: bt-active-state {
> +		bt-en {
> +			pins = "gpio21";
> +			function = "gpio";
> +
> +			drive-strength = <16>;
> +			output-high;
> +			bias-pull-up;
> +		};
> +	};
> +
>  	lt9611_irq_pin: lt9611-irq {
>  		pins = "gpio63";
>  		function = "gpio";
> @@ -1119,6 +1158,28 @@ sdc2_card_det_n: sd-card-det-n {
>  		function = "gpio";
>  		bias-pull-up;
>  	};
> +
> +	wlan_default_state: wlan-default-state {

JFYI. You don't need this "dummy" subnode, you can put the properties
directly in the state node.

Regards,
Bjorn

> +		wlan-en {
> +			pins = "gpio20";
> +			function = "gpio";
> +
> +			drive-strength = <16>;
> +			output-low;
> +			bias-pull-up;
> +		};
> +	};
> +
> +	wlan_active_state: wlan-active-state {
> +		wlan-en {
> +			pins = "gpio20";
> +			function = "gpio";
> +
> +			drive-strength = <16>;
> +			output-high;
> +			bias-pull-up;
> +		};
> +	};
>  };
>  
>  &uart12 {
> -- 
> 2.29.2
>
Manivannan Sadhasivam Jan. 30, 2021, 3:59 a.m. UTC | #2
On Fri, Jan 29, 2021 at 09:47:37PM -0600, Bjorn Andersson wrote:
> On Thu 28 Jan 11:52 CST 2021, Dmitry Baryshkov wrote:

> 

> > Add qca6391 to device tree as a way to provide power domain to WiFi and

> > BT parts of the chip.

> > 

> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> > ---

> >  arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 61 ++++++++++++++++++++++++

> >  1 file changed, 61 insertions(+)

> > 

> > diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts

> > index 8aebc3660b11..2b0c1cc9333b 100644

> > --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts

> > +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts

> > @@ -151,6 +151,23 @@ vreg_s4a_1p8: vreg-s4a-1p8 {

> >  		regulator-max-microvolt = <1800000>;

> >  		regulator-always-on;

> >  	};

> > +

> > +	qca6391: qca6391 {

> > +		compatible = "qcom,qca6390";

> > +		#power-domain-cells = <0>;

> > +

> > +		vddaon-supply = <&vreg_s6a_0p95>;

> > +		vddpmu-supply = <&vreg_s2f_0p95>;

> > +		vddrfa1-supply = <&vreg_s2f_0p95>;

> > +		vddrfa2-supply = <&vreg_s8c_1p3>;

> > +		vddrfa3-supply = <&vreg_s5a_1p9>;

> > +		vddpcie1-supply = <&vreg_s8c_1p3>;

> > +		vddpcie2-supply = <&vreg_s5a_1p9>;

> > +		vddio-supply = <&vreg_s4a_1p8>;

> > +		pinctrl-names = "default", "active";

> > +		pinctrl-0 = <&wlan_default_state &bt_default_state>;

> > +		pinctrl-1 = <&wlan_active_state &bt_active_state>;

> 

> I dislike the use of pinctrl states for toggling the level of the gpio

> and would prefer that you use the gpio binding and api for this instead.

> 

> > +	};

> >  };

> >  

> >  &adsp {

> > @@ -1013,6 +1030,28 @@ &tlmm {

> >  		"HST_WLAN_UART_TX",

> >  		"HST_WLAN_UART_RX";

> >  

> > +	bt_default_state: bt-default-state {

> 

> Are you sure you need to drive the BT_EN pin in order to have WiFi

> working? On QCA6174 I believe the "WL_EN" was actually RESET_N and BT_EN

> was actually "blueooth enable" - so we wired that in the bluetooth node

> instead.

> 


IIRC, that's the case. We need both BT_EN and WL_EN for proper bringup of the
chip.

Thanks,
Mani
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index 8aebc3660b11..2b0c1cc9333b 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -151,6 +151,23 @@  vreg_s4a_1p8: vreg-s4a-1p8 {
 		regulator-max-microvolt = <1800000>;
 		regulator-always-on;
 	};
+
+	qca6391: qca6391 {
+		compatible = "qcom,qca6390";
+		#power-domain-cells = <0>;
+
+		vddaon-supply = <&vreg_s6a_0p95>;
+		vddpmu-supply = <&vreg_s2f_0p95>;
+		vddrfa1-supply = <&vreg_s2f_0p95>;
+		vddrfa2-supply = <&vreg_s8c_1p3>;
+		vddrfa3-supply = <&vreg_s5a_1p9>;
+		vddpcie1-supply = <&vreg_s8c_1p3>;
+		vddpcie2-supply = <&vreg_s5a_1p9>;
+		vddio-supply = <&vreg_s4a_1p8>;
+		pinctrl-names = "default", "active";
+		pinctrl-0 = <&wlan_default_state &bt_default_state>;
+		pinctrl-1 = <&wlan_active_state &bt_active_state>;
+	};
 };
 
 &adsp {
@@ -1013,6 +1030,28 @@  &tlmm {
 		"HST_WLAN_UART_TX",
 		"HST_WLAN_UART_RX";
 
+	bt_default_state: bt-default-state {
+		bt-en {
+			pins = "gpio21";
+			function = "gpio";
+
+			drive-strength = <16>;
+			output-low;
+			bias-pull-up;
+		};
+	};
+
+	bt_active_state: bt-active-state {
+		bt-en {
+			pins = "gpio21";
+			function = "gpio";
+
+			drive-strength = <16>;
+			output-high;
+			bias-pull-up;
+		};
+	};
+
 	lt9611_irq_pin: lt9611-irq {
 		pins = "gpio63";
 		function = "gpio";
@@ -1119,6 +1158,28 @@  sdc2_card_det_n: sd-card-det-n {
 		function = "gpio";
 		bias-pull-up;
 	};
+
+	wlan_default_state: wlan-default-state {
+		wlan-en {
+			pins = "gpio20";
+			function = "gpio";
+
+			drive-strength = <16>;
+			output-low;
+			bias-pull-up;
+		};
+	};
+
+	wlan_active_state: wlan-active-state {
+		wlan-en {
+			pins = "gpio20";
+			function = "gpio";
+
+			drive-strength = <16>;
+			output-high;
+			bias-pull-up;
+		};
+	};
 };
 
 &uart12 {