T-HEAD Devicetrees for v6.19

Add PWM controlled fan and it's associated thermal management for the
 Lichee Pi 4A board.
 
 Enable additional ISA extenstions supported by the T-Head C910 cores:
 Zfh, Ziccrse, XTheadvector.
 
 Add reset controllers of more TH1520 subsystems: AP, AO, DSP, MISC, VI.
 
 Signed-off-by: Drew Fustini <fustini@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSy8G7QpEpV9aCf6Lbb7CzD2SixDAUCaRDChQAKCRDb7CzD2Six
 DNU3AQDMrJ6jcRJQbog1T2OnIxPyvOct1Hx+01cD62MaSFprHAEAsJ4L8s3HPMWf
 pj+Cq44DoFH6UV/ImJlxpYFL87J9TQY=
 =ykgv
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmkghukACgkQmmx57+YA
 GNmV9A/9GUE328GSrWiJ63RsZmgnBhb0o2SRyQxQSmTWbaLnNeHebO0myNCUynK9
 kqacDnOFyUyFu8J7bMqT5RtZTGZalvFtt7Uxld+ESjTxujBqCZz7QNEVvWzNUpzB
 pxIfJdWfm7GcQYZsM+6V+tpByVkrnh3smErm3vCt4TFCk9Eqkn0n+Vfe8Rvm3Tm9
 ELZY/zC4LW4GMDX429wJs1d9N9c6zxYwhd/Q1kyO5iPV/eiLlTVVFlHQZZaJRlB0
 TbAHVt5RxtN4AC2xLUAer3J1K4iZNnXvVbBb5kBnGny5FTxHSafB11V2BFwDKrDB
 eleUw8K6xXL5Jijau5rULF4e35Qo8SXRI6FaiezcZbFzqC/ChSzsSY6phGEd2REt
 Z/lXrpa4YhiFPNyJzRLCDeFp9vRHgMOwBng7eZWx2AOMhGGNOUp1ktgj4n2lsRf1
 9AxII/D+Dfdvrl1aicTRxpKEknywJw1x4RPcM9jTQfbEh22inp4f2fdwjNtK85vp
 uvStggBXvACHSz8pM7g1iifLsrOoXIuN7/BRrnw7yBUTz6rtCLAwsIpqr2H7qPTA
 ke+4EcxLNZWhii8pMG/q/bsOdDoaylVHfDkA/hai0tUpseGDm7Sf1LutFIi6i7CO
 aYSIIXFIFSx8JFbgqncmDwXoZwFGc/y4npDcd5NTUR8eNygX9ME=
 =wIpW
 -----END PGP SIGNATURE-----

Merge tag 'thead-dt-for-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux into soc/dt

T-HEAD Devicetrees for v6.19

Add PWM controlled fan and it's associated thermal management for the
Lichee Pi 4A board.

Enable additional ISA extenstions supported by the T-Head C910 cores:
Zfh, Ziccrse, XTheadvector.

Add reset controllers of more TH1520 subsystems: AP, AO, DSP, MISC, VI.

Signed-off-by: Drew Fustini <fustini@kernel.org>

* tag 'thead-dt-for-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/fustini/linux:
  riscv: dts: thead: Add reset controllers of more subsystems for TH1520
  riscv: dts: thead: Add PWM fan and thermal control
  riscv: dts: thead: Add PWM controller node
  riscv: dts: thead: add zfh for th1520
  riscv: dts: thead: add ziccrse for th1520
  riscv: dts: thead: add xtheadvector to the th1520 devicetree

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2025-11-21 16:35:57 +01:00
commit 7e90eede6b
2 changed files with 131 additions and 8 deletions

View File

