Compare commits

..

2 Commits

Author SHA1 Message Date
simy46
ad03f23f3d support pynqz2 2025-01-24 12:17:29 -05:00
simy46
df8fc1aed1 new target on pynqz2 and ps clk set to 50MHz 2025-01-24 11:56:05 -05:00
3 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,7 @@ target_coraz7 = []
target_ebaz4205 = [] target_ebaz4205 = []
target_redpitaya = [] target_redpitaya = []
target_kasli_soc = [] target_kasli_soc = []
target_pynqz2 = []
ipv6 = [ "smoltcp/proto-ipv6" ] ipv6 = [ "smoltcp/proto-ipv6" ]
[dependencies] [dependencies]

View File

@ -12,6 +12,8 @@ pub const PS_CLK: u32 = 33_333_333;
pub const PS_CLK: u32 = 33_333_333; pub const PS_CLK: u32 = 33_333_333;
#[cfg(feature = "target_kasli_soc")] #[cfg(feature = "target_kasli_soc")]
pub const PS_CLK: u32 = 33_333_333; pub const PS_CLK: u32 = 33_333_333;
#[cfg(feature = "target_pynqz2")]
pub const PS_CLK: u32 = 50_000_000;
/// (pll_fdiv_max, (pll_cp, pll_res, lock_cnt)) /// (pll_fdiv_max, (pll_cp, pll_res, lock_cnt))
const PLL_FDIV_LOCK_PARAM: &[(u16, (u8, u8, u16))] = &[ const PLL_FDIV_LOCK_PARAM: &[(u16, (u8, u8, u16))] = &[

View File

@ -19,8 +19,8 @@ impl<T> UncachedSlice<T> {
.max(L1_PAGE_SIZE); .max(L1_PAGE_SIZE);
let layout = Layout::from_size_align(size, align)?; let layout = Layout::from_size_align(size, align)?;
let ptr = unsafe { alloc::alloc::alloc(layout).cast::<T>() }; let ptr = unsafe { alloc::alloc::alloc(layout).cast::<T>() };
assert!(!ptr.is_null());
let start = ptr as usize; let start = ptr as usize;
assert_eq!(start & (L1_PAGE_SIZE - 1), 0);
for page_start in (start..(start + size)).step_by(L1_PAGE_SIZE) { for page_start in (start..(start + size)).step_by(L1_PAGE_SIZE) {
// non-shareable device // non-shareable device
@ -33,6 +33,9 @@ impl<T> UncachedSlice<T> {
} }
let slice = unsafe { core::slice::from_raw_parts_mut(ptr, len) }; let slice = unsafe { core::slice::from_raw_parts_mut(ptr, len) };
// verify size
assert!(unsafe { slice.get_unchecked(len) } as *const _ as usize <= start + size);
// initialize
for e in slice.iter_mut() { for e in slice.iter_mut() {
*e = default(); *e = default();
} }