2 ## Compute the location and size of where this firmware image
3 ## (coreboot plus bootloader) will live in the boot rom chip.
6 default ROM_SECTION_SIZE = FAILOVER_SIZE
7 default ROM_SECTION_OFFSET = ( ROM_SIZE - FAILOVER_SIZE )
10 default ROM_SECTION_SIZE = FALLBACK_SIZE
11 default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
13 default ROM_SECTION_SIZE = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
14 default ROM_SECTION_OFFSET = 0
19 ## Compute the start location and size size of
20 ## The coreboot bootloader.
22 default PAYLOAD_SIZE = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
23 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
26 ## Compute where this copy of coreboot will start in the boot rom
28 default _ROMBASE = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
31 ## Compute a range of ROM that can cached to speed up coreboot,
34 ## XIP_ROM_SIZE must be a power of 2.
35 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
37 default XIP_ROM_SIZE=65536
40 default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
43 default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
45 default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
52 ## Build the objects we have code for in this directory.
56 #needed by irq_tables and mptable and acpi_tables
59 if HAVE_MP_TABLE object mptable.o end
60 if HAVE_PIRQ_TABLE object irq_tables.o end
66 depends "$(MAINBOARD)/dsdt.dsl"
67 action "iasl -p $(PWD)/dsdt -tc $(MAINBOARD)/dsdt.dsl"
68 action "mv dsdt.hex dsdt.c"
71 #./ssdt.o is moved to northbridge/amd/amdk8/Config.lb
72 #./fadt.o is moved to southbridge/nvidia/ck804/Config.lb
79 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
80 action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o auto.o"
84 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
85 action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall $(DEBUG_CFLAGS) -c -S -o $@"
86 action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
87 action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
96 depends "$(MAINBOARD)/failover.c ../romcc"
97 action "../romcc -E -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/failover.c -o $@"
100 makerule ./failover.inc
101 depends "$(MAINBOARD)/failover.c ../romcc"
102 action "../romcc -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/failover.c -o $@"
106 depends "$(MAINBOARD)/auto.c option_table.h ../romcc"
107 action "../romcc -E -mcpu=k8 -O2 -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -o $@"
111 depends "$(MAINBOARD)/auto.c option_table.h ../romcc"
112 action "../romcc -mcpu=k8 -O2 -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -o $@"
118 ## Build our 16 bit and 32 bit coreboot entry code
120 if HAVE_FAILOVER_BOOT
121 if USE_FAILOVER_IMAGE
122 mainboardinit cpu/x86/16bit/entry16.inc
123 ldscript /cpu/x86/16bit/entry16.lds
126 if USE_FALLBACK_IMAGE
127 mainboardinit cpu/x86/16bit/entry16.inc
128 ldscript /cpu/x86/16bit/entry16.lds
132 mainboardinit cpu/x86/32bit/entry32.inc
136 ldscript /cpu/x86/32bit/entry32.lds
140 ldscript /cpu/amd/car/cache_as_ram.lds
145 ## Build our reset vector (This is where coreboot is entered)
147 if HAVE_FAILOVER_BOOT
148 if USE_FAILOVER_IMAGE
149 mainboardinit cpu/x86/16bit/reset16.inc
150 ldscript /cpu/x86/16bit/reset16.lds
152 mainboardinit cpu/x86/32bit/reset32.inc
153 ldscript /cpu/x86/32bit/reset32.lds
156 if USE_FALLBACK_IMAGE
157 mainboardinit cpu/x86/16bit/reset16.inc
158 ldscript /cpu/x86/16bit/reset16.lds
160 mainboardinit cpu/x86/32bit/reset32.inc
161 ldscript /cpu/x86/32bit/reset32.lds
167 ### Should this be in the northbridge code?
168 mainboardinit arch/i386/lib/cpu_reset.inc
172 ## Include an id string (For safe flashing)
174 mainboardinit southbridge/nvidia/ck804/id.inc
175 ldscript /southbridge/nvidia/ck804/id.lds
178 ## ROMSTRAP table for CK804
180 if HAVE_FAILOVER_BOOT
181 if USE_FAILOVER_IMAGE
182 mainboardinit southbridge/nvidia/ck804/romstrap.inc
183 ldscript /southbridge/nvidia/ck804/romstrap.lds
186 if USE_FALLBACK_IMAGE
187 mainboardinit southbridge/nvidia/ck804/romstrap.inc
188 ldscript /southbridge/nvidia/ck804/romstrap.lds
194 ## Setup Cache-As-Ram
196 mainboardinit cpu/amd/car/cache_as_ram.inc
200 ### This is the early phase of coreboot startup
201 ### Things are delicate and we test to see if we should
202 ### failover to another image.
204 if HAVE_FAILOVER_BOOT
205 if USE_FAILOVER_IMAGE
207 ldscript /arch/i386/lib/failover_failover.lds
211 if USE_FALLBACK_IMAGE
213 ldscript /arch/i386/lib/failover.lds
215 mainboardinit ./failover.inc
228 mainboardinit ./auto.inc
233 mainboardinit cpu/x86/fpu/enable_fpu.inc
234 mainboardinit cpu/x86/mmx/enable_mmx.inc
235 mainboardinit cpu/x86/sse/enable_sse.inc
236 mainboardinit ./auto.inc
237 mainboardinit cpu/x86/sse/disable_sse.inc
238 mainboardinit cpu/x86/mmx/disable_mmx.inc
243 ## Include the secondary Configuration files
247 # sample config for tyan/s2895
248 chip northbridge/amd/amdk8/root_complex
249 device apic_cluster 0 on
250 chip cpu/amd/socket_940
254 device pci_domain 0 on
255 chip northbridge/amd/amdk8 #mc0
256 device pci 18.0 on # northbridge
257 # devices on link 0, link 0 == LDT 0
258 chip southbridge/nvidia/ck804
259 device pci 0.0 on end # HT
260 device pci 1.0 on # LPC
261 chip superio/smsc/lpc47b397
262 device pnp 2e.0 on # Floppy
267 device pnp 2e.3 on # Parallel Port
272 device pnp 2e.4 on # Com1
276 device pnp 2e.5 off # Com2
280 device pnp 2e.7 on # Keyboard
286 device pnp 2e.8 on # HW Monitor
288 chip drivers/generic/generic # LM95221 CPU temp
291 chip drivers/generic/generic # EMCT03
295 device pnp 2e.a on # RT
300 device pci 1.1 on # SM 0
301 chip drivers/generic/generic #dimm 0-0-0
304 chip drivers/generic/generic #dimm 0-0-1
307 chip drivers/generic/generic #dimm 0-1-0
310 chip drivers/generic/generic #dimm 0-1-1
313 chip drivers/generic/generic #dimm 1-0-0
316 chip drivers/generic/generic #dimm 1-0-1
319 chip drivers/generic/generic #dimm 1-1-0
322 chip drivers/generic/generic #dimm 1-1-1
326 device pci 1.1 on # SM 1
327 chip drivers/generic/generic #MAC EEPROM
332 device pci 2.0 on end # USB 1.1
333 device pci 2.1 on end # USB 2
334 device pci 4.0 on end # ACI
335 device pci 4.1 off end # MCI
336 device pci 6.0 on end # IDE
337 device pci 7.0 on end # SATA 1
338 device pci 8.0 on end # SATA 0
339 device pci 9.0 on end # PCI
340 device pci a.0 on end # NIC
341 device pci b.0 off end # PCI E 3
342 device pci c.0 off end # PCI E 2
343 device pci d.0 off end # PCI E 1
344 device pci e.0 on end # PCI E 0
345 register "ide0_enable" = "1"
346 register "ide1_enable" = "1"
347 register "sata0_enable" = "1"
348 register "sata1_enable" = "1"
349 # register "nic_rom_address" = "0xfff80000" # 64k
350 # register "raid_rom_address" = "0xfff90000"
351 register "mac_eeprom_smbus" = "3" # 1: smbus under 2e.8, 2: SM0 3: SM1
352 register "mac_eeprom_addr" = "0x51"
354 end # device pci 18.0
355 device pci 18.0 on end # Link 1
357 # devices on link 2, link 2 == LDT 2
358 chip southbridge/amd/amd8131
359 # the on/off keyword is mandatory
360 device pci 0.0 on end
361 device pci 0.1 on end
363 chip drivers/pci/onboard
364 device pci 6.0 on end # lsi scsi
365 device pci 6.1 on end
368 device pci 1.1 on end
370 end # device pci 18.0
371 device pci 18.1 on end
372 device pci 18.2 on end
373 device pci 18.3 on end
376 chip northbridge/amd/amdk8
377 device pci 19.0 on # northbridge
378 # devices on link 0, link 0 == LDT 0
379 chip southbridge/nvidia/ck804
380 device pci 0.0 on end # HT
381 device pci 1.0 on end # LPC
382 device pci 1.1 off end # SM
383 device pci 2.0 off end # USB 1.1
384 device pci 2.1 off end # USB 2
385 device pci 4.0 off end # ACI
386 device pci 4.1 off end # MCI
387 device pci 6.0 off end # IDE
388 device pci 7.0 off end # SATA 1
389 device pci 8.0 off end # SATA 0
390 device pci 9.0 off end # PCI
391 device pci a.0 on end # NIC
392 device pci b.0 off end # PCI E 3
393 device pci c.0 off end # PCI E 2
394 device pci d.0 off end # PCI E 1
395 device pci e.0 on end # PCI E 0
396 # register "nic_rom_address" = "0xfff80000" # 64k
397 register "mac_eeprom_smbus" = "3"
398 register "mac_eeprom_addr" = "0x51"
400 end # device pci 19.0
402 device pci 19.0 on end
403 device pci 19.0 on end
404 device pci 19.1 on end
405 device pci 19.2 on end
406 device pci 19.3 on end
410 # chip drivers/generic/debug
411 # device pnp 0.0 off end # chip name
412 # device pnp 0.1 off end # pci_regs_all
413 # device pnp 0.2 off end # mem
414 # device pnp 0.3 off end # cpuid
415 # device pnp 0.4 on end # smbus_regs_all
416 # device pnp 0.5 off end # dual core msr
417 # device pnp 0.6 off end # cache size
418 # device pnp 0.7 off end # tsc