Aamir Bohra has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47788 )
Change subject: soc/intel/jasperlake: [TEST-ONLY] SPI read CAR test ......................................................................
soc/intel/jasperlake: [TEST-ONLY] SPI read CAR test
Change-Id: I4813572a31240b2796cacfa97044f9ed091ec108 Signed-off-by: Aamir Bohra aamir.bohra@intel.com --- M src/soc/intel/jasperlake/bootblock/bootblock.c 1 file changed, 29 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/47788/1
diff --git a/src/soc/intel/jasperlake/bootblock/bootblock.c b/src/soc/intel/jasperlake/bootblock/bootblock.c index 96e6268..a1254cf 100644 --- a/src/soc/intel/jasperlake/bootblock/bootblock.c +++ b/src/soc/intel/jasperlake/bootblock/bootblock.c @@ -1,10 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <bootblock_common.h> +#include <console/console.h> #include <intelblocks/systemagent.h> #include <intelblocks/tco.h> #include <intelblocks/uart.h> #include <soc/bootblock.h> +#include <string.h> +
asmlinkage void bootblock_c_entry(uint64_t base_timestamp) { @@ -22,6 +25,31 @@ uart_bootblock_init(); }
+static void report_cache_info(void) +{ + struct cpuid_result res; + uintptr_t addr = 0xFF000000; + char buf[1024]; + uint32_t kbcount=0; + res = cpuid_ext(0x04, 0x03); + const size_t assoc = CPUID_CACHE_WAYS_OF_ASSOC(res) + 1; + const size_t partitions = CPUID_CACHE_PHYS_LINE(res) + 1; + const size_t cache_line_size = CPUID_CACHE_COHER_LINE(res) + 1; + const size_t number_of_sets = CPUID_CACHE_NO_OF_SETS(res) + 1; + const size_t cache_size = assoc * partitions * cache_line_size * number_of_sets; + printk(BIOS_INFO, "assoc=%zd par=%zd line_size=%zd sets=%zd\n", + assoc, partitions, cache_line_size, number_of_sets); + printk(BIOS_INFO, "@@ dedede cache_size 0x%lx bytes\n", cache_size); + + while (addr < 0xFFFF0000) { + memcpy(buf, (void *)addr, 1024); + printk(BIOS_ERR, "TEST : %lx %x KBcount : %d \n", addr, buf[0], kbcount); + addr += 1024; + ++kbcount; + } + +} + void bootblock_soc_init(void) { report_platform_info(); @@ -29,4 +57,5 @@
/* Programming TCO_BASE_ADDRESS and TCO Timer Halt */ tco_configure(); + report_cache_info(); }
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47788 )
Change subject: soc/intel/jasperlake: [TEST-ONLY] SPI read CAR test ......................................................................
Patch Set 1:
(27 comments)
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... File src/soc/intel/jasperlake/bootblock/bootblock.c:
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 30: struct cpuid_result res; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 31: uintptr_t addr = 0xFF000000; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 32: char buf[1024]; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 33: uint32_t kbcount=0; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 33: uint32_t kbcount=0; spaces required around that '=' (ctx:VxV)
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 34: res = cpuid_ext(0x04, 0x03); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 35: const size_t assoc = CPUID_CACHE_WAYS_OF_ASSOC(res) + 1; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 36: const size_t partitions = CPUID_CACHE_PHYS_LINE(res) + 1; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 37: const size_t cache_line_size = CPUID_CACHE_COHER_LINE(res) + 1; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 38: const size_t number_of_sets = CPUID_CACHE_NO_OF_SETS(res) + 1; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 39: const size_t cache_size = assoc * partitions * cache_line_size * number_of_sets; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 40: printk(BIOS_INFO, "assoc=%zd par=%zd line_size=%zd sets=%zd\n", please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 41: assoc, partitions, cache_line_size, number_of_sets); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 41: assoc, partitions, cache_line_size, number_of_sets); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 42: printk(BIOS_INFO, "@@ dedede cache_size 0x%lx bytes\n", cache_size); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 44: while (addr < 0xFFFF0000) { please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 44: while (addr < 0xFFFF0000) { suspect code indent for conditional statements (7, 15)
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 45: memcpy(buf, (void *)addr, 1024); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 45: memcpy(buf, (void *)addr, 1024); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 46: printk(BIOS_ERR, "TEST : %lx %x KBcount : %d \n", addr, buf[0], kbcount); code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 46: printk(BIOS_ERR, "TEST : %lx %x KBcount : %d \n", addr, buf[0], kbcount); please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 46: printk(BIOS_ERR, "TEST : %lx %x KBcount : %d \n", addr, buf[0], kbcount); unnecessary whitespace before a quoted newline
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 47: addr += 1024; code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 47: addr += 1024; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 48: ++kbcount; code indent should use tabs where possible
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 48: ++kbcount; please, no spaces at the start of a line
https://review.coreboot.org/c/coreboot/+/47788/1/src/soc/intel/jasperlake/bo... PS1, Line 49: } please, no spaces at the start of a line
Stefan Reinauer has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/47788?usp=email )
Change subject: soc/intel/jasperlake: [TEST-ONLY] SPI read CAR test ......................................................................
Abandoned