Skip to content

Commit

Permalink
increase verbosity of pl230 output for co-debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnie committed Nov 18, 2024
1 parent 64520cf commit fe45f40
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libs/xous-pl230/src/pl230_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub fn report_api(desc: &str, d: u32) {
{
use core::fmt::Write;
let mut uart = crate::debug::Uart {};
writeln!(uart, "pl230: [{}] 0x{:x}", desc, d).ok();
writeln!(uart, "pl230: [{}] 0x{:x}\r", desc, d).ok();
}
#[cfg(not(feature = "baremetal"))]
log::info!("pl230: [{}] 0x{:x}", desc, d);
Expand Down
32 changes: 27 additions & 5 deletions libs/xous-pl230/src/pl230_tests/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ pub fn basic_tests(pl230: &mut Pl230) -> bool {
// report_api("dma_len", DMA_LEN as u32);
report_api("baseptr", cc_struct.channels.as_ptr() as u32);
report_api("src start", region_a.as_ptr() as u32);
// report_api("baseptr[0]", unsafe{cc_struct.channels.as_ptr().read()}.src_end_ptr);
report_api("baseptr[0]", unsafe { cc_struct.channels.as_ptr().read() }.src_end_ptr);
report_api("dst start", region_b.as_ptr() as u32);
// report_api("baseptr[1]", unsafe{cc_struct.channels.as_ptr().read()}.dst_end_ptr);
// report_api("baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
// report_api("baseptr[3]", unsafe{cc_struct.channels.as_ptr().read()}.reserved);
// report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));
report_api("baseptr[1]", unsafe { cc_struct.channels.as_ptr().read() }.dst_end_ptr);
report_api("baseptr[2]", unsafe { cc_struct.channels.as_ptr().read() }.control);
report_api("baseptr[3]", unsafe { cc_struct.channels.as_ptr().read() }.reserved);
report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));

unsafe {
for i in 0..16 {
report_api("pl230 reg ", pl230.csr.base().add(i as usize).read_volatile());
}
}

// this should kick off the DMA
pl230.csr.wo(utra::pl230::CHNLSWREQUEST, 1);
Expand Down Expand Up @@ -123,6 +129,22 @@ pub fn basic_tests(pl230: &mut Pl230) -> bool {
}
report_api("basic dma result (1=pass)", if passing { 1 } else { 0 });
report_api("errs: ", errs);

report_api("baseptr", cc_struct.channels.as_ptr() as u32);
report_api("src start", region_a.as_ptr() as u32);
report_api("baseptr[0]", unsafe { cc_struct.channels.as_ptr().read() }.src_end_ptr);
report_api("dst start", region_b.as_ptr() as u32);
report_api("baseptr[1]", unsafe { cc_struct.channels.as_ptr().read() }.dst_end_ptr);
report_api("baseptr[2]", unsafe { cc_struct.channels.as_ptr().read() }.control);
report_api("baseptr[3]", unsafe { cc_struct.channels.as_ptr().read() }.reserved);
report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));

unsafe {
for i in 0..16 {
report_api("pl230 reg ", pl230.csr.base().add(i as usize).read_volatile());
}
}

passing
}

Expand Down

0 comments on commit fe45f40

Please sign in to comment.