Attention is currently required from: David Wu, Krishna P Bhat D, Reka Norman, Stefan Reinauer, Subrata Banik, Tyler Wang.

Tyler Wang uploaded patch set #12 to this change.

View Change

The following approvals got outdated and were removed: Verified+1 by build bot (Jenkins)

util/ifdtool: Add support for checking GPR0 status

This patch adds support for the new command-line option `-c` to
the ifdtool, which is able to check GPR0 (Global Protected Range)
status.

This patch also add helper function get_enabled_gprd() to get enabled
GPR0 settings. It used in enable_gpr0() and is_gpr0_protected().

Developers can use ifdtool with '-c' option to check whether GPR0 is
set to enabled or disabled in the binary file.

BUG=none
TEST=(1) > ifdtool -p mtl -E image-unlocked.bin -O image-lock.bin
...
Value at GPRD offset (64) is 0x83220004
--------- GPR0 Protected Range --------------
Start address = 0x00004000
End address = 0x00322fff
...
GPR0 protection is now enabled

(2) > ifdtool -p mtl -c image-unlocked.bin
GPR0 status: Disabled

Value at GPRD offset (64) is 0x00000000
--------- GPR0 Protected Range --------------
Start address = 0x00000000
End address = 0x00000fff

(3) > ifdtool -p mtl -c image-lock.bin
GPR0 status: Enabled

Value at GPRD offset (64) is 0x83220004
--------- GPR0 Protected Range --------------
Start address = 0x00004000
End address = 0x00322fff

Change-Id: I6b3af973be784200b965a68e5f6b7737cba03ed7
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
---
M util/ifdtool/ifdtool.c
1 file changed, 58 insertions(+), 16 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/81928/12

To view, visit change 81928. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I6b3af973be784200b965a68e5f6b7737cba03ed7
Gerrit-Change-Number: 81928
Gerrit-PatchSet: 12
Gerrit-Owner: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Gerrit-Reviewer: David Wu <david_wu@quanta.corp-partner.google.com>
Gerrit-Reviewer: Krishna P Bhat D <krishna.p.bhat.d@intel.com>
Gerrit-Reviewer: Reka Norman <rekanorman@google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: Subrata Banik <subratabanik@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Reka Norman <rekanorman@chromium.org>
Gerrit-Attention: Reka Norman <rekanorman@google.com>
Gerrit-Attention: David Wu <david_wu@quanta.corp-partner.google.com>
Gerrit-Attention: Subrata Banik <subratabanik@google.com>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Attention: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Gerrit-Attention: Krishna P Bhat D <krishna.p.bhat.d@intel.com>
Gerrit-MessageType: newpatchset