2024-09-05 16:59:06 +02:00
|
|
|
#include "lagarto_ox.h"
|
|
|
|
|
2024-06-27 11:29:15 +02:00
|
|
|
/dts-v1/;
|
|
|
|
/ {
|
2024-07-01 11:25:59 +02:00
|
|
|
#address-cells = <2>;
|
|
|
|
#size-cells = <2>; /* 64 bits memory addresses */
|
2024-06-27 11:29:15 +02:00
|
|
|
compatible = "riscv,rv64i";
|
2024-06-27 17:58:21 +02:00
|
|
|
model = "Barcelona Supercomputing Center - Lagarto Ox (NixOS)";
|
2024-07-04 17:22:43 +02:00
|
|
|
|
|
|
|
aliases {
|
|
|
|
serial0 = &uart_console; // ttyS0
|
2024-07-12 18:47:48 +02:00
|
|
|
// serial1 = &uart_testing; // ttyS1
|
2024-07-04 17:22:43 +02:00
|
|
|
};
|
|
|
|
|
2024-07-01 14:53:37 +02:00
|
|
|
// chosen {
|
|
|
|
// bootargs = "earlyprintk ignore_loglevel earlycon=sbi console=hvc0 root=/dev/pmem0p1 ro init=/bin/bash";
|
|
|
|
// };
|
2024-06-27 11:29:15 +02:00
|
|
|
cpus {
|
2024-07-01 11:25:59 +02:00
|
|
|
#address-cells = <1>;
|
|
|
|
#size-cells = <0>;
|
2024-09-04 11:46:18 +02:00
|
|
|
|
2024-09-05 16:59:06 +02:00
|
|
|
timebase-frequency = <RTC_CLOCK_FREQUENCY>;
|
2024-06-27 17:58:21 +02:00
|
|
|
CPU0: cpu@0 {
|
2024-09-05 17:12:35 +02:00
|
|
|
clock-frequency = <CPU_CLOCK_FREQUENCY>;
|
2024-06-27 16:08:30 +02:00
|
|
|
device_type = "cpu";
|
2024-07-01 11:25:59 +02:00
|
|
|
reg = <0>;
|
2024-06-27 16:08:30 +02:00
|
|
|
status = "okay";
|
|
|
|
compatible = "riscv";
|
|
|
|
riscv,isa = "rv64imafd";
|
|
|
|
mmu-type = "riscv,sv39";
|
|
|
|
tlb-split;
|
2024-07-08 08:48:56 +02:00
|
|
|
|
|
|
|
// OpenPiton+Ariane Platform
|
|
|
|
// L1I Size / Assoc: 16 kB / 4
|
|
|
|
// L1D Size / Assoc: 32 kB / 4
|
|
|
|
// L15 Size / Assoc: 128 kB / 8
|
|
|
|
// L2 Size / Assoc: 256 kB / 4
|
|
|
|
// L15/L1D Cacheline size 64
|
|
|
|
|
|
|
|
i-cache-block-size = <64>; // Guess
|
|
|
|
i-cache-sets = <4>;
|
|
|
|
i-cache-size = <16384>;
|
|
|
|
i-tlb-sets = <1>; // Guess
|
|
|
|
i-tlb-size = <32>; // Guess
|
|
|
|
|
|
|
|
d-cache-block-size = <64>; // Guess
|
|
|
|
d-cache-sets = <4>;
|
|
|
|
d-cache-size = <32768>;
|
|
|
|
d-tlb-sets = <1>; // Guess
|
|
|
|
d-tlb-size = <32>; // Guess
|
|
|
|
|
2024-06-27 17:58:21 +02:00
|
|
|
phandle = <0x00000004>;
|
2024-07-01 11:25:59 +02:00
|
|
|
/* Hart-Level Interrupt Controller: Every interrupt is
|
|
|
|
* ultimately routed through a hart's HLIC before it
|
|
|
|
* interrupts that hart. */
|
|
|
|
HLIC0: interrupt-controller {
|
|
|
|
#interrupt-cells = <1>;
|
|
|
|
interrupt-controller; /* Receives interrupts */
|
2024-06-27 16:08:30 +02:00
|
|
|
compatible = "riscv,cpu-intc";
|
2024-07-01 11:25:59 +02:00
|
|
|
phandle = <0x5>;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
cpu-map {
|
|
|
|
cluster0 {
|
|
|
|
core0 {
|
|
|
|
cpu = <&CPU0>;
|
|
|
|
};
|
2024-06-27 11:29:15 +02:00
|
|
|
};
|
2024-06-27 16:08:30 +02:00
|
|
|
};
|
2024-06-27 11:29:15 +02:00
|
|
|
};
|
2024-06-28 10:39:10 +02:00
|
|
|
/* Memory layout:
|
|
|
|
*
|
|
|
|
* [0x0_6000_0000, 0x0_7000_0000) -> DMA pool (256 MiB)
|
|
|
|
* [0x0_7000_0000, 0x0_8000_0000) -> DMA pool (256 MiB)
|
2024-07-10 18:04:11 +02:00
|
|
|
* [0x0_8000_0000, 0x0_b000_0000) -> RAM memory (768 MiB)
|
|
|
|
* [0x0_b000_0000, 0x0_c000_0000) -> Broken? (256 MiB)
|
|
|
|
* [0x0_c000_0000, 0x1_0000_0000) -> Empty (1024 MiB)
|
2024-07-01 14:53:37 +02:00
|
|
|
* [0x1_0000_0000, 0x1_c000_0000) -> PMEM (3072 MiB)
|
|
|
|
* [0x1_c000_0000, 0x2_8000_0000) -> Empty (3072 MiB)
|
2024-06-28 10:39:10 +02:00
|
|
|
*/
|
2024-06-27 11:29:15 +02:00
|
|
|
memory@80000000 {
|
2024-06-27 16:08:30 +02:00
|
|
|
device_type = "memory";
|
2024-07-10 18:04:11 +02:00
|
|
|
reg = <0x0 0x80000000 0x0 0x30000000>;
|
2024-06-27 11:29:15 +02:00
|
|
|
};
|
|
|
|
reserved-memory {
|
2024-07-01 11:25:59 +02:00
|
|
|
#address-cells = <2>; /* Starting address and size */
|
|
|
|
#size-cells = <2>; /* 64 bits memory addresses */
|
2024-06-27 16:08:30 +02:00
|
|
|
ranges;
|
|
|
|
eth_pool: dma_pool@60000000 {
|
2024-07-01 11:25:59 +02:00
|
|
|
reg = <0x0 0x60000000 0x0 0x10000000>;
|
2024-06-27 16:08:30 +02:00
|
|
|
compatible = "shared-dma-pool";
|
|
|
|
};
|
|
|
|
onic_pool: dma_pool@70000000 {
|
2024-07-01 11:25:59 +02:00
|
|
|
reg = <0x0 0x70000000 0x0 0x10000000>;
|
2024-06-27 16:08:30 +02:00
|
|
|
compatible = "shared-dma-pool";
|
|
|
|
};
|
2024-06-27 11:29:15 +02:00
|
|
|
};
|
2024-09-05 09:44:39 +02:00
|
|
|
dma_clk: dma_clk {
|
|
|
|
compatible = "fixed-clock";
|
|
|
|
#clock-cells = <0x00000000>;
|
|
|
|
clock-frequency = <0x09502f90>;
|
|
|
|
phandle = <0x00000002>;
|
|
|
|
};
|
2024-07-01 14:53:37 +02:00
|
|
|
pmem@100000000 {
|
2024-06-28 14:36:32 +02:00
|
|
|
/* volatile; This property indicates that this region is
|
|
|
|
* actually backed by non-persistent memory. This lets the OS
|
|
|
|
* know that it may skip the cache flushes required to ensure
|
|
|
|
* data is made persistent after a write. */
|
2024-06-27 16:08:30 +02:00
|
|
|
volatile;
|
|
|
|
compatible = "pmem-region";
|
2024-07-01 14:53:37 +02:00
|
|
|
reg = <0x1 0x00000000 0x0 0xc0000000>;
|
2024-06-27 11:29:15 +02:00
|
|
|
};
|
|
|
|
soc {
|
2024-06-27 16:08:30 +02:00
|
|
|
#address-cells = <0x00000002>;
|
|
|
|
#size-cells = <0x00000002>;
|
|
|
|
compatible = "BSC,Lagarto-ox-soc", "simple-bus";
|
|
|
|
ranges;
|
2024-07-04 17:22:43 +02:00
|
|
|
|
|
|
|
/* For bitstream e97dd7b2-397f-11ef-abe0-bbd201a5a630 with two
|
|
|
|
* consoles */
|
|
|
|
|
|
|
|
/* The serial for the kernel console */
|
2024-09-05 16:59:06 +02:00
|
|
|
uart_console: serial@UART0_ADDR_HEX {
|
2024-06-27 17:58:21 +02:00
|
|
|
compatible = "ns16550";
|
2024-09-05 16:59:06 +02:00
|
|
|
reg = <0x0 UART0_ADDR 0x0 0x1000>;
|
2024-06-27 17:58:21 +02:00
|
|
|
reg-shift = <2>;
|
2024-07-08 08:49:12 +02:00
|
|
|
/* No interrupts for this UART, use console=hvc0 */
|
|
|
|
/* This clock is the SERIAL_CLK */
|
2024-09-05 16:59:06 +02:00
|
|
|
clock-frequency = <CPU_CLOCK_FREQUENCY>;
|
|
|
|
current-speed = <UART_SPEED>;
|
2024-06-27 16:08:30 +02:00
|
|
|
status = "okay";
|
|
|
|
};
|
2024-09-03 16:09:53 +02:00
|
|
|
/* The serial for interrupt tests */
|
|
|
|
uart_testing: serial@40003000 {
|
|
|
|
compatible = "ns16550";
|
|
|
|
reg = <0x0 0x40003000 0x0 0x1000>;
|
|
|
|
reg-shift = <2>;
|
|
|
|
/* Output interrupt 1 (the first one) */
|
|
|
|
interrupts = <1>;
|
|
|
|
interrupt-parent = <&PLIC>;
|
2024-09-05 16:59:06 +02:00
|
|
|
clock-frequency = <CPU_CLOCK_FREQUENCY>;
|
|
|
|
current-speed = <UART_SPEED>;
|
2024-09-03 16:09:53 +02:00
|
|
|
status = "okay";
|
|
|
|
};
|
2024-07-01 11:25:59 +02:00
|
|
|
|
2024-09-03 16:55:34 +02:00
|
|
|
ethernet0 {
|
|
|
|
xlnx,rxmem = <0x000005f2>;
|
|
|
|
carv,mtu = <0x000005dc>;
|
|
|
|
carv,no-mac;
|
|
|
|
device_type = "network";
|
2024-09-05 10:58:17 +02:00
|
|
|
// 02:$node:00:01:00:$fpga -> 02:05:00:01:00:02
|
|
|
|
// 10.5.1.$N/16 -> 10.5.1.184/16
|
|
|
|
// N = 150 + ($node - 1) * 8 + $fpga
|
|
|
|
local-mac-address = [00 00 00 00 00 00];
|
2024-09-05 09:44:39 +02:00
|
|
|
axistream-connected = <&axi_dma>;
|
|
|
|
compatible = "xlnx,xxv-ethernet-1.0-carv";
|
2024-09-03 16:55:34 +02:00
|
|
|
memory-region = <ð_pool>;
|
|
|
|
};
|
|
|
|
|
2024-09-05 09:44:39 +02:00
|
|
|
axi_dma: dma@40400000 {
|
|
|
|
xlnx,include-dre;
|
|
|
|
#dma-cells = <0x00000001>;
|
|
|
|
compatible = "xlnx,axi-dma-1.00.a";
|
|
|
|
clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk", "m_axi_sg_aclk";
|
|
|
|
clocks = <&dma_clk>, <&dma_clk>, <&dma_clk>, <&dma_clk>;
|
|
|
|
reg = <0x00000000 0x40400000 0x00000000 0x00400000>;
|
|
|
|
interrupt-names = "mm2s_introut", "s2mm_introut";
|
|
|
|
interrupt-parent = <&PLIC>;
|
|
|
|
interrupts = <2 3>;
|
|
|
|
xlnx,addrwidth = <0x28>;
|
|
|
|
xlnx,include-sg;
|
|
|
|
xlnx,sg-length-width = <0x17>;
|
|
|
|
dma-channel@40400000 {
|
|
|
|
compatible = "xlnx,axi-dma-mm2s-channel";
|
|
|
|
dma-channels = <0>;
|
|
|
|
interrupts = <2>;
|
|
|
|
xlnx,datawidth = <0x40>;
|
|
|
|
xlnx,device-id = <0x0>;
|
|
|
|
xlnx,include-dre;
|
|
|
|
};
|
|
|
|
dma-channel@40400030 {
|
|
|
|
compatible = "xlnx,axi-dma-s2mm-channel";
|
|
|
|
dma-channels = <1>;
|
|
|
|
interrupts = <3>;
|
|
|
|
xlnx,datawidth = <0x40>;
|
|
|
|
xlnx,device-id = <0x0>;
|
|
|
|
xlnx,include-dre;
|
|
|
|
};
|
|
|
|
};
|
2024-07-01 11:25:59 +02:00
|
|
|
|
|
|
|
/* Platform-Level Interrupt Controller: Delivers interrupts to
|
|
|
|
* HARTs. */
|
2024-07-12 18:51:17 +02:00
|
|
|
PLIC: plic@40800000 {
|
|
|
|
compatible = "riscv,plic0";
|
|
|
|
interrupt-controller; /* Receives interrupts */
|
|
|
|
#address-cells = <0>;
|
|
|
|
#interrupt-cells = <1>;
|
2024-10-04 10:52:02 +02:00
|
|
|
/* Sends interrupts to HART interrupt controllers.
|
|
|
|
* Configures two output targets or contexts:
|
|
|
|
* - context 0: machine mode external interrupt (11)
|
|
|
|
* - context 1: supervisor mode external interrupt (9)
|
2024-07-12 18:51:17 +02:00
|
|
|
*/
|
|
|
|
interrupts-extended = <&HLIC0 11>, <&HLIC0 9>;
|
|
|
|
reg = < 0x0 0x40800000 0x0 0x00400000>;
|
2024-09-03 16:09:53 +02:00
|
|
|
riscv,ndev = <4>;
|
2024-07-12 18:51:17 +02:00
|
|
|
//riscv,max-priority = <0x7>;
|
|
|
|
phandle = <0x3>;
|
|
|
|
};
|
2024-07-01 11:25:59 +02:00
|
|
|
/* Core Local Interruptor: It directly connects to the timer and
|
|
|
|
* inter-processor interrupt lines of various HARTs (or CPUs) so
|
|
|
|
* RISC-V per-HART (or per-CPU) local interrupt controller is
|
|
|
|
* the parent interrupt controller for CLINT device. The clock
|
|
|
|
* frequency of CLINT is specified via "timebase-frequency" DT
|
|
|
|
* property of "/cpus" DT node. The "timebase-frequency" DT
|
|
|
|
* property is described in
|
|
|
|
* Documentation/devicetree/bindings/riscv/cpus.yaml
|
|
|
|
*/
|
2024-08-30 15:10:46 +02:00
|
|
|
clint: clint@40100000 {
|
|
|
|
reg = <0x0 0x40100000 0x0 0x00010000>;
|
|
|
|
reg-names = "control";
|
|
|
|
interrupts-extended = <&HLIC0 3>, <&HLIC0 7>;
|
|
|
|
compatible = "riscv,clint0";
|
|
|
|
};
|
2024-10-04 09:50:32 +02:00
|
|
|
|
2024-10-04 10:52:02 +02:00
|
|
|
/* There is another auxiliar clint (timer) at 40010000 for
|
|
|
|
* tests, but we don't tell the kernel so we can use it for
|
|
|
|
* testing interrupts manually. */
|
|
|
|
#if 0
|
|
|
|
aux_timer: clint@40010000 {
|
|
|
|
reg = <0x0 0x40010000 0x0 0x00010000>;
|
|
|
|
reg-names = "control";
|
|
|
|
interrupts = <4>; /* PLIC input source 4 */
|
|
|
|
interrupt-parent = <&PLIC>;
|
|
|
|
compatible = "riscv,clint0";
|
|
|
|
};
|
|
|
|
#endif
|
2024-10-04 09:50:32 +02:00
|
|
|
|
|
|
|
#ifdef ENABLE_SPI
|
|
|
|
uart16750: serial@40005000 {
|
|
|
|
compatible = "ns16750";
|
|
|
|
reg = <0x00000000 0x40005000 0x00000000 0x00001000>;
|
|
|
|
interrupt-parent = <&PLIC>;
|
|
|
|
interrupts = <5>;
|
|
|
|
clock-frequency = <CPU_CLOCK_FREQUENCY>;
|
|
|
|
current-speed = <0x0001c200>;
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
spi0: spi@40007000 {
|
|
|
|
compatible = "ti,keystone-spi";
|
|
|
|
reg = <0x00000000 0x40007000 0x00000000 0x00001000>;
|
|
|
|
#address-cells = <1>;
|
|
|
|
#size-cells = <0>;
|
|
|
|
interrupt-parent = <&PLIC>;
|
|
|
|
interrupt-names = "intvec0", "intvec1";
|
|
|
|
interrupts = <6 0>, <0x00000007 0>;
|
|
|
|
ti,davinci-spi-intr-line = <0>;
|
|
|
|
spi-max-frequency = <24000000>;
|
|
|
|
loopback-mode = <1>;
|
|
|
|
status = "okay";
|
|
|
|
};
|
|
|
|
#endif
|
2024-06-27 11:29:15 +02:00
|
|
|
};
|
|
|
|
};
|