Skip to content

Commit cb357a4

Browse files
authored
Pulp CDC constraints fixup on FPGA, remote boot in device-tree, add cva6-sdk subrepo (#261)
* fpga: Correct pulp island CDC constraints * fpga: Select mac_addr by env variable * fpga: Add safety+spatz config and correct jtag chain * sdk: Update cva6-sdk with https buildroot dependancy * carfield.mk: Update CI hash
1 parent 405ace5 commit cb357a4

20 files changed

+392
-198
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "sw/deps/cva6-sdk"]
2+
path = sw/deps/cva6-sdk
3+
url = https://github.com/pulp-platform/cva6-sdk.git

Bender.yml

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ sources:
5959
files:
6060
- hw/configs/carfield_l2dual_safe_periph.sv
6161

62+
- target: carfield_l2dual_safe_spatz_periph
63+
files:
64+
- hw/configs/carfield_l2dual_safe_spatz_periph.sv
65+
6266
- target: carfield_l2dual_spatz_periph
6367
files:
6468
- hw/configs/carfield_l2dual_spatz_periph.sv

carfield.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ include $(CAR_ROOT)/bender-safed.mk
4444
######################
4545

4646
CAR_NONFREE_REMOTE ?= [email protected]:carfield/carfield-nonfree.git
47-
CAR_NONFREE_COMMIT ?= 54ce7e49
47+
CAR_NONFREE_COMMIT ?= 59e53134
4848

4949
## @section Carfield platform nonfree components
5050
## Clone the non-free verification IP for Carfield. Some components such as CI scripts and ASIC

docs/tg/xilinx.md

+32-18
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ See below some typical building time for reference:
6060

6161
| Config | Board | Duration |
6262
|----------------------------------------|--------|------------|
63-
| carfield_l2dual_pulp_periph | vcu128 | __ISSUE__ |
64-
| carfield_l2dual_safe_periph | vcu128 | 6h01min |
65-
| carfield_l2dual_spatz_periph | vcu128 | 3h31min |
63+
| carfield_l2dual_pulp_periph | vcu128 | ~5h |
64+
| carfield_l2dual_safe_periph | vcu128 | ~5h |
65+
| carfield_l2dual_spatz_periph | vcu128 | ~5h |
6666
| carfield_l2dual_secure_periph | vcu128 | __ISSUE__ |
6767

