This patch from Ralf Grosse Boerger makes debugging more comfortable.
[coreboot.git] / src / mainboard / msi / ms7135 / Config.lb
1 ##
2 ## This file is part of the coreboot project.
3 ##
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>
9 ##
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.
14 ##
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.
19 ##
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
23 ##
24
25 ##
26 ## Compute the location and size of where this firmware image
27 ## (coreboot plus bootloader) will live in the boot rom chip.
28 ##
29 if USE_FAILOVER_IMAGE
30         default ROM_SECTION_SIZE   = FAILOVER_SIZE
31         default ROM_SECTION_OFFSET = (ROM_SIZE - FAILOVER_SIZE)
32 else
33         if USE_FALLBACK_IMAGE
34                 default ROM_SECTION_SIZE   = FALLBACK_SIZE
35                 default ROM_SECTION_OFFSET = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
36         else
37                 default ROM_SECTION_SIZE   = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
38                 default ROM_SECTION_OFFSET = 0
39         end
40 end
41
42 ##
43 ## Compute the start location and size size of the coreboot bootloader.
44 ##
45 default PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE)
46 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
47
48 ##
49 ## Compute where this copy of coreboot will start in the boot ROM.
50 ##
51 default _ROMBASE = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
52
53 ##
54 ## Compute a range of ROM that can be cached to speed up coreboot
55 ## execution speed.
56 ##
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
59 ##
60 default XIP_ROM_SIZE = (64 * 1024)
61
62 if USE_FAILOVER_IMAGE
63         default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
64 else
65         if USE_FALLBACK_IMAGE
66                 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
67         else
68                 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
69         end
70 end
71
72 arch i386 end
73
74 ##
75 ## Build the objects we have code for in this directory.
76 ##
77
78 driver mainboard.o
79
80 #dir /drivers/ati/ragexl
81
82 # Needed by irq_tables and mptable and acpi_tables.
83 object get_bus_conf.o
84
85 if HAVE_MP_TABLE
86         object mptable.o
87 end
88
89 if HAVE_PIRQ_TABLE
90         object irq_tables.o
91 end
92
93 if USE_DCACHE_RAM
94         if CONFIG_USE_INIT
95                 makerule ./auto.o
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 $@"
98                 end
99         else
100                 makerule ./auto.inc
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 $@"
105                 end
106         end
107 end
108
109 ##
110 ## Build our 16 bit and 32 bit coreboot entry code.
111 ##
112 if HAVE_FAILOVER_BOOT
113         if USE_FAILOVER_IMAGE
114                 mainboardinit cpu/x86/16bit/entry16.inc
115                 ldscript /cpu/x86/16bit/entry16.lds
116         end
117 else
118         if USE_FALLBACK_IMAGE
119                 mainboardinit cpu/x86/16bit/entry16.inc
120                 ldscript /cpu/x86/16bit/entry16.lds
121         end
122 end
123
124 mainboardinit cpu/x86/32bit/entry32.inc
125
126 if USE_DCACHE_RAM
127         if CONFIG_USE_INIT
128                 ldscript /cpu/x86/32bit/entry32.lds
129                 ldscript /cpu/amd/car/cache_as_ram.lds
130         end
131 end
132
133 ##
134 ## Build our reset vector (this is where coreboot is entered).
135 ##
136 if HAVE_FAILOVER_BOOT
137         if USE_FAILOVER_IMAGE
138                 mainboardinit cpu/x86/16bit/reset16.inc
139                 ldscript /cpu/x86/16bit/reset16.lds
140         else
141                 mainboardinit cpu/x86/32bit/reset32.inc
142                 ldscript /cpu/x86/32bit/reset32.lds
143         end
144 else
145         if USE_FALLBACK_IMAGE
146                 mainboardinit cpu/x86/16bit/reset16.inc
147                 ldscript /cpu/x86/16bit/reset16.lds
148         else
149                 mainboardinit cpu/x86/32bit/reset32.inc
150                 ldscript /cpu/x86/32bit/reset32.lds
151         end
152 end
153
154 if USE_DCACHE_RAM
155 else
156         ### Should this be in the northbridge code?
157         mainboardinit arch/i386/lib/cpu_reset.inc
158 end
159
160 ##
161 ## Include an ID string (for safe flashing).
162 ##
163 mainboardinit southbridge/nvidia/ck804/id.inc
164 ldscript /southbridge/nvidia/ck804/id.lds
165
166 ##
167 ## ROMSTRAP table for CK804
168 ##
169 if HAVE_FAILOVER_BOOT
170         if USE_FAILOVER_IMAGE
171                 mainboardinit southbridge/nvidia/ck804/romstrap.inc
172                 ldscript /southbridge/nvidia/ck804/romstrap.lds
173         end
174 else
175         if USE_FALLBACK_IMAGE
176                 mainboardinit southbridge/nvidia/ck804/romstrap.inc
177                 ldscript /southbridge/nvidia/ck804/romstrap.lds
178         end
179 end
180
181 if USE_DCACHE_RAM
182         ##
183         ## Setup Cache-As-Ram
184         ##
185         mainboardinit cpu/amd/car/cache_as_ram.inc
186 end
187
188
189 ###
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.
193 ###
194 if HAVE_FAILOVER_BOOT
195         if USE_FAILOVER_IMAGE
196                 if USE_DCACHE_RAM
197                         ldscript /arch/i386/lib/failover_failover.lds
198                 end
199         end
200 else
201         if USE_FALLBACK_IMAGE
202                 if USE_DCACHE_RAM
203                         ldscript /arch/i386/lib/failover.lds
204                 end
205         end
206 end
207
208 ###
209 ### O.k. We aren't just an intermediary anymore!
210 ###
211
212 ##
213 ## Setup RAM
214 ##
215 if USE_DCACHE_RAM
216         if CONFIG_USE_INIT
217                 initobject auto.o
218         else
219                 mainboardinit ./auto.inc
220         end
221 end
222
223 ##
224 ## Include the secondary configuration files
225 ##
226 if CONFIG_CHIP_NAME
227         config chip.h
228 end
229
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
234     end
235   end
236
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
246                 io 0x60 = 0x3f0
247                 irq 0x70 = 6
248                 drq 0x74 = 2
249               end
250               device pnp 4e.1 on                # Parallel port
251                 io 0x60 = 0x378
252                 irq 0x70 = 7
253               end
254               device pnp 4e.2 on                # Com1
255                 io 0x60 = 0x3f8
256                 irq 0x70 = 4
257               end
258               device pnp 4e.3 on                # Com2
259                 io 0x60 = 0x2f8
260                 irq 0x70 = 3
261               end
262               device pnp 4e.5 on                # PS/2 keyboard
263                 io 0x60 = 0x60
264                 io 0x62 = 0x64
265                 irq 0x70 = 1
266                 irq 0x72 = 12
267               end
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
273                 io 0x60 = 0x290
274                 irq 0x70 = 0
275               end
276             end
277           end
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"
298         end
299       end
300       device pci 18.1 on end
301       device pci 18.2 on end
302       device pci 18.3 on end
303     end
304   end
305 end