18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
28c2ecf20Sopenharmony_ci// Copyright (C) 2016 ARM Ltd.
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#include <arm/sunxi-h3-h5.dtsi>
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#include <dt-bindings/thermal/thermal.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/ {
98c2ecf20Sopenharmony_ci	cpus {
108c2ecf20Sopenharmony_ci		#address-cells = <1>;
118c2ecf20Sopenharmony_ci		#size-cells = <0>;
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci		cpu0: cpu@0 {
148c2ecf20Sopenharmony_ci			compatible = "arm,cortex-a53";
158c2ecf20Sopenharmony_ci			device_type = "cpu";
168c2ecf20Sopenharmony_ci			reg = <0>;
178c2ecf20Sopenharmony_ci			enable-method = "psci";
188c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_CPUX>;
198c2ecf20Sopenharmony_ci			clock-latency-ns = <244144>; /* 8 32k periods */
208c2ecf20Sopenharmony_ci			#cooling-cells = <2>;
218c2ecf20Sopenharmony_ci		};
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci		cpu1: cpu@1 {
248c2ecf20Sopenharmony_ci			compatible = "arm,cortex-a53";
258c2ecf20Sopenharmony_ci			device_type = "cpu";
268c2ecf20Sopenharmony_ci			reg = <1>;
278c2ecf20Sopenharmony_ci			enable-method = "psci";
288c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_CPUX>;
298c2ecf20Sopenharmony_ci			clock-latency-ns = <244144>; /* 8 32k periods */
308c2ecf20Sopenharmony_ci			#cooling-cells = <2>;
318c2ecf20Sopenharmony_ci		};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci		cpu2: cpu@2 {
348c2ecf20Sopenharmony_ci			compatible = "arm,cortex-a53";
358c2ecf20Sopenharmony_ci			device_type = "cpu";
368c2ecf20Sopenharmony_ci			reg = <2>;
378c2ecf20Sopenharmony_ci			enable-method = "psci";
388c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_CPUX>;
398c2ecf20Sopenharmony_ci			clock-latency-ns = <244144>; /* 8 32k periods */
408c2ecf20Sopenharmony_ci			#cooling-cells = <2>;
418c2ecf20Sopenharmony_ci		};
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci		cpu3: cpu@3 {
448c2ecf20Sopenharmony_ci			compatible = "arm,cortex-a53";
458c2ecf20Sopenharmony_ci			device_type = "cpu";
468c2ecf20Sopenharmony_ci			reg = <3>;
478c2ecf20Sopenharmony_ci			enable-method = "psci";
488c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_CPUX>;
498c2ecf20Sopenharmony_ci			clock-latency-ns = <244144>; /* 8 32k periods */
508c2ecf20Sopenharmony_ci			#cooling-cells = <2>;
518c2ecf20Sopenharmony_ci		};
528c2ecf20Sopenharmony_ci	};
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci	pmu {
558c2ecf20Sopenharmony_ci		compatible = "arm,cortex-a53-pmu";
568c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
578c2ecf20Sopenharmony_ci			     <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
588c2ecf20Sopenharmony_ci			     <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
598c2ecf20Sopenharmony_ci			     <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
608c2ecf20Sopenharmony_ci		interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
618c2ecf20Sopenharmony_ci	};
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	psci {
648c2ecf20Sopenharmony_ci		compatible = "arm,psci-0.2";
658c2ecf20Sopenharmony_ci		method = "smc";
668c2ecf20Sopenharmony_ci	};
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci	timer {
698c2ecf20Sopenharmony_ci		compatible = "arm,armv8-timer";
708c2ecf20Sopenharmony_ci		arm,no-tick-in-suspend;
718c2ecf20Sopenharmony_ci		interrupts = <GIC_PPI 13
728c2ecf20Sopenharmony_ci				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
738c2ecf20Sopenharmony_ci			     <GIC_PPI 14
748c2ecf20Sopenharmony_ci				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
758c2ecf20Sopenharmony_ci			     <GIC_PPI 11
768c2ecf20Sopenharmony_ci				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
778c2ecf20Sopenharmony_ci			     <GIC_PPI 10
788c2ecf20Sopenharmony_ci				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
798c2ecf20Sopenharmony_ci	};
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci	soc {
828c2ecf20Sopenharmony_ci		syscon: system-control@1c00000 {
838c2ecf20Sopenharmony_ci			compatible = "allwinner,sun50i-h5-system-control";
848c2ecf20Sopenharmony_ci			reg = <0x01c00000 0x1000>;
858c2ecf20Sopenharmony_ci			#address-cells = <1>;
868c2ecf20Sopenharmony_ci			#size-cells = <1>;
878c2ecf20Sopenharmony_ci			ranges;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci			sram_c1: sram@18000 {
908c2ecf20Sopenharmony_ci				compatible = "mmio-sram";
918c2ecf20Sopenharmony_ci				reg = <0x00018000 0x1c000>;
928c2ecf20Sopenharmony_ci				#address-cells = <1>;
938c2ecf20Sopenharmony_ci				#size-cells = <1>;
948c2ecf20Sopenharmony_ci				ranges = <0 0x00018000 0x1c000>;
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci				ve_sram: sram-section@0 {
978c2ecf20Sopenharmony_ci					compatible = "allwinner,sun50i-h5-sram-c1",
988c2ecf20Sopenharmony_ci						     "allwinner,sun4i-a10-sram-c1";
998c2ecf20Sopenharmony_ci					reg = <0x000000 0x1c000>;
1008c2ecf20Sopenharmony_ci				};
1018c2ecf20Sopenharmony_ci			};
1028c2ecf20Sopenharmony_ci		};
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci		video-codec@1c0e000 {
1058c2ecf20Sopenharmony_ci			compatible = "allwinner,sun50i-h5-video-engine";
1068c2ecf20Sopenharmony_ci			reg = <0x01c0e000 0x1000>;
1078c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
1088c2ecf20Sopenharmony_ci				 <&ccu CLK_DRAM_VE>;
1098c2ecf20Sopenharmony_ci			clock-names = "ahb", "mod", "ram";
1108c2ecf20Sopenharmony_ci			resets = <&ccu RST_BUS_VE>;
1118c2ecf20Sopenharmony_ci			interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
1128c2ecf20Sopenharmony_ci			allwinner,sram = <&ve_sram 1>;
1138c2ecf20Sopenharmony_ci		};
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci		crypto: crypto@1c15000 {
1168c2ecf20Sopenharmony_ci			compatible = "allwinner,sun50i-h5-crypto";
1178c2ecf20Sopenharmony_ci			reg = <0x01c15000 0x1000>;
1188c2ecf20Sopenharmony_ci			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
1198c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_BUS_CE>, <&ccu CLK_CE>;
1208c2ecf20Sopenharmony_ci			clock-names = "bus", "mod";
1218c2ecf20Sopenharmony_ci			resets = <&ccu RST_BUS_CE>;
1228c2ecf20Sopenharmony_ci		};
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci		mali: gpu@1e80000 {
1258c2ecf20Sopenharmony_ci			compatible = "allwinner,sun50i-h5-mali", "arm,mali-450";
1268c2ecf20Sopenharmony_ci			reg = <0x01e80000 0x30000>;
1278c2ecf20Sopenharmony_ci			/*
1288c2ecf20Sopenharmony_ci			 * While the datasheet lists an interrupt for the
1298c2ecf20Sopenharmony_ci			 * PMU, the actual silicon does not have the PMU
1308c2ecf20Sopenharmony_ci			 * block. Reads all return zero, and writes are
1318c2ecf20Sopenharmony_ci			 * ignored.
1328c2ecf20Sopenharmony_ci			 */
1338c2ecf20Sopenharmony_ci			interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
1348c2ecf20Sopenharmony_ci				     <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
1358c2ecf20Sopenharmony_ci				     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
1368c2ecf20Sopenharmony_ci				     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
1378c2ecf20Sopenharmony_ci				     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
1388c2ecf20Sopenharmony_ci				     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
1398c2ecf20Sopenharmony_ci				     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
1408c2ecf20Sopenharmony_ci				     <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
1418c2ecf20Sopenharmony_ci				     <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
1428c2ecf20Sopenharmony_ci				     <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
1438c2ecf20Sopenharmony_ci				     <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
1448c2ecf20Sopenharmony_ci			interrupt-names = "gp",
1458c2ecf20Sopenharmony_ci					  "gpmmu",
1468c2ecf20Sopenharmony_ci					  "pp",
1478c2ecf20Sopenharmony_ci					  "pp0",
1488c2ecf20Sopenharmony_ci					  "ppmmu0",
1498c2ecf20Sopenharmony_ci					  "pp1",
1508c2ecf20Sopenharmony_ci					  "ppmmu1",
1518c2ecf20Sopenharmony_ci					  "pp2",
1528c2ecf20Sopenharmony_ci					  "ppmmu2",
1538c2ecf20Sopenharmony_ci					  "pp3",
1548c2ecf20Sopenharmony_ci					  "ppmmu3";
1558c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
1568c2ecf20Sopenharmony_ci			clock-names = "bus", "core";
1578c2ecf20Sopenharmony_ci			resets = <&ccu RST_BUS_GPU>;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci			assigned-clocks = <&ccu CLK_GPU>;
1608c2ecf20Sopenharmony_ci			assigned-clock-rates = <384000000>;
1618c2ecf20Sopenharmony_ci		};
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci		ths: thermal-sensor@1c25000 {
1648c2ecf20Sopenharmony_ci			compatible = "allwinner,sun50i-h5-ths";
1658c2ecf20Sopenharmony_ci			reg = <0x01c25000 0x400>;
1668c2ecf20Sopenharmony_ci			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
1678c2ecf20Sopenharmony_ci			resets = <&ccu RST_BUS_THS>;
1688c2ecf20Sopenharmony_ci			clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
1698c2ecf20Sopenharmony_ci			clock-names = "bus", "mod";
1708c2ecf20Sopenharmony_ci			nvmem-cells = <&ths_calibration>;
1718c2ecf20Sopenharmony_ci			nvmem-cell-names = "calibration";
1728c2ecf20Sopenharmony_ci			#thermal-sensor-cells = <1>;
1738c2ecf20Sopenharmony_ci		};
1748c2ecf20Sopenharmony_ci	};
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	thermal-zones {
1778c2ecf20Sopenharmony_ci		cpu_thermal: cpu-thermal {
1788c2ecf20Sopenharmony_ci			polling-delay-passive = <0>;
1798c2ecf20Sopenharmony_ci			polling-delay = <0>;
1808c2ecf20Sopenharmony_ci			thermal-sensors = <&ths 0>;
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci			trips {
1838c2ecf20Sopenharmony_ci				cpu_hot_trip: cpu-hot {
1848c2ecf20Sopenharmony_ci					temperature = <80000>;
1858c2ecf20Sopenharmony_ci					hysteresis = <2000>;
1868c2ecf20Sopenharmony_ci					type = "passive";
1878c2ecf20Sopenharmony_ci				};
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci				cpu_very_hot_trip: cpu-very-hot {
1908c2ecf20Sopenharmony_ci					temperature = <100000>;
1918c2ecf20Sopenharmony_ci					hysteresis = <0>;
1928c2ecf20Sopenharmony_ci					type = "critical";
1938c2ecf20Sopenharmony_ci				};
1948c2ecf20Sopenharmony_ci			};
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci			cooling-maps {
1978c2ecf20Sopenharmony_ci				cpu-hot-limit {
1988c2ecf20Sopenharmony_ci					trip = <&cpu_hot_trip>;
1998c2ecf20Sopenharmony_ci					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
2008c2ecf20Sopenharmony_ci							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
2018c2ecf20Sopenharmony_ci							 <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
2028c2ecf20Sopenharmony_ci							 <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
2038c2ecf20Sopenharmony_ci				};
2048c2ecf20Sopenharmony_ci			};
2058c2ecf20Sopenharmony_ci		};
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci		gpu-thermal {
2088c2ecf20Sopenharmony_ci			polling-delay-passive = <0>;
2098c2ecf20Sopenharmony_ci			polling-delay = <0>;
2108c2ecf20Sopenharmony_ci			thermal-sensors = <&ths 1>;
2118c2ecf20Sopenharmony_ci		};
2128c2ecf20Sopenharmony_ci	};
2138c2ecf20Sopenharmony_ci};
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_ci&ccu {
2168c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-ccu";
2178c2ecf20Sopenharmony_ci};
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci&display_clocks {
2208c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-de2-clk";
2218c2ecf20Sopenharmony_ci};
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci&mmc0 {
2248c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-mmc",
2258c2ecf20Sopenharmony_ci		     "allwinner,sun50i-a64-mmc";
2268c2ecf20Sopenharmony_ci	clocks = <&ccu CLK_BUS_MMC0>, <&ccu CLK_MMC0>;
2278c2ecf20Sopenharmony_ci	clock-names = "ahb", "mmc";
2288c2ecf20Sopenharmony_ci};
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci&mmc1 {
2318c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-mmc",
2328c2ecf20Sopenharmony_ci		     "allwinner,sun50i-a64-mmc";
2338c2ecf20Sopenharmony_ci	clocks = <&ccu CLK_BUS_MMC1>, <&ccu CLK_MMC1>;
2348c2ecf20Sopenharmony_ci	clock-names = "ahb", "mmc";
2358c2ecf20Sopenharmony_ci};
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci&mmc2 {
2388c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-emmc",
2398c2ecf20Sopenharmony_ci		     "allwinner,sun50i-a64-emmc";
2408c2ecf20Sopenharmony_ci	clocks = <&ccu CLK_BUS_MMC2>, <&ccu CLK_MMC2>;
2418c2ecf20Sopenharmony_ci	clock-names = "ahb", "mmc";
2428c2ecf20Sopenharmony_ci};
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci&pio {
2458c2ecf20Sopenharmony_ci	interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
2468c2ecf20Sopenharmony_ci		     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
2478c2ecf20Sopenharmony_ci		     <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
2488c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-pinctrl";
2498c2ecf20Sopenharmony_ci};
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci&rtc {
2528c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-rtc";
2538c2ecf20Sopenharmony_ci};
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_ci&sid {
2568c2ecf20Sopenharmony_ci	compatible = "allwinner,sun50i-h5-sid";
2578c2ecf20Sopenharmony_ci};
258