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"; 28*c3f7c148SConor Dooley riscv,isa-base = "rv64i"; 29*c3f7c148SConor Dooley riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", 30*c3f7c148SConor Dooley "zifencei", "zihpm"; 31077e5f4fSSamuel Holland #cooling-cells = <2>; 32077e5f4fSSamuel Holland 33077e5f4fSSamuel Holland cpu0_intc: interrupt-controller { 34077e5f4fSSamuel Holland compatible = "riscv,cpu-intc"; 35077e5f4fSSamuel Holland interrupt-controller; 36077e5f4fSSamuel Holland #interrupt-cells = <1>; 37077e5f4fSSamuel Holland }; 38077e5f4fSSamuel Holland }; 39077e5f4fSSamuel Holland }; 40077e5f4fSSamuel Holland 41077e5f4fSSamuel Holland opp_table_cpu: opp-table-cpu { 42077e5f4fSSamuel Holland compatible = "operating-points-v2"; 43077e5f4fSSamuel Holland 44077e5f4fSSamuel Holland opp-408000000 { 45077e5f4fSSamuel Holland opp-hz = /bits/ 64 <408000000>; 46077e5f4fSSamuel Holland opp-microvolt = <900000 900000 1100000>; 47077e5f4fSSamuel Holland }; 48077e5f4fSSamuel Holland 49077e5f4fSSamuel Holland opp-1080000000 { 50077e5f4fSSamuel Holland opp-hz = /bits/ 64 <1008000000>; 51077e5f4fSSamuel Holland opp-microvolt = <900000 900000 1100000>; 52077e5f4fSSamuel Holland }; 53077e5f4fSSamuel Holland }; 54077e5f4fSSamuel Holland 55077e5f4fSSamuel Holland soc { 56077e5f4fSSamuel Holland interrupt-parent = <&plic>; 57077e5f4fSSamuel Holland 58077e5f4fSSamuel Holland riscv_wdt: watchdog@6011000 { 59077e5f4fSSamuel Holland compatible = "allwinner,sun20i-d1-wdt"; 60077e5f4fSSamuel Holland reg = <0x6011000 0x20>; 61077e5f4fSSamuel Holland interrupts = <SOC_PERIPHERAL_IRQ(131) IRQ_TYPE_LEVEL_HIGH>; 62077e5f4fSSamuel Holland clocks = <&dcxo>, <&rtc CLK_OSC32K>; 63077e5f4fSSamuel Holland clock-names = "hosc", "losc"; 64077e5f4fSSamuel Holland }; 65077e5f4fSSamuel Holland 66077e5f4fSSamuel Holland plic: interrupt-controller@10000000 { 67077e5f4fSSamuel Holland compatible = "allwinner,sun20i-d1-plic", 68077e5f4fSSamuel Holland "thead,c900-plic"; 69077e5f4fSSamuel Holland reg = <0x10000000 0x4000000>; 70077e5f4fSSamuel Holland interrupts-extended = <&cpu0_intc 11>, 71077e5f4fSSamuel Holland <&cpu0_intc 9>; 72077e5f4fSSamuel Holland interrupt-controller; 73077e5f4fSSamuel Holland riscv,ndev = <175>; 74077e5f4fSSamuel Holland #address-cells = <0>; 75077e5f4fSSamuel Holland #interrupt-cells = <2>; 76077e5f4fSSamuel Holland }; 77077e5f4fSSamuel Holland }; 78b3eaec07SInochi Amaoto 79b3eaec07SInochi Amaoto pmu { 80b3eaec07SInochi Amaoto compatible = "riscv,pmu"; 81b3eaec07SInochi Amaoto riscv,event-to-mhpmcounters = 82b3eaec07SInochi Amaoto <0x00003 0x00003 0x00000008>, 83b3eaec07SInochi Amaoto <0x00004 0x00004 0x00000010>, 84b3eaec07SInochi Amaoto <0x00005 0x00005 0x00000200>, 85b3eaec07SInochi Amaoto <0x00006 0x00006 0x00000100>, 86b3eaec07SInochi Amaoto <0x10000 0x10000 0x00004000>, 87b3eaec07SInochi Amaoto <0x10001 0x10001 0x00008000>, 88b3eaec07SInochi Amaoto <0x10002 0x10002 0x00010000>, 89b3eaec07SInochi Amaoto <0x10003 0x10003 0x00020000>, 90b3eaec07SInochi Amaoto <0x10019 0x10019 0x00000040>, 91b3eaec07SInochi Amaoto <0x10021 0x10021 0x00000020>; 92b3eaec07SInochi Amaoto riscv,event-to-mhpmevent = 93b3eaec07SInochi Amaoto <0x00003 0x00000000 0x00000001>, 94b3eaec07SInochi Amaoto <0x00004 0x00000000 0x00000002>, 95b3eaec07SInochi Amaoto <0x00005 0x00000000 0x00000007>, 96b3eaec07SInochi Amaoto <0x00006 0x00000000 0x00000006>, 97b3eaec07SInochi Amaoto <0x10000 0x00000000 0x0000000c>, 98b3eaec07SInochi Amaoto <0x10001 0x00000000 0x0000000d>, 99b3eaec07SInochi Amaoto <0x10002 0x00000000 0x0000000e>, 100b3eaec07SInochi Amaoto <0x10003 0x00000000 0x0000000f>, 101b3eaec07SInochi Amaoto <0x10019 0x00000000 0x00000004>, 102b3eaec07SInochi Amaoto <0x10021 0x00000000 0x00000003>; 103b3eaec07SInochi Amaoto riscv,raw-event-to-mhpmcounters = 104b3eaec07SInochi Amaoto <0x00000000 0x00000001 0xffffffff 0xffffffff 0x00000008>, 105b3eaec07SInochi Amaoto <0x00000000 0x00000002 0xffffffff 0xffffffff 0x00000010>, 106b3eaec07SInochi Amaoto <0x00000000 0x00000003 0xffffffff 0xffffffff 0x00000020>, 107b3eaec07SInochi Amaoto <0x00000000 0x00000004 0xffffffff 0xffffffff 0x00000040>, 108b3eaec07SInochi Amaoto <0x00000000 0x00000005 0xffffffff 0xffffffff 0x00000080>, 109b3eaec07SInochi Amaoto <0x00000000 0x00000006 0xffffffff 0xffffffff 0x00000100>, 110b3eaec07SInochi Amaoto <0x00000000 0x00000007 0xffffffff 0xffffffff 0x00000200>, 111b3eaec07SInochi Amaoto <0x00000000 0x0000000b 0xffffffff 0xffffffff 0x00002000>, 112b3eaec07SInochi Amaoto <0x00000000 0x0000000c 0xffffffff 0xffffffff 0x00004000>, 113b3eaec07SInochi Amaoto <0x00000000 0x0000000d 0xffffffff 0xffffffff 0x00008000>, 114b3eaec07SInochi Amaoto <0x00000000 0x0000000e 0xffffffff 0xffffffff 0x00010000>, 115b3eaec07SInochi Amaoto <0x00000000 0x0000000f 0xffffffff 0xffffffff 0x00020000>; 116b3eaec07SInochi Amaoto }; 117077e5f4fSSamuel Holland}; 118