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
85 makerule ./cache_as_ram_auto.o
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 $@"
90 makerule ./cache_as_ram_auto.inc
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
205 initobject cache_as_ram_auto.o
207 mainboardinit ./cache_as_ram_auto.inc
211 ## Include the secondary Configuration files
215 chip northbridge/amd/amdk8/root_complex
216 device apic_cluster 0 on
217 chip cpu/amd/socket_AM2
221 device pci_domain 0 on
222 chip northbridge/amd/amdk8 #mc0
224 # devices on link 0, link 0 == LDT 0
225 chip southbridge/nvidia/mcp55
226 device pci 0.0 on end # HT
227 device pci 1.0 on # LPC
228 chip superio/ite/it8716f
231 # Watchdog from CLKIN, CLKIN = 24 MHz
233 # Serial Flash (SPI only)
239 device pnp 2e.1 on # Com1
243 device pnp 2e.2 off # Com2
247 device pnp 2e.3 off # Parallel Port
251 device pnp 2e.4 on # EC
256 device pnp 2e.5 on # Keyboard
261 device pnp 2e.6 on # Mouse
264 device pnp 2e.7 on # GPIO, SPI flash
267 # pin 21 is GP26, pin 26 is GP21, pin 27 is GP20
273 # pin 6,3,128,127,126 is GP63,64,65,66,67
275 # Enable FAN_CTL/FAN_TAC set to 5 (pin 21,23), enable FAN_CTL/FAN_TAC set to 4 (pin 20,22), pin 48 is PCIRST5#, pin91 is PCIRSTIN#, VIN7 is internal voltage divider for VCCH5V, pin 95 is ATXPG, VIN3 is internal voltage divider for VCC5V
279 # Serial Flash I/O (SPI only)
281 # watch dog force timeout (parallel flash only)
285 # GPIO pin set 1 disable internal pullup
287 # GPIO pin set 5 enable internal pullup
289 # SIO pin set 1 alternate function
291 # SIO pin set 2 mixed function
293 # SIO pin set 3 mixed function
295 # SIO pin set 4 alternate function
297 # SIO pin set 1 input mode
299 # SIO pin set 2 input mode
301 # SIO pin set 4 input mode
303 # Generate SMI# on EC IRQ
307 # HWMON alert beep pin location
310 device pnp 2e.8 off # MIDI
314 device pnp 2e.9 off # GAME
317 device pnp 2e.a off end # CIR
320 device pci 1.1 on # SM 0
321 chip drivers/generic/generic #dimm 0-0-0
324 chip drivers/generic/generic #dimm 0-0-1
327 chip drivers/generic/generic #dimm 0-1-0
330 chip drivers/generic/generic #dimm 0-1-1
333 chip drivers/generic/generic #dimm 1-0-0
336 chip drivers/generic/generic #dimm 1-0-1
339 chip drivers/generic/generic #dimm 1-1-0
342 chip drivers/generic/generic #dimm 1-1-1
346 #WTF?!? We already have device pci 1.1 in the section above
347 device pci 1.1 on # SM 1
348 #PCI device smbus address will depend on addon pci device, do we need to scan_smbus_bus?
349 # chip drivers/generic/generic #PCIXA Slot1
350 # device i2c 50 on end
352 # chip drivers/generic/generic #PCIXB Slot1
353 # device i2c 51 on end
355 # chip drivers/generic/generic #PCIXB Slot2
356 # device i2c 52 on end
358 # chip drivers/generic/generic #PCI Slot1
359 # device i2c 53 on end
361 # chip drivers/generic/generic #Master MCP55 PCI-E
362 # device i2c 54 on end
364 # chip drivers/generic/generic #Slave MCP55 PCI-E
365 # device i2c 55 on end
367 chip drivers/generic/generic #MAC EEPROM
372 device pci 2.0 on end # USB 1.1
373 device pci 2.1 on end # USB 2
374 device pci 4.0 on end # IDE
375 device pci 5.0 on end # SATA 0
376 device pci 5.1 on end # SATA 1
377 device pci 5.2 on end # SATA 2
378 device pci 6.0 on end # PCI
379 device pci 6.1 on end # AZA
380 device pci 8.0 on end # NIC
381 device pci 9.0 off end # NIC
382 device pci a.0 on end # PCI E 5
383 device pci b.0 on end # PCI E 4
384 device pci c.0 on end # PCI E 3
385 device pci d.0 on end # PCI E 2
386 device pci e.0 on end # PCI E 1
387 device pci f.0 on end # PCI E 0
388 register "ide0_enable" = "1"
389 register "sata0_enable" = "1"
390 register "sata1_enable" = "1"
391 register "mac_eeprom_smbus" = "3" # 1: smbus under 2e.8, 2: SM0 3: SM1
392 register "mac_eeprom_addr" = "0x51"
394 end # device pci 18.0
395 device pci 18.0 on end # Link 1
396 device pci 18.0 on end
397 device pci 18.1 on end
398 device pci 18.2 on end
399 device pci 18.3 on end
404 # chip drivers/generic/debug
405 # device pnp 0.0 off end # chip name
406 # device pnp 0.1 on end # pci_regs_all
407 # device pnp 0.2 on end # mem
408 # device pnp 0.3 off end # cpuid
409 # device pnp 0.4 on end # smbus_regs_all
410 # device pnp 0.5 off end # dual core msr
411 # device pnp 0.6 off end # cache size
412 # device pnp 0.7 off end # tsc
413 # device pnp 0.8 off end # io
414 # device pnp 0.9 off end # io