You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
5.7 KiB

6 years ago
  1. # coreboot-x230
  2. pre-built coreboot images and documentation on how to flash them for the Thinkpad X230
  3. These images
  4. * include [SeaBIOS](https://seabios.org/SeaBIOS) as coreboot payload, for maximum compatibility.
  5. * are meant to be [flashed externally](#how-to-flash)
  6. * are compatible with Windows and Linux
  7. ## Latest build (config overview and version info)
  8. See our [releases](https://github.com/merge/coreboot-x230/releases)
  9. * Lenovo's proprietary VGA BIOS ROM is executed in "secure" mode
  10. ### coreboot
  11. * We simply take coreboot's current state in it's master branch at the time we build a release image.
  12. That's the preferred way to use coreboot. The git HEAD we use it always included in
  13. the release.
  14. ### Intel microcode
  15. * version [20180108](https://downloadcenter.intel.com/download/27431/Linux-Processor-Microcode-Data-File)
  16. * in 20180108, for the X230's CPU ID (306ax) the latest update is 2015-02-26
  17. * (not yet in coreboot upstream)
  18. ### SeaBIOS
  19. * version [1.11.0](https://seabios.org/Releases#SeaBIOS_1.11.0) from 2017-11-10
  20. * (in coreboot upstream)
  21. ## When do we do a release?
  22. Either when
  23. * There is a new SeaBIOS release,
  24. * There is a new Intel microcode release (included in coreboot AND affecting our CPU ID),
  25. * There is a coreboot issue that affects us (unlikely), or
  26. * We need to change the config
  27. ## TL;DR
  28. Download a released image, connect your hardware SPI flasher to the "upper"
  29. 4MB chip in your X230, and do
  30. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -w x230_coreboot_seabios_example_top.rom
  31. ## Flashing for the first time
  32. ### EC firmware
  33. Enter Lenovo's BIOS with __F1__ and check the embedded controller (EC) version to be
  34. __1.14__ and upgrade using [the latest bootable CD](https://support.lenovo.com/at/en/downloads/ds029188)
  35. if it isn't. The EC cannot be upgraded when coreboot is installed. (In case a newer
  36. version should ever be available (I doubt it), you could temporarily flash back your
  37. original Lenovo BIOS image)
  38. ### me_cleaner
  39. The Intel Management Engine resides on the 8MB chip. We don't need to touch it
  40. for coreboot-upgrades in the future, but while opening up the Thinkpad anyways,
  41. we can save it and run [ifdtool](https://github.com/coreboot/coreboot/tree/master/util/ifdtool)
  42. and [me_cleaner](https://github.com/corna/me_cleaner) on it:
  43. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -c "MX25L3206E/MX25L3208E" -r ifdmegbe.rom
  44. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -c "MX25L3206E/MX25L3208E" -r ifdmegbe2.rom
  45. diff ifdmegbe.rom ifdmegbe2.rom
  46. git clone https://github.com/corna/me_cleaner.git && cd me_cleaner
  47. ./me_cleaner.py -O ifdmegbe_meclean.rom ifdmegbe.rom
  48. ifdtool -u ifdmegbe_meclean.rom
  49. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -c "MX25L3206E/MX25L3208E" -w ifdmegbe_meclean.rom.new
  50. ### save the 4MB chip
  51. (internally, memory of the two chips is mapped together, the 8MB being the lower
  52. part, but we can essientially ignore that)
  53. For the first time, we have to save the original image, just like we did with
  54. the 8MB chip above:
  55. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -r top1.rom
  56. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -r top2.rom
  57. diff top1.rom top2.rom
  58. ## Flashing the coreboot / SeaBIOS image
  59. When __upgrading__ to a new version, for example when a new [SeaBIOS](https://seabios.org/Releases)
  60. version is available, only the "upper" 4MB chip has to be written.
  61. Download the latest release image we provide here and flash it:
  62. flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=128 -w x230_coreboot_seabios_example_top.rom
  63. ## How to flash
  64. We flash externally, using a "Pomona 5250 8-pin SOIC test clip". You'll find
  65. one easily.
  66. ### Example: Raspberry Pi 3
  67. We connect it to a Raspberry Pi 3, running [Raspbian](https://www.raspberrypi.org/downloads/raspbian/)
  68. and the following setup
  69. * [Serial connection](https://elinux.org/RPi_Serial_Connection) using a "USB to Serial" Adapter and picocom or minicom
  70. * in the SD Cards's `/boot/config.txt` file `enable_uart=1` and `dtparam=spi=on`
  71. * [For flashrom](https://www.flashrom.org/RaspberryPi) we put `spi_bcm2835` and `spidev` in /etc/modules
  72. * [Connect to a wifi](https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md) or to network over ethernet.
  73. * install `flashrom`
  74. * connect the Clip to the Raspberry Pi 3:
  75. Edge of pi (furthest from you)
  76. L CS
  77. E |
  78. F +---------------------------------------------------------------------------------+
  79. T | x x x x x x x x x x x x x x x x x x x x |
  80. | x x x x x x x x x x x x x x x x x x x x |
  81. E +----------------------------------^---^---^---^-------------------------------^--+
  82. D | | | | |
  83. G 3.3V MOSIMISO| GND
  84. E (VCC) CLK
  85. Body of Pi (closest to you)
  86. and to your X230:
  87. Screen (furthest from you)
  88. __
  89. MOSI 5 --| |-- 4 GND
  90. CLK 6 --| |-- 3 N/C
  91. N/C 7 --| |-- 2 MISO
  92. VCC 8 --|__|-- 1 CS
  93. Edge (closest to you)
  94. Now you should be able to copy the image over to your Rasperry Pi and run the
  95. mentioned `flashrom` commands.
  96. ## How we build
  97. Everything necessary to build coreboot is included in this project and building
  98. coreboot is not hard at all. Please refer to [coreboot's own documentation](https://www.coreboot.org/Build_HOWTO).
  99. When building, testing and doing a release here, we always try to upload our
  100. result to coreboot's [board status project](https://www.coreboot.org/Supported_Motherboards).