util/amdfwtool: Add fanless SMU firmware options

The Stoney Ridge program has OPNs that are considered fanless.  These
APUs are strapped to search for unique SMU firmware, indicated by
Type[8]=1 in the directory table entry.

Add new options to amdfwtool and include the blobs in the build with
the appropriate bit set in the Type encoding.

Original-Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Original-Reviewed-by: Marc Jones <marcj303@gmail.com>
(cherry picked from commit 8df0d6847c39bb021271983018ac6f448f9ff9da)

Change-Id: I4b80ccf8fd9644f9a9d300e6c67aed9834a2c7a7
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/18991
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Marshall Dawson 2017-03-17 16:30:51 -06:00 committed by Martin Roth
parent e91d170d21
commit f4b9b41c47
1 changed files with 85 additions and 63 deletions

View File

@ -172,6 +172,7 @@ static void usage(void)
printf("-P | --pubkey2 <FILE> Add pubkey\n");
printf("-B | --bootloader2 <FILE> Add bootloader\n");
printf("-S | --smufirmware_2 <FILE> Add smufirmware\n");
printf("-L | --smufnfirmware_2 <FILE> Add fanless smufirmware\n");
printf("-R | --recovery2 <FILE> Add recovery\n");
printf("-K | --rtmpubkey2 <FILE> Add rtmpubkey\n");
printf("-C | --secureos2 <FILE> Add secureos\n");
@ -180,6 +181,7 @@ static void usage(void)
printf("-T | --trustlets2 <FILE> Add trustlets\n");
printf("-U | --trustletkey2 <FILE> Add trustletkey\n");
printf("-W | --smufirmware2_2 <FILE> Add smufirmware2\n");
printf("-E | --smufnfirmware2_2 <FILE> Add fanless smufirmware2\n");
printf("-M | --smuscs2 <FILE> Add smuscs\n");
#endif
@ -192,10 +194,13 @@ static void usage(void)
}
#define FANLESS_FW 0x100 /* type[15:8]: 0=non-fanless OPNs, 1=fanless */
typedef enum _amd_fw_type {
AMD_FW_PSP_PUBKEY = 0,
AMD_FW_PSP_BOOTLOADER = 1,
AMD_FW_PSP_SMU_FIRMWARE = 8,
AMD_FW_PSP_SMU_FN_FIRMWARE = FANLESS_FW + AMD_FW_PSP_SMU_FIRMWARE,
AMD_FW_PSP_RECOVERY = 3,
AMD_FW_PSP_RTM_PUBKEY = 5,
AMD_FW_PSP_SECURED_OS = 2,
@ -204,6 +209,7 @@ typedef enum _amd_fw_type {
AMD_FW_PSP_TRUSTLETS = 12,
AMD_FW_PSP_TRUSTLETKEY = 13,
AMD_FW_PSP_SMU_FIRMWARE2 = 18,
AMD_FW_PSP_SMU_FN_FIRMWARE2 = FANLESS_FW + AMD_FW_PSP_SMU_FIRMWARE2,
AMD_PSP_FUSE_CHAIN = 11,
AMD_FW_PSP_SMUSCS = 95,
@ -230,6 +236,8 @@ static amd_fw_entry amd_psp_fw_table[] = {
{ .type = AMD_FW_PSP_TRUSTLETS },
{ .type = AMD_FW_PSP_TRUSTLETKEY },
{ .type = AMD_FW_PSP_SMU_FIRMWARE2 },
{ .type = AMD_FW_PSP_SMU_FN_FIRMWARE },
{ .type = AMD_FW_PSP_SMU_FN_FIRMWARE2 },
{ .type = AMD_FW_PSP_SMUSCS },
{ .type = AMD_PSP_FUSE_CHAIN },
{ .type = AMD_FW_INVALID },
@ -248,6 +256,8 @@ static amd_fw_entry amd_psp2_fw_table[] = {
{ .type = AMD_FW_PSP_TRUSTLETS },
{ .type = AMD_FW_PSP_TRUSTLETKEY },
{ .type = AMD_FW_PSP_SMU_FIRMWARE2 },
{ .type = AMD_FW_PSP_SMU_FN_FIRMWARE },
{ .type = AMD_FW_PSP_SMU_FN_FIRMWARE2 },
{ .type = AMD_FW_PSP_SMUSCS },
{ .type = AMD_PSP_FUSE_CHAIN },
{ .type = AMD_FW_INVALID },
@ -367,7 +377,7 @@ static uint32_t integrate_psp_firmwares(char *base, uint32_t pos,
#if PSP2
static const char *optstring =
"x:i:g:p:b:s:r:k:c:n:d:t:u:w:m:P:B:S:R:K:C:N:D:T:U:W:M:o:f:h";
"x:i:g:p:b:s:r:k:c:n:d:t:u:w:m:P:B:S:L:R:K:C:N:D:T:U:W:E:M:o:f:h";
#else
static const char *optstring = "x:i:g:p:b:s:r:k:c:n:d:t:u:w:m:o:f:h";
#endif
@ -395,6 +405,7 @@ static struct option long_options[] = {
{"pubkey2", required_argument, 0, 'P' },
{"bootloader2", required_argument, 0, 'B' },
{"smufirmware_2", required_argument, 0, 'S' },
{"smufnfirmware_2", required_argument, 0, 'L' },
{"recovery2", required_argument, 0, 'R' },
{"rtmpubkey2", required_argument, 0, 'K' },
{"secureos2", required_argument, 0, 'C' },
@ -403,6 +414,7 @@ static struct option long_options[] = {
{"trustlets2", required_argument, 0, 'T' },
{"trustletkey2", required_argument, 0, 'U' },
{"smufirmware2_2", required_argument, 0, 'W' },
{"smufnfirmware2_2", required_argument, 0, 'E' },
{"smuscs2", required_argument, 0, 'M' },
#endif
@ -552,6 +564,11 @@ int main(int argc, char **argv)
optarg, 2);
psp2flag = 1;
break;
case 'L':
register_fw_filename(AMD_FW_PSP_SMU_FN_FIRMWARE,
optarg, 2);
psp2flag = 1;
break;
case 'R':
register_fw_filename(AMD_FW_PSP_RECOVERY, optarg, 2);
psp2flag = 1;
@ -586,6 +603,11 @@ int main(int argc, char **argv)
optarg, 2);
psp2flag = 1;
break;
case 'E':
register_fw_filename(AMD_FW_PSP_SMU_FN_FIRMWARE2,
optarg, 2);
psp2flag = 1;
break;
case 'M':
register_fw_filename(AMD_FW_PSP_SMUSCS, optarg, 2);
psp2flag = 1;