blob: db1345ac4271bc2b5fa6e44112fd92228358ccd5 [file] [log] [blame]
Angel Pons0612b272020-04-05 15:46:56 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Subrata Banik03e971c2017-03-07 14:02:23 +05302
3#include <commonlib/helpers.h>
4#include <cpu/x86/cache.h>
5#include <cpu/x86/cr.h>
Elyes HAOUAS419bfbc2018-10-01 08:47:51 +02006#include <cpu/x86/msr.h>
Subrata Banik03e971c2017-03-07 14:02:23 +05307#include <cpu/x86/mtrr.h>
8#include <cpu/x86/post_code.h>
9#include <rules.h>
10#include <intelblocks/msr.h>
11
Kyösti Mälkki7522a8f2020-11-20 16:47:38 +020012.section .init, "ax", @progbits
13
Patrick Rudolph2b771122020-11-30 13:52:42 +010014.code32
Arthur Heymans64c9c6d2019-11-25 09:45:40 +010015
16/*
17 * macro: find_free_mtrr
18 * Clobbers: %eax, %ebx, %ecx, %edx.
19 * Returns:
20 * %ebx contains the number of freely available MTRR's.
21 * It should be checked against 0.
22 * %ecx holds the MTRR_BASE of the free MTRR.
23 */
24.macro find_free_mtrr
25 /* Figure out how many MTRRs we have */
26 mov $MTRR_CAP_MSR, %ecx
27 rdmsr
28 movzb %al, %ebx /* Number of variable MTRRs */
29
30 /* Find a free variable MTRR */
31 movl $MTRR_PHYS_MASK(0), %ecx
321:
33 rdmsr
34 test $MTRR_PHYS_MASK_VALID, %eax
35 jz 2f
36 addl $2, %ecx
37 dec %ebx
38 jnz 1b
392:
40 /* %ecx needs to hold the MTRR_BASE */
41 decl %ecx
42.endm
43
Subrata Banik03e971c2017-03-07 14:02:23 +053044.global bootblock_pre_c_entry
45bootblock_pre_c_entry:
46
47 post_code(0x20)
48
Arthur Heymansc4772b92019-04-14 18:38:35 +020049 movl $no_reset, %esp /* return address */
50 jmp check_mtrr /* Check if CPU properly reset */
Subrata Banik03e971c2017-03-07 14:02:23 +053051
52no_reset:
53 post_code(0x21)
54
55 /* Clear/disable fixed MTRRs */
56 mov $fixed_mtrr_list_size, %ebx
57 xor %eax, %eax
58 xor %edx, %edx
59
60clear_fixed_mtrr:
61 add $-2, %ebx
62 movzwl fixed_mtrr_list(%ebx), %ecx
63 wrmsr
64 jnz clear_fixed_mtrr
65
66 post_code(0x22)
67
Arthur Heymansc57d3032021-06-16 09:56:26 +020068 /* Figure out how many MTRRs we have, and clear them out */
Subrata Banik03e971c2017-03-07 14:02:23 +053069 mov $MTRR_CAP_MSR, %ecx
70 rdmsr
71 movzb %al, %ebx /* Number of variable MTRRs */
72 mov $MTRR_PHYS_BASE(0), %ecx
73 xor %eax, %eax
74 xor %edx, %edx
75
76clear_var_mtrr:
77 wrmsr
78 inc %ecx
79 wrmsr
80 inc %ecx
81 dec %ebx
82 jnz clear_var_mtrr
83
84 post_code(0x23)
85
86 /* Configure default memory type to uncacheable (UC) */
87 mov $MTRR_DEF_TYPE_MSR, %ecx
88 rdmsr
89 /* Clear enable bits and set default type to UC. */
90 and $~(MTRR_DEF_TYPE_MASK | MTRR_DEF_TYPE_EN | \
91 MTRR_DEF_TYPE_FIX_EN), %eax
92 wrmsr
93
94 /* Configure MTRR_PHYS_MASK_HIGH for proper addressing above 4GB
95 * based on the physical address size supported for this processor
96 * This is based on read from CPUID EAX = 080000008h, EAX bits [7:0]
97 *
98 * Examples:
99 * MTRR_PHYS_MASK_HIGH = 00000000Fh For 36 bit addressing
100 * MTRR_PHYS_MASK_HIGH = 0000000FFh For 40 bit addressing
101 */
102
Elyes HAOUAS05498a22018-05-28 16:26:43 +0200103 movl $0x80000008, %eax /* Address sizes leaf */
Subrata Banik03e971c2017-03-07 14:02:23 +0530104 cpuid
105 sub $32, %al
106 movzx %al, %eax
107 xorl %esi, %esi
108 bts %eax, %esi
109 dec %esi /* esi <- MTRR_PHYS_MASK_HIGH */
110
111 post_code(0x24)
112
113#if ((CONFIG_DCACHE_RAM_SIZE & (CONFIG_DCACHE_RAM_SIZE - 1)) == 0)
Arthur Heymans64c9c6d2019-11-25 09:45:40 +0100114 find_free_mtrr
115 test %ebx, %ebx
116 jz .halt_forever
117
Subrata Banik03e971c2017-03-07 14:02:23 +0530118 /* Configure CAR region as write-back (WB) */
Subrata Banik03e971c2017-03-07 14:02:23 +0530119 mov $CONFIG_DCACHE_RAM_BASE, %eax
120 or $MTRR_TYPE_WRBACK, %eax
121 xor %edx,%edx
122 wrmsr
123
124 /* Configure the MTRR mask for the size region */
Arthur Heymans64c9c6d2019-11-25 09:45:40 +0100125 inc %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530126 mov $CONFIG_DCACHE_RAM_SIZE, %eax /* size mask */
127 dec %eax
128 not %eax
129 or $MTRR_PHYS_MASK_VALID, %eax
130 movl %esi, %edx /* edx <- MTRR_PHYS_MASK_HIGH */
131 wrmsr
132#elif (CONFIG_DCACHE_RAM_SIZE == 768 * KiB) /* 768 KiB */
Arthur Heymans64c9c6d2019-11-25 09:45:40 +0100133 find_free_mtrr
134 test %ebx, %ebx
135 jz .halt_forever
136
Subrata Banik03e971c2017-03-07 14:02:23 +0530137 /* Configure CAR region as write-back (WB) */
Subrata Banik03e971c2017-03-07 14:02:23 +0530138 mov $CONFIG_DCACHE_RAM_BASE, %eax
139 or $MTRR_TYPE_WRBACK, %eax
140 xor %edx,%edx
141 wrmsr
142
Arthur Heymans64c9c6d2019-11-25 09:45:40 +0100143 incl %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530144 mov $(512 * KiB), %eax /* size mask */
145 dec %eax
146 not %eax
147 or $MTRR_PHYS_MASK_VALID, %eax
148 movl %esi, %edx /* edx <- MTRR_PHYS_MASK_HIGH */
149 wrmsr
150
Arthur Heymans64c9c6d2019-11-25 09:45:40 +0100151 find_free_mtrr
152 test %ebx, %ebx
153 jz .halt_forever
1541:
Subrata Banik03e971c2017-03-07 14:02:23 +0530155 mov $(CONFIG_DCACHE_RAM_BASE + 512 * KiB), %eax
156 or $MTRR_TYPE_WRBACK, %eax
157 xor %edx,%edx
158 wrmsr
159
Arthur Heymans64c9c6d2019-11-25 09:45:40 +0100160 incl %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530161 mov $(256 * KiB), %eax /* size mask */
162 dec %eax
163 not %eax
164 or $MTRR_PHYS_MASK_VALID, %eax
165 movl %esi, %edx /* edx <- MTRR_PHYS_MASK_HIGH */
166 wrmsr
167#else
168#error "DCACHE_RAM_SIZE is not a power of 2 and setup code is missing"
169#endif
170 post_code(0x25)
171
172 /* Enable variable MTRRs */
173 mov $MTRR_DEF_TYPE_MSR, %ecx
174 rdmsr
175 or $MTRR_DEF_TYPE_EN, %eax
176 wrmsr
177
178 /* Enable caching */
179 mov %cr0, %eax
180 and $~(CR0_CD | CR0_NW), %eax
181 invd
182 mov %eax, %cr0
183
Julius Wernercd49cce2019-03-05 16:53:33 -0800184#if CONFIG(INTEL_CAR_NEM)
Subrata Banik03e971c2017-03-07 14:02:23 +0530185 jmp car_nem
Julius Wernercd49cce2019-03-05 16:53:33 -0800186#elif CONFIG(INTEL_CAR_CQOS)
Subrata Banik03e971c2017-03-07 14:02:23 +0530187 jmp car_cqos
Julius Wernercd49cce2019-03-05 16:53:33 -0800188#elif CONFIG(INTEL_CAR_NEM_ENHANCED)
Subrata Banik03e971c2017-03-07 14:02:23 +0530189 jmp car_nem_enhanced
190#else
191 jmp .halt_forever /* In case nothing has selected */
192#endif
193
194.global car_init_done
195car_init_done:
196
197 post_code(0x29)
198
199 /* Setup bootblock stack */
Arthur Heymansdf9cdcf2019-11-09 06:50:20 +0100200 mov $_ecar_stack, %esp
Subrata Banik03e971c2017-03-07 14:02:23 +0530201
Aaron Durbin028e18f2017-06-23 11:14:58 -0500202 /* Need to align stack to 16 bytes at call instruction. Account for
203 the two pushes below. */
204 andl $0xfffffff0, %esp
Patrick Rudolph2b771122020-11-30 13:52:42 +0100205
206#if ENV_X86_64
207 #include <cpu/x86/64bit/entry64.inc>
208 movd %mm2, %rdi
209 shlq $32, %rdi
210 movd %mm1, %rsi
211 or %rsi, %rdi
212 movd %mm0, %rsi
213#else
Aaron Durbin028e18f2017-06-23 11:14:58 -0500214 sub $8, %esp
215
Subrata Banik5885ffe2019-11-14 11:08:51 +0530216 /* push TSC value to stack */
Subrata Banik03e971c2017-03-07 14:02:23 +0530217 movd %mm2, %eax
218 pushl %eax /* tsc[63:32] */
219 movd %mm1, %eax
Elyes HAOUAS05498a22018-05-28 16:26:43 +0200220 pushl %eax /* tsc[31:0] */
Patrick Rudolph2b771122020-11-30 13:52:42 +0100221#endif
Subrata Banik03e971c2017-03-07 14:02:23 +0530222
223before_carstage:
224 post_code(0x2A)
225
226 call bootblock_c_entry
227 /* Never reached */
228
229.halt_forever:
230 post_code(POST_DEAD_CODE)
231 hlt
232 jmp .halt_forever
233
234fixed_mtrr_list:
235 .word MTRR_FIX_64K_00000
236 .word MTRR_FIX_16K_80000
237 .word MTRR_FIX_16K_A0000
238 .word MTRR_FIX_4K_C0000
239 .word MTRR_FIX_4K_C8000
240 .word MTRR_FIX_4K_D0000
241 .word MTRR_FIX_4K_D8000
242 .word MTRR_FIX_4K_E0000
243 .word MTRR_FIX_4K_E8000
244 .word MTRR_FIX_4K_F0000
245 .word MTRR_FIX_4K_F8000
246fixed_mtrr_list_size = . - fixed_mtrr_list
247
Julius Wernercd49cce2019-03-05 16:53:33 -0800248#if CONFIG(INTEL_CAR_NEM)
Subrata Banik03e971c2017-03-07 14:02:23 +0530249.global car_nem
250car_nem:
251 /* Disable cache eviction (setup stage) */
252 mov $MSR_EVICT_CTL, %ecx
253 rdmsr
254 or $0x1, %eax
255 wrmsr
256
257 post_code(0x26)
258
259 /* Clear the cache memory region. This will also fill up the cache */
260 movl $CONFIG_DCACHE_RAM_BASE, %edi
261 movl $CONFIG_DCACHE_RAM_SIZE, %ecx
262 shr $0x02, %ecx
263 xor %eax, %eax
264 cld
265 rep stosl
266
267 post_code(0x27)
268
269 /* Disable cache eviction (run stage) */
270 mov $MSR_EVICT_CTL, %ecx
271 rdmsr
272 or $0x2, %eax
273 wrmsr
274
275 post_code(0x28)
276
277 jmp car_init_done
278
Julius Wernercd49cce2019-03-05 16:53:33 -0800279#elif CONFIG(INTEL_CAR_CQOS)
Subrata Banik03e971c2017-03-07 14:02:23 +0530280.global car_cqos
281car_cqos:
282 /*
Naresh G Solankif329f0c2017-09-27 14:21:18 +0530283 * Create CBM_LEN_MASK based on CBM_LEN
284 * Get CPUID.(EAX=10H, ECX=2H):EAX.CBM_LEN[bits 4:0]
285 */
286 mov $0x10, %eax
287 mov $0x2, %ecx
288 cpuid
289 and $0x1F, %eax
290 add $1, %al
291
292 mov $1, %ebx
293 mov %al, %cl
294 shl %cl, %ebx
295 sub $1, %ebx
296
297 /* Store the CBM_LEN_MASK in mm3 for later use. */
298 movd %ebx, %mm3
299
300 /*
Subrata Banik03e971c2017-03-07 14:02:23 +0530301 * Disable both L1 and L2 prefetcher. For yet-to-understood reason,
302 * prefetchers slow down filling cache with rep stos in CQOS mode.
303 */
304 mov $MSR_PREFETCH_CTL, %ecx
305 rdmsr
306 or $(PREFETCH_L1_DISABLE | PREFETCH_L2_DISABLE), %eax
307 wrmsr
308
309#if (CONFIG_DCACHE_RAM_SIZE == CONFIG_L2_CACHE_SIZE)
310/*
311 * If CAR size is set to full L2 size, mask is calculated as all-zeros.
312 * This is not supported by the CPU/uCode.
313 */
314#error "CQOS CAR may not use whole L2 cache area"
315#endif
316
317 /* Calculate how many bits to be used for CAR */
318 xor %edx, %edx
319 mov $CONFIG_DCACHE_RAM_SIZE, %eax /* dividend */
320 mov $CONFIG_CACHE_QOS_SIZE_PER_BIT, %ecx /* divisor */
321 div %ecx /* result is in eax */
322 mov %eax, %ecx /* save to ecx */
323 mov $1, %ebx
324 shl %cl, %ebx
325 sub $1, %ebx /* resulting mask is is in ebx */
326
327 /* Set this mask for initial cache fill */
328 mov $MSR_L2_QOS_MASK(0), %ecx
329 rdmsr
Naresh G Solankif329f0c2017-09-27 14:21:18 +0530330 mov %ebx, %eax
Subrata Banik03e971c2017-03-07 14:02:23 +0530331 wrmsr
332
333 /* Set CLOS selector to 0 */
Elyes HAOUAS419bfbc2018-10-01 08:47:51 +0200334 mov $IA32_PQR_ASSOC, %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530335 rdmsr
336 and $~IA32_PQR_ASSOC_MASK, %edx /* select mask 0 */
337 wrmsr
338
339 /* We will need to block CAR region from evicts */
340 mov $MSR_L2_QOS_MASK(1), %ecx
341 rdmsr
342 /* Invert bits that are to be used for cache */
Naresh G Solankif329f0c2017-09-27 14:21:18 +0530343 mov %ebx, %eax
344 xor $~0, %eax /* invert 32 bits */
345
346 /*
347 * Use CBM_LEN_MASK stored in mm3 to set bits based on Capacity Bit
348 * Mask Length.
349 */
350 movd %mm3, %ebx
351 and %ebx, %eax
Subrata Banik03e971c2017-03-07 14:02:23 +0530352 wrmsr
353
354 post_code(0x26)
355
356 /* Clear the cache memory region. This will also fill up the cache */
357 movl $CONFIG_DCACHE_RAM_BASE, %edi
358 movl $CONFIG_DCACHE_RAM_SIZE, %ecx
359 shr $0x02, %ecx
360 xor %eax, %eax
361 cld
362 rep stosl
363
364 post_code(0x27)
365
366 /* Cache is populated. Use mask 1 that will block evicts */
Elyes HAOUAS419bfbc2018-10-01 08:47:51 +0200367 mov $IA32_PQR_ASSOC, %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530368 rdmsr
369 and $~IA32_PQR_ASSOC_MASK, %edx /* clear index bits first */
370 or $1, %edx /* select mask 1 */
371 wrmsr
372
373 /* Enable prefetchers */
374 mov $MSR_PREFETCH_CTL, %ecx
375 rdmsr
376 and $~(PREFETCH_L1_DISABLE | PREFETCH_L2_DISABLE), %eax
377 wrmsr
378
379 post_code(0x28)
380
381 jmp car_init_done
382
Julius Wernercd49cce2019-03-05 16:53:33 -0800383#elif CONFIG(INTEL_CAR_NEM_ENHANCED)
Subrata Banik03e971c2017-03-07 14:02:23 +0530384.global car_nem_enhanced
385car_nem_enhanced:
386 /* Disable cache eviction (setup stage) */
387 mov $MSR_EVICT_CTL, %ecx
388 rdmsr
389 or $0x1, %eax
390 wrmsr
391 post_code(0x26)
392
393 /* Create n-way set associativity of cache */
394 xorl %edi, %edi
395find_llc_subleaf:
396 movl %edi, %ecx
397 movl $0x04, %eax
398 cpuid
399 inc %edi
400 and $0xe0, %al /* EAX[7:5] = Cache Level */
401 cmp $0x60, %al /* Check to see if it is LLC */
402 jnz find_llc_subleaf
403
404 /*
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530405 * Calculate the total LLC size
406 * (Line_Size + 1) * (Sets + 1) * (Partitions + 1) * (Ways + 1)
407 * (EBX[11:0] + 1) * (ECX + 1) * (EBX[21:12] + 1) * EBX[31:22] + 1)
408 */
409
410 mov %ebx, %eax
411 and $0xFFF, %eax
412 inc %eax
413 inc %ecx
414 mul %ecx
415 mov %eax, %ecx
416 mov %ebx, %eax
417 shr $12, %eax
418 and $0x3FF, %eax
419 inc %eax
420 mul %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530421 shr $22, %ebx
422 inc %ebx
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530423 mov %ebx, %edx
424 mul %ebx /* eax now holds total LLC size */
Subrata Banik03e971c2017-03-07 14:02:23 +0530425
426 /*
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530427 * The number of the ways that we want to protect from eviction
428 * can be calculated as RW data stack size / way size where way
429 * size is Total LLC size / Total number of LLC ways.
Subrata Banik03e971c2017-03-07 14:02:23 +0530430 */
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530431 div %ebx /* way size */
432 mov %eax, %ecx
433
Subrata Banik03e971c2017-03-07 14:02:23 +0530434 /*
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530435 * Check if way size if bigger than the cache ram size.
436 * Then we need to allocate just one way for non-eviction
437 * of RW data.
438 */
Subrata Banik06039022021-03-09 14:40:39 +0530439 movl $0x01, %eax
440 cmp $CONFIG_DCACHE_RAM_SIZE, %ecx
441 jnc set_eviction_mask
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530442
443 /*
444 * RW data size / way size is equal to number of
445 * ways to be configured for non-eviction
446 */
Subrata Banik06039022021-03-09 14:40:39 +0530447 mov $CONFIG_DCACHE_RAM_SIZE, %eax
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530448 div %ecx
449 mov %eax, %ecx
450 movl $0x01, %eax
451 shl %cl, %eax
452 subl $0x01, %eax
453
454set_eviction_mask:
Shreesh Chhabbi860c6842020-12-03 15:06:20 -0800455 mov %ebx, %ecx /* back up number of ways */
456 mov %eax, %ebx /* back up the non-eviction mask*/
457#if CONFIG(CAR_HAS_SF_MASKS)
458 mov %ecx, %edi /* use number of ways to prepare SF mask */
459 /*
460 * SF mask is programmed with the double number of bits than
461 * the number of ways
462 */
463 mov $0x01, %eax
464 shl %cl, %eax
465 shl %cl, %eax
466 subl $0x01, %eax /* contains SF mask */
467 /*
468 * Program MSR 0x1891 IA32_CR_SF_QOS_MASK_1 with
469 * total number of LLC ways
470 */
471 movl $IA32_CR_SF_QOS_MASK_1, %ecx
472 xorl %edx, %edx
473 wrmsr
474 mov %edi, %ecx /* restore number of ways */
475#endif
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530476 /*
Shreesh Chhabbi87c7ec72020-12-03 14:07:15 -0800477 * Program MSR 0xC91 IA32_L3_MASK_1
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530478 * This MSR contain one bit per each way of LLC
Subrata Banik03e971c2017-03-07 14:02:23 +0530479 * - If this bit is '0' - the way is protected from eviction
480 * - If this bit is '1' - the way is not protected from eviction
481 */
Subrata Banik06039022021-03-09 14:40:39 +0530482 mov $0x1, %eax
483 shl %cl, %eax
484 subl $0x01, %eax
485 mov %eax, %ecx
486 mov %ebx, %eax
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530487
488 xor $~0, %eax /* invert 32 bits */
489 and %ecx, %eax
Elyes HAOUAS419bfbc2018-10-01 08:47:51 +0200490 movl $IA32_L3_MASK_1, %ecx
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530491 xorl %edx, %edx
492 wrmsr
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530493 /*
Shreesh Chhabbi87c7ec72020-12-03 14:07:15 -0800494 * Program MSR 0xC92 IA32_L3_MASK_2
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530495 * This MSR contain one bit per each way of LLC
496 * - If this bit is '0' - the way is protected from eviction
497 * - If this bit is '1' - the way is not protected from eviction
498 */
499 mov %ebx, %eax
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530500 movl $IA32_L3_MASK_2, %ecx
Subrata Banik03e971c2017-03-07 14:02:23 +0530501 xorl %edx, %edx
502 wrmsr
503 /*
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530504 * Set IA32_PQR_ASSOC
Subrata Banik03e971c2017-03-07 14:02:23 +0530505 *
506 * Possible values:
507 * 0: Default value, no way mask should be applied
508 * 1: Apply way mask 1 to LLC
509 * 2: Apply way mask 2 to LLC
510 * 3: Shouldn't be use in NEM Mode
511 */
Elyes HAOUAS419bfbc2018-10-01 08:47:51 +0200512 movl $IA32_PQR_ASSOC, %ecx
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530513 xorl %eax, %eax
Subrata Banik03e971c2017-03-07 14:02:23 +0530514 xorl %edx, %edx
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530515#if CONFIG(COS_MAPPED_TO_MSB)
516 movl $0x02, %edx
517#else
518 movl $0x02, %eax
519#endif
Subrata Banik03e971c2017-03-07 14:02:23 +0530520 wrmsr
Subrata Banik03e971c2017-03-07 14:02:23 +0530521 movl $CONFIG_DCACHE_RAM_BASE, %edi
522 movl $CONFIG_DCACHE_RAM_SIZE, %ecx
523 shr $0x02, %ecx
524 xor %eax, %eax
525 cld
526 rep stosl
527 /*
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530528 * Set IA32_PQR_ASSOC
Subrata Banik03e971c2017-03-07 14:02:23 +0530529 * At this stage we apply LLC_WAY_MASK_1 to the cache.
Subrata Banik03e971c2017-03-07 14:02:23 +0530530 */
Elyes HAOUAS419bfbc2018-10-01 08:47:51 +0200531 movl $IA32_PQR_ASSOC, %ecx
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530532 xorl %eax, %eax
Subrata Banik03e971c2017-03-07 14:02:23 +0530533 xorl %edx, %edx
Aamir Bohrac1d227d2020-07-16 09:03:06 +0530534#if CONFIG(COS_MAPPED_TO_MSB)
535 movl $0x01, %edx
536#else
537 movl $0x01, %eax
538#endif
Subrata Banik03e971c2017-03-07 14:02:23 +0530539 wrmsr
540
541 post_code(0x27)
542 /*
543 * Enable No-Eviction Mode Run State by setting
544 * NO_EVICT_MODE MSR 2E0h bit [1] = '1'.
545 */
546
547 movl $MSR_EVICT_CTL, %ecx
548 rdmsr
549 orl $0x02, %eax
550 wrmsr
551
552 post_code(0x28)
553
554 jmp car_init_done
555#endif