4947698590fb98b8df381b9bd2e13115162ec8fe
[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 ###
19 ### Build options
20 ###
21
22 ##
23 ## Build code for the fallback boot
24 ##
25 option HAVE_FALLBACK_BOOT=1
26
27 ##
28 ## Build code to reset the motherboard from linuxBIOS
29 ##
30 option HAVE_HARD_RESET=1
31
32 ##
33 ## Build code to export a programmable irq routing table
34 ##
35 option HAVE_PIRQ_TABLE=1
36 option IRQ_SLOT_COUNT=7
37
38 ##
39 ## Build code to export an x86 MP table
40 ## Useful for specifying IRQ routing values
41 ##
42 option HAVE_MP_TABLE=1
43
44 ##
45 ## Build code to export a CMOS option table
46 ##
47 option HAVE_OPTION_TABLE=1
48
49 ##
50 ## Build code for SMP support
51 ## Only worry about 2 micro processors
52 ##
53 option CONFIG_SMP=1
54 option CONFIG_MAX_CPUS=2
55
56 ##
57 ## Build code to setup a generic IOAPIC
58 ##
59 option CONFIG_IOAPIC=1
60
61 ##
62 ## Clean up the motherboard id strings
63 ##
64 option MAINBOARD_PART_NUMBER="HDAMA"
65 option MAINBOARD_VENDOR="ARIMA"
66
67 ###
68 ### LinuxBIOS layout values
69 ###
70
71 ## ROM_SIZE is the size of boot ROM that this board will use.
72 option ROM_SIZE = 524288
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  -O ./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
226 northbridge amd/amdk8 "mc0"
227         #pci 0:18.0
228         #pci 0:18.0
229         #pci 0:18.0
230         #pci 0:18.1
231         #pci 0:18.2
232         #pci 0:18.3
233         southbridge amd/amd8131 "amd8131"
234                 #pci 0:0.0
235                 #pci 0:0.1
236                 #pci 0:1.0
237                 #pci 0:1.1
238         end
239         southbridge amd/amd8111 "amd8111"
240                 #pci 0:0.0
241                 #pci 0:1.0
242                 #pci 0:1.1
243                 #pci 0:1.2
244                 #pci 0:1.3
245                 #pci 0:1.5 off
246                 #pci 0:1.6 off
247                 superio NSC/pc87360
248                         #pnp 1:2e.0
249                         #pnp 1:2e.1
250                         #pnp 1:2e.2
251                         #pnp 1:2e.3
252                         #pnp 1:2e.4
253                         #pnp 1:2e.5
254                         #pnp 1:2e.6
255                         #pnp 1:2e.7
256                         #pnp 1:2e.8
257                         #pnp 1:2e.9
258                         #pnp 1:2e.a
259                         register "com1" = "{1, 0, 0x3f8, 4}"
260                         register "lpt" = "{1}"
261                 end
262         end
263 end
264
265 northbridge amd/amdk8 "mc1"
266         #pci 0:19.0
267         #pci 0:19.0
268         #pci 0:19.0
269         #pci 0:19.1
270         #pci 0:19.2
271         #pci 0:19.3
272 end
273
274 cpu k8 "cpu0"
275         register "up" = "{ .chip = &amd8131, .ht_width=16, .ht_speed=600 }"
276 end
277
278 cpu k8 "cpu1" 
279 end
280
281 ##
282 ## Include the old serial code for those few places that still need it.
283 ##
284 mainboardinit pc80/serial.inc
285 mainboardinit arch/i386/lib/console.inc
286