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