From 4919fb8765652852cd0802afa71596dd432c94dc Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 9 Dec 2019 17:39:22 +0800 Subject: [PATCH] wrpll: print DDMTD helper tags --- artiq/firmware/libboard_artiq/wrpll.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/artiq/firmware/libboard_artiq/wrpll.rs b/artiq/firmware/libboard_artiq/wrpll.rs index 1a528afeb..1f6f91775 100644 --- a/artiq/firmware/libboard_artiq/wrpll.rs +++ b/artiq/firmware/libboard_artiq/wrpll.rs @@ -280,6 +280,14 @@ fn get_ddmtd_main_tag() -> u16 { } } +fn get_ddmtd_helper_tag() -> u16 { + unsafe { + csr::wrpll::ddmtd_helper_arm_write(1); + while csr::wrpll::ddmtd_helper_arm_read() != 0 {} + csr::wrpll::ddmtd_helper_tag_read() + } +} + pub fn init() { info!("initializing..."); @@ -311,4 +319,11 @@ pub fn init() { pub fn select_recovered_clock(rc: bool) { info!("select_recovered_clock: {}", rc); + if rc { + let mut tags = [0; 10]; + for i in 0..tags.len() { + tags[i] = get_ddmtd_helper_tag(); + } + info!("DDMTD helper tags: {:?}", tags); + } }