blob: 504f12d270bc561490803097d21426c98cdb435c [file] [log] [blame]
arch import user (historical)ef03afa2005-07-06 17:15:30 +00001##
2## Compute the location and size of where this firmware image
3## (linuxBIOS plus bootloader) will live in the boot rom chip.
4##
5if USE_FALLBACK_IMAGE
6 default ROM_SECTION_SIZE = FALLBACK_SIZE
7 default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
8else
9 default ROM_SECTION_SIZE = ( ROM_SIZE - FALLBACK_SIZE )
10 default ROM_SECTION_OFFSET = 0
11end
12
13##
14## Compute the start location and size size of
15## The linuxBIOS bootloader.
16##
17default PAYLOAD_SIZE = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
18default CONFIG_ROM_STREAM_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
19default CONFIG_ROM_STREAM = 1
20
21##
22## Compute where this copy of linuxBIOS will start in the boot rom
23##
24default _ROMBASE = ( CONFIG_ROM_STREAM_START + PAYLOAD_SIZE )
25
26##
27## Compute a range of ROM that can cached to speed up linuxBIOS,
28## execution speed.
29##
30## XIP_ROM_SIZE must be a power of 2.
31## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
32##
33default XIP_ROM_SIZE=65536
34default XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
35
36arch i386 end
37
38
39##
40## Build the objects we have code for in this directory.
41##
42
43driver mainboard.o
44
45#dir /drivers/ati/ragexl
46
47if HAVE_MP_TABLE object mptable.o end
48if HAVE_PIRQ_TABLE object irq_tables.o end
49#object reset.o
arch import user (historical)6ca76362005-07-06 17:17:25 +000050
51if USE_DCACHE_RAM
52
53if CONFIG_USE_INIT
54
55makerule ./auto.o
56 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
57 action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o auto.o"
58end
59
60else
61
62makerule ./auto.inc
63 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
64 action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -S -o $@"
65 action "perl -e 's/.rodata/.rom.data/g' -pi $@"
66 action "perl -e 's/.text/.section .rom.text/g' -pi $@"
67end
68
69end
70else
71
arch import user (historical)ef03afa2005-07-06 17:15:30 +000072##
73## Romcc output
74##
75makerule ./failover.E
76 depends "$(MAINBOARD)/failover.c ./romcc"
77 action "./romcc -E -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/failover.c -o $@"
78end
79
80makerule ./failover.inc
81 depends "$(MAINBOARD)/failover.c ./romcc"
82 action "./romcc -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/failover.c -o $@"
83end
84
85makerule ./auto.E
86 depends "$(MAINBOARD)/auto.c option_table.h ./romcc"
87 action "./romcc -E -mcpu=k8 -O2 -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -o $@"
88end
89makerule ./auto.inc
90 depends "$(MAINBOARD)/auto.c option_table.h ./romcc"
91 action "./romcc -mcpu=k8 -O2 -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -o $@"
92end
93
arch import user (historical)6ca76362005-07-06 17:17:25 +000094
95end
96
arch import user (historical)ef03afa2005-07-06 17:15:30 +000097##
98## Build our 16 bit and 32 bit linuxBIOS entry code
99##
100mainboardinit cpu/x86/16bit/entry16.inc
101mainboardinit cpu/x86/32bit/entry32.inc
102ldscript /cpu/x86/16bit/entry16.lds
arch import user (historical)6ca76362005-07-06 17:17:25 +0000103
104if USE_DCACHE_RAM
105 if CONFIG_USE_INIT
106 ldscript /cpu/x86/32bit/entry32.lds
107 end
108
109 if CONFIG_USE_INIT
110 ldscript /cpu/amd/car/cache_as_ram.lds
111 end
112end
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000113
114##
115## Build our reset vector (This is where linuxBIOS is entered)
116##
117if USE_FALLBACK_IMAGE
118 mainboardinit cpu/x86/16bit/reset16.inc
119 ldscript /cpu/x86/16bit/reset16.lds
120else
121 mainboardinit cpu/x86/32bit/reset32.inc
122 ldscript /cpu/x86/32bit/reset32.lds
123end
124
arch import user (historical)6ca76362005-07-06 17:17:25 +0000125if USE_DCACHE_RAM
126else
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000127### Should this be in the northbridge code?
128mainboardinit arch/i386/lib/cpu_reset.inc
arch import user (historical)6ca76362005-07-06 17:17:25 +0000129end
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000130
131##
132## Include an id string (For safe flashing)
133##
134mainboardinit southbridge/nvidia/ck804/id.inc
135ldscript /southbridge/nvidia/ck804/id.lds
136
137##
138## ROMSTRAP table for CK804
139##
140if USE_FALLBACK_IMAGE
141 mainboardinit southbridge/nvidia/ck804/romstrap.inc
142 ldscript /southbridge/nvidia/ck804/romstrap.lds
143end
144
arch import user (historical)6ca76362005-07-06 17:17:25 +0000145if USE_DCACHE_RAM
146##
147## Setup Cache-As-Ram
148##
149mainboardinit cpu/amd/car/cache_as_ram.inc
150end
151
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000152###
153### This is the early phase of linuxBIOS startup
154### Things are delicate and we test to see if we should
155### failover to another image.
156###
157if USE_FALLBACK_IMAGE
arch import user (historical)6ca76362005-07-06 17:17:25 +0000158if USE_DCACHE_RAM
159 ldscript /arch/i386/lib/failover.lds
160else
161 ldscript /arch/i386/lib/failover.lds
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000162 mainboardinit ./failover.inc
163end
arch import user (historical)6ca76362005-07-06 17:17:25 +0000164end
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000165
166###
167### O.k. We aren't just an intermediary anymore!
168###
169
170##
171## Setup RAM
172##
arch import user (historical)6ca76362005-07-06 17:17:25 +0000173if USE_DCACHE_RAM
174
175if CONFIG_USE_INIT
176initobject auto.o
177else
178mainboardinit ./auto.inc
179end
180
181else
182# ROMCC
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000183mainboardinit cpu/x86/fpu/enable_fpu.inc
184mainboardinit cpu/x86/mmx/enable_mmx.inc
185mainboardinit cpu/x86/sse/enable_sse.inc
186mainboardinit ./auto.inc
187mainboardinit cpu/x86/sse/disable_sse.inc
188mainboardinit cpu/x86/mmx/disable_mmx.inc
189
arch import user (historical)6ca76362005-07-06 17:17:25 +0000190end
191
arch import user (historical)ef03afa2005-07-06 17:15:30 +0000192##
193## Include the secondary Configuration files
194##
195if CONFIG_CHIP_NAME
196 config chip.h
197end
198
199
200# sample config for tyan/s2892
201chip northbridge/amd/amdk8/root_complex
202 device apic_cluster 0 on
203 chip cpu/amd/socket_940
204 device apic 0 on end
205 end
206 end
207
208 device pci_domain 0 on
209 chip northbridge/amd/amdk8 #mc0
210 device pci 18.0 on # northbridge
211 # devices on link 0, link 0 == LDT 0
212 chip southbridge/nvidia/ck804
213 device pci 0.0 on end # HT
214 device pci 1.0 on # LPC
215 chip superio/winbond/w83627hf
216 device pnp 2e.0 on # Floppy
217 io 0x60 = 0x3f0
218 irq 0x70 = 6
219 drq 0x74 = 2
220 end
221 device pnp 2e.1 off # Parallel Port
222 io 0x60 = 0x378
223 irq 0x70 = 7
224 end
225 device pnp 2e.2 on # Com1
226 io 0x60 = 0x3f8
227 irq 0x70 = 4
228 end
229 device pnp 2e.3 off # Com2
230 io 0x60 = 0x2f8
231 irq 0x70 = 3
232 end
233 device pnp 2e.5 on # Keyboard
234 io 0x60 = 0x60
235 io 0x62 = 0x64
236 irq 0x70 = 1
237 irq 0x72 = 12
238 end
239 device pnp 2e.6 off # CIR
240 io 0x60 = 0x100
241 end
242 device pnp 2e.7 off # GAME_MIDI_GIPO1
243 io 0x60 = 0x220
244 io 0x62 = 0x300
245 irq 0x70 = 9
246 end
247 device pnp 2e.8 off end # GPIO2
248 device pnp 2e.9 off end # GPIO3
249 device pnp 2e.a off end # ACPI
250 device pnp 2e.b on # HW Monitor
251 io 0x60 = 0x290
252 irq 0x70 = 5
253 end
254 end
255 end
256 device pci 1.1 on # SM 0
257 chip drivers/generic/generic #dimm 0-0-0
258 device i2c 50 on end
259 end
260 chip drivers/generic/generic #dimm 0-0-1
261 device i2c 51 on end
262 end
263 chip drivers/generic/generic #dimm 0-1-0
264 device i2c 52 on end
265 end
266 chip drivers/generic/generic #dimm 0-1-1
267 device i2c 53 on end
268 end
269 chip drivers/generic/generic #dimm 1-0-0
270 device i2c 54 on end
271 end
272 chip drivers/generic/generic #dimm 1-0-1
273 device i2c 55 on end
274 end
275 chip drivers/generic/generic #dimm 1-1-0
276 device i2c 56 on end
277 end
278 chip drivers/generic/generic #dimm 1-1-1
279 device i2c 57 on end
280 end
281 end # SM
282 device pci 1.1 on # SM 1
283 chip drivers/i2c/adm1027 # ADT7463A CPU0 temp, SYS FAN 2/3/4
284 device i2c 2d on end
285 end
286 chip drivers/i2c/adm1027 # ADT7463A CPU1 temp, CPU0/1 FAN , SYS FAN 1/5
287 device i2c 2e on end
288 end
289 chip drivers/generic/generic # Winbond HWM 0x54 CPU0/1 VRM temp, SYSFAN 6/7, SB FAN
290 device i2c 2a on end
291 end
292 chip drivers/generic/generic # Winbond HWM 0x92
293 device i2c 49 on end
294 end
295 chip drivers/generic/generic # Winbond HWM 0x94
296 device i2c 4a on end
297 end
298 end #SM
299 device pci 2.0 on end # USB 1.1
300 device pci 2.1 on end # USB 2
301 device pci 4.0 off end # ACI
302 device pci 4.1 off end # MCI
303 device pci 6.0 on end # IDE
304 device pci 7.0 on end # SATA 1
305 device pci 8.0 on end # SATA 0
306 device pci 9.0 on # PCI
307 # chip drivers/ati/ragexl
308 chip drivers/pci/onboard
309 device pci 6.0 on end
310 register "rom_address" = "0xfff80000"
311 end
312 chip drivers/pci/onboard
313 device pci 8.0 on end
314 end
315 end
316 device pci a.0 off end # NIC
317 device pci b.0 off end # PCI E 3
318 device pci c.0 off end # PCI E 2
319 device pci d.0 on end # PCI E 1
320 device pci e.0 on end # PCI E 0
321 register "ide0_enable" = "1"
322 register "ide1_enable" = "1"
323 register "sata0_enable" = "1"
324 register "sata1_enable" = "1"
325 end
326 end # device pci 18.0
327 device pci 18.0 on end # Link 1
328 device pci 18.0 on
329 # devices on link 2, link 2 == LDT 2
330 chip southbridge/amd/amd8131
331 # the on/off keyword is mandatory
332 device pci 0.0 on end
333 device pci 0.1 on end
334 device pci 1.0 on
335 chip drivers/pci/onboard
336 device pci 9.0 on end # broadcom 5704
337 device pci 9.1 on end
338 end
339 end
340 device pci 1.1 on end
341 end
342 end # device pci 18.0
343 device pci 18.1 on end
344 device pci 18.2 on end
345 device pci 18.3 on end
346 end #mc0
347
348 end # pci_domain
349
350# chip drivers/generic/debug
351# device pnp 0.0 off end
352# device pnp 0.1 off end
353# device pnp 0.2 off end
354# device pnp 0.3 off end
355# device pnp 0.4 off end
356# device pnp 0.5 on end
357# end
358end # root_complex