Jérémy Compostella has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83982?usp=email )
Change subject: soc/intel/common/block/cpu: Fix number of way computation ......................................................................
soc/intel/common/block/cpu: Fix number of way computation
The way size is not necessarily a power of two. As a result, dividing `CONFIG_DCACHE_RAM_SIZE' by the way size can leave a remainder. That remainder should be taken into account to compute the number of way.
BUG=b:360332771 TEST=Verified on rex
Change-Id: I5cb66da0aa977eecb64a0021268a6827747c521e Signed-off-by: Jeremy Compostella jeremy.compostella@intel.com --- M src/soc/intel/common/block/cpu/car/cache_as_ram.S 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/83982/1
diff --git a/src/soc/intel/common/block/cpu/car/cache_as_ram.S b/src/soc/intel/common/block/cpu/car/cache_as_ram.S index f412cc5..109b3f6 100644 --- a/src/soc/intel/common/block/cpu/car/cache_as_ram.S +++ b/src/soc/intel/common/block/cpu/car/cache_as_ram.S @@ -512,6 +512,11 @@ mov $CONFIG_DCACHE_RAM_SIZE, %eax xor %edx, %edx div %ecx + /* Take the remainder into account */ + movl $0x01, %ecx + cmp $0x00, %edx + cmovne %ecx, %edx + add %edx, %eax mov %eax, %edx /* back up data_ways in edx */ mov %eax, %ecx movl $0x01, %eax