this should get the VIA VT8454c in shape with Kconfig
[coreboot.git] / src / mainboard / via / epia-n / Config.lb
1 ##
2 ## This file is part of the coreboot project.
3 ##
4 ## Copyright (C) 2008 VIA Technologies, Inc.
5 ## (Written by Aaron Lwe <aaron.lwe@gmail.com> for VIA)
6 ##
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ## GNU General Public License for more details.
16 ##
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20 ##
21
22 ## CONFIG_XIP_ROM_SIZE must be a power of 2.
23 default CONFIG_XIP_ROM_SIZE = 64 * 1024
24
25 include /config/nofailovercalculation.lb
26
27 ##
28 ## Set all of the defaults for an x86 architecture
29 ##
30 arch i386 end
31
32 ##
33 ## Build the objects we have code for in this directory.
34 ##
35
36 driver mainboard.o
37 if CONFIG_GENERATE_PIRQ_TABLE object irq_tables.o end
38
39 #object vgabios.o
40
41 if CONFIG_GENERATE_MP_TABLE object mptable.o end
42
43 if CONFIG_GENERATE_ACPI_TABLES
44 #acpi_create_fadt is located in VT8237R code
45         makerule dsdt.c
46                 depends "$(CONFIG_MAINBOARD)/dsdt.asl"
47                 action  "iasl -p $(CURDIR)/dsdt -tc $(CONFIG_MAINBOARD)/dsdt.asl"
48                 action  "mv dsdt.hex dsdt.c"
49         end
50         object ./dsdt.o
51         object acpi_tables.o
52 end
53 makerule ./failover.E
54         depends "$(CONFIG_MAINBOARD)/../../../arch/i386/lib/failover.c ../romcc"
55         action "../romcc -E -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(CONFIG_MAINBOARD)/../../../arch/i386/lib/failover.c -o $@"
56 end
57 makerule ./failover.inc
58         depends "$(CONFIG_MAINBOARD)/../../../arch/i386/lib/failover.c ../romcc"
59         action "../romcc    -O --label-prefix=failover -I$(TOP)/src -I. $(CPPFLAGS) $(CONFIG_MAINBOARD)/../../../arch/i386/lib/failover.c -o $@"
60 end
61 makerule ./auto.E
62         depends "$(CONFIG_MAINBOARD)/auto.c option_table.h ../romcc"
63         action  "../romcc -E -mcpu=c3 -O -I$(TOP)/src -I. $(CPPFLAGS) $(CONFIG_MAINBOARD)/auto.c -o $@"
64 end
65 makerule ./auto.inc
66         depends "$(CONFIG_MAINBOARD)/auto.c option_table.h ../romcc"
67         action  "../romcc    -mcpu=c3 -O -I$(TOP)/src -I. $(CPPFLAGS) $(CONFIG_MAINBOARD)/auto.c -o $@"
68 end
69
70 ##
71 ## Build our 16 bit and 32 bit coreboot entry code
72 ##
73 mainboardinit cpu/x86/16bit/entry16.inc
74 mainboardinit cpu/x86/32bit/entry32.inc
75 ldscript /cpu/x86/16bit/entry16.lds
76 ldscript /cpu/x86/32bit/entry32.lds
77
78 ##
79 ## Build our reset vector (This is where coreboot is entered)
80 ##
81 if CONFIG_USE_FALLBACK_IMAGE
82         mainboardinit cpu/x86/16bit/reset16.inc
83         ldscript /cpu/x86/16bit/reset16.lds
84 else
85         mainboardinit cpu/x86/32bit/reset32.inc
86         ldscript /cpu/x86/32bit/reset32.lds
87 end
88
89 ### Should this be in the northbridge code?
90 mainboardinit arch/i386/lib/cpu_reset.inc
91
92 ##
93 ## Include an id string (For safe flashing)
94 ##
95 mainboardinit arch/i386/lib/id.inc
96 ldscript /arch/i386/lib/id.lds
97
98 ###
99 ### This is the early phase of coreboot startup 
100 ### Things are delicate and we test to see if we should
101 ### failover to another image.
102 ###
103 if CONFIG_USE_FALLBACK_IMAGE
104         ldscript /arch/i386/lib/failover.lds
105         mainboardinit ./failover.inc
106 end
107
108 ###
109 ### O.k. We aren't just an intermediary anymore!
110 ###
111
112 ##
113 ## Setup RAM
114 ##
115
116 mainboardinit cpu/x86/fpu_enable.inc
117 mainboardinit ./auto.inc
118 mainboardinit cpu/x86/mmx_disable.inc
119
120 dir /pc80
121 config chip.h
122
123 chip northbridge/via/cn400                      # Northbridge
124
125   device apic_cluster 0 on                      # APIC cluster
126     chip cpu/via/model_c3                       # VIA C3
127       device apic 0 on end                      # APIC
128     end
129   end
130
131   device pci_domain 0 on                        # PCI domain
132     device pci 0.0 on end                       # AGP Bridge
133     device pci 0.1 on end                       # Error Reporting
134     device pci 0.2 on end                       # Host Bus Control
135     device pci 0.3 on end                       # Memory Controller
136     device pci 0.4 on end                       # Power Management
137     device pci 0.7 on end                       # V-Link Controller
138     device pci 1.0 on end                       # PCI Bridge
139     chip southbridge/via/vt8237r                # Southbridge
140       # Enable both IDE channels.
141       register "ide0_enable" = "1"
142       register "ide1_enable" = "1"
143       # Both cables are 40pin.
144       register "ide0_80pin_cable" = "0"
145       register "ide1_80pin_cable" = "0"
146       device pci f.0 on end                     # IDE/SATA
147           device pci f.1 on end                 # IDE
148       register "fn_ctrl_lo" = "0xC0"    # Disable AC/MC97
149       register "fn_ctrl_hi" = "0x9d"    # Disable USB Direct & LAN Gating
150       device pci 10.0 on end                    # OHCI
151       device pci 10.1 on end                    # OHCI
152       device pci 10.2 on end                    # OHCI
153       device pci 10.3 on end                    # OHCI
154       device pci 10.4 on end                    # EHCI
155       device pci 10.5 off end                   # USB Direct
156       device pci 11.0 on                        # Southbridge LPC
157         chip superio/winbond/w83697hf           # Super I/O
158           device pnp 2e.0 off                   # Floppy
159             io 0x60 = 0x3f0
160             irq 0x70 = 6
161             drq 0x74 = 2
162           end
163           device pnp 2e.1 off                   # Parallel Port
164             io 0x60 = 0x378
165             irq 0x70 = 7
166             drq 0x74 = 3
167           end
168           device pnp 2e.2 on                    # COM1
169             io 0x60 = 0x3f8
170             irq 0x70 = 4
171           end
172           device pnp 2e.3 off                   # COM2
173             io 0x60 = 0x2f8
174             irq 0x70 = 3
175           end
176           device pnp 2e.6 off                   # IR Port
177             io 0x60 = 0x000
178           end
179           device pnp 2e.7 off                   # GPIO 1
180             io 0x60 = 0x201                     # 0x201
181           end
182           device pnp 2e.8 off                   # GPIO 5
183             io 0x60 = 0x330                     # 0x330
184           end
185           device pnp 2e.9 off                   # GPIO 2, 3,and 4
186             io 0x60 = 0x000                     #
187           end
188           device pnp 2e.a off                   # ACPI
189             io 0x60 = 0x000                     #
190           end
191           device pnp 2e.b on                    # HWM
192             io 0x60 = 0x290
193                         irq 0x70 = 0
194           end
195         end
196       end
197       device pci 11.5 off end                   # AC'97 audio
198       device pci 11.6 off end                   # AC'97 Modem
199       device pci 12.0 on end                    # Ethernet
200     end
201   end
202 end