Hello Aaron Durbin, Subrata Banik, Balaji Manigandan, Aamir Bohra, Paul Menzel, build bot (Jenkins), Hannah Williams, Lijian Zhao, Furquan Shaikh,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/35924
to review the following change.
Change subject: Revert "soc/intel/cannonlake: Remove DMA support for PTT" ......................................................................
Revert "soc/intel/cannonlake: Remove DMA support for PTT"
This reverts commit d5018a8f78b9e1f0b7d3d1be298cba9716b10c6c.
Reason for revert: Breaks boot on Whiskey Lake-U System76 boards
Change-Id: Ib82f02c4a2b1cd2dbf95d4ca4a9edd314e78edd2 --- M src/soc/intel/cannonlake/include/soc/iomap.h M src/soc/intel/cannonlake/memmap.c 2 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/35924/1
diff --git a/src/soc/intel/cannonlake/include/soc/iomap.h b/src/soc/intel/cannonlake/include/soc/iomap.h index 75f11c0..2a3608c 100644 --- a/src/soc/intel/cannonlake/include/soc/iomap.h +++ b/src/soc/intel/cannonlake/include/soc/iomap.h @@ -65,6 +65,10 @@
#define HECI1_BASE_ADDRESS 0xfeda2000
+/* PTT registers */ +#define PTT_TXT_BASE_ADDRESS 0xfed30800 +#define PTT_PRESENT 0x00070000 + #define VTD_BASE_ADDRESS 0xFED90000 #define VTD_BASE_SIZE 0x00004000 /* diff --git a/src/soc/intel/cannonlake/memmap.c b/src/soc/intel/cannonlake/memmap.c index 64e07be..108a1b0 100644 --- a/src/soc/intel/cannonlake/memmap.c +++ b/src/soc/intel/cannonlake/memmap.c @@ -83,6 +83,22 @@ return 0; }
+static bool is_ptt_enable(void) +{ + if ((read32((void *)PTT_TXT_BASE_ADDRESS) & PTT_PRESENT) == + PTT_PRESENT) + return true; + + return false; +} + +/* Calculate PTT size */ +static size_t get_ptt_size(void) +{ + /* Allocate 4KB for PTT if enabled */ + return is_ptt_enable() ? 4*KiB : 0; +} + /* Calculate ME Stolen size */ static size_t get_imr_size(void) { @@ -176,6 +192,9 @@ /* Get Tracehub size */ reserve_mem_base -= get_imr_size();
+ /* Get PTT size */ + reserve_mem_base -= get_ptt_size(); + /* Traditional Area Size */ reserve_mem_size = dram_base - reserve_mem_base;