Eliminate SET_NB_CFG_54 option. There was no board that
[coreboot.git] / src / cpu / amd / model_gx1 / cpu_setup.inc
1 /*
2     freebios/src/northbridge/nsc/gx1/cpu_setup.inc
3
4     Copyright (c) 2002 Christer Weinigel <wingel@hack.org>
5
6     Initialize the GX1 CPU configuration registers
7 */
8
9 /* USES: esi, ecx, eax */
10
11 #include <cpu/amd/gx1def.h>
12
13         movl %eax, %ebp /* preserve bist */
14
15 cpu_setup_start:
16         leal    cpu_setup_table, %esi
17         movl    $cpu_setup_len, %ecx
18
19 cpu_setup_loop:
20         movw    (%esi), %ax
21         addl    $2, %esi
22         outb    %al, $0x22
23         movb    %ah, %al
24         outb    %al, $0x23
25         loop    cpu_setup_loop
26
27         movb    $0xff, %al              /* DIR1 -- Identification Register 1 */
28         outb    %al, $0x22
29         inb     $0x23, %al
30         cmpb    $0x63, %al              /* Revision for GXLV rev 3 */
31         jbe     cpu_no_ccr4
32
33         movb    $0xe8, %al              /* CCR4 */
34         outb    %al, $0x22
35         inb     $0x23, %al
36         orb     $0x20, %al              /* Enable FPU Fast Mode */
37         outb    %al, $0x23
38
39         movb    $0xf0, %al              /* PCR1 --- Performace Control  */
40         outb    %al, $0x22
41         inb     $0x23, %al
42         orb     $0x02, %al              /* Incrementor on, whatever that is */
43         outb    %al, $0x23
44
45         movb    $0x20, %al              /* PCR0 --- Performace Control  */
46         outb    %al, $0x22
47         inb     $0x23, %al
48         orb     $0x20, %al              /* Must be 1 according to data book */
49         orb     $0x04, %al              /* Incrementor Margin 10 */
50         outb    %al, $0x23
51 cpu_no_ccr4:
52
53         jmp     cpu_setup_end
54
55 cpu_setup_table:
56         .byte   0xc1, 0x00              /* NO SMIs */
57         .byte   0xc3, 0x14              /* Enable CPU config register */
58         .byte   0x20, 0x00
59         .byte   0xb8, GX_BASE>>30       /* Enable GXBASE address */
60         .byte   0xc2, 0x00
61         .byte   0xe8, 0x98
62         .byte   0xc3, 0xf8              /* Enable CPU config register */
63 cpu_setup_len = (.-cpu_setup_table)/2
64
65 cpu_setup_end:
66         nop
67
68         movl %ebp, %eax /* Restore bist */