From 6de4caa7df8c6a0b76223121b7618511aeb56a26 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Tue, 15 Jun 2021 11:23:42 +0800 Subject: [PATCH] arm64: dts: rockchip: rk356x-evb: fix pcie supply to regulator-fixed The pcie supply design is (rk3566 evb2 example) DC12V -> VCC12V_PCIE(controlled by GPIO0_C2_H) -> VCC3V3_PCIE(controlled by GPIO0_C2_H) -> VCC5V0_SYS -> VCC3V3_PI6C(controlled by GPIO0_C2_H) The pci phy driver only want to enable or disable the VCC3V3_PCIE power. Suggested from pcie owner to ignore the VCC12V_PCIE and VCC3V3_PI6C, so the dts only need to add regulator node for VCC3V3_PCIE. Most of time we keep the regulator name same as the hardware design, so the dts node is vcc3v3_pcie: gpio-regulator { compatible = "regulator-fixed"; regulator-name = "vcc3v3_pcie"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; enable-active-high; gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; vin-supply = <&dc_12v>; }; The regulator type is "regulator-fixed" since its voltage always be 3.3v, min and max should be 3300000 make the regulator has a voltage value. The regulator can be enabled or disabled by regulator_enable or regulator_disable function, so make the GPIO0_B7 as "ena_pin" for the regulator. The regulator is supplied by DCIN_12V, so add the vin-supply. Change-Id: Iaf70abe9c9e06504af067dc0e3d60b775557c026 Signed-off-by: Jianqun Xu --- .../dts/rockchip/rk3566-evb-mipitest-v10.dtsi | 17 +++--- .../dts/rockchip/rk3566-evb1-ddr4-v10.dtsi | 17 +++--- .../dts/rockchip/rk3566-evb2-lp4x-v10.dtsi | 23 ++++---- .../dts/rockchip/rk3566-evb5-lp4x-v10.dtsi | 17 +++--- .../dts/rockchip/rk3568-evb2-lp4x-v10.dtsi | 48 +++------------ .../dts/rockchip/rk3568-evb6-ddr3-v10.dtsi | 58 +++++-------------- 6 files changed, 56 insertions(+), 124 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3566-evb-mipitest-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-evb-mipitest-v10.dtsi index d0e2f2a54b7a..4f5547faf24b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-evb-mipitest-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-evb-mipitest-v10.dtsi @@ -14,15 +14,14 @@ model = "Rockchip RK3566 EVB MIPITEST V10 Board"; compatible = "rockchip,rk3566-evb-mipitest-v10", "rockchip,rk3566"; - pcie20_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie20_3v3"; - regulator-min-microvolt = <0100000>; + vcc3v3_pcie: gpio-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie"; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <0100000 0x0 - 3300000 0x1>; + enable-active-high; + gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; + vin-supply = <&dc_12v>; }; rk_headset: rk-headset { @@ -332,7 +331,7 @@ &pcie2x1 { reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie20_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-evb1-ddr4-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-evb1-ddr4-v10.dtsi index d62cc83fbce0..913aff5e2614 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-evb1-ddr4-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-evb1-ddr4-v10.dtsi @@ -14,15 +14,14 @@ model = "Rockchip RK3566 EVB1 DDR4 V10 Board"; compatible = "rockchip,rk3566-evb1-ddr4-v10", "rockchip,rk3566"; - pcie20_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie20_3v3"; - regulator-min-microvolt = <100000>; + vcc3v3_pcie: gpio-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie"; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <100000 0x0 - 3300000 0x1>; + enable-active-high; + gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; + vin-supply = <&dc_12v>; }; rk_headset: rk-headset { @@ -327,7 +326,7 @@ &pcie2x1 { reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie20_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-evb2-lp4x-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-evb2-lp4x-v10.dtsi index 2cb47ca48ea1..a23339548302 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-evb2-lp4x-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-evb2-lp4x-v10.dtsi @@ -15,17 +15,6 @@ model = "Rockchip RK3566 EVB2 LP4X V10 Board"; compatible = "rockchip,rk3566-evb2-lp4x-v10", "rockchip,rk3566"; - pcie20_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie20_3v3"; - regulator-min-microvolt = <100000>; - regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <100000 0x0 - 3300000 0x1>; - }; - rk_headset: rk-headset { compatible = "rockchip_headset"; headset_gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; @@ -43,6 +32,16 @@ regulator-always-on; regulator-boot-on; }; + + vcc3v3_pcie: gpio-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + enable-active-high; + gpio = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; + vin-supply = <&dc_12v>; + }; }; &combphy1_usq { @@ -416,7 +415,7 @@ &pcie2x1 { reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie20_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3566-evb5-lp4x-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-evb5-lp4x-v10.dtsi index 67da07efdcb6..e9cb9c23ba61 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-evb5-lp4x-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3566-evb5-lp4x-v10.dtsi @@ -14,15 +14,14 @@ model = "Rockchip RK3566 EVB5 LP4X V10 Board"; compatible = "rockchip,rk3566-evb5-lp4x-v10", "rockchip,rk3566"; - pcie20_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie20_3v3"; - regulator-min-microvolt = <100000>; + vcc3v3_pcie: gpio-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie"; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <100000 0x0 - 3300000 0x1>; + enable-active-high; + gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; + vin-supply = <&dc_12v>; }; rk_headset: rk-headset { @@ -190,7 +189,7 @@ &pcie2x1 { reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie20_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb2-lp4x-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-evb2-lp4x-v10.dtsi index 57eb90227ef4..505d01779c48 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-evb2-lp4x-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-evb2-lp4x-v10.dtsi @@ -32,46 +32,14 @@ vin-supply = <&vcc3v3_sys>; }; - pcie20_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie20_3v3"; - regulator-min-microvolt = <100000>; - regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <100000 0x0 - 3300000 0x1>; - }; - - pcie30_avdd0v9: pcie30-avdd0v9 { + vcc3v3_pcie: gpio-regulator { compatible = "regulator-fixed"; - regulator-name = "pcie30_avdd0v9"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <900000>; - vin-supply = <&vcc3v3_sys>; - }; - - pcie30_avdd1v8: pcie30-avdd1v8 { - compatible = "regulator-fixed"; - regulator-name = "pcie30_avdd1v8"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - vin-supply = <&vcc3v3_sys>; - }; - - pcie30_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie30_3v3"; - regulator-min-microvolt = <100000>; + regulator-name = "vcc3v3_pcie"; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <100000 0x0 - 3300000 0x1>; + enable-active-high; + gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; + vin-supply = <&dc_12v>; }; qsgmii_3v3: gpio-regulator { @@ -243,7 +211,7 @@ &pcie2x1 { reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie20_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; }; @@ -253,7 +221,7 @@ &pcie3x2 { reset-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie30_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb6-ddr3-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-evb6-ddr3-v10.dtsi index 3780daa11c88..b8110a505c62 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-evb6-ddr3-v10.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-evb6-ddr3-v10.dtsi @@ -13,48 +13,6 @@ model = "Rockchip RK3568 EVB6 DDR3 V10 Board"; compatible = "rockchip,rk3568-evb6-ddr3-v10", "rockchip,rk3568"; - pcie20_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie20_3v3"; - regulator-min-microvolt = <100000>; - regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <100000 0x0 - 3300000 0x1>; - }; - - pcie30_avdd0v9: pcie30-avdd0v9 { - compatible = "regulator-fixed"; - regulator-name = "pcie30_avdd0v9"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <900000>; - vin-supply = <&vcc3v3_sys>; - }; - - pcie30_avdd1v8: pcie30-avdd1v8 { - compatible = "regulator-fixed"; - regulator-name = "pcie30_avdd1v8"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - vin-supply = <&vcc3v3_sys>; - }; - - pcie30_3v3: gpio-regulator { - compatible = "regulator-gpio"; - regulator-name = "pcie30_3v3"; - regulator-min-microvolt = <0100000>; - regulator-max-microvolt = <3300000>; - gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; - gpios-states = <0x1>; - states = <0100000 0x0 - 3300000 0x1>; - }; - rk_headset: rk-headset { compatible = "rockchip_headset"; headset_gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; @@ -62,6 +20,16 @@ pinctrl-0 = <&hp_det>; }; + vcc3v3_pcie: gpio-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_pcie"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + enable-active-high; + gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; + vin-supply = <&dc_12v>; + }; + vcc_camera: vcc-camera-regulator { compatible = "regulator-fixed"; gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; @@ -333,21 +301,21 @@ &pcie2x1 { reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie20_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; }; &pcie3x1 { rockchip,bifurcation; reset-gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie30_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; }; &pcie3x2 { rockchip,bifurcation; reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&pcie30_3v3>; + vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; };