summaryrefslogtreecommitdiffstats
path: root/resources/utilities/ich9deblob/src/ich9deblob.c
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-12-28 12:33:50 (EST)
committer Francis Rowe <info@gluglug.org.uk>2014-12-28 12:33:50 (EST)
commit4ff5a94eb974a783081ee358966b2022aaf1fb20 (patch)
tree242d67dcfcf3fb4f1f9f0f06097757ec707a7520 /resources/utilities/ich9deblob/src/ich9deblob.c
parent779f26c4b48b792873438d99526ebe51c9db2565 (diff)
downloadlibreboot-4ff5a94eb974a783081ee358966b2022aaf1fb20.zip
libreboot-4ff5a94eb974a783081ee358966b2022aaf1fb20.tar.gz
libreboot-4ff5a94eb974a783081ee358966b2022aaf1fb20.tar.bz2
ich9deblob: added ich9gen utility
This can generate the descriptor+gbe images from scratch, without the need for a factory.bin dump.
Diffstat (limited to 'resources/utilities/ich9deblob/src/ich9deblob.c')
-rw-r--r--resources/utilities/ich9deblob/src/ich9deblob.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/resources/utilities/ich9deblob/src/ich9deblob.c b/resources/utilities/ich9deblob/src/ich9deblob.c
index 313416c..b7bbf88 100644
--- a/resources/utilities/ich9deblob/src/ich9deblob.c
+++ b/resources/utilities/ich9deblob/src/ich9deblob.c
@@ -36,7 +36,7 @@
/*
* See docs/hcl/x200_remove_me.html for info plus links to datasheet (also linked below)
*
- * Info about flash descriptor (read page 850 onwards):
+ * Info about flash descriptor (read page 845 onwards):
* http://www.intel.co.uk/content/dam/doc/datasheet/io-controller-hub-9-datasheet.pdf
*
* Info about Gbe region (read whole datasheet):
@@ -221,6 +221,33 @@ int main(int argc, char *argv[])
if (notCreatedDescriptorGbeFile(deblobbedDescriptorStruct, deblobbedGbeStruct8k, deblobbedDescriptorFilename)) {
return 1;
}
+
+ /*
+ * ------------------------------------------------------------------
+ * Generate ich9gen data (C code that will recreate the deblobbed descriptor+gbe from scratch)
+ * ------------------------------------------------------------------
+ */
+
+ /* Code for generating the Gbe struct */
+ /* mkgbe.h */
+ if (notCreatedHFileForGbeCFile("mkgbe.h", "mkgbe.c")) {
+ return 1;
+ } /* and now mkgbe.c */
+ if (notCreatedCFileFromGbeStruct4k(deblobbedGbeStruct8k.backup, "mkgbe.c", "mkgbe.h")) {
+ return 1;
+ }
+
+ /* Code for generating the Descriptor struct */
+ /* mkdescriptor.h */
+ if (notCreatedHFileForDescriptorCFile("mkdescriptor.h", "mkdescriptor.c")) {
+ return 1;
+ } /* and now mkdescriptor.c */
+ if (notCreatedCFileFromDescriptorStruct(deblobbedDescriptorStruct, "mkdescriptor.c", "mkdescriptor.h")) {
+ return 1;
+ }
+
+ printf("The modified descriptor and gbe regions have also been dumped as src files: mkgbe.c, mkgbe.h, mkdescriptor.c, mkdescriptor.h\n");
+ printf("To use these in ich9gen, place them in src/ich9gen/ and re-build ich9gen.\n\n");
return 0;
}