2 ## This file is part of the coreboot project.
4 ## Copyright (C) 2007 AMD
5 ## (Written by Yinghai Lu <yinghailu@amd.com> for AMD)
6 ## Copyright (C) 2007 Philipp Degler <pdegler@rumms.uni-mannheim.de>
7 ## (Thanks to LSRA University of Mannheim for their support)
8 ## Copyright (C) 2008 Jonathan A. Kollasch <jakllsch@kollasch.net>
10 ## This program is free software; you can redistribute it and/or modify
11 ## it under the terms of the GNU General Public License as published by
12 ## the Free Software Foundation; either version 2 of the License, or
13 ## (at your option) any later version.
15 ## This program is distributed in the hope that it will be useful,
16 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ## GNU General Public License for more details.
20 ## You should have received a copy of the GNU General Public License
21 ## along with this program; if not, write to the Free Software
22 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 ## Compute the location and size of where this firmware image
27 ## (coreboot plus bootloader) will live in the boot rom chip.
30 default ROM_SECTION_SIZE = FAILOVER_SIZE
31 default ROM_SECTION_OFFSET = (ROM_SIZE - FAILOVER_SIZE)
34 default ROM_SECTION_SIZE = FALLBACK_SIZE
35 default ROM_SECTION_OFFSET = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
37 default ROM_SECTION_SIZE = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
38 default ROM_SECTION_OFFSET = 0
43 ## Compute the start location and size size of the coreboot bootloader.
45 default PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE)
46 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
49 ## Compute where this copy of coreboot will start in the boot ROM.
51 default _ROMBASE = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
54 ## Compute a range of ROM that can be cached to speed up coreboot
57 ## XIP_ROM_SIZE must be a power of 2 (here 64 Kbyte)
58 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
60 default XIP_ROM_SIZE = (64 * 1024)
63 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
66 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
68 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
75 ## Build the objects we have code for in this directory.
80 #dir /drivers/ati/ragexl
82 # Needed by irq_tables and mptable and acpi_tables.
96 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
97 action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o $@"
101 depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
102 action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -g -dA -fverbose-asm -Wall -c -S -o $@"
103 action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
104 action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
110 ## Build our 16 bit and 32 bit coreboot entry code.
112 if HAVE_FAILOVER_BOOT
113 if USE_FAILOVER_IMAGE
114 mainboardinit cpu/x86/16bit/entry16.inc
115 ldscript /cpu/x86/16bit/entry16.lds
118 if USE_FALLBACK_IMAGE
119 mainboardinit cpu/x86/16bit/entry16.inc
120 ldscript /cpu/x86/16bit/entry16.lds
124 mainboardinit cpu/x86/32bit/entry32.inc
128 ldscript /cpu/x86/32bit/entry32.lds
129 ldscript /cpu/amd/car/cache_as_ram.lds
134 ## Build our reset vector (this is where coreboot is entered).
136 if HAVE_FAILOVER_BOOT
137 if USE_FAILOVER_IMAGE
138 mainboardinit cpu/x86/16bit/reset16.inc
139 ldscript /cpu/x86/16bit/reset16.lds
141 mainboardinit cpu/x86/32bit/reset32.inc
142 ldscript /cpu/x86/32bit/reset32.lds
145 if USE_FALLBACK_IMAGE
146 mainboardinit cpu/x86/16bit/reset16.inc
147 ldscript /cpu/x86/16bit/reset16.lds
149 mainboardinit cpu/x86/32bit/reset32.inc
150 ldscript /cpu/x86/32bit/reset32.lds
156 ### Should this be in the northbridge code?
157 mainboardinit arch/i386/lib/cpu_reset.inc
161 ## Include an ID string (for safe flashing).
163 mainboardinit southbridge/nvidia/ck804/id.inc
164 ldscript /southbridge/nvidia/ck804/id.lds
167 ## ROMSTRAP table for CK804
169 if HAVE_FAILOVER_BOOT
170 if USE_FAILOVER_IMAGE
171 mainboardinit southbridge/nvidia/ck804/romstrap.inc
172 ldscript /southbridge/nvidia/ck804/romstrap.lds
175 if USE_FALLBACK_IMAGE
176 mainboardinit southbridge/nvidia/ck804/romstrap.inc
177 ldscript /southbridge/nvidia/ck804/romstrap.lds
183 ## Setup Cache-As-Ram
185 mainboardinit cpu/amd/car/cache_as_ram.inc
190 ### This is the early phase of coreboot startup.
191 ### Things are delicate and we test to see if we should
192 ### failover to another image.
194 if HAVE_FAILOVER_BOOT
195 if USE_FAILOVER_IMAGE
197 ldscript /arch/i386/lib/failover_failover.lds
201 if USE_FALLBACK_IMAGE
203 ldscript /arch/i386/lib/failover.lds
209 ### O.k. We aren't just an intermediary anymore!
219 mainboardinit ./auto.inc
224 ## Include the secondary configuration files
230 chip northbridge/amd/amdk8/root_complex # Root complex
231 device apic_cluster 0 on # APIC cluster
232 chip cpu/amd/socket_754 # Socket 754 CPU
233 device apic 0 on end # APIC
237 device pci_domain 0 on # PCI domain
238 chip northbridge/amd/amdk8 # mc0
239 device pci 18.0 on # Northbridge
240 # Devices on link 0, link 0 == LDT 0
241 chip southbridge/nvidia/ck804 # Southbridge
242 device pci 0.0 on end # HT
243 device pci 1.0 on # LPC
244 chip superio/winbond/w83627thf # Super I/O
245 device pnp 4e.0 on # Floppy
250 device pnp 4e.1 on # Parallel port
254 device pnp 4e.2 on # Com1
258 device pnp 4e.3 on # Com2
262 device pnp 4e.5 on # PS/2 keyboard
268 device pnp 4e.7 off end # Game, MIDI, GPIO 1, GPIO 5
269 device pnp 4e.8 off end # GPIO 2
270 device pnp 4e.9 off end # GPIO 3, GPIO 4
271 device pnp 4e.a off end # ACPI
272 device pnp 4e.b on # Hardware monitor
278 device pci 1.1 on end # SMbus
279 device pci 2.0 on end # USB 1.1
280 device pci 2.1 on end # USB 2
281 device pci 4.0 on end # Onboard audio (ACI)
282 device pci 4.1 off end # Onboard modem (MCI) -- not wired out
283 device pci 6.0 on end # IDE
284 device pci 7.0 on end # SATA 1
285 device pci 8.0 on end # SATA 0
286 device pci 9.0 on end # PCI
287 device pci a.0 on end # NIC
288 device pci b.0 off end # PCI E 3 -- not wired out
289 device pci c.0 off end # PCI E 2 -- not wired out
290 device pci d.0 on end # PCI E 1
291 device pci e.0 on end # PCI E 0
292 register "ide0_enable" = "1"
293 register "ide1_enable" = "1"
294 register "sata0_enable" = "1"
295 register "sata1_enable" = "1"
296 # register "mac_eeprom_smbus" = "3"
297 # register "mac_eeprom_addr" = "0x51"
300 device pci 18.1 on end
301 device pci 18.2 on end
302 device pci 18.3 on end