标题RK3399 GPIO配置问题/电源域配置
平台RK3399
OS Linux
Kernel 4.4
硬件需要拉高gpio1 A3来使能OTG功能,但是在配置dts后一直没有电压,最后查下来是硬件与软件的电源域配置不一致,记录一下查找过程。
原理图
VCC5V0_OTG_EN对应gpio1 A3
Dts配置:
arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
+ vcc5v0_otg: vcc5v0-otg-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&otg_vbus_drv>;
+ regulator-name = "vcc5v0_otg";
+ regulator-always-on;
+ };
...
+ usb1 {
+ otg_vbus_drv: otg-vbus-drv {
+ rockchip,pins =
+ <1 3 RK_FUNC_GPIO &pcfg_pull_none>;
开机后量电压一直没有,查看gpio的clk没有打开(pclk_gpio1_pmu)
#cat /sys/kernel/debug/clk/clk_summary | grep gpio
pclk_gpio4 1 1 100000000 0 0
pclk_gpio3 0 1 100000000 0 0
pclk_gpio2 0 1 100000000 0 0
pclk_gpio1_pmu 0 1 48285715 0 0
pclk_gpio0_pmu 2 1 48285715 0 0
由原理图可知GPIO1用的电源域对应PMUIO2
查看kernel文档Documentation/devicetree/bindings/power/rockchip-io-domain.txt
124 Possible supplies for rk3399:
125 - bt656-supply: The supply connected to APIO2_VDD.
126 - audio-supply: The supply connected to APIO5_VDD.
127 - sdmmc-supply: The supply connected to SDMMC0_VDD.
128 - gpio1830 The supply connected to APIO4_VDD.
129
130 Possible supplies for rk3399 pmu-domains:
131 - pmu1830-supply:The supply connected to PMUIO2_VDD.
检查dts配置,修改成相应配置
&pmu_io_domains {
status = "okay";
- pmu1830-supply = <&vcc_3v0>;
+ pmu1830-supply = <&vcc_1v8>;
};
编译下载后量电压为1.8v,对应gpio时钟也是enable状态了
#cat /sys/kernel/debug/clk/clk_summary | grep gpio
pclk_gpio4 1 1 100000000 0 0
pclk_gpio3 0 1 100000000 0 0
pclk_gpio2 0 1 100000000 0 0
pclk_gpio1_pmu 2 1 48285715 0 0
pclk_gpio0_pmu 2 1 48285715 0 0