817. designware_mobile_storage: a proven DesignWare SD and eMMC host, released on its own
(From calef's rulings on pull request #1806; the title and slug are drafts. Milestone 813 (a proven FAT crate released on its own) is the shape this follows.)
calef's rulings, quoted from the maintainer comments on #1806 of 2026-10-07 (UTC):
- Policy: "Each publish-ours crate (NVMe, e1000e, the DesignWare pair, the JH7110 pair, xHCI, and
portable_executableonce it carries proofs) is published when ready (proofs passing, API stable), each through its own milestone at its review." His words: "Since the consumer would be other hobby OSes, I think it makes sense to publish them. [...] a nice legacy is a bunch of hobby oses that use its parts." - Crates: "one milestone per crate, minted now, each keeping its tree name (all free on crates.io as of today) [...] Names are ratified now and permanent on first publication." His words: "Yes, one per crate".
- The release rules are forks 1 to 4 and 6 of the same pull request, applied in Release below.
What exists, checked 2026-10-07 (UTC)
crates/designware_mobile_storage: 2,645 code lines (3,736 with comments), written by milestone 53 (the board's own peripherals: network and storage on real silicon), which is PARTIAL. It is the whole Synopsys Mobile Storage Host Controller driver (snps,dw-mshc) behind one smallhost_controller::RegisterWindowAndClocktrait: card bring-up, SD and eMMC commands, the FIFO, partitions. It drives radon's microSD slot and eMMC socket.- Eight Kani harnesses in the crate, each with a falsification patch. The scratch range never
touches a partition or sector zero. A FIFO step never overruns the FIFO or the buffer, an admitted
range is inside the card and the address, and an IDMAC chain describes exactly its bytes. The MBR
parse is total and reads each entry from its own bytes. A register field never exceeds its width,
the CSD decoders size a card without overflow, and the
EXT_CSDsector count is total. A served block never leaves its window, a harness that moved withservetodriver_process_contract. - Class B in #1806's note
notes/releasable-crates-2026-10-07.md. The cut is larger than that note's inventory says.jh7110::discoverreads aDeviceTreeBlob; under codebase rule 2 the caller passes the register region instead, and the query moves to the kernel side. Theservemodule is nife's own: it speaks nife's block protocol (file_system_contract::blk) and places nife's virtual addresses (address_space_layout::pair_page). Soserveand its harness move tocomponents/src/designware_mobile_storage.rs, or stay with the two constants inlined; the lane picks and records why. The tests alsoinclude_bytes!a fixture from../../device_tree_blob/tests/fixtures/, outside the package. - The crates take plain values, by the ruling in milestone 857 (crates released on their own).
- Cut on 2026-10-25 (UTC) by #2719.
Slot::from_nodedecodes one slot from a node's properties, andmachine_discovery::jh7110::designware_mobile_storagewalks the tree, with the fixtures beside its tests.serveand its harness moved tocrates/driver_process_contract, a contract crate, because the kernel and the EL0 driver incomponents/both link it. - Its consumers:
kernel/src/designware_mobile_storage.rs,kernel/src/storage_bench.rs,kernel/src/memory.rs,kernel/src/arch/riscv64/mmu.rs,kernel/src/user/designware_mobile_storage_service.rs, andcomponents/src/designware_mobile_storage.rs(the EL0 driver). - crates.io answers 404 for the name (checked 2026-10-07).
Reuse: the alternatives were surveyed in #1806's other-implementations.md appendix (looked up
2026-10-07), and none is taken, because calef ruled this crate "publish ours". rcore-os's
dwmmc-host 0.4.2 (Apache-2.0, 1.7k downloads) and starfive-jh7110-dwmmc 0.1.8 (911) live in the
tgoskits monorepo with no proofs found. drivercraft's sdmmc 0.1.0 (11k) is a general SD/MMC
crate with no proofs found. embedded-sdmmc is SD over SPI plus FAT, another scope, and its project
bans AI-generated contributions. The crate adapts OpenBSD's dwmmc.c (ISC; it keeps the notice) and
takes only the order of its addressing commands from sdmmc_mem.c. It reads Linux's dw_mmc
(GPL-2.0) and never copies it. No upstream offer goes anywhere, by the ruling in
milestone 814 (proven NVMe queue logic).
What is proven
Each row is a property this crate must prove before it publishes. The harness cell reads as in
milestone 813's table. Each patch is at crates/designware_mobile_storage/falsifications/. Stock
Kani proves all 8 properties in the tree, measured 2026-11-02 (UTC).
| property | harness |
|---|---|
| The scratch range never touches a partition or sector zero | proofs::the_scratch_range_never_touches_a_partition_or_sector_zero |
| A FIFO step never overruns the FIFO or the buffer | proofs::a_queue_step_never_overruns_the_queue_or_the_buffer |
| An admitted range is inside the card and the address | proofs::an_admitted_range_is_inside_the_card_and_the_address |
| An IDMAC chain describes exactly its bytes, inside the region | proofs::a_chain_describes_its_bytes_inside_the_region |
The MBR parse (partition::MasterBootRecord::parse) is total, accepts exactly the signed sectors, and reads each entry from its own bytes |
proofs::the_master_boot_record_parse_is_total_and_reads_each_entry_from_its_own_bytes |
A register field (card::extract_bits) never exceeds its width |
proofs::a_register_field_never_exceeds_its_width |
The CSD decoders (card::CardSpecificData) are total for any register and size a card without overflow |
proofs::a_card_specific_data_decode_is_total_and_never_overflows |
The EXT_CSD sector count (card::extended_card_specific_data_sectors) is total for any bytes |
proofs::an_extended_card_specific_data_sector_count_is_total |
The last four rows are this lane's reading of the hostile surface: a stranger's SD card supplies
its partition table and its registers. The MBR parse does not know the card's size, so that every
entry lies inside the card is the caller's check, not a property of the parse. The served-block
row left with serve on 2026-10-25: its harness is designware_mobile_storage::proofs::a_served_block_never_leaves_its_window in
crates/driver_process_contract. Not proven: the card bring-up state machine
(sd, command), timing, and the CID decode, which names the card and sizes nothing.
Release, by #1806's rulings
- The name is settled before anything leaves (857's Fork 5 as calef amended it on 2026-10-11 UTC).
script/names designware_mobile_storagereports it ratified, crates.io answers 404 for it (or it is already ours), andpartsfoundry/designware_mobile_storagedoes not exist yet.script/crate-standalonechecks the first. - Make the cut above.
cargo tree -p designware_mobile_storagethen lists no nife crate, and the tests read only fixtures inside the package. - In the tree,
script/verifyproves the harnesses andCargo.tomlsayspublish = false. - The package meets Fork 3 of
milestone 857 (crates released on their own).
cargo package --listshows its harnesses and falsification patches. - Ready means proofs passing and the API stable.
Milestone 814 (proven NVMe queue logic)
says how each is measured; here the soak is step 6. When the soak exits, calef adds it to the
lint-checked publish allowlist. The
partsfoundry/designware_mobile_storagerepository is created when the crate moves, on the shared CI template (milestone 887), through reusable workflows: Kani throughkani-github-action, lint, release. Its release workflow refuses to publish unless the proof job is green. No harness here readstarget_arch, so stock Kani proves them. §218 (carry a Kani patch so riscv64 is proved) applies only if a harness comes to need riscv64. Milestone 589 (Kani can prove riscv64 from the hosts we already have) built it. - Soak, as its own repository, until the soak's five end conditions in the runbook hold.
- Publish and consume the release by version, by the runbook's publication steps.
Parity
Pure logic, tested on the host against a simulated controller. This lane built it on 2026-10-07
with the pinned nightly for aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf,
x86_64-unknown-none and the host, all exit 0. The release workflow builds the same four.
Standalone, measured 2026-10-11 (UTC)
script/crate-standalone designware_mobile_storage fails today, at base ae6b91e79. The manifest
and files fail as for all nine crates in
milestone 814 (proven NVMe queue logic).
It does not build alone: address_space_layout, file_system_contract and device_tree_blob are
path dependencies outside the copy, so neither the build nor Kani ran. A test reads
../../device_tree_blob/tests/fixtures/qemu-riscv64-virt.dtb. Beyond manifest and files, 14 lines
cite this tree: 5 milestone N, 4 tree paths, 2 §N, 2 provenance blocks and 1 naming calef.
script/names reports the name designware_mobile_storage ratified (checked 2026-10-25).
Measured again on 2026-10-25 (UTC) with --no-kani: the manifest and files pass, and the only
citations left sit in Name: blocks, which stay until the ratification pass. address_space_layout,
file_system_contract and device_tree_blob are still path dependencies, so the copy does not
build; the second half of the cut removes them.
Measured again after the cut on 2026-10-25 (UTC), with Kani: the manifest has no dependencies, the
crate builds for the host and the three targets on 1.88. Stock Kani proves all 4 harnesses, and
each falsification patch makes its harness fail. The only failures left are citations in Name:
blocks, which the ratification pass settles.
Review before release
- The public API speaks the device's vocabulary, by the test milestone 813 states. A reviewer judges
this; no script can. Known today: nothing.
serve, which spoke nife's block protocol, left with the cut.
Names a stranger may misread, open before release
design/naming.md's tests and 857's Fork 5 judge each name. The lines below list the names that read as something other than clear or a term, as of 2026-10-26 (UTC), copied as they stand. Each stays open until a ruling keeps or changes it. The tree keeps no record of a release-track crate's names (ruled 2026-10-26 UTC), so this list is the open work, and the lane that renames a name drops its line.
Nife's own plan
role(src/jh7110.rs): nife: nife's own process plan
Belongs to something else
bench(src/bench.rs): scope: a benchjh7110(src/jh7110.rs): scope: one SoC's glue in a host controller cratepartition(src/partition.rs): scope: partitionsMATRIX_BLOCKS(src/bench.rs): scope: a benchMATRIX_HZ(src/bench.rs): scope: a benchMatrixRow(src/bench.rs): scope: a benchWatch(src/bench.rs): scope: a benchread_matrix(src/bench.rs): scope: a bench
Generic
bits(src/card.rs): genericData(src/command.rs): genericword(src/command.rs): genericKind(src/sd.rs): generic
Exit
A check proves it. In nife, cargo tree --locked -i designware_mobile_storage resolves to v0.1.x
from crates.io with a checksum in Cargo.lock, crates/designware_mobile_storage no longer exists,
and the tree builds for all three targets. In partsfoundry/designware_mobile_storage, the run that
published 0.1.0 shows the Kani job green ahead of the publish job, and every harness's falsification
patch makes its proof fail. The five soak criteria of release step 6 hold before it publishes.
The name check of release step 1 passes first, by Fork 5 of milestone 857. Before the move,
script/crate-standalone designware_mobile_storage exits 0 in nife, and every row of What is
proven names a harness that stock Kani proves in the copy and whose falsification patch makes it
fail. No crate publishes without the proofs milestone 857 (crates released on their own) requires.
What the crate no longer cites
The crate's source cites nothing of this tree beyond its Name: blocks. This section keeps the
links it carried, by milestone 857's provenance rule.
Cargo.toml, the package comment: theno_stdand host-test split is the pure-logic split of §7 (Testing: QEMU harness + host-testable crates, from commit one) that every driver crate here uses. Milestone 53 (the board's own peripherals: network and storage on real silicon) wrote the crate.src/lib.rs, the crate doc: the design is innotes/designware-mobile-storage.md, andkernel/src/designware_mobile_storage.rsimplementshost_controller::RegisterWindowAndClockover the mapped window. That note also records why the lane did not take the crates.io candidate. The IDMAC bench step that the crate's BUGS waits on is the one that note describes.src/simulator.rs, the module doc:notes/designware-mobile-storage/driver.mdlists each behavior the simulated controller models.src/tests.rs, the module doc: the tests leftlib.rson 2026-10-12 (UTC), in lane maintainer/mutation-triage-2026w42, so the crate root stays an index under §282 (when a file is split, the parent becomes an index).src/partition.rs, the module doc:notes/visionfive2.md, "The microSD payload", describes the card radon boots from.src/jh7110.rs, the module doc:notes/designware-mobile-storage/driver.mdholds every node, clock, reset and log line of the two device trees.src/sd.rs, the module doc:notes/designware-mobile-storage/driver.mdholds the steps,CMD0toCMD16andEXT_CSD.src/bench.rs,Watch: it serves milestone 53 (the board's own peripherals: network and storage on real silicon)'s multi-block read diagnosis.
BUGS
- Steps 5 and 6 wait on milestone 887 (one CI template) and on 610's co-change column.
- Milestone 53 (the board's own peripherals: network and storage on real silicon) is PARTIAL, so the API is still moving.
- The device-tree fixtures behind this crate's decoder are
jh7110-mmc-mainline.dts,jh7110-mmc-vendor.dtsandjh7110-mmc-odd.dtsincrates/machine_discovery/tests/fixtures/, outside this package. They are excerpts of the mainline and vendor JH7110 trees. needs_personisyesbecause the exit includes a publication only calef can approve. Everything before step 7 can start now.
Follow-on
- Outstanding. The crate's repository exists and nife builds against its pinned commit. What
remains is the tag
v0.1.0, the soak's end conditions, the publication and nife consuming the release by semantic version. Checked bygh api repos/partsfoundry/designware_mobile_storage/tags, which lists no tag, and bycargo tree --locked -i designware_mobile_storage, which resolves to the git pin and not to crates.io.
Index row
nife's Synopsys DesignWare Mobile Storage host driver for SD cards and eMMC, with eight Kani proofs
and their falsification patches, cut free of nife's device tree, block protocol and address map. It
is published on crates.io as designware_mobile_storage 0.1 from its own nifeos repository.