hal: microchip: pic32cz_ca90: fix PHY24 and EPINFO in usbhs.h #85
All Vouch review confidence checks passed
Residual risk 0.12 = Change Risk (0.22) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.22 · 7 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.00 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.350
Diff Size
diff_size
0.124
Real PR Conversation Timeline
2 items
Approved
Approved these changes.
Madhan-Kurukondar
TheArkadiuszGrzelka
Two bitfields in the PIC32CZ CA90 USBHS component header do not match the PIC32CZ CA80/CA90 Family Data Sheet (DS60001749).
1.
USBHS_PHY24(offset 0x1524) has no field for bit 1. The field list jumps fromHSSLEW2at bit 0 toRSVD0at bit 2, andUSBHS_PHY24_Mskis0x000000FD, which excludes bit 1 from the register mask. Data sheet section 37.15.10 documents bit 1 asOTGPDN, "ODT Power Down". A write built by ORing this header's masked field values can never set that bit.2.
USBHS_EPINFO_RESETVALUE(offset 0x1078, read-only) is0xFF, which the header's ownTXENDPOINTS/RXENDPOINTSsplit would read as 15 TX and 15 RX endpoints. Data sheet section 37.7.31 gives the per-bit reset value as0111_0111, that is0x77: 7 TX and 7 RX endpoints, matching the part's documented endpoint count.Both are already present in the PIC32CZ8110CA90208 ATDF bundled alongside this header in the same pack directory, so the header is a correct transcription of pack data that itself disagrees with the printed data sheet.
Full write-up, including the datasheet and ATDF checks: zephyrproject-rtos/zephyr#119959
Fix
Add the missing
OTGPDNfield at bit 1, widenUSBHS_PHY24_Mskto0x000000FFto include it, and correctUSBHS_EPINFO_RESETVALUEto0x77. Scoped to the CA90 pack only, the part this was checked against; CA80 and CA91 carry the identical bug in their own copy of this header and likely want the same fix, noted in the linked issue.Testing
Checked the changed macros expand as expected with a standalone preprocessor/
_Static_assertcheck (USBHS_PHY24_OTGPDN_Msk == 0x2,USBHS_PHY24_Msk == 0xFF,USBHS_EPINFO_RESETVALUE == 0x77). No PIC32CZ CA90 USBHS driver exists in-tree yet to exercise this header through a build.