Junhui Liu | c489ccb | 2025-01-15 00:46:38 +0800 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0 OR MIT |
| 2 | /* |
| 3 | * Copyright (C) 2024 Yangyu Chen <cyy@cyyself.name> |
| 4 | * Copyright (C) 2025 Junhui Liu <junhui.liu@pigmoral.tech> |
| 5 | */ |
| 6 | |
| 7 | #include <dt-bindings/interrupt-controller/irq.h> |
| 8 | |
| 9 | / { |
| 10 | #address-cells = <2>; |
| 11 | #size-cells = <2>; |
| 12 | compatible = "canaan,kendryte-k230"; |
| 13 | |
| 14 | aliases { |
| 15 | serial0 = &uart0; |
| 16 | serial1 = &uart1; |
| 17 | serial2 = &uart2; |
| 18 | serial3 = &uart3; |
| 19 | serial4 = &uart4; |
| 20 | }; |
| 21 | |
| 22 | cpus { |
| 23 | #address-cells = <1>; |
| 24 | #size-cells = <0>; |
| 25 | timebase-frequency = <27000000>; |
| 26 | |
| 27 | cpu@0 { |
| 28 | compatible = "thead,c908", "riscv"; |
| 29 | device_type = "cpu"; |
| 30 | reg = <0>; |
| 31 | riscv,isa = "rv64imafdcv_zicbom_zicbop_zicboz_zfh_zba_zbb_zbc_zbs_zvfh_svpbmt"; |
| 32 | riscv,isa-base = "rv64i"; |
| 33 | riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "v", "zicbom", |
| 34 | "zicbop", "zicboz", "zicntr", "zicsr", "zifencei", |
| 35 | "zihpm", "zfh", "zba", "zbb", "zbc", "zbs", "zvfh", |
| 36 | "svpbmt"; |
| 37 | riscv,cbom-block-size = <64>; |
| 38 | riscv,cbop-block-size = <64>; |
| 39 | riscv,cboz-block-size = <64>; |
| 40 | mmu-type = "riscv,sv39"; |
| 41 | |
| 42 | cpu0_intc: interrupt-controller { |
| 43 | compatible = "riscv,cpu-intc"; |
| 44 | interrupt-controller; |
| 45 | #interrupt-cells = <1>; |
| 46 | }; |
| 47 | }; |
| 48 | }; |
| 49 | |
| 50 | apb_clk: apb-clk-clock { |
| 51 | compatible = "fixed-clock"; |
| 52 | clock-frequency = <50000000>; |
| 53 | clock-output-names = "apb_clk"; |
| 54 | #clock-cells = <0>; |
| 55 | }; |
| 56 | |
| 57 | clk_dummy: clock-dummy { |
| 58 | compatible = "fixed-clock"; |
| 59 | clock-frequency = <0>; |
| 60 | clock-output-names = "clk_dummy"; |
| 61 | #clock-cells = <0>; |
| 62 | }; |
| 63 | |
| 64 | reboot: syscon-reboot { |
| 65 | compatible = "syscon-reboot"; |
| 66 | regmap = <&bootctl>; |
| 67 | offset = <0x60>; |
| 68 | mask = <0x10001>; |
| 69 | value = <0x10001>; |
| 70 | }; |
| 71 | |
| 72 | soc { |
| 73 | compatible = "simple-bus"; |
| 74 | interrupt-parent = <&plic>; |
| 75 | #address-cells = <2>; |
| 76 | #size-cells = <2>; |
| 77 | dma-noncoherent; |
| 78 | ranges; |
| 79 | |
| 80 | bootctl: syscon@0x91102000 { |
| 81 | compatible = "syscon"; |
| 82 | reg = <0x0 0x91102000 0x0 0x1000>; |
| 83 | }; |
| 84 | |
| 85 | plic: interrupt-controller@f00000000 { |
| 86 | compatible = "canaan,k230-plic" ,"thead,c900-plic"; |
| 87 | reg = <0xf 0x00000000 0x0 0x04000000>; |
| 88 | interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; |
| 89 | interrupt-controller; |
| 90 | #address-cells = <0>; |
| 91 | #interrupt-cells = <2>; |
| 92 | riscv,ndev = <208>; |
| 93 | }; |
| 94 | |
| 95 | clint: timer@f04000000 { |
| 96 | compatible = "canaan,k230-clint", "thead,c900-clint"; |
| 97 | reg = <0xf 0x04000000 0x0 0x00010000>; |
| 98 | interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; |
| 99 | }; |
| 100 | |
| 101 | uart0: serial@91400000 { |
| 102 | compatible = "snps,dw-apb-uart"; |
| 103 | reg = <0x0 0x91400000 0x0 0x1000>; |
| 104 | clocks = <&apb_clk>; |
| 105 | interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; |
| 106 | reg-io-width = <4>; |
| 107 | reg-shift = <2>; |
| 108 | status = "disabled"; |
| 109 | }; |
| 110 | |
| 111 | uart1: serial@91401000 { |
| 112 | compatible = "snps,dw-apb-uart"; |
| 113 | reg = <0x0 0x91401000 0x0 0x1000>; |
| 114 | clocks = <&apb_clk>; |
| 115 | interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; |
| 116 | reg-io-width = <4>; |
| 117 | reg-shift = <2>; |
| 118 | status = "disabled"; |
| 119 | }; |
| 120 | |
| 121 | uart2: serial@91402000 { |
| 122 | compatible = "snps,dw-apb-uart"; |
| 123 | reg = <0x0 0x91402000 0x0 0x1000>; |
| 124 | clocks = <&apb_clk>; |
| 125 | interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; |
| 126 | reg-io-width = <4>; |
| 127 | reg-shift = <2>; |
| 128 | status = "disabled"; |
| 129 | }; |
| 130 | |
| 131 | uart3: serial@91403000 { |
| 132 | compatible = "snps,dw-apb-uart"; |
| 133 | reg = <0x0 0x91403000 0x0 0x1000>; |
| 134 | clocks = <&apb_clk>; |
| 135 | interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; |
| 136 | reg-io-width = <4>; |
| 137 | reg-shift = <2>; |
| 138 | status = "disabled"; |
| 139 | }; |
| 140 | |
| 141 | uart4: serial@91404000 { |
| 142 | compatible = "snps,dw-apb-uart"; |
| 143 | reg = <0x0 0x91404000 0x0 0x1000>; |
| 144 | clocks = <&apb_clk>; |
| 145 | interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; |
| 146 | reg-io-width = <4>; |
| 147 | reg-shift = <2>; |
| 148 | status = "disabled"; |
| 149 | }; |
| 150 | |
| 151 | usb0: usb@91500000 { |
| 152 | compatible = "canaan,k230-otg", "snps,dwc2"; |
| 153 | reg = <0x0 0x91500000 0x0 0x40000>; |
| 154 | interrupts = <173 IRQ_TYPE_LEVEL_HIGH>; |
| 155 | clocks = <&clk_dummy>; |
| 156 | clock-names = "otg"; |
| 157 | g-rx-fifo-size = <512>; |
| 158 | g-np-tx-fifo-size = <64>; |
| 159 | g-tx-fifo-size = <512 1024 64 64 64 64>; |
| 160 | status = "disabled"; |
| 161 | }; |
| 162 | |
| 163 | usb1: usb@91540000 { |
| 164 | compatible = "canaan,k230-otg", "snps,dwc2"; |
| 165 | reg = <0x0 0x91540000 0x0 0x40000>; |
| 166 | interrupts = <174 IRQ_TYPE_LEVEL_HIGH>; |
| 167 | clocks = <&clk_dummy>; |
| 168 | clock-names = "otg"; |
| 169 | g-rx-fifo-size = <512>; |
| 170 | g-np-tx-fifo-size = <64>; |
| 171 | g-tx-fifo-size = <512 1024 64 64 64 64>; |
| 172 | status = "disabled"; |
| 173 | }; |
| 174 | }; |
| 175 | }; |