* [PATCH 0/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader @ 2024-11-18 10:34 Stephan Gerhold 2024-11-18 10:34 ` [PATCH 1/2] " Stephan Gerhold 2024-11-18 10:34 ` [PATCH 2/2] arm64: defconfig: enable NXP PTN3222 eUSB2 to USB2 redriver driver Stephan Gerhold 0 siblings, 2 replies; 16+ messages in thread From: Stephan Gerhold @ 2024-11-18 10:34 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Johan Hovold The X1E80100 CRD has a Goodix fingerprint reader connected to the USB multiport controller. Set it up in the device tree and enable the needed driver for the NXP PTN3222 eUSB2 to USB2 redriver in the arm64 defconfig. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> --- Stephan Gerhold (2): arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader arm64: defconfig: enable NXP PTN3222 eUSB2 to USB2 redriver driver arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ arch/arm64/configs/defconfig | 1 + 2 files changed, 49 insertions(+) --- base-commit: 30eb6f0b08b13fd25ea12a3a6fa0a85915190c1c change-id: 20241115-x1e80100-crd-fp-8828cca97d66 Best regards, -- Stephan Gerhold <stephan.gerhold@linaro.org> ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-11-18 10:34 [PATCH 0/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Stephan Gerhold @ 2024-11-18 10:34 ` Stephan Gerhold 2024-12-02 14:32 ` Konrad Dybcio 2024-12-03 10:20 ` Johan Hovold 2024-11-18 10:34 ` [PATCH 2/2] arm64: defconfig: enable NXP PTN3222 eUSB2 to USB2 redriver driver Stephan Gerhold 1 sibling, 2 replies; 16+ messages in thread From: Stephan Gerhold @ 2024-11-18 10:34 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Johan Hovold The X1E80100 CRD has a Goodix fingerprint reader connected to the USB multiport controller on eUSB6. All other ports (including USB super-speed pins) are unused. Set it up in the device tree together with the NXP PTN3222 repeater. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> --- arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts index 39f9d9cdc10d..44942931c18f 100644 --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts @@ -735,6 +735,26 @@ keyboard@3a { }; }; +&i2c5 { + clock-frequency = <400000>; + + status = "okay"; + + eusb6_repeater: redriver@4f { + compatible = "nxp,ptn3222"; + reg = <0x4f>; + #phy-cells = <0>; + + vdd3v3-supply = <&vreg_l13b_3p0>; + vdd1v8-supply = <&vreg_l4b_1p8>; + + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; + + pinctrl-0 = <&eusb6_reset_n>; + pinctrl-names = "default"; + }; +}; + &i2c8 { clock-frequency = <400000>; @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { bias-disable; }; + eusb6_reset_n: eusb6-reset-n-state { + pins = "gpio184"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; + hall_int_n_default: hall-int-n-state { pins = "gpio92"; function = "gpio"; @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { &usb_1_ss2_qmpphy_out { remote-endpoint = <&pmic_glink_ss2_ss_in>; }; + +&usb_mp { + status = "okay"; +}; + +&usb_mp_dwc3 { + /* Limit to USB 2.0 and single port */ + maximum-speed = "high-speed"; + phys = <&usb_mp_hsphy1>; + phy-names = "usb2-1"; +}; + +&usb_mp_hsphy1 { + vdd-supply = <&vreg_l2e_0p8>; + vdda12-supply = <&vreg_l3e_1p2>; + + phys = <&eusb6_repeater>; + + status = "okay"; +}; -- 2.44.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-11-18 10:34 ` [PATCH 1/2] " Stephan Gerhold @ 2024-12-02 14:32 ` Konrad Dybcio 2024-12-03 10:20 ` Johan Hovold 1 sibling, 0 replies; 16+ messages in thread From: Konrad Dybcio @ 2024-12-02 14:32 UTC (permalink / raw) To: Stephan Gerhold, Bjorn Andersson, Konrad Dybcio Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Johan Hovold On 18.11.2024 11:34 AM, Stephan Gerhold wrote: > The X1E80100 CRD has a Goodix fingerprint reader connected to the USB > multiport controller on eUSB6. All other ports (including USB super-speed > pins) are unused. > > Set it up in the device tree together with the NXP PTN3222 repeater. > > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Konrad ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-11-18 10:34 ` [PATCH 1/2] " Stephan Gerhold 2024-12-02 14:32 ` Konrad Dybcio @ 2024-12-03 10:20 ` Johan Hovold 2024-12-03 11:30 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery Stephan Gerhold 2024-12-03 13:15 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Krishna Kurapati 1 sibling, 2 replies; 16+ messages in thread From: Johan Hovold @ 2024-12-03 10:20 UTC (permalink / raw) To: Stephan Gerhold Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb [ +CC: Krishna, Thinh and the USB list ] On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > The X1E80100 CRD has a Goodix fingerprint reader connected to the USB > multiport controller on eUSB6. All other ports (including USB super-speed > pins) are unused. > > Set it up in the device tree together with the NXP PTN3222 repeater. > > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> > --- > arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > index 39f9d9cdc10d..44942931c18f 100644 > --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > @@ -735,6 +735,26 @@ keyboard@3a { > }; > }; > > +&i2c5 { > + clock-frequency = <400000>; > + > + status = "okay"; > + > + eusb6_repeater: redriver@4f { > + compatible = "nxp,ptn3222"; > + reg = <0x4f>; The driver does not currently check that there's actually anything at this address. Did you verify that this is the correct address? (Abel is adding a check to the driver as we speak to catch any such mistakes going forward). > + #phy-cells = <0>; nit: I'd put provider properties like this one last. > + vdd3v3-supply = <&vreg_l13b_3p0>; > + vdd1v8-supply = <&vreg_l4b_1p8>; Sort by supply name? > + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; > + > + pinctrl-0 = <&eusb6_reset_n>; > + pinctrl-names = "default"; > + }; > +}; > + > &i2c8 { > clock-frequency = <400000>; > > @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { > bias-disable; > }; > > + eusb6_reset_n: eusb6-reset-n-state { > + pins = "gpio184"; > + function = "gpio"; > + drive-strength = <2>; > + bias-disable; > + output-low; I don't think the pin config should assert reset, that should be up to the driver to control. > + }; > + > hall_int_n_default: hall-int-n-state { > pins = "gpio92"; > function = "gpio"; > @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { > &usb_1_ss2_qmpphy_out { > remote-endpoint = <&pmic_glink_ss2_ss_in>; > }; > + > +&usb_mp { > + status = "okay"; > +}; > + > +&usb_mp_dwc3 { > + /* Limit to USB 2.0 and single port */ > + maximum-speed = "high-speed"; > + phys = <&usb_mp_hsphy1>; > + phy-names = "usb2-1"; > +}; The dwc3 driver determines (and acts on) the number of ports based on the port interrupts in DT and controller capabilities. I'm not sure we can (should) just drop the other HS PHY and the SS PHYs that would still be there in the SoC (possibly initialised by the boot firmware). I had a local patch to enable the multiport controller (for the suspend work) and I realise that you'd currently need to specify a repeater also for the HS PHY which does not have one, but that should be possible to fix somehow. > + > +&usb_mp_hsphy1 { > + vdd-supply = <&vreg_l2e_0p8>; > + vdda12-supply = <&vreg_l3e_1p2>; > + > + phys = <&eusb6_repeater>; > + > + status = "okay"; > +}; Johan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery 2024-12-03 10:20 ` Johan Hovold @ 2024-12-03 11:30 ` Stephan Gerhold 2024-12-03 12:03 ` Abel Vesa 2024-12-03 15:37 ` Krishna Kurapati 2024-12-03 13:15 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Krishna Kurapati 1 sibling, 2 replies; 16+ messages in thread From: Stephan Gerhold @ 2024-12-03 11:30 UTC (permalink / raw) To: Johan Hovold Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On Tue, Dec 03, 2024 at 11:20:48AM +0100, Johan Hovold wrote: > [ +CC: Krishna, Thinh and the USB list ] > > On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > > The X1E80100 CRD has a Goodix fingerprint reader connected to the USB > > multiport controller on eUSB6. All other ports (including USB super-speed > > pins) are unused. > > > > Set it up in the device tree together with the NXP PTN3222 repeater. > > > > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> > > --- > > arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ > > 1 file changed, 48 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > index 39f9d9cdc10d..44942931c18f 100644 > > --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > @@ -735,6 +735,26 @@ keyboard@3a { > > }; > > }; > > > > +&i2c5 { > > + clock-frequency = <400000>; > > + > > + status = "okay"; > > + > > + eusb6_repeater: redriver@4f { > > + compatible = "nxp,ptn3222"; > > + reg = <0x4f>; > > The driver does not currently check that there's actually anything at > this address. Did you verify that this is the correct address? > > (Abel is adding a check to the driver as we speak to catch any such > mistakes going forward). > Yes, I verified this using https://git.codelinaro.org/stephan.gerhold/linux/-/commit/45d5add498612387f88270ca944ee16e2236fddd (I sent this to Abel back then, so I'm surprised he didn't run that :-)) > > + #phy-cells = <0>; > > nit: I'd put provider properties like this one last. > > > + vdd3v3-supply = <&vreg_l13b_3p0>; > > + vdd1v8-supply = <&vreg_l4b_1p8>; > > Sort by supply name? > Ack. > > + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; > > + > > + pinctrl-0 = <&eusb6_reset_n>; > > + pinctrl-names = "default"; > > + }; > > +}; > > + > > &i2c8 { > > clock-frequency = <400000>; > > > > @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { > > bias-disable; > > }; > > > > + eusb6_reset_n: eusb6-reset-n-state { > > + pins = "gpio184"; > > + function = "gpio"; > > + drive-strength = <2>; > > + bias-disable; > > + output-low; > > I don't think the pin config should assert reset, that should be up to > the driver to control. > I can drop it I guess, but pinctrl is applied before the driver takes control of the GPIO. This means if the GPIO happens to be in input mode before the driver loads (with pull up or pull down), then we would briefly leave it floating when applying the bias-disable. Or I guess we could drop the bias-disable, since it shouldn't be relevant for a pin we keep in output mode all the time? > > + }; > > + > > hall_int_n_default: hall-int-n-state { > > pins = "gpio92"; > > function = "gpio"; > > @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { > > &usb_1_ss2_qmpphy_out { > > remote-endpoint = <&pmic_glink_ss2_ss_in>; > > }; > > + > > +&usb_mp { > > + status = "okay"; > > +}; > > + > > +&usb_mp_dwc3 { > > + /* Limit to USB 2.0 and single port */ > > + maximum-speed = "high-speed"; > > + phys = <&usb_mp_hsphy1>; > > + phy-names = "usb2-1"; > > +}; > > The dwc3 driver determines (and acts on) the number of ports based on > the port interrupts in DT and controller capabilities. > > I'm not sure we can (should) just drop the other HS PHY and the SS PHYs > that would still be there in the SoC (possibly initialised by the boot > firmware). > > I had a local patch to enable the multiport controller (for the suspend > work) and I realise that you'd currently need to specify a repeater also > for the HS PHY which does not have one, but that should be possible to > fix somehow. > I think there are two separate questions here: 1. Should we (or do we even need to) enable unused PHYs? 2. Do we need to power off unused PHYs left enabled by the firmware? For (1), I'm not not sure if there is a technical reason that requires us to. And given that PHYs typically consume quite a bit of power, I'm not sure if we should. Perhaps it's not worth spending effort on this minor optimization now, but then the device tree would ideally still tell us which PHYs are actually used (for future optimizations). For (2), yes, we probably need to. But my impression so far is that this might be a larger problem that we need to handle on the SoC level. I have seen some firmware versions that blindly power up all USB controllers, even completely unused ones. Ideally we would power down unused components during startup and then leave them off. Thanks, Stephan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery 2024-12-03 11:30 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery Stephan Gerhold @ 2024-12-03 12:03 ` Abel Vesa 2024-12-03 15:11 ` Stephan Gerhold 2024-12-03 15:37 ` Krishna Kurapati 1 sibling, 1 reply; 16+ messages in thread From: Abel Vesa @ 2024-12-03 12:03 UTC (permalink / raw) To: Stephan Gerhold Cc: Johan Hovold, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Krishna Kurapati, Thinh Nguyen, linux-usb On 24-12-03 12:30:37, Stephan Gerhold wrote: > On Tue, Dec 03, 2024 at 11:20:48AM +0100, Johan Hovold wrote: > > [ +CC: Krishna, Thinh and the USB list ] > > > > On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > > > The X1E80100 CRD has a Goodix fingerprint reader connected to the USB > > > multiport controller on eUSB6. All other ports (including USB super-speed > > > pins) are unused. > > > > > > Set it up in the device tree together with the NXP PTN3222 repeater. > > > > > > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> > > > --- > > > arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ > > > 1 file changed, 48 insertions(+) > > > > > > diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > index 39f9d9cdc10d..44942931c18f 100644 > > > --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > @@ -735,6 +735,26 @@ keyboard@3a { > > > }; > > > }; > > > > > > +&i2c5 { > > > + clock-frequency = <400000>; > > > + > > > + status = "okay"; > > > + > > > + eusb6_repeater: redriver@4f { > > > + compatible = "nxp,ptn3222"; > > > + reg = <0x4f>; > > > > The driver does not currently check that there's actually anything at > > this address. Did you verify that this is the correct address? > > > > (Abel is adding a check to the driver as we speak to catch any such > > mistakes going forward). > > > > Yes, I verified this using > https://git.codelinaro.org/stephan.gerhold/linux/-/commit/45d5add498612387f88270ca944ee16e2236fddd > > (I sent this to Abel back then, so I'm surprised he didn't run that :-)) I don't remember seeing this commit back then. Maybe I didn't look careful enough. Sorry. Since you already did the work, can you send that on the list? So if you remember, back then I hunted down all of these with i2cget on my t14s (it has 3 such repeaters, unlike CRD). > > > > + #phy-cells = <0>; > > > > nit: I'd put provider properties like this one last. > > > > > + vdd3v3-supply = <&vreg_l13b_3p0>; > > > + vdd1v8-supply = <&vreg_l4b_1p8>; > > > > Sort by supply name? > > > > Ack. > > > > + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; > > > + > > > + pinctrl-0 = <&eusb6_reset_n>; > > > + pinctrl-names = "default"; > > > + }; > > > +}; > > > + > > > &i2c8 { > > > clock-frequency = <400000>; > > > > > > @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { > > > bias-disable; > > > }; > > > > > > + eusb6_reset_n: eusb6-reset-n-state { > > > + pins = "gpio184"; > > > + function = "gpio"; > > > + drive-strength = <2>; > > > + bias-disable; > > > + output-low; > > > > I don't think the pin config should assert reset, that should be up to > > the driver to control. > > > > I can drop it I guess, but pinctrl is applied before the driver takes > control of the GPIO. This means if the GPIO happens to be in input mode > before the driver loads (with pull up or pull down), then we would > briefly leave it floating when applying the bias-disable. > > Or I guess we could drop the bias-disable, since it shouldn't be > relevant for a pin we keep in output mode all the time? > > > > + }; > > > + > > > hall_int_n_default: hall-int-n-state { > > > pins = "gpio92"; > > > function = "gpio"; > > > @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { > > > &usb_1_ss2_qmpphy_out { > > > remote-endpoint = <&pmic_glink_ss2_ss_in>; > > > }; > > > + > > > +&usb_mp { > > > + status = "okay"; > > > +}; > > > + > > > +&usb_mp_dwc3 { > > > + /* Limit to USB 2.0 and single port */ > > > + maximum-speed = "high-speed"; > > > + phys = <&usb_mp_hsphy1>; > > > + phy-names = "usb2-1"; > > > +}; > > > > The dwc3 driver determines (and acts on) the number of ports based on > > the port interrupts in DT and controller capabilities. > > > > I'm not sure we can (should) just drop the other HS PHY and the SS PHYs > > that would still be there in the SoC (possibly initialised by the boot > > firmware). > > > > I had a local patch to enable the multiport controller (for the suspend > > work) and I realise that you'd currently need to specify a repeater also > > for the HS PHY which does not have one, but that should be possible to > > fix somehow. > > > > I think there are two separate questions here: > > 1. Should we (or do we even need to) enable unused PHYs? > 2. Do we need to power off unused PHYs left enabled by the firmware? > > For (1), I'm not not sure if there is a technical reason that requires > us to. And given that PHYs typically consume quite a bit of power, I'm > not sure if we should. Perhaps it's not worth spending effort on this > minor optimization now, but then the device tree would ideally still > tell us which PHYs are actually used (for future optimizations). > > For (2), yes, we probably need to. But my impression so far is that this > might be a larger problem that we need to handle on the SoC level. I > have seen some firmware versions that blindly power up all USB > controllers, even completely unused ones. Ideally we would power down > unused components during startup and then leave them off. > > Thanks, > Stephan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery 2024-12-03 12:03 ` Abel Vesa @ 2024-12-03 15:11 ` Stephan Gerhold 0 siblings, 0 replies; 16+ messages in thread From: Stephan Gerhold @ 2024-12-03 15:11 UTC (permalink / raw) To: Abel Vesa, Johan Hovold Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Krishna Kurapati, Thinh Nguyen, linux-usb, Dmitry Baryshkov +Cc Dmitry On Tue, Dec 03, 2024 at 02:03:05PM +0200, Abel Vesa wrote: > On 24-12-03 12:30:37, Stephan Gerhold wrote: > > On Tue, Dec 03, 2024 at 11:20:48AM +0100, Johan Hovold wrote: > > > [ +CC: Krishna, Thinh and the USB list ] > > > > > > On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > > > > The X1E80100 CRD has a Goodix fingerprint reader connected to the USB > > > > multiport controller on eUSB6. All other ports (including USB super-speed > > > > pins) are unused. > > > > > > > > Set it up in the device tree together with the NXP PTN3222 repeater. > > > > > > > > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> > > > > --- > > > > arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ > > > > 1 file changed, 48 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > > index 39f9d9cdc10d..44942931c18f 100644 > > > > --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > > +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > > @@ -735,6 +735,26 @@ keyboard@3a { > > > > }; > > > > }; > > > > > > > > +&i2c5 { > > > > + clock-frequency = <400000>; > > > > + > > > > + status = "okay"; > > > > + > > > > + eusb6_repeater: redriver@4f { > > > > + compatible = "nxp,ptn3222"; > > > > + reg = <0x4f>; > > > > > > The driver does not currently check that there's actually anything at > > > this address. Did you verify that this is the correct address? > > > > > > (Abel is adding a check to the driver as we speak to catch any such > > > mistakes going forward). > > > > > > > Yes, I verified this using > > https://git.codelinaro.org/stephan.gerhold/linux/-/commit/45d5add498612387f88270ca944ee16e2236fddd > > > > (I sent this to Abel back then, so I'm surprised he didn't run that :-)) > > I don't remember seeing this commit back then. Maybe I didn't look > careful enough. Sorry. > > Since you already did the work, can you send that on the list? > Sure, no problem. What exactly do we want for upstream? My patch above isn't ideal, because it checks the CHIP_ID on every PHY power up. But briefly powering up the PHY during probe() just for reading the CHIP_ID is also a bit weird. Not sure what the best approach here is. Thanks, Stephan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery 2024-12-03 11:30 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery Stephan Gerhold 2024-12-03 12:03 ` Abel Vesa @ 2024-12-03 15:37 ` Krishna Kurapati 2024-12-03 16:05 ` Stephan Gerhold 1 sibling, 1 reply; 16+ messages in thread From: Krishna Kurapati @ 2024-12-03 15:37 UTC (permalink / raw) To: Stephan Gerhold, Johan Hovold Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On 12/3/2024 5:00 PM, Stephan Gerhold wrote: > On Tue, Dec 03, 2024 at 11:20:48AM +0100, Johan Hovold wrote: >> [ +CC: Krishna, Thinh and the USB list ] >> >> On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: >>> The X1E80100 CRD has a Goodix fingerprint reader connected to the USB >>> multiport controller on eUSB6. All other ports (including USB super-speed >>> pins) are unused. >>> >>> Set it up in the device tree together with the NXP PTN3222 repeater. >>> >>> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> >>> --- >>> arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ >>> 1 file changed, 48 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> index 39f9d9cdc10d..44942931c18f 100644 >>> --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> @@ -735,6 +735,26 @@ keyboard@3a { >>> }; >>> }; >>> >>> +&i2c5 { >>> + clock-frequency = <400000>; >>> + >>> + status = "okay"; >>> + >>> + eusb6_repeater: redriver@4f { >>> + compatible = "nxp,ptn3222"; >>> + reg = <0x4f>; >> >> The driver does not currently check that there's actually anything at >> this address. Did you verify that this is the correct address? >> >> (Abel is adding a check to the driver as we speak to catch any such >> mistakes going forward). >> > > Yes, I verified this using > https://git.codelinaro.org/stephan.gerhold/linux/-/commit/45d5add498612387f88270ca944ee16e2236fddd > > (I sent this to Abel back then, so I'm surprised he didn't run that :-)) > >>> + #phy-cells = <0>; >> >> nit: I'd put provider properties like this one last. >> >>> + vdd3v3-supply = <&vreg_l13b_3p0>; >>> + vdd1v8-supply = <&vreg_l4b_1p8>; >> >> Sort by supply name? >> > > Ack. > >>> + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; >>> + >>> + pinctrl-0 = <&eusb6_reset_n>; >>> + pinctrl-names = "default"; >>> + }; >>> +}; >>> + >>> &i2c8 { >>> clock-frequency = <400000>; >>> >>> @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { >>> bias-disable; >>> }; >>> >>> + eusb6_reset_n: eusb6-reset-n-state { >>> + pins = "gpio184"; >>> + function = "gpio"; >>> + drive-strength = <2>; >>> + bias-disable; >>> + output-low; >> >> I don't think the pin config should assert reset, that should be up to >> the driver to control. >> > > I can drop it I guess, but pinctrl is applied before the driver takes > control of the GPIO. This means if the GPIO happens to be in input mode > before the driver loads (with pull up or pull down), then we would > briefly leave it floating when applying the bias-disable. > > Or I guess we could drop the bias-disable, since it shouldn't be > relevant for a pin we keep in output mode all the time? > >>> + }; >>> + >>> hall_int_n_default: hall-int-n-state { >>> pins = "gpio92"; >>> function = "gpio"; >>> @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { >>> &usb_1_ss2_qmpphy_out { >>> remote-endpoint = <&pmic_glink_ss2_ss_in>; >>> }; >>> + >>> +&usb_mp { >>> + status = "okay"; >>> +}; >>> + >>> +&usb_mp_dwc3 { >>> + /* Limit to USB 2.0 and single port */ >>> + maximum-speed = "high-speed"; >>> + phys = <&usb_mp_hsphy1>; >>> + phy-names = "usb2-1"; >>> +}; >> >> The dwc3 driver determines (and acts on) the number of ports based on >> the port interrupts in DT and controller capabilities. >> >> I'm not sure we can (should) just drop the other HS PHY and the SS PHYs >> that would still be there in the SoC (possibly initialised by the boot >> firmware). >> >> I had a local patch to enable the multiport controller (for the suspend >> work) and I realise that you'd currently need to specify a repeater also >> for the HS PHY which does not have one, but that should be possible to >> fix somehow. >> > > I think there are two separate questions here: > > 1. Should we (or do we even need to) enable unused PHYs? > 2. Do we need to power off unused PHYs left enabled by the firmware? > > For (1), I'm not not sure if there is a technical reason that requires > us to. And given that PHYs typically consume quite a bit of power, I'm > not sure if we should. Perhaps it's not worth spending effort on this > minor optimization now, but then the device tree would ideally still > tell us which PHYs are actually used (for future optimizations). > > For (2), yes, we probably need to. But my impression so far is that this > might be a larger problem that we need to handle on the SoC level. I > have seen some firmware versions that blindly power up all USB > controllers, even completely unused ones. Ideally we would power down > unused components during startup and then leave them off. > This question might be a dumb one, if so please ignore it. But if we skip adding unused phys in DTS node, the core driver wouldn't have access to all phys and we wouldn't be able to get references to unused ones (un-mentioned ones in DTS). So how can we power them off from core driver if we don't have reference to them ? Regards, Krishna, ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery 2024-12-03 15:37 ` Krishna Kurapati @ 2024-12-03 16:05 ` Stephan Gerhold 2024-12-13 13:08 ` Konrad Dybcio 0 siblings, 1 reply; 16+ messages in thread From: Stephan Gerhold @ 2024-12-03 16:05 UTC (permalink / raw) To: Krishna Kurapati Cc: Johan Hovold, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On Tue, Dec 03, 2024 at 09:07:22PM +0530, Krishna Kurapati wrote: > On 12/3/2024 5:00 PM, Stephan Gerhold wrote: > > On Tue, Dec 03, 2024 at 11:20:48AM +0100, Johan Hovold wrote: > > > [ +CC: Krishna, Thinh and the USB list ] > > > > > > On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > > > > The X1E80100 CRD has a Goodix fingerprint reader connected to the USB > > > > multiport controller on eUSB6. All other ports (including USB super-speed > > > > pins) are unused. > > > > > > > > Set it up in the device tree together with the NXP PTN3222 repeater. > > > > > > > > Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> > > > > --- > > > > arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ > > > > 1 file changed, 48 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > > index 39f9d9cdc10d..44942931c18f 100644 > > > > --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > > +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts > > > > @@ -735,6 +735,26 @@ keyboard@3a { > > > > [...] > > > > @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { > > > > &usb_1_ss2_qmpphy_out { > > > > remote-endpoint = <&pmic_glink_ss2_ss_in>; > > > > }; > > > > + > > > > +&usb_mp { > > > > + status = "okay"; > > > > +}; > > > > + > > > > +&usb_mp_dwc3 { > > > > + /* Limit to USB 2.0 and single port */ > > > > + maximum-speed = "high-speed"; > > > > + phys = <&usb_mp_hsphy1>; > > > > + phy-names = "usb2-1"; > > > > +}; > > > > > > The dwc3 driver determines (and acts on) the number of ports based on > > > the port interrupts in DT and controller capabilities. > > > > > > I'm not sure we can (should) just drop the other HS PHY and the SS PHYs > > > that would still be there in the SoC (possibly initialised by the boot > > > firmware). > > > > > > I had a local patch to enable the multiport controller (for the suspend > > > work) and I realise that you'd currently need to specify a repeater also > > > for the HS PHY which does not have one, but that should be possible to > > > fix somehow. > > > > > > > I think there are two separate questions here: > > > > 1. Should we (or do we even need to) enable unused PHYs? > > 2. Do we need to power off unused PHYs left enabled by the firmware? > > > > For (1), I'm not not sure if there is a technical reason that requires > > us to. And given that PHYs typically consume quite a bit of power, I'm > > not sure if we should. Perhaps it's not worth spending effort on this > > minor optimization now, but then the device tree would ideally still > > tell us which PHYs are actually used (for future optimizations). > > > > For (2), yes, we probably need to. But my impression so far is that this > > might be a larger problem that we need to handle on the SoC level. I > > have seen some firmware versions that blindly power up all USB > > controllers, even completely unused ones. Ideally we would power down > > unused components during startup and then leave them off. > > > > This question might be a dumb one, if so please ignore it. > > But if we skip adding unused phys in DTS node, the core driver wouldn't have > access to all phys and we wouldn't be able to get references to unused ones > (un-mentioned ones in DTS). So how can we power them off from core driver if > we don't have reference to them ? > The question is not dumb at all, it's a very valid one. :-) Perhaps it's easier if we keep them all listed on the USB controllers and have something else to mark them as unused. The downside of that option is that we might not be able to have a complete description of the PHY with all resources. For example on the CRD there is no eUSB repeater we could model for the first USB port (usb2-0), but it's needed to enable the qcom,x1e80100-snps-eusb2-phy. Thanks, Stephan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery 2024-12-03 16:05 ` Stephan Gerhold @ 2024-12-13 13:08 ` Konrad Dybcio 0 siblings, 0 replies; 16+ messages in thread From: Konrad Dybcio @ 2024-12-13 13:08 UTC (permalink / raw) To: Stephan Gerhold, Krishna Kurapati Cc: Johan Hovold, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On 3.12.2024 5:05 PM, Stephan Gerhold wrote: > On Tue, Dec 03, 2024 at 09:07:22PM +0530, Krishna Kurapati wrote: >> On 12/3/2024 5:00 PM, Stephan Gerhold wrote: >>> On Tue, Dec 03, 2024 at 11:20:48AM +0100, Johan Hovold wrote: >>>> [ +CC: Krishna, Thinh and the USB list ] >>>> >>>> On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: >>>>> The X1E80100 CRD has a Goodix fingerprint reader connected to the USB >>>>> multiport controller on eUSB6. All other ports (including USB super-speed >>>>> pins) are unused. >>>>> >>>>> Set it up in the device tree together with the NXP PTN3222 repeater. >>>>> >>>>> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> >>>>> --- >>>>> arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ >>>>> 1 file changed, 48 insertions(+) >>>>> >>>>> diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>>>> index 39f9d9cdc10d..44942931c18f 100644 >>>>> --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>>>> +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>>>> @@ -735,6 +735,26 @@ keyboard@3a { >>>>> [...] >>>>> @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { >>>>> &usb_1_ss2_qmpphy_out { >>>>> remote-endpoint = <&pmic_glink_ss2_ss_in>; >>>>> }; >>>>> + >>>>> +&usb_mp { >>>>> + status = "okay"; >>>>> +}; >>>>> + >>>>> +&usb_mp_dwc3 { >>>>> + /* Limit to USB 2.0 and single port */ >>>>> + maximum-speed = "high-speed"; >>>>> + phys = <&usb_mp_hsphy1>; >>>>> + phy-names = "usb2-1"; >>>>> +}; >>>> >>>> The dwc3 driver determines (and acts on) the number of ports based on >>>> the port interrupts in DT and controller capabilities. >>>> >>>> I'm not sure we can (should) just drop the other HS PHY and the SS PHYs >>>> that would still be there in the SoC (possibly initialised by the boot >>>> firmware). >>>> >>>> I had a local patch to enable the multiport controller (for the suspend >>>> work) and I realise that you'd currently need to specify a repeater also >>>> for the HS PHY which does not have one, but that should be possible to >>>> fix somehow. >>>> >>> >>> I think there are two separate questions here: >>> >>> 1. Should we (or do we even need to) enable unused PHYs? >>> 2. Do we need to power off unused PHYs left enabled by the firmware? >>> >>> For (1), I'm not not sure if there is a technical reason that requires >>> us to. And given that PHYs typically consume quite a bit of power, I'm >>> not sure if we should. Perhaps it's not worth spending effort on this >>> minor optimization now, but then the device tree would ideally still >>> tell us which PHYs are actually used (for future optimizations). >>> >>> For (2), yes, we probably need to. But my impression so far is that this >>> might be a larger problem that we need to handle on the SoC level. I >>> have seen some firmware versions that blindly power up all USB >>> controllers, even completely unused ones. Ideally we would power down >>> unused components during startup and then leave them off. >>> >> >> This question might be a dumb one, if so please ignore it. >> >> But if we skip adding unused phys in DTS node, the core driver wouldn't have >> access to all phys and we wouldn't be able to get references to unused ones >> (un-mentioned ones in DTS). So how can we power them off from core driver if >> we don't have reference to them ? >> > > The question is not dumb at all, it's a very valid one. :-) > > Perhaps it's easier if we keep them all listed on the USB controllers > and have something else to mark them as unused. The downside of that > option is that we might not be able to have a complete description of > the PHY with all resources. For example on the CRD there is no eUSB > repeater we could model for the first USB port (usb2-0), but it's needed > to enable the qcom,x1e80100-snps-eusb2-phy. So we have the choice between a silent failure or a loud non-failure wrt acquiring the repeater.. not sure which one is better Konrad ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-12-03 10:20 ` Johan Hovold 2024-12-03 11:30 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery Stephan Gerhold @ 2024-12-03 13:15 ` Krishna Kurapati 2024-12-05 8:02 ` Krishna Kurapati 1 sibling, 1 reply; 16+ messages in thread From: Krishna Kurapati @ 2024-12-03 13:15 UTC (permalink / raw) To: Johan Hovold, Stephan Gerhold Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On 12/3/2024 3:50 PM, Johan Hovold wrote: > [ +CC: Krishna, Thinh and the USB list ] > > On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: >> The X1E80100 CRD has a Goodix fingerprint reader connected to the USB >> multiport controller on eUSB6. All other ports (including USB super-speed >> pins) are unused. >> >> Set it up in the device tree together with the NXP PTN3222 repeater. >> >> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> >> --- >> arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 +++++++++++++++++++++++++++++++ >> 1 file changed, 48 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >> index 39f9d9cdc10d..44942931c18f 100644 >> --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >> +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >> @@ -735,6 +735,26 @@ keyboard@3a { >> }; >> }; >> >> +&i2c5 { >> + clock-frequency = <400000>; >> + >> + status = "okay"; >> + >> + eusb6_repeater: redriver@4f { >> + compatible = "nxp,ptn3222"; >> + reg = <0x4f>; > > The driver does not currently check that there's actually anything at > this address. Did you verify that this is the correct address? > > (Abel is adding a check to the driver as we speak to catch any such > mistakes going forward). > >> + #phy-cells = <0>; > > nit: I'd put provider properties like this one last. > >> + vdd3v3-supply = <&vreg_l13b_3p0>; >> + vdd1v8-supply = <&vreg_l4b_1p8>; > > Sort by supply name? > >> + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; >> + >> + pinctrl-0 = <&eusb6_reset_n>; >> + pinctrl-names = "default"; >> + }; >> +}; >> + >> &i2c8 { >> clock-frequency = <400000>; >> >> @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { >> bias-disable; >> }; >> >> + eusb6_reset_n: eusb6-reset-n-state { >> + pins = "gpio184"; >> + function = "gpio"; >> + drive-strength = <2>; >> + bias-disable; >> + output-low; > > I don't think the pin config should assert reset, that should be up to > the driver to control. > >> + }; >> + >> hall_int_n_default: hall-int-n-state { >> pins = "gpio92"; >> function = "gpio"; >> @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { >> &usb_1_ss2_qmpphy_out { >> remote-endpoint = <&pmic_glink_ss2_ss_in>; >> }; >> + >> +&usb_mp { >> + status = "okay"; >> +}; >> + >> +&usb_mp_dwc3 { >> + /* Limit to USB 2.0 and single port */ >> + maximum-speed = "high-speed"; >> + phys = <&usb_mp_hsphy1>; >> + phy-names = "usb2-1"; >> +}; > > The dwc3 driver determines (and acts on) the number of ports based on > the port interrupts in DT and controller capabilities. > > I'm not sure we can (should) just drop the other HS PHY and the SS PHYs > that would still be there in the SoC (possibly initialised by the boot > firmware). > The DWC3 core driver identifies number of ports based on xHCI registers. The QC Wrapper reads this number via interrupts. But these two values are independent of each other. The core driver uses these values to identify and manipulate phys. Even if only one HS is given in multiport it would be sufficient if the name is "usb2-1". If the others are missing, those phys would be read by driver as NULL and any ops to phys would be NOP. Regards, Krishna, > I had a local patch to enable the multiport controller (for the suspend > work) and I realise that you'd currently need to specify a repeater also > for the HS PHY which does not have one, but that should be possible to > fix somehow. > >> + >> +&usb_mp_hsphy1 { >> + vdd-supply = <&vreg_l2e_0p8>; >> + vdda12-supply = <&vreg_l3e_1p2>; >> + >> + phys = <&eusb6_repeater>; >> + >> + status = "okay"; >> +}; > > Johan > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-12-03 13:15 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Krishna Kurapati @ 2024-12-05 8:02 ` Krishna Kurapati 2024-12-05 8:16 ` Johan Hovold 0 siblings, 1 reply; 16+ messages in thread From: Krishna Kurapati @ 2024-12-05 8:02 UTC (permalink / raw) To: Johan Hovold, Stephan Gerhold Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On 12/3/2024 6:45 PM, Krishna Kurapati wrote: > > > On 12/3/2024 3:50 PM, Johan Hovold wrote: >> [ +CC: Krishna, Thinh and the USB list ] >> >> On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: >>> The X1E80100 CRD has a Goodix fingerprint reader connected to the USB >>> multiport controller on eUSB6. All other ports (including USB >>> super-speed >>> pins) are unused. >>> >>> Set it up in the device tree together with the NXP PTN3222 repeater. >>> >>> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> >>> --- >>> arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 48 >>> +++++++++++++++++++++++++++++++ >>> 1 file changed, 48 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> index 39f9d9cdc10d..44942931c18f 100644 >>> --- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> +++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts >>> @@ -735,6 +735,26 @@ keyboard@3a { >>> }; >>> }; >>> +&i2c5 { >>> + clock-frequency = <400000>; >>> + >>> + status = "okay"; >>> + >>> + eusb6_repeater: redriver@4f { >>> + compatible = "nxp,ptn3222"; >>> + reg = <0x4f>; >> >> The driver does not currently check that there's actually anything at >> this address. Did you verify that this is the correct address? >> >> (Abel is adding a check to the driver as we speak to catch any such >> mistakes going forward). >> >>> + #phy-cells = <0>; >> >> nit: I'd put provider properties like this one last. >> >>> + vdd3v3-supply = <&vreg_l13b_3p0>; >>> + vdd1v8-supply = <&vreg_l4b_1p8>; >> >> Sort by supply name? >> >>> + reset-gpios = <&tlmm 184 GPIO_ACTIVE_LOW>; >>> + >>> + pinctrl-0 = <&eusb6_reset_n>; >>> + pinctrl-names = "default"; >>> + }; >>> +}; >>> + >>> &i2c8 { >>> clock-frequency = <400000>; >>> @@ -1047,6 +1067,14 @@ edp_reg_en: edp-reg-en-state { >>> bias-disable; >>> }; >>> + eusb6_reset_n: eusb6-reset-n-state { >>> + pins = "gpio184"; >>> + function = "gpio"; >>> + drive-strength = <2>; >>> + bias-disable; >>> + output-low; >> >> I don't think the pin config should assert reset, that should be up to >> the driver to control. >> >>> + }; >>> + >>> hall_int_n_default: hall-int-n-state { >>> pins = "gpio92"; >>> function = "gpio"; >>> @@ -1260,3 +1288,23 @@ &usb_1_ss2_dwc3_hs { >>> &usb_1_ss2_qmpphy_out { >>> remote-endpoint = <&pmic_glink_ss2_ss_in>; >>> }; >>> + >>> +&usb_mp { >>> + status = "okay"; >>> +}; >>> + >>> +&usb_mp_dwc3 { >>> + /* Limit to USB 2.0 and single port */ >>> + maximum-speed = "high-speed"; >>> + phys = <&usb_mp_hsphy1>; >>> + phy-names = "usb2-1"; >>> +}; >> >> The dwc3 driver determines (and acts on) the number of ports based on >> the port interrupts in DT and controller capabilities. >> >> I'm not sure we can (should) just drop the other HS PHY and the SS PHYs >> that would still be there in the SoC (possibly initialised by the boot >> firmware). >> > > The DWC3 core driver identifies number of ports based on xHCI registers. > The QC Wrapper reads this number via interrupts. But these two values > are independent of each other. The core driver uses these values to > identify and manipulate phys. Even if only one HS is given in multiport > it would be sufficient if the name is "usb2-1". If the others are > missing, those phys would be read by driver as NULL and any ops to phys > would be NOP. > However do we need to reduce the number of interrupts used in DTS ? We don't need to give all interrupts as there is only one port present. We don't want to enable all interrupts when ports are not exposed. Regards, Krishna, ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-12-05 8:02 ` Krishna Kurapati @ 2024-12-05 8:16 ` Johan Hovold 2024-12-05 8:22 ` Krishna Kurapati 0 siblings, 1 reply; 16+ messages in thread From: Johan Hovold @ 2024-12-05 8:16 UTC (permalink / raw) To: Krishna Kurapati Cc: Stephan Gerhold, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On Thu, Dec 05, 2024 at 01:32:29PM +0530, Krishna Kurapati wrote: > On 12/3/2024 6:45 PM, Krishna Kurapati wrote: > > On 12/3/2024 3:50 PM, Johan Hovold wrote: > >> On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > >>> +&usb_mp_dwc3 { > >>> + /* Limit to USB 2.0 and single port */ > >>> + maximum-speed = "high-speed"; > >>> + phys = <&usb_mp_hsphy1>; > >>> + phy-names = "usb2-1"; > >>> +}; > >> > >> The dwc3 driver determines (and acts on) the number of ports based on > >> the port interrupts in DT and controller capabilities. > >> > >> I'm not sure we can (should) just drop the other HS PHY and the SS PHYs > >> that would still be there in the SoC (possibly initialised by the boot > >> firmware). > > > > The DWC3 core driver identifies number of ports based on xHCI registers. > > The QC Wrapper reads this number via interrupts. But these two values > > are independent of each other. The core driver uses these values to > > identify and manipulate phys. Even if only one HS is given in multiport > > it would be sufficient if the name is "usb2-1". If the others are > > missing, those phys would be read by driver as NULL and any ops to phys > > would be NOP. No, the core driver still acts on these ports (to some extent) even if there is no PHY specified (e.g. updates DWC3_GUSB2PHYCFG on suspend). And IIRC I even had to specify more than just the fingerprint reader PHY on the X13s to get it to enumerate. I never had time to fully determine why this was the case though. > However do we need to reduce the number of interrupts used in DTS ? > We don't need to give all interrupts as there is only one port present. > We don't want to enable all interrupts when ports are not exposed. No, the interrupts are still there, wired up in the SoC, so we should not change that. With runtime PM eventually enabled and working as it should, the OS should be able to power down any unused ports. And we could also consider marking some ports as not physically accessible and not connected as a further hint to the OS that they can be disabled even sooner. Johan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-12-05 8:16 ` Johan Hovold @ 2024-12-05 8:22 ` Krishna Kurapati 2024-12-05 8:56 ` Johan Hovold 0 siblings, 1 reply; 16+ messages in thread From: Krishna Kurapati @ 2024-12-05 8:22 UTC (permalink / raw) To: Johan Hovold Cc: Stephan Gerhold, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On 12/5/2024 1:46 PM, Johan Hovold wrote: > On Thu, Dec 05, 2024 at 01:32:29PM +0530, Krishna Kurapati wrote: >> On 12/3/2024 6:45 PM, Krishna Kurapati wrote: >>> On 12/3/2024 3:50 PM, Johan Hovold wrote: >>>> On Mon, Nov 18, 2024 at 11:34:29AM +0100, Stephan Gerhold wrote: > >>>>> +&usb_mp_dwc3 { >>>>> + /* Limit to USB 2.0 and single port */ >>>>> + maximum-speed = "high-speed"; >>>>> + phys = <&usb_mp_hsphy1>; >>>>> + phy-names = "usb2-1"; >>>>> +}; >>>> >>>> The dwc3 driver determines (and acts on) the number of ports based on >>>> the port interrupts in DT and controller capabilities. >>>> >>>> I'm not sure we can (should) just drop the other HS PHY and the SS PHYs >>>> that would still be there in the SoC (possibly initialised by the boot >>>> firmware). >>> >>> The DWC3 core driver identifies number of ports based on xHCI registers. >>> The QC Wrapper reads this number via interrupts. But these two values >>> are independent of each other. The core driver uses these values to >>> identify and manipulate phys. Even if only one HS is given in multiport >>> it would be sufficient if the name is "usb2-1". If the others are >>> missing, those phys would be read by driver as NULL and any ops to phys >>> would be NOP. > > No, the core driver still acts on these ports (to some extent) even if > there is no PHY specified (e.g. updates DWC3_GUSB2PHYCFG on suspend). > Yes, since the port count is obtained from xHCI registers, the GUSB2PHYCFG/ GUSB3PIPECTL regs are modified regardless we use the PHYs or not but this is still fine. It can be considered a NOP AFAIK. > And IIRC I even had to specify more than just the fingerprint reader PHY > on the X13s to get it to enumerate. I never had time to fully determine > why this was the case though. > This might need to be checked. Did you attempt adding each phy individually ? Just incase the first PHY is not the one corresponding to the fingerprint reader. Regards, Krishna, >> However do we need to reduce the number of interrupts used in DTS ? >> We don't need to give all interrupts as there is only one port present. >> We don't want to enable all interrupts when ports are not exposed. > > No, the interrupts are still there, wired up in the SoC, so we should > not change that. > > With runtime PM eventually enabled and working as it should, the OS > should be able to power down any unused ports. And we could also > consider marking some ports as not physically accessible and not > connected as a further hint to the OS that they can be disabled even > sooner. > > Johan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader 2024-12-05 8:22 ` Krishna Kurapati @ 2024-12-05 8:56 ` Johan Hovold 0 siblings, 0 replies; 16+ messages in thread From: Johan Hovold @ 2024-12-05 8:56 UTC (permalink / raw) To: Krishna Kurapati Cc: Stephan Gerhold, Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Krishna Kurapati, Thinh Nguyen, linux-usb On Thu, Dec 05, 2024 at 01:52:08PM +0530, Krishna Kurapati wrote: > On 12/5/2024 1:46 PM, Johan Hovold wrote: > > And IIRC I even had to specify more than just the fingerprint reader PHY > > on the X13s to get it to enumerate. I never had time to fully determine > > why this was the case though. > > This might need to be checked. Did you attempt adding each phy > individually ? Just incase the first PHY is not the one corresponding to > the fingerprint reader. Yes, I tried each PHY in turn, and only enabling the HS and SS PHY for the fingerprint reader port, but that was not enough. Johan ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/2] arm64: defconfig: enable NXP PTN3222 eUSB2 to USB2 redriver driver 2024-11-18 10:34 [PATCH 0/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Stephan Gerhold 2024-11-18 10:34 ` [PATCH 1/2] " Stephan Gerhold @ 2024-11-18 10:34 ` Stephan Gerhold 1 sibling, 0 replies; 16+ messages in thread From: Stephan Gerhold @ 2024-11-18 10:34 UTC (permalink / raw) To: Bjorn Andersson, Konrad Dybcio Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Catalin Marinas, Will Deacon, linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel, Abel Vesa, Johan Hovold It is used in many of the Qualcomm X1 Elite laptops for additional USB-A ports, USB fingerprint readers or similar peripherals. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 0b8303eb498d..8b17d70b3b58 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1530,6 +1530,7 @@ CONFIG_RESET_RZG2L_USBPHY_CTRL=y CONFIG_RESET_TI_SCI=y CONFIG_PHY_XGENE=y CONFIG_PHY_CAN_TRANSCEIVER=m +CONFIG_PHY_NXP_PTN3222=m CONFIG_PHY_SUN4I_USB=y CONFIG_PHY_CADENCE_TORRENT=m CONFIG_PHY_CADENCE_DPHY_RX=m -- 2.44.2 ^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2024-12-13 13:08 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-11-18 10:34 [PATCH 0/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Stephan Gerhold 2024-11-18 10:34 ` [PATCH 1/2] " Stephan Gerhold 2024-12-02 14:32 ` Konrad Dybcio 2024-12-03 10:20 ` Johan Hovold 2024-12-03 11:30 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint readery Stephan Gerhold 2024-12-03 12:03 ` Abel Vesa 2024-12-03 15:11 ` Stephan Gerhold 2024-12-03 15:37 ` Krishna Kurapati 2024-12-03 16:05 ` Stephan Gerhold 2024-12-13 13:08 ` Konrad Dybcio 2024-12-03 13:15 ` [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: Add USB multiport fingerprint reader Krishna Kurapati 2024-12-05 8:02 ` Krishna Kurapati 2024-12-05 8:16 ` Johan Hovold 2024-12-05 8:22 ` Krishna Kurapati 2024-12-05 8:56 ` Johan Hovold 2024-11-18 10:34 ` [PATCH 2/2] arm64: defconfig: enable NXP PTN3222 eUSB2 to USB2 redriver driver Stephan Gerhold
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).