Attention is currently required from: Subrata Banik, Paul Menzel, Tim Wawrzynczak, Stefan Reinauer, Angel Pons. Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/54305 )
Change subject: util/ifdtool: Use -p platform name to detect IFDv2 platform and chipset ......................................................................
Patch Set 6:
(3 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/54305/comment/80b2165e_bd2952ff PS6, Line 8: You have captured all the details in the commit message, but it still seems a little confusing.
Does this make sense: ``` ifdtool uses `chipset` information to determine how certain straps are decoded. This has been used for IFDv1 platforms as well as IFDv2 platforms (CHIPSET_500_600_SERIES_TIGER_ALDER_POINT). IFDv2 platforms are all expected to pass in `-p` argument to identify the platform. This platform information can be used to identify the appropriate chipset information. For IFDv1 since `-p` argument is not provided, ifdtool needs to guess the chipset using certain fields in the descriptor (e.g. strap length).
This change updates `check_ifd_version()` function to: 1. Determine if IFD version is v1 or v2 based on `-p` argument. If `-p` is not provided, it assumes that the platform is using IFDv1. 2. Based on IFD version, it calls either `ifd2_platform_to_chipset()` or `ifd1_guess_chipset()` to determine chipset information.
This fixes the issue reported with CB:44815, where ifdtool is unable to identify Alder Lake chipsets. ```
File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/54305/comment/0bf3519b_17897b46 PS6, Line 207: guess_ifd_2_chipset I think this function should be named differently. It is not really guessing the chipset. `get_ifd2_chipset_from_platform()` or `ifd2_platform_to_chipset()`?
https://review.coreboot.org/c/coreboot/+/54305/comment/7d7b48a0_a2fee524 PS6, Line 246: chipset = guess_ifd_2_chipset(platform); Since this function is named `is_platform_ifd_2()`, I think it is not correct to have a side-effect of setting chipset here. Instead this should be done at the caller site.
``` if (is_platform_ifd_2()) { ifd_version = IFD_VERSION_2; chipset = ifd2_platform_to_chipset(platform); } else { ifd_version = get_ifd_version_from_fcba(image, size); chipset = ifd1_guess_chipset(); } ```