[U-Boot] [PATCH 00/82] x86: Add initial support for 64-bit U-Boot

Simon Glass sjg at chromium.org
Mon Sep 26 05:33:03 CEST 2016


At present U-Boot runs entirely in 32-bit mode on x86, except for the
initial switch from 16-bit mode. On 64-bit machines it is possible to run
in 64-bit mode. This series starts the process of adding this support.

The main benefit of 64-bit mode for a boot loader is direct access to all
available memory. There are also more registers, but this makes very little
difference.

This feature is implemented by putting all of the 32-bit code in an SPL
build. SPL then runs through all the init that has to be done in 32-bit
mode, changes to 64-bit mode and then jumps to U-Boot proper.

Typically the total code size increases slightly. For example, on link in
32-bit mode, U-Boot has around 480KB of code (admittedly with a large
number of features enabled). In 64-bit mode, U-Boot falls to around 460KB,
but SPL adds another 60KB, for a net increase of 40KB. Partly this is due
to code duplication and partly it is due to the worse code density of
64-bit code on x86.

Many major features are not implemented yet, for example:
- SDRAM sizing
- Booting linux
- FSP support
- EFI support
- SCSI device init
- Running video ROMs

Still, this is a big step forward towards full 64-bit support. To enable it,
select CONFIG_X86_RUN_64BIT.

This series is available at u-boot-x86/64-working


Simon Glass (82):
  WIP: x86: Fix up types in smbios code
  Add _image_binary_end section declaration
  bios_emulator: Fix cast for 64-bit compilation
  board_f: Drop the extra fdtdec_prepare_fdt()
  console: Don't enable CONFIG-CONSOLE_MUX, etc. in SPL
  elf: Add the Elf64_Rela type
  mmc: Fix cast for 64-bit compilation
  rtc: Use CONFIG_X86 instead of __I386__
  spl: spi: Add a debug message if loading fails
  spl: Makefile: Define SPL_ earlier
  spl: Allow CPU drivers to be used in SPL
  spl: Allow PCI drivers to be used in SPL
  spl: Allow RTC drivers to be used in SPL
  spl: Allow timer drivers to be used in SPL
  spl: Allow PCH drivers to be used in SPL
  spl: Don't create a BSS padding when it is separate
  tpm: Tidy up use of size_t
  usb: pci: Fix cast for 64-bit compilation
  video: Use ulong for video frame buffer address
  x86: Allow interrupts to be disabled in 64-bit mode
  x86: Correct address casts in cpu code
  x86: Correct address casts in interrupt code
  x86: Use unsigned long for address in table generation
  WIP: x86: Update mpspec to build on 64-bit machines
  x86: Add basic support for U-Boot as a 64-bit EFI application
  x86: ivybridge: Declare global data where it is used
  x86: i2c: Fix cast of address to 32-bit value
  x86: Don't export interrupt handlers with x86_64
  x86: ivybridge: Add more debugging for failures
  x86: ivybridge: Fix types for 64-bit compilation
  x86: ivybridge: Fix PCH power setup
  x86: ivybridge: Tidy up enable_clock_gating() for 64-bit
  x86: dts: Mark serial as needed before relocation
  x86: fsp: Fix cast for 64-bit compilation
  x86: Drop unused init_helper functions
  x86: lib: Fix types and casts for 64-bit compilation
  x86: mrccache: Fix error handling in mrccache_get_region()
  x86: Add Kconfig options to build 64-bit U-Boot
  x86: Kconfig: Add location options for 16/32-bit init
  x86: Use X86_16BIT_INIT instead of X86_RESET_VECTOR
  x86: Use X86_32BIT_INIT instead of X86_RESET_VECTOR
  x86: ivybridge: Allow 32-bit init to move to SPL
  x86: Add 64-bit start-up code
  x86: board_f: Update init sequence for 64-bit startup
  x86: board_r: Set the global data pointer after relocation
  x86: Do relocation before clearing BSS
  x86: Refactor relocation to prepare for 64-bit
  x86: Add support for 64-bit relocation
  x86: Tidy up use of size_t in relocation
  x86: Add an SPL implementation
  x86: Move the i386 code into its own directory
  x86: Add cpu code for x86_64
  x86: Support global_data on x86_64
  x86: Fix up CONFIG_X86_64 check
  x86: Add a link script for 64-bit x86
  x86: Add a link script for SPL
  x86: Add SPL build rules for start-up code
  x86: Fix up byteorder.h for x86_64
  x86: Drop flag_is_changable() on x86_64
  x86: Fix up type sizes for 64-bit
  x86: Mention the MRC region in the README
  x86: ivybridge: Only do graphics init in 32-bit mode
  x86: ivybridge: Skipt SATA init in SPL
  x86: ivybridge: Provide a dummy SDRAM init for 64-bit
  x86: Don't try to run the VGA BIOS in 64-bit mode
  x86: Don't build call64 and setjmp on 64-bit
  x86: Don't build cpu files which are not supported on 64-bit
  x86: Don't try to boot Linux from SPL
  x86: Drop interrupt support in 64-bit mode
  x86: Support jumping from SPL to U-Boot
  x86: Move pirq_routing_table to global_data
  x86: Move turbo_state to global_data
  x86: Change irq_already_routed to a local variable
  x86: Move call64 to the i386 directory
  x86: Move setjmp to the i386 directory
  x86: Add a dummy setjmp implementation for x86_64
  x86: link: Add a text base for 64-bit U-Boot
  x86: link: Add SPL declarations to the binman image
  x86: link: Set up device tree for SPL
  x86: link: Add build options for SPL
  x86: Update compile/link flags to support 64-bit U-Boot
  x86: link: Switch to 64-bit U-Boot

 Makefile                                        |   7 +-
 arch/x86/Kconfig                                |  85 ++++
 arch/x86/Makefile                               |   9 +-
 arch/x86/config.mk                              |  30 +-
 arch/x86/cpu/Makefile                           |  24 +-
 arch/x86/cpu/config.mk                          |   8 +-
 arch/x86/cpu/cpu.c                              | 506 --------------------
 arch/x86/cpu/efi/elf_x86_64_efi.lds             |   3 +
 arch/x86/cpu/i386/Makefile                      |   9 +
 arch/x86/cpu/{ => i386}/call64.S                |   3 +
 arch/x86/cpu/i386/cpu.c                         | 599 ++++++++++++++++++++++++
 arch/x86/cpu/{interrupts.c => i386/interrupt.c} |  13 +-
 arch/x86/cpu/{ => i386}/setjmp.S                |   0
 arch/x86/cpu/intel_common/Makefile              |  10 +-
 arch/x86/cpu/irq.c                              |  14 +-
 arch/x86/cpu/ivybridge/Makefile                 |  11 +-
 arch/x86/cpu/ivybridge/bd82x6x.c                |   6 +
 arch/x86/cpu/ivybridge/cpu.c                    |   4 +-
 arch/x86/cpu/ivybridge/gma.c                    |   4 +-
 arch/x86/cpu/ivybridge/lpc.c                    |  18 +-
 arch/x86/cpu/ivybridge/model_206ax.c            |   2 +
 arch/x86/cpu/ivybridge/northbridge.c            |   2 +
 arch/x86/cpu/ivybridge/sata.c                   |   4 +-
 arch/x86/cpu/ivybridge/sdram.c                  |  36 +-
 arch/x86/cpu/ivybridge/sdram_nop.c              |  29 ++
 arch/x86/cpu/start64.S                          |  39 ++
 arch/x86/cpu/turbo.c                            |   8 +-
 arch/x86/cpu/u-boot-64.lds                      |  76 +++
 arch/x86/cpu/u-boot-spl.lds                     |  74 +++
 arch/x86/cpu/u-boot.lds                         |   2 +-
 arch/x86/cpu/x86_64/Makefile                    |   6 +
 arch/x86/cpu/x86_64/cpu.c                       |  48 ++
 arch/x86/cpu/x86_64/interrupts.c                |  30 ++
 arch/x86/cpu/x86_64/setjmp.c                    |  20 +
 arch/x86/dts/binman.dtsi                        |  19 +
 arch/x86/dts/chromebook_link.dts                |  15 +-
 arch/x86/dts/serial.dtsi                        |   1 +
 arch/x86/include/asm/acpi_table.h               |   2 +-
 arch/x86/include/asm/byteorder.h                |  17 +-
 arch/x86/include/asm/cpu.h                      |  12 +
 arch/x86/include/asm/fsp/fsp_hob.h              |   2 +-
 arch/x86/include/asm/global_data.h              |   8 +-
 arch/x86/include/asm/init_helpers.h             |   2 -
 arch/x86/include/asm/mp.h                       |   3 +
 arch/x86/include/asm/mpspec.h                   |  10 +-
 arch/x86/include/asm/posix_types.h              |   5 +
 arch/x86/include/asm/sfi.h                      |   2 +-
 arch/x86/include/asm/smbios.h                   |   4 +-
 arch/x86/include/asm/spl.h                      |   8 +
 arch/x86/include/asm/tables.h                   |   2 +-
 arch/x86/include/asm/types.h                    |   5 +
 arch/x86/lib/Makefile                           |   9 +
 arch/x86/lib/acpi_table.c                       |   4 +-
 arch/x86/lib/bios.c                             |   4 +-
 arch/x86/lib/bootm.c                            |   2 +
 arch/x86/lib/init_helpers.c                     |  12 +-
 arch/x86/lib/interrupts.c                       |   5 +
 arch/x86/lib/mpspec.c                           |  14 +-
 arch/x86/lib/mrccache.c                         |   8 +-
 arch/x86/lib/pinctrl_ich6.c                     |   2 +-
 arch/x86/lib/pirq_routing.c                     |  14 +-
 arch/x86/lib/reloc_x86_64.c                     |  90 ++++
 arch/x86/lib/relocate.c                         | 102 +++-
 arch/x86/lib/sfi.c                              |   6 +-
 arch/x86/lib/smbios.c                           |  22 +-
 arch/x86/lib/spl.c                              | 149 ++++++
 arch/x86/lib/tables.c                           |   2 +-
 arch/x86/lib/zimage.c                           |   2 +-
 board/google/chromebook_link/Kconfig            |   3 +-
 common/board_f.c                                |  17 +-
 common/board_r.c                                |   5 +
 common/console.c                                |  30 +-
 common/spl/Kconfig                              |  47 ++
 common/spl/spl_spi.c                            |   4 +-
 configs/chromebook_link_defconfig               |  22 +-
 doc/README.x86                                  |   1 +
 drivers/Makefile                                |   5 +
 drivers/bios_emulator/atibios.c                 |   2 +-
 drivers/i2c/intel_i2c.c                         |   6 +-
 drivers/misc/qfw.c                              |   4 +-
 drivers/mmc/pci_mmc.c                           |   2 +-
 drivers/pci/pci_rom.c                           |   2 +-
 drivers/rtc/mc146818.c                          |   2 +-
 drivers/tpm/tpm_tis_lpc.c                       |   4 +-
 drivers/usb/host/ehci-pci.c                     |   4 +-
 include/_exports.h                              |   2 +-
 include/asm-generic/sections.h                  |   1 +
 include/configs/chromebook_link.h               |   9 +
 include/elf.h                                   |   6 +
 include/video_fb.h                              |   2 +-
 scripts/Makefile.spl                            |  18 +-
 91 files changed, 1796 insertions(+), 705 deletions(-)
 create mode 100644 arch/x86/cpu/i386/Makefile
 rename arch/x86/cpu/{ => i386}/call64.S (98%)
 create mode 100644 arch/x86/cpu/i386/cpu.c
 rename arch/x86/cpu/{interrupts.c => i386/interrupt.c} (98%)
 rename arch/x86/cpu/{ => i386}/setjmp.S (100%)
 create mode 100644 arch/x86/cpu/ivybridge/sdram_nop.c
 create mode 100644 arch/x86/cpu/start64.S
 create mode 100644 arch/x86/cpu/u-boot-64.lds
 create mode 100644 arch/x86/cpu/u-boot-spl.lds
 create mode 100644 arch/x86/cpu/x86_64/Makefile
 create mode 100644 arch/x86/cpu/x86_64/cpu.c
 create mode 100644 arch/x86/cpu/x86_64/interrupts.c
 create mode 100644 arch/x86/cpu/x86_64/setjmp.c
 create mode 100644 arch/x86/include/asm/spl.h
 create mode 100644 arch/x86/lib/reloc_x86_64.c
 create mode 100644 arch/x86/lib/spl.c

-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list