parsed and loaded bitstream from bootimage #12
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/artiq-zynq#12
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "pca006132/artiq-zynq:devc-clean"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
It can now parse the header and load the bitstream from the bootimage, i.e.
boot.bin
stored in the SD card.@ -40,0 +129,4 @@
let buffer = &mut raw_buffer[offset..unencrypted_length as usize * 4 + offset];
file.read_exact(buffer).unwrap();
cache::dcci_slice(buffer);
Shouldn't this be moved into the devc driver?
This requires refactoring, as the current implementation just takes a
u32
as address... but should be simple to doOK please do it.
@ -40,0 +89,4 @@
// read boot header signature
file.seek(SeekFrom::Start(0x24)).unwrap();
if read_u32(file) != BOOT_HEADER_SIGN {
panic!("Invalid header!");
I would not use
panic!
here, instead return aResult
.Suggest moving all this boot.bin and bitstream loading code into its own file, e.g.
runtime/src/load_pl.rs
ok, I would try to turn the
panic
things andunwrap
things into appropriate error handling and refactor them intoload_pl.rs
.@ -60,3 +56,2 @@
} else {
info!("loading gateware");
unimplemented!("gateware loading");
// Load from SD card
Move this (i.e. the "Load for SD card" block, but not the "devc.is_done" test) to load_pl as well.
@ -46,20 +47,43 @@ pub fn main_core0() {
ram::init_alloc_linker();
match config::read_str("foo") {
Leave this.
@ -232,3 +232,3 @@
name = "libsupport_zynq"
version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#a17a5d2925e7e521f31320ccefd7bf3cb61c45a7"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#191da7c959baeb30e31196f2c35b0790ea25cbf6"
Changing Cargo.lock requires updating cargoSha256 in default.nix.
@ -57,3 +58,1 @@
// Do not load again: assume that the gateware already present is
// what we want (e.g. gateware configured via JTAG before PS
// startup, or by FSBL).
// Do not load again: assume that the gateware already present is
This should be indented one more block.
@ -23,3 +26,1 @@
mod kernel;
mod moninj;
mod sd_reader;
Why change the order of the imports?
@ -9,3 +9,3 @@
use log::info;
use libboard_zynq::{timer::GlobalTimer, logger, devc};
use fatfs::File;
Is this used?
@ -61,2 +62,2 @@
info!("loading gateware");
unimplemented!("gateware loading");
// Load from SD card
match load_pl::load_bitstream_from_sd(&mut devc) {
I think the
load_pl
module should create the DevC object itself.Release it above using e.g.
or simply
if devc::DevC::new().is_done()
if that works?I think it should work. I pass the DevC object as I thought we should treat that as a singleton, I would change that.