-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T420 initial support + X220 FBWhiptail Support #578
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
662a1dd
Add support for the Lenovo ThinkPad T420.
snmcmillan 94e6e09
Fix the autodetection of ifdtool and me_cleaner.
snmcmillan be21220
Whoops, added the entire directory!
snmcmillan d38190e
Actually point to the T420 coreboot config file...
snmcmillan f2bdd98
Merge branch 'master' of https://github.com/SebastianMcMillan/heads
snmcmillan 62d6a6c
Enable FBWhiptail mode for X220 and T420
snmcmillan 6fb0a9d
Don't use iommu settings because it breaks graphics after kexec.
snmcmillan 41e5301
Remove sandybridge patches. Causes 50 second delay when booting up, r…
snmcmillan 584690f
Fixed TPM romstage measurements.
snmcmillan 04d7df7
Turn on iommu, but do not enable igfx-off
snmcmillan cb74314
Revert "Fixed TPM romstage measurements."
snmcmillan 04b59d2
Revert "Remove sandybridge patches. Causes 50 second delay when booti…
snmcmillan fe03f79
One more thing: Add flash.sh definitions for X220 and T420.
snmcmillan f17c519
Required SPI flash chip option to flahs internally
tlaurion 5a437ea
Temporary coreboot config required to debug through cbmem under heads
tlaurion f3c8a2d
Revert "Required SPI flash chip option to flahs internally"
tlaurion 68e2c76
Merge pull request #2 from tlaurion/x220_cbmem_temp_debug_requirements
snmcmillan 1e705eb
Update flash.sh
snmcmillan 3c0899f
Update x220.config
snmcmillan e356d2d
Update coreboot-x220.config
snmcmillan f60fd69
Update coreboot-x220.config
snmcmillan fe30018
Update x220.config
snmcmillan adc9f0a
Update t420.config
snmcmillan 9b3da5b
Revert "Update flash.sh"
snmcmillan 0e1f36b
Revert "One more thing: Add flash.sh definitions for X220 and T420."
snmcmillan 6c7a2ff
Update t420.config
snmcmillan d8c018c
Update t420.config
snmcmillan dbdf051
Update coreboot-t420.config
snmcmillan 52df283
Update coreboot-x220.config
snmcmillan 5c5bca0
Update t420.config
snmcmillan e1e3418
Update x220.config
snmcmillan bac3936
Merge branch 'master' into t420-initial-support
tlaurion 4afa41b
Remove space in x220 board config prior of FLASHROM_OPTIONS
tlaurion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
function printusage { | ||
echo "Usage: $0 -f <romdump> -m <me_cleaner>(optional) -i <ifdtool>(optional)" | ||
exit 0 | ||
} | ||
|
||
BLOBDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
if [ "$#" -eq 0 ]; then printusage; fi | ||
|
||
while getopts ":f:m:i:" opt; do | ||
case $opt in | ||
f) | ||
FILE="$OPTARG" | ||
;; | ||
m) | ||
if [ -x "$OPTARG" ]; then | ||
MECLEAN="$OPTARG" | ||
fi | ||
;; | ||
i) | ||
if [ -x "$OPTARG" ]; then | ||
IFDTOOL="$OPTARG" | ||
fi | ||
;; | ||
esac | ||
done | ||
|
||
if [ -z "$MECLEAN" ]; then | ||
MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1` | ||
if [ -z "$MECLEAN" ]; then | ||
echo "me_cleaner.py required but not found or specified with -m. Aborting." | ||
exit 1; | ||
fi | ||
fi | ||
|
||
if [ -z "$IFDTOOL" ]; then | ||
IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1` | ||
if [ -z "$IFDTOOL" ]; then | ||
echo "ifdtool required but not found or specified with -m. Aborting." | ||
exit 1; | ||
fi | ||
fi | ||
|
||
echo "FILE: $FILE" | ||
echo "ME: $MECLEAN" | ||
echo "IFD: $IFDTOOL" | ||
|
||
bioscopy=$(mktemp) | ||
extractdir=$(mktemp -d) | ||
|
||
cp "$FILE" $bioscopy | ||
|
||
cd "$extractdir" | ||
$IFDTOOL -x $bioscopy | ||
cp "$extractdir/flashregion_3_gbe.bin" "$BLOBDIR/gbe.bin" | ||
$MECLEAN -O "$BLOBDIR/me.bin" -r -t "$extractdir/flashregion_2_intel_me.bin" | ||
$IFDTOOL -n "$BLOBDIR/layout.txt" $bioscopy | ||
$IFDTOOL -x $bioscopy.new | ||
cp "$extractdir/flashregion_0_flashdescriptor.bin" "$BLOBDIR/ifd.bin" | ||
|
||
rm "$bioscopy" | ||
rm "$bioscopy.new" | ||
rm -r "$extractdir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
00000000:00000fff fd | ||
00018000:007fffff bios | ||
00003000:00017fff me | ||
00001000:00002fff gbe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
To build for T420, we need to have the following files in this folder: | ||
* `me.bin` - ME binary that has been stripped and truncated with me_cleaner | ||
* `gbe.bin` - Network card blob from the original firmware | ||
* `ifd.bin` - Flash layout file has been provided as text | ||
|
||
To get the binaries, start with a copy of the original Lenovo firmware image. | ||
If you do not have one already, you can read one out from the laptops SPI flash with flashrom | ||
|
||
``` | ||
flashrom -p <programmer> -r original.bin | ||
``` | ||
|
||
Set `<programmer>` to the flashrom programmer type that you will use (for example, `linux_spi:dev=/dev/spidev0.0` on a Raspberry Pi). | ||
|
||
Once you have the image, the provided extraction script will extract the files needed. | ||
|
||
``` | ||
./extract.sh -f <romdump> | ||
``` | ||
|
||
Use the options '-m' and '-i' to provide me_cleaner and ifdtool if they can not be located automatically. | ||
|
||
The flash layout will be automatically adjusted and the ME image cleaned and truncated. | ||
|
||
You can now compile the image with: | ||
|
||
``` | ||
make BOARD=t420 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Configuration for a T420 running Qubes and other OS, T420 is identical to X230 on the Linux Side of things. | ||
export CONFIG_COREBOOT=y | ||
CONFIG_COREBOOT_CONFIG=config/coreboot-t420.config | ||
CONFIG_LINUX_CONFIG=config/linux-x230.config | ||
|
||
CONFIG_CRYPTSETUP=y | ||
CONFIG_FLASHROM=y | ||
CONFIG_FLASHTOOLS=y | ||
CONFIG_GPG2=y | ||
CONFIG_KEXEC=y | ||
CONFIG_UTIL_LINUX=y | ||
CONFIG_LVM2=y | ||
CONFIG_MBEDTLS=y | ||
CONFIG_PCIUTILS=y | ||
CONFIG_POPT=y | ||
CONFIG_QRENCODE=y | ||
CONFIG_TPMTOTP=y | ||
CONFIG_DROPBEAR=y | ||
|
||
CONFIG_CAIRO=y | ||
CONFIG_FBWHIPTAIL=y | ||
|
||
CONFIG_LINUX_USB=y | ||
CONFIG_LINUX_E1000E=y | ||
|
||
export CONFIG_TPM=y | ||
export CONFIG_BOOTSCRIPT=/bin/gui-init | ||
export CONFIG_BOOT_REQ_HASH=n | ||
export CONFIG_BOOT_REQ_ROLLBACK=n | ||
export CONFIG_BOOT_KERNEL_ADD="intel_iommu=on intel_iommu=igfx_off" | ||
export CONFIG_BOOT_KERNEL_REMOVE="quiet" | ||
export CONFIG_BOOT_DEV="/dev/sda1" | ||
export CONFIG_BOOT_GUI_MENU_NAME="ThinkPad T420 Heads Boot Menu" | ||
export CONFIG_USB_BOOT_DEV="/dev/sdb1" | ||
export CONFIG_WARNING_BG_COLOR="--background-gradient 0 0 0 150 125 0" | ||
export CONFIG_ERROR_BG_COLOR="--background-gradient 0 0 0 150 0 0" | ||
export FLASHROM_OPTIONS='--force --noverify-all -p internal:laptop=force_I_want_a_brick,ich_spi_mode=hwseq --ifd --image bios' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CONFIG_LOCALVERSION="heads" | ||
CONFIG_ANY_TOOLCHAIN=y | ||
# CONFIG_INCLUDE_CONFIG_FILE is not set | ||
# CONFIG_COLLECT_TIMESTAMPS is not set | ||
CONFIG_USE_BLOBS=y | ||
CONFIG_MEASURED_BOOT=y | ||
CONFIG_VENDOR_LENOVO=y | ||
CONFIG_CBFS_SIZE=0x700000 | ||
CONFIG_ONBOARD_VGA_IS_PRIMARY=y | ||
CONFIG_HAVE_IFD_BIN=y | ||
CONFIG_HAVE_ME_BIN=y | ||
CONFIG_HAVE_GBE_BIN=y | ||
CONFIG_IFD_BIN_PATH="../../blobs/t420/ifd.bin" | ||
CONFIG_ME_BIN_PATH="../../blobs/t420/me.bin" | ||
CONFIG_BOARD_LENOVO_T420=y | ||
CONFIG_DRIVERS_PS2_KEYBOARD=y | ||
CONFIG_NO_POST=y | ||
CONFIG_GBE_BIN_PATH="../../blobs/t420/gbe.bin" | ||
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x80000 | ||
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5=y | ||
CONFIG_PAYLOAD_LINUX=y | ||
CONFIG_PAYLOAD_FILE="../../build/t420/bzImage" | ||
CONFIG_LINUX_COMMAND_LINE="quiet" | ||
CONFIG_LINUX_INITRD="../../build/t420/initrd.cpio.xz" | ||
CONFIG_DEBUG_SMM_RELOCATION=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if correct, we should add a comment, why, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct. If the already existing X220 is close enough to X230, and T420 is close enough to X220, T420 is close enough to X230.
Tested on my T420 as working.