68a3f56788c406b160260818d918c494534f04bd
[coreboot.git] / src / mainboard / arima / hdama / Config.lb
1 ##
2 ## Compute the location and size of where this firmware image
3 ## (linuxBIOS plus bootloader) will live in the boot rom chip.
4 ##
5 if USE_FALLBACK_IMAGE
6         default ROM_SECTION_SIZE   = FALLBACK_SIZE
7         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
8 else
9         default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
10         default ROM_SECTION_OFFSET = 0
11 end
12
13 ##
14 ## Compute the start location and size size of
15 ## The linuxBIOS bootloader.
16 ##
17 default PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
18 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
19
20 ##
21 ## Compute where this copy of linuxBIOS will start in the boot rom
22 ##
23 default _ROMBASE      = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
24
25 ##
26 ## Compute a range of ROM that can cached to speed up linuxBIOS,
27 ## execution speed.
28 ##
29 ## XIP_ROM_SIZE must be a power of 2.
30 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
31 ##
32 default XIP_ROM_SIZE=131072
33 default XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
34
35 ##
36 ## Set all of the defaults for an x86 architecture
37 ##
38
39 arch i386 end
40
41 ##
42 ## Build the objects we have code for in this directory.
43 ##
44
45 driver mainboard.o
46 if HAVE_MP_TABLE object mptable.o end
47 if HAVE_PIRQ_TABLE object irq_tables.o end
48
49 if USE_DCACHE_RAM
50
51 if CONFIG_USE_INIT
52
53 makerule ./auto.o
54         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
55         action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o auto.o" 
56 end
57
58 else    
59                 
60 makerule ./auto.inc
61         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
62         action "$(CC) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -S -o $@"         
63         action "perl -e 's/.rodata/.rom.data/g' -pi $@"
64         action "perl -e 's/.text/.section .rom.text/g' -pi $@"
65 end
66
67 end
68 else
69 ##
70 ## Romcc output
71 ##
72 makerule ./failover.E
73         depends "$(MAINBOARD)/failover.c ./romcc"
74         action "./romcc -E -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/failover.c -o $@"
75 end
76
77 makerule ./failover.inc
78         depends "$(MAINBOARD)/failover.c ./romcc"
79         action "./romcc    -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/failover.c -o $@"
80 end
81
82 makerule ./auto.E
83         depends "$(MAINBOARD)/auto.c option_table.h ./romcc"
84         action  "./romcc -E -mcpu=k8 -O2 -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -o $@"
85 end
86 makerule ./auto.inc
87         depends "$(MAINBOARD)/auto.c option_table.h ./romcc"
88         action  "./romcc    -mcpu=k8 -O2 -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -o $@"
89 end
90
91 end
92
93 ##
94 ## Build our 16 bit and 32 bit linuxBIOS entry code
95 ##
96 if USE_FALLBACK_IMAGE
97         mainboardinit cpu/x86/16bit/entry16.inc
98         ldscript /cpu/x86/16bit/entry16.lds
99 end
100
101 mainboardinit cpu/x86/32bit/entry32.inc
102
103 if USE_DCACHE_RAM
104         if CONFIG_USE_INIT
105                 ldscript /cpu/x86/32bit/entry32.lds
106         end
107
108         if CONFIG_USE_INIT
109                 ldscript      /cpu/amd/car/cache_as_ram.lds
110         end
111 end
112
113 ##
114 ## Build our reset vector (This is where linuxBIOS is entered)
115 ##
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
124 if USE_DCACHE_RAM
125 else
126 ### Should this be in the northbridge code?
127 mainboardinit arch/i386/lib/cpu_reset.inc
128 end
129
130 ##
131 ## Include an id string (For safe flashing)
132 ##
133 mainboardinit arch/i386/lib/id.inc
134 ldscript /arch/i386/lib/id.lds
135
136 if USE_DCACHE_RAM
137 ##
138 ## Setup Cache-As-Ram
139 ##
140 mainboardinit cpu/amd/car/cache_as_ram.inc
141 end
142
143 ###
144 ### This is the early phase of linuxBIOS startup 
145 ### Things are delicate and we test to see if we should
146 ### failover to another image.
147 ###
148 if USE_FALLBACK_IMAGE
149 if USE_DCACHE_RAM
150        ldscript /arch/i386/lib/failover.lds
151 else
152        ldscript /arch/i386/lib/failover.lds
153         mainboardinit ./failover.inc
154 end
155 end
156
157 ###
158 ### O.k. We aren't just an intermediary anymore!
159 ###
160
161 ##
162 ## Setup RAM
163 ##
164 if USE_DCACHE_RAM
165
166 if CONFIG_USE_INIT
167 initobject auto.o
168 else
169 mainboardinit ./auto.inc
170 end
171
172 else
173
174 ##
175 ## Setup RAM
176 ##
177 mainboardinit cpu/x86/fpu/enable_fpu.inc
178 mainboardinit cpu/x86/mmx/enable_mmx.inc
179 mainboardinit cpu/x86/sse/enable_sse.inc
180 mainboardinit ./auto.inc
181 mainboardinit cpu/x86/sse/disable_sse.inc
182 mainboardinit cpu/x86/mmx/disable_mmx.inc
183 end
184
185 ##
186 ## Include the secondary Configuration files 
187 ##
188 config chip.h
189
190 # config for arima/hdama
191 chip northbridge/amd/amdk8/root_complex
192         device apic_cluster 0 on
193                 chip cpu/amd/socket_940
194                         device apic 0 on end
195                 end
196         end
197         device pci_domain 0 on
198                 chip northbridge/amd/amdk8
199                         device pci 18.0 on #  northbridge 
200                                 #  devices on link 0, link 0 == LDT 0 
201                                 chip southbridge/amd/amd8131
202                                         # the on/off keyword is mandatory
203                                         device pci 0.0 on       # PCIX bridge
204                                                 ## On board NIC A
205                                                 #chip drivers/generic/generic
206                                                 #       device pci 3.0 on       
207                                                 #               irq 0 = 0x13
208                                                 #       end
209                                                 #end
210                                                 ## On board NIC B
211                                                 #chip drivers/generic/generic
212                                                 #       device pci 4.0 on
213                                                 #               irq 0 = 0x13
214                                                 #       end
215                                                 #end
216                                                 ## PCI Slot 3
217                                                 #chip drivers/generic/generic
218                                                 #       device pci 1.0 on
219                                                 #               irq 0 = 0x11
220                                                 #               irq 1 = 0x12
221                                                 #               irq 2 = 0x13
222                                                 #               irq 3 = 0x10
223                                                 #       end
224                                                 #end 
225                                                 ## PCI Slot 4
226                                                 #chip drivers/generic/generic
227                                                 #       device pci 2.0 on
228                                                 #               irq 0 = 0x12
229                                                 #               irq 1 = 0x13
230                                                 #               irq 2 = 0x10
231                                                 #               irq 3 = 0x11
232                                                 #       end
233                                                 #end 
234                                         end
235                                         device pci 0.1 on end   # IOAPIC
236                                         device pci 1.0 on       # PCIX bridge
237                                                 ## PCI Slot 1
238                                                 #chip drivers/generic/generic
239                                                 #       device pci 1.0 on
240                                                 #               irq 0 = 0x11
241                                                 #               irq 1 = 0x12
242                                                 #               irq 2 = 0x13
243                                                 #               irq 3 = 0x10
244                                                 #       end
245                                                 #end
246                                                 ## PCI Slot 2
247                                                 #chip drivers/generic/generic
248                                                 #       device pci 2.0 on
249                                                 #               irq 0 = 0x12
250                                                 #               irq 1 = 0x13
251                                                 #               irq 2 = 0x10
252                                                 #               irq 3 = 0x11
253                                                 #       end
254                                                 #end 
255                                         end
256                                         device pci 1.1 on end   # IOAPIC
257                                 end
258                                 chip southbridge/amd/amd8111
259                                         # this "device pci 0.0" is the parent of the next one
260                                         # PCI bridge
261                                         device pci 0.0 on
262                                                 device pci 0.0 on  end  # USB0
263                                                 device pci 0.1 on  end  # USB1
264                                                 device pci 0.2 off end  # USB 2.0
265                                                 device pci 1.0 off end  # LAN
266                                                 chip drivers/pci/onboard
267                                                         device pci 6.0 on end # ATI Rage XL
268                                                         register "rom_address" = "0xfff80000"
269                                                 end
270                                                 ## PCI Slot 5 (correct?)
271                                                 #chip drivers/generic/generic
272                                                 #       device pci 5.0 on
273                                                 #               irq 0 = 0x11
274                                                 #               irq 1 = 0x12
275                                                 #               irq 2 = 0x13
276                                                 #               irq 3 = 0x10
277                                                 #       end
278                                                 #end 
279                                                 ## PCI Slot 6 (correct?)
280                                                 #chip drivers/generic/generic
281                                                 #       device pci 4.0 on
282                                                 #               irq 0 = 0x10
283                                                 #               irq 1 = 0x11
284                                                 #               irq 2 = 0x12
285                                                 #               irq 3 = 0x13
286                                                 #       end
287                                                 #end 
288
289                                         end
290                                         # LPC bridge
291                                         device pci 1.0 on
292                                                 chip superio/nsc/pc87360
293                                                         device  pnp 2e.0 off  # Floppy 
294                                                                  io 0x60 = 0x3f0
295                                                                 irq 0x70 = 6
296                                                                 drq 0x74 = 2
297                                                         end
298                                                         device pnp 2e.1 off  # Parallel Port
299                                                                  io 0x60 = 0x378
300                                                                 irq 0x70 = 7
301                                                         end
302                                                         device pnp 2e.2 off # Com 2
303                                                                  io 0x60 = 0x2f8
304                                                                 irq 0x70 = 3
305                                                         end
306                                                         device pnp 2e.3 on  # Com 1
307                                                                  io 0x60 = 0x3f8
308                                                                 irq 0x70 = 4
309                                                         end
310                                                         device pnp 2e.4 off end # SWC
311                                                         device pnp 2e.5 off end # Mouse
312                                                         device pnp 2e.6 on  # Keyboard
313                                                                  io 0x60 = 0x60
314                                                                  io 0x62 = 0x64
315                                                                 irq 0x70 = 1
316                                                         end
317                                                         device pnp 2e.7 off end # GPIO
318                                                         device pnp 2e.8 off end # ACB
319                                                         device pnp 2e.9 off end # FSCM
320                                                         device pnp 2e.a off end # WDT  
321                                                 end
322                                         end
323                                         device pci 1.1 on end   # IDE
324                                         device pci 1.2 on end   # SMBus 2.0
325                                         device pci 1.3 on       # System Management
326                                                 chip drivers/generic/generic
327                                                         #phillips pca9545 smbus mux
328                                                         device i2c 70 on 
329                                                                 # analog_devices adm1026        
330                                                                 chip drivers/generic/generic
331                                                                         device i2c 2c on end
332                                                                 end
333                                                         end
334                                                         device i2c 70 on end
335                                                         device i2c 70 on end
336                                                         device i2c 70 on end
337                                                 end
338                                                 chip drivers/generic/generic #dimm 0-0-0
339                                                         device i2c 50 on end
340                                                 end
341                                                 chip drivers/generic/generic #dimm 0-0-1
342                                                         device i2c 51 on end
343                                                 end 
344                                                 chip drivers/generic/generic #dimm 0-1-0
345                                                         device i2c 52 on end
346                                                 end 
347                                                 chip drivers/generic/generic #dimm 0-1-1
348                                                         device i2c 53 on end
349                                                 end 
350                                                 chip drivers/generic/generic #dimm 1-0-0
351                                                         device i2c 54 on end 
352                                                 end
353                                                 chip drivers/generic/generic #dimm 1-0-1
354                                                         device i2c 55 on end
355                                                 end 
356                                                 chip drivers/generic/generic #dimm 1-1-0
357                                                         device i2c 56 on end
358                                                 end 
359                                                 chip drivers/generic/generic #dimm 1-1-1
360                                                         device i2c 57 on end
361                                                 end 
362                                         end
363                                         device pci 1.5 off end  # AC97 Audio
364                                         device pci 1.6 on  end  # AC97 Modem
365                                         register "ide0_enable" = "1"
366                                         register "ide1_enable" = "1"
367                                 end
368                         end #  device pci 18.0 
369                         
370                         device pci 18.0 on end # LDT1
371                         device pci 18.0 on end # LDT2
372                         device pci 18.1 on end
373                         device pci 18.2 on end
374                         device pci 18.3 on end
375                 end  # chip northbridge/amd/amdk8
376                 chip northbridge/amd/amdk8
377                         device pci 19.0 on end
378                         device pci 19.0 on end
379                         device pci 19.0 on end
380                         device pci 19.1 on end
381                         device pci 19.2 on end
382                         device pci 19.3 on end
383                 end
384         end 
385 end
386