Lines Matching +full:rom +full:- +full:15 +full:h

1 # SPDX-License-Identifier: GPL-2.0+
6 U-Boot on x86
9 This document describes the information about U-Boot running on x86 targets,
13 ------
14 U-Boot supports running as a coreboot [1] payload on x86. So far only Link
17 most of the low-level details.
19 U-Boot is a main bootloader on Intel Edison board.
21 U-Boot also supports booting directly from x86 reset vector, without coreboot.
23 'bare metal', U-Boot acts like a BIOS replacement. The following platforms
26 - Bayley Bay CRB
27 - Cherry Hill CRB
28 - Congatec QEVAL 2.0 & conga-QA3/E3845
29 - Cougar Canyon 2 CRB
30 - Crown Bay CRB
31 - Galileo
32 - Link (Chromebook Pixel)
33 - Minnowboard MAX
34 - Samus (Chromebook Pixel 2015)
35 - QEMU x86 (32-bit & 64-bit)
37 As for loading an OS, U-Boot supports directly booting a 32-bit or 64-bit
39 U-Boot supports loading an x86 VxWorks kernel. Please check README.vxworks
42 Build Instructions for U-Boot as coreboot payload
43 -------------------------------------------------
44 Building U-Boot as a coreboot payload is just like building U-Boot for targets
50 Build Instructions for U-Boot as main bootloader
51 ------------------------------------------------
55 Simple you can build U-Boot and obtain u-boot.bin
60 Build Instructions for U-Boot as BIOS replacement (bare mode)
61 -------------------------------------------------------------
62 Building a ROM version of U-Boot (hereafter referred to as u-boot.rom) is a
64 shipped in the U-Boot source tree. Due to this reason, the u-boot.rom build is
65 not turned on by default in the U-Boot source tree. Firstly, you need turn it
66 on by enabling the ROM build either via an environment variable
74 Both tell the Makefile to build u-boot.rom as a target.
76 ---
82 * descriptor.bin - Intel flash descriptor
83 * me.bin - Intel Management Engine
84 * mrc.bin - Memory Reference Code, which sets up SDRAM
85 * video ROM - sets up the display
96 * ./northbridge/intel/sandybridge/systemagent-r6.bin
99 As for the video ROM, you can get it here [3] and rename it to vga.bin.
102 Now you can build U-Boot and obtain u-boot.rom:
107 ---
113 * descriptor.bin - Intel flash descriptor
114 * me.bin - Intel Management Engine
115 * mrc.bin - Memory Reference Code, which sets up SDRAM
116 * refcode.elf - Additional Reference code
117 * vga.bin - video ROM, which sets up the display
120 developer mode on the Chromebook (use Ctrl-Alt-F2 to obtain a terminal and
124 flashrom -w samus.bin
132 on the 'coreboot-Google_Samus.*' file to short-circuit some of the below.
134 Then 'ifdtool -x samus.bin' on your development machine will produce:
142 You can ignore flashregion_1_bios.bin - it is not used.
151 pci8086,0406.rom 0x7004c0 optionrom 65536
160 u-boot.dtb 0x76eb00 (unknown) 5318
167 cbfstool samus.bin extract -n pci8086,0406.rom -f vga.bin
168 cbfstool samus.bin extract -n fallback/refcode -f refcode.rmod
169 cbfstool samus.bin extract -n mrc.bin -f mrc.bin
170 cbfstool samus.bin extract -n fallback/refcode -f refcode.bin -U
172 Note that the -U flag is only supported by the latest cbfstool. It unpacks
179 Now you can build U-Boot and obtain u-boot.rom:
184 If you are using em100, then this command will flash write -Boot:
186 em100 -s -d filename.rom -c W25Q64CV -r
188 ---
192 U-Boot support of Intel Crown Bay board [4] relies on a binary blob called
200 the SPI flash where u-boot.rom resides, and this CMC binary blob can be found
203 * ./FSP/QUEENSBAY_FSP_GOLD_001_20-DECEMBER-2013.fd
216 As for the video ROM, you need manually extract it from the Intel provided
217 BIOS for Crown Bay here [6], using the AMI MMTool [7]. Check PCI option ROM
220 Now you can build U-Boot and obtain u-boot.rom
225 ---
231 website and put the .fd file (CHIEFRIVER_FSP_GOLD_001_09-OCTOBER-2013.fd at the
234 Now build U-Boot and obtain u-boot.rom
239 The board has two 8MB SPI flashes mounted, which are called SPI-0 and SPI-1 in
240 the board manual. The SPI-0 flash should have flash descriptor plus ME firmware
241 and SPI-1 flash is used to store U-Boot. For convenience, the complete 8MB SPI-0
243 this image to the SPI-0 flash according to the board manual just once and we are
244 all set. For programming U-Boot we just need to program SPI-1 flash. Since the
245 default u-boot.rom image for this board is set to 2MB, it should be programmed
248 ---
254 Download this and get the .fd file (BAYTRAIL_FSP_GOLD_003_16-SEP-2014.fd at
264 $ ./tools/ifdtool -x BayleyBay/SPI.bin
273 http://firmware.intel.com/sites/default/files/2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip
277 $ unzip 2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip
279 Use ifdtool in the U-Boot tools directory to extract the images from that
282 $ ./tools/ifdtool -x MNW2MAX1.X64.0073.R02.1409160934.bin
284 This will provide the descriptor file - copy this into the correct place:
288 Now you can build U-Boot and obtain u-boot.rom
296 $ md5sum -b board/intel/minnowmax/*.bin
302 The ROM image is broken up into these parts:
305 ------------------------------------------------------------
306 000000 descriptor.bin Hard-coded to 0 in ifdtool
311 700000 u-boot-dtb.bin CONFIG_SYS_TEXT_BASE
315 7ff800 U-Boot 16-bit boot CONFIG_SYS_X86_START16
317 Overall ROM image size is controlled by CONFIG_ROM_SIZE.
323 ---
336 vbt.bin if you want graphics support in U-Boot.
338 Now you can build U-Boot and obtain u-boot.rom
343 An important note for programming u-boot.rom to the on-board SPI flash is that
347 For the on-board SPI flash MX25U6435F, this can be done by writing 0x40 to the
349 Register(s) > Register1 Value(Hex). This is is a one-time change. Once set, it
350 persists in SPI flash part regardless of the u-boot.rom image burned.
352 ---
357 Quark SoC. Not like FSP, U-Boot does not call into the binary. The binary is
368 Now you can build U-Boot and obtain u-boot.rom
373 ---
377 To build u-boot.rom for QEMU x86 targets, just simply run
379 $ make qemu-x86_defconfig (for 32-bit)
381 $ make qemu-x86_64_defconfig (for 64-bit)
384 Note this default configuration will build a U-Boot for the QEMU x86 i440FX
385 board. To build a U-Boot against QEMU x86 Q35 board, you can change the build
388 Device Tree Control --->
390 (qemu-x86_q35) Default Device Tree for DT control
393 ------------------
394 For testing U-Boot as the coreboot payload, there are things that need be paid
395 attention to. coreboot supports loading an ELF executable and a 32-bit plain
397 U-Boot is set up to use a separate Device Tree Blob (dtb). As of today, the
398 generated u-boot-dtb.bin needs to be packaged by the cbfstool utility (a tool
403 $ ./build/util/cbfstool/cbfstool build/coreboot.rom add-flat-binary \
404 -f u-boot-dtb.bin -n fallback/payload -c lzma -l 0x1110000 -e 0x1110000
409 If you want to use ELF as the coreboot payload, change U-Boot configuration to
414 - Set framebuffer graphics resolution (1280x1024 32k-color (1:5:5))
415 - Keep VESA framebuffer
422 ----------------------------
423 QEMU is a fancy emulator that can enable us to test U-Boot without access to
425 U-Boot. To launch QEMU with u-boot.rom, call QEMU as follows:
427 $ qemu-system-i386 -nographic -bios path/to/u-boot.rom
431 also supported by U-Boot. To instantiate such a machine, call QEMU with:
433 $ qemu-system-i386 -nographic -bios path/to/u-boot.rom -M q35
436 it is enough to have U-Boot boot and function correctly. You can increase the
437 system memory by pass '-m' parameter to QEMU if you want more memory:
439 $ qemu-system-i386 -nographic -bios path/to/u-boot.rom -m 1024
441 This creates a board with 1 GiB system memory. Currently U-Boot for QEMU only
443 for PCI device memory-mapped I/O and other stuff, so the maximum value of '-m'
446 QEMU emulates a graphic card which U-Boot supports. Removing '-nographic' will
448 If you want to check both consoles, use '-serial stdio'.
450 Multicore is also supported by QEMU via '-smp n' where n is the number of cores
454 initrd, command-line arguments and more. U-Boot supports directly accessing
459 $ qemu-system-i386 -nographic -bios path/to/u-boot.rom -m 1024 -kernel /path/to/bzImage
460 -append 'root=/dev/ram console=ttyS0' -initrd /path/to/initrd -smp 8
462 Note: -initrd and -smp are both optional
464 Then start QEMU, in U-Boot command line use the following U-Boot command to
468 qfw - QEMU firmware interface
472 - list : print firmware(s) currently loaded
473 - cpus : print online cpu number
474 - load <kernel addr> <initrd addr> : load kernel and initrd (if any) and setup for zboot
482 => zboot 01000000 - 04000000 1b1ab50
484 To run 64-bit U-Boot, qemu-system-x86_64 should be used instead, e.g.:
485 $ qemu-system-x86_64 -nographic -bios path/to/u-boot.rom
487 A specific CPU can be specified via the '-cpu' parameter but please make
488 sure the specified CPU supports 64-bit like '-cpu core2duo'. Conversely
489 '-cpu pentium' won't work for obvious reasons that the processor only
490 supports 32-bit.
492 Note 64-bit support is very preliminary at this point. Lots of features
493 are missing in the 64-bit world. One notable feature is the VGA console
494 support which is currently missing, so that you must specify '-nographic'
495 to get 64-bit U-Boot up and running.
497 Updating U-Boot on Edison
498 -------------------------
500 patched U-Boot v2014.04. Though it supports DFU which we may be able to
503 1. Prepare u-boot.bin as described in chapter above. You still need one
504 more step (if and only if you have original U-Boot), i.e. run the
507 $ truncate -s %4096 u-boot.bin
509 2. Run your board and interrupt booting to U-Boot console. In the console
517 $ dfu-util -v -d 8087:0a99 --alt u-boot0 -D u-boot.bin
519 4. Return to U-Boot console and following hint. i.e. push Ctrl+C, and
525 -------------
527 loaded on the processor after power up in order to function properly. U-Boot
531 -----------
532 On a multicore system, U-Boot is executed on the bootstrap processor (BSP).
533 Additional application processors (AP) can be brought up by U-Boot. In order to
534 have an SMP kernel to discover all of the available processors, U-Boot needs to
535 prepare configuration tables which contain the multi-CPUs information before
536 loading the OS kernel. Currently U-Boot supports generating two types of tables
537 for SMP, called Simple Firmware Interface (SFI) [9] and Multi-Processor (MP)
542 ------------
544 keyboard, real-time clock, USB. Video is in progress.
547 -----------
554 ---------------
555 In keeping with the U-Boot philosophy of providing functions to check and
556 adjust internal settings, there are several x86-specific commands that may be
559 fsp - Display information about Intel Firmware Support Package (FSP).
561 iod - Display I/O memory
562 iow - Write I/O memory
563 mtrr - List and set the Memory Type Range Registers (MTRR). These are used to
565 mode to use. U-Boot sets up some reasonable values but you can
569 --------------
570 As an example of how to set up your boot flow with U-Boot, here are
571 instructions for starting Ubuntu from U-Boot. These instructions have been
577 Note: It is possible to set up U-Boot to boot automatically using syslinux.
582 possible to make U-Boot start a USB start-up disk but for now let's assume
585 Use the U-Boot command line to find the UUID of the partition you want to
590 Partition Map for SCSI device 0 -- Partition Type: EFI
598 type: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
599 guid: 9d02e8e4-4d59-408f-a9b0-fd497bc9291c
602 type: 0fc63daf-8483-4772-8e79-3d69d8477de4
603 guid: 965c59ee-1822-4326-90d2-b02446050059
606 type: 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
607 guid: 2c4282bd-1e82-4bcf-a5ff-51dedbf39f17
660 3381262 System.map-3.13.0-32-generic
661 1162712 abi-3.13.0-32-generic
662 165611 config-3.13.0-32-generic
666 5798112 vmlinuz-3.13.0-32-generic
667 165762 config-3.13.0-58-generic
668 1165129 abi-3.13.0-58-generic
669 5823136 vmlinuz-3.13.0-58-generic
670 19215259 initrd.img-3.13.0-58-generic
671 3391763 System.map-3.13.0-58-generic
672 5825048 vmlinuz-3.13.0-58-generic.efi.signed
673 28304443 initrd.img-3.13.0-32-generic
677 self-extracting compressed file mixed with some 'setup' configuration data.
689 but normally this is not needed. The '-58' is used by Ubuntu. Each time they
694 The '.efi.signed' kernel is signed for EFI's secure boot. U-Boot has its own
695 secure boot mechanism - see [12] [13] and cannot read .efi files at present.
697 To boot Ubuntu from U-Boot the steps are as follows:
702 => setenv bootargs root=/dev/disk/by-partuuid/965c59ee-1822-4326-90d2-b02446050059 ro
705 by its GUID, using '/dev/disk/by-partuuid/', a Linux path to a 'directory'
712 => ext2load scsi 0:2 03000000 /boot/vmlinuz-3.13.0-58-generic
720 => ext2load scsi 0:2 04000000 /boot/initrd.img-3.13.0-58-generic
723 a variable for that. U-Boot sets 'filesize' to the size of the last file it
728 Type 'help zboot' if you want to see what the arguments are. U-Boot on x86 is
730 U-Boot:
736 …Linux kernel version 3.13.0-58-generic (buildd@allspice) #97-Ubuntu SMP Wed Jul 8 02:56:15 UTC 2015
741 Kernel command line: "root=/dev/disk/by-partuuid/965c59ee-1822-4326-90d2-b02446050059 ro"
745 U-Boot prints out some bootstage timing. This is more useful if you put the
767-58-generic (buildd@allspice) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #97-Ubuntu SMP Wed Jul…
768 …[ 0.000000] Command line: root=/dev/disk/by-partuuid/965c59ee-1822-4326-90d2-b02446050059 ro co…
773 [ 0.000000] RAMDISK: [mem 0x04000000-0x05253fff]
776 [ 1.540111] Freeing initrd memory: 18768K (ffff880004000000 - ffff880005254000)
781 Begin: Running /scripts/local-premount ... done.
785 [ 4.357243] scsi 1:0:0:0: Direct-Access ATA ADATA SP310 5.2 PQ: 0 ANSI: 5
786 [ 4.366860] sd 1:0:0:0: [sda] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
792 Linux has found the three partitions (sda1-3). Mercifully it doesn't print out
803 displays the Ubuntu start-up screen) and a lot of 'Starting' messages:
811 setenv bootargs root=UUID=b2aaf743-0418-4d90-94cc-3e6108d7d968 ro
813 …xt2load scsi 0:2 03000000 /boot/vmlinuz-3.13.0-58-generic; ext2load scsi 0:2 04000000 /boot/initrd…
819 You can also bake this behaviour into your build by hard-coding the
820 environment variables if you add this to minnowmax.h:
824 "ext2load scsi 0:2 03000000 /boot/vmlinuz-3.13.0-58-generic; " \
825 "ext2load scsi 0:2 04000000 /boot/initrd.img-3.13.0-58-generic; " \
836 -----------------
837 SeaBIOS [14] is an open source implementation of a 16-bit x86 BIOS. It can run
838 in an emulator or natively on x86 hardware with the use of U-Boot. With its
839 help, we can boot some OSes that require 16-bit BIOS services like Windows/DOS.
841 As U-Boot, we have to manually create a table where SeaBIOS gets various system
845 To support loading SeaBIOS, U-Boot should be built with CONFIG_SEABIOS on.
846 Booting SeaBIOS is done via U-Boot's bootelf command, like below:
854 SeaBIOS (version rel-1.9.0)
869 Total size: 121888 Fixed: 66496 Free: 9184 (used 93.0% of 128KiB rom)
872 Currently this is tested on QEMU x86 target with U-Boot chain-loading SeaBIOS
876 $ qemu-img create -f qcow2 disk.img 10G
879 $ qemu-system-i386 -serial stdio -bios u-boot.rom -hda disk.img -cdrom winxp.iso -smp 2 -m 512
882 $ qemu-system-i386 -serial stdio -bios u-boot.rom -hda disk.img -smp 2 -m 512
885 SeaBIOS then chain-loading a GRUB on a USB drive, then Linux kernel finally.
888 device on your board, SeaBIOS needs to be patched manually to get its VGA ROM
889 loaded and run by SeaBIOS. SeaBIOS locates VGA ROM via the PCI expansion ROM
890 register, but IGD device does not have its VGA ROM mapped by this register.
891 Its VGA ROM is packaged as part of u-boot.rom at a configurable flash address
894 diff --git a/src/optionroms.c b/src/optionroms.c
896 --- a/src/optionroms.c
898 @@ -324,6 +324,8 @@ init_pcirom(struct pci_device *pci, int isvga, u64 *sources)
899 rom = deploy_romfile(file);
901 rom = map_pcirom(pci);
902 + if (pci->bdf == pci_to_bdf(0, 2, 0))
903 + rom = (struct rom_header *)0xfff90000;
904 if (! rom)
905 // No ROM present.
908 Note: the patch above expects IGD device is at PCI b.d.f 0.2.0 and its VGA ROM
913 ----------------
914 These notes are for those who want to port U-Boot to a new x86 platform.
923 sudo em100 -s -p LOW -d u-boot.rom -c W25Q64DW -r
927 http://www.dediprog.com/pd/programmer-accessories/EM-TC-8
934 Intel-specific feature - e.g. tools/ifttool has an option to set the SPI
943 The ivybridge support works this way, although it still uses a ROM for
951 ./tools/microcode-tool -d microcode.dat -m <model> create
955 ./tools/microcode-tool -H BAY_TRAIL_FSP_KIT/Microcode/M0130673322.h \
956 -H BAY_TRAIL_FSP_KIT/Microcode/M0130679901.h \
957 -m all create
962 model. U-Boot prints this information when it starts
964 CPU: x86_64, vendor Intel, device 30673h
968 If you platform can display POST codes on two little 7-segment displays on
975 During the U-Boot porting, one of the important steps is to write correct PIRQ
978 refer to U-Boot doc [15] for the device tree bindings of Intel interrupt router.
979 Here we have more details on the intel,pirq-routing property below.
981 intel,pirq-routing = <
990 can get the interrupt pin either from datasheet or hardware via U-Boot shell.
992 up-to-date. Type 'pci header' plus the device's pci bus/device/function number
993 from U-Boot shell below.
1006 chipset, the power-up default mapping is INTA/B/C/D maps to PIRQA/B/C/D. This
1011 allocation and assignment will be done by U-Boot automatically. Now you can
1016 U-Boot then it will generate a device tree fragment with the interrupt
1021 {patsplit(device, bdf, "[0-9a-f]+"); \
1031 -------------
1033 Quark-specific considerations:
1035 To port U-Boot to other boards based on the Intel Quark SoC, a few things need
1037 parameters. Quark MRC supports memory-down configuration only. All these MRC
1041 Available MRC parameter values are listed in include/dt-bindings/mrc/quark.h.
1043 but by default they are held in reset after power on. In U-Boot, PCIe
1047 The two routines need implement a board-specific mechanism to assert/deassert
1057 U-Boot drivers. It will not resolve all build errors, but will perform common
1059 to U-Boot. This should go at the top of each file and list the coreboot
1069 -------------------
1071 industry-standard interfaces enabling OS-directed configuration, power
1076 For Windows, ACPI is a must-have firmware feature since Windows Vista.
1078 U-Boot. This requires Intel ACPI compiler to be installed on your host to
1080 the compiler via "apt-get install iasl" if you are on Ubuntu or download
1083 Current ACPI support in U-Boot is basically complete. More optional features
1089 * Support booting a pre-installed Ubuntu distribution via 'zboot' command.
1090 * Support installing and booting Ubuntu 14.04 (or above) from U-Boot with
1091 the help of SeaBIOS using legacy interface (non-UEFI mode).
1092 * Support installing and booting Windows 8.1/10 from U-Boot with the help
1093 of SeaBIOS using legacy interface (non-UEFI mode).
1097 * Dynamic AML bytecodes insertion at run-time. We may need this to support
1099 * SMI support. Since U-Boot is a modern bootloader, we don't want to bring
1100 those legacy stuff into U-Boot. ACPI spec allows a system that does not
1101 support SMI (a legacy-free system).
1104 a pre-installed Ubuntu 14.04 from a SATA drive. Installing Ubuntu 14.04 and
1116 pressed again, U-Boot runs as it does in cold boot and detects the sleeping
1118 U-Boot is responsible for restoring the machine state as it is before sleep.
1119 When everything is done, U-Boot finds out the wakeup vector provided by OSes
1128 -----------
1129 U-Boot supports booting as a 32-bit or 64-bit EFI payload, e.g. with UEFI.
1130 This is enabled with CONFIG_EFI_STUB to boot from both 32-bit and 64-bit
1131 UEFI BIOS. U-Boot can also run as an EFI application, with CONFIG_EFI_APP.
1132 The CONFIG_EFI_LOADER option, where U-Boot provides an EFI environment to
1133 the kernel (i.e. replaces UEFI completely but provides the same EFI run-time
1135 to load a 'u-boot-payload.efi', see below test logs on QEMU.
1137 => load ide 0 3000000 u-boot-payload.efi
1144 U-Boot EFI Payload
1147 U-Boot 2018.07-rc2 (Jun 23 2018 - 17:12:58 +0800)
1149 CPU: x86_64, vendor AMD, device 663h
1156 Warning: e1000#0 using MAC address from ROM
1161 See README.u-boot_on_efi and README.uefi for details of EFI support in U-Boot.
1164 ---------
1165 - Audio
1166 - Chrome OS verified boot
1169 ----------
1172 [3] http://www.coreboot.org/~stepan/pci8086,0166.rom
1173 …/www.intel.com/content/www/us/en/embedded/design-tools/evaluation-platforms/atom-e660-eg20t-develo…
1175 [6] http://www.intel.com/content/www/us/en/secure/intelligent-systems/privileged/e6xx-35-b1-cmc2221…
1176 [7] http://www.ami.com/products/bios-uefi-tools-and-utilities/bios-uefi-utilities/
1182 [13] http://events.linuxfoundation.org/sites/events/files/slides/elce-2014.pdf
1184 [15] doc/device-tree-bindings/misc/intel,irq-router.txt