coreboot-kgpe-d16/src/soc
Aaron Durbin 5c9df70031 soc/intel/apollolake: enable cache-as-ram paging for glk
Add support and enalbe cache-as-ram paging for glk to work around
a cache-as-ram corruption issue. glk executes verstage, romstage,
and FSP-M directly out of cache-as-ram (just like apl). However,
the front end on glk is very agressive about pulling cache lines
into L1I for potential execution. When the snoops hit in the L1D
and the cache lines are dirty the processor writes the line back.
However, there is no backing store for the dirty lines to go. As
such when the line is pulled back in the value is all 0xff's,
corrupting cache-as-ram.

To fix the issue one needs to enable paging with NX (no execute)
permissions which prevents the above actions from happening because
the TLB will indicate that shouldn't be fetched into the instruction
cache since data will be marked no execute.

The generated page tables are added to cbfs and only added to the
COREBOOT cbfs as they are only consumed in the early cache-as-ram
stages.

The page tables generated with:

$ go run util/x86/x86_page_tables.go \
  --iomap_file=src/soc/intel/apollolake/glk_page_map.txt \
  --metadata_base_address=0xfef00000 \
  --pdpt_output_c_file=src/soc/intel/apollolake/pdpt.c \
  --pt_output_c_file=src/soc/intel/apollolake/pt.c

Merged address space:
00000000d0000000 -- 00000000fef00000 UC NX : 375 big 256 small
00000000fef00000 -- 00000000fef20000 WB NX : 0 big 32 small
00000000fef20000 -- 00000000fefc0000 WB    : 0 big 160 small
00000000fefc0000 -- 00000000ff000000 WB NX : 0 big 64 small
00000000ff000000 -- 0000000100000000 WP    : 8 big 0 small

Total Pages of page tables: 5

Pages linked using base address of 0xfef00000.

BUG=b:72728953

Change-Id: Icde9cc0bf5079bb5821f4e59eb61e939c13d7062
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/25719
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
2018-04-27 18:48:10 +00:00
..
amd soc/amd/stoneyridge/include/soc/smi.h: Fix name collision 2018-04-27 09:24:37 +00:00
broadcom soc{broadcom,imgtec,mediatek,qualcomm}: stop using spi_xfer_two_vectors 2018-04-23 09:13:16 +00:00
dmp DMP Vortex86ex board & chip: Remove - using LATE_CBMEM_INIT 2018-01-15 23:23:17 +00:00
imgtec soc{broadcom,imgtec,mediatek,qualcomm}: stop using spi_xfer_two_vectors 2018-04-23 09:13:16 +00:00
intel soc/intel/apollolake: enable cache-as-ram paging for glk 2018-04-27 18:48:10 +00:00
lowrisc RISC-V boards: Stop using the config string 2017-11-07 12:31:00 +00:00
marvell src/soc: Fix various typos 2018-02-20 23:17:39 +00:00
mediatek soc{broadcom,imgtec,mediatek,qualcomm}: stop using spi_xfer_two_vectors 2018-04-23 09:13:16 +00:00
nvidia compiler.h: add __weak macro 2018-04-24 14:37:59 +00:00
qualcomm soc{broadcom,imgtec,mediatek,qualcomm}: stop using spi_xfer_two_vectors 2018-04-23 09:13:16 +00:00
rockchip spi: Add helper functions for bit-banging 2018-04-03 00:34:52 +00:00
samsung driver/uart: Introduce a way for mainboard to override the baudrate 2018-02-21 16:09:06 +00:00
sifive src/sifive: Add the SiFive Freedom Unleashed 540 SoC 2018-04-26 11:52:37 +00:00
ucb riscv: Remove config string support 2017-12-02 05:25:00 +00:00