Device Tree Configuration
The device tree file for the JH7110 EVB is located at: kernel/linux/arch/riscv/boot/dts/starfive/jh7110.dtsi. The following sections describe each node and its key parameters.
Thermal Sensor (sfctemp)
The sfctemp node defines the on-chip temperature sensor
hardware.
sfctemp: tmon@120e0000 {
compatible = "starfive,jh7110-temp";
reg = <0x0 0x120e0000 0x0 0x10000>;
interrupts = <81>;
clocks = <&clkgen JH7110_TEMP_SENSOR_CLK_TEMP>,
<&clkgen JH7110_TEMP_SENSOR_CLK_APB>;
clock-names = "sense", "bus";
resets = <&rstgen RSTN_U0_TEMP_SENSOR_TEMP>,
<&rstgen RSTN_U0_TEMP_SENSOR_APB>;
reset-names = "sense", "bus";
#thermal-sensor-cells = <0>;
status = "disabled";
| Parameter | Description |
|---|---|
| compatible | Compatibility information, used to associate the driver and its target device |
| reg | Sensor register base address and size |
| interrupts | Hardware interrupt number for temperature alerts |
| clocks | Clocks used by the thermal module |
| clock-names | Names of the clocks |
| resets | Rest signals for the thermla module |
| reset-names | Names of the reset signals |
| thermal-sensor-cells | Set to <0> — this sensor provides a
single temperature reading with no additional parameters.
Referenced by the thermal zone via
<&sfctemp>. |
| status | Set to okay to enable the sensor, or
disabled to disable it. |
CPU as Cooling Device
Each CPU core is declared as a cooling device by adding the
#cooling-cells parameter. When the thermal framework detects an
over-temperature condition, it instructs the cpufreq driver to reduce the CPU
frequency, which lowers power dissipation and temperature.
#cooling-cells parameter added to
CPU0.cpu0: cpu@0 {
compatible = "sifive,s7", "riscv";
device_type = "cpu";
reg = <0>;
riscv,isa = "rv64imac_zba_zbb";
/* ... other CPU properties (cache, MMU, etc.) omitted for clarity ... */
#cooling-cells = <2>;
status = "disabled";
};| Parameter | Description |
|---|---|
| #cooling-cells | Required for any device that acts as a cooling actuator. Set
to <2> — the two cells specify the minimum
and maximum cooling state that the thermal zone's cooling-maps
can request. |
CPU OPP Table
The OPP (Operating Performance Points) table defines the available CPU frequency and voltage pairs. The cpufreq driver selects from these entries when scaling the CPU frequency — including during thermal throttling. A lower OPP means lower frequency, lower voltage, and less heat.
cluster0_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-suspend;
};
opp-1500000000 {
opp-hz = /bits/ 64 <1500000000>;
opp-microvolt = <1040000>;
};
/* CPU opp table for 1.25GHz */
opp-312500000 {
opp-hz = /bits/ 64 <312500000>;
opp-microvolt = <800000>;
};
opp-417000000 {
opp-hz = /bits/ 64 <417000000>;
opp-microvolt = <800000>;
};
opp-625000000 {
opp-hz = /bits/ 64 <625000000>;
opp-microvolt = <800000>;
opp-suspend;
};
opp-1250000000 {
opp-hz = /bits/ 64 <1250000000>;
opp-microvolt = <1000000>;
};
};
| Parameter | Description |
|---|---|
| compatible | Must be "operating-points-v2" for the OPP v2 binding. |
| opp-shared | Indicates all CPU cores in the cluster share the same OPP (frequency scaling applies to the entire cluster, not individual cores). |
| opp-hz | Target CPU frequency in Hz. |
| opp-microvolt | Required supply voltage in microvolts for this frequency. |
| opp-suspend | Marks this OPP as the preferred frequency during system suspend. |
Thermal Zone: Trip Points and Cooling Maps
thermal-zones node ties the sensor, trip points, and cooling
devices into a complete thermal policy. It defines: - Which sensor to read (
thermal-sensors) - When to take action (
trips: temperature thresholds) - What to do when a threshold is crossed (
cooling-maps: which cooling devices to activate)
thermal-zones {
cpu-thermal {
polling-delay-passive = <250>;
polling-delay = <15000>;
thermal-sensors = <&sfctemp>;
trips {
cpu_alert0: cpu_alert0 {
/* milliCelsius */
temperature = <85000>;
hysteresis = <2000>;
type = "passive";
};
cpu_crit: cpu_crit {
/* milliCelsius */
temperature = <100000>;
hysteresis = <2000>;
type = "critical";
};
};
cooling-maps {
map0 {
trip = <&cpu_alert0>;
cooling-device =
<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
};
| Parameter | Description |
|---|---|
| cpu-thermal Node | |
| polling-delay-passive | Polling interval (ms) when a passive trip is active. |
| polling-delay | Polling interval (ms) when no passive trip is active. |
| thermal-sensors | References the sensor node ( &sfctemp ) that provides temperature readings for this zone. |
| trips Node | |
| temperature | Trip threshold in milli-degrees Celsius. |
| hysteresis | Temperature hysteresis in milli-degrees Celsius. |
| type | passive — the framework activates cooling
devices to reduce temperature. critical — the
framework performs an emergency shutdown. |
| cooling-maps Node | |
| trip | References the trip point that triggers this cooling action,
for example, <&cpu_alert0>. |
| cooling-device |
References one or more cooling devices. Each entry is
|