README.x86 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #
  2. # Copyright (C) 2014, Simon Glass <sjg@chromium.org>
  3. # Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
  4. #
  5. # SPDX-License-Identifier: GPL-2.0+
  6. #
  7. U-Boot on x86
  8. =============
  9. This document describes the information about U-Boot running on x86 targets,
  10. including supported boards, build instructions, todo list, etc.
  11. Status
  12. ------
  13. U-Boot supports running as a coreboot [1] payload on x86. So far only Link
  14. (Chromebook Pixel) has been tested, but it should work with minimal adjustments
  15. on other x86 boards since coreboot deals with most of the low-level details.
  16. U-Boot also supports booting directly from x86 reset vector without coreboot,
  17. aka raw support or bare support. Currently Link and Intel Crown Bay board
  18. support running U-Boot 'bare metal'.
  19. As for loading OS, U-Boot supports directly booting a 32-bit or 64-bit Linux
  20. kernel as part of a FIT image. It also supports a compressed zImage.
  21. Build Instructions
  22. ------------------
  23. Building U-Boot as a coreboot payload is just like building U-Boot for targets
  24. on other architectures, like below:
  25. $ make coreboot-x86_defconfig
  26. $ make all
  27. Note this default configuration will build a U-Boot payload for the Link board.
  28. To build a coreboot payload against another board, you can change the build
  29. configuration during the 'make menuconfig' process.
  30. x86 architecture --->
  31. ...
  32. (chromebook_link) Board configuration file
  33. (chromebook_link) Board Device Tree Source (dts) file
  34. (0x19200000) Board specific Cache-As-RAM (CAR) address
  35. (0x4000) Board specific Cache-As-RAM (CAR) size
  36. Change the 'Board configuration file' and 'Board Device Tree Source (dts) file'
  37. to point to a new board. You can also change the Cache-As-RAM (CAR) related
  38. settings here if the default values do not fit your new board.
  39. Building ROM version of U-Boot (hereafter referred to as u-boot.rom) is a
  40. little bit tricky, as generally it requires several binary blobs which are not
  41. shipped in the U-Boot source tree. Due to this reason, the u-boot.rom build is
  42. not turned on by default in the U-Boot source tree. Firstly, you need turn it
  43. on by uncommenting the following line in the main U-Boot Makefile:
  44. # ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
  45. Link-specific instructions:
  46. First, you need the following binary blobs:
  47. * descriptor.bin - Intel flash descriptor
  48. * me.bin - Intel Management Engine
  49. * mrc.bin - Memory Reference Code, which sets up SDRAM
  50. * video ROM - sets up the display
  51. You can get these binary blobs by:
  52. $ git clone http://review.coreboot.org/p/blobs.git
  53. $ cd blobs
  54. Find the following files:
  55. * ./mainboard/google/link/descriptor.bin
  56. * ./mainboard/google/link/me.bin
  57. * ./northbridge/intel/sandybridge/systemagent-ivybridge.bin
  58. The 3rd one should be renamed to mrc.bin.
  59. As for the video ROM, you can get it here [2].
  60. Make sure all these binary blobs are put in the board directory.
  61. Now you can build U-Boot and obtain u-boot.rom:
  62. $ make chromebook_link_defconfig
  63. $ make all
  64. Intel Crown Bay specific instructions:
  65. U-Boot support of Intel Crown Bay board [3] relies on a binary blob called
  66. Firmware Support Package [4] to perform all the necessary initialization steps
  67. as documented in the BIOS Writer Guide, including initialization of the CPU,
  68. memory controller, chipset and certain bus interfaces.
  69. Download the Intel FSP for Atom E6xx series and Platform Controller Hub EG20T,
  70. install it on your host and locate the FSP binary blob. Note this platform
  71. also requires a Chipset Micro Code (CMC) state machine binary to be present in
  72. the SPI flash where u-boot.rom resides, and this CMC binary blob can be found
  73. in this FSP package too.
  74. * ./FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd
  75. * ./Microcode/C0_22211.BIN
  76. Rename the first one to fsp.bin and second one to cmc.bin and put them in the
  77. board directory.
  78. Now you can build U-Boot and obtain u-boot.rom
  79. $ make crownbay_defconfig
  80. $ make all
  81. Test with coreboot
  82. ------------------
  83. For testing U-Boot as the coreboot payload, there are things that need be paid
  84. attention to. coreboot supports loading an ELF executable and a 32-bit plain
  85. binary, as well as other supported payloads. With the default configuration,
  86. U-Boot is set up to use a separate Device Tree Blob (dtb). As of today, the
  87. generated u-boot-dtb.bin needs to be packaged by the cbfstool utility (a tool
  88. provided by coreboot) manually as coreboot's 'make menuconfig' does not provide
  89. this capability yet. The command is as follows:
  90. # in the coreboot root directory
  91. $ ./build/util/cbfstool/cbfstool build/coreboot.rom add-flat-binary \
  92. -f u-boot-dtb.bin -n fallback/payload -c lzma -l 0x1110000 -e 0x1110015
  93. Make sure 0x1110000 matches CONFIG_SYS_TEXT_BASE and 0x1110015 matches the
  94. symbol address of _start (in arch/x86/cpu/start.S).
  95. If you want to use ELF as the coreboot payload, change U-Boot configuration to
  96. use CONFIG_OF_EMBED.
  97. CPU Microcode
  98. -------------
  99. Modern CPU usually requires a special bit stream called microcode [5] to be
  100. loaded on the processor after power up in order to function properly. U-Boot
  101. has already integrated these as hex dumps in the source tree.
  102. Driver Model
  103. ------------
  104. x86 has been converted to use driver model for serial and GPIO.
  105. Device Tree
  106. -----------
  107. x86 uses device tree to configure the board thus requires CONFIG_OF_CONTROL to
  108. be turned on. Not every device on the board is configured via device tree, but
  109. more and more devices will be added as time goes by. Check out the directory
  110. arch/x86/dts/ for these device tree source files.
  111. Useful Commands
  112. ---------------
  113. In keeping with the U-Boot philosophy of providing functions to check and
  114. adjust internal settings, there are several x86-specific commands that may be
  115. useful:
  116. hob - Display information about Firmware Support Package (FSP) Hand-off
  117. Block. This is only available on platforms which use FSP, mostly
  118. Atom.
  119. iod - Display I/O memory
  120. iow - Write I/O memory
  121. mtrr - List and set the Memory Type Range Registers (MTRR). These are used to
  122. tell the CPU whether memory is cacheable and if so the cache write
  123. mode to use. U-Boot sets up some reasonable values but you can
  124. adjust then with this command.
  125. TODO List
  126. ---------
  127. - Audio
  128. - Chrome OS verified boot
  129. - SMI and ACPI support, to provide platform info and facilities to Linux
  130. References
  131. ----------
  132. [1] http://www.coreboot.org
  133. [2] http://www.coreboot.org/~stepan/pci8086,0166.rom
  134. [3] http://www.intel.com/content/www/us/en/embedded/design-tools/evaluation-platforms/atom-e660-eg20t-development-kit.html
  135. [4] http://www.intel.com/fsp
  136. [5] http://en.wikipedia.org/wiki/Microcode