20667f5db4893c89d18af7627fcb1e96386472eb
[coreboot.git] / src / mainboard / amd / quartet / Config.lb
1 uses HAVE_MP_TABLE
2 uses HAVE_PIRQ_TABLE
3 uses USE_FALLBACK_IMAGE
4 uses HAVE_FALLBACK_BOOT
5 uses HAVE_HARD_RESET
6 uses HARD_RESET_BUS
7 uses HARD_RESET_DEVICE
8 uses HARD_RESET_FUNCTION
9 uses IRQ_SLOT_COUNT
10 uses HAVE_OPTION_TABLE
11 uses CONFIG_MAX_CPUS
12 uses CONFIG_IOAPIC
13 uses CONFIG_SMP
14 uses FALLBACK_SIZE
15 uses ROM_SIZE
16 uses ROM_SECTION_SIZE
17 uses ROM_IMAGE_SIZE
18 uses ROM_SECTION_SIZE
19 uses ROM_SECTION_OFFSET
20 uses CONFIG_ROM_STREAM
21 uses CONFIG_ROM_STREAM_START
22 uses PAYLOAD_SIZE
23 uses _ROMBASE
24 uses XIP_ROM_SIZE
25 uses XIP_ROM_BASE
26 uses STACK_SIZE
27 uses HEAP_SIZE
28 uses USE_OPTION_TABLE
29 uses LB_CKS_RANGE_START
30 uses LB_CKS_RANGE_END
31 uses LB_CKS_LOC
32 uses MAINBOARD_PART_NUMBER
33 uses MAINBOARD_VENDOR
34
35
36 ## ROM_SIZE is the size of boot ROM that this board will use.
37 default ROM_SIZE=524288
38
39 ###
40 ### Build options
41 ###
42
43 ##
44 ## Build code for the fallback boot
45 ##
46 default HAVE_FALLBACK_BOOT=1
47
48 ##
49 ## Build code to reset the motherboard from linuxBIOS
50 ##
51 default HAVE_HARD_RESET=1
52
53 default HARD_RESET_BUS=1
54 default HARD_RESET_DEVICE=4
55 default HARD_RESET_FUNCTION=0
56
57 ##
58 ## Build code to export a programmable irq routing table
59 ##
60 default HAVE_PIRQ_TABLE=1
61 default IRQ_SLOT_COUNT=9
62
63 ##
64 ## Build code to export an x86 MP table
65 ## Useful for specifying IRQ routing values
66 ##
67 default HAVE_MP_TABLE=1
68
69 ##
70 ## Build code to export a CMOS option table
71 ##
72 default HAVE_OPTION_TABLE=1
73
74 ##
75 ## Move the default LinuxBIOS cmos range off of AMD RTC registers
76 ##
77 default LB_CKS_RANGE_START=49
78 default LB_CKS_RANGE_END=122
79 default LB_CKS_LOC=123
80
81 ##
82 ## Build code for SMP support
83 ## Only worry about 2 micro processors
84 ##
85 default CONFIG_SMP=1
86 default CONFIG_MAX_CPUS=4
87
88 ##
89 ## Build code to setup a generic IOAPIC
90 ##
91 default CONFIG_IOAPIC=1
92
93 ##
94 ## Clean up the motherboard id strings
95 ##
96 default MAINBOARD_PART_NUMBER="QUARTET"
97 default MAINBOARD_VENDOR="AMD"
98
99 ###
100 ### LinuxBIOS layout values
101 ###
102
103 ## ROM_IMAGE_SIZE is the amount of space to allow linuxBIOS to occupy.
104 default ROM_IMAGE_SIZE = 65536
105
106 ##
107 ## Use a small 8K stack
108 ##
109 default STACK_SIZE=0x2000
110
111 ##
112 ## Use a small 16K heap
113 ##
114 default HEAP_SIZE=0x4000
115
116 ##
117 ## Only use the option table in a normal image
118 ##
119 default USE_OPTION_TABLE = !USE_FALLBACK_IMAGE
120
121 ##
122 ## Compute the location and size of where this firmware image
123 ## (linuxBIOS plus bootloader) will live in the boot rom chip.
124 ##
125 if USE_FALLBACK_IMAGE
126         default ROM_SECTION_SIZE   = FALLBACK_SIZE
127         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
128 else
129         default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
130         default ROM_SECTION_OFFSET = 0
131 end
132
133 ##
134 ## Compute the start location and size size of
135 ## The linuxBIOS bootloader.
136 ##
137 default PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
138 default CONFIG_ROM_STREAM_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
139 default CONFIG_ROM_STREAM     = 1
140
141 ##
142 ## Compute where this copy of linuxBIOS will start in the boot rom
143 ##
144 default _ROMBASE      = ( CONFIG_ROM_STREAM_START + PAYLOAD_SIZE )
145
146 ##
147 ## Compute a range of ROM that can cached to speed up linuxBIOS,
148 ## execution speed.
149 ##
150 ## XIP_ROM_SIZE must be a power of 2.
151 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
152 ##
153 default XIP_ROM_SIZE=65536
154 default XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
155
156 ##
157 ## Set all of the defaults for an x86 architecture
158 ##
159
160 arch i386 end
161 #cpu k8 end
162
163 ##
164 ## Build the objects we have code for in this directory.
165 ##
166
167 driver mainboard.o
168 if HAVE_MP_TABLE object mptable.o end
169 if HAVE_PIRQ_TABLE object irq_tables.o end
170
171 ##
172 ## Romcc output
173 ##
174 makerule ./failover.E
175         depends "$(MAINBOARD)/failover.c" 
176         action "$(CPP) -I$(TOP)/src $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/failover.c > ./failover.E"
177 end
178
179 makerule ./failover.inc
180         depends "./failover.E ./romcc"
181         action "./romcc -O -o failover.inc --label-prefix=failover ./failover.E"
182 end
183
184 makerule ./auto.E 
185         depends "$(MAINBOARD)/auto.c option_table.h" 
186         action  "$(CPP) -I$(TOP)/src -I. $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/auto.c > ./auto.E"
187 end
188 makerule ./auto.inc 
189         depends "./auto.E ./romcc"
190         action  "./romcc -mcpu=k8 -O2 ./auto.E > auto.inc"
191 end
192
193 ##
194 ## Build our 16 bit and 32 bit linuxBIOS entry code
195 ##
196 mainboardinit cpu/i386/entry16.inc
197 mainboardinit cpu/i386/entry32.inc
198 mainboardinit cpu/i386/bist32.inc
199 ldscript /cpu/i386/entry16.lds
200 ldscript /cpu/i386/entry32.lds
201
202 ##
203 ## Build our reset vector (This is where linuxBIOS is entered)
204 ##
205 if USE_FALLBACK_IMAGE 
206         mainboardinit cpu/i386/reset16.inc 
207         ldscript /cpu/i386/reset16.lds 
208 else
209         mainboardinit cpu/i386/reset32.inc 
210         ldscript /cpu/i386/reset32.lds 
211 end
212
213 ### Should this be in the northbridge code?
214 mainboardinit arch/i386/lib/cpu_reset.inc
215
216 ##
217 ## Include an id string (For safe flashing)
218 ##
219 mainboardinit arch/i386/lib/id.inc
220 ldscript /arch/i386/lib/id.lds
221
222 ##
223 ## Setup our mtrrs
224 ##
225 mainboardinit cpu/k8/earlymtrr.inc
226
227 ###
228 ### This is the early phase of linuxBIOS startup 
229 ### Things are delicate and we test to see if we should
230 ### failover to another image.
231 ###
232 if USE_FALLBACK_IMAGE
233         ldscript /arch/i386/lib/failover.lds 
234         mainboardinit ./failover.inc
235 end
236
237 ###
238 ### O.k. We aren't just an intermediary anymore!
239 ###
240
241 ##
242 ## Setup RAM
243 ##
244 mainboardinit cpu/k8/enable_mmx_sse.inc
245 mainboardinit ./auto.inc
246 mainboardinit cpu/k8/disable_mmx_sse.inc
247
248 ##
249 ## Include the secondary Configuration files 
250 ##
251 dir /pc80
252 config chip.h
253
254 northbridge amd/amdk8 "mc0"
255         pci 0:18.0
256         pci 0:18.0
257         pci 0:18.0
258         pci 0:18.1
259         pci 0:18.2
260         pci 0:18.3
261         southbridge amd/amd8111 "amd8111" link 2
262                 pci 0:0.0
263                 pci 0:1.0 on
264                 pci 0:1.1 on
265                 pci 0:1.2 on
266                 pci 0:1.3 on
267                 pci 0:1.5 on
268                 pci 0:1.6 on
269                 pci 1:0.0 on
270                 pci 1:0.1 on
271                 pci 1:0.2 on
272                 pci 1:1.0 on
273                 superio NSC/pc87360 link 1
274                         pnp 2e.0 off  # Floppy 
275                                  io 0x60 = 0x3f0
276                                 irq 0x70 = 6
277                                 drq 0x74 = 2
278                         pnp 2e.1 off  # Parallel Port
279                                  io 0x60 = 0x378
280                                 irq 0x70 = 7
281                         pnp 2e.2 off # Com 2
282                                  io 0x60 = 0x2f8
283                                 irq 0x70 = 3
284                         pnp 2e.3 on  # Com 1
285                                  io 0x60 = 0x3f8
286                                 irq 0x70 = 4
287                         pnp 2e.4 off # SWC
288                         pnp 2e.5 off # Mouse
289                         pnp 2e.6 on  # Keyboard
290                                  io 0x60 = 0x60
291                                  io 0x62 = 0x64
292                                 irq 0x70 = 1
293                         pnp 2e.7 off # GPIO
294                         pnp 2e.8 off # ACB
295                         pnp 2e.9 off # FSCM
296                         pnp 2e.a off # WDT  
297                 end
298         end
299 end
300
301 northbridge amd/amdk8 "mc1"
302         pci 0:19.0
303         pci 0:19.0
304         pci 0:19.0
305         pci 0:19.1
306         pci 0:19.2
307         pci 0:19.3
308         southbridge amd/amd8131 "amd8131_0" link 1
309                 pci 0:0.0
310                 pci 0:0.1
311                 pci 0:1.0
312                 pci 0:1.1
313         end
314         southbridge amd/amd8131 "amd8131_1" link 1
315                 pci 0:0.0
316                 pci 0:0.1
317                 pci 0:1.0
318                 pci 0:1.1
319         end
320 end
321
322 northbridge amd/amdk8 "mc2"
323         pci 0:1a.0
324         pci 0:1a.0
325         pci 0:1a.0
326         pci 0:1a.1
327         pci 0:1a.2
328         pci 0:1a.3
329 end
330
331 northbridge amd/amdk8 "mc3"
332         pci 0:1b.0
333         pci 0:1b.0
334         pci 0:1b.0
335         pci 0:1b.1
336         pci 0:1b.2
337         pci 0:1b.3
338 end
339
340 cpu k8 "cpu0"
341 end
342
343 cpu k8 "cpu1" 
344 end
345
346 cpu k8 "cpu2" 
347 end
348
349 cpu k8 "cpu3" 
350 end
351
352 ##
353 ## Include the old serial code for those few places that still need it.
354 ##
355 mainboardinit pc80/serial.inc
356 mainboardinit arch/i386/lib/console.inc
357 mainboardinit cpu/i386/bist32_fail.inc
358