This patch cleans up the calls to $CC in mainboard Config.lb files. They
[coreboot.git] / src / mainboard / msi / ms7260 / Config.lb
1 ##
2 ## This file is part of the coreboot project.
3 ##
4 ## Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
5 ##
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19 ##
20
21 if USE_FAILOVER_IMAGE
22   default ROM_SECTION_SIZE   = FAILOVER_SIZE
23   default ROM_SECTION_OFFSET = (ROM_SIZE - FAILOVER_SIZE)
24 else
25   if USE_FALLBACK_IMAGE
26     default ROM_SECTION_SIZE   = FALLBACK_SIZE
27     default ROM_SECTION_OFFSET = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
28   else
29     default ROM_SECTION_SIZE   = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
30     default ROM_SECTION_OFFSET = 0
31   end
32 end
33
34 default PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE)
35 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
36 default _ROMBASE = (CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE)
37 default XIP_ROM_SIZE = 65536
38
39 if USE_FAILOVER_IMAGE
40   default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
41 else
42   if USE_FALLBACK_IMAGE
43     default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
44   else
45     default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
46   end
47 end
48
49 arch i386 end
50
51 driver mainboard.o
52 object get_bus_conf.o # Needed by irq_tables and mptable (and acpi_tables).
53 if HAVE_MP_TABLE object mptable.o end
54 if HAVE_PIRQ_TABLE object irq_tables.o end
55 # object reset.o
56
57   if CONFIG_USE_INIT
58     makerule ./cache_as_ram_auto.o
59       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
60       action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c $(MAINBOARD)/cache_as_ram_auto.c -o $@"
61     end
62   else
63     makerule ./cache_as_ram_auto.inc
64       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
65       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 $@"
66       action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
67       action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
68     end
69   end
70
71 if USE_FAILOVER_IMAGE
72 else
73   if CONFIG_AP_CODE_IN_CAR
74     makerule ./apc_auto.o
75       depends "$(MAINBOARD)/apc_auto.c option_table.h"
76       action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -nostdinc -nostdlib -fno-builtin -Wall -Os -c $(MAINBOARD)/apc_auto.c -o $@"
77     end
78     ldscript /arch/i386/init/ldscript_apc.lb
79   end
80 end
81
82 if HAVE_FAILOVER_BOOT
83   if USE_FAILOVER_IMAGE
84     mainboardinit cpu/x86/16bit/entry16.inc
85     ldscript /cpu/x86/16bit/entry16.lds
86   end
87 else
88   if USE_FALLBACK_IMAGE
89     mainboardinit cpu/x86/16bit/entry16.inc
90     ldscript /cpu/x86/16bit/entry16.lds
91   end
92 end
93
94 mainboardinit cpu/x86/32bit/entry32.inc
95
96   if CONFIG_USE_INIT
97     ldscript /cpu/x86/32bit/entry32.lds
98   end
99   if CONFIG_USE_INIT
100     ldscript /cpu/amd/car/cache_as_ram.lds
101   end
102
103 if HAVE_FAILOVER_BOOT
104   if USE_FAILOVER_IMAGE
105     mainboardinit cpu/x86/16bit/reset16.inc
106     ldscript /cpu/x86/16bit/reset16.lds
107   else
108     mainboardinit cpu/x86/32bit/reset32.inc
109     ldscript /cpu/x86/32bit/reset32.lds
110   end
111 else
112   if USE_FALLBACK_IMAGE
113     mainboardinit cpu/x86/16bit/reset16.inc
114     ldscript /cpu/x86/16bit/reset16.lds
115   else
116     mainboardinit cpu/x86/32bit/reset32.inc
117     ldscript /cpu/x86/32bit/reset32.lds
118   end
119 end
120
121 mainboardinit southbridge/nvidia/mcp55/id.inc
122 ldscript /southbridge/nvidia/mcp55/id.lds
123
124 # ROMSTRAP table for MCP55.
125 if HAVE_FAILOVER_BOOT
126   if USE_FAILOVER_IMAGE
127     mainboardinit southbridge/nvidia/mcp55/romstrap.inc
128     ldscript /southbridge/nvidia/mcp55/romstrap.lds
129   end
130 else
131   if USE_FALLBACK_IMAGE
132     mainboardinit southbridge/nvidia/mcp55/romstrap.inc
133     ldscript /southbridge/nvidia/mcp55/romstrap.lds
134   end
135 end
136
137   mainboardinit cpu/amd/car/cache_as_ram.inc
138
139 if HAVE_FAILOVER_BOOT
140   if USE_FAILOVER_IMAGE
141       ldscript /arch/i386/lib/failover_failover.lds
142   end
143 else
144   if USE_FALLBACK_IMAGE
145       ldscript /arch/i386/lib/failover.lds
146   end
147 end
148
149   if CONFIG_USE_INIT
150     initobject cache_as_ram_auto.o
151   else
152     mainboardinit ./cache_as_ram_auto.inc
153   end
154
155 config chip.h
156
157 chip northbridge/amd/amdk8/root_complex         # Root complex
158   device apic_cluster 0 on                      # APIC cluster
159     chip cpu/amd/socket_AM2                     # CPU
160       device apic 0 on end                      # APIC
161     end
162   end
163   device pci_domain 0 on                        # PCI domain
164     chip northbridge/amd/amdk8                  # Northbridge / mc0
165       device pci 18.0 on
166         # Devices on link 0, link 0 == LDT 0
167         chip southbridge/nvidia/mcp55           # Southbridge
168           device pci 0.0 on end                 # HT
169           device pci 1.0 on                     # LPC
170             chip superio/winbond/w83627ehg      # Super I/O
171               device pnp 4e.0 on                # Floppy
172                 io 0x60 = 0x3f0
173                 irq 0x70 = 6
174                 drq 0x74 = 2
175               end
176               device pnp 4e.1 on                # Parallel port
177                 io 0x60 = 0x378
178                 irq 0x70 = 7
179               end
180               device pnp 4e.2 on                # Com1
181                 io 0x60 = 0x3f8
182                 irq 0x70 = 4
183               end
184               device pnp 4e.3 on                # Com2 / IrDA
185                 io 0x60 = 0x2f8
186                 irq 0x70 = 3
187               end
188               device pnp 4e.5 on                # PS/2 keyboard
189                 io 0x60 = 0x60
190                 io 0x62 = 0x64
191                 irq 0x70 = 1                    # PS/2 keyboard IRQ
192                 irq 0x72 = 12                   # PS/2 mouse IRQ
193               end
194               device pnp 4e.6 off               # Serial flash interface
195                 # io 0x62 = 0x100
196               end
197               device pnp 4e.7 off               # GPIO1/6, game port, MIDI port
198                 # io 0x60 = 0x220               # Datasheet: 0x201
199                 # io 0x62 = 0x300               # Datasheet: 0x330
200                 # irq 0x70 = 9
201               end
202               device pnp 4e.8 off               # WDTO#, PLED
203               end
204               device pnp 4e.9 off               # GPIO2/3/4/5, SUSLED
205               end
206               device pnp 4e.a off               # ACPI
207               end
208               device pnp 4e.b on                # HWM (for lm-sensors)
209                 io 0x60 = 0xa10
210               end
211             end
212           end
213           device pci 1.1 on                     # SM 0
214             chip drivers/generic/generic        # DIMM 0-0-0
215               device i2c 50 on end
216             end
217             chip drivers/generic/generic        # DIMM 0-0-1
218               device i2c 51 on end
219             end
220             chip drivers/generic/generic        # DIMM 0-1-0
221               device i2c 52 on end
222             end
223             chip drivers/generic/generic        # DIMM 0-1-1
224               device i2c 53 on end
225             end
226             # TODO: Needed?
227             # chip drivers/generic/generic      # DIMM 1-0-0
228             #   device i2c 54 on end
229             # end
230             # chip drivers/generic/generic      # DIMM 1-0-1
231             #   device i2c 55 on end
232             # end
233             # chip drivers/generic/generic      # DIMM 1-1-0
234             #   device i2c 56 on end
235             # end
236             # chip drivers/generic/generic      # DIMM 1-1-1
237             #   device i2c 57 on end
238             # end
239           end
240           # TODO: Check if the stuff below is correct / needed.
241           device pci 1.1 on                     # SM 1
242             # PCI device SMBus address will depend on addon PCI device,
243             # do we need to scan_smbus_bus?
244
245             # chip drivers/generic/generic      # PCIXA Slot1
246             #   device i2c 50 on end
247             # end
248             # chip drivers/generic/generic      # PCIXB Slot1
249             #   device i2c 51 on end
250             # end
251             # chip drivers/generic/generic      # PCIXB Slot2
252             #   device i2c 52 on end
253             # end
254             # chip drivers/generic/generic      # PCI Slot1
255             #   device i2c 53 on end
256             # end
257             # chip drivers/generic/generic      # Master MCP55 PCI-E
258             #   device i2c 54 on end
259             # end
260             # chip drivers/generic/generic      # Slave MCP55 PCI-E
261             #   device i2c 55 on end
262             # end
263             chip drivers/generic/generic        # MAC EEPROM
264               device i2c 51 on end
265             end
266           end
267           device pci 2.0 on end                 # USB 1.1
268           device pci 2.1 on end                 # USB 2
269           device pci 4.0 on end                 # IDE
270           device pci 5.0 on end                 # SATA 0
271           device pci 5.1 on end                 # SATA 1
272           device pci 5.2 off end                # SATA 2 (N/A on this board)
273           device pci 6.0 on end                 # PCI
274           device pci 6.1 on end                 # AZA (HD Audio)
275           device pci 8.0 on end                 # NIC
276           device pci 9.0 off end                # NIC (N/A on this board)
277           device pci a.0 off end                # PCI E 5 (N/A on this board?)
278           device pci b.0 on end                 # PCI E 4
279           device pci c.0 on end                 # PCI E 3
280           device pci d.0 on end                 # PCI E 2
281           device pci e.0 on end                 # PCI E 1
282           device pci f.0 on end                 # PCI E 0
283           register "ide0_enable" = "1"
284           register "sata0_enable" = "1"
285           register "sata1_enable" = "1"
286           # TODO: Check the two lines below.
287           register "mac_eeprom_smbus" = "3"     # 1: SMBus under 2e.8, 2: SM0 3: SM1
288           register "mac_eeprom_addr" = "0x51"
289         end
290       end
291       device pci 18.0 on end                    # Link 1
292       device pci 18.0 on end
293       device pci 18.1 on end
294       device pci 18.2 on end
295       device pci 18.3 on end
296     end
297   end
298
299 # TODO
300 #  chip drivers/generic/debug
301 #    device pnp 0.0 off end                     # chip name
302 #    device pnp 0.1 on end                      # pci_regs_all
303 #    device pnp 0.2 on end                      # mem
304 #    device pnp 0.3 off end                     # cpuid
305 #    device pnp 0.4 on end                      # smbus_regs_all
306 #    device pnp 0.5 off end                     # dual core msr
307 #    device pnp 0.6 off end                     # cache size
308 #    device pnp 0.7 off end                     # tsc
309 #    device pnp 0.8 off end                     # io
310 #    device pnp 0.9 off end                     # io
311 #  end
312
313 end