CONFIG_LB_TOPK 8M above support
[coreboot.git] / src / config / linuxbios_ram.ld
1 /*
2  *      Memory map:
3  *
4  *      _RAMBASE                
5  *                              : data segment
6  *                              : bss segment
7  *                              : heap
8  *                              : stack
9  */
10 /*
11  * Bootstrap code for the STPC Consumer
12  * Copyright (c) 1999 by Net Insight AB. All Rights Reserved.
13  */
14
15 /*
16  *      Written by Johan Rydberg, based on work by Daniel Kahlin.
17  *      Rewritten by Eric Biederman
18  *  2005.12 yhlu add linuxbios_ram cross the vga font buffer handling
19  */
20 /*
21  *      We use ELF as output format. So that we can
22  *      debug the code in some form. 
23  */
24 INCLUDE ldoptions
25
26 ENTRY(_start)
27
28 SECTIONS
29 {
30         . = _RAMBASE;
31         /*
32          * First we place the code and read only data (typically const declared).
33          * This get placed in rom.
34          */
35         .text : {
36                 _text = .;
37                 *(.text);
38                 *(.text.*);
39                 . = ALIGN(16);
40                 _etext = .;
41         }
42         .rodata : {
43                 _rodata = .;
44                 . = ALIGN(4);
45                 console_drivers = .;
46                 *(.rodata.console_drivers)
47                 econsole_drivers = . ;
48                 . = ALIGN(4);
49                 pci_drivers = . ;
50                 *(.rodata.pci_driver)
51                 epci_drivers = . ;
52                 cpu_drivers = . ;
53                 *(.rodata.cpu_driver)
54                 ecpu_drivers = . ;
55                 *(.rodata)
56                 *(.rodata.*)
57                 /*
58                  * kevinh/Ispiri - Added an align, because the objcopy tool
59                  * incorrectly converts sections that are not long word aligned.
60                  * This breaksthe linuxbios.strip target.
61                  */
62                  . = ALIGN(4);
63
64                 _erodata = .;
65         }       
66         /*
67          * After the code we place initialized data (typically initialized
68          * global variables). This gets copied into ram by startup code.
69          * __data_start and __data_end shows where in ram this should be placed,
70          * whereas __data_loadstart and __data_loadend shows where in rom to
71          * copy from.
72          */
73         .data : {
74                 _data = .;
75                 *(.data)
76                 _edata = .;
77         }
78         /*
79          * bss does not contain data, it is just a space that should be zero
80          * initialized on startup. (typically uninitialized global variables)
81          * crt0.S fills between _bss and _ebss with zeroes.
82          */
83         _bss = .;
84         .bss . : {
85                 *(.bss)
86                 *(.sbss)
87                 *(COMMON)
88         }
89         _ebss = .;
90         _end = .;
91         . = ALIGN(STACK_SIZE);
92         _stack = .;
93         .stack . : {
94                 /* Reserve a stack for each possible cpu */
95                 /* the stack for ap will be put after pgtbl in 1M to CONFIG_LB_MEM_TOPK range when VGA and ROM_RUN and CONFIG_LB_MEM_TOPK>1024*/
96                 . = ((CONFIG_CONSOLE_VGA || CONFIG_PCI_ROM_RUN)&&(_RAMBASE<0x100000)&&(CONFIG_LB_MEM_TOPK>(0x100000>>10)) ) ? STACK_SIZE : (CONFIG_MAX_CPUS*STACK_SIZE);
97         }
98         _estack = .;
99         _heap = .;
100         .heap . : {
101                 /* Reserve 256K for the heap */
102                 . = HEAP_SIZE ;
103                 . = ALIGN(4);
104         }
105         _eheap = .;
106         /* The ram segment
107          * This is all address of the memory resident copy of linuxBIOS.
108          */
109         _ram_seg = _text; 
110         _eram_seg = _eheap;
111
112         _bogus = ASSERT( ((_eram_seg>>10)<CONFIG_LB_MEM_TOPK) , "please increase CONFIG_LB_MEM_TOPK");
113
114         _bogus = ASSERT( !((CONFIG_CONSOLE_VGA || CONFIG_PCI_ROM_RUN) && ((_ram_seg<0xa0000) && (_eram_seg>0xa0000))) , "please increase CONFIG_LB_MEM_TOPK and if still fail, try to set _RAMBASE more than 1M");
115
116         /DISCARD/ : {
117                 *(.comment)
118                 *(.note)
119                 *(.note.*)
120         }
121 }