mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add TRNG output to board bring-up test
This commit is contained in:
parent
2fb5b171c0
commit
798183fe95
1 changed files with 8 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
use cramium_hal::iox::{Iox, IoxDir, IoxEnable, IoxFunction, IoxPort};
|
use cramium_hal::iox::{Iox, IoxDir, IoxEnable, IoxFunction, IoxPort};
|
||||||
|
use cramium_hal::sce;
|
||||||
use cramium_hal::udma;
|
use cramium_hal::udma;
|
||||||
use utralib::generated::*;
|
use utralib::generated::*;
|
||||||
|
|
||||||
|
|
@ -133,6 +134,13 @@ pub fn early_init() {
|
||||||
// makes things a little bit cleaner for JTAG ops, it seems.
|
// makes things a little bit cleaner for JTAG ops, it seems.
|
||||||
#[cfg(feature = "board-bringup")]
|
#[cfg(feature = "board-bringup")]
|
||||||
{
|
{
|
||||||
|
// do a quick TRNG test.
|
||||||
|
let mut trng = sce::trng::Trng::new(HW_TRNG_BASE);
|
||||||
|
trng.setup_raw_generation(256);
|
||||||
|
for _ in 0..8 {
|
||||||
|
crate::println!("trng raw: {:x}", trng.get_u32().unwrap_or(0xDEAD_BEEF));
|
||||||
|
}
|
||||||
|
|
||||||
let rx_buf = unsafe {
|
let rx_buf = unsafe {
|
||||||
// safety: it's safe only because we are manually tracking the allocations in IFRAM0. Yuck!
|
// safety: it's safe only because we are manually tracking the allocations in IFRAM0. Yuck!
|
||||||
core::slice::from_raw_parts_mut(
|
core::slice::from_raw_parts_mut(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue