fixes for epia, attempts to fix arima
[coreboot.git] / src / mainboard / via / epia / Config.lb
1 uses HAVE_MP_TABLE
2 uses HAVE_PIRQ_TABLE
3 uses USE_FALLBACK_IMAGE
4 uses MAINBOARD
5 uses ARCH
6 uses FALLBACK_SIZE
7 uses ROM_SIZE
8 uses ROM_SECTION_SIZE
9 uses ROM_IMAGE_SIZE
10 uses ROM_SECTION_SIZE
11 uses ROM_SECTION_OFFSET
12 uses CONFIG_ROM_STREAM_START
13 uses PAYLOAD_SIZE
14 uses _ROMBASE
15 uses XIP_ROM_SIZE
16 uses XIP_ROM_BASE
17 uses HAVE_MP_TABLE
18
19 ## ROM_SIZE is the size of boot ROM that this board will use.
20 default ROM_SIZE  256*1024
21
22 ###
23 ### Build options
24 ###
25
26 ##
27 ## Build code for the fallback boot
28 ##
29 option HAVE_FALLBACK_BOOT=1
30
31 ##
32 ## no MP table
33 ##
34 option HAVE_MP_TABLE=0
35
36 ##
37 ## Build code to reset the motherboard from linuxBIOS
38 ##
39 option HAVE_HARD_RESET=1
40
41 ##
42 ## Build code to export a programmable irq routing table
43 ##
44 option HAVE_PIRQ_TABLE=1
45 option IRQ_SLOT_COUNT=5
46 object irq_tables.o
47
48 ##
49 ## Build code to export a CMOS option table
50 ##
51 option HAVE_OPTION_TABLE=1
52
53 ###
54 ### LinuxBIOS layout values
55 ###
56
57 ## ROM_IMAGE_SIZE is the amount of space to allow linuxBIOS to occupy.
58 option ROM_IMAGE_SIZE = 65536
59
60 ##
61 ## Use a small 8K stack
62 ##
63 option STACK_SIZE=0x2000
64
65 ##
66 ## Use a small 16K heap
67 ##
68 option HEAP_SIZE=0x4000
69
70 ##
71 ## Only use the option table in a normal image
72 ##
73 option USE_OPTION_TABLE = !USE_FALLBACK_IMAGE
74
75 ##
76 ## Compute the location and size of where this firmware image
77 ## (linuxBIOS plus bootloader) will live in the boot rom chip.
78 ##
79 if USE_FALLBACK_IMAGE
80         option ROM_SECTION_SIZE   = FALLBACK_SIZE
81         option ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
82 else
83         option ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
84         option ROM_SECTION_OFFSET = 0
85 end
86
87 ##
88 ## Compute the start location and size size of
89 ## The linuxBIOS bootloader.
90 ##
91 option PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
92 option CONFIG_ROM_STREAM_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
93 option CONFIG_ROM_STREAM     = 1
94
95 ##
96 ## Compute where this copy of linuxBIOS will start in the boot rom
97 ##
98 option _ROMBASE      = ( CONFIG_ROM_STREAM_START + PAYLOAD_SIZE )
99
100 ##
101 ## Compute a range of ROM that can cached to speed up linuxBIOS,
102 ## execution speed.
103 ##
104 ## XIP_ROM_SIZE must be a power of 2.
105 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
106 ##
107 option XIP_ROM_SIZE=65536
108 option XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
109
110 ##
111 ## Set all of the defaults for an x86 architecture
112 ##
113
114 arch i386 end
115
116 ##
117 ## Build the objects we have code for in this directory.
118 ##
119
120
121 driver mainboard.o
122 #object reset.o
123
124 ##
125 ## Romcc output
126 ##
127 makerule ./failover.E
128         depends "$(MAINBOARD)/failover.c" 
129         action "$(CPP) -I$(TOP)/src $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/failover.c > ./failover.E"
130 end
131
132 makerule ./failover.inc
133         depends "./failover.E ./romcc"
134         action "./romcc -O -mcpu=c3 -o failover.inc --label-prefix=failover ./failover.E"
135 end
136
137 makerule ./auto.E 
138         depends "$(MAINBOARD)/auto.c" 
139         action  "$(CPP) -I$(TOP)/src $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/auto.c > ./auto.E"
140 end
141 makerule ./auto.inc 
142         depends "./auto.E ./romcc"
143         action  "./romcc   -O -mcpu=c3 ./auto.E "
144 end
145
146 ##
147 ## Build our 16 bit and 32 bit linuxBIOS entry code
148 ##
149 mainboardinit cpu/i386/entry16.inc
150 mainboardinit cpu/i386/entry32.inc
151 ldscript /cpu/i386/entry16.lds
152 ldscript /cpu/i386/entry32.lds
153
154 ##
155 ## Build our reset vector (This is where linuxBIOS is entered)
156 ##
157 if USE_FALLBACK_IMAGE 
158         mainboardinit cpu/i386/reset16.inc 
159         ldscript /cpu/i386/reset16.lds 
160 else
161         mainboardinit cpu/i386/reset32.inc 
162         ldscript /cpu/i386/reset32.lds 
163 end
164
165 ### Should this be in the northbridge code?
166 mainboardinit arch/i386/lib/cpu_reset.inc
167
168 ##
169 ## Include an id string (For safe flashing)
170 ##
171 mainboardinit arch/i386/lib/id.inc
172 ldscript /arch/i386/lib/id.lds
173
174 ##
175 ## Setup our mtrrs
176 ##
177 # mainboardinit cpu/p6/earlymtrr.inc
178
179 ###
180 ### This is the early phase of linuxBIOS startup 
181 ### Things are delicate and we test to see if we should
182 ### failover to another image.
183 ###
184 if USE_FALLBACK_IMAGE
185         ldscript /arch/i386/lib/failover.lds 
186         mainboardinit ./failover.inc
187 end
188
189 ###
190 ### O.k. We aren't just an intermediary anymore!
191 ###
192
193 ##
194 ## Setup RAM
195 ##
196 mainboardinit ./auto.inc
197
198 ##
199 ## Include the secondary Configuration files 
200 ##
201 dir /pc80
202 config chip.h
203
204 northbridge via/vt8601 "vt8601"
205 #       pci 0:0.0
206 #       pci 0:1.0
207         southbridge via/vt8231 "vt8231"
208 #               pci 0:11.0
209 #               pci 0:11.1
210 #               pci 0:11.2
211 #               pci 0:11.3
212 #               pci 0:11.4
213 #               pci 0:11.5
214 #               pci 0:11.6
215 #               pci 0:12.0
216                 register "enable_usb" = "0"
217                 register "enable_native_ide" = "0"
218                 register "enable_com_ports" = "1"
219                 register "enable_keyboard" = "0"
220                 register "enable_nvram" = "1"
221         end
222 end
223
224 cpu p6 "cpu0"
225         
226 end
227
228 ##
229 ## Include the old serial code for those few places that still need it.
230 ##
231 mainboardinit pc80/serial.inc
232 mainboardinit arch/i386/lib/console.inc