summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzbao <fishbaozi@gmail.com>2016-02-19 13:47:31 +0800
committerMartin Roth <martinroth@google.com>2016-02-20 04:57:42 +0100
commitc3b0b7281326de836890fdb16eb92737f44b4e59 (patch)
tree8e44098227f1db6379fbf54f764de6117118f5cf
parent6e2f3d1df462330c524aece7f3ddb91bd20b96c7 (diff)
amdfwtool: Postpone the usage of PSP combo directory
If we only need to "combo" two PSP directories into one image, we can put first address in romsig 0x10 and second one in romsig 0x14. If we really need to put three, the 0x14 is the combo directory which points to multiple level-2 PSP directories. I guess that two PSP can also use combo directory, with only one level-2 directory. But nobody seems to do that. Change-Id: Ic450a846bc04db90a75cd417b6d7104fe2a5b177 Signed-off-by: Zheng Bao <fishbaozi@gmail.com> Reviewed-on: https://review.coreboot.org/13739 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r--util/amdfwtool/amdfwtool.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index 92a53fc598..073c138907 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -15,11 +15,12 @@
/*
* ROMSIG At ROMBASE + 0x20000:
+ * 0 4 8 C
* +------------+---------------+----------------+------------+
* | 0x55AA55AA |EC ROM Address |GEC ROM Address |USB3 ROM |
* +------------+---------------+----------------+------------+
- * | PSPDIR ADDR|PSP2DIR ADDR |
- * +------------+---------------+
+ * | PSPDIR ADDR|PSPDIR ADDR |<-- Field 0x14 could be either
+ * +------------+---------------+ 2nd PSP directory or PSP COMBO directory
* EC ROM should be 64K aligned.
*
* PSP directory (Where "PSPDIR ADDR" points)
@@ -41,7 +42,7 @@
* | |
* +------------+---------------+----------------+------------+
*
- * PSP2 directory
+ * PSP Combo directory
* +------------+---------------+----------------+------------+
* | 'PSP2' | Fletcher | Count |Look up mode|
* +------------+---------------+----------------+------------+
@@ -81,6 +82,13 @@
kinds of APU.
*/
#define PSP2 1
+#if PSP2
+/* Use PSP combo directory or not.
+ * Currently we dont have to squeeze 3 PSP directories into 1 image. So
+ * we skip the combo directory.
+ */
+ #define PSP_COMBO 0
+#endif
typedef unsigned int uint32_t;
typedef unsigned char uint8_t;
@@ -534,9 +542,11 @@ int main(int argc, char **argv)
amd_romsig[5] = current + ROM_BASE_ADDRESS;
current += 0x100; /* Add conservative size of psp2dir. */
+ #if PSP_COMBO
/* TODO: remove the hardcode. */
psp2count = 1; /* Start from 1. */
/* for (; psp2count <= PSP2COUNT; psp2count++, current=ALIGN(current, 0x100)) { */
+ /* Now the psp2dir is psp combo dir. */
psp2dir[psp2count*4 + 0] = 0; /* 0 -Compare PSP ID, 1 -Compare chip family ID */
psp2dir[psp2count*4 + 1] = 0x10220B00; /* TODO: PSP ID. Documentation is needed. */
psp2dir[psp2count*4 + 2] = current + ROM_BASE_ADDRESS;
@@ -550,11 +560,17 @@ int main(int argc, char **argv)
fill_psp_head(pspdir, count);
/* } */ /* End of loop */
- /* fill the PSP2 head */
+ /* fill the PSP combo head */
psp2dir[0] = 0x50535032; /* 'PSP2' */
psp2dir[2] = psp2count; /* Count */
psp2dir[3] = 0; /* 0-Dynamic look up through all entries, 1-PSP/chip ID match */
psp2dir[1] = fletcher32((uint16_t *)&psp2dir[1], (psp2count*16 + 16)/2 - 2);
+ #else
+ for (count = 0; count < sizeof(amd_psp2_fw_table) / sizeof(amd_fw_entry); count ++) {
+ current = integerate_one_psp(rom, current, psp2dir, count);
+ }
+ fill_psp_head(psp2dir, count);
+ #endif
}
#endif
}