2 ## This file is part of the coreboot project.
4 ## Copyright (C) 2008 VIA Technologies, Inc.
5 ## (Written by Aaron Lwe <aaron.lwe@gmail.com> for VIA)
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.
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.
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
22 ## CONFIG_XIP_ROM_SIZE must be a power of 2.
23 default CONFIG_XIP_ROM_SIZE = 64 * 1024
25 include /config/nofailovercalculation.lb
28 ## Set all of the defaults for an x86 architecture
33 ## Build the objects we have code for in this directory.
37 if CONFIG_GENERATE_PIRQ_TABLE object irq_tables.o end
41 if CONFIG_GENERATE_MP_TABLE object mptable.o end
43 if CONFIG_GENERATE_ACPI_TABLES
44 #acpi_create_fadt is located in VT8237R code
46 depends "$(CONFIG_MAINBOARD)/dsdt.asl"
47 action "iasl -p $(CURDIR)/dsdt -tc $(CONFIG_MAINBOARD)/dsdt.asl"
48 action "mv dsdt.hex dsdt.c"
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 $@"
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 $@"
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 $@"
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 $@"
71 ## Build our 16 bit and 32 bit coreboot entry code
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
79 ## Build our reset vector (This is where coreboot is entered)
81 if CONFIG_USE_FALLBACK_IMAGE
82 mainboardinit cpu/x86/16bit/reset16.inc
83 ldscript /cpu/x86/16bit/reset16.lds
85 mainboardinit cpu/x86/32bit/reset32.inc
86 ldscript /cpu/x86/32bit/reset32.lds
89 ### Should this be in the northbridge code?
90 mainboardinit arch/i386/lib/cpu_reset.inc
93 ## Include an id string (For safe flashing)
95 mainboardinit arch/i386/lib/id.inc
96 ldscript /arch/i386/lib/id.lds
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.
103 if CONFIG_USE_FALLBACK_IMAGE
104 ldscript /arch/i386/lib/failover.lds
105 mainboardinit ./failover.inc
109 ### O.k. We aren't just an intermediary anymore!
116 mainboardinit cpu/x86/fpu_enable.inc
117 mainboardinit ./auto.inc
118 mainboardinit cpu/x86/mmx_disable.inc
123 chip northbridge/via/cn400 # Northbridge
125 device apic_cluster 0 on # APIC cluster
126 chip cpu/via/model_c3 # VIA C3
127 device apic 0 on end # APIC
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
163 device pnp 2e.1 off # Parallel Port
168 device pnp 2e.2 on # COM1
172 device pnp 2e.3 off # COM2
176 device pnp 2e.6 off # IR Port
179 device pnp 2e.7 off # GPIO 1
180 io 0x60 = 0x201 # 0x201
182 device pnp 2e.8 off # GPIO 5
183 io 0x60 = 0x330 # 0x330
185 device pnp 2e.9 off # GPIO 2, 3,and 4
188 device pnp 2e.a off # ACPI
191 device pnp 2e.b on # HWM
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