intel/common: CAR setup CQOS
Enable CQOS on Geminilake. In Apololake, CBM_LEN is 0x7. Whereas the same in Geminilake is 0xF. Thus get CBM_LEN using cpuid instruction & generate CBM_LEN_MASK. Later use the CBM_LEN_MASK when writing to IA32_L2_MASK_* to set right bits. BUG=None TEST= Build for Geminilake platform i.e., glkrvp & check for successful CAR setup. Even verified the same on APL platform i.e., on Reef Change-Id: Ic736dba1a46629ff5bf3183082799c0c1468e6d9 Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com Reviewed-on: https://review.coreboot.org/21701 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
7151778847
commit
f329f0c3af
|
@ -254,6 +254,24 @@ car_nem:
|
||||||
#elif IS_ENABLED(CONFIG_INTEL_CAR_CQOS)
|
#elif IS_ENABLED(CONFIG_INTEL_CAR_CQOS)
|
||||||
.global car_cqos
|
.global car_cqos
|
||||||
car_cqos:
|
car_cqos:
|
||||||
|
/*
|
||||||
|
* Create CBM_LEN_MASK based on CBM_LEN
|
||||||
|
* Get CPUID.(EAX=10H, ECX=2H):EAX.CBM_LEN[bits 4:0]
|
||||||
|
*/
|
||||||
|
mov $0x10, %eax
|
||||||
|
mov $0x2, %ecx
|
||||||
|
cpuid
|
||||||
|
and $0x1F, %eax
|
||||||
|
add $1, %al
|
||||||
|
|
||||||
|
mov $1, %ebx
|
||||||
|
mov %al, %cl
|
||||||
|
shl %cl, %ebx
|
||||||
|
sub $1, %ebx
|
||||||
|
|
||||||
|
/* Store the CBM_LEN_MASK in mm3 for later use. */
|
||||||
|
movd %ebx, %mm3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable both L1 and L2 prefetcher. For yet-to-understood reason,
|
* Disable both L1 and L2 prefetcher. For yet-to-understood reason,
|
||||||
* prefetchers slow down filling cache with rep stos in CQOS mode.
|
* prefetchers slow down filling cache with rep stos in CQOS mode.
|
||||||
|
@ -284,7 +302,7 @@ car_cqos:
|
||||||
/* Set this mask for initial cache fill */
|
/* Set this mask for initial cache fill */
|
||||||
mov $MSR_L2_QOS_MASK(0), %ecx
|
mov $MSR_L2_QOS_MASK(0), %ecx
|
||||||
rdmsr
|
rdmsr
|
||||||
mov %bl, %al
|
mov %ebx, %eax
|
||||||
wrmsr
|
wrmsr
|
||||||
|
|
||||||
/* Set CLOS selector to 0 */
|
/* Set CLOS selector to 0 */
|
||||||
|
@ -297,8 +315,15 @@ car_cqos:
|
||||||
mov $MSR_L2_QOS_MASK(1), %ecx
|
mov $MSR_L2_QOS_MASK(1), %ecx
|
||||||
rdmsr
|
rdmsr
|
||||||
/* Invert bits that are to be used for cache */
|
/* Invert bits that are to be used for cache */
|
||||||
mov %bl, %al
|
mov %ebx, %eax
|
||||||
xor $~0, %al /* invert 8 bits */
|
xor $~0, %eax /* invert 32 bits */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use CBM_LEN_MASK stored in mm3 to set bits based on Capacity Bit
|
||||||
|
* Mask Length.
|
||||||
|
*/
|
||||||
|
movd %mm3, %ebx
|
||||||
|
and %ebx, %eax
|
||||||
wrmsr
|
wrmsr
|
||||||
|
|
||||||
post_code(0x26)
|
post_code(0x26)
|
||||||
|
|
Loading…
Reference in New Issue