amdfwtool: Set the level based on cookie
It was complicated and weird to check both the cookie and whether one table is a null pointer. Just checking the cookie is enough. TEST=Identical test on all AMD SOC platform Change-Id: Icab74714990f74e11fd5e899661e4e2d41230541 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81208 Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -878,14 +878,13 @@ static void integrate_psp_firmwares(context *ctx,
|
|||||||
* flattened table which contains all applicable types. These if-else
|
* flattened table which contains all applicable types. These if-else
|
||||||
* statements infer what the caller intended. If a 2nd-level cookie
|
* statements infer what the caller intended. If a 2nd-level cookie
|
||||||
* is passed, clearly a 2nd-level table is intended. However, a
|
* is passed, clearly a 2nd-level table is intended. However, a
|
||||||
* 1st-level cookie may indicate level 1 or flattened. If the caller
|
* 1st-level cookie may indicate level 1 or flattened.
|
||||||
* passes a pointer to a 2nd-level table, then assume not flat.
|
|
||||||
*/
|
*/
|
||||||
if (!cb_config->multi_level)
|
if (!cb_config->multi_level)
|
||||||
level = PSP_BOTH;
|
level = PSP_BOTH;
|
||||||
else if (cookie == PSPL2_COOKIE)
|
else if (cookie == PSPL2_COOKIE)
|
||||||
level = PSP_LVL2;
|
level = PSP_LVL2;
|
||||||
else if (pspdir2)
|
else if (cookie == PSP_COOKIE)
|
||||||
level = PSP_LVL1;
|
level = PSP_LVL1;
|
||||||
else
|
else
|
||||||
level = PSP_BOTH;
|
level = PSP_BOTH;
|
||||||
@@ -893,7 +892,7 @@ static void integrate_psp_firmwares(context *ctx,
|
|||||||
if (recovery_ab) {
|
if (recovery_ab) {
|
||||||
if (cookie == PSPL2_COOKIE)
|
if (cookie == PSPL2_COOKIE)
|
||||||
level = PSP_LVL2_AB;
|
level = PSP_LVL2_AB;
|
||||||
else if (pspdir2)
|
else if (cookie == PSP_COOKIE)
|
||||||
level = PSP_LVL1_AB;
|
level = PSP_LVL1_AB;
|
||||||
else
|
else
|
||||||
level = PSP_BOTH_AB;
|
level = PSP_BOTH_AB;
|
||||||
@@ -1180,14 +1179,13 @@ static void integrate_bios_firmwares(context *ctx,
|
|||||||
* flattened table which contains all applicable types. These if-else
|
* flattened table which contains all applicable types. These if-else
|
||||||
* statements infer what the caller intended. If a 2nd-level cookie
|
* statements infer what the caller intended. If a 2nd-level cookie
|
||||||
* is passed, clearly a 2nd-level table is intended. However, a
|
* is passed, clearly a 2nd-level table is intended. However, a
|
||||||
* 1st-level cookie may indicate level 1 or flattened. If the caller
|
* 1st-level cookie may indicate level 1 or flattened.
|
||||||
* passes a pointer to a 2nd-level table, then assume not flat.
|
|
||||||
*/
|
*/
|
||||||
if (!cb_config->multi_level)
|
if (!cb_config->multi_level)
|
||||||
level = BDT_BOTH;
|
level = BDT_BOTH;
|
||||||
else if (cookie == BHDL2_COOKIE)
|
else if (cookie == BHDL2_COOKIE)
|
||||||
level = BDT_LVL2;
|
level = BDT_LVL2;
|
||||||
else if (biosdir2)
|
else if (cookie == BHD_COOKIE)
|
||||||
level = BDT_LVL1;
|
level = BDT_LVL1;
|
||||||
else
|
else
|
||||||
level = BDT_BOTH;
|
level = BDT_BOTH;
|
||||||
|
Reference in New Issue
Block a user