6868
You can find which sources are used by looking at `Bender.yml` (target `all(xilinx, fpga,
@@ -104,14 +104,15 @@ See the argument list below:
104104
| GEN_EXT_JTAG | vcu128 | `0` Connect the JTAG debugger to the board's JTAG (see [vcu128](#xilinx-vcu128)) <br>`1` Connect the JTAG debugger to an external JTAG chain |
105105
| CARFIELD_CONFIG | all | Select the Carfield configuration to implement. See below for supported configs. |
106106
| VIVADO_MODE | all | `batch` Compile in Vivado shell<br>`gui` Compile in Vivado gui |
107+
| XILINX_BOOT_ETH | all | `0` Boot via SPI flash only (see [booting Linux](#booting_linux)) <br>`1` Boot via SPI flash and Ethernet |
107108

108109
See below some typical building time for reference:
109110

110111
| Config | Board | Duration |
111112
|----------------------------------------|--------|------------|
112-
| carfield_l2dual_pulp_periph | vcu128 | __ISSUE__ |
113-
| carfield_l2dual_safe_periph | vcu128 | 3h49min |
114-
| carfield_l2dual_spatz_periph | vcu128 | 5h40min |
113+
| carfield_l2dual_pulp_periph | vcu128 | ~5h |
114+
| carfield_l2dual_safe_periph | vcu128 | ~5h |
115+
| carfield_l2dual_spatz_periph | vcu128 | ~5h |
115116
| carfield_l2dual_secure_periph | vcu128 | __ISSUE__ |
116117

117118
You can find which sources are used by looking at `Bender.yml` (target `all(xilinx, fpga,
@@ -124,6 +125,10 @@ Note that the `make` command above will first package a Carfield ip before compi
124125

125126
## Board specificities
126127

128+
### All
129+
> #### Ethernet
130+
> As the MAC address of each FPGA is unique (but reconfigurable), if you wish to use the Ethernet
131+
> IP (`bd` flavor) you will need to add the MAC address of your board in `sw/boot/mac_address.dtsi`.
127132
### Xilinx VCU128
128133
> #### Bootmodes and VIOs
129134
>
@@ -198,10 +203,6 @@ Tbd
198203

199204
Tbd
200205

201-
### JTAG Preloading
202-
203-
Tbd
204-
205206
## Booting Linux
206207

207208
To boot Linux, we must load the *OpenSBI* firmware, which takes over M mode and launches the U-boot
@@ -211,8 +212,8 @@ Clone the `carfield` branch of CVA6 SDK at the root of this repository and build
211212
(OpenSBI + U-boot) and Linux images (*this will take about 30 minutes*):
212213

213214
```bash
214-
git clone https://github.com/pulp-platform/cva6-sdk.git --branch carfield
215-
make -C cva6-sdk images
215+
git submodule update --init --recursive sw/deps/cva6-sdk
216+
make -C sw/deps/cva6-sdk images
216217
```
217218

218219
In principle, we can boot Linux through JTAG by loading all images into memory, launching OpenSBI,
@@ -227,16 +228,14 @@ To create a full Linux disk image from the ZSL, device tree, firmware, and Linux
227228

228229
```bash
229230
# Place the cva6-sdk where they are expected:
230-
ln -s cva6-sdk/install64 sw/boot/install64
231-
# Optional: Pre-uild explicitely the image
231+
ln -s sw/deps/cva6-sdk/install64 sw/boot/install64
232+
# Optional: Pre-build explicitely the image
232233
make CAR_ROOT=. sw/boot/linux_carfield_bd_vcu128.gpt.bin
233234
```
234235

235-
You can now recompile the board, it should start booting automatically!
236-
237-
### Xilinx VCU128
236+
### Via SPI flash
238237
>
239-
> This board does not offer a SD card reader. We need to load the image in the
238+
> Boards like VCU128 does not offer a SD card reader. We need to load the image in the
240239
integrated flash:
241240
>
242241
> ```
@@ -248,6 +247,21 @@ integrated flash:
248247
>
249248
> This script will erase your bitstream, once the flash has been written (c.a.
250249
10min) you will need to re-program the bitstream on the board.
250+
> You can attach the UART port of the FPGA to minicom and see the boot process!
251+
### Via Ethernet
252+
>
253+
> As flashing and reading the kernel from SPI can take a few minutes, a faster way is to
254+
> [ask U-Boot to fetch the image from the network](https://www.emcraft.com/som/using-dhcp).
255+
> This feature can be enabled in the Carfield `bd` flavor. You will need to add the MAC
256+
> address of your FPGA in `sw/boot/mac_address.dtsi` and the path to your Linux image (on a FTP server)
257+
> in `sw/boot/remote_boot.dtsi`.
258+
> You will still need to flash u-boot but it will be now faster:
259+
> ```
260+
> make chs-xil-flash VIVADO_MODE=batch XILINX_BOARD=vcu128 XILINX_FLAVOR=bd XILINX_BOOT_ETH=1
261+
> ```
262+
### Via Ethernet
263+
264+
Tbd
251265
252266
## Add your own board
253267

hw/carfield.sv

+2-2
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ else begin : gen_no_safety_island
12881288
assign safed_secd_mbox_intr = '0;
12891289

12901290
assign safed_dbg_reqs = '0;
1291-
assign jtag_safety_island_tdo_o = '0;
1291+
assign jtag_safety_island_tdo_o = jtag_safety_island_tdi_i;
12921292
end
12931293

12941294
// PULP integer cluster
@@ -1756,7 +1756,7 @@ end else begin : gen_no_secure_subsystem
17561756
assign car_regs_hw2reg.security_island_isolate_status.d = '0;
17571757
assign car_regs_hw2reg.security_island_isolate_status.de = '0;
17581758

1759-
assign jtag_ot_tdo_o = '0;
1759+
assign jtag_ot_tdo_o = jtag_ot_tdi_i;
17601760
end
17611761

17621762
// Mailbox unit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright 2022 ETH Zurich and University of Bologna.
2+
// Solderpad Hardware License, Version 0.51, see LICENSE for details.
3+
// SPDX-License-Identifier: SHL-0.51
4+
//
5+
// Yvan Tortorella <[email protected]>
6+
7+
package carfield_configuration;
8+
9+
import cheshire_pkg::*;
10+
/*********************
11+
* AXI Configuration *
12+
********************/
13+
//L2, port 0
14+
localparam bit L2Port0Enable = 1;
15+
localparam doub_bt L2Port0Base = 'h78000000;
16+
localparam doub_bt L2Port0Size = 'h00200000;
17+
// L2, port 1
18+
localparam bit L2Port1Enable = 1;
19+
localparam doub_bt L2Port1Base = L2Port0Base + L2Port0Size;
20+
localparam doub_bt L2Port1Size = L2Port0Size;
21+
// Safety Island
22+
localparam bit SafetyIslandEnable = 1;
23+
localparam doub_bt SafetyIslandBase = 'h60000000;
24+
localparam doub_bt SafetyIslandSize = 'h00800000;
25+
// Ethernet
26+
localparam bit EthernetEnable = 0;
27+
localparam doub_bt EthernetBase = 'h20000000;
28+
localparam doub_bt EthernetSize = 'h00001000;
29+
// Peripherals
30+
localparam bit PeriphEnable = 1;
31+
localparam doub_bt PeriphBase = 'h20001000;
32+
localparam doub_bt PeriphSize = 'h00009000;
33+
// Spatz cluster
34+
localparam bit SpatzClusterEnable = 1;
35+
localparam doub_bt SpatzClusterBase = 'h51000000;
36+
localparam doub_bt SpatzClusterSize = 'h00800000;
37+
// PULP cluster
38+
localparam bit PulpClusterEnable = 0;
39+
localparam doub_bt PulpClusterBase = 'h50000000;
40+
localparam doub_bt PulpClusterSize = 'h00800000;
41+
// Security Island
42+
localparam bit SecurityIslandEnable = 0;
43+
localparam doub_bt SecurityIslandBase = 'h0;
44+
localparam doub_bt SecurityIslandSize = 'h0;
45+
// Mailbox
46+
localparam bit MailboxEnable = 1;
47+
localparam doub_bt MailboxBase = 'h40000000;
48+
localparam doub_bt MailboxSize = 'h00001000;
49+
// Can
50+
localparam bit CanEnable = 0;
51+
localparam doub_bt CanBase = 'h20001000;
52+
localparam doub_bt CanSize = 'h00001000;
53+
// System Timer
54+
localparam doub_bt SystemTimerBase = 'h20004000;
55+
localparam doub_bt SystemTimerSize = 'h00001000;
56+
// System Advanced Timer
57+
localparam doub_bt SystemAdvancedTimerBase = 'h20005000;
58+
localparam doub_bt SystemAdvancedTimerSize = 'h00001000;
59+
// System Watchdog
60+
localparam doub_bt SystemWatchdogBase = 'h20007000;
61+
localparam doub_bt SystemWatchdogSize = 'h00001000;
62+
// Hyperbus Config
63+
localparam doub_bt HyperBusBase = 'h20009000;
64+
localparam doub_bt HyperBusSize = 'h00001000;
65+
/************************
66+
* RegBus Configuration *
67+
***********************/
68+
// Platform control registers
69+
localparam doub_bt PcrsBase = 'h20010000;
70+
localparam doub_bt PcrsSize = 'h00001000;
71+
// PLL
72+
localparam bit PllCfgEnable = 1;
73+
localparam doub_bt PllCfgBase = 'h20020000;
74+
localparam doub_bt PllCfgSize = 'h00001000;
75+
// Padframe
76+
localparam bit PadframeCfgEnable = 1;
77+
localparam doub_bt PadframeCfgBase = 'h200A0000;
78+
localparam doub_bt PadframeCfgSize = 'h00001000;
79+
// L2 ECC
80+
localparam bit L2EccCfgEnable = 1;
81+
localparam doub_bt L2EccCfgBase = 'h200B0000;
82+
localparam doub_bt L2EccCfgSize = 'h00001000;
83+
84+
endpackage

sw/boot/carfield.dtsi

+4-142
Original file line numberDiff line numberDiff line change
@@ -14,149 +14,11 @@
1414
stdout-path = "/soc/serial@3002000:38400";
1515
};
1616
memory@80000000 {
17+
// Give 1GiB to Linux management
1718
device_type = "memory";
1819
reg = <0x0 0x80000000 0x0 0x40000000>;
1920
};
20-
cpus {
21-
#address-cells = <1>;
22-
#size-cells = <0>;
23-
timebase-frequency = <1000000>; // 1 MHz
24-
CPU0: cpu@0 {
25-
device_type = "cpu";
26-
status = "okay";
27-
compatible = "eth,ariane", "riscv";
28-
clock-frequency = <50000000>; // 50 MHz
29-
riscv,isa = "rv64imafdc";
30-
mmu-type = "riscv,sv39";
31-
tlb-split;
32-
reg = <0>;
33-
CPU0_intc: interrupt-controller {
34-
#address-cells = <0>;
35-
#interrupt-cells = <1>;
36-
interrupt-controller;
37-
compatible = "riscv,cpu-intc";
38-
};
39-
};
40-
};
41-
sysclk: virt_50mhz {
42-
#clock-cells = <0>;
43-
compatible = "fixed-clock";
44-
clock-frequency = <50000000>;
45-
};
46-
soc: soc {
47-
#address-cells = <2>;
48-
#size-cells = <2>;
49-
compatible = "eth,carfield-soc", "eth,cheshire-bare-soc", "simple-bus";
50-
ranges;
51-
debug@0 {
52-
compatible = "riscv,debug-013";
53-
reg-names = "control";
54-
reg = <0x0 0x0 0x0 0x1000>;
55-
};
56-
ctrl-regs@3000000 {
57-
compatible = "eth,control-regs";
58-
reg = <0x0 0x3000000 0x0 0x1000>;
59-
};
60-
axi_llc@3001000 {
61-
compatible = "eth,axi-llc";
62-
reg = <0x0 0x3001000 0x0 0x5000>;
63-
};
64-
ddr_link: memory-controller@3006000 {
65-
compatible = "eth,ddr-link";
66-
reg = <0x0 0x3006000 0x0 0x1000>;
67-
};
68-
serial@3002000 {
69-
compatible = "ns16550a";
70-
clock-frequency = <50000000>; // 50 MHz
71-
current-speed = <38400>;
72-
interrupt-parent = <&PLIC0>;
73-
interrupts = <1>;
74-
reg = <0x0 0x3002000 0x0 0x1000>;
75-
reg-shift = <2>; // regs are spaced on 32 bit boundary
76-
reg-io-width = <4>; // only 32-bit access are supported
77-
};
78-
spi@3004000 {
79-
compatible = "opentitan,spi-host", "lowrisc,spi";
80-
interrupt-parent = <&PLIC0>;
81-
interrupts = <17 18>;
82-
reg = <0x0 0x3004000 0x0 0x1000>;
83-
clock-frequency = <50000000>;
84-
max-frequency = <20000000>;
85-
#address-cells = <1>;
86-
#size-cells = <0>;
87-
boot-with = <1>;
88-
nor@1 {
89-
#address-cells = <0x1>;
90-
#size-cells = <0x1>;
91-
// Note : u-boot does not find mt25qu02g
92-
compatible = "mt25qu02g", "jedec,spi-nor";
93-
reg = <0x1>; // CS
94-
spi-max-frequency = <20000000>;
95-
spi-rx-bus-width = <0x1>;
96-
spi-tx-bus-width = <0x1>;
97-
disable-wp;
98-
partition@0 {
99-
label = "all";
100-
reg = <0x0 0x6000000>; // 96 MB
101-
read-only;
102-
};
103-
};
104-
};
105-
clint@2040000 {
106-
compatible = "riscv,clint0";
107-
interrupts-extended = <&CPU0_intc 3 &CPU0_intc 7>;
108-
reg-names = "control";
109-
reg = <0x0 0x2040000 0x0 0x040000>;
110-
};
111-
PLIC0: interrupt-controller@4000000 {
112-
compatible = "riscv,plic0";
113-
#address-cells = <0>;
114-
#interrupt-cells = <1>;
115-
interrupt-controller;
116-
interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>;
117-
riscv,max-priority = <7>;
118-
riscv,ndev = <51>;
119-
reg = <0x0 0x4000000 0x0 0x4000000>;
120-
};
121-
gpio@3005000 {
122-
compatible = "gpio,carfield";
123-
reg = <0x0 0x3005000 0x0 0x1000>;
124-
interrupts-extended = <&PLIC0 19 &PLIC0 21 &PLIC0 22 &PLIC0 24>;
125-
};
126-
tcdm@10000000 {
127-
reg = <0x0 0x10000000 0x0 0x400000>;
128-
};
129-
soc-ctrl@20010000 {
130-
compatible = "soc-ctrl,carfield";
131-
reg = <0x0 0x20010000 0x0 0x1000>;
132-
};
133-
l2-intl-0@78000000 {
134-
compatible = "l2-intl,carfield";
135-
reg = <0x0 0x78000000 0x0 0x100000>;
136-
};
137-
l2-cont-0@78100000 {
138-
compatible = "l2-cont,carfield";
139-
reg = <0x0 0x78100000 0x0 0x100000>;
140-
};
141-
l2-intl-1@78200000 {
142-
compatible = "l2-intl,carfield";
143-
reg = <0x0 0x78200000 0x0 0x100000>;
144-
};
145-
l2-cont-1@78300000 {
146-
compatible = "l2-cont,carfield";
147-
reg = <0x0 0x78300000 0x0 0x100000>;
148-
};
149-
safety-island@60000000 {
150-
compatible = "safety-island,carfield";
151-
reg = <0x0 0x60000000 0x0 0x800000>;
152-
};
153-
integer-cluster@50000000 {
154-
compatible = "integer-cluster,carfield";
155-
reg = <0x0 0x50000000 0x0 0x800000>;
156-
};
157-
spatz-cluster@51000000 {
158-
compatible = "spatz-cluster,carfield";
159-
reg = <0x0 0x51000000 0x0 0x800000>;
160-
};
161-
};
21+
22+
/include/ "carfield_soc.dtsi"
23+
16224
};

0 commit comments

Comments
 (0)