roadmap PARTIAL

819. jh7110_clock_and_reset: JH7110 clock and reset logic, proven, then 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):

What exists, checked 2026-10-07 (UTC)

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". The only Rust JH7110 crates found, weathered-steel's jh71xx-pac 0.11.1 and jh71xx-hal 0.7.2 (Codeberg, 2025-03), are register maps under GPL-3.0-only, which nife cannot take under its license. No Rust crate for the clock and reset logic was found. Linux's clk-starfive-jh7110-* drivers stay the reference and are read, never copied. The I2C timing function standard_mode_100k takes no text from any driver: its counts follow from the I2C specification's standard-mode limits and the DesignWare count registers' description, and its fill (the whole shortfall to the low count) is nife's own. OpenBSD's dwiic.c (ISC) states no equations (read 2026-11-01), so no notice rides with the function. No upstream offer goes anywhere, by the ruling in milestone 814 (proven NVMe queue logic).

What is proven

Four properties, which nine harnesses prove in crates/jh7110_clock_and_reset/src/lib.rs. Every harness carries a falsification patch that makes it fail at its own assertion, at crates/jh7110_clock_and_reset/falsifications/<module.path>.<harness>.patch, as §134 (a harness carries a machine-replayable falsification record) and script/falsifications require.

property harnesses
with_parent changes only the mux field: for every word and every parent, every bit outside CLOCK_MULTIPLEXER_MASK stays as it was and an over-wide parent never spills into the enable bit with_parent_changes_only_the_mux_field
Every offset a domain answers is one of its own words: Domain::clock_offset and Domain::reset_bit return none past the domain's clocks or resets count, and otherwise a word-aligned offset inside its range and a one-bit mask, for all three domains a_clock_offset_is_one_of_the_domains_own_words, a_reset_line_is_one_bit_of_one_of_the_domains_own_words
Every plan ungates its clocks before it releases its reset: the six fixed plans, and plans the crate builds from caller-supplied specifiers, hold only in-bounds ids, never more than MAXIMUM_POWER_MANAGEMENT_CHIP_BUS_STEPS (or MAXIMUM_DEVICE_STEPS), with every EnableClock ahead of every DeassertReset every_fixed_plan_ungates_its_clocks_before_releasing_a_reset, a_device_plan_from_specifiers_ungates_before_it_releases, the_pmic_bus_plan_is_never_empty_and_ungates_before_it_releases
The status decoders (is_deasserted, is_clock_enabled, clock_divider) are total and match their definitions for every word is_deasserted_reads_the_bit_the_mask_names, is_clock_enabled_reads_bit_31_and_nothing_else, clock_divider_is_the_low_24_bits_and_nothing_else

The two built-plan harnesses take the solver 80 to 90 seconds each. They model the caller's phandle lookup as one SYS controller with one cell per specifier, and feed two clock specifiers and one reset specifier of whole length. Not proved:

The host tests cover those by example. A lookup that answered differently on every call ran for over an hour without finishing, and five specifiers timed out at 280 seconds.

Not proven, by design: that a plan's order is the one the silicon needs, which only a board shows, and the device-tree queries, which the cut moves out of the crate.

Release, by #1806's rulings

  1. The name is settled before anything leaves (857's Fork 5 as calef amended it on 2026-10-11 UTC). script/names jh7110_clock_and_reset reports it ratified, crates.io answers 404 for it (or it is already ours), and nifeos/jh7110_clock_and_reset does not exist yet. script/crate-standalone checks the first.
  2. The proofs above exist with their falsification patches, and the cut stands. cargo tree -p jh7110_clock_and_reset then lists no nife crate.
  3. In the tree, script/verify proves the harnesses and Cargo.toml says publish = false.
  4. The package meets Fork 3 of milestone 857 (crates released on their own). cargo package --list shows its harnesses and falsification patches.
  5. 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 nifeos/jh7110_clock_and_reset repository is created when the crate moves, on the shared CI template (milestone 887), through reusable workflows: Kani through kani-github-action, lint, release. Its release workflow refuses to publish unless the proof job is green. Nothing here reads target_arch, so stock Kani serves. §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.
  6. Soak, as its own repository, until the soak's five end conditions in the runbook hold.
  7. Publish and consume the release by version, by the runbook's publication steps.

Parity

Pure logic, tested on the host. 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. The silicon is riscv64 only; the crate is not.

Standalone

script/crate-standalone jh7110_clock_and_reset is clean: it builds the crate in a copy on 1.88 for the host and the three bare-metal targets, proves all nine harnesses with stock Kani, and replays all nine falsification patches red. script/names reports the crate's name and every Name: block ratified, CLOCK_MULTIPLEXER_MASK by the architect on 2026-11-11 (UTC).

Before the move

The template's gates, run as milestone 816 (proven DesignWare Ethernet QoS logic) runs them, find:

gate findings what they are
spelled_out 7 the private clock and reset ids named for the binding's SDIO0, SDIO1 and GMAC0_TX
register_names 8 five len and size fields with no unit; the field power_management_chip_address, the PMIC's I2C bus address, with no bus qualifier; and two test names that say addresses
prose_acronyms 28 acronyms in doc comments not expanded at their first use

Each is a rename or a doc-comment edit in this tree before the move, with its consumers. Who decides each rename is as in milestone 816 (proven DesignWare Ethernet QoS logic). The README meets the template's prose caps.

Review before release

Exit

A check proves it. script/verify proves the four properties and script/falsifications reports every harness replayable. In nife, cargo tree --locked -i jh7110_clock_and_reset resolves to v0.1.x from crates.io with a checksum in Cargo.lock, crates/jh7110_clock_and_reset no longer exists, and the tree builds for all three targets. In nifeos/jh7110_clock_and_reset, the run that published 0.1.0 shows the Kani job green ahead of the publish job. 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 jh7110_clock_and_reset 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.

BUGS

Follow-on

Index row

nife's StarFive JH7110 clock and reset generator logic, which carries no proofs today, gains four Kani proofs with falsification patches, is cut free of nife's device tree, and is published on crates.io as jh7110_clock_and_reset 0.1 from its own nifeos repository.