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