mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix trng service in baosec environment
fix missing initializers
This commit is contained in:
parent
5c98af9dfa
commit
c2c135bfdc
2 changed files with 4 additions and 2 deletions
|
|
@ -262,6 +262,8 @@ fn main() {
|
||||||
// claim BIO
|
// claim BIO
|
||||||
#[cfg(feature = "board-baosec")]
|
#[cfg(feature = "board-baosec")]
|
||||||
let bio_ss = Arc::new(Mutex::new(xous_bio_bdma::BioSharedState::new()));
|
let bio_ss = Arc::new(Mutex::new(xous_bio_bdma::BioSharedState::new()));
|
||||||
|
#[cfg(feature = "board-baosec")]
|
||||||
|
bio_ss.lock().unwrap().init();
|
||||||
// setup TRNG server - baosec only because it has an external AV generator
|
// setup TRNG server - baosec only because it has an external AV generator
|
||||||
#[cfg(feature = "board-baosec")]
|
#[cfg(feature = "board-baosec")]
|
||||||
servers::trng::start_trng_service(&bio_ss);
|
servers::trng::start_trng_service(&bio_ss);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ impl HwTrng {
|
||||||
bio_ss.load_code(avtrng_bio_code(), 0, BioCore::Core0);
|
bio_ss.load_code(avtrng_bio_code(), 0, BioCore::Core0);
|
||||||
|
|
||||||
// don't use QDIV
|
// don't use QDIV
|
||||||
bio_ss.bio.wo(utra::bio_bdma::SFR_QDIV0, 0x1_0000);
|
bio_ss.bio.wo(utra::bio_bdma::SFR_QDIV0, 0x1_0001);
|
||||||
|
|
||||||
// use extclock on channel 0, tied to the trng pin
|
// use extclock on channel 0, tied to the trng pin
|
||||||
bio_ss.bio.wo(
|
bio_ss.bio.wo(
|
||||||
|
|
@ -47,7 +47,7 @@ impl HwTrng {
|
||||||
);
|
);
|
||||||
|
|
||||||
// start the machine
|
// start the machine
|
||||||
bio_ss.set_core_run_states([true, false, false, true]);
|
bio_ss.set_core_run_states([true, false, false, false]);
|
||||||
bio_ss.bio.wo(utra::bio_bdma::SFR_TXF0, trng_pin as u32); // start the sampling
|
bio_ss.bio.wo(utra::bio_bdma::SFR_TXF0, trng_pin as u32); // start the sampling
|
||||||
|
|
||||||
// server_id is a random number from the hardware entropy pool. Note that this
|
// server_id is a random number from the hardware entropy pool. Note that this
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue