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