util/ifdtool: Fix region access control for SKL/KBL
The default values used by ifdtool for setting region access control do not match the expected values for SKL/KBL as per the SPI programming guide. This change adds platform "sklkbl" that sets region access control bits differently for SKL/KBL images. BUG=b:76098647 BRANCH=poppy TEST=Verified that the access control bits on KBL images is set correctly. Change-Id: I1328d8006c25be282b3223268d8f1fd0a64e2ed3 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/25306 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
5044b01697
commit
088b6e8f8b
|
@ -826,6 +826,24 @@ static void lock_descriptor(const char *filename, char *image, int size)
|
||||||
/* TXE can only write Device Expansion */
|
/* TXE can only write Device Expansion */
|
||||||
fmba->flmstr2 |= 0x20 << wr_shift;
|
fmba->flmstr2 |= 0x20 << wr_shift;
|
||||||
break;
|
break;
|
||||||
|
case PLATFORM_SKLKBL:
|
||||||
|
/* CPU/BIOS can read descriptor, BIOS and GbE. */
|
||||||
|
fmba->flmstr1 |= 0xb << rd_shift;
|
||||||
|
/* CPU/BIOS can write BIOS and Gbe. */
|
||||||
|
fmba->flmstr1 |= 0xa << wr_shift;
|
||||||
|
/* ME can read descriptor, ME and GbE. */
|
||||||
|
fmba->flmstr2 |= 0xd << rd_shift;
|
||||||
|
/* ME can write ME. */
|
||||||
|
fmba->flmstr2 |= 0x4 << wr_shift;
|
||||||
|
/* GbE can read GbE and descriptor. */
|
||||||
|
fmba->flmstr3 |= 0x9 << rd_shift;
|
||||||
|
/* GbE can write GbE. */
|
||||||
|
fmba->flmstr3 |= 0x8 << wr_shift;
|
||||||
|
/* EC can read EC and descriptor. */
|
||||||
|
fmba->flmstr5 |= 0x101 << rd_shift;
|
||||||
|
/* EC can write EC region. */
|
||||||
|
fmba->flmstr5 |= 0x100 << wr_shift;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* CPU/BIOS can read descriptor, BIOS, and GbE. */
|
/* CPU/BIOS can read descriptor, BIOS, and GbE. */
|
||||||
fmba->flmstr1 |= 0xb << rd_shift;
|
fmba->flmstr1 |= 0xb << rd_shift;
|
||||||
|
@ -1325,6 +1343,8 @@ int main(int argc, char *argv[])
|
||||||
case 'p':
|
case 'p':
|
||||||
if (!strcmp(optarg, "aplk")) {
|
if (!strcmp(optarg, "aplk")) {
|
||||||
platform = PLATFORM_APOLLOLAKE;
|
platform = PLATFORM_APOLLOLAKE;
|
||||||
|
} else if (!strcmp(optarg, "sklkbl")) {
|
||||||
|
platform = PLATFORM_SKLKBL;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown platform: %s\n", optarg);
|
fprintf(stderr, "Unknown platform: %s\n", optarg);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
|
@ -22,7 +22,8 @@ enum ifd_version {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum platform {
|
enum platform {
|
||||||
PLATFORM_APOLLOLAKE
|
PLATFORM_APOLLOLAKE,
|
||||||
|
PLATFORM_SKLKBL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LAYOUT_LINELEN 80
|
#define LAYOUT_LINELEN 80
|
||||||
|
|
Loading…
Reference in New Issue