[coreboot] [PATCH try 4] Reduce duplicate definition in CAR code.

Warren Turkal wt at penguintechs.org
Fri Oct 8 05:47:52 CEST 2010


Even with that, the CAR code for via currently has the following:
        /* Clear all MTRRs. */
        xorl    %edx, %edx
        movl    $fixed_mtrr_msr, %esi

clear_fixed_var_mtrr:
        lodsl   (%esi), %eax
        testl   %eax, %eax
        jz      clear_fixed_var_mtrr_out

        movl    %eax, %ecx
        xorl    %eax, %eax
        wrmsr

        jmp     clear_fixed_var_mtrr

fixed_mtrr_msr:
        .long   0x250, 0x258, 0x259
        .long   0x268, 0x269, 0x26A
        .long   0x26B, 0x26C, 0x26D
        .long   0x26E, 0x26F

var_mtrr_msr:
        .long   0x200, 0x201, 0x202, 0x203
        .long   0x204, 0x205, 0x206, 0x207
        .long   0x208, 0x209, 0x20A, 0x20B
        .long   0x20C, 0x20D, 0x20E, 0x20F
        .long   0x000 /* NULL, end of table */


That fixed_mtrr_msr list is identical to the intel fixed_mtrr_msr
list, so the registers are being cleared whether they need to be or
not.

Speaking of which, is the via bios writer's guide accessible by mere mortals?

wt

On Thu, Oct 7, 2010 at 5:13 PM, Kevin O'Connor <kevin at koconnor.net> wrote:
> On Thu, Oct 07, 2010 at 09:16:28AM -0700, Stefan Reinauer wrote:
>>  On 10/7/10 5:58 AM, Kevin O'Connor wrote:
>> > BTW, the list concept doesn't make much sense anyway - at least on
>> > Via, there is no need to clear the fixed mtrrs, and you don't need a
>> > list to clear the variable mtrrs (a simple iterator would suffice).
>> The list seemed more comprehensible than writing down linear code. It's
>> simple for the variable mtrrs, but the fixed ones are not linearly spread.
>>
>> Why do you assume it's not needed to clear the fixed MTRRs on VIA
>> systems? I don't think we should assume they didn't get set to "bad"
>> values by the OS running prior to a reset, for example.
>
> The via code runs with fixed mtrrs disabled in MTRRdefType_MSR.  (It
> writes 0x800 there instead of 0xc00.)  Because fixed MTRRs aren't
> enabled during CAR, they don't need to be cleared in the CAR setup
> phase.
>
> -Kevin
>
> --
> coreboot mailing list: coreboot at coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
>




More information about the coreboot mailing list