diff --git a/justfile b/justfile new file mode 100644 index 0000000..a761458 --- /dev/null +++ b/justfile @@ -0,0 +1,5 @@ + +[working-directory: 'zynq-boot-image/staging'] +bootgen: + bootgen -arch zynq -image boot.bif -o boot.bin -w on + echo "Generated boot.bin at zynq-boot-image/staging" diff --git a/zynq-boot-image/staging/README.md b/zynq-boot-image/staging/README.md index 9f6e028..976ca93 100644 --- a/zynq-boot-image/staging/README.md +++ b/zynq-boot-image/staging/README.md @@ -21,4 +21,8 @@ should run in DDR. You can copy the files into the staging area, using the file names `fsbl.elf`, `fpga.bit` and `application.elf`, which are also ignored by the VCS. -Then, you can simply run `bootgen` to generate the boot binary. +Then, you can simply run `bootgen` to generate the boot binary: + +```sh +bootgen -arch zynq -image boot.bif -o boot.bin -w on +``` diff --git a/zynq-boot-image/tester/Cargo.lock b/zynq-boot-image/tester/Cargo.lock index 708ef6a..a6fe1da 100644 --- a/zynq-boot-image/tester/Cargo.lock +++ b/zynq-boot-image/tester/Cargo.lock @@ -52,53 +52,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "arbitrary-int" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825297538d77367557b912770ca3083f778a196054b3ee63b22673c4a3cae0a5" - -[[package]] -name = "arbitrary-int" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c858caffa49edfc4ecc45a4bec37abd3e88041a2903816f10f990b7b41abc281" - -[[package]] -name = "arm-targets" -version = "0.2.0" -source = "git+https://github.com/rust-embedded/cortex-ar.git?rev=79dba7000d2090d13823bfb783d9d64be8b778d2#79dba7000d2090d13823bfb783d9d64be8b778d2" - -[[package]] -name = "bitbybit" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec187a89ab07e209270175faf9e07ceb2755d984954e58a2296e325ddece2762" -dependencies = [ - "arbitrary-int 1.3.0", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cfg-if" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" - [[package]] name = "clap" version = "4.5.46" @@ -145,188 +98,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" -[[package]] -name = "cortex-ar" -version = "0.2.0" -source = "git+https://github.com/rust-embedded/cortex-ar.git?rev=79dba7000d2090d13823bfb783d9d64be8b778d2#79dba7000d2090d13823bfb783d9d64be8b778d2" -dependencies = [ - "arbitrary-int 1.3.0", - "arm-targets", - "bitbybit", - "num_enum", - "thiserror", -] - -[[package]] -name = "critical-section" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "delegate" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6178a82cf56c836a3ba61a7935cdb1c49bfaa6fa4327cd5bf554a503087de26b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "derive-mmio" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cb20d58c6618082f91e4f5bde31422e73dd59afeda16c61c94fd15adcf8812b" -dependencies = [ - "derive-mmio-macro", - "rustversion", -] - -[[package]] -name = "derive-mmio-macro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92bcaf79d5ee81fac0a867e95df6943cde5e42c82059a9ec93fc0c6cb8ae35a" -dependencies = [ - "proc-macro-error2", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "embassy-net-driver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524eb3c489760508f71360112bca70f6e53173e6fe48fc5f0efd0f5ab217751d" - -[[package]] -name = "embassy-sync" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73974a3edbd0bd286759b3d483540f0ebef705919a5f56f4fc7709066f71689b" -dependencies = [ - "cfg-if", - "critical-section", - "embedded-io-async", - "futures-core", - "futures-sink", - "heapless 0.8.0", -] - -[[package]] -name = "embedded-dma" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "994f7e5b5cb23521c22304927195f236813053eb9c065dd2226a32ba64695446" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "embedded-hal", -] - -[[package]] -name = "embedded-hal-nb" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605" -dependencies = [ - "embedded-hal", - "nb", -] - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "embedded-io-async" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" -dependencies = [ - "embedded-io", -] - -[[package]] -name = "fugit" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17186ad64927d5ac8f02c1e77ccefa08ccd9eaa314d5a4772278aa204a22f7e7" -dependencies = [ - "gcd", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "gcd" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" - -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32", - "stable_deref_trait", -] - -[[package]] -name = "heapless" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1edcd5a338e64688fbdcb7531a846cfd3476a54784dcb918a0844682bc7ada5" -dependencies = [ - "hash32", - "stable_deref_trait", -] - [[package]] name = "heck" version = "0.5.0" @@ -339,101 +110,12 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "libm" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "managed" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" - -[[package]] -name = "num_enum" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" -dependencies = [ - "num_enum_derive", - "rustversion", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -dependencies = [ - "critical-section", - "portable-atomic", -] - [[package]] name = "once_cell_polyfill" version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "portable-atomic" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.101" @@ -452,64 +134,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "raw-slicee" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d8fb5aaf355f81e39a4834840f68e809ee98c83f556dcfb8c16fd7004fe4dc" -dependencies = [ - "embedded-dma", -] - -[[package]] -name = "ringbuf" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe47b720588c8702e34b5979cb3271a8b1842c7cb6f57408efa70c779363488c" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "smoltcp" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" -dependencies = [ - "bitflags", - "byteorder", - "cfg-if", - "heapless 0.8.0", - "managed", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "static_cell" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0530892bb4fa575ee0da4b86f86c667132a94b74bb72160f58ee5a4afec74c23" -dependencies = [ - "portable-atomic", -] - [[package]] name = "strsim" version = "0.11.1" @@ -532,7 +156,7 @@ name = "tester" version = "0.1.0" dependencies = [ "clap", - "zynq7000-hal", + "zynq-boot-image", ] [[package]] @@ -567,12 +191,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "vcell" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" - [[package]] name = "windows-link" version = "0.1.3" @@ -654,56 +272,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] -name = "zynq-mmu" +name = "zynq-boot-image" version = "0.1.0" dependencies = [ - "cortex-ar", "thiserror", ] - -[[package]] -name = "zynq7000" -version = "0.1.0" -dependencies = [ - "arbitrary-int 1.3.0", - "bitbybit", - "derive-mmio", - "once_cell", - "rustversion", - "static_assertions", - "thiserror", -] - -[[package]] -name = "zynq7000-hal" -version = "0.1.0" -dependencies = [ - "arbitrary-int 2.0.0", - "bitbybit", - "cortex-ar", - "critical-section", - "delegate", - "embassy-net-driver", - "embassy-sync", - "embedded-hal", - "embedded-hal-async", - "embedded-hal-nb", - "embedded-io", - "embedded-io-async", - "fugit", - "heapless 0.9.1", - "libm", - "log", - "nb", - "num_enum", - "paste", - "raw-slicee", - "ringbuf", - "smoltcp", - "static_assertions", - "static_cell", - "thiserror", - "vcell", - "zynq-mmu", - "zynq7000", -] diff --git a/zynq-boot-image/tester/Cargo.toml b/zynq-boot-image/tester/Cargo.toml index 1073a57..4cc3de7 100644 --- a/zynq-boot-image/tester/Cargo.toml +++ b/zynq-boot-image/tester/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "tester" version = "0.1.0" diff --git a/zynq-boot-image/tester/src/main.rs b/zynq-boot-image/tester/src/main.rs index b414d9c..29aa0ba 100644 --- a/zynq-boot-image/tester/src/main.rs +++ b/zynq-boot-image/tester/src/main.rs @@ -1,3 +1,4 @@ +//! Small tester app to verify some of the API offers by the zynq-boot-image crate. use std::{io::Read, path::Path}; use clap::Parser as _;