* fix a minor power state issue in the ich7 smm handler
[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 if HAVE_SMI_HANDLER smmobject mainboard_smi.o end
80
81 if HAVE_ACPI_TABLES
82         object fadt.o
83         object acpi_tables.o
84         makerule dsdt.c
85                 depends "$(MAINBOARD)/dsdt.dsl"
86                 action  "iasl -p dsdt -tc $(MAINBOARD)/dsdt.dsl"
87                 action  "mv $(PWD)/dsdt.hex dsdt.c"
88         end
89         object ./dsdt.o
90 end
91
92 object reset.o
93
94 if CONFIG_USE_INIT
95
96 makerule ./auto.o
97         depends "$(MAINBOARD)/auto.c option_table.h"
98         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o auto.o"
99 end
100
101 else
102
103 makerule ./auto.inc
104         depends "$(MAINBOARD)/auto.c option_table.h"
105         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I.  $(CPPFLAGS) $(MAINBOARD)/auto.c -Os -nostdinc -nostdlib -fno-builtin $(DEBUG_CFLAGS) -Wall -c -S -o $@"
106         action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
107         action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
108 end
109
110 end
111
112 ##
113 ## Build our 16 bit and 32 bit coreboot entry code
114 ##
115 mainboardinit cpu/x86/16bit/entry16.inc
116 mainboardinit cpu/x86/32bit/entry32.inc
117 ldscript /cpu/x86/16bit/entry16.lds
118 if CONFIG_USE_INIT
119         ldscript /cpu/x86/32bit/entry32.lds
120         ldscript /cpu/x86/car/cache_as_ram.lds
121 end
122
123 ##
124 ## Build our reset vector (This is where coreboot is entered)
125 ##
126 if USE_FALLBACK_IMAGE 
127         mainboardinit cpu/x86/16bit/reset16.inc
128         ldscript /cpu/x86/16bit/reset16.lds
129 else
130         mainboardinit cpu/x86/32bit/reset32.inc
131         ldscript /cpu/x86/32bit/reset32.lds
132 end
133
134
135 ##
136 ## Include an id string (For safe flashing)
137 ##
138 mainboardinit arch/i386/lib/id.inc
139 ldscript /arch/i386/lib/id.lds
140
141 ##
142 ## Setup Cache-As-Ram
143 ##
144 mainboardinit cpu/intel/model_6ex/cache_as_ram.inc
145
146 ###
147 ### This is the early phase of coreboot startup 
148 ### Things are delicate and we test to see if we should
149 ### failover to another image.
150 ###
151 if USE_FALLBACK_IMAGE
152         ldscript /arch/i386/lib/failover.lds
153 end
154
155 ###
156 ### O.k. We aren't just an intermediary anymore!
157 ###
158
159 if CONFIG_USE_INIT
160 initobject auto.o
161 else
162 mainboardinit ./auto.inc
163 end
164
165 ##
166 ## Include the secondary Configuration files 
167 ##
168 dir /pc80
169 config chip.h
170
171 chip northbridge/intel/i945
172
173         device apic_cluster 0 on
174                 chip cpu/intel/socket_mFCPGA478
175                         device apic 0 on end
176                 end
177         end
178
179         device pci_domain 0 on 
180                 device pci 00.0 on end # host bridge
181                 device pci 01.0 off end # i945 PCIe root port
182                 chip drivers/pci/onboard
183                         device pci 02.0 on end # vga controller
184                         # register "rom_address" = "0xfffc0000" # 256 KB image
185                         # register "rom_address" = "0xfff80000" # 512 KB image
186                         register "rom_address" = "0xfff00000" # 1 MB image
187                 end
188                 device pci 02.1 on end # display controller
189
190                 chip southbridge/intel/i82801gx
191                         register "pirqa_routing" = "0x05"
192                         register "pirqb_routing" = "0x07"
193                         register "pirqc_routing" = "0x06"
194                         register "pirqd_routing" = "0x07"
195                         register "pirqe_routing" = "0x80"
196                         register "pirqf_routing" = "0x80"
197                         register "pirqg_routing" = "0x80"
198                         register "pirqh_routing" = "0x05"
199
200                         register "ide_legacy_combined" = "0x1"
201                         register "ide_enable_primary" = "0x1"
202                         register "ide_enable_secondary" = "0x0"
203                         register "sata_ahci" = "0x0"
204
205                         device pci 1b.0 on end # High Definition Audio
206                         device pci 1c.0 on end # PCIe
207                         device pci 1c.1 on end # PCIe
208                         device pci 1c.2 on end # PCIe
209                         #device pci 1c.3 off end # PCIe port 4
210                         #device pci 1c.4 off end # PCIe port 5
211                         #device pci 1c.5 off end # PCIe port 6
212                         device pci 1d.0 on end # USB UHCI
213                         device pci 1d.1 on end # USB UHCI
214                         device pci 1d.2 on end # USB UHCI
215                         device pci 1d.3 on end # USB UHCI
216                         device pci 1d.7 on end # USB2 EHCI
217                         device pci 1e.0 on end # PCI bridge
218                         #device pci 1e.2 off end # AC'97 Audio 
219                         #device pci 1e.3 off end # AC'97 Modem
220                         device pci 1f.0 on # LPC bridge
221                                 chip superio/winbond/w83627thg
222                                         device pnp 2e.0 off             # Floppy
223                                         end
224                                         device pnp 2e.1 off             # Parport
225                                         end
226                                         device pnp 2e.2 on
227                                                  io 0x60 = 0x3f8
228                                                 irq 0x70 = 4
229                                         end
230                                         device pnp 2e.3 on
231                                                  io 0x60 = 0x2f8
232                                                 irq 0x70 = 3
233                                                 irq 0xf1 = 4 # set IRMODE 0 # XXX not an irq
234                                         end
235                                         device pnp 2e.5 on              # Keyboard+Mouse
236                                                  io 0x60 = 0x60
237                                                  io 0x62 = 0x64
238                                                 irq 0x70 = 1
239                                                 irq 0x72 = 12
240                                                 irq 0xf0 = 0x82         # HW accel A20.
241                                         end
242                                         device pnp 2e.7 on              # GPIO1, GAME, MIDI
243                                                  io 0x62 = 0x330
244                                                 irq 0x70 = 9
245                                         end
246                                         device pnp 2e.8 on              # GPIO2
247                                                 # all default
248                                         end
249                                         device pnp 2e.9 on              # GPIO3/4
250                                                 irq 0x30 = 0x03         # does this work?
251                                                 irq 0xf0 = 0xfb         # set inputs/outputs
252                                                 irq 0xf1 = 0x66
253                                         end
254                                         device pnp 2e.a off             # ACPI
255                                         end
256                                         device pnp 2e.b on              # HWM
257                                                  io 0x60 = 0xa00
258                                                 irq 0x70 = 0
259                                         end
260
261                                 end
262                                 chip superio/winbond/w83627thg
263                                         device pnp 4e.0 off             # Floppy
264                                         end
265                                         device pnp 4e.1 off             # Parport
266                                         end
267                                         device pnp 4e.2 on              # COM3
268                                                  io 0x60 = 0x3e8
269                                                 irq 0x70 = 11
270                                         end
271                                         device pnp 4e.3 on              # COM4
272                                                  io 0x60 = 0x2e8
273                                                 irq 0x70 = 10
274                                         end
275                                         device pnp 4e.5 off             # Keyboard
276                                         end
277                                         device pnp 4e.7 off             # GPIO1, GAME, MIDI
278                                         end
279                                         device pnp 4e.8 off             # GPIO2
280                                         end
281                                         device pnp 4e.9 off             # GPIO3/4
282                                         end
283                                         device pnp 4e.a off             # ACPI
284                                         end
285                                         device pnp 4e.b off             # HWM
286                                         end
287                                 end
288
289                         end
290                         #device pci 1f.1 off end # IDE
291                         device pci 1f.2 on end  # SATA
292                         device pci 1f.3 on end  # SMBus
293                         #device pci 1f.4 off end # Realtek ID Codec
294                 end
295         end
296 end