@ -28,9 +28,76 @@ aliases {
chosen {
stdout-path = "serial0:115200n8";
};
thermal-zones {
cpu-thermal {
polling-delay = <1000>;
polling-delay-passive = <1000>;
thermal-sensors = <&pvt 0>;
trips {
fan_config0: fan-trip0 {
temperature = <39000>;
hysteresis = <5000>;
type = "active";
};
fan_config1: fan-trip1 {
temperature = <50000>;
hysteresis = <5000>;
type = "active";
};
fan_config2: fan-trip2 {
temperature = <60000>;
hysteresis = <5000>;
type = "active";
};
};
cooling-maps {
map-active-0 {
cooling-device = <&fan 1 1>;
trip = <&fan_config0>;
};
map-active-1 {
cooling-device = <&fan 2 2>;
trip = <&fan_config1>;
};
map-active-2 {
cooling-device = <&fan 3 3>;
trip = <&fan_config2>;
};
};
};
};
fan: pwm-fan {
pinctrl-names = "default";
pinctrl-0 = <&fan_pins>;
compatible = "pwm-fan";
#cooling-cells = <2>;
pwms = <&pwm 1 10000000 0>;
cooling-levels = <0 66 196 255>;
};
};
&padctrl0_apsys {
fan_pins: fan-0 {
pwm1-pins {
pins = "GPIO3_3"; /* PWM1 */
function = "pwm";
bias-disable;
drive-strength = <25>;
input-disable;
input-schmitt-disable;
slew-rate = <0>;
};
};
uart0_pins: uart0-0 {
tx-pins {
pins = "UART0_TXD";

View File

@ -24,8 +24,11 @@ c910_0: cpu@0 {
device_type = "cpu";
riscv,isa = "rv64imafdc";
riscv,isa-base = "rv64i";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
"zifencei", "zihpm";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
"ziccrse", "zicntr", "zicsr",
"zifencei", "zihpm", "zfh",
"xtheadvector";
thead,vlenb = <16>;
reg = <0>;
i-cache-block-size = <64>;
i-cache-size = <65536>;
@ -48,8 +51,11 @@ c910_1: cpu@1 {
device_type = "cpu";
riscv,isa = "rv64imafdc";
riscv,isa-base = "rv64i";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
"zifencei", "zihpm";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
"ziccrse", "zicntr", "zicsr",
"zifencei", "zihpm", "zfh",
"xtheadvector";
thead,vlenb = <16>;
reg = <1>;
i-cache-block-size = <64>;
i-cache-size = <65536>;
@ -72,8 +78,11 @@ c910_2: cpu@2 {
device_type = "cpu";
riscv,isa = "rv64imafdc";
riscv,isa-base = "rv64i";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
"zifencei", "zihpm";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
"ziccrse", "zicntr", "zicsr",
"zifencei", "zihpm", "zfh",
"xtheadvector";
thead,vlenb = <16>;
reg = <2>;
i-cache-block-size = <64>;
i-cache-size = <65536>;
@ -96,8 +105,11 @@ c910_3: cpu@3 {
device_type = "cpu";
riscv,isa = "rv64imafdc";
riscv,isa-base = "rv64i";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr",
"zifencei", "zihpm";
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
"ziccrse", "zicntr", "zicsr",
"zifencei", "zihpm", "zfh",
"xtheadvector";
thead,vlenb = <16>;
reg = <3>;
i-cache-block-size = <64>;
i-cache-size = <65536>;
@ -277,6 +289,12 @@ clint: timer@ffdc000000 {
<&cpu3_intc 3>, <&cpu3_intc 7>;
};
rst_vi: reset-controller@ffe4040100 {
compatible = "thead,th1520-reset-vi";
reg = <0xff 0xe4040100 0x0 0x8>;
#reset-cells = <1>;
};
spi0: spi@ffe700c000 {
compatible = "thead,th1520-spi", "snps,dw-apb-ssi";
reg = <0xff 0xe700c000 0x0 0x1000>;
@ -502,6 +520,25 @@ uart2: serial@ffec010000 {
status = "disabled";
};
pwm: pwm@ffec01c000 {
compatible = "thead,th1520-pwm";
reg = <0xff 0xec01c000 0x0 0x4000>;
clocks = <&clk CLK_PWM>;
#pwm-cells = <3>;
};
rst_misc: reset-controller@ffec02c000 {
compatible = "thead,th1520-reset-misc";
reg = <0xff 0xec02c000 0x0 0x18>;
#reset-cells = <1>;
};
rst_vp: reset-controller@ffecc30000 {
compatible = "thead,th1520-reset-vp";
reg = <0xff 0xecc30000 0x0 0x14>;
#reset-cells = <1>;
};
clk: clock-controller@ffef010000 {
compatible = "thead,th1520-clk-ap";
reg = <0xff 0xef010000 0x0 0x1000>;
@ -509,6 +546,18 @@ clk: clock-controller@ffef010000 {
#clock-cells = <1>;
};
rst_ap: reset-controller@ffef014000 {
compatible = "thead,th1520-reset-ap";
reg = <0xff 0xef014000 0x0 0x1000>;
#reset-cells = <1>;
};
rst_dsp: reset-controller@ffef040028 {
compatible = "thead,th1520-reset-dsp";
reg = <0xff 0xef040028 0x0 0x4>;
#reset-cells = <1>;
};
gpu: gpu@ffef400000 {
compatible = "thead,th1520-gpu", "img,img-bxm-4-64",
"img,img-rogue";
@ -681,6 +730,13 @@ aogpio: gpio-controller@0 {
};
};
rst_ao: reset-controller@fffff44000 {
compatible = "thead,th1520-reset-ao";
reg = <0xff 0xfff44000 0x0 0x2000>;
#reset-cells = <1>;
status = "reserved";
};
padctrl_aosys: pinctrl@fffff4a000 {
compatible = "thead,th1520-pinctrl";
reg = <0xff 0xfff4a000 0x0 0x2000>;