diff mbox series

[3/3] arm64: dts: mediatek: enable USB device port for mt8195-demo board

Message ID 20230105092809.14214-3-macpaul.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [1/3] arm64: dts: mediatek: Introduce MT8195 LAPTOP and IOT's USB configurations | expand

Commit Message

Macpaul Lin Jan. 5, 2023, 9:28 a.m. UTC
1. Enable USB device port (USB port0).
2. Enable u2 speed for other USB HOST (USB port1/2/3).
3. Configure mt6360 (TYPEC) related pinctrls.

Note: Full dual-role switch capability requires TYPEC MUX driver and dts
update will be send in separate patches.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 51 ++++++++++++++++++++
 1 file changed, 51 insertions(+)

Comments

Krzysztof Kozlowski Jan. 6, 2023, 12:56 p.m. UTC | #1
On 05/01/2023 10:28, Macpaul Lin wrote:
> 1. Enable USB device port (USB port0).
> 2. Enable u2 speed for other USB HOST (USB port1/2/3).
> 3. Configure mt6360 (TYPEC) related pinctrls.
> 
> Note: Full dual-role switch capability requires TYPEC MUX driver and dts
> update will be send in separate patches.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 51 ++++++++++++++++++++
>  1 file changed, 51 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index 07a864cb8b54..207bb5f4c58f 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -12,6 +12,7 @@
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>  #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
> +#include <dt-bindings/usb/pd.h>
>  
>  / {
>  	model = "MediaTek MT8195 demo board";
> @@ -380,6 +381,22 @@
>  		};
>  	};
>  
> +	mt6360_pins: mt6360-pins {
> +		pins {
> +			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
> +				 <PINMUX_GPIO101__FUNC_GPIO101>;
> +			input-enable;
> +			bias-pull-up;
> +		};
> +	};
> +
> +	u3_p0_vbus: u3_p0vbusdefault {

No underscores in node names. Also does not look correct naming. Please
run `make dtbs_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).

> +		pins_cmd_dat {

Same problem.



Best regards,
Krzysztof
Macpaul Lin Jan. 11, 2023, 5:41 a.m. UTC | #2
On 1/6/23 20:56, Krzysztof Kozlowski wrote:
> On 05/01/2023 10:28, Macpaul Lin wrote:
>> 1. Enable USB device port (USB port0).
>> 2. Enable u2 speed for other USB HOST (USB port1/2/3).
>> 3. Configure mt6360 (TYPEC) related pinctrls.
>>
>> Note: Full dual-role switch capability requires TYPEC MUX driver and dts
>> update will be send in separate patches.
>>
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 51 ++++++++++++++++++++
>>   1 file changed, 51 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> index 07a864cb8b54..207bb5f4c58f 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> @@ -12,6 +12,7 @@
>>   #include <dt-bindings/input/input.h>
>>   #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>>   #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>> +#include <dt-bindings/usb/pd.h>
>>   
>>   / {
>>   	model = "MediaTek MT8195 demo board";
>> @@ -380,6 +381,22 @@
>>   		};
>>   	};
>>   
>> +	mt6360_pins: mt6360-pins {
>> +		pins {
>> +			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
>> +				 <PINMUX_GPIO101__FUNC_GPIO101>;
>> +			input-enable;
>> +			bias-pull-up;
>> +		};
>> +	};
>> +
>> +	u3_p0_vbus: u3_p0vbusdefault {
> 
> No underscores in node names. Also does not look correct naming. Please
> run `make dtbs_check` (see
> Documentation/devicetree/bindings/writing-schema.rst for instructions).

Thanks for the suggest.
I'm trying to request IT to setup for the environment for supporting 
"make dtbs_check". This should be fix in next patch.

>> +		pins_cmd_dat {
> 
> Same problem.
> 

Got it.

> 
> Best regards,
> Krzysztof
> 

Thanks!
Macpaul Lin
Matthias Brugger Feb. 1, 2023, 12:24 p.m. UTC | #3
On 05/01/2023 10:28, Macpaul Lin wrote:
> 1. Enable USB device port (USB port0).
> 2. Enable u2 speed for other USB HOST (USB port1/2/3).
> 3. Configure mt6360 (TYPEC) related pinctrls.
> 
> Note: Full dual-role switch capability requires TYPEC MUX driver and dts
> update will be send in separate patches.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 51 ++++++++++++++++++++
>   1 file changed, 51 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index 07a864cb8b54..207bb5f4c58f 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -12,6 +12,7 @@
>   #include <dt-bindings/input/input.h>
>   #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>   #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
> +#include <dt-bindings/usb/pd.h>
>   
>   / {
>   	model = "MediaTek MT8195 demo board";
> @@ -380,6 +381,22 @@
>   		};
>   	};
>   
> +	mt6360_pins: mt6360-pins {
> +		pins {
> +			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
> +				 <PINMUX_GPIO101__FUNC_GPIO101>;
> +			input-enable;
> +			bias-pull-up;
> +		};
> +	};
> +
> +	u3_p0_vbus: u3_p0vbusdefault {
> +		pins_cmd_dat {
> +			pinmux = <PINMUX_GPIO63__FUNC_VBUSVALID>;
> +			input-enable;
> +		};
> +	};
> +
>   	uart0_pins: uart0-pins {
>   		pins {
>   			pinmux = <PINMUX_GPIO98__FUNC_UTXD0>,
> @@ -393,6 +410,14 @@
>   				 <PINMUX_GPIO103__FUNC_URXD1>;
>   		};
>   	};
> +
> +	usb_otg_vbus: usb-otg-vbus-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "otg-vbus";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		enable-active-high;
> +	};
>   };
>   
>   
> @@ -412,6 +437,22 @@
>   	status = "okay";
>   };
>   
> +&u3port0 {
> +	status = "okay";
> +};
> +
> +&u2port1 {
> +	status = "okay";
> +};
> +
> +&u2port2 {
> +	status = "okay";
> +};
> +
> +&u2port3 {
> +	status = "okay";
> +};
> +
>   &u3phy0 {
>   	status = "okay";
>   };
> @@ -428,6 +469,16 @@
>   	status = "okay";
>   };
>   
> +&ssusb {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&u3_p0_vbus>;
> +	vusb33-supply = <&mt6359_vusb_ldo_reg>;
> +	dr_mode = "otg";
> +	mediatek,usb3-drd;

What it that used for?
git grep didn't gave me any hit.

Regards,
Matthias

> +	usb-role-switch;
> +	status = "okay";
> +};
> +
>   &xhci0 {
>   	vusb33-supply = <&mt6359_vusb_ldo_reg>;
>   	vbus-supply = <&otg_vbus_regulator>;
Chunfeng Yun (云春峰) Feb. 7, 2023, 9:36 a.m. UTC | #4
On Wed, 2023-02-01 at 13:24 +0100, Matthias Brugger wrote:
> 
> On 05/01/2023 10:28, Macpaul Lin wrote:
> > 1. Enable USB device port (USB port0).
> > 2. Enable u2 speed for other USB HOST (USB port1/2/3).
> > 3. Configure mt6360 (TYPEC) related pinctrls.
> > 
> > Note: Full dual-role switch capability requires TYPEC MUX driver
> > and dts
> > update will be send in separate patches.
> > 
> > Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> > ---
> >   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 51
> > ++++++++++++++++++++
> >   1 file changed, 51 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> > b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> > index 07a864cb8b54..207bb5f4c58f 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> > +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> > @@ -12,6 +12,7 @@
> >   #include <dt-bindings/input/input.h>
> >   #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
> >   #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
> > +#include <dt-bindings/usb/pd.h>
> >   
> >   / {
> >   	model = "MediaTek MT8195 demo board";
> > @@ -380,6 +381,22 @@
> >   		};
> >   	};
> >   
> > +	mt6360_pins: mt6360-pins {
> > +		pins {
> > +			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
> > +				 <PINMUX_GPIO101__FUNC_GPIO101>;
> > +			input-enable;
> > +			bias-pull-up;
> > +		};
> > +	};
> > +
> > +	u3_p0_vbus: u3_p0vbusdefault {
> > +		pins_cmd_dat {
> > +			pinmux = <PINMUX_GPIO63__FUNC_VBUSVALID>;
> > +			input-enable;
> > +		};
> > +	};
> > +
> >   	uart0_pins: uart0-pins {
> >   		pins {
> >   			pinmux = <PINMUX_GPIO98__FUNC_UTXD0>,
> > @@ -393,6 +410,14 @@
> >   				 <PINMUX_GPIO103__FUNC_URXD1>;
> >   		};
> >   	};
> > +
> > +	usb_otg_vbus: usb-otg-vbus-regulator {
> > +		compatible = "regulator-fixed";
> > +		regulator-name = "otg-vbus";
> > +		regulator-min-microvolt = <5000000>;
> > +		regulator-max-microvolt = <5000000>;
> > +		enable-active-high;
> > +	};
> >   };
> >   
> >   
> > @@ -412,6 +437,22 @@
> >   	status = "okay";
> >   };
> >   
> > +&u3port0 {
> > +	status = "okay";
> > +};
> > +
> > +&u2port1 {
> > +	status = "okay";
> > +};
> > +
> > +&u2port2 {
> > +	status = "okay";
> > +};
> > +
> > +&u2port3 {
> > +	status = "okay";
> > +};
> > +
> >   &u3phy0 {
> >   	status = "okay";
> >   };
> > @@ -428,6 +469,16 @@
> >   	status = "okay";
> >   };
> >   
> > +&ssusb {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&u3_p0_vbus>;
> > +	vusb33-supply = <&mt6359_vusb_ldo_reg>;
> > +	dr_mode = "otg";
> > +	mediatek,usb3-drd;
> 
> What it that used for?
> git grep didn't gave me any hit.
"mediatek,usb3-drd;" can be now removed,

the patch sent out on Jul 8 2022:
"683ff6e485f1 usb: mtu3: check capability of usb3 dual role"
already removed the property.

Thanks a lot

> 
> Regards,
> Matthias
> 
> > +	usb-role-switch;
> > +	status = "okay";
> > +};
> > +
> >   &xhci0 {
> >   	vusb33-supply = <&mt6359_vusb_ldo_reg>;
> >   	vbus-supply = <&otg_vbus_regulator>;
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index 07a864cb8b54..207bb5f4c58f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -12,6 +12,7 @@ 
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
 #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
+#include <dt-bindings/usb/pd.h>
 
 / {
 	model = "MediaTek MT8195 demo board";
@@ -380,6 +381,22 @@ 
 		};
 	};
 
+	mt6360_pins: mt6360-pins {
+		pins {
+			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
+				 <PINMUX_GPIO101__FUNC_GPIO101>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
+
+	u3_p0_vbus: u3_p0vbusdefault {
+		pins_cmd_dat {
+			pinmux = <PINMUX_GPIO63__FUNC_VBUSVALID>;
+			input-enable;
+		};
+	};
+
 	uart0_pins: uart0-pins {
 		pins {
 			pinmux = <PINMUX_GPIO98__FUNC_UTXD0>,
@@ -393,6 +410,14 @@ 
 				 <PINMUX_GPIO103__FUNC_URXD1>;
 		};
 	};
+
+	usb_otg_vbus: usb-otg-vbus-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "otg-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+	};
 };
 
 
@@ -412,6 +437,22 @@ 
 	status = "okay";
 };
 
+&u3port0 {
+	status = "okay";
+};
+
+&u2port1 {
+	status = "okay";
+};
+
+&u2port2 {
+	status = "okay";
+};
+
+&u2port3 {
+	status = "okay";
+};
+
 &u3phy0 {
 	status = "okay";
 };
@@ -428,6 +469,16 @@ 
 	status = "okay";
 };
 
+&ssusb {
+	pinctrl-names = "default";
+	pinctrl-0 = <&u3_p0_vbus>;
+	vusb33-supply = <&mt6359_vusb_ldo_reg>;
+	dr_mode = "otg";
+	mediatek,usb3-drd;
+	usb-role-switch;
+	status = "okay";
+};
+
 &xhci0 {
 	vusb33-supply = <&mt6359_vusb_ldo_reg>;
 	vbus-supply = <&otg_vbus_regulator>;