Repository navigation
cv6xx: keep the parser's first-table offset, and say where its bounds come from - #166
Merged
Merged
Conversation
… come from build_ddr_table() re-read the DDR header's structure length from the raw file to rebuild the offset of table 0, which parse_cv6xx_boot() had already validated. CV6xxBootParts now carries that offset instead of offset_32, the only thing offset_32 was used for, so the two cannot read the header differently. The parser's bounds get the layouts they were set against: the GSL header at 0x800 (hi3516cv608/cv610) or 0x1200 (hi3519dv500), 0x400 or 0x100 between the GSL and the DDR header, and an 8-byte board map that caps the tables at eight. The browser copy points at those comments. Output is byte-identical to master for every published cv608, cv610 and hi3519dv500 boot image and every board ID.
PR Summary by QodoCV6xx: Reuse the validated DDR table offset and document parser bounds
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR |
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.
Follow-up to #130, covering the two nits from its review.
Changes
CV6xxBootParts.first_table_offsetreplacesoffset_32.build_ddr_table()used to read the DDR header'sstructure_lengthfromfile_dataagain to rebuild where table 0 starts, even thoughparse_cv6xx_boot()had already validated that. The parser now keeps the validated offset, so the two can't drift.offset_32had no other users; the browser parser already kepttableOffset.The parser's bounds are documented with the layouts they were set against, measured on the published images:
boot-hi3516cv608-nor.bin,boot-hi3516cv610-*-nor.bin0x8000x400boot-hi3519dv500-dmebpro-nor.bin0x12000x100MAX_GSL_HEADER_OFFSET(64 KiB) andMAX_SECTION_GAP(4 KiB) leave room past both layouts.MAX_DDR_TABLES= 8 because the board map has 8 entries, so a ninth table could never be selected. The browser constants point at the Python comment.Verified
build_ddr_table()output are byte-identical to master for all six published images and board IDs 0–9.pytest tests/ --ignore=tests/fuzz: 1097 passed, 3 skipped. Fuzz: 16 passed.node --test: 95 passed.