66ada57c65f9825ba4da73ede07c4a522fa6796a
[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 CONFIG_USE_OPTION_TABLE = !CONFIG_USE_FALLBACK_IMAGE
30
31 ##
32 ## Image size calculation
33 ##
34
35 include /config/nofailovercalculation.lb
36
37 ##
38 ## Set all of the defaults for an x86 architecture
39 ##
40
41 arch i386 end
42
43 ##
44 ## Build the objects we have code for in this directory.
45 ##
46
47 driver mainboard.o
48 driver rtl8168.o
49 if CONFIG_GENERATE_MP_TABLE object mptable.o end
50 if CONFIG_GENERATE_PIRQ_TABLE object irq_tables.o end
51 if CONFIG_HAVE_SMI_HANDLER smmobject mainboard_smi.o end
52
53 if CONFIG_GENERATE_ACPI_TABLES
54         object fadt.o
55         object acpi_tables.o
56         makerule dsdt.c
57                 depends "$(CONFIG_MAINBOARD)/dsdt.asl"
58                 action  "$(CONFIG_CROSS_COMPILE)cpp -D__ACPI__ -P $(CPPFLAGS) -I$(CONFIG_MAINBOARD)  $(CONFIG_MAINBOARD)/dsdt.asl -o $(CURDIR)/dsdt.asl"
59                 action  "iasl -p dsdt -tc $(CURDIR)/dsdt.asl"
60                 action  "mv $(CURDIR)/dsdt.hex dsdt.c"
61         end
62         object ./dsdt.o
63 end
64
65 if CONFIG_USE_INIT
66
67 makerule ./auto.o
68         depends "$(CONFIG_MAINBOARD)/auto.c option_table.h"
69         action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -c $(CONFIG_MAINBOARD)/auto.c -o $@"
70 end
71
72 else
73
74 makerule ./auto.inc
75         depends "$(CONFIG_MAINBOARD)/auto.c option_table.h"
76         action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(TOP)/src -I. -c -S $(CONFIG_MAINBOARD)/auto.c -o $@"
77         action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
78         action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
79 end
80
81 end
82
83 ##
84 ## Build our 16 bit and 32 bit coreboot entry code
85 ##
86 mainboardinit cpu/x86/16bit/entry16.inc
87 mainboardinit cpu/x86/32bit/entry32.inc
88 ldscript /cpu/x86/16bit/entry16.lds
89 if CONFIG_USE_INIT
90         ldscript /cpu/x86/32bit/entry32.lds
91         ldscript /cpu/x86/car/cache_as_ram.lds
92 end
93
94 ##
95 ## Build our reset vector (This is where coreboot is entered)
96 ##
97 if CONFIG_USE_FALLBACK_IMAGE 
98         mainboardinit cpu/x86/16bit/reset16.inc
99         ldscript /cpu/x86/16bit/reset16.lds
100 else
101         mainboardinit cpu/x86/32bit/reset32.inc
102         ldscript /cpu/x86/32bit/reset32.lds
103 end
104
105
106 ##
107 ## Include an id string (For safe flashing)
108 ##
109 mainboardinit arch/i386/lib/id.inc
110 ldscript /arch/i386/lib/id.lds
111
112 ##
113 ## Setup Cache-As-Ram
114 ##
115 mainboardinit cpu/intel/model_6ex/cache_as_ram.inc
116
117 ###
118 ### This is the early phase of coreboot startup 
119 ### Things are delicate and we test to see if we should
120 ### failover to another image.
121 ###
122 if CONFIG_USE_FALLBACK_IMAGE
123         ldscript /arch/i386/lib/failover.lds
124 end
125
126 ###
127 ### O.k. We aren't just an intermediary anymore!
128 ###
129
130 if CONFIG_USE_INIT
131 initobject auto.o
132 else
133 mainboardinit ./auto.inc
134 end
135
136 ##
137 ## Include the secondary Configuration files 
138 ##
139 dir /pc80
140 config chip.h
141
142 chip northbridge/intel/i945
143
144         device apic_cluster 0 on
145                 chip cpu/intel/socket_mFCPGA478
146                         device apic 0 on end
147                 end
148         end
149
150         device pci_domain 0 on 
151                 device pci 00.0 on end # host bridge
152                 # autodetect 0:1.0 because it might or might not be there.
153                 # device pci 01.0 off end # i945 PCIe root port
154                 device pci 02.0 on end # vga controller
155                 device pci 02.1 on end # display controller
156
157                 chip southbridge/intel/i82801gx
158                         register "pirqa_routing" = "0x05"
159                         register "pirqb_routing" = "0x07"
160                         register "pirqc_routing" = "0x05"
161                         register "pirqd_routing" = "0x07"
162                         register "pirqe_routing" = "0x80"
163                         register "pirqf_routing" = "0x80"
164                         register "pirqg_routing" = "0x80"
165                         register "pirqh_routing" = "0x06"
166
167                         # GPI routing
168                         #  0 No effect (default)
169                         #  1 SMI# (if corresponding ALT_GPI_SMI_EN bit is also set)
170                         #  2 SCI (if corresponding GPIO_EN bit is also set)
171                         register "gpi13_routing" = "1"
172                         register "gpe0_en" = "0x00000400"
173
174                         register "ide_legacy_combined" = "0x1"
175                         register "ide_enable_primary" = "0x1"
176                         register "ide_enable_secondary" = "0x1"
177                         register "sata_ahci" = "0x0"
178
179                         device pci 1b.0 on end # High Definition Audio
180                         device pci 1c.0 on end # PCIe
181                         device pci 1c.1 on end # PCIe
182                         device pci 1c.2 on end # PCIe
183                         #device pci 1c.3 off end # PCIe port 4
184                         #device pci 1c.4 off end # PCIe port 5
185                         #device pci 1c.5 off end # PCIe port 6
186                         device pci 1d.0 on end # USB UHCI
187                         device pci 1d.1 on end # USB UHCI
188                         device pci 1d.2 on end # USB UHCI
189                         device pci 1d.3 on end # USB UHCI
190                         device pci 1d.7 on end # USB2 EHCI
191                         device pci 1e.0 on end # PCI bridge
192                         #device pci 1e.2 off end # AC'97 Audio 
193                         #device pci 1e.3 off end # AC'97 Modem
194                         device pci 1f.0 on # LPC bridge
195                                 chip superio/winbond/w83627thg
196                                         device pnp 2e.0 off             # Floppy
197                                         end
198                                         device pnp 2e.1 off             # Parport
199                                         end
200                                         device pnp 2e.2 on
201                                                  io 0x60 = 0x3f8
202                                                 irq 0x70 = 4
203                                         end
204                                         device pnp 2e.3 on
205                                                  io 0x60 = 0x2f8
206                                                 irq 0x70 = 3
207                                                 irq 0xf1 = 4 # set IRMODE 0 # XXX not an irq
208                                         end
209                                         device pnp 2e.5 on              # Keyboard+Mouse
210                                                  io 0x60 = 0x60
211                                                  io 0x62 = 0x64
212                                                 irq 0x70 = 1
213                                                 irq 0x72 = 12
214                                                 irq 0xf0 = 0x82         # HW accel A20.
215                                         end
216                                         device pnp 2e.7 on              # GPIO1, GAME, MIDI
217                                                  io 0x62 = 0x330
218                                                 irq 0x70 = 9
219                                         end
220                                         device pnp 2e.8 on              # GPIO2
221                                                 # all default
222                                         end
223                                         device pnp 2e.9 on              # GPIO3/4
224                                                 irq 0x30 = 0x03         # does this work?
225                                                 irq 0xf0 = 0xfb         # set inputs/outputs
226                                                 irq 0xf1 = 0x66
227                                         end
228                                         device pnp 2e.a off             # ACPI
229                                         end
230                                         device pnp 2e.b on              # HWM
231                                                  io 0x60 = 0xa00
232                                                 irq 0x70 = 0
233                                         end
234
235                                 end
236                                 chip superio/winbond/w83627thg
237                                         device pnp 4e.0 off             # Floppy
238                                         end
239                                         device pnp 4e.1 off             # Parport
240                                         end
241                                         device pnp 4e.2 on              # COM3
242                                                  io 0x60 = 0x3e8
243                                                 irq 0x70 = 11
244                                         end
245                                         device pnp 4e.3 on              # COM4
246                                                  io 0x60 = 0x2e8
247                                                 irq 0x70 = 10
248                                         end
249                                         device pnp 4e.5 off             # Keyboard
250                                         end
251                                         device pnp 4e.7 off             # GPIO1, GAME, MIDI
252                                         end
253                                         device pnp 4e.8 off             # GPIO2
254                                         end
255                                         device pnp 4e.9 off             # GPIO3/4
256                                         end
257                                         device pnp 4e.a off             # ACPI
258                                         end
259                                         device pnp 4e.b off             # HWM
260                                         end
261                                 end
262
263                         end
264                         #device pci 1f.1 off end # IDE
265                         device pci 1f.2 on end  # SATA
266                         device pci 1f.3 on end  # SMBus
267                         #device pci 1f.4 off end # Realtek ID Codec
268                 end
269         end
270 end