1062b9b66SKrzysztof Kozlowski// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2077e5f4fSSamuel Holland// Copyright (C) 2021-2022 Samuel Holland <samuel@sholland.org> 3077e5f4fSSamuel Holland 4077e5f4fSSamuel Holland#define SOC_PERIPHERAL_IRQ(nr) (nr + 16) 5077e5f4fSSamuel Holland 6077e5f4fSSamuel Holland#include "sunxi-d1s-t113.dtsi" 7077e5f4fSSamuel Holland 8077e5f4fSSamuel Holland/ { 9077e5f4fSSamuel Holland cpus { 10077e5f4fSSamuel Holland timebase-frequency = <24000000>; 11077e5f4fSSamuel Holland #address-cells = <1>; 12077e5f4fSSamuel Holland #size-cells = <0>; 13077e5f4fSSamuel Holland 14077e5f4fSSamuel Holland cpu0: cpu@0 { 15077e5f4fSSamuel Holland compatible = "thead,c906", "riscv"; 16077e5f4fSSamuel Holland device_type = "cpu"; 17077e5f4fSSamuel Holland reg = <0>; 18077e5f4fSSamuel Holland clocks = <&ccu CLK_RISCV>; 19077e5f4fSSamuel Holland d-cache-block-size = <64>; 20077e5f4fSSamuel Holland d-cache-sets = <256>; 21077e5f4fSSamuel Holland d-cache-size = <32768>; 22077e5f4fSSamuel Holland i-cache-block-size = <64>; 23077e5f4fSSamuel Holland i-cache-sets = <128>; 24077e5f4fSSamuel Holland i-cache-size = <32768>; 25077e5f4fSSamuel Holland mmu-type = "riscv,sv39"; 26077e5f4fSSamuel Holland operating-points-v2 = <&opp_table_cpu>; 27077e5f4fSSamuel Holland riscv,isa = "rv64imafdc"; 28077e5f4fSSamuel Holland #cooling-cells = <2>; 29077e5f4fSSamuel Holland 30077e5f4fSSamuel Holland cpu0_intc: interrupt-controller { 31077e5f4fSSamuel Holland compatible = "riscv,cpu-intc"; 32077e5f4fSSamuel Holland interrupt-controller; 33077e5f4fSSamuel Holland #interrupt-cells = <1>; 34077e5f4fSSamuel Holland }; 35077e5f4fSSamuel Holland }; 36077e5f4fSSamuel Holland }; 37077e5f4fSSamuel Holland 38077e5f4fSSamuel Holland opp_table_cpu: opp-table-cpu { 39077e5f4fSSamuel Holland compatible = "operating-points-v2"; 40077e5f4fSSamuel Holland 41077e5f4fSSamuel Holland opp-408000000 { 42077e5f4fSSamuel Holland opp-hz = /bits/ 64 <408000000>; 43077e5f4fSSamuel Holland opp-microvolt = <900000 900000 1100000>; 44077e5f4fSSamuel Holland }; 45077e5f4fSSamuel Holland 46077e5f4fSSamuel Holland opp-1080000000 { 47077e5f4fSSamuel Holland opp-hz = /bits/ 64 <1008000000>; 48077e5f4fSSamuel Holland opp-microvolt = <900000 900000 1100000>; 49077e5f4fSSamuel Holland }; 50077e5f4fSSamuel Holland }; 51077e5f4fSSamuel Holland 52077e5f4fSSamuel Holland soc { 53077e5f4fSSamuel Holland interrupt-parent = <&plic>; 54077e5f4fSSamuel Holland 55077e5f4fSSamuel Holland riscv_wdt: watchdog@6011000 { 56077e5f4fSSamuel Holland compatible = "allwinner,sun20i-d1-wdt"; 57077e5f4fSSamuel Holland reg = <0x6011000 0x20>; 58077e5f4fSSamuel Holland interrupts = <SOC_PERIPHERAL_IRQ(131) IRQ_TYPE_LEVEL_HIGH>; 59077e5f4fSSamuel Holland clocks = <&dcxo>, <&rtc CLK_OSC32K>; 60077e5f4fSSamuel Holland clock-names = "hosc", "losc"; 61077e5f4fSSamuel Holland }; 62077e5f4fSSamuel Holland 63077e5f4fSSamuel Holland plic: interrupt-controller@10000000 { 64077e5f4fSSamuel Holland compatible = "allwinner,sun20i-d1-plic", 65077e5f4fSSamuel Holland "thead,c900-plic"; 66077e5f4fSSamuel Holland reg = <0x10000000 0x4000000>; 67077e5f4fSSamuel Holland interrupts-extended = <&cpu0_intc 11>, 68077e5f4fSSamuel Holland <&cpu0_intc 9>; 69077e5f4fSSamuel Holland interrupt-controller; 70077e5f4fSSamuel Holland riscv,ndev = <175>; 71077e5f4fSSamuel Holland #address-cells = <0>; 72077e5f4fSSamuel Holland #interrupt-cells = <2>; 73077e5f4fSSamuel Holland }; 74077e5f4fSSamuel Holland }; 75*b3eaec07SInochi Amaoto 76*b3eaec07SInochi Amaoto pmu { 77*b3eaec07SInochi Amaoto compatible = "riscv,pmu"; 78*b3eaec07SInochi Amaoto riscv,event-to-mhpmcounters = 79*b3eaec07SInochi Amaoto <0x00003 0x00003 0x00000008>, 80*b3eaec07SInochi Amaoto <0x00004 0x00004 0x00000010>, 81*b3eaec07SInochi Amaoto <0x00005 0x00005 0x00000200>, 82*b3eaec07SInochi Amaoto <0x00006 0x00006 0x00000100>, 83*b3eaec07SInochi Amaoto <0x10000 0x10000 0x00004000>, 84*b3eaec07SInochi Amaoto <0x10001 0x10001 0x00008000>, 85*b3eaec07SInochi Amaoto <0x10002 0x10002 0x00010000>, 86*b3eaec07SInochi Amaoto <0x10003 0x10003 0x00020000>, 87*b3eaec07SInochi Amaoto <0x10019 0x10019 0x00000040>, 88*b3eaec07SInochi Amaoto <0x10021 0x10021 0x00000020>; 89*b3eaec07SInochi Amaoto riscv,event-to-mhpmevent = 90*b3eaec07SInochi Amaoto <0x00003 0x00000000 0x00000001>, 91*b3eaec07SInochi Amaoto <0x00004 0x00000000 0x00000002>, 92*b3eaec07SInochi Amaoto <0x00005 0x00000000 0x00000007>, 93*b3eaec07SInochi Amaoto <0x00006 0x00000000 0x00000006>, 94*b3eaec07SInochi Amaoto <0x10000 0x00000000 0x0000000c>, 95*b3eaec07SInochi Amaoto <0x10001 0x00000000 0x0000000d>, 96*b3eaec07SInochi Amaoto <0x10002 0x00000000 0x0000000e>, 97*b3eaec07SInochi Amaoto <0x10003 0x00000000 0x0000000f>, 98*b3eaec07SInochi Amaoto <0x10019 0x00000000 0x00000004>, 99*b3eaec07SInochi Amaoto <0x10021 0x00000000 0x00000003>; 100*b3eaec07SInochi Amaoto riscv,raw-event-to-mhpmcounters = 101*b3eaec07SInochi Amaoto <0x00000000 0x00000001 0xffffffff 0xffffffff 0x00000008>, 102*b3eaec07SInochi Amaoto <0x00000000 0x00000002 0xffffffff 0xffffffff 0x00000010>, 103*b3eaec07SInochi Amaoto <0x00000000 0x00000003 0xffffffff 0xffffffff 0x00000020>, 104*b3eaec07SInochi Amaoto <0x00000000 0x00000004 0xffffffff 0xffffffff 0x00000040>, 105*b3eaec07SInochi Amaoto <0x00000000 0x00000005 0xffffffff 0xffffffff 0x00000080>, 106*b3eaec07SInochi Amaoto <0x00000000 0x00000006 0xffffffff 0xffffffff 0x00000100>, 107*b3eaec07SInochi Amaoto <0x00000000 0x00000007 0xffffffff 0xffffffff 0x00000200>, 108*b3eaec07SInochi Amaoto <0x00000000 0x0000000b 0xffffffff 0xffffffff 0x00002000>, 109*b3eaec07SInochi Amaoto <0x00000000 0x0000000c 0xffffffff 0xffffffff 0x00004000>, 110*b3eaec07SInochi Amaoto <0x00000000 0x0000000d 0xffffffff 0xffffffff 0x00008000>, 111*b3eaec07SInochi Amaoto <0x00000000 0x0000000e 0xffffffff 0xffffffff 0x00010000>, 112*b3eaec07SInochi Amaoto <0x00000000 0x0000000f 0xffffffff 0xffffffff 0x00020000>; 113*b3eaec07SInochi Amaoto }; 114077e5f4fSSamuel Holland}; 115