2 ## This file is part of the coreboot project.
4 ## Copyright (C) 2007 AMD
5 ## Written by Yinghai Lu <yinghailu@amd.com> for AMD.
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 ## Compute the location and size of where this firmware image
24 ## (coreboot plus bootloader) will live in the boot rom chip.
27 default ROM_SECTION_SIZE = FAILOVER_SIZE
28 default ROM_SECTION_OFFSET = ( ROM_SIZE - FAILOVER_SIZE )
31 default ROM_SECTION_SIZE = FALLBACK_SIZE
32 default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
34 default ROM_SECTION_SIZE = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
35 default ROM_SECTION_OFFSET = 0
40 ## Compute the start location and size size of
41 ## The coreboot bootloader.
43 default PAYLOAD_SIZE = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
44 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
47 ## Compute where this copy of coreboot will start in the boot rom
49 default _ROMBASE = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
52 ## Compute a range of ROM that can cached to speed up coreboot,
55 ## XIP_ROM_SIZE must be a power of 2.
56 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
58 default XIP_ROM_SIZE=65536
61 default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
64 default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
66 default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
73 ## Build the objects we have code for in this directory.
77 #needed by irq_tables and mptable and acpi_tables
80 if HAVE_MP_TABLE object mptable.o end
81 if HAVE_PIRQ_TABLE object irq_tables.o end
88 depends "$(MAINBOARD)/dx/dsdt_lb.dsl"
89 action "/usr/sbin/iasl -tc $(MAINBOARD)/dx/dsdt_lb.dsl"
90 action "mv dsdt_lb.hex dsdt.c"
94 #./ssdt.o is moved to northbridge/amd/amdk8/Config.lb
98 depends "$(MAINBOARD)/dx/pci6.asl"
99 action "/usr/sbin/iasl -tc $(MAINBOARD)/dx/pci6.asl"
100 action "perl -pi -e 's/AmlCode/AmlCode_ssdt6/g' pci6.hex"
101 action "mv pci6.hex ssdt6.c"
105 depends "$(MAINBOARD)/dx/pci5.asl"
106 action "/usr/sbin/iasl -tc $(MAINBOARD)/dx/pci5.asl"
107 action "perl -pi -e 's/AmlCode/AmlCode_ssdt5/g' pci5.hex"
108 action "mv pci5.hex ssdt5.c"
115 makerule ./cache_as_ram_auto.o
116 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
117 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c $(MAINBOARD)/cache_as_ram_auto.c -o $@"
120 makerule ./cache_as_ram_auto.inc
121 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
122 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c -S $(MAINBOARD)/cache_as_ram_auto.c -o $@"
123 action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
124 action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
128 if USE_FAILOVER_IMAGE
130 if CONFIG_AP_CODE_IN_CAR
131 makerule ./apc_auto.o
132 depends "$(MAINBOARD)/apc_auto.c option_table.h"
133 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c $(MAINBOARD)/apc_auto.c -o $@"
135 ldscript /arch/i386/init/ldscript_apc.lb
141 ## Build our 16 bit and 32 bit coreboot entry code
143 if HAVE_FAILOVER_BOOT
144 if USE_FAILOVER_IMAGE
145 mainboardinit cpu/x86/16bit/entry16.inc
146 ldscript /cpu/x86/16bit/entry16.lds
149 if USE_FALLBACK_IMAGE
150 mainboardinit cpu/x86/16bit/entry16.inc
151 ldscript /cpu/x86/16bit/entry16.lds
155 mainboardinit cpu/x86/32bit/entry32.inc
158 ldscript /cpu/x86/32bit/entry32.lds
162 ldscript /cpu/amd/car/cache_as_ram.lds
166 ## Build our reset vector (This is where coreboot is entered)
168 if HAVE_FAILOVER_BOOT
169 if USE_FAILOVER_IMAGE
170 mainboardinit cpu/x86/16bit/reset16.inc
171 ldscript /cpu/x86/16bit/reset16.lds
173 mainboardinit cpu/x86/32bit/reset32.inc
174 ldscript /cpu/x86/32bit/reset32.lds
177 if USE_FALLBACK_IMAGE
178 mainboardinit cpu/x86/16bit/reset16.inc
179 ldscript /cpu/x86/16bit/reset16.lds
181 mainboardinit cpu/x86/32bit/reset32.inc
182 ldscript /cpu/x86/32bit/reset32.lds
187 ## Include an id string (For safe flashing)
189 mainboardinit southbridge/nvidia/mcp55/id.inc
190 ldscript /southbridge/nvidia/mcp55/id.lds
193 ## ROMSTRAP table for MCP55
195 if HAVE_FAILOVER_BOOT
196 if USE_FAILOVER_IMAGE
197 mainboardinit southbridge/nvidia/mcp55/romstrap.inc
198 ldscript /southbridge/nvidia/mcp55/romstrap.lds
201 if USE_FALLBACK_IMAGE
202 mainboardinit southbridge/nvidia/mcp55/romstrap.inc
203 ldscript /southbridge/nvidia/mcp55/romstrap.lds
208 ## Setup Cache-As-Ram
210 mainboardinit cpu/amd/car/cache_as_ram.inc
213 ### This is the early phase of coreboot startup
214 ### Things are delicate and we test to see if we should
215 ### failover to another image.
217 if HAVE_FAILOVER_BOOT
218 if USE_FAILOVER_IMAGE
219 ldscript /arch/i386/lib/failover_failover.lds
222 if USE_FALLBACK_IMAGE
223 ldscript /arch/i386/lib/failover.lds
231 initobject cache_as_ram_auto.o
233 mainboardinit ./cache_as_ram_auto.inc
237 ## Include the secondary Configuration files
241 chip northbridge/amd/amdk8/root_complex
242 device apic_cluster 0 on
243 chip cpu/amd/socket_F
247 device pci_domain 0 on
248 chip northbridge/amd/amdk8 #mc0
250 # devices on link 0, link 0 == LDT 0
251 chip southbridge/nvidia/mcp55
252 device pci 0.0 on end # HT
253 device pci 1.0 on # LPC
254 chip superio/winbond/w83627ehg
255 device pnp 2e.0 off # Floppy
260 device pnp 2e.1 off # Parallel Port
264 device pnp 2e.2 on # Com1
268 device pnp 2e.3 off # Com2
272 device pnp 2e.5 on # Keyboard
278 device pnp 2e.6 off # SFI
281 device pnp 2e.7 off # GPIO_GAME_MIDI
286 device pnp 2e.8 off end # WDTO_PLED
287 device pnp 2e.9 off end # GPIO_SUSLED
288 device pnp 2e.a off end # ACPI
289 device pnp 2e.b on # HW Monitor
295 device pci 1.1 on # SM 0
296 chip drivers/generic/generic #dimm 0-0-0
299 chip drivers/generic/generic #dimm 0-0-1
302 chip drivers/generic/generic #dimm 0-1-0
305 chip drivers/generic/generic #dimm 0-1-1
308 chip drivers/generic/generic #dimm 1-0-0
311 chip drivers/generic/generic #dimm 1-0-1
314 chip drivers/generic/generic #dimm 1-1-0
317 chip drivers/generic/generic #dimm 1-1-1
321 device pci 1.1 on # SM 1
322 #PCI device smbus address will depend on addon pci device, do we need to scan_smbus_bus?
323 # chip drivers/generic/generic #PCIXA Slot1
324 # device i2c 50 on end
326 # chip drivers/generic/generic #PCIXB Slot1
327 # device i2c 51 on end
329 # chip drivers/generic/generic #PCIXB Slot2
330 # device i2c 52 on end
332 # chip drivers/generic/generic #PCI Slot1
333 # device i2c 53 on end
335 # chip drivers/generic/generic #Master MCP55 PCI-E
336 # device i2c 54 on end
338 # chip drivers/generic/generic #Slave MCP55 PCI-E
339 # device i2c 55 on end
341 chip drivers/generic/generic #MAC EEPROM
346 device pci 2.0 on end # USB 1.1
347 device pci 2.1 on end # USB 2
348 device pci 4.0 on end # IDE
349 device pci 5.0 on end # SATA 0
350 device pci 5.1 on end # SATA 1
351 device pci 5.2 on end # SATA 2
352 device pci 6.0 on end # PCI
353 device pci 6.1 on end # AZA
354 device pci 8.0 on end # NIC
355 device pci 9.0 on end # NIC
356 device pci a.0 on end # PCI E 5
357 device pci b.0 off end # PCI E 4
358 device pci c.0 off end # PCI E 3
359 device pci d.0 on end # PCI E 2
360 device pci e.0 off end # PCI E 1
361 device pci f.0 on end # PCI E 0
362 register "ide0_enable" = "1"
363 register "sata0_enable" = "1"
364 register "sata1_enable" = "1"
365 register "mac_eeprom_smbus" = "3" # 1: smbus under 2e.8, 2: SM0 3: SM1
366 register "mac_eeprom_addr" = "0x51"
368 end # device pci 18.0
369 device pci 18.0 on end # Link 1
371 # devices on link 2, link 2 == LDT 2
372 chip southbridge/nvidia/mcp55
373 device pci 0.0 on end # HT
374 device pci 1.0 on end # LPC
375 device pci 1.1 on end # SM 0
376 device pci 2.0 off end # USB 1.1
377 device pci 2.1 off end # USB 2
378 device pci 4.0 off end # IDE
379 device pci 5.0 on end # SATA 0
380 device pci 5.1 on end # SATA 1
381 device pci 5.2 on end # SATA 2
382 device pci 6.0 off end # PCI
383 device pci 6.1 off end # AZA
384 device pci 8.0 on end # NIC
385 device pci 9.0 on end # NIC
386 device pci a.0 on end # PCI E 5
387 device pci b.0 off end # PCI E 4
388 device pci c.0 off end # PCI E 3
389 device pci d.0 on end # PCI E 2
390 device pci e.0 on end # PCI E 1
391 device pci f.0 on end # PCI E 0
392 register "ide0_enable" = "1"
393 register "sata0_enable" = "1"
394 register "sata1_enable" = "1"
395 register "mac_eeprom_smbus" = "3" # 1: smbus under 2e.8, 2: SM0 3: SM1
396 register "mac_eeprom_addr" = "0x51"
398 end # device pci 18.0
399 device pci 18.1 on end
400 device pci 18.2 on end
401 device pci 18.3 on end
406 # chip drivers/generic/debug
407 # device pnp 0.0 off end # chip name
408 # device pnp 0.1 on end # pci_regs_all
409 # device pnp 0.2 on end # mem
410 # device pnp 0.3 off end # cpuid
411 # device pnp 0.4 on end # smbus_regs_all
412 # device pnp 0.5 off end # dual core msr
413 # device pnp 0.6 off end # cache size
414 # device pnp 0.7 off end # tsc
415 # device pnp 0.8 off end # io
416 # device pnp 0.9 off end # io