251175f86fe150160e230a39cedc000c1e6c9c3d
[coreboot.git] / src / mainboard / supermicro / h8dmr / 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 ## 
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.
11 ## 
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.
16 ## 
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
20 ## 
21
22 ##
23 ## Compute the location and size of where this firmware image
24 ## (coreboot plus bootloader) will live in the boot rom chip.
25 ##
26 if USE_FAILOVER_IMAGE
27         default ROM_SECTION_SIZE   = FAILOVER_SIZE
28         default ROM_SECTION_OFFSET = ( ROM_SIZE - FAILOVER_SIZE )
29 else
30     if USE_FALLBACK_IMAGE
31         default ROM_SECTION_SIZE   = FALLBACK_SIZE
32         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
33     else
34         default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE )
35         default ROM_SECTION_OFFSET = 0
36     end
37 end
38
39 ##
40 ## Compute the start location and size size of
41 ## The coreboot bootloader.
42 ##
43 default PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
44 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
45
46 ##
47 ## Compute where this copy of coreboot will start in the boot rom
48 ##
49 default _ROMBASE      = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
50
51 ##
52 ## Compute a range of ROM that can cached to speed up coreboot,
53 ## execution speed.
54 ##
55 ## XIP_ROM_SIZE must be a power of 2.
56 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
57 ##
58 default XIP_ROM_SIZE=65536
59
60 if USE_FAILOVER_IMAGE
61         default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
62 else
63     if USE_FALLBACK_IMAGE
64         default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
65     else
66         default XIP_ROM_BASE = ( _ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
67     end
68 end
69
70 arch i386 end 
71
72 ##
73 ## Build the objects we have code for in this directory.
74 ##
75
76 driver mainboard.o
77 #needed by irq_tables and mptable and acpi_tables
78 object get_bus_conf.o
79
80 if HAVE_MP_TABLE object mptable.o end
81 if HAVE_PIRQ_TABLE object irq_tables.o end
82 #object reset.o
83
84         if CONFIG_USE_INIT      
85                 makerule ./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 $@"
88                 end
89         else
90                 makerule ./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 $@"
95                 end
96         end
97
98 if USE_FAILOVER_IMAGE
99 else
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 $@"
104         end
105         ldscript /arch/i386/init/ldscript_apc.lb
106     end
107 end
108
109
110 ##
111 ## Build our 16 bit and 32 bit coreboot entry code
112 ##
113 if HAVE_FAILOVER_BOOT
114     if USE_FAILOVER_IMAGE
115         mainboardinit cpu/x86/16bit/entry16.inc
116         ldscript /cpu/x86/16bit/entry16.lds
117     end
118 else
119     if USE_FALLBACK_IMAGE
120         mainboardinit cpu/x86/16bit/entry16.inc
121         ldscript /cpu/x86/16bit/entry16.lds
122     end
123 end
124
125 mainboardinit cpu/x86/32bit/entry32.inc
126
127         if CONFIG_USE_INIT
128                 ldscript /cpu/x86/32bit/entry32.lds
129         end
130
131         if CONFIG_USE_INIT
132                 ldscript /cpu/amd/car/cache_as_ram.lds
133         end
134
135 ##
136 ## Build our reset vector (This is where coreboot is entered)
137 ##
138 if HAVE_FAILOVER_BOOT
139     if USE_FAILOVER_IMAGE 
140         mainboardinit cpu/x86/16bit/reset16.inc 
141         ldscript /cpu/x86/16bit/reset16.lds 
142     else
143         mainboardinit cpu/x86/32bit/reset32.inc 
144         ldscript /cpu/x86/32bit/reset32.lds 
145     end
146 else
147     if USE_FALLBACK_IMAGE 
148         mainboardinit cpu/x86/16bit/reset16.inc 
149         ldscript /cpu/x86/16bit/reset16.lds 
150     else
151         mainboardinit cpu/x86/32bit/reset32.inc 
152         ldscript /cpu/x86/32bit/reset32.lds 
153     end
154 end
155
156 ##
157 ## Include an id string (For safe flashing)
158 ##
159 mainboardinit southbridge/nvidia/mcp55/id.inc
160 ldscript /southbridge/nvidia/mcp55/id.lds
161
162 ##
163 ## ROMSTRAP table for MCP55
164 ##
165 if HAVE_FAILOVER_BOOT
166     if USE_FAILOVER_IMAGE 
167         mainboardinit southbridge/nvidia/mcp55/romstrap.inc
168         ldscript /southbridge/nvidia/mcp55/romstrap.lds
169     end
170 else
171     if USE_FALLBACK_IMAGE 
172         mainboardinit southbridge/nvidia/mcp55/romstrap.inc
173         ldscript /southbridge/nvidia/mcp55/romstrap.lds
174     end
175 end
176
177         ##
178         ## Setup Cache-As-Ram
179         ##
180         mainboardinit cpu/amd/car/cache_as_ram.inc
181
182 ###
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.
186 ###
187 if HAVE_FAILOVER_BOOT
188     if USE_FAILOVER_IMAGE
189                 ldscript /arch/i386/lib/failover_failover.lds
190     end
191 else
192     if USE_FALLBACK_IMAGE
193                 ldscript /arch/i386/lib/failover.lds
194     end
195 end
196
197 ##
198 ## Setup RAM
199 ##
200         if CONFIG_USE_INIT
201                 initobject auto.o
202         else
203                 mainboardinit ./auto.inc
204         end
205
206 ##
207 ## Include the secondary Configuration files 
208 ##
209 config chip.h
210
211 chip northbridge/amd/amdk8/root_complex
212         device apic_cluster 0 on
213                 chip cpu/amd/socket_F
214                         device apic 0 on end
215                 end
216         end
217         device pci_domain 0 on
218                 chip northbridge/amd/amdk8 #mc0
219                         device pci 18.0 on end
220                         device pci 18.0 on end
221                         device pci 18.0 on 
222                                 #  devices on link 0, link 0 == LDT 0 
223                                 chip southbridge/nvidia/mcp55 
224                                         device pci 0.0 on end   # HT
225                                         device pci 1.0 on # LPC
226                                                 chip superio/winbond/w83627hf
227                                                         device pnp 2e.0 off #  Floppy
228                                                                 io 0x60 = 0x3f0
229                                                                 irq 0x70 = 6
230                                                                 drq 0x74 = 2
231                                                         end
232                                                         device pnp 2e.1 off #  Parallel Port
233                                                                 io 0x60 = 0x378
234                                                                 irq 0x70 = 7
235                                                         end
236                                                         device pnp 2e.2 on #  Com1
237                                                                 io 0x60 = 0x3f8
238                                                                 irq 0x70 = 4
239                                                         end
240                                                         device pnp 2e.3 off #  Com2
241                                                                 io 0x60 = 0x2f8
242                                                                 irq 0x70 = 3
243                                                         end
244                                                         device pnp 2e.5 on #  Keyboard
245                                                                 io 0x60 = 0x60
246                                                                 io 0x62 = 0x64
247                                                                 irq 0x70 = 1
248                                                                 irq 0x72 = 12
249                                                         end
250                                                         device pnp 2e.6 off  # SFI 
251                                                                 io 0x62 = 0x100
252                                                         end
253                                                         device pnp 2e.7 off #  GPIO_GAME_MIDI
254                                                                 io 0x60 = 0x220
255                                                                 io 0x62 = 0x300
256                                                                 irq 0x70 = 9
257                                                         end                                             
258                                                         device pnp 2e.8 off end #  WDTO_PLED
259                                                         device pnp 2e.9 off end #  GPIO_SUSLED
260                                                         device pnp 2e.a off end #  ACPI
261                                                         device pnp 2e.b on #  HW Monitor
262                                                                 io 0x60 = 0x290
263                                                                 irq 0x70 = 5
264                                                         end
265                                                 end
266                                         end
267                                         device pci 1.1 on # SM 0
268                                                 chip drivers/generic/generic #dimm 0-0-0
269                                                         device i2c 50 on end  
270                                                 end              
271                                                 chip drivers/generic/generic #dimm 0-0-1
272                                                         device i2c 51 on end
273                                                 end     
274                                                 chip drivers/generic/generic #dimm 0-1-0
275                                                         device i2c 52 on end
276                                                 end             
277                                                 chip drivers/generic/generic #dimm 0-1-1
278                                                         device i2c 53 on end
279                                                 end              
280                                                 chip drivers/generic/generic #dimm 1-0-0
281                                                         device i2c 54 on end
282                                                 end     
283                                                 chip drivers/generic/generic #dimm 1-0-1
284                                                         device i2c 55 on end
285                                                 end     
286                                                 chip drivers/generic/generic #dimm 1-1-0
287                                                         device i2c 56 on end
288                                                 end     
289                                                 chip drivers/generic/generic #dimm 1-1-1
290                                                         device i2c 57 on end
291                                                 end 
292                                         end # SM
293                                         device pci 1.1 on # SM 1
294 #PCI device smbus address will depend on addon pci device, do we need to scan_smbus_bus?
295 #                                                chip drivers/generic/generic #PCIXA Slot1
296 #                                                        device i2c 50 on end
297 #                                                end
298 #                                                chip drivers/generic/generic #PCIXB Slot1
299 #                                                        device i2c 51 on end
300 #                                                end     
301 #                                                chip drivers/generic/generic #PCIXB Slot2
302 #                                                        device i2c 52 on end
303 #                                                end             
304 #                                                chip drivers/generic/generic #PCI Slot1
305 #                                                        device i2c 53 on end
306 #                                                end              
307 #                                                chip drivers/generic/generic #Master MCP55 PCI-E
308 #                                                        device i2c 54 on end
309 #                                                end     
310 #                                                chip drivers/generic/generic #Slave MCP55 PCI-E
311 #                                                        device i2c 55 on end
312 #                                                end             
313                                                 chip drivers/generic/generic #MAC EEPROM
314                                                         device i2c 51 on end
315                                                 end 
316
317                                         end # SM 
318                                         device pci 2.0 on end # USB 1.1
319                                         device pci 2.1 on end # USB 2
320                                         device pci 4.0 on end # IDE
321                                         device pci 5.0 on end # SATA 0
322                                         device pci 5.1 on end # SATA 1
323                                         device pci 5.2 on end # SATA 2
324                                         device pci 6.0 on  # PCI
325                                                 chip drivers/pci/onboard
326                                                         device pci 6.0 on end
327                                                         register "rom_address" = "0xfff00000" #for 1M
328 #                                                        register "rom_address" = "0xfff80000" #for 512K
329                                                 end
330                                         end
331                                         device pci 6.1 on end # AZA
332                                         device pci 8.0 on end # NIC
333                                         device pci 9.0 on end # NIC
334                                         device pci a.0 on  # PCI E 5
335                                                 device pci 0.0 on #nec pci-x
336                                                 end
337                                                 device pci 0.1 on #nec pci-x
338                                                         device pci 4.0 on end #scsi
339                                                         device pci 4.1 on end #scsi
340                                                 end
341                                         end
342                                         device pci b.0 on end # PCI E 4
343                                         device pci c.0 on end # PCI E 3
344                                         device pci d.0 on end # PCI E 2
345                                         device pci e.0 on end # PCI E 1
346                                         device pci f.0 on end # PCI E 0
347                                         register "ide0_enable" = "1"
348                                         register "sata0_enable" = "1"
349                                         register "sata1_enable" = "1"
350                                         register "mac_eeprom_smbus" = "3" # 1: smbus under 2e.8, 2: SM0 3: SM1
351                                         register "mac_eeprom_addr" = "0x51"
352                                 end
353                         end #  device pci 18.0 
354                         device pci 18.1 on end
355                         device pci 18.2 on end
356                         device pci 18.3 on end
357                 end # mc0
358                 
359         end # PCI domain
360         
361 #       chip drivers/generic/debug 
362 #               device pnp 0.0 off end # chip name
363 #                device pnp 0.1 on end # pci_regs_all
364 #                device pnp 0.2 off end # mem
365 #                device pnp 0.3 off end # cpuid
366 #                device pnp 0.4 on end # smbus_regs_all
367 #                device pnp 0.5 off end # dual core msr
368 #                device pnp 0.6 off end # cache size
369 #                device pnp 0.7 off end # tsc
370 #                device pnp 0.8 off  end # io
371 #                device pnp 0.9 on end # io
372 #       end  
373 end #root_complex