From 4ff5a94eb974a783081ee358966b2022aaf1fb20 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Sun, 28 Dec 2014 12:33:50 -0500 Subject: ich9deblob: added ich9gen utility This can generate the descriptor+gbe images from scratch, without the need for a factory.bin dump. --- (limited to 'resources/utilities/ich9deblob/src/ich9deblob.c') 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; } -- cgit v0.9.1