[U-Boot] [PATCH v2 0/22] x86: Add support for MTRRs

Simon Glass sjg at chromium.org
Fri Jan 2 00:17:53 CET 2015


One of the four items left to fix up for bare ivybridge support in U-Boot
is MTRRs. These are an important part of the x86 platform since they provide
a means to control the cache behaviour for areas of memory.

Memory areas can be marked as uncacheable or cacheable. For cacheable the
write behaviour can be controlled:

- write-back: data is not written back from the cache until evicted
- write-though: data goes into the cache but is also written to memory
- write-protect: data cannot be written to this area
- write-combining: multiple writes to this area can be combined

This series adds support for deciding the MTRR setup that should be used,
commiting it to registers before relocation, updating it for the video frame
buffer, disabling CAR (cache-as-RAM) when needed and making sure that the
faster possible execution speed is provided. In addition an 'mtrr' command
is added to permit inspection and adjustment of MTRR registers from the
command line.

Changes in v2:
- Remove CONFIG_RAMTOP from mtrr.h in this patch
- Use CONFIG_VIDEO directly to control running the video BIOS
- Remove definition of 'ulong start' from this patch
- Remove unused Lhlt code
- Use a simple 'ret' instruction to return
- Use a simple call instruction to call car_uninit
- Use constants for microcode MSRs and header length
- Move cmd_mtrr to arch/x86/lib
- Correct 'platform' typo

Simon Glass (22):
  x86: Correct XIP_ROM_SIZE
  x86: Drop RAMTOP Kconfig
  x86: Correct ifdtool microcode calculation
  x86: video: Add support for CONFIG_CONSOLE_SCROLL_LINES
  x86: config: Always scroll the display by 5 lines, for speed
  x86: video: Add a debug() to display the frame buffer address
  x86: pci: Don't return a vesa mode when there is not video
  x86: video: Add debug option to time the BIOS copy
  x86: ivybridge: Only run the Video BIOS when video is enabled
  x86: Use cache, don't clear the display in video BIOS
  x86: Tidy up VESA mode numbers
  x86: pci: Display vesa modes in hex
  x86: ivybridge: Drop support for ROM caching
  x86: Add support for MTRRs
  x86: ivybridge: Set up an MTRR for the video frame buffer
  x86: board_f: Adjust x86 boot order for performance
  x86: ivybridge: Request MTRRs for DRAM regions
  x86: Commit the current MTRRs before relocation
  x86: ivybridge: Add a way to turn off the CAR
  x86: Disable CAR before relocation on platforms that need it
  x86: ivybridge: Update microcode early in boot
  x86: Add an 'mtrr' command to list and adjust MTRRs

 arch/x86/Kconfig                                |   6 +-
 arch/x86/cpu/Makefile                           |   1 +
 arch/x86/cpu/coreboot/coreboot.c                |  22 ++--
 arch/x86/cpu/ivybridge/car.S                    |  74 ++++++++++-
 arch/x86/cpu/ivybridge/cpu.c                    |  27 +---
 arch/x86/cpu/ivybridge/gma.c                    |  16 ++-
 arch/x86/cpu/ivybridge/microcode_intel.c        |  26 ++--
 arch/x86/cpu/ivybridge/sdram.c                  |  10 ++
 arch/x86/cpu/mtrr.c                             |  81 ++++++++++++
 arch/x86/cpu/start.S                            |   9 ++
 arch/x86/dts/link.dts                           |   3 -
 arch/x86/include/asm/arch-ivybridge/microcode.h |   6 +
 arch/x86/include/asm/global_data.h              |  15 +++
 arch/x86/include/asm/mtrr.h                     | 163 +++++++++++-------------
 arch/x86/lib/Makefile                           |   1 +
 arch/x86/lib/bios.c                             |  14 +-
 arch/x86/lib/cmd_mtrr.c                         | 138 ++++++++++++++++++++
 arch/x86/lib/init_helpers.c                     |   8 ++
 common/board_f.c                                |   8 +-
 doc/README.x86                                  |  18 ++-
 drivers/pci/pci_rom.c                           |   9 +-
 drivers/video/cfb_console.c                     |  26 ++--
 drivers/video/x86_fb.c                          |   1 +
 include/configs/x86-common.h                    |   1 +
 tools/ifdtool.c                                 |   4 +-
 25 files changed, 511 insertions(+), 176 deletions(-)
 create mode 100644 arch/x86/cpu/mtrr.c
 create mode 100644 arch/x86/lib/cmd_mtrr.c

-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list