nixos-riscv/dts/lagarto_ox.dts

256 lines
6.9 KiB
Plaintext
Raw Normal View History

#include "lagarto_ox.h"
2024-06-27 11:29:15 +02:00
/dts-v1/;
/ {
#address-cells = <2>;
#size-cells = <2>; /* 64 bits memory addresses */
2024-06-27 11:29:15 +02:00
compatible = "riscv,rv64i";
model = "Barcelona Supercomputing Center - Lagarto Ox (NixOS)";
2024-06-27 11:29:15 +02:00
cpus {
#address-cells = <1>;
#size-cells = <0>;
2024-09-04 11:46:18 +02:00
2024-10-10 15:34:06 +02:00
timebase-frequency = <RTC_FREQ>;
CPU0: cpu@0 {
2024-10-10 15:34:06 +02:00
clock-frequency = <CPU_FREQ>;
device_type = "cpu";
reg = <0>;
status = "okay";
compatible = "riscv";
riscv,isa = "rv64imafd";
mmu-type = "riscv,sv39";
tlb-split;
2024-07-08 08:48:56 +02:00
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
/* 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 */
compatible = "riscv,cpu-intc";
};
};
cpu-map {
cluster0 {
core0 {
cpu = <&CPU0>;
};
2024-06-27 11:29:15 +02:00
};
};
2024-06-27 11:29:15 +02:00
};
2024-10-10 15:34:06 +02:00
memory@MEM_ADDR {
device_type = "memory";
2024-10-10 15:34:06 +02:00
reg = /bits/ 64 <MEM_ADDR MEM_SIZE>;
2024-06-27 11:29:15 +02:00
};
reserved-memory {
#address-cells = <2>; /* Starting address and size */
#size-cells = <2>; /* 64 bits memory addresses */
ranges;
2024-10-10 15:34:06 +02:00
eth_pool: dma_pool@ETHPOOL_ADDR {
reg = /bits/ 64 <ETHPOOL_ADDR ETHPOOL_SIZE>;
compatible = "shared-dma-pool";
};
2024-10-10 15:34:06 +02:00
onic_pool: dma_pool@ONICPOOL_ADDR {
reg = /bits/ 64 <ONICPOOL_ADDR ONICPOOL_SIZE>;
compatible = "shared-dma-pool";
};
2024-06-27 11:29:15 +02:00
};
2024-10-10 15:34:06 +02:00
pmem@PMEM_ADDR {
Remove unused PMEM regions Boots until the init, then fails with: [ 42.561840] Freeing unused kernel image (initmem) memory: 2448K [ 42.572360] Run /init as init process [ 42.577400] with arguments: [ 42.581780] /init [ 42.584520] with environment: [ 42.589320] HOME=/ [ 42.592140] TERM=linux [ 42.637580] init[1]: unhandled signal 4 code 0x1 at 0x0000003f966980d8 in ld-linux-riscv64-lp64d.so.1[3f96683000+23000] [ 42.650580] CPU: 0 PID: 1 Comm: init Not tainted 6.1.62 #1-NixOS [ 42.657720] Hardware name: Barcelona Supercomputing Center - Lagarto Ox (NixOS) (DT) [ 42.666760] epc : 0000003f966980d8 ra : 0000000000000000 sp : 0000003fe5c95db0 [ 42.675040] gp : ffffffff8197ea48 tp : 0000000000000000 t0 : 0000000000000000 [ 42.683320] t1 : 0000000000000000 t2 : 0000000000000000 s0 : 0000000000000000 [ 42.691600] s1 : 0000000000000000 a0 : 0000000000000000 a1 : 0000000000000000 [ 42.699880] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 42.708160] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000000000 [ 42.716420] s2 : 0000000000000000 s3 : 0000000000000000 s4 : 0000000000000000 [ 42.724700] s5 : 0000000000000000 s6 : 0000000000000000 s7 : 0000000000000000 [ 42.733380] s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000000000000000 [ 42.741660] s11: 0000000000000000 t3 : 0000000000000000 t4 : 0000000000000000 [ 42.749920] t5 : 0000000000000000 t6 : 0000000000000000 [ 42.756440] status: 0000000200004020 badaddr: 0000000000010513 cause: 0000000000000002 [ 42.767620] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 [ 42.775720] CPU: 0 PID: 1 Comm: init Not tainted 6.1.62 #1-NixOS [ 42.782320] Hardware name: Barcelona Supercomputing Center - Lagarto Ox (NixOS) (DT) [ 42.790460] Call Trace: [ 42.793380] [<ffffffff800070c4>] dump_backtrace+0x38/0x48 [ 42.799520] [<ffffffff809f063c>] show_stack+0x50/0x68 [ 42.805280] [<ffffffff809fd1f8>] dump_stack_lvl+0x60/0x84 [ 42.811400] [<ffffffff809fd23c>] dump_stack+0x20/0x30 [ 42.817140] [<ffffffff809f0918>] panic+0x160/0x390 [ 42.822620] [<ffffffff80020184>] do_exit+0xa70/0xa78 [ 42.828260] [<ffffffff800203a4>] do_group_exit+0x44/0xb0 [ 42.834240] [<ffffffff80031eec>] get_signal+0x9b4/0xa00 [ 42.840140] [<ffffffff80005ca0>] do_work_pending+0x18c/0x610 [ 42.846480] [<ffffffff80003880>] resume_userspace_slow+0x10/0x14 [ 42.853420] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 ]---
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. */
volatile;
compatible = "pmem-region";
2024-10-10 15:34:06 +02:00
reg = /bits/ 64 <PMEM_ADDR PMEM_SIZE>;
2024-06-27 11:29:15 +02:00
};
soc {
2024-10-10 15:34:06 +02:00
#address-cells = <2>;
#size-cells = <2>;
compatible = "BSC,Lagarto-ox-soc", "simple-bus";
ranges;
/* For bitstream e97dd7b2-397f-11ef-abe0-bbd201a5a630 with two
* consoles */
2024-10-10 15:34:06 +02:00
#ifdef ENABLE_UART0
/* The serial for the kernel console */
2024-10-10 15:34:06 +02:00
uart_console: serial@UART0_ADDR {
compatible = "ns16550";
2024-10-10 15:34:06 +02:00
reg = /bits/ 64 <UART0_ADDR UART0_SIZE>;
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-10-10 15:34:06 +02:00
clock-frequency = <CPU_FREQ>;
current-speed = <UART0_SPEED>;
status = "okay";
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_UART0 */
#ifdef ENABLE_UART1
2024-09-03 16:09:53 +02:00
/* The serial for interrupt tests */
2024-10-10 15:34:06 +02:00
uart_testing: serial@UART1_ADDR {
2024-09-03 16:09:53 +02:00
compatible = "ns16550";
2024-10-10 15:34:06 +02:00
reg = /bits/ 64 <UART1_ADDR UART1_SIZE>;
2024-09-03 16:09:53 +02:00
reg-shift = <2>;
/* Output interrupt 1 (the first one) */
interrupts = <1>;
interrupt-parent = <&PLIC>;
2024-10-10 15:34:06 +02:00
clock-frequency = <CPU_FREQ>;
current-speed = <UART1_SPEED>;
2024-09-03 16:09:53 +02:00
status = "okay";
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_UART1 */
2024-10-10 15:34:06 +02:00
#ifdef ENABLE_ETHERNET
2024-09-03 16:55:34 +02:00
ethernet0 {
2024-10-10 15:34:06 +02:00
xlnx,rxmem = <1522>;
carv,mtu = <1500>;
carv,no-mac;
device_type = "network";
// 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];
axistream-connected = <&axi_dma>;
compatible = "xlnx,xxv-ethernet-1.0-carv";
memory-region = <&eth_pool>;
2024-09-03 16:55:34 +02:00
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_ETHERNET */
2024-09-03 16:55:34 +02:00
2024-10-10 15:34:06 +02:00
#ifdef ENABLE_AXIDMA
dma_clk: dma_clk {
compatible = "fixed-clock";
#clock-cells = <0x0>;
clock-frequency = <AXIDMA_FREQ>;
};
axi_dma: dma@AXIDMA_ADDR {
reg = /bits/ 64 <AXIDMA_ADDR AXIDMA_SIZE>;
reg-shift = <2>;
#address-cells = <2>;
#size-cells = <2>;
2024-09-05 09:44:39 +02:00
xlnx,include-dre;
2024-10-10 15:34:06 +02:00
#dma-cells = <0x1>;
2024-09-05 09:44:39 +02:00
compatible = "xlnx,axi-dma-1.00.a";
2024-10-10 15:34:06 +02:00
clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk",
"m_axi_s2mm_aclk", "m_axi_sg_aclk";
2024-09-05 09:44:39 +02:00
clocks = <&dma_clk>, <&dma_clk>, <&dma_clk>, <&dma_clk>;
interrupt-names = "mm2s_introut", "s2mm_introut";
interrupt-parent = <&PLIC>;
interrupts = <2 3>;
xlnx,addrwidth = <0x28>;
xlnx,include-sg;
xlnx,sg-length-width = <0x17>;
2024-10-10 15:34:06 +02:00
dma-channel@AXIDMA_CH0 {
reg = /bits/ 64 <AXIDMA_CH0 0x30>;
2024-09-05 09:44:39 +02:00
compatible = "xlnx,axi-dma-mm2s-channel";
dma-channels = <0>;
interrupts = <2>;
xlnx,datawidth = <0x40>;
xlnx,device-id = <0x0>;
xlnx,include-dre;
};
2024-10-10 15:34:06 +02:00
dma-channel@AXIDMA_CH1 {
reg = /bits/ 64 <AXIDMA_CH1 0x30>;
2024-09-05 09:44:39 +02:00
compatible = "xlnx,axi-dma-s2mm-channel";
dma-channels = <1>;
interrupts = <3>;
xlnx,datawidth = <0x40>;
xlnx,device-id = <0x0>;
xlnx,include-dre;
};
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_AXIDMA */
2024-10-10 15:34:06 +02:00
#ifdef ENABLE_PLIC
/* Platform-Level Interrupt Controller: Delivers interrupts to
* HARTs. */
2024-10-10 15:34:06 +02:00
PLIC: plic@PLIC_ADDR {
reg = /bits/ 64 <PLIC_ADDR PLIC_SIZE>;
2024-07-12 18:51:17 +02:00
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>;
2024-10-10 15:34:06 +02:00
riscv,ndev = <PLIC_NDEV>;
2024-07-12 18:51:17 +02:00
//riscv,max-priority = <0x7>;
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_PLIC */
#ifdef ENABLE_CLINT
/* 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
*/
clint: clint@CLINT_ADDR {
2024-10-10 15:34:06 +02:00
reg = /bits/ 64 <CLINT_ADDR CLINT_SIZE>;
reg-names = "control";
interrupts-extended = <&HLIC0 3>, <&HLIC0 7>;
compatible = "riscv,clint0";
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_CLINT */
2024-10-04 09:50:32 +02:00
2024-10-10 15:34:06 +02:00
#if 0
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. */
aux_timer: clint@AUXTIMER_ADDR {
reg = /bits/ 64 <AUXTIMER_ADDR AUXTIMER_SIZE>;
2024-10-04 10:52:02 +02:00
reg-names = "control";
interrupts = <4>; /* PLIC input source 4 */
interrupt-parent = <&PLIC>;
compatible = "riscv,clint0";
};
2024-10-10 15:34:06 +02:00
#endif
2024-10-04 09:50:32 +02:00
2024-10-10 15:34:06 +02:00
#ifdef ENABLE_SPI
serial@UART2_ADDR {
2024-10-04 09:50:32 +02:00
compatible = "ns16750";
reg = /bits/ 64 <UART2_ADDR UART2_SIZE>;
2024-10-04 09:50:32 +02:00
interrupt-parent = <&PLIC>;
interrupts = <5>;
2024-10-10 15:34:06 +02:00
clock-frequency = <CPU_FREQ>;
current-speed = <UART2_SPEED>;
2024-10-04 09:50:32 +02:00
status = "okay";
};
spi@SPI_ADDR {
2024-10-04 09:50:32 +02:00
compatible = "ti,keystone-spi";
reg = /bits/ 64 <SPI_ADDR SPI_SIZE>;
2024-10-04 09:50:32 +02:00
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&PLIC>;
interrupt-names = "intvec0", "intvec1";
interrupts = <6 0>, <7 0>;
2024-10-04 09:50:32 +02:00
ti,davinci-spi-intr-line = <0>;
spi-max-frequency = <24000000>;
loopback-mode = <1>;
status = "okay";
};
2024-10-10 15:34:06 +02:00
#endif /* ENABLE_SPI */
2024-06-27 11:29:15 +02:00
};
};