| 1 |
// SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 |
// Copyright (C) 2021-2022 Samuel Holland <[email protected]> |
| 3 |
|
| 4 |
#include <dt-bindings/thermal/thermal.h> |
| 5 |
|
| 6 |
#define SOC_PERIPHERAL_IRQ(nr) (nr + 16) |
| 7 |
|
| 8 |
#include "sunxi-d1s-t113.dtsi" |
| 9 |
|
| 10 |
/ { |
| 11 |
cpus { |
| 12 |
timebase-frequency = <24000000>; |
| 13 |
#address-cells = <1>; |
| 14 |
#size-cells = <0>; |
| 15 |
|
| 16 |
cpu0: cpu@0 { |
| 17 |
compatible = "thead,c906", "riscv"; |
| 18 |
device_type = "cpu"; |
| 19 |
reg = <0>; |
| 20 |
clocks = <&ccu CLK_RISCV>; |
| 21 |
d-cache-block-size = <64>; |
| 22 |
d-cache-sets = <256>; |
| 23 |
d-cache-size = <32768>; |
| 24 |
i-cache-block-size = <64>; |
| 25 |
i-cache-sets = <128>; |
| 26 |
i-cache-size = <32768>; |
| 27 |
mmu-type = "riscv,sv39"; |
| 28 |
operating-points-v2 = <&opp_table_cpu>; |
| 29 |
riscv,isa = "rv64imafdc"; |
| 30 |
riscv,isa-base = "rv64i"; |
| 31 |
riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", |
| 32 |
"zifencei", "zihpm", "xtheadvector"; |
| 33 |
thead,vlenb = <16>; |
| 34 |
#cooling-cells = <2>; |
| 35 |
|
| 36 |
cpu0_intc: interrupt-controller { |
| 37 |
compatible = "riscv,cpu-intc"; |
| 38 |
interrupt-controller; |
| 39 |
#interrupt-cells = <1>; |
| 40 |
}; |
| 41 |
}; |
| 42 |
}; |
| 43 |
|
| 44 |
opp_table_cpu: opp-table-cpu { |
| 45 |
compatible = "operating-points-v2"; |
| 46 |
|
| 47 |
opp-408000000 { |
| 48 |
opp-hz = /bits/ 64 <408000000>; |
| 49 |
opp-microvolt = <900000 900000 1100000>; |
| 50 |
}; |
| 51 |
|
| 52 |
opp-1080000000 { |
| 53 |
opp-hz = /bits/ 64 <1008000000>; |
| 54 |
opp-microvolt = <900000 900000 1100000>; |
| 55 |
}; |
| 56 |
}; |
| 57 |
|
| 58 |
soc { |
| 59 |
interrupt-parent = <&plic>; |
| 60 |
|
| 61 |
riscv_wdt: watchdog@6011000 { |
| 62 |
compatible = "allwinner,sun20i-d1-wdt"; |
| 63 |
reg = <0x6011000 0x20>; |
| 64 |
interrupts = <SOC_PERIPHERAL_IRQ(131) IRQ_TYPE_LEVEL_HIGH>; |
| 65 |
clocks = <&dcxo>, <&rtc CLK_OSC32K>; |
| 66 |
clock-names = "hosc", "losc"; |
| 67 |
}; |
| 68 |
|
| 69 |
plic: interrupt-controller@10000000 { |
| 70 |
compatible = "allwinner,sun20i-d1-plic", |
| 71 |
"thead,c900-plic"; |
| 72 |
reg = <0x10000000 0x4000000>; |
| 73 |
interrupts-extended = <&cpu0_intc 11>, |
| 74 |
<&cpu0_intc 9>; |
| 75 |
interrupt-controller; |
| 76 |
riscv,ndev = <175>; |
| 77 |
#address-cells = <0>; |
| 78 |
#interrupt-cells = <2>; |
| 79 |
}; |
| 80 |
}; |
| 81 |
|
| 82 |
pmu { |
| 83 |
compatible = "riscv,pmu"; |
| 84 |
riscv,event-to-mhpmcounters = |
| 85 |
<0x00003 0x00003 0x00000008>, |
| 86 |
<0x00004 0x00004 0x00000010>, |
| 87 |
<0x00005 0x00005 0x00000200>, |
| 88 |
<0x00006 0x00006 0x00000100>, |
| 89 |
<0x10000 0x10000 0x00004000>, |
| 90 |
<0x10001 0x10001 0x00008000>, |
| 91 |
<0x10002 0x10002 0x00010000>, |
| 92 |
<0x10003 0x10003 0x00020000>, |
| 93 |
<0x10019 0x10019 0x00000040>, |
| 94 |
<0x10021 0x10021 0x00000020>; |
| 95 |
riscv,event-to-mhpmevent = |
| 96 |
<0x00003 0x00000000 0x00000001>, |
| 97 |
<0x00004 0x00000000 0x00000002>, |
| 98 |
<0x00005 0x00000000 0x00000007>, |
| 99 |
<0x00006 0x00000000 0x00000006>, |
| 100 |
<0x10000 0x00000000 0x0000000c>, |
| 101 |
<0x10001 0x00000000 0x0000000d>, |
| 102 |
<0x10002 0x00000000 0x0000000e>, |
| 103 |
<0x10003 0x00000000 0x0000000f>, |
| 104 |
<0x10019 0x00000000 0x00000004>, |
| 105 |
<0x10021 0x00000000 0x00000003>; |
| 106 |
riscv,raw-event-to-mhpmcounters = |
| 107 |
<0x00000000 0x00000001 0xffffffff 0xffffffff 0x00000008>, |
| 108 |
<0x00000000 0x00000002 0xffffffff 0xffffffff 0x00000010>, |
| 109 |
<0x00000000 0x00000003 0xffffffff 0xffffffff 0x00000020>, |
| 110 |
<0x00000000 0x00000004 0xffffffff 0xffffffff 0x00000040>, |
| 111 |
<0x00000000 0x00000005 0xffffffff 0xffffffff 0x00000080>, |
| 112 |
<0x00000000 0x00000006 0xffffffff 0xffffffff 0x00000100>, |
| 113 |
<0x00000000 0x00000007 0xffffffff 0xffffffff 0x00000200>, |
| 114 |
<0x00000000 0x0000000b 0xffffffff 0xffffffff 0x00002000>, |
| 115 |
<0x00000000 0x0000000c 0xffffffff 0xffffffff 0x00004000>, |
| 116 |
<0x00000000 0x0000000d 0xffffffff 0xffffffff 0x00008000>, |
| 117 |
<0x00000000 0x0000000e 0xffffffff 0xffffffff 0x00010000>, |
| 118 |
<0x00000000 0x0000000f 0xffffffff 0xffffffff 0x00020000>; |
| 119 |
}; |
| 120 |
|
| 121 |
thermal-zones { |
| 122 |
cpu-thermal { |
| 123 |
polling-delay-passive = <0>; |
| 124 |
polling-delay = <0>; |
| 125 |
thermal-sensors = <&ths>; |
| 126 |
|
| 127 |
cooling-maps { |
| 128 |
map0 { |
| 129 |
trip = <&cpu_alert>; |
| 130 |
cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; |
| 131 |
}; |
| 132 |
}; |
| 133 |
|
| 134 |
trips { |
| 135 |
cpu_alert: cpu-alert { |
| 136 |
temperature = <85000>; |
| 137 |
hysteresis = <2000>; |
| 138 |
type = "passive"; |
| 139 |
}; |
| 140 |
|
| 141 |
cpu-crit { |
| 142 |
temperature = <100000>; |
| 143 |
hysteresis = <0>; |
| 144 |
type = "critical"; |
| 145 |
}; |
| 146 |
}; |
| 147 |
}; |
| 148 |
}; |
| 149 |
}; |