tell people that the segment descriptors are different for ROMCC and
[coreboot.git] / src / cpu / x86 / 32bit / entry32.inc
1 /* For starting linuxBIOS in protected mode */
2
3 #include <arch/rom_segs.h>
4
5 /*      .section ".rom.text" */
6         .code32
7
8         .align  4
9 .globl gdtptr
10
11         /* This is the gdt for ROMCC/ASM part of LinuxBIOS.
12          * It is different from the gdt in GCC part of LinuxBIOS
13          * which is defined in c_start.S */
14 gdt:
15 gdtptr:
16         .word   gdt_end - gdt -1 /* compute the table limit */
17         .long   gdt              /* we know the offset */
18         .word   0
19
20         /* selgdt 0x08, flat code segment */
21         .word   0xffff, 0x0000          
22         .byte   0x00, 0x9b, 0xcf, 0x00  
23
24         /* selgdt 0x10,flat data segment */
25         .word   0xffff, 0x0000          
26         .byte   0x00, 0x93, 0xcf, 0x00  
27
28 gdt_end:
29         
30
31 /*
32  *      When we come here we are in protected mode. We expand 
33  *      the stack and copies the data segment from ROM to the
34  *      memory.
35  *
36  *      After that, we call the chipset bootstrap routine that
37  *      does what is left of the chipset initialization. 
38  *
39  *      NOTE aligned to 4 so that we are sure that the prefetch
40  *      cache will be reloaded.
41  */
42         .align  4
43 .globl protected_start
44 protected_start:
45
46         lgdt    %cs:gdtptr
47         ljmp    $ROM_CODE_SEG, $__protected_start
48         
49 __protected_start:
50         /* Save the BIST value */
51         movl    %eax, %ebp
52
53         intel_chip_post_macro(0x10)     /* post 10 */
54
55         movw    $ROM_DATA_SEG, %ax
56         movw    %ax, %ds
57         movw    %ax, %es
58         movw    %ax, %ss
59         movw    %ax, %fs
60         movw    %ax, %gs
61
62         /* Restore the BIST value to %eax */
63         movl    %ebp, %eax
64