coreboot/src/cpu/intel
Patrick Rudolph 97dbfd3098 cpu/intel/car/non-evict: Improve CAR setup
On older CPUs lacking ESRM (Enhanced Short Rep Mov) the rep stos
instructions are very slow. Since the MTRR that covers the SPI ROM
is disabled when setting up the NEM, the CPU will run with cache
disabled and is even slower.

The Sandy Bridge BWG and the Sandy Bridge UEFI reference code do not
disable the MTRR on the XiP, allowing the CPU to run at full speed
when setting up CAR. On UEFI the CAR is set up by touching each
cache-line once. It doesn't clear the CAR while doing so.

Do the same to speed up setting CAR:
- Invalidate the cache
- Enable the SPI ROM XiP MTRR
- Set CR0.CD=0
- Touch one spot in each cache-line
- Clear CAR after NEM has been set up

To ensure that the CAR MTRR area is 64-byte aligned add an ALIGN to
the linker script. All existing boards should use a 64-byte alignment
for CAR.

TEST=Booted on Lenovo X220 and measured with cbmem -t:

TODO: Test on platforms that have FSRM (Ivy Bridge and newer).

Before:
   0:1st timestamp                                     1,083 (0)
  11:start of bootblock                                93,765 (92,681)

After:
   0:1st timestamp                                     0
  11:start of bootblock                                24,027

Boots 69msec faster than before or about 4 times faster.

Change-Id: Ia8baef28fd736ef6bb02d8a100d752ac0392e1cf
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88792
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2025-09-04 17:13:12 +00:00
..
car cpu/intel/car/non-evict: Improve CAR setup 2025-09-04 17:13:12 +00:00
common arch/x86: Fix typo for macro CPUID_FEATURE_HTT 2024-03-21 20:37:51 +00:00
fit util/cbfstool: Add Intel platform boot policy support 2024-10-23 10:29:59 +00:00
haswell cpu/intel: Use mtrr_use_temp_range() 2025-08-19 20:56:12 +00:00
microcode cpu/intel/microcode: Add error handling if microcode directory is empty 2025-05-18 18:42:22 +00:00
model_6bx arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_6ex arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_6fx payloads/edk2: Add Kconfig to use LAPIC timer 2024-04-20 18:38:55 +00:00
model_6xx arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_65x arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_67x arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_68x cpu: Rename Makefiles from .inc to .mk 2024-01-24 08:35:01 +00:00
model_106cx arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_206ax cpu/intel: Use mtrr_use_temp_range() 2025-08-19 20:56:12 +00:00
model_1067x payloads/edk2: Add Kconfig to use LAPIC timer 2024-04-20 18:38:55 +00:00
model_2065x cpu/intel: Use mtrr_use_temp_range() 2025-08-19 20:56:12 +00:00
model_f2x arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_f3x arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
model_f4x arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
slot_1 treewide: Remove unused CHIPs 2024-02-20 11:01:36 +00:00
smm cpu: Rename Makefiles from .inc to .mk 2024-01-24 08:35:01 +00:00
socket_441 arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
socket_BGA956 arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
socket_FCBGA559 arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
socket_LGA775 arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
socket_LGA1700 cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00
socket_LGA3647_1 cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00
socket_LGA4189 cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00
socket_LGA4677 cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00
socket_m arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
socket_mPGA604 arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
socket_OTHER cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00
socket_p arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
speedstep cpu: Rename Makefiles from .inc to .mk 2024-01-24 08:35:01 +00:00
turbo arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
Kconfig cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00
Makefile.mk cpu/intel: Add socket types 2024-07-19 12:35:09 +00:00