From f60d0589cc884da347974afcbb92b7c04a310fcc Mon Sep 17 00:00:00 2001 From: pca006132 Date: Thu, 1 Oct 2020 00:17:47 +0800 Subject: [PATCH] fix ps7_init compilation error and warnings --- libboard_zynq/src/ddr/mod.rs | 1 + libboard_zynq/src/ps7_init/mod.rs | 9 ++++++--- libboard_zynq/src/ps7_init/none.rs | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 libboard_zynq/src/ps7_init/none.rs diff --git a/libboard_zynq/src/ddr/mod.rs b/libboard_zynq/src/ddr/mod.rs index c351b9f..5a3eeae 100644 --- a/libboard_zynq/src/ddr/mod.rs +++ b/libboard_zynq/src/ddr/mod.rs @@ -34,6 +34,7 @@ impl DdrRam { // We have not yet fixed red pitaya initialization yet. It seems // that the clock configuration, iob settings and ddr settings are // all problematic + #[cfg(feature = "target_redpitaya")] ps7_init::apply(); let regs = regs::RegisterBlock::ddrc(); DdrRam { regs } diff --git a/libboard_zynq/src/ps7_init/mod.rs b/libboard_zynq/src/ps7_init/mod.rs index 1d9a5f4..f957273 100644 --- a/libboard_zynq/src/ps7_init/mod.rs +++ b/libboard_zynq/src/ps7_init/mod.rs @@ -1,16 +1,19 @@ use crate::println; +#[cfg(feature = "target_zc706")] mod zc706; +#[cfg(feature = "target_redpitaya")] mod redpitaya; -// mod cora_z7_10; +#[cfg(not(any(feature = "target_zc706", feature = "target_redpitaya")))] +mod none; #[cfg(feature = "target_zc706")] use zc706 as target; #[cfg(feature = "target_redpitaya")] use redpitaya as target; -// #[cfg(feature = "target_cora_z7_10")] -// use cora_z7_10 as target; +#[cfg(not(any(feature = "target_zc706", feature = "target_redpitaya")))] +use none as target; pub fn report_differences() { for (i, op) in target::INIT_DATA.iter().enumerate() { diff --git a/libboard_zynq/src/ps7_init/none.rs b/libboard_zynq/src/ps7_init/none.rs new file mode 100644 index 0000000..94ad423 --- /dev/null +++ b/libboard_zynq/src/ps7_init/none.rs @@ -0,0 +1,4 @@ +use super::InitOp::{self, *}; + +pub const INIT_DATA: &'static [InitOp] = &[ +];