Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | %YAML 1.2 |
| 3 | --- |
| 4 | $id: http://devicetree.org/schemas/thermal/allwinner,sun8i-a83t-ths.yaml# |
| 5 | $schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 | |
| 7 | title: Allwinner SUN8I Thermal Controller |
| 8 | |
| 9 | maintainers: |
| 10 | - Vasily Khoruzhick <anarsoul@gmail.com> |
| 11 | - Yangtao Li <tiny.windzz@gmail.com> |
| 12 | |
| 13 | properties: |
| 14 | compatible: |
| 15 | enum: |
| 16 | - allwinner,sun8i-a83t-ths |
| 17 | - allwinner,sun8i-h3-ths |
| 18 | - allwinner,sun8i-r40-ths |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 19 | - allwinner,sun20i-d1-ths |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 20 | - allwinner,sun50i-a64-ths |
| 21 | - allwinner,sun50i-a100-ths |
| 22 | - allwinner,sun50i-h5-ths |
| 23 | - allwinner,sun50i-h6-ths |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 24 | - allwinner,sun50i-h616-ths |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 25 | |
| 26 | clocks: |
| 27 | minItems: 1 |
| 28 | items: |
| 29 | - description: Bus Clock |
| 30 | - description: Module Clock |
| 31 | |
| 32 | clock-names: |
| 33 | minItems: 1 |
| 34 | items: |
| 35 | - const: bus |
| 36 | - const: mod |
| 37 | |
| 38 | reg: |
| 39 | maxItems: 1 |
| 40 | |
| 41 | interrupts: |
| 42 | maxItems: 1 |
| 43 | |
| 44 | resets: |
| 45 | maxItems: 1 |
| 46 | |
| 47 | nvmem-cells: |
| 48 | maxItems: 1 |
| 49 | description: Calibration data for thermal sensors |
| 50 | |
| 51 | nvmem-cell-names: |
| 52 | const: calibration |
| 53 | |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 54 | allwinner,sram: |
| 55 | maxItems: 1 |
| 56 | description: phandle to device controlling temperate offset SYS_CFG register |
| 57 | |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 58 | # See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for details |
| 59 | "#thermal-sensor-cells": |
| 60 | enum: |
| 61 | - 0 |
| 62 | - 1 |
| 63 | |
| 64 | allOf: |
| 65 | - if: |
| 66 | properties: |
| 67 | compatible: |
| 68 | contains: |
| 69 | enum: |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 70 | - allwinner,sun20i-d1-ths |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 71 | - allwinner,sun50i-a100-ths |
| 72 | - allwinner,sun50i-h6-ths |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 73 | - allwinner,sun50i-h616-ths |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 74 | |
| 75 | then: |
| 76 | properties: |
| 77 | clocks: |
| 78 | maxItems: 1 |
| 79 | |
| 80 | clock-names: |
| 81 | maxItems: 1 |
| 82 | |
| 83 | else: |
| 84 | properties: |
| 85 | clocks: |
| 86 | minItems: 2 |
| 87 | |
| 88 | clock-names: |
| 89 | minItems: 2 |
| 90 | |
| 91 | - if: |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 92 | not: |
| 93 | properties: |
| 94 | compatible: |
| 95 | contains: |
| 96 | const: allwinner,sun50i-h616-ths |
| 97 | |
| 98 | then: |
| 99 | properties: |
| 100 | allwinner,sram: false |
| 101 | |
| 102 | - if: |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 103 | properties: |
| 104 | compatible: |
| 105 | contains: |
Tom Rini | 93743d2 | 2024-04-01 09:08:13 -0400 | [diff] [blame] | 106 | enum: |
| 107 | - allwinner,sun8i-h3-ths |
| 108 | - allwinner,sun20i-d1-ths |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 109 | |
| 110 | then: |
| 111 | properties: |
| 112 | "#thermal-sensor-cells": |
| 113 | const: 0 |
| 114 | |
| 115 | else: |
| 116 | properties: |
| 117 | "#thermal-sensor-cells": |
| 118 | const: 1 |
| 119 | |
| 120 | - if: |
Tom Rini | 6bb92fc | 2024-05-20 09:54:58 -0600 | [diff] [blame^] | 121 | not: |
| 122 | properties: |
| 123 | compatible: |
| 124 | contains: |
| 125 | enum: |
| 126 | - allwinner,sun8i-a83t-ths |
Tom Rini | 53633a8 | 2024-02-29 12:33:36 -0500 | [diff] [blame] | 127 | |
| 128 | then: |
| 129 | required: |
| 130 | - clocks |
| 131 | - clock-names |
| 132 | - resets |
| 133 | |
| 134 | required: |
| 135 | - compatible |
| 136 | - reg |
| 137 | - interrupts |
| 138 | - '#thermal-sensor-cells' |
| 139 | |
| 140 | additionalProperties: false |
| 141 | |
| 142 | examples: |
| 143 | - | |
| 144 | thermal-sensor@1f04000 { |
| 145 | compatible = "allwinner,sun8i-a83t-ths"; |
| 146 | reg = <0x01f04000 0x100>; |
| 147 | interrupts = <0 31 0>; |
| 148 | nvmem-cells = <&ths_calibration>; |
| 149 | nvmem-cell-names = "calibration"; |
| 150 | #thermal-sensor-cells = <1>; |
| 151 | }; |
| 152 | |
| 153 | - | |
| 154 | thermal-sensor@1c25000 { |
| 155 | compatible = "allwinner,sun8i-h3-ths"; |
| 156 | reg = <0x01c25000 0x400>; |
| 157 | clocks = <&ccu 0>, <&ccu 1>; |
| 158 | clock-names = "bus", "mod"; |
| 159 | resets = <&ccu 2>; |
| 160 | interrupts = <0 31 0>; |
| 161 | nvmem-cells = <&ths_calibration>; |
| 162 | nvmem-cell-names = "calibration"; |
| 163 | #thermal-sensor-cells = <0>; |
| 164 | }; |
| 165 | |
| 166 | - | |
| 167 | thermal-sensor@5070400 { |
| 168 | compatible = "allwinner,sun50i-h6-ths"; |
| 169 | reg = <0x05070400 0x100>; |
| 170 | clocks = <&ccu 0>; |
| 171 | clock-names = "bus"; |
| 172 | resets = <&ccu 2>; |
| 173 | interrupts = <0 15 0>; |
| 174 | nvmem-cells = <&ths_calibration>; |
| 175 | nvmem-cell-names = "calibration"; |
| 176 | #thermal-sensor-cells = <1>; |
| 177 | }; |
| 178 | |
| 179 | ... |