Skip to content

Commit

Permalink
riscv: dts: starfive: Add cpu scaling for JH7110 SoC
Browse files Browse the repository at this point in the history
Add the operating-points-v2 to support cpu scaling on StarFive JH7110 SoC.
It supports up to 4 cpu frequency loads.

Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
  • Loading branch information
Mason Huo authored and Conor Dooley committed Jun 6, 2023
1 parent 2378341 commit e2c510d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,19 @@
pinctrl-0 = <&uart0_pins>;
status = "okay";
};

&U74_1 {
cpu-supply = <&vdd_cpu>;
};

&U74_2 {
cpu-supply = <&vdd_cpu>;
};

&U74_3 {
cpu-supply = <&vdd_cpu>;
};

&U74_4 {
cpu-supply = <&vdd_cpu>;
};
33 changes: 33 additions & 0 deletions arch/riscv/boot/dts/starfive/jh7110.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
next-level-cache = <&ccache>;
riscv,isa = "rv64imafdc_zba_zbb";
tlb-split;
operating-points-v2 = <&cpu_opp>;
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
clock-names = "cpu";

cpu1_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
Expand All @@ -79,6 +82,9 @@
next-level-cache = <&ccache>;
riscv,isa = "rv64imafdc_zba_zbb";
tlb-split;
operating-points-v2 = <&cpu_opp>;
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
clock-names = "cpu";

cpu2_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
Expand All @@ -105,6 +111,9 @@
next-level-cache = <&ccache>;
riscv,isa = "rv64imafdc_zba_zbb";
tlb-split;
operating-points-v2 = <&cpu_opp>;
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
clock-names = "cpu";

cpu3_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
Expand All @@ -131,6 +140,9 @@
next-level-cache = <&ccache>;
riscv,isa = "rv64imafdc_zba_zbb";
tlb-split;
operating-points-v2 = <&cpu_opp>;
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
clock-names = "cpu";

cpu4_intc: interrupt-controller {
compatible = "riscv,cpu-intc";
Expand Down Expand Up @@ -164,6 +176,27 @@
};
};

cpu_opp: opp-table-0 {
compatible = "operating-points-v2";
opp-shared;
opp-375000000 {
opp-hz = /bits/ 64 <375000000>;
opp-microvolt = <800000>;
};
opp-500000000 {
opp-hz = /bits/ 64 <500000000>;
opp-microvolt = <800000>;
};
opp-750000000 {
opp-hz = /bits/ 64 <750000000>;
opp-microvolt = <800000>;
};
opp-1500000000 {
opp-hz = /bits/ 64 <1500000000>;
opp-microvolt = <1040000>;
};
};

gmac0_rgmii_rxin: gmac0-rgmii-rxin-clock {
compatible = "fixed-clock";
clock-output-names = "gmac0_rgmii_rxin";
Expand Down

0 comments on commit e2c510d

Please sign in to comment.