Repository navigation
rewrite(phase3): port mdio from c-RCP, revert an earlier session's own regression - #138
Merged
Merged
Conversation
…n regression Part of the v3.0.0 ground-up rewrite (cpp-RCP #129, ROADMAP.md Phase 17), branch rewrite/v3-from-c-rcp. First of Phase 3 Wave 2's three batches, alongside spi/uart and pwm/wakeup (separate PRs). c-RCP's largest single endpoint source file (ep_mdio.c, 1195 lines) -- mdio.hpp needed the largest single content expansion of any Phase 3 batch (309 -> 1354 lines). - A prior session's own 'addressing-model fix' (issue #72) was itself wrong and has been reverted: it discarded the real Clause-22/Clause-45 (MMD) addressing (5-bit prtad, plus regad directly or devad+16-bit regad) for an invented opaque mdio_address field, on the theory that Clause 22/45 had 'no basis' in TC18. c-RCP's ep_mdio.h/.c (rcp_ep_mdio_addr_t, rcp_ep_mdio_addr_valid(), rcp_ep_mdio_burst_next_regad()) keeps this addressing as real, load-bearing content -- restored as MdioAddr/addr_valid()/ burst_next_regad() (REQ-MDIO-001/002). - No ACF-level wire codec existed at all -- ported the complete read/write request/response pair for both the MMD family and the entirely separate MMS family (REQ-MDIO-012-019/025-028). - MMS (Memory Map Selector) addressing family was entirely missing -- added MdioMmsAddr, mms_addr_valid()/mms_uses_32bit_words()/ mms_burst_next_addr()/mms_mode_for_word_count(), plus 32-bit word packing (REQ-MDIO-022/024). - REQ-MDIO-024 (the external-spec ambiguity) reflected explicitly: TC18 itself never specifies mdio_address's bit layout for MMS mode (spec-defects item 55, still open); c-RCP closed it with a documented, externally-sourced assumption (OPEN Alliance 10BASE-T1x MAC-PHY Serial Interface Spec V1.1's 4-bit MMS selector + 16-bit ADDR) -- carried forward as MdioMmsAddr{mms, addr}, kept characterized as PARTIAL not IMPLEMENTED, matching c-RCP's own .fusa-reqs.json status. - Table 59 functional-config register block was entirely missing -- added, with no base_clk row (unlike every other endpoint type, since Table 59 genuinely defines none) (REQ-MDIO-009/010/020/023). - Invented TriggerRegistry/MdioSignal::TransferComplete removed -- c-RCP's own file header states MDIO has no trigger-signal table at all, mirroring can.hpp's CanEndpoint (no TriggerRegistry either). Fixed-capacity: EpFuncBlock is std::array<uint8_t, 6> (narrower than sibling endpoints since MDIO has no base_clk row). test_mdio.cpp: 12 -> 121 TEST_CASEs (420 assertions). Call sites touched: none. MdioRequest/MdioResponse/MdioEndpoint's transact/handle_request/last_request kept fully source-compatible, so mock.hpp's dispatch_mdio() and its own MDIO tests compile and pass unmodified. Verified: full tree rebuilds clean (223/223 targets), 56/56 ctest suites pass (100%) -- independently re-verified from a fresh build, not just the porting agent's own report. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the v3.0.0 ground-up rewrite (#129, ROADMAP.md Phase 17), branch
rewrite/v3-from-c-rcp. First of Phase 3 Wave 2's three batches (alongsidephase3/spi-uartandphase3/pwm-wakeup, separate PRs).c-RCP's largest single endpoint source file (
ep_mdio.c, 1195 lines) —mdio.hppneeded the largest single content expansion of any Phase 3 batch (309 → 1354 lines).Content deltas vs. prior cpp-RCP state
prtad, plusregaddirectly ordevad+16-bitregad— in favor of an invented opaquemdio_addressfield, on the mistaken theory that Clause 22/45 had no TC18 basis. c-RCP'sep_mdio.h/.c(rcp_ep_mdio_addr_t,rcp_ep_mdio_addr_valid(),rcp_ep_mdio_burst_next_regad()) keeps this addressing as real, load-bearing content — restored asMdioAddr/addr_valid()/burst_next_regad()(REQ-MDIO-001/002).MdioMmsAddr,mms_addr_valid()/mms_uses_32bit_words()/mms_burst_next_addr()/mms_mode_for_word_count(), plus 32-bit word packing (REQ-MDIO-022/024).mdio_address's bit layout for MMS mode (spec-defects item 55, still open in c-RCP); c-RCP closed it with a documented, externally-sourced assumption (OPEN Alliance 10BASE-T1x MAC-PHY Serial Interface Spec V1.1's 4-bit MMS selector + 16-bit ADDR) — carried forward asMdioMmsAddr{mms, addr}, kept characterized as PARTIAL not IMPLEMENTED, matching c-RCP's own.fusa-reqs.jsonstatus.base_clkrow (unlike every other endpoint type — Table 59 genuinely defines none) (REQ-MDIO-009/010/020/023).TriggerRegistry/MdioSignal::TransferComplete— c-RCP's own file header states MDIO has no trigger-signal table at all, mirroringcan.hpp'sCanEndpoint(noTriggerRegistryeither).Fixed-capacity:
EpFuncBlockisstd::array<uint8_t, 6>(narrower than sibling endpoints, since MDIO has nobase_clkrow).test_mdio.cpp: 12 → 121TEST_CASEs (420 assertions).Call sites
None touched —
MdioRequest/MdioResponse/MdioEndpoint'stransact/handle_request/last_requestkept fully source-compatible, somock.hpp'sdispatch_mdio()and its own MDIO tests compile and pass unmodified.Verification
Full tree rebuilds clean (223/223 targets), 56/56 ctest suites pass (100%) — independently re-verified from a fresh build in the worktree, not just the porting agent's own report.