From 3e02980c20429087145764c6a419ec4f68f96977 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 9 May 2020 02:32:29 +0200 Subject: [PATCH] libboard_zynq: fix access to "full" 1022 MB on target_zc706 --- libboard_zynq/src/ddr/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libboard_zynq/src/ddr/mod.rs b/libboard_zynq/src/ddr/mod.rs index 23084c4..924513a 100644 --- a/libboard_zynq/src/ddr/mod.rs +++ b/libboard_zynq/src/ddr/mod.rs @@ -183,6 +183,14 @@ impl DdrRam { /// Reset DDR controller fn reset_ddrc(&mut self) { + #[cfg(feature = "target_zc706")] + unsafe { + // row/column address bits + self.regs.dram_addr_map_bank.write(0x00000777); + self.regs.dram_addr_map_col.write(0xFFF00000); + self.regs.dram_addr_map_row.write(0x0F666666); + } + #[cfg(feature = "target_zc706")] let width = regs::DataBusWidth::Width32bit; #[cfg(feature = "target_cora_z7_10")] @@ -209,9 +217,11 @@ impl DdrRam { 0x0010_0000 as *mut _ } + /// actually there's 1 MB more but starting at 0x0000_0000 + /// overlaps with OCM. pub fn size(&self) -> usize { #[cfg(feature = "target_zc706")] - let megabytes = 511; + let megabytes = 1022; #[cfg(feature = "target_cora_z7_10")] let megabytes = 511;