Skip to content

Commit d35152c

Browse files
committed
Make u-boot feature docs
1 parent cf770ff commit d35152c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

riscv-rt/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,20 @@
452452
//! ```
453453
//!
454454
//! This will generate a function named `_start_MachineTimer_trap` that calls the interrupt handler `MachineTimer`.
455+
//!
456+
//! ## `u-boot`
457+
//!
458+
//! The u-boot support feature (`u-boot`) can be activated via [Cargo features](https://doc.rust-lang.org/cargo/reference/features.html).
459+
//!
460+
//! For example:
461+
//! ``` text
462+
//! [dependencies]
463+
//! riscv-rt = { features = ["u-boot"] }
464+
//! ```
465+
//! When the u-boot feature is enabled, some assembly code is disabled to leave stack untouched. This is required
466+
//! because when booting from elf, u-boot passes arguments as argc and argv through stack. Because the only way
467+
//! to get boot-hart is through fdt, this feature also implies `single-hart` so other harts initialization
468+
//! is up to you.
455469
456470
// NOTE: Adapted from cortex-m/src/lib.rs
457471
#![no_std]

0 commit comments

Comments
 (0)