summaryrefslogtreecommitdiffstats
path: root/resources/utilities
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-12-23 23:10:23 (EST)
committer Francis Rowe <info@gluglug.org.uk>2014-12-23 23:10:23 (EST)
commitd993e696d62fba8a3ca3a2e27d9c0d527256ca58 (patch)
tree7529ddb4abcb3dc36ca850909ff3e7ed043b77a3 /resources/utilities
parent4286a86d77844026de788fe9283f710c7a7ec8ad (diff)
downloadlibreboot-d993e696d62fba8a3ca3a2e27d9c0d527256ca58.zip
libreboot-d993e696d62fba8a3ca3a2e27d9c0d527256ca58.tar.gz
libreboot-d993e696d62fba8a3ca3a2e27d9c0d527256ca58.tar.bz2
ich9deblob: debug in descriptor deblob moved to separate function
Diffstat (limited to 'resources/utilities')
-rw-r--r--resources/utilities/ich9deblob/descriptor/descriptor.c57
-rw-r--r--resources/utilities/ich9deblob/descriptor/descriptor.h1
-rw-r--r--resources/utilities/ich9deblob/ich9deblob.c6
3 files changed, 54 insertions, 10 deletions
diff --git a/resources/utilities/ich9deblob/descriptor/descriptor.c b/resources/utilities/ich9deblob/descriptor/descriptor.c
index 0e7f2bf..6eba50b 100644
--- a/resources/utilities/ich9deblob/descriptor/descriptor.c
+++ b/resources/utilities/ich9deblob/descriptor/descriptor.c
@@ -113,16 +113,53 @@ struct DESCRIPTORREGIONRECORD deblobbedDescriptorStructFromFactory(struct DESCRI
* deblobbedDescriptorStruct.mchStraps.mchStrap0.meAlternateDisable = 1;
*/
- /* debugging */
- printf("\nOriginal (factory.rom) Descriptor start block: %08x ; Descriptor end block: %08x\n", factoryDescriptorStruct.regionSection.flReg0.BASE << FLREGIONBITSHIFT, factoryDescriptorStruct.regionSection.flReg0.LIMIT << FLREGIONBITSHIFT);
- printf("Original (factory.rom) BIOS start block: %08x ; BIOS end block: %08x\n", factoryDescriptorStruct.regionSection.flReg1.BASE << FLREGIONBITSHIFT, factoryDescriptorStruct.regionSection.flReg1.LIMIT << FLREGIONBITSHIFT);
- printf("Original (factory.rom) ME start block: %08x ; ME end block: %08x\n", factoryDescriptorStruct.regionSection.flReg2.BASE << FLREGIONBITSHIFT, factoryDescriptorStruct.regionSection.flReg2.LIMIT << FLREGIONBITSHIFT);
- printf("Original (factory.rom) GBe start block: %08x ; GBe end block: %08x\n", factoryDescriptorStruct.regionSection.flReg3.BASE << FLREGIONBITSHIFT, factoryDescriptorStruct.regionSection.flReg3.LIMIT << FLREGIONBITSHIFT);
+ return deblobbedDescriptorStruct;
+}
+
+/*
+ * ---------------------------------------------------------------------
+ * Debugging functions:
+ * ---------------------------------------------------------------------
+ */
+
+/*
+ * show debugging info: descriptor region boundaries, in a 4KB struct.
+ */
+void printDescriptorRegionLocations(struct DESCRIPTORREGIONRECORD descriptorStruct, char* romName)
+{
+ printf("\n");
- printf("\nRelocated (libreboot.rom) Descriptor start block: %08x ; Descriptor end block: %08x\n", deblobbedDescriptorStruct.regionSection.flReg0.BASE << FLREGIONBITSHIFT, deblobbedDescriptorStruct.regionSection.flReg0.LIMIT << FLREGIONBITSHIFT);
- printf("Relocated (libreboot.rom) BIOS start block: %08x ; BIOS end block: %08x\n", deblobbedDescriptorStruct.regionSection.flReg1.BASE << FLREGIONBITSHIFT, deblobbedDescriptorStruct.regionSection.flReg1.LIMIT << FLREGIONBITSHIFT);
- printf("Relocated (libreboot.rom) ME start block: %08x ; ME end block: %08x\n", deblobbedDescriptorStruct.regionSection.flReg2.BASE << FLREGIONBITSHIFT, deblobbedDescriptorStruct.regionSection.flReg2.LIMIT << FLREGIONBITSHIFT);
- printf("Relocated (libreboot.rom) GBe start block: %08x ; GBe end block: %08x\n", deblobbedDescriptorStruct.regionSection.flReg3.BASE << FLREGIONBITSHIFT, deblobbedDescriptorStruct.regionSection.flReg3.LIMIT << FLREGIONBITSHIFT);
+ /* Descriptor region */
+ printf(
+ "%s: Descriptor start block: %08x ; Descriptor end block: %08x\n",
+ romName,
+ descriptorStruct.regionSection.flReg0.BASE << FLREGIONBITSHIFT,
+ descriptorStruct.regionSection.flReg0.LIMIT << FLREGIONBITSHIFT
+ );
- return deblobbedDescriptorStruct;
+ /* BIOS region */
+ printf(
+ "%s: BIOS start block: %08x ; BIOS end block: %08x\n",
+ romName,
+ descriptorStruct.regionSection.flReg1.BASE << FLREGIONBITSHIFT,
+ descriptorStruct.regionSection.flReg1.LIMIT << FLREGIONBITSHIFT
+ );
+
+ /* ME region */
+ printf(
+ "%s: ME start block: %08x ; ME end block: %08x\n",
+ romName,
+ descriptorStruct.regionSection.flReg2.BASE << FLREGIONBITSHIFT,
+ descriptorStruct.regionSection.flReg2.LIMIT << FLREGIONBITSHIFT
+ );
+
+ /* GBe region */
+ printf(
+ "%s: GBe start block: %08x ; GBe end block: %08x\n",
+ romName,
+ descriptorStruct.regionSection.flReg3.BASE << FLREGIONBITSHIFT,
+ descriptorStruct.regionSection.flReg3.LIMIT << FLREGIONBITSHIFT
+ );
+
+ return;
}
diff --git a/resources/utilities/ich9deblob/descriptor/descriptor.h b/resources/utilities/ich9deblob/descriptor/descriptor.h
index a3dd340..3841fdc 100644
--- a/resources/utilities/ich9deblob/descriptor/descriptor.h
+++ b/resources/utilities/ich9deblob/descriptor/descriptor.h
@@ -257,5 +257,6 @@ struct DESCRIPTORREGIONRECORD {
*/
struct DESCRIPTORREGIONRECORD deblobbedDescriptorStructFromFactory(struct DESCRIPTORREGIONRECORD factoryDescriptorStruct, unsigned int factoryRomSize);
+void printDescriptorRegionLocations(struct DESCRIPTORREGIONRECORD descriptorStruct, char* romName);
#endif
diff --git a/resources/utilities/ich9deblob/ich9deblob.c b/resources/utilities/ich9deblob/ich9deblob.c
index b6ad9cd..f8ed5a4 100644
--- a/resources/utilities/ich9deblob/ich9deblob.c
+++ b/resources/utilities/ich9deblob/ich9deblob.c
@@ -195,6 +195,12 @@ int main(int argc, char *argv[])
* Also, extend the BIOS region to fill the ROM image (after descriptor+gbe).
*/
deblobbedDescriptorStruct = deblobbedDescriptorStructFromFactory(factoryDescriptorStruct, factoryRomSize);
+ /*
+ * Debugging: show region locations in the
+ * original descriptor and the modified one
+ */
+ printDescriptorRegionLocations(factoryDescriptorStruct, "Original");
+ printDescriptorRegionLocations(deblobbedDescriptorStruct, "Modified");
/*
* Modify the Gbe region (see function for details)