Many Kudos go to Segher Boessenkool and Patrick Georgi for figuring this one
[coreboot.git] / src / mainboard / asus / m2v-mx_se / Config.lb
1 ## 
2 ## This file is part of the coreboot project.
3 ## 
4 ## Copyright (C) 2007 AMD
5 ## (Written by Yinghai Lu <yinghailu@amd.com> for AMD)
6 ## Copyright (C) 2007 Rudolf Marek <r.marek@assembler.cz>
7 ## 
8 ## This program is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ## 
13 ## This program is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ## GNU General Public License for more details.
17 ## 
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program; if not, write to the Free Software
20 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
21 ## 
22
23 include /config/nofailovercalculation128.lb
24
25 arch i386 end 
26
27 driver mainboard.o
28 if HAVE_ACPI_TABLES
29   object acpi_tables.o
30   object fadt.o
31   makerule dsdt.c
32     depends "$(MAINBOARD)/dsdt.asl"
33     action  "iasl -p $(CURDIR)/dsdt -tc $(MAINBOARD)/dsdt.asl"
34     action  "mv dsdt.hex dsdt.c"
35   end
36   object ./dsdt.o
37 end
38
39   if CONFIG_USE_INIT
40     makerule ./cache_as_ram_auto.o
41       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
42       action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -c $(MAINBOARD)/cache_as_ram_auto.c -o $@"
43     end
44   else
45     makerule ./cache_as_ram_auto.inc
46       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
47       action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(TOP)/src -I. -c -S $(MAINBOARD)/cache_as_ram_auto.c -o $@"
48       action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
49       action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
50     end
51   end
52
53 if USE_FALLBACK_IMAGE
54   mainboardinit cpu/x86/16bit/entry16.inc
55   ldscript /cpu/x86/16bit/entry16.lds
56   mainboardinit southbridge/via/k8t890/romstrap.inc
57   ldscript /southbridge/via/k8t890/romstrap.lds
58 end
59
60 mainboardinit cpu/x86/32bit/entry32.inc
61
62   if CONFIG_USE_INIT
63     ldscript /cpu/x86/32bit/entry32.lds
64   end
65   if CONFIG_USE_INIT
66     ldscript /cpu/amd/car/cache_as_ram.lds
67   end
68
69 if USE_FALLBACK_IMAGE
70   mainboardinit cpu/x86/16bit/reset16.inc
71   ldscript /cpu/x86/16bit/reset16.lds
72 else
73   mainboardinit cpu/x86/32bit/reset32.inc
74   ldscript /cpu/x86/32bit/reset32.lds
75 end
76
77   mainboardinit cpu/amd/car/cache_as_ram.inc
78
79 if USE_FALLBACK_IMAGE
80     ldscript /arch/i386/lib/failover.lds
81 end
82
83   if CONFIG_USE_INIT
84     initobject cache_as_ram_auto.o
85   else
86     mainboardinit ./cache_as_ram_auto.inc
87   end
88
89 config chip.h
90
91 chip northbridge/amd/amdk8/root_complex         # Root complex
92   device apic_cluster 0 on                      # APIC cluster
93     chip cpu/amd/socket_AM2                     # CPU
94       device apic 0 on end                      # APIC
95     end
96   end
97   device pci_domain 0 on                        # PCI domain
98     chip northbridge/amd/amdk8                  # mc0
99       device pci 18.0 on                        # Northbridge
100         # Devices on link 0, link 0 == LDT 0
101         chip southbridge/via/vt8237r            # Southbridge
102           register "ide0_enable" = "1"          # Enable IDE channel 0
103           register "ide1_enable" = "1"          # Enable IDE channel 1
104           register "ide0_80pin_cable" = "1"     # 80pin cable on IDE channel 0
105           register "ide1_80pin_cable" = "1"     # 80pin cable on IDE channel 1
106           register "fn_ctrl_lo" = "0xc0"        # Enable SB functions
107           register "fn_ctrl_hi" = "0x1d"        # Enable SB functions
108           device pci 0.0 on end                 # HT
109           device pci f.1 on end                 # IDE
110           device pci 11.0 on                    # LPC
111             chip drivers/generic/generic        # DIMM 0-0-0
112               device i2c 50 on end
113             end
114             chip drivers/generic/generic        # DIMM 0-0-1
115               device i2c 51 on end
116             end
117             chip drivers/generic/generic        # DIMM 0-1-0
118               device i2c 52 on end
119             end
120             chip drivers/generic/generic        # DIMM 0-1-1
121               device i2c 53 on end
122             end
123             chip superio/ite/it8712f            # Super I/O
124               device pnp 2e.0 on                # Floppy
125                 io 0x60 = 0x3f0
126                 irq 0x70 = 6
127                 drq 0x74 = 2
128               end
129               device pnp 2e.1 on                # Com1
130                 io 0x60 = 0x3f8
131                 irq 0x70 = 4
132               end
133               device pnp 2e.2 off               # Com2
134                 io 0x60 = 0x2f8
135                 irq 0x70 = 3
136               end
137               device pnp 2e.3 on                # Parallel port
138                 io 0x60 = 0x378
139                 irq 0x70 = 7
140               end
141               device pnp 2e.4 on                # Environment controller
142                 io 0x60 = 0x290
143                 io 0x62 = 0x230
144                 irq 0x70 = 0x00
145               end
146               device pnp 2e.5 off end           # PS/2 keyboard
147               device pnp 2e.6 off end           # PS/2 mouse
148               device pnp 2e.7 off end           # GPIO config
149               device pnp 2e.8 off end           # Midi port
150               device pnp 2e.9 off end           # Game port
151               device pnp 2e.a off end           # IR
152              end
153            end
154           device pci 12.0 on end                # VIA LAN
155           device pci 13.0 on end                # br
156           device pci 13.1 on end                # br2 need to have it here to discover it
157         end
158         chip southbridge/via/k8t890             # "Southbridge" K8M890
159         end
160       end
161       device pci 18.1 on end
162       device pci 18.2 on end
163       device pci 18.3 on end
164     end
165   end
166 end