psptool: Improve Zen generation parsing#79
Conversation
The tertiary directories (formally known as ISH structures) and combo directories contain PSP IDs that PSP checks to match the silicon supported by given directory. Extract the PSP IDs from the ISH structures and determine the Zen generation from the PSP ID. This change adds mainly the PSP IDs for AM5 platforms. The code determining Zen generation has been moved to the directory class sources to let the tool determine it on directory creation happening in multiple places in the tool. The printed directories are now extended with the Zen generations and PSP IDs the directory supports. It has been noticed on AM5 BIOS images, that certain directory pointers in ISH structures may point to the same L2 directory, but have a different PSP ID only. Thus it is necessary to recursively update the Zen generation and supported PSP IDs to all directories underneath the one being detected and parsed. TEST=Parse MSI PRO B850-P WIFI BIOS 7E56v2A75 and see the PSP IDs and Zen generation supported by L2 directories. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Metrics
|
| Metric | Value |
|---|---|
| Files Processed | 68 |
| Stdout Lines | 14,913 |
| Stderr Lines | 144 |
| Total Lines | 15,057 |
| Error Ratio | 0.96% |
PSPTool python library metrics
| Status | Count | Percentage |
|---|---|---|
| ✓ Successful | 68 | 100.0% |
| ✗ Failed | 0 | 0.0% |
| Total | 68 | 100% |
All files parsed successfully!
|
More about ISH structure can be found here: https://github.com/coreboot/coreboot/blob/main/util/amdfwtool/amdfwtool.h#L339 Before the change: https://paste.dasharo.com/?4b79a6e778c6b460#82xPk8VLi3xohkT5uZ6DJLpV7joVeqtb7JR6aj96Zxbi The main rationale here was to identify which directories support which families of processors, because it was hard to find out otherwise (unless manually parsing hexdumps...). I had no better idea how to expose it, so I preserved the |
|
Oh, I didn't spot that the tests don't success. If you find the time to fix the issue before I do, I'm grateful: https://github.com/PSPReverse/PSPTool/actions/runs/21401532497/job/61613651611 I also enabled the Python tests (with access to the private fixtures repo) now for all PRs actually, so we should be able to spot these kinds of bugs before merging. |
The tertiary directories (formally known as ISH structures) and combo directories contain PSP IDs that PSP checks to match the silicon supported by given directory. Extract the PSP IDs from the ISH structures and determine the Zen generation from the PSP ID. This change adds mainly the PSP IDs for AM5 platforms.
The code determining Zen generation has been moved to the directory class sources to let the tool determine it on directory creation happening in multiple places in the tool. The printed directories are now extended with the Zen generations and PSP IDs the directory supports. It has been noticed on AM5 BIOS images, that certain directory pointers in ISH structures may point to the same L2 directory, but have a different PSP ID only. Thus it is necessary to recursively update the Zen generation and supported PSP IDs to all directories underneath the one being detected and parsed.
TEST=Parse MSI PRO B850-P WIFI BIOS 7E56v2A75 and see the PSP IDs and Zen generation supported by L2 directories.