0cadeefb4cf57cc059cc9e7c68a6c50ee458f289
[coreboot.git] / src / mainboard / msi / ms7260 / Config.lb
1 ##
2 ## This file is part of the LinuxBIOS 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 USE_DCACHE_RAM
58   if CONFIG_USE_INIT
59     makerule ./cache_as_ram_auto.o
60       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
61       action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o $@"
62     end
63   else
64     makerule ./cache_as_ram_auto.inc
65       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
66       action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -S -o $@"
67       action "perl -e 's/.rodata/.rom.data/g' -pi $@"
68       action "perl -e 's/.text/.section .rom.text/g' -pi $@"
69     end
70   end
71 end
72
73 if USE_FAILOVER_IMAGE
74 else
75   if CONFIG_AP_CODE_IN_CAR
76     makerule ./apc_auto.o
77       depends "$(MAINBOARD)/apc_auto.c option_table.h"
78       action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/apc_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o $@"
79     end
80     ldscript /arch/i386/init/ldscript_apc.lb
81   end
82 end
83
84 if HAVE_FAILOVER_BOOT
85   if USE_FAILOVER_IMAGE
86     mainboardinit cpu/x86/16bit/entry16.inc
87     ldscript /cpu/x86/16bit/entry16.lds
88   end
89 else
90   if USE_FALLBACK_IMAGE
91     mainboardinit cpu/x86/16bit/entry16.inc
92     ldscript /cpu/x86/16bit/entry16.lds
93   end
94 end
95
96 mainboardinit cpu/x86/32bit/entry32.inc
97
98 if USE_DCACHE_RAM
99   if CONFIG_USE_INIT
100     ldscript /cpu/x86/32bit/entry32.lds
101   end
102   if CONFIG_USE_INIT
103     ldscript /cpu/amd/car/cache_as_ram.lds
104   end
105 end
106
107 if HAVE_FAILOVER_BOOT
108   if USE_FAILOVER_IMAGE
109     mainboardinit cpu/x86/16bit/reset16.inc
110     ldscript /cpu/x86/16bit/reset16.lds
111   else
112     mainboardinit cpu/x86/32bit/reset32.inc
113     ldscript /cpu/x86/32bit/reset32.lds
114   end
115 else
116   if USE_FALLBACK_IMAGE
117     mainboardinit cpu/x86/16bit/reset16.inc
118     ldscript /cpu/x86/16bit/reset16.lds
119   else
120     mainboardinit cpu/x86/32bit/reset32.inc
121     ldscript /cpu/x86/32bit/reset32.lds
122   end
123 end
124
125 mainboardinit southbridge/nvidia/mcp55/id.inc
126 ldscript /southbridge/nvidia/mcp55/id.lds
127
128 # ROMSTRAP table for MCP55.
129 if HAVE_FAILOVER_BOOT
130   if USE_FAILOVER_IMAGE
131     mainboardinit southbridge/nvidia/mcp55/romstrap.inc
132     ldscript /southbridge/nvidia/mcp55/romstrap.lds
133   end
134 else
135   if USE_FALLBACK_IMAGE
136     mainboardinit southbridge/nvidia/mcp55/romstrap.inc
137     ldscript /southbridge/nvidia/mcp55/romstrap.lds
138   end
139 end
140
141 if USE_DCACHE_RAM
142   mainboardinit cpu/amd/car/cache_as_ram.inc
143 end
144
145 if HAVE_FAILOVER_BOOT
146   if USE_FAILOVER_IMAGE
147     if USE_DCACHE_RAM
148       ldscript /arch/i386/lib/failover_failover.lds
149     end
150   end
151 else
152   if USE_FALLBACK_IMAGE
153     if USE_DCACHE_RAM
154       ldscript /arch/i386/lib/failover.lds
155     end
156   end
157 end
158
159 if USE_DCACHE_RAM
160   if CONFIG_USE_INIT
161     initobject cache_as_ram_auto.o
162   else
163     mainboardinit ./cache_as_ram_auto.inc
164   end
165 end
166
167 if CONFIG_CHIP_NAME
168   config chip.h
169 end
170
171 chip northbridge/amd/amdk8/root_complex         # Root complex
172   device apic_cluster 0 on                      # APIC cluster
173     chip cpu/amd/socket_AM2                     # CPU
174       device apic 0 on end                      # APIC
175     end
176   end
177   device pci_domain 0 on                        # PCI domain
178     chip northbridge/amd/amdk8                  # Northbridge / mc0
179       device pci 18.0 on
180         # Devices on link 0, link 0 == LDT 0
181         chip southbridge/nvidia/mcp55           # Southbridge
182           device pci 0.0 on end                 # HT
183           device pci 1.0 on                     # LPC
184             chip superio/winbond/w83627ehg      # Super I/O
185               device pnp 4e.0 on                # Floppy
186                 io 0x60 = 0x3f0
187                 irq 0x70 = 6
188                 drq 0x74 = 2
189               end
190               device pnp 4e.1 on                # Parallel port
191                 io 0x60 = 0x378
192                 irq 0x70 = 7
193               end
194               device pnp 4e.2 on                # Com1
195                 io 0x60 = 0x3f8
196                 irq 0x70 = 4
197               end
198               device pnp 4e.3 on                # Com2 / IrDA
199                 io 0x60 = 0x2f8
200                 irq 0x70 = 3
201               end
202               device pnp 4e.5 on                # PS/2 keyboard
203                 io 0x60 = 0x60
204                 io 0x62 = 0x64
205                 irq 0x70 = 1                    # PS/2 keyboard IRQ
206                 irq 0x72 = 12                   # PS/2 mouse IRQ
207               end
208               device pnp 4e.6 off               # Serial flash interface
209                 # io 0x62 = 0x100
210               end
211               device pnp 4e.7 off               # GPIO1/6, game port, MIDI port
212                 # io 0x60 = 0x220               # Datasheet: 0x201
213                 # io 0x62 = 0x300               # Datasheet: 0x330
214                 # irq 0x70 = 9
215               end
216               device pnp 4e.8 off               # WDTO#, PLED
217               end
218               device pnp 4e.9 off               # GPIO2/3/4/5, SUSLED
219               end
220               device pnp 4e.a off               # ACPI
221               end
222               device pnp 4e.b on                # HWM (for lm-sensors)
223                 io 0x60 = 0xa10
224               end
225             end
226           end
227           device pci 1.1 on                     # SM 0
228             chip drivers/generic/generic        # DIMM 0-0-0
229               device i2c 50 on end
230             end
231             chip drivers/generic/generic        # DIMM 0-0-1
232               device i2c 51 on end
233             end
234             chip drivers/generic/generic        # DIMM 0-1-0
235               device i2c 52 on end
236             end
237             chip drivers/generic/generic        # DIMM 0-1-1
238               device i2c 53 on end
239             end
240             # TODO: Needed?
241             # chip drivers/generic/generic      # DIMM 1-0-0
242             #   device i2c 54 on end
243             # end
244             # chip drivers/generic/generic      # DIMM 1-0-1
245             #   device i2c 55 on end
246             # end
247             # chip drivers/generic/generic      # DIMM 1-1-0
248             #   device i2c 56 on end
249             # end
250             # chip drivers/generic/generic      # DIMM 1-1-1
251             #   device i2c 57 on end
252             # end
253           end
254           # TODO: Check if the stuff below is correct / needed.
255           device pci 1.1 on                     # SM 1
256             # PCI device SMBus address will depend on addon PCI device,
257             # do we need to scan_smbus_bus?
258
259             # chip drivers/generic/generic      # PCIXA Slot1
260             #   device i2c 50 on end
261             # end
262             # chip drivers/generic/generic      # PCIXB Slot1
263             #   device i2c 51 on end
264             # end
265             # chip drivers/generic/generic      # PCIXB Slot2
266             #   device i2c 52 on end
267             # end
268             # chip drivers/generic/generic      # PCI Slot1
269             #   device i2c 53 on end
270             # end
271             # chip drivers/generic/generic      # Master MCP55 PCI-E
272             #   device i2c 54 on end
273             # end
274             # chip drivers/generic/generic      # Slave MCP55 PCI-E
275             #   device i2c 55 on end
276             # end
277             chip drivers/generic/generic        # MAC EEPROM
278               device i2c 51 on end
279             end
280           end
281           device pci 2.0 on end                 # USB 1.1
282           device pci 2.1 on end                 # USB 2
283           device pci 4.0 on end                 # IDE
284           device pci 5.0 on end                 # SATA 0
285           device pci 5.1 on end                 # SATA 1
286           device pci 5.2 off end                # SATA 2 (N/A on this board)
287           device pci 6.0 on end                 # PCI
288           device pci 6.1 on end                 # AZA (HD Audio)
289           device pci 8.0 on end                 # NIC
290           device pci 9.0 off end                # NIC (N/A on this board)
291           device pci a.0 off end                # PCI E 5 (N/A on this board?)
292           device pci b.0 on end                 # PCI E 4
293           device pci c.0 on end                 # PCI E 3
294           device pci d.0 on end                 # PCI E 2
295           device pci e.0 on end                 # PCI E 1
296           device pci f.0 on end                 # PCI E 0
297           register "ide0_enable" = "1"
298           register "sata0_enable" = "1"
299           register "sata1_enable" = "1"
300           # TODO: Check the two lines below.
301           register "mac_eeprom_smbus" = "3"     # 1: SMBus under 2e.8, 2: SM0 3: SM1
302           register "mac_eeprom_addr" = "0x51"
303         end
304       end
305       device pci 18.0 on end                    # Link 1
306       device pci 18.0 on end
307       device pci 18.1 on end
308       device pci 18.2 on end
309       device pci 18.3 on end
310     end
311   end
312
313 # TODO
314 #  chip drivers/generic/debug
315 #    device pnp 0.0 off end                     # chip name
316 #    device pnp 0.1 on end                      # pci_regs_all
317 #    device pnp 0.2 on end                      # mem
318 #    device pnp 0.3 off end                     # cpuid
319 #    device pnp 0.4 on end                      # smbus_regs_all
320 #    device pnp 0.5 off end                     # dual core msr
321 #    device pnp 0.6 off end                     # cache size
322 #    device pnp 0.7 off end                     # tsc
323 #    device pnp 0.8 off end                     # io
324 #    device pnp 0.9 off end                     # io
325 #  end
326
327 end