drop duplicate compiler options that are already mentioned in CFLAGS.
[coreboot.git] / src / mainboard / amd / serengeti_cheetah / Config.lb
1 include /config/failovercalculation.lb
2
3 arch i386 end 
4
5 ##
6 ## Build the objects we have code for in this directory.
7 ##
8
9 driver mainboard.o
10
11 #dir /drivers/si/3114
12
13 #needed by irq_tables and mptable and acpi_tables
14 object get_bus_conf.o
15
16 if HAVE_MP_TABLE 
17         object mptable.o 
18 end
19
20 if HAVE_PIRQ_TABLE 
21         object irq_tables.o 
22 end
23
24 #if HAVE_ACPI_TABLES
25 #       object acpi_tables.o
26 #       object fadt.o
27 #       if SB_HT_CHAIN_ON_BUS0
28 #               object dsdt_bus0.o
29 #       else
30 #               object dsdt.o
31 #       end
32 #       object ssdt.o
33 #       if ACPI_SSDTX_NUM
34 #                if SB_HT_CHAIN_ON_BUS0
35 #                 object ssdt2_bus0.o
36 #                else
37 #                 object ssdt2.o
38 #                end
39 #       end
40 #end
41
42 if HAVE_ACPI_TABLES
43         object acpi_tables.o
44         object fadt.o
45         makerule dsdt.c
46                 depends "$(MAINBOARD)/dx/dsdt_lb.dsl"
47                 action  "iasl -p $(PWD)/dsdt_lb -tc $(MAINBOARD)/dx/dsdt_lb.dsl"
48                 action  "mv dsdt_lb.hex dsdt.c"
49         end
50         object ./dsdt.o
51
52         #./ssdt.o is moved to northbridge/amd/amdk8/Config.lb
53         
54         if ACPI_SSDTX_NUM
55             makerule ssdt2.c
56                         depends "$(MAINBOARD)/dx/pci2.asl"
57                         action  "iasl -p $(PWD)/pci2 -tc $(MAINBOARD)/dx/pci2.asl"
58                         action  "perl -pi -e 's/AmlCode/AmlCode_ssdt2/g' pci2.hex"
59                         action  "mv pci2.hex ssdt2.c"
60             end
61             object ./ssdt2.o
62             makerule ssdt3.c
63                         depends "$(MAINBOARD)/dx/pci3.asl"
64                         action  "iasl -p $(PWD)/pci3 -tc $(MAINBOARD)/dx/pci3.asl"
65                         action  "perl -pi -e 's/AmlCode/AmlCode_ssdt3/g' pci3.hex"
66                         action  "mv pci3.hex ssdt3.c"
67             end
68             object ./ssdt3.o
69             makerule ssdt4.c
70                         depends "$(MAINBOARD)/dx/pci4.asl"
71                         action  "iasl -p $(PWD)/pci4 -tc $(MAINBOARD)/dx/pci4.asl"
72                         action  "perl -pi -e 's/AmlCode/AmlCode_ssdt4/g' pci4.hex"
73                         action  "mv pci4.hex ssdt4.c"
74             end
75             object ./ssdt4.o
76         end
77 end
78
79         if CONFIG_USE_INIT
80                 # compile cache_as_ram.c to auto.o
81                 makerule ./cache_as_ram_auto.o
82                         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
83                         action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -c $(MAINBOARD)/cache_as_ram_auto.c -o $@"
84                 end
85
86         else   
87                 #compile cache_as_ram.c to auto.inc 
88                 makerule ./cache_as_ram_auto.inc
89                         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
90                         action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(TOP)/src -I. -c -S $(MAINBOARD)/cache_as_ram_auto.c -o $@"
91                         action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
92                         action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
93                 end
94         end
95
96 if USE_FAILOVER_IMAGE
97 else
98     if CONFIG_AP_CODE_IN_CAR
99         makerule ./apc_auto.o
100                 depends "$(MAINBOARD)/apc_auto.c option_table.h"
101                 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -c $(MAINBOARD)/apc_auto.c -o $@"
102         end
103         ldscript /arch/i386/init/ldscript_apc.lb
104     end
105 end
106
107 ##
108 ## Build our 16 bit and 32 bit coreboot entry code
109 ##
110
111 if HAVE_FAILOVER_BOOT
112     if USE_FAILOVER_IMAGE
113         mainboardinit cpu/x86/16bit/entry16.inc
114         ldscript /cpu/x86/16bit/entry16.lds
115     end
116 else
117     if USE_FALLBACK_IMAGE
118         mainboardinit cpu/x86/16bit/entry16.inc
119         ldscript /cpu/x86/16bit/entry16.lds
120     end
121 end
122
123 mainboardinit cpu/x86/32bit/entry32.inc
124         if CONFIG_USE_INIT
125                 ldscript /cpu/x86/32bit/entry32.lds
126         end
127
128         if CONFIG_USE_INIT
129                 ldscript /cpu/amd/car/cache_as_ram.lds
130         end
131
132 ##
133 ## Build our reset vector (This is where coreboot is entered)
134 ##
135 if HAVE_FAILOVER_BOOT
136     if USE_FAILOVER_IMAGE 
137         mainboardinit cpu/x86/16bit/reset16.inc 
138         ldscript /cpu/x86/16bit/reset16.lds 
139     else
140         mainboardinit cpu/x86/32bit/reset32.inc 
141         ldscript /cpu/x86/32bit/reset32.lds 
142     end
143 else
144     if USE_FALLBACK_IMAGE 
145         mainboardinit cpu/x86/16bit/reset16.inc 
146         ldscript /cpu/x86/16bit/reset16.lds 
147     else
148         mainboardinit cpu/x86/32bit/reset32.inc 
149         ldscript /cpu/x86/32bit/reset32.lds 
150     end
151 end
152
153 ##
154 ## Include an id string (For safe flashing)
155 ##
156 mainboardinit arch/i386/lib/id.inc
157 ldscript /arch/i386/lib/id.lds
158
159         ##
160         ## Setup Cache-As-Ram
161         ##
162         mainboardinit cpu/amd/car/cache_as_ram.inc
163
164 ###
165 ### This is the early phase of coreboot startup 
166 ### Things are delicate and we test to see if we should
167 ### failover to another image.
168 ###
169 if HAVE_FAILOVER_BOOT
170     if USE_FAILOVER_IMAGE
171                 ldscript /arch/i386/lib/failover_failover.lds
172     end
173 else
174     if USE_FALLBACK_IMAGE
175                 ldscript /arch/i386/lib/failover.lds
176     end
177 end
178
179 ###
180 ### O.k. We aren't just an intermediary anymore!
181 ###
182
183 ##
184 ## Setup RAM
185 ##
186         if CONFIG_USE_INIT
187                 initobject cache_as_ram_auto.o
188         else
189                 mainboardinit ./cache_as_ram_auto.inc
190         end
191
192 ##
193 ## Include the secondary Configuration files 
194 ##
195 config chip.h
196
197 # sample config for amd/serengeti_cheetah 
198 chip northbridge/amd/amdk8/root_complex
199         device apic_cluster 0 on
200                 chip cpu/amd/socket_F
201                         device apic 0 on end
202                 end
203         end
204         device pci_domain 0 on
205                 chip northbridge/amd/amdk8
206                         device pci 18.0 on #  northbridge 
207                                 #  devices on link 0, link 0 == LDT 0
208                                 chip southbridge/amd/amd8132
209                                         # the on/off keyword is mandatory
210                                         device pci 0.0 on end
211                                         device pci 0.1 on end
212                                         device pci 1.0 on end
213                                         device pci 1.1 on end
214                                 end
215                                 chip southbridge/amd/amd8111
216                                         # this "device pci 0.0" is the parent the next one
217                                         # PCI bridge
218                                         device pci 0.0 on
219                                                 device pci 0.0 on end
220                                                 device pci 0.1 on end
221                                                 device pci 0.2 off end
222                                                 device pci 1.0 off end
223                                         end
224                                         device pci 1.0 on
225                                                 chip superio/winbond/w83627hf
226                                                         device pnp 2e.0 off #  Floppy
227                                                                 io 0x60 = 0x3f0
228                                                                 irq 0x70 = 6
229                                                                 drq 0x74 = 2
230                                                         end
231                                                         device pnp 2e.1 off #  Parallel Port
232                                                                 io 0x60 = 0x378
233                                                                 irq 0x70 = 7
234                                                         end
235                                                         device pnp 2e.2 on #  Com1
236                                                                 io 0x60 = 0x3f8
237                                                                 irq 0x70 = 4
238                                                         end
239                                                         device pnp 2e.3 off #  Com2
240                                                                 io 0x60 = 0x2f8
241                                                                 irq 0x70 = 3
242                                                         end
243                                                         device pnp 2e.5 on #  Keyboard
244                                                                 io 0x60 = 0x60
245                                                                 io 0x62 = 0x64
246                                                                 irq 0x70 = 1
247                                                                 irq 0x72 = 12
248                                                         end
249                                                         device pnp 2e.6 off #  CIR
250                                                                 io 0x60 = 0x100
251                                                         end
252                                                         device pnp 2e.7 off #  GAME_MIDI_GIPO1
253                                                                 io 0x60 = 0x220
254                                                                 io 0x62 = 0x300
255                                                                 irq 0x70 = 9
256                                                         end                                             
257                                                         device pnp 2e.8 off end #  GPIO2
258                                                         device pnp 2e.9 off end #  GPIO3
259                                                         device pnp 2e.a off end #  ACPI
260                                                         device pnp 2e.b on #  HW Monitor
261                                                                 io 0x60 = 0x290
262                                                                 irq 0x70 = 5
263                                                         end
264                                                 end
265                                         end
266                                         device pci 1.1 on end
267                                         device pci 1.2 on end
268                                         device pci 1.3 on
269                                                 chip drivers/i2c/i2cmux # pca9556 smbus mux
270                                                         device i2c 18 on #0 pca9516 1
271                                                                 chip drivers/generic/generic #dimm 0-0-0
272                                                                         device i2c 50 on end
273                                                                 end
274                                                                 chip drivers/generic/generic #dimm 0-0-1
275                                                                         device i2c 51 on end
276                                                                 end
277                                                                 chip drivers/generic/generic #dimm 0-1-0
278                                                                         device i2c 52 on end
279                                                                 end
280                                                                 chip drivers/generic/generic #dimm 0-1-1
281                                                                         device i2c 53 on end
282                                                                 end
283                                                         end
284                                                         device i2c 18 on #1 pca9516 2
285                                                                 chip drivers/generic/generic #dimm 1-0-0
286                                                                         device i2c 50 on end
287                                                                 end
288                                                                 chip drivers/generic/generic #dimm 1-0-1
289                                                                         device i2c 51 on end
290                                                                 end
291                                                                 chip drivers/generic/generic #dimm 1-1-0
292                                                                         device i2c 52 on end
293                                                                 end
294                                                                 chip drivers/generic/generic #dimm 1-1-1
295                                                                         device i2c 53 on end
296                                                                 end
297                                                                 chip drivers/generic/generic #dimm 1-2-0
298                                                                         device i2c 54 on end
299                                                                 end
300                                                                 chip drivers/generic/generic #dimm 1-2-1
301                                                                         device i2c 55 on end
302                                                                 end
303                                                                 chip drivers/generic/generic #dimm 1-3-0
304                                                                         device i2c 56 on end
305                                                                 end
306                                                                 chip drivers/generic/generic #dimm 1-3-1
307                                                                         device i2c 57 on end
308                                                                 end
309                                                         end
310                                                 end
311                                         end # acpi
312                                         device pci 1.5 off end
313                                         device pci 1.6 off end
314                                         register "ide0_enable" = "1"
315                                         register "ide1_enable" = "1"
316                                 end
317                         end #  device pci 18.0
318
319                         device pci 18.0 on end
320                         device pci 18.0 on end  
321                         device pci 18.1 on end
322                         device pci 18.2 on end
323                         device pci 18.3 on end
324                 end
325                 chip northbridge/amd/amdk8
326                         device pci 19.0 on #  northbridge
327                                 chip southbridge/amd/amd8151
328                                         # the on/off keyword is mandatory
329                                         device pci 0.0 on end
330                                         device pci 1.0 on end
331                                 end
332                         end #  device pci 19.0
333
334                         device pci 19.0 on end
335                         device pci 19.0 on end
336                         device pci 19.1 on end
337                         device pci 19.2 on end
338                         device pci 19.3 on end
339                 end
340
341
342         end #pci_domain
343 #        chip drivers/generic/debug
344 #               device pnp 0.0 off end # chip name
345 #                device pnp 0.1 on end # pci_regs_all
346 #                device pnp 0.2 off end # mem
347 #                device pnp 0.3 off end # cpuid
348 #                device pnp 0.4 off end # smbus_regs_all
349 #                device pnp 0.5 off end # dual core msr
350 #                device pnp 0.6 off end # cache size
351 #                device pnp 0.7 off end # tsc
352 #       end
353
354 end
355
356