Compare commits
11 Commits
zynq7000-v
...
zynq7000-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7f8aa8657
|
||
|
|
9596cf4dae
|
||
| 0fa69f9eb9 | |||
|
|
687be0e515 | ||
| 4e2da0a790 | |||
|
|
0206d15b2e | ||
|
|
98aedf2249
|
||
|
|
c6be77c098
|
||
|
|
a68d3d1784
|
||
| 20092410c0 | |||
|
|
a20ad9f621 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,7 +1,7 @@
|
||||
target
|
||||
xsct-output.log
|
||||
app.map
|
||||
|
||||
/app.map
|
||||
/xsct-output.log
|
||||
/.vscode
|
||||
/Cargo.lock
|
||||
/.cargo/config.toml
|
||||
|
||||
@@ -111,7 +111,8 @@ target = "armv7a-none-eabihf"
|
||||
You can build the blinky example app using
|
||||
|
||||
```sh
|
||||
cargo build --example simple
|
||||
cd zynq
|
||||
cargo build --bin blinky
|
||||
```
|
||||
|
||||
|
||||
|
||||
16
zynq/zedboard-bsp/CHANGELOG.md
Normal file
16
zynq/zedboard-bsp/CHANGELOG.md
Normal file
@@ -0,0 +1,16 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v0.1.0]
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/zedboard-bsp-v0.1.0...HEAD
|
||||
[v0.1.0]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zedboard-bsp-v0.1.0
|
||||
@@ -1,7 +1,7 @@
|
||||
# program."]
|
||||
#![doc = r""]
|
||||
#![doc = r"This configuration file contains static DDR configuration parameters extracted from the"]
|
||||
#![doc = r"AMD ps7init.tcl file"]
|
||||
#![doc = r"AMD ps7init.tcl file. It was generated for the MT41K128M16JT-125 DDR chip."]
|
||||
use zynq7000::ddrc::regs;
|
||||
use zynq7000_hal::ddr::DdrcConfigSet;
|
||||
pub const DDRC_CONFIG_ZEDBOARD: DdrcConfigSet = DdrcConfigSet {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# program."]
|
||||
#![doc = r""]
|
||||
#![doc = r"This configuration file contains static DDRIOB configuration parameters extracted from the"]
|
||||
#![doc = r"AMD ps7init.tcl file"]
|
||||
#![doc = r"AMD ps7init.tcl file. It was generated for the MT41K128M16JT-125 DDR chip."]
|
||||
use zynq7000::ddrc::regs;
|
||||
use zynq7000_hal::ddr::DdriobConfigSet;
|
||||
pub const DDRIOB_CONFIG_SET_ZEDBOARD: DdriobConfigSet = DdriobConfigSet {
|
||||
|
||||
16
zynq/zynq7000-embassy/CHANGELOG.md
Normal file
16
zynq/zynq7000-embassy/CHANGELOG.md
Normal file
@@ -0,0 +1,16 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v0.1.0] 2025-10-09
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/v0.1.0...HEAD
|
||||
[v0.1.0]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-embassy-v0.1.0
|
||||
21
zynq/zynq7000-hal/CHANGELOG.md
Normal file
21
zynq/zynq7000-hal/CHANGELOG.md
Normal file
@@ -0,0 +1,21 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v0.1.1] 2025-10-10
|
||||
|
||||
Documentation fixes.
|
||||
|
||||
# [v0.1.0] 2025-10-09
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/zynq7000-hal-v0.1.0...HEAD
|
||||
[v0.1.1]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-hal-v0.1.0...zynq7000-hal-v0.1.1
|
||||
[v0.1.0]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-hal-v0.1.0
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "zynq7000-hal"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||
edition = "2024"
|
||||
description = "Hardware Abstraction Layer (HAL) for the Zynq7000 family of SoCs"
|
||||
@@ -52,4 +52,6 @@ approx = "0.5"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["alloc"]
|
||||
targets = ["armv7a-none-eabihf"]
|
||||
cargo-args = ["-Z", "build-std=core"]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
21
zynq/zynq7000-mmu/CHANGELOG.md
Normal file
21
zynq/zynq7000-mmu/CHANGELOG.md
Normal file
@@ -0,0 +1,21 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v0.1.1] 2025-10-10
|
||||
|
||||
Documentation fixes.
|
||||
|
||||
# [v0.1.0] 2025-10-09
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/zynq7000-mmu-v0.1.0...HEAD
|
||||
[v0.1.1]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-mmu-v0.1.0...zynq7000-mmu-v0.1.1
|
||||
[v0.1.0]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-mmu-v0.1.0
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "zynq7000-mmu"
|
||||
description = "Zynq7000 MMU structures"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2024"
|
||||
license = "MIT OR Apache-2.0"
|
||||
homepage = "https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs"
|
||||
@@ -13,5 +13,13 @@ categories = ["embedded", "no-std", "hardware-support"]
|
||||
thiserror = { version = "2", default-features = false }
|
||||
cortex-ar = { version = "0.3" }
|
||||
|
||||
[build-dependencies]
|
||||
arm-targets = { version = "0.3" }
|
||||
|
||||
[features]
|
||||
tools = []
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["armv7a-none-eabihf"]
|
||||
cargo-args = ["-Z", "build-std=core"]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
[](https://crates.io/crates/zynq7000-mmu)
|
||||
[](https://docs.rs/zynq7000-mmu)
|
||||
[](https://github.com/us-irs/zynq7000-rs/actions/workflows/ci.yml)
|
||||
|
||||
Zynq7000 Memory Management Unit (MMU) library
|
||||
=========
|
||||
|
||||
|
||||
3
zynq/zynq7000-mmu/build.rs
Normal file
3
zynq/zynq7000-mmu/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
arm_targets::process();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//! # Zynq7000 Memory Management Unit (MMU)
|
||||
//! # Zynq7000 Memory Management Unit (MMU)
|
||||
//!
|
||||
//! Dedicated shared crate for Zynq7000 MMU abstractions which can be used by Zynq
|
||||
//! runtime crates, PACs and HALs.
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
use core::cell::UnsafeCell;
|
||||
use cortex_ar::mmu::L1Section;
|
||||
#[cfg(not(feature = "tools"))]
|
||||
#[cfg(all(not(feature = "tools"), arm_profile = "a"))]
|
||||
use cortex_ar::{
|
||||
asm::{dsb, isb},
|
||||
cache::clean_and_invalidate_l1_data_cache,
|
||||
@@ -39,7 +39,7 @@ impl L1TableRaw {
|
||||
self.0.as_mut_ptr() as *mut _
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "tools"))]
|
||||
#[cfg(all(not(feature = "tools"), arm_profile = "a"))]
|
||||
pub fn update(
|
||||
&mut self,
|
||||
addr: u32,
|
||||
@@ -92,7 +92,7 @@ impl<'a> L1TableWrapper<'a> {
|
||||
}
|
||||
|
||||
impl L1TableWrapper<'_> {
|
||||
#[cfg(not(feature = "tools"))]
|
||||
#[cfg(all(not(feature = "tools"), arm_profile = "a"))]
|
||||
pub fn update(
|
||||
&mut self,
|
||||
addr: u32,
|
||||
|
||||
21
zynq/zynq7000-rt/CHANGELOG.md
Normal file
21
zynq/zynq7000-rt/CHANGELOG.md
Normal file
@@ -0,0 +1,21 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v0.1.1] 2025-10-10
|
||||
|
||||
Documentation fixes.
|
||||
|
||||
# [v0.1.0] 2025-10-09
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/zynq7000-rt-v0.1.0...HEAD
|
||||
[v0.1.1]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-rt-v0.1.0...zynq7000-rt-v0.1.1
|
||||
[v0.1.0]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/tag/zynq7000-rt-v0.1.0
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "zynq7000-rt"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||
edition = "2024"
|
||||
description = "Run-time support for the Zynq7000 family of SoCs for running bare-metal applications"
|
||||
@@ -16,9 +16,14 @@ cortex-ar = { version = "0.3" }
|
||||
arbitrary-int = "2"
|
||||
zynq7000-mmu = { path = "../zynq7000-mmu", version = "0.1" }
|
||||
|
||||
[build-dependencies]
|
||||
arm-targets = { version = "0.3" }
|
||||
|
||||
[features]
|
||||
default = ["rt"]
|
||||
rt = ["dep:cortex-a-rt"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["armv7a-none-eabihf"]
|
||||
cargo-args = ["-Z", "build-std=core"]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
3
zynq/zynq7000-rt/build.rs
Normal file
3
zynq/zynq7000-rt/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
arm_targets::process();
|
||||
}
|
||||
@@ -9,20 +9,20 @@
|
||||
//! - Modification to the stack setup code, because a different linker script is used.
|
||||
#![no_std]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
#[cfg(feature = "rt")]
|
||||
#[cfg(all(feature = "rt", arm_profile = "a"))]
|
||||
pub use cortex_a_rt::*;
|
||||
|
||||
#[cfg(feature = "rt")]
|
||||
use zynq7000_mmu::L1TableWrapper;
|
||||
|
||||
pub mod mmu;
|
||||
#[cfg(feature = "rt")]
|
||||
#[cfg(all(feature = "rt", arm_profile = "a"))]
|
||||
mod mmu_table;
|
||||
#[cfg(feature = "rt")]
|
||||
#[cfg(all(feature = "rt", arm_profile = "a"))]
|
||||
pub mod rt;
|
||||
|
||||
/// Retrieves a mutable reference to the MMU L1 page table.
|
||||
#[cfg(feature = "rt")]
|
||||
#[cfg(all(feature = "rt", arm_profile = "a"))]
|
||||
pub fn mmu_l1_table_mut() -> L1TableWrapper<'static> {
|
||||
let mmu_table = mmu_table::MMU_L1_PAGE_TABLE.0.get();
|
||||
// Safety: We retrieve a reference to the MMU page table singleton.
|
||||
|
||||
21
zynq/zynq7000/CHANGELOG.md
Normal file
21
zynq/zynq7000/CHANGELOG.md
Normal file
@@ -0,0 +1,21 @@
|
||||
Change Log
|
||||
=======
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [unreleased]
|
||||
|
||||
# [v0.1.1] 2025-10-09
|
||||
|
||||
Documentation fix
|
||||
|
||||
# [v0.1.0] 2025-10-08
|
||||
|
||||
Initial release
|
||||
|
||||
[unreleased]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/zynq7000-v0.1.1...HEAD
|
||||
[v0.1.1]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/compare/zynq7000-v0.1.0...zynq7000-v0.1.1
|
||||
[v0.1.0]: https://egit.irs.uni-stuttgart.de/rust/zynq7000-rs/src/tag/zynq7000-v0.1.0
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "zynq7000"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||
edition = "2024"
|
||||
description = "Peripheral Access Crate (PAC) for the Zynq7000 family of SoCs"
|
||||
@@ -23,4 +23,6 @@ once_cell = { version = "1", default-features = false, features = ["critical-sec
|
||||
approx = "0.5"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["armv7a-none-eabihf"]
|
||||
cargo-args = ["-Z", "build-std=core"]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
[](https://docs.rs/zynq7000)
|
||||
[](https://github.com/us-irs/zynq7000-rs/actions/workflows/ci.yml)
|
||||
|
||||
# PAC for
|
||||
# PAC for the AMD Zynq 7000 SoC family
|
||||
|
||||
This repository contains the Peripheral Access Crate (PAC) for the AMD Zynq7000 SoC family.
|
||||
|
||||
If you are interested in higher-level abstractions, it is recommended you visit
|
||||
|
||||
@@ -725,6 +725,7 @@ pub mod regs {
|
||||
|
||||
use regs::*;
|
||||
|
||||
/// DDR controller register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct DdrController {
|
||||
|
||||
@@ -257,6 +257,7 @@ pub struct Status {
|
||||
efuse_jtag_disabled: bool,
|
||||
}
|
||||
|
||||
/// Device configuration register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct DevCfg {
|
||||
|
||||
@@ -418,7 +418,7 @@ pub struct MatchRegister {
|
||||
type_id: u16,
|
||||
}
|
||||
|
||||
/// Gigabit Ethernet Controller (GEM) registers for Zynq-7000
|
||||
/// Gigabit Ethernet Controller (GEM) register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Ethernet {
|
||||
@@ -477,7 +477,7 @@ pub struct Ethernet {
|
||||
|
||||
static_assertions::const_assert_eq!(core::mem::size_of::<Ethernet>(), 0x294);
|
||||
|
||||
/// GEM statistics registers
|
||||
/// Ethernet statistics registers
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Statistics {
|
||||
|
||||
@@ -35,6 +35,7 @@ pub struct BankControl {
|
||||
int_any: u32,
|
||||
}
|
||||
|
||||
/// GPIO register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Gpio {
|
||||
|
||||
@@ -22,7 +22,7 @@ pub struct InterruptStatus {
|
||||
event_flag: bool,
|
||||
}
|
||||
|
||||
/// Global timer counter.
|
||||
/// Global timer counter register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct GlobalTimerCounter {
|
||||
|
||||
@@ -156,6 +156,7 @@ pub struct TransferSize {
|
||||
size: u8,
|
||||
}
|
||||
|
||||
/// I2C register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct I2c {
|
||||
|
||||
@@ -184,6 +184,7 @@ pub struct InterruptControl {
|
||||
event_counter_overflow_increment: bool,
|
||||
}
|
||||
|
||||
/// L2 Cache register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct L2Cache {
|
||||
|
||||
@@ -44,6 +44,7 @@ impl SnoopControlUnit {
|
||||
|
||||
const_assert_eq!(core::mem::size_of::<SnoopControlUnit>(), 0x58);
|
||||
|
||||
/// MP Core register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct MpCore {
|
||||
|
||||
@@ -21,6 +21,7 @@ pub struct InterruptStatus {
|
||||
event_flag: bool,
|
||||
}
|
||||
|
||||
/// CPU private timer register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct CpuPrivateTimer {
|
||||
|
||||
@@ -220,6 +220,7 @@ pub struct LinearQspiStatus {
|
||||
axi_write_command_received: bool,
|
||||
}
|
||||
|
||||
/// QSPI register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Qspi {
|
||||
|
||||
@@ -91,7 +91,7 @@ pub struct LevelShifterRegister {
|
||||
user_lvl_shftr_en: Option<LevelShifterConfig>,
|
||||
}
|
||||
|
||||
/// System Level Control Registers
|
||||
/// System Level Control Registers access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Slcr {
|
||||
|
||||
@@ -178,7 +178,7 @@ pub struct DelayControl {
|
||||
cs_to_first_bit: u8,
|
||||
}
|
||||
|
||||
/// Register block specification for both PS SPIs.
|
||||
/// SPI register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Spi {
|
||||
|
||||
@@ -142,7 +142,7 @@ pub struct EventCount {
|
||||
count: u16,
|
||||
}
|
||||
|
||||
/// Triple-timer counter
|
||||
/// Triple-timer counter register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Ttc {
|
||||
|
||||
@@ -278,6 +278,7 @@ impl InterruptStatus {
|
||||
}
|
||||
}
|
||||
|
||||
/// UART register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct Uart {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
pub const XADC_BASE_ADDR: usize = 0xF8007100;
|
||||
|
||||
/// XADC register access.
|
||||
#[derive(derive_mmio::Mmio)]
|
||||
#[repr(C)]
|
||||
pub struct XAdc {
|
||||
|
||||
Reference in New Issue
Block a user