From 4ff5a94eb974a783081ee358966b2022aaf1fb20 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Sun, 28 Dec 2014 17:33:50 +0000 Subject: ich9deblob: added ich9gen utility This can generate the descriptor+gbe images from scratch, without the need for a factory.bin dump. --- .gitignore | 7 + build-release | 7 + docs/hcl/x200_remove_me.html | 59 ++++ docs/release.html | 3 + resources/utilities/ich9deblob/Makefile | 29 +- resources/utilities/ich9deblob/obj/ich9gen/.empty | 0 .../ich9deblob/src/common/descriptor_gbe.c | 2 +- .../ich9deblob/src/descriptor/descriptor.c | 370 +++++++++++++++++++++ .../ich9deblob/src/descriptor/descriptor.h | 123 ++++--- resources/utilities/ich9deblob/src/gbe/gbe.c | 353 +++++++++++++++++++- resources/utilities/ich9deblob/src/gbe/gbe.h | 16 +- resources/utilities/ich9deblob/src/ich9deblob.c | 29 +- resources/utilities/ich9deblob/src/ich9gen.c | 57 ++++ resources/utilities/ich9deblob/src/ich9gen.h | 35 ++ .../ich9deblob/src/ich9gen/mkdescriptor.c | 238 +++++++++++++ .../ich9deblob/src/ich9gen/mkdescriptor.h | 32 ++ resources/utilities/ich9deblob/src/ich9gen/mkgbe.c | 256 ++++++++++++++ resources/utilities/ich9deblob/src/ich9gen/mkgbe.h | 28 ++ 18 files changed, 1590 insertions(+), 54 deletions(-) create mode 100644 resources/utilities/ich9deblob/obj/ich9gen/.empty create mode 100644 resources/utilities/ich9deblob/src/ich9gen.c create mode 100644 resources/utilities/ich9deblob/src/ich9gen.h create mode 100644 resources/utilities/ich9deblob/src/ich9gen/mkdescriptor.c create mode 100644 resources/utilities/ich9deblob/src/ich9gen/mkdescriptor.h create mode 100644 resources/utilities/ich9deblob/src/ich9gen/mkgbe.c create mode 100644 resources/utilities/ich9deblob/src/ich9gen/mkgbe.h diff --git a/.gitignore b/.gitignore index e6dcc6dc..bcbc2997 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,13 @@ /resources/utilities/ich9deblob/deblobbed_descriptor.bin /resources/utilities/ich9deblob/libreboot.rom /resources/utilities/ich9deblob/ich9deblob +/resources/utilities/ich9deblob/ich9gen /resources/utilities/ich9deblob/obj/*.o /resources/utilities/ich9deblob/obj/*/*.o +/resources/utilities/ich9deblob/mkdescriptor.c +/resources/utilities/ich9deblob/mkdescriptor.h +/resources/utilities/ich9deblob/mkgbe.c +/resources/utilities/ich9deblob/mkgbe.h +/resources/utilities/ich9deblob/ich9fdgbe_4m.bin +/resources/utilities/ich9deblob/ich9fdgbe_8m.bin /resources/utilities/coreboot-libre/tocheck diff --git a/build-release b/build-release index 67fc1d84..5fb02886 100755 --- a/build-release +++ b/build-release @@ -240,16 +240,19 @@ if [ $(uname -i) = "i686" ] || [ $(uname -m) = "i686" ] # User is building on 32-bit host. Build only 32-bit binaries mkdir ../../../libreboot_bin/ich9deblob/i686 mv ich9deblob ../../../libreboot_bin/ich9deblob/i686/ + mv ich9gen ../../../libreboot_bin/ich9deblob/i686/ elif [ $(uname -i) = "x86_64" ] || $(uname -m) = "x86_64" then # Build the 64-bit binaries mkdir ../../../libreboot_bin/ich9deblob/x86_64 mv ich9deblob ../../../libreboot_bin/ich9deblob/x86_64/ + mv ich9gen ../../../libreboot_bin/ich9deblob/x86_64/ # Now build 32-bit binaries make clean make SHARED=0 CC='gcc -static -m32' mkdir ../../../libreboot_bin/ich9deblob/i686 mv ich9deblob ../../../libreboot_bin/ich9deblob/i686/ + mv ich9gen ../../../libreboot_bin/ich9deblob/i686/ fi cd ../ rm -rf ich9deblob @@ -377,6 +380,10 @@ rm -f libreboot_src/DEBLOB rm -f libreboot_src/resources/utilities/ich9deblob/deblobbed_descriptor.bin rm -f libreboot_src/resources/utilities/ich9deblob/factory.rom rm -f libreboot_src/resources/utilities/ich9deblob/libreboot.rom +rm -f libreboot_src/resources/utilities/ich9deblob/mkdescriptor.c +rm -f libreboot_src/resources/utilities/ich9deblob/mkdescriptor.h +rm -f libreboot_src/resources/utilities/ich9deblob/mkgbe.c +rm -f libreboot_src/resources/utilities/ich9deblob/mkgbe.h echo "Creating compressed libreboot_src release archive" diff --git a/docs/hcl/x200_remove_me.html b/docs/hcl/x200_remove_me.html index 0cef79b4..532b4990 100644 --- a/docs/hcl/x200_remove_me.html +++ b/docs/hcl/x200_remove_me.html @@ -28,6 +28,49 @@ Or back to main X200 compatibility page (x200.html).

+
+ +

ICH9 gen utility

+ +

+ It is no longer necessary to use ich9deblob to generate + a deblobbed descriptor+gme image for the X200. ich9gen is a small utility within + ich9deblob that can generate them from scratch, without a factory.bin dump. +

+ +

+ Run:
+ $ ./ich9gen +

+ +

+ Two new files will be created: +

+ + +

+ ich9gen executables can be found under ./ich9gen/ statically compiled in + libreboot_bin. If you are using src or git, build ich9gen from source with:
+ $ ./builddeps-ich9deblob
+ The executable will appear under resources/utilities/ich9deblob/ +

+ +

+ Assuming that your X200 libreboot image is named libreboot.rom, copy + the file to where libreboot.rom is located + and then run, for instance:
+ $ dd if=ich9fdgbe_8m.bin of=libreboot.rom bs=1 count=12k conv=notrunc
+ or:
+ $ dd if=ich9fdgbe_4m.bin of=libreboot.rom bs=1 count=12k conv=notrunc +

+ +

+ Your X200 libreboot.rom image is now ready to be flashed on the machine. +

+

ICH9 deblob utility

@@ -66,6 +109,22 @@ $ dd if=deblobbed_descriptor.bin of=libreboot.rom bs=1 count=12k conv=notrunc

+

+ The utility will also generate 4 additional files: +

+ +

+ These are C source files that can re-generate the very same Gbe and Descriptor structs + (from ich9deblob/ich9gen). To use these, place them in src/ich9gen/ in ich9deblob, then re-build. + The newly built ich9gen executable will be able to re-create the very same 12KiB file from scratch, + based on the C structs, this time without the need for a factory.rom dump! +

+

You should now have a libreboot.rom image containing the correct 4K descriptor and 8K gbe regions, which will then be safe to flash. Refer back to ../install/index.html#flashrom_x200 diff --git a/docs/release.html b/docs/release.html index e99947ed..24c68079 100644 --- a/docs/release.html +++ b/docs/release.html @@ -120,6 +120,9 @@ Changes for this release (latest changes first, earliest changes last)