mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
add debug call for bio
This commit is contained in:
parent
a56ed768e8
commit
b991a54b52
4 changed files with 66 additions and 0 deletions
|
|
@ -100,6 +100,8 @@ pub trait BioApi<'a> {
|
||||||
|
|
||||||
/// Returns a version code for the underlying hardware.
|
/// Returns a version code for the underlying hardware.
|
||||||
fn get_version(&self) -> u32;
|
fn get_version(&self) -> u32;
|
||||||
|
|
||||||
|
fn debug(&self, core: BioCore);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
@ -126,6 +128,7 @@ macro_rules! bio_code {
|
||||||
}
|
}
|
||||||
|
|
||||||
core::arch::global_asm!(
|
core::arch::global_asm!(
|
||||||
|
".option arch, +m",
|
||||||
".align 4",
|
".align 4",
|
||||||
concat!(".globl ", stringify!($name_start)),
|
concat!(".globl ", stringify!($name_start)),
|
||||||
concat!(stringify!($name_start), ":"),
|
concat!(stringify!($name_start), ":"),
|
||||||
|
|
@ -164,6 +167,8 @@ pub enum BioOp {
|
||||||
ClaimDynamicPin,
|
ClaimDynamicPin,
|
||||||
ReleaseDynamicPin,
|
ReleaseDynamicPin,
|
||||||
|
|
||||||
|
Debug,
|
||||||
|
|
||||||
InvalidCall,
|
InvalidCall,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,14 @@ impl<'a> BioApi<'a> for Bio {
|
||||||
.map_err(|e| <xous::Error as Into<BioError>>::into(e))?;
|
.map_err(|e| <xous::Error as Into<BioError>>::into(e))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn debug(&self, core: BioCore) {
|
||||||
|
send_message(
|
||||||
|
self.conn,
|
||||||
|
Message::new_blocking_scalar(BioOp::Debug.to_usize().unwrap(), core as usize, 0, 0, 0),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
|
|
|
||||||
|
|
@ -668,6 +668,23 @@ impl<'a> BioApi<'a> for BioSharedState {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn debug(&self, core: BioCore) {
|
||||||
|
match core {
|
||||||
|
BioCore::Core0 => {
|
||||||
|
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG0))
|
||||||
|
}
|
||||||
|
BioCore::Core1 => {
|
||||||
|
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG1))
|
||||||
|
}
|
||||||
|
BioCore::Core2 => {
|
||||||
|
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG2))
|
||||||
|
}
|
||||||
|
BioCore::Core3 => {
|
||||||
|
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG3))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,42 @@ fn bio_service(clk_freq: u32) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BioOp::Debug => {
|
||||||
|
if let Some(scalar) = msg_opt.as_mut().unwrap().body.scalar_message_mut() {
|
||||||
|
let core = BioCore::from(scalar.arg1);
|
||||||
|
match core {
|
||||||
|
BioCore::Core0 => {
|
||||||
|
log::info!(
|
||||||
|
"DBG_{:?}: {:x}",
|
||||||
|
core,
|
||||||
|
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG0)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
BioCore::Core1 => {
|
||||||
|
log::info!(
|
||||||
|
"DBG_{:?}: {:x}",
|
||||||
|
core,
|
||||||
|
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG1)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
BioCore::Core2 => {
|
||||||
|
log::info!(
|
||||||
|
"DBG_{:?}: {:x}",
|
||||||
|
core,
|
||||||
|
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG2)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
BioCore::Core3 => {
|
||||||
|
log::info!(
|
||||||
|
"DBG_{:?}: {:x}",
|
||||||
|
core,
|
||||||
|
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG3)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BioOp::GetCoreHandle => {
|
BioOp::GetCoreHandle => {
|
||||||
if let Some(scalar) = msg_opt.as_mut().unwrap().body.scalar_message_mut() {
|
if let Some(scalar) = msg_opt.as_mut().unwrap().body.scalar_message_mut() {
|
||||||
let index = scalar.arg1;
|
let index = scalar.arg1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue