833478bb79e8307878b85fdd87bf87fde168f6fa
[coreboot.git] / src / mainboard / kontron / 986lcd-m / Config.lb
1 ##
2 ## This file is part of the coreboot project.
3 ## 
4 ## Copyright (C) 2007-2008 coresystems GmbH
5 ##
6 ## This program is free software; you can redistribute it and/or
7 ## modify it under the terms of the GNU General Public License as
8 ## published by the Free Software Foundation; version 2 of
9 ## the License.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 ## MA 02110-1301 USA
20 ##
21
22 ##
23 ## This mainboard requires DCACHE_AS_RAM enabled. It won't work without.
24 ## 
25
26 ##
27 ## Only use the option table in a normal image
28 ##
29 default USE_OPTION_TABLE = !USE_FALLBACK_IMAGE
30
31 ##
32 ## Compute the location and size of where this firmware image
33 ## (coreboot plus bootloader) will live in the boot rom chip.
34 ##
35 if USE_FALLBACK_IMAGE
36         default ROM_SECTION_SIZE   = FALLBACK_SIZE
37         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
38 else
39         default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
40         default ROM_SECTION_OFFSET = 0
41 end
42
43 ##
44 ## Compute the start location and size size of
45 ## The coreboot bootloader.
46 ##
47 default PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
48 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
49
50 ##
51 ## Compute where this copy of coreboot will start in the boot rom
52 ##
53 default _ROMBASE      = ( CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE )
54
55 ##
56 ## Compute a range of ROM that can cached to speed up coreboot,
57 ## execution speed.
58 ##
59 ## XIP_ROM_SIZE must be a power of 2.
60 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
61 ##
62 default XIP_ROM_SIZE=(64*1024)
63 default XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
64
65 ##
66 ## Set all of the defaults for an x86 architecture
67 ##
68
69 arch i386 end
70
71 ##
72 ## Build the objects we have code for in this directory.
73 ##
74
75 driver mainboard.o
76 driver rtl8168.o
77 if HAVE_MP_TABLE object mptable.o end
78 if HAVE_PIRQ_TABLE object irq_tables.o end
79
80 if HAVE_ACPI_TABLES
81         object fadt.o
82         object acpi_tables.o
83         makerule dsdt.c
84                 depends "$(MAINBOARD)/dsdt.dsl"
85                 action  "iasl -p dsdt -tc $(MAINBOARD)/dsdt.dsl"
86                 action  "mv $(PWD)/dsdt.hex dsdt.c"
87         end
88         object ./dsdt.o
89 end
90
91 object reset.o
92
93 if CONFIG_USE_INIT
94
95 makerule ./auto.o
96         depends "$(MAINBOARD)/auto.c option_table.h"
97         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o auto.o"
98 end
99
100 else
101
102 makerule ./auto.inc
103         depends "$(MAINBOARD)/auto.c option_table.h"
104         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I.  $(CPPFLAGS) $(MAINBOARD)/auto.c -Os -nostdinc -nostdlib -fno-builtin $(DEBUG_CFLAGS) -Wall -c -S -o $@"
105         action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
106         action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
107 end
108
109 end
110
111 ##
112 ## Build our 16 bit and 32 bit coreboot entry code
113 ##
114 mainboardinit cpu/x86/16bit/entry16.inc
115 mainboardinit cpu/x86/32bit/entry32.inc
116 ldscript /cpu/x86/16bit/entry16.lds
117 if CONFIG_USE_INIT
118         ldscript /cpu/x86/32bit/entry32.lds
119         ldscript /cpu/x86/car/cache_as_ram.lds
120 end
121
122 ##
123 ## Build our reset vector (This is where coreboot is entered)
124 ##
125 if USE_FALLBACK_IMAGE 
126         mainboardinit cpu/x86/16bit/reset16.inc
127         ldscript /cpu/x86/16bit/reset16.lds
128 else
129         mainboardinit cpu/x86/32bit/reset32.inc
130         ldscript /cpu/x86/32bit/reset32.lds
131 end
132
133
134 ##
135 ## Include an id string (For safe flashing)
136 ##
137 mainboardinit arch/i386/lib/id.inc
138 ldscript /arch/i386/lib/id.lds
139
140 ##
141 ## Setup Cache-As-Ram
142 ##
143 mainboardinit cpu/intel/model_6ex/cache_as_ram.inc
144
145 ###
146 ### This is the early phase of coreboot startup 
147 ### Things are delicate and we test to see if we should
148 ### failover to another image.
149 ###
150 if USE_FALLBACK_IMAGE
151         ldscript /arch/i386/lib/failover.lds
152 end
153
154 ###
155 ### O.k. We aren't just an intermediary anymore!
156 ###
157
158 if CONFIG_USE_INIT
159 initobject auto.o
160 else
161 mainboardinit ./auto.inc
162 end
163
164 ##
165 ## Include the secondary Configuration files 
166 ##
167 dir /pc80
168 config chip.h
169
170 chip northbridge/intel/i945
171
172         device apic_cluster 0 on
173                 chip cpu/intel/socket_mFCPGA478
174                         device apic 0 on end
175                 end
176         end
177
178         device pci_domain 0 on 
179                 device pci 00.0 on end # host bridge
180                 device pci 01.0 off end # i945 PCIe root port
181                 chip drivers/pci/onboard
182                         device pci 02.0 on end # vga controller
183                         # register "rom_address" = "0xfffc0000" # 256 KB image
184                         # register "rom_address" = "0xfff80000" # 512 KB image
185                         register "rom_address" = "0xfff00000" # 1 MB image
186                 end
187                 device pci 02.1 on end # display controller
188
189                 chip southbridge/intel/i82801gx
190                         register "pirqa_routing" = "0x05"
191                         register "pirqb_routing" = "0x07"
192                         register "pirqc_routing" = "0x06"
193                         register "pirqd_routing" = "0x07"
194                         register "pirqe_routing" = "0x80"
195                         register "pirqf_routing" = "0x80"
196                         register "pirqg_routing" = "0x80"
197                         register "pirqh_routing" = "0x05"
198
199                         register "ide_legacy_combined" = "0x1"
200                         register "ide_enable_primary" = "0x1"
201                         register "ide_enable_secondary" = "0x0"
202                         register "sata_ahci" = "0x0"
203
204                         device pci 1b.0 on end # High Definition Audio
205                         device pci 1c.0 on end # PCIe
206                         device pci 1c.1 on end # PCIe
207                         device pci 1c.2 on end # PCIe
208                         #device pci 1c.3 off end # PCIe port 4
209                         #device pci 1c.4 off end # PCIe port 5
210                         #device pci 1c.5 off end # PCIe port 6
211                         device pci 1d.0 on end # USB UHCI
212                         device pci 1d.1 on end # USB UHCI
213                         device pci 1d.2 on end # USB UHCI
214                         device pci 1d.3 on end # USB UHCI
215                         device pci 1d.7 on end # USB2 EHCI
216                         device pci 1e.0 on end # PCI bridge
217                         #device pci 1e.2 off end # AC'97 Audio 
218                         #device pci 1e.3 off end # AC'97 Modem
219                         device pci 1f.0 on # LPC bridge
220                                 chip superio/winbond/w83627thg
221                                         device pnp 2e.0 off             # Floppy
222                                         end
223                                         device pnp 2e.1 off             # Parport
224                                         end
225                                         device pnp 2e.2 on
226                                                  io 0x60 = 0x3f8
227                                                 irq 0x70 = 4
228                                         end
229                                         device pnp 2e.3 on
230                                                  io 0x60 = 0x2f8
231                                                 irq 0x70 = 3
232                                                 irq 0xf1 = 4 # set IRMODE 0 # XXX not an irq
233                                         end
234                                         device pnp 2e.5 on              # Keyboard+Mouse
235                                                  io 0x60 = 0x60
236                                                  io 0x62 = 0x64
237                                                 irq 0x70 = 1
238                                                 irq 0x72 = 12
239                                                 irq 0xf0 = 0x82         # HW accel A20.
240                                         end
241                                         device pnp 2e.7 on              # GPIO1, GAME, MIDI
242                                                  io 0x62 = 0x330
243                                                 irq 0x70 = 9
244                                         end
245                                         device pnp 2e.8 on              # GPIO2
246                                                 # all default
247                                         end
248                                         device pnp 2e.9 on              # GPIO3/4
249                                                 irq 0x30 = 0x03         # does this work?
250                                                 irq 0xf0 = 0xfb         # set inputs/outputs
251                                                 irq 0xf1 = 0x66
252                                         end
253                                         device pnp 2e.a off             # ACPI
254                                         end
255                                         device pnp 2e.b on              # HWM
256                                                  io 0x60 = 0xa00
257                                                 irq 0x70 = 0
258                                         end
259
260                                 end
261                                 chip superio/winbond/w83627thg
262                                         device pnp 4e.0 off             # Floppy
263                                         end
264                                         device pnp 4e.1 off             # Parport
265                                         end
266                                         device pnp 4e.2 on              # COM3
267                                                  io 0x60 = 0x3e8
268                                                 irq 0x70 = 11
269                                         end
270                                         device pnp 4e.3 on              # COM4
271                                                  io 0x60 = 0x2e8
272                                                 irq 0x70 = 10
273                                         end
274                                         device pnp 4e.5 off             # Keyboard
275                                         end
276                                         device pnp 4e.7 off             # GPIO1, GAME, MIDI
277                                         end
278                                         device pnp 4e.8 off             # GPIO2
279                                         end
280                                         device pnp 4e.9 off             # GPIO3/4
281                                         end
282                                         device pnp 4e.a off             # ACPI
283                                         end
284                                         device pnp 4e.b off             # HWM
285                                         end
286                                 end
287
288                         end
289                         #device pci 1f.1 off end # IDE
290                         device pci 1f.2 on end  # SATA
291                         device pci 1f.3 on end  # SMBus
292                         #device pci 1f.4 off end # Realtek ID Codec
293                 end
294         end
295 end