Skip to content

Commit

Permalink
regulator: Add hpu3501 regulator and update dts
Browse files Browse the repository at this point in the history
Signed-off-by: yaqiang.li <[email protected]>
  • Loading branch information
yaqiang.li committed Dec 8, 2022
1 parent 577fc07 commit cdd89be
Show file tree
Hide file tree
Showing 3 changed files with 333 additions and 0 deletions.
104 changes: 104 additions & 0 deletions arch/arm64/boot/dts/hobot/hobot-x3-dvb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,64 @@
turbo-mode;
};
};

cpu_opp_table_hobot: cpu_opp_table_hobot {
compatible = "operating-points-v2";
opp-shared;
opp00 {
opp-hz = /bits/ 64 <1200000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp01 {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp02 {
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp03 {
opp-hz = /bits/ 64 <500000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp04 {
opp-hz = /bits/ 64 <240000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp05 {
opp-hz = /bits/ 64 <1500000000>;
opp-microvolt = <990000>;
clock-latency-ns = <500000>;
turbo-mode;
};
};

camera_pd_dc_2v8: camera_pd_dc_2v8 {
status = "disabled";
compatible = "regulator-gpio";
regulator-name = "VCC28_CAM";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <3000000>;
enable-gpio = <&gpios 92 0>;
states = <3000000 0>;
enable-active-high;
};

camera_pd_dc_1v8: camera_pd_dc_1v8 {
status = "disabled";
compatible = "regulator-gpio";
regulator-name = "VCC18_CAM";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
enable-gpio = <&gpios 93 0>;
states = <1800000 0>;
enable-active-high;
};
};

&i2c0 {
Expand Down Expand Up @@ -188,10 +246,45 @@
};
};

hpu3501@1e {
compatible = "hobot-pmic,hpu3501";
reg = <0x1e>;
status = "disabled";
regulators {
cnn0_pd_reg_hobot: BUCK3 {
regulator-name = "VCC_CNN0";
regulator-min-microvolt = <820000>;
regulator-max-microvolt = <1000000>;
regulator-enable-ramp-delay = <3000>;
};

cnn1_pd_reg_hobot: BUCK4 {
regulator-name = "VCC_CNN1";
regulator-min-microvolt = <820000>;
regulator-max-microvolt = <1000000>;
regulator-enable-ramp-delay = <3000>;
};

cpu_pd_reg_hobot: BUCK5 {
regulator-name = "VCC_CPU";
regulator-min-microvolt = <795000>;
regulator-max-microvolt = <990000>;
regulator-always-on;
};

vdd_usb_0v8_hobot: LDO3 {
regulator-name = "USB_V_8";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <3000>;
};
};
};
};

&usbdrd3_0 {
usb_0v8-supply = <&vdd_usb_0v8>;
usb_0v8-supply_hobot = <&vdd_usb_0v8_hobot>;
};

&dwc3_powersave {
Expand Down Expand Up @@ -224,31 +317,40 @@

&cpu0 {
cpu-supply = <&cpu_pd_reg>;
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
cpu-supply-dc = <&cpu_pd_reg_dc>;
operating-points-v2-dc = <&cpu_opp_table_dc>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cpu1 {
cpu-supply = <&cpu_pd_reg>;
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
cpu-supply-dc = <&cpu_pd_reg_dc>;
operating-points-v2-dc = <&cpu_opp_table_dc>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cpu2 {
cpu-supply = <&cpu_pd_reg>;
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
cpu-supply-dc = <&cpu_pd_reg_dc>;
operating-points-v2-dc = <&cpu_opp_table_dc>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cpu3 {
cpu-supply = <&cpu_pd_reg>;
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
cpu-supply-dc = <&cpu_pd_reg_dc>;
operating-points-v2-dc = <&cpu_opp_table_dc>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cnn0 {
cnn-supply = <&cnn0_pd_reg>;
cnn-supply-dc = <&cnn0_pd_reg_dc>;
cnn-supply-hobot = <&cnn0_pd_reg_hobot>;
operating-points-v2-dc = <&cnn_opp_table_dc>;
operating-points-v2-lite = <&cnn_opp_table_lite>;
operating-points-v2-dc-lite = <&cnn_opp_table_dc_lite>;
Expand All @@ -259,6 +361,7 @@
&cnn1 {
cnn-supply = <&cnn1_pd_reg>;
cnn-supply-dc = <&cnn1_pd_reg_dc>;
cnn-supply-hobot = <&cnn1_pd_reg_hobot>;
operating-points-v2-dc = <&cnn_opp_table_dc>;
operating-points-v2-lite = <&cnn_opp_table_lite>;
operating-points-v2-dc-lite = <&cnn_opp_table_dc_lite>;
Expand Down Expand Up @@ -316,3 +419,4 @@
status = "disabled";
// camera_check_irq_pin = <117>; // camera lock check pin
};

128 changes: 128 additions & 0 deletions arch/arm64/boot/dts/hobot/hobot-x3-pi.dts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,42 @@
regulator-boot-on;
enable-active-high;
};

cpu_opp_table_hobot: cpu_opp_table_hobot {
compatible = "operating-points-v2";
opp-shared;
opp00 {
opp-hz = /bits/ 64 <1200000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp01 {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp02 {
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp03 {
opp-hz = /bits/ 64 <500000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp04 {
opp-hz = /bits/ 64 <240000000>;
opp-microvolt = <795000>;
clock-latency-ns = <500000>;
};
opp05 {
opp-hz = /bits/ 64 <1500000000>;
opp-microvolt = <990000>;
clock-latency-ns = <500000>;
turbo-mode;
};
};
};

&power {
Expand Down Expand Up @@ -256,6 +292,40 @@
rst-gpio = <&gpios 64 0>;
status = "okay";
};
hpu3501@1e {
compatible = "hobot-pmic,hpu3501";
reg = <0x1e>;
status = "disabled";
regulators {
cnn0_pd_reg_hobot: BUCK3 {
regulator-name = "VCC_CNN0";
regulator-min-microvolt = <820000>;
regulator-max-microvolt = <1000000>;
regulator-enable-ramp-delay = <3000>;
};

cnn1_pd_reg_hobot: BUCK4 {
regulator-name = "VCC_CNN1";
regulator-min-microvolt = <820000>;
regulator-max-microvolt = <1000000>;
regulator-enable-ramp-delay = <3000>;
};

cpu_pd_reg_hobot: BUCK5 {
regulator-name = "VCC_CPU";
regulator-min-microvolt = <795000>;
regulator-max-microvolt = <990000>;
regulator-always-on;
};

vdd_usb_0v8_hobot: LDO3 {
regulator-name = "USB_V_8";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <3000>;
};
};
};
};

&uart0 {
Expand Down Expand Up @@ -283,6 +353,7 @@

&usbdrd3_0 {
status = "okay";
usb_0v8-supply_hobot = <&vdd_usb_0v8_hobot>;
};

&usbdrd_dwc3_0 {
Expand Down Expand Up @@ -469,6 +540,63 @@
};
};

&cnn_opp_table {
opp00 {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <820000>;
clock-latency-ns = <500000>;
};
opp01 {
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <820000>;
clock-latency-ns = <500000>;
};
opp02 {
opp-hz = /bits/ 64 <400000000>;
opp-microvolt = <820000>;
clock-latency-ns = <500000>;
};
opp03 {
opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <820000>;
clock-latency-ns = <500000>;
};
};


&cpu0 {
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cpu1 {
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cpu2 {
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cpu3 {
cpu-supply-hobot = <&cpu_pd_reg_hobot>;
operating-points-v2-hobot = <&cpu_opp_table_hobot>;
};

&cnn0 {
cnn-supply-hobot = <&cnn0_pd_reg_hobot>;
governor = "userspace";
max_freq = /bits/ 64 <1000000000>;
};

&cnn1 {
cnn-supply-hobot = <&cnn1_pd_reg_hobot>;
governor = "userspace";
max_freq = /bits/ 64 <1000000000>;
};


&sdio0 {
status = "okay";
bus-width = <8>;
Expand Down
Loading

0 comments on commit cdd89be

Please sign in to comment.