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
86 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
87 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c $(MAINBOARD)/cache_as_ram_auto.c -o $@"
91 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
92 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 $@"
93 action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
94 action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
100 if CONFIG_AP_CODE_IN_CAR
101 makerule ./apc_auto.o
102 depends "$(MAINBOARD)/apc_auto.c option_table.h"
103 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c $(MAINBOARD)/apc_auto.c -o $@"
105 ldscript /arch/i386/init/ldscript_apc.lb
111 ## Build our 16 bit and 32 bit coreboot entry code
113 if HAVE_FAILOVER_BOOT
114 if USE_FAILOVER_IMAGE
115 mainboardinit cpu/x86/16bit/entry16.inc
116 ldscript /cpu/x86/16bit/entry16.lds
119 if USE_FALLBACK_IMAGE
120 mainboardinit cpu/x86/16bit/entry16.inc
121 ldscript /cpu/x86/16bit/entry16.lds
125 mainboardinit cpu/x86/32bit/entry32.inc
128 ldscript /cpu/x86/32bit/entry32.lds
132 ldscript /cpu/amd/car/cache_as_ram.lds
136 ## Build our reset vector (This is where coreboot is entered)
138 if HAVE_FAILOVER_BOOT
139 if USE_FAILOVER_IMAGE
140 mainboardinit cpu/x86/16bit/reset16.inc
141 ldscript /cpu/x86/16bit/reset16.lds
143 mainboardinit cpu/x86/32bit/reset32.inc
144 ldscript /cpu/x86/32bit/reset32.lds
147 if USE_FALLBACK_IMAGE
148 mainboardinit cpu/x86/16bit/reset16.inc
149 ldscript /cpu/x86/16bit/reset16.lds
151 mainboardinit cpu/x86/32bit/reset32.inc
152 ldscript /cpu/x86/32bit/reset32.lds
157 ## Include an id string (For safe flashing)
159 mainboardinit southbridge/nvidia/mcp55/id.inc
160 ldscript /southbridge/nvidia/mcp55/id.lds
163 ## ROMSTRAP table for MCP55
165 if HAVE_FAILOVER_BOOT
166 if USE_FAILOVER_IMAGE
167 mainboardinit southbridge/nvidia/mcp55/romstrap.inc
168 ldscript /southbridge/nvidia/mcp55/romstrap.lds
171 if USE_FALLBACK_IMAGE
172 mainboardinit southbridge/nvidia/mcp55/romstrap.inc
173 ldscript /southbridge/nvidia/mcp55/romstrap.lds
178 ## Setup Cache-As-Ram
180 mainboardinit cpu/amd/car/cache_as_ram.inc
183 ### This is the early phase of coreboot startup
184 ### Things are delicate and we test to see if we should
185 ### failover to another image.
187 if HAVE_FAILOVER_BOOT
188 if USE_FAILOVER_IMAGE
189 ldscript /arch/i386/lib/failover_failover.lds
192 if USE_FALLBACK_IMAGE
193 ldscript /arch/i386/lib/failover.lds
203 mainboardinit ./auto.inc
207 ## Include the secondary Configuration files
211 chip northbridge/amd/amdk8/root_complex
212 device apic_cluster 0 on
213 chip cpu/amd/socket_F
217 device pci_domain 0 on
218 chip northbridge/amd/amdk8 #mc0
219 device pci 18.0 on end
220 device pci 18.0 on end
222 # devices on link 0, link 0 == LDT 0
223 chip southbridge/nvidia/mcp55
224 device pci 0.0 on end # HT
225 device pci 1.0 on # LPC
226 chip superio/winbond/w83627hf
227 device pnp 2e.0 off # Floppy
232 device pnp 2e.1 off # Parallel Port
236 device pnp 2e.2 on # Com1
240 device pnp 2e.3 off # Com2
244 device pnp 2e.5 on # Keyboard
250 device pnp 2e.6 off # SFI
253 device pnp 2e.7 off # GPIO_GAME_MIDI
258 device pnp 2e.8 off end # WDTO_PLED
259 device pnp 2e.9 off end # GPIO_SUSLED
260 device pnp 2e.a off end # ACPI
261 device pnp 2e.b on # HW Monitor
267 device pci 1.1 on # SM 0
268 chip drivers/generic/generic #dimm 0-0-0
271 chip drivers/generic/generic #dimm 0-0-1
274 chip drivers/generic/generic #dimm 0-1-0
277 chip drivers/generic/generic #dimm 0-1-1
280 chip drivers/generic/generic #dimm 1-0-0
283 chip drivers/generic/generic #dimm 1-0-1
286 chip drivers/generic/generic #dimm 1-1-0
289 chip drivers/generic/generic #dimm 1-1-1
293 device pci 1.1 on # SM 1
294 #PCI device smbus address will depend on addon pci device, do we need to scan_smbus_bus?
295 # chip drivers/generic/generic #PCIXA Slot1
296 # device i2c 50 on end
298 # chip drivers/generic/generic #PCIXB Slot1
299 # device i2c 51 on end
301 # chip drivers/generic/generic #PCIXB Slot2
302 # device i2c 52 on end
304 # chip drivers/generic/generic #PCI Slot1
305 # device i2c 53 on end
307 # chip drivers/generic/generic #Master MCP55 PCI-E
308 # device i2c 54 on end
310 # chip drivers/generic/generic #Slave MCP55 PCI-E
311 # device i2c 55 on end
313 chip drivers/generic/generic #MAC EEPROM
318 device pci 2.0 on end # USB 1.1
319 device pci 2.1 on end # USB 2
320 device pci 4.0 on end # IDE
321 device pci 5.0 on end # SATA 0
322 device pci 5.1 on end # SATA 1
323 device pci 5.2 on end # SATA 2
324 device pci 6.0 on # PCI
325 chip drivers/pci/onboard
326 device pci 6.0 on end
327 register "rom_address" = "0xfff00000" #for 1M
328 # register "rom_address" = "0xfff80000" #for 512K
331 device pci 6.1 on end # AZA
332 device pci 8.0 on end # NIC
333 device pci 9.0 on end # NIC
334 device pci a.0 on # PCI E 5
335 device pci 0.0 on #nec pci-x
337 device pci 0.1 on #nec pci-x
338 device pci 4.0 on end #scsi
339 device pci 4.1 on end #scsi
342 device pci b.0 on end # PCI E 4
343 device pci c.0 on end # PCI E 3
344 device pci d.0 on end # PCI E 2
345 device pci e.0 on end # PCI E 1
346 device pci f.0 on end # PCI E 0
347 register "ide0_enable" = "1"
348 register "sata0_enable" = "1"
349 register "sata1_enable" = "1"
350 register "mac_eeprom_smbus" = "3" # 1: smbus under 2e.8, 2: SM0 3: SM1
351 register "mac_eeprom_addr" = "0x51"
353 end # device pci 18.0
354 device pci 18.1 on end
355 device pci 18.2 on end
356 device pci 18.3 on end
361 # chip drivers/generic/debug
362 # device pnp 0.0 off end # chip name
363 # device pnp 0.1 on end # pci_regs_all
364 # device pnp 0.2 off end # mem
365 # device pnp 0.3 off end # cpuid
366 # device pnp 0.4 on end # smbus_regs_all
367 # device pnp 0.5 off end # dual core msr
368 # device pnp 0.6 off end # cache size
369 # device pnp 0.7 off end # tsc
370 # device pnp 0.8 off end # io
371 # device pnp 0.9 on end # io