2 ## This file is part of the LinuxBIOS 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)
9 ## This program is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2 of the License, or
12 ## (at your option) any later version.
14 ## This program is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ## GNU General Public License for more details.
19 ## You should have received a copy of the GNU General Public License
20 ## along with this program; if not, write to the Free Software
21 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 ## Compute the location and size of where this firmware image
26 ## (linuxBIOS plus bootloader) will live in the boot rom chip.
29 default ROM_SECTION_SIZE = FAILOVER_SIZE
30 default ROM_SECTION_OFFSET = ( ROM_SIZE - FAILOVER_SIZE )
33 default ROM_SECTION_SIZE = FALLBACK_SIZE
34 default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
36 default ROM_SECTION_SIZE = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
37 default ROM_SECTION_OFFSET = 0
42 ## Compute the start location and size size of
43 ## The linuxBIOS 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 linuxBIOS will start in the boot rom
51 default _ROMBASE = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
54 ## Compute a range of ROM that can cached to speed up linuxBIOS,
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 -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 linuxBIOS 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
132 ldscript /cpu/amd/car/cache_as_ram.lds
137 ## Build our reset vector (This is where linuxBIOS is entered)
139 if HAVE_FAILOVER_BOOT
140 if USE_FAILOVER_IMAGE
141 mainboardinit cpu/x86/16bit/reset16.inc
142 ldscript /cpu/x86/16bit/reset16.lds
144 mainboardinit cpu/x86/32bit/reset32.inc
145 ldscript /cpu/x86/32bit/reset32.lds
148 if USE_FALLBACK_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
159 ### Should this be in the northbridge code?
160 mainboardinit arch/i386/lib/cpu_reset.inc
164 ## Include an id string (For safe flashing)
166 mainboardinit southbridge/nvidia/ck804/id.inc
167 ldscript /southbridge/nvidia/ck804/id.lds
170 ## ROMSTRAP table for CK804
172 if HAVE_FAILOVER_BOOT
173 if USE_FAILOVER_IMAGE
174 mainboardinit southbridge/nvidia/ck804/romstrap.inc
175 ldscript /southbridge/nvidia/ck804/romstrap.lds
178 if USE_FALLBACK_IMAGE
179 mainboardinit southbridge/nvidia/ck804/romstrap.inc
180 ldscript /southbridge/nvidia/ck804/romstrap.lds
186 ## Setup Cache-As-Ram
188 mainboardinit cpu/amd/car/cache_as_ram.inc
193 ### This is the early phase of linuxBIOS startup
194 ### Things are delicate and we test to see if we should
195 ### failover to another image.
197 if HAVE_FAILOVER_BOOT
198 if USE_FAILOVER_IMAGE
200 ldscript /arch/i386/lib/failover_failover.lds
204 if USE_FALLBACK_IMAGE
206 ldscript /arch/i386/lib/failover.lds
212 ### O.k. We aren't just an intermediary anymore!
222 mainboardinit ./auto.inc
227 ## Include the secondary configuration files
233 chip northbridge/amd/amdk8/root_complex
234 device apic_cluster 0 on
235 chip cpu/amd/socket_939
240 device pci_domain 0 on
241 chip northbridge/amd/amdk8 # mc0
242 device pci 18.0 on # northbridge
243 # Devices on link 0, link 0 == LDT 0
244 chip southbridge/nvidia/ck804
245 device pci 0.0 on end # HT
246 device pci 1.0 on # LPC
247 chip superio/ite/it8712f
248 device pnp 2e.0 off # Floppy
253 device pnp 2e.1 on # Com1
257 device pnp 2e.2 off # Com2
261 device pnp 2e.3 on # Parallel Port
265 device pnp 2e.4 on # Environment Controller
270 device pnp 2e.5 on # Keyboard
276 device pnp 2e.6 on # Mouse
280 device pnp 2e.7 on # GPIO config
285 # GPIO Polarity for Set 3
287 # GPIO Pin Internal Pull up for Set 3
289 # Simple I/O register config
295 device pnp 2e.8 off end # Midi port
296 device pnp 2e.9 off end # Game port
297 device pnp 2e.a off end # IR
300 device pci 1.1 on # SM 0
301 # chip drivers/generic/generic #dimm 0-0-0
302 # device i2c 50 on end
304 # chip drivers/generic/generic #dimm 0-0-1
305 # device i2c 51 on end
307 # chip drivers/generic/generic #dimm 0-1-0
308 # device i2c 52 on end
310 # chip drivers/generic/generic #dimm 0-1-1
311 # device i2c 53 on end
313 # chip drivers/generic/generic #dimm 1-0-0
314 # device i2c 54 on end
316 # chip drivers/generic/generic #dimm 1-0-1
317 # device i2c 55 on end
319 # chip drivers/generic/generic #dimm 1-1-0
320 # device i2c 56 on end
322 # chip drivers/generic/generic #dimm 1-1-1
323 # device i2c 57 on end
326 device pci 2.0 on end # USB 1.1
327 device pci 2.1 on end # USB 2
328 device pci 4.0 off end # ACI
329 device pci 4.1 off end # MCI
330 device pci 6.0 on end # IDE
331 device pci 7.0 on end # SATA 1
332 device pci 8.0 on end # SATA 0
333 device pci 9.0 on end # PCI
334 device pci a.0 on end # NIC
335 device pci b.0 on end # PCI E 3
336 device pci c.0 on end # PCI E 2
337 device pci d.0 on end # PCI E 1
338 device pci e.0 on end # PCI E 0
339 register "ide0_enable" = "1"
340 register "ide1_enable" = "1"
341 register "sata0_enable" = "1"
342 register "sata1_enable" = "1"
343 # register "mac_eeprom_smbus" = "3"
344 # register "mac_eeprom_addr" = "0x51"
347 end # device pci 18.0
348 device pci 18.1 on end
349 device pci 18.2 on end
350 device pci 18.3 on end