Skip to content

Commit b4b1266

Browse files
Merge tock#135
135: cargo: Add support for building OpenTitan apps r=alistair23 a=alistair23 This fixes tock#134 and adds support for building OT apps, Signed-off-by: Alistair Francis <[email protected]> Co-authored-by: Alistair Francis <[email protected]>
2 parents 034ae24 + 82feaa2 commit b4b1266

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.cargo/config

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ rustflags = [
1313
"-D", "warnings",
1414
]
1515

16+
[target.riscv32imc-unknown-none-elf]
17+
rustflags = [
18+
"-C", "link-arg=-Topentitan_layout.ld",
19+
"-C", "relocation-model=static",
20+
"-D", "warnings",
21+
]
22+
1623
# Target configuration for the travis CI Linux build
1724
[target.x86_64-unknown-linux-gnu]
1825
rustflags = [

opentitan_layout.ld

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Layout for the RISC-V 32 boards, used by the examples in this repository. */
2+
3+
MEMORY {
4+
/* The TBF header region is 32 bytes (0x20) */
5+
FLASH (rx) : ORIGIN = 0x20030020, LENGTH = 32M
6+
SRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 512K
7+
}
8+
9+
/*
10+
* Any change to STACK_SIZE should be accompanied by a corresponding change to
11+
* `elf2tab`'s `--stack` option
12+
*/
13+
STACK_SIZE = 2048;
14+
15+
MPU_MIN_ALIGN = 1K;
16+
17+
INCLUDE layout.ld

0 commit comments

Comments
 (0)