litex_arty/
litex_generated_constants.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Licensed under the Apache License, Version 2.0 or the MIT License.
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Copyright Tock Contributors 2022.

#![allow(unused)]

// LiteX SoC Wishbone Register format
pub type SoCRegisterFmt = litex_vexriscv::litex_registers::LiteXSoCRegistersC32B32;

// Uart baudrate (configurable with `--uart-baudrate` in LiteX)
pub const UART_BAUDRATE: u32 = 1_000_000;

// constants defined in `generated/soc.h`

pub type ClockFrequency = kernel::hil::time::Freq100MHz;

pub const CONFIG_CPU_HAS_INTERRUPT: bool = true;
pub const CONFIG_CPU_RESET_ADDR: usize = 0;

pub const CONFIG_CPU_TYPE: &str = "vexriscv";
pub const CONFIG_CPU_VARIANT: &str = "tock";
pub const CONFIG_CPU_HUMAN_NAME: &str = "VexRiscv_TockSecureIMC";
pub const CONFIG_CPU_NOP: &str = "nop";
pub const CONFIG_L2_SIZE: usize = 8192;

pub const CONFIG_CSR_DATA_WIDTH: usize = 32;
pub const CONFIG_CSR_ALIGNMENT: usize = 32;
pub const CONFIG_BUS_STANDARD: &str = "WISHBONE";
pub const CONFIG_BUS_DATA_WIDTH: usize = 32;
pub const CONFIG_BUS_ADDRESS_WIDTH: usize = 32;

pub const ETHMAC_RX_SLOTS: usize = 2;
pub const ETHMAC_TX_SLOTS: usize = 2;
pub const ETHMAC_SLOT_SIZE: usize = 2048;

pub const ETHMAC_INTERRUPT: usize = 2;
pub const TIMER0_INTERRUPT: usize = 1;
pub const UART_INTERRUPT: usize = 0;

// constants defined in `generated/csr.h`

pub const CSR_BASE: usize = 0xf0000000;
pub const CSR_BUTTONS_BASE: usize = CSR_BASE + 0x0000;
pub const CSR_CTRL_BASE: usize = CSR_BASE + 0x0800;
pub const CSR_DDRPHY_BASE: usize = CSR_BASE + 0x1000;
pub const CSR_DNA_BASE: usize = CSR_BASE + 0x1800;
pub const CSR_ETHMAC_BASE: usize = CSR_BASE + 0x2000;
pub const CSR_ETHPHY_BASE: usize = CSR_BASE + 0x2800;
pub const CSR_IDENTIFIER_MEM_BASE: usize = CSR_BASE + 0x3000;
pub const CSR_LEDS_BASE: usize = CSR_BASE + 0x3800;
pub const CSR_SDRAM_BASE: usize = CSR_BASE + 0x4000;
pub const CSR_SPIFLASH_CORE_BASE: usize = CSR_BASE + 0x4800;
pub const CSR_TIMER0_BASE: usize = CSR_BASE + 0x5000;
pub const CSR_UART_BASE: usize = CSR_BASE + 0x5800;
pub const CSR_XADC_BASE: usize = CSR_BASE + 0x6000;

// constants defined in `generated/mem.h`
pub const MEM_ETHMAC_BASE: usize = 0x80000000;
pub const MEM_ETHMAC_SIZE: usize = 0x00002000;