a1f291fd333399926ad9e7fd601b7a2dc4dbe409
[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 if USE_FALLBACK_IMAGE
24   default ROM_SECTION_SIZE   = FALLBACK_SIZE
25   default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
26 else
27   default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
28   default ROM_SECTION_OFFSET = 0
29 end
30
31 default PAYLOAD_SIZE             = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
32 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
33 default CONFIG_ROM_PAYLOAD       = 1
34 default _ROMBASE     = (CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE)
35
36 ##WARNING enable caching of whole ROM during CAR
37 ##for 512KB flash
38 default XIP_ROM_SIZE =  0x80000
39 default XIP_ROM_BASE =  0xffffffff + 1 - XIP_ROM_SIZE
40
41 arch i386 end 
42
43 driver mainboard.o
44 if HAVE_ACPI_TABLES
45   object acpi_tables.o
46   object fadt.o
47   makerule dsdt.c
48     depends "$(MAINBOARD)/dsdt.asl"
49     action  "iasl -p $(PWD)/dsdt -tc $(MAINBOARD)/dsdt.asl"
50     action  "mv dsdt.hex dsdt.c"
51   end
52   object ./dsdt.o
53 end
54 if HAVE_MP_TABLE object mptable.o end
55 if HAVE_PIRQ_TABLE object irq_tables.o end
56 # object reset.o
57
58 if USE_DCACHE_RAM
59   if CONFIG_USE_INIT
60     makerule ./cache_as_ram_auto.o
61       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
62       action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o $@"
63     end
64   else
65     makerule ./cache_as_ram_auto.inc
66       depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
67       action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall $(DEBUG_CFLAGS) -c -S -o $@"
68       action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
69       action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
70     end
71   end
72 end
73
74 if USE_FALLBACK_IMAGE
75   mainboardinit cpu/x86/16bit/entry16.inc
76   ldscript /cpu/x86/16bit/entry16.lds
77   mainboardinit southbridge/via/k8t890/romstrap.inc
78   ldscript /southbridge/via/k8t890/romstrap.lds
79 end
80
81 mainboardinit cpu/x86/32bit/entry32.inc
82
83 if USE_DCACHE_RAM
84   if CONFIG_USE_INIT
85     ldscript /cpu/x86/32bit/entry32.lds
86   end
87   if CONFIG_USE_INIT
88     ldscript /cpu/amd/car/cache_as_ram.lds
89   end
90 end
91
92 if USE_FALLBACK_IMAGE
93   mainboardinit cpu/x86/16bit/reset16.inc
94   ldscript /cpu/x86/16bit/reset16.lds
95 else
96   mainboardinit cpu/x86/32bit/reset32.inc
97   ldscript /cpu/x86/32bit/reset32.lds
98 end
99
100 if USE_DCACHE_RAM
101   mainboardinit cpu/amd/car/cache_as_ram.inc
102 end
103
104 if USE_FALLBACK_IMAGE
105   if USE_DCACHE_RAM
106     ldscript /arch/i386/lib/failover.lds
107   end
108 end
109
110 if USE_DCACHE_RAM
111   if CONFIG_USE_INIT
112     initobject cache_as_ram_auto.o
113   else
114     mainboardinit ./cache_as_ram_auto.inc
115   end
116 end
117
118 if CONFIG_CHIP_NAME
119   config chip.h
120 end
121
122 chip northbridge/amd/amdk8/root_complex         # Root complex
123   device apic_cluster 0 on                      # APIC cluster
124     chip cpu/amd/socket_AM2                     # CPU
125       device apic 0 on end                      # APIC
126     end
127   end
128   device pci_domain 0 on                        # PCI domain
129     chip northbridge/amd/amdk8                  # mc0
130       device pci 18.0 on                        # Northbridge
131         # Devices on link 0, link 0 == LDT 0
132         chip southbridge/via/vt8237r            # Southbridge
133           register "ide0_enable" = "1"          # Enable IDE channel 0
134           register "ide1_enable" = "1"          # Enable IDE channel 1
135           register "ide0_80pin_cable" = "1"     # 80pin cable on IDE channel 0
136           register "ide1_80pin_cable" = "1"     # 80pin cable on IDE channel 1
137           register "fn_ctrl_lo" = "0xc0"        # Enable SB functions
138           register "fn_ctrl_hi" = "0x1d"        # Enable SB functions
139           device pci 0.0 on end                 # HT
140           device pci f.1 on end                 # IDE
141           device pci 11.0 on                    # LPC
142             chip drivers/generic/generic        # DIMM 0-0-0
143               device i2c 50 on end
144             end
145             chip drivers/generic/generic        # DIMM 0-0-1
146               device i2c 51 on end
147             end
148             chip drivers/generic/generic        # DIMM 0-1-0
149               device i2c 52 on end
150             end
151             chip drivers/generic/generic        # DIMM 0-1-1
152               device i2c 53 on end
153             end
154             chip superio/ite/it8712f            # Super I/O
155               device pnp 2e.0 on                # Floppy
156                 io 0x60 = 0x3f0
157                 irq 0x70 = 6
158                 drq 0x74 = 2
159               end
160               device pnp 2e.1 on                # Com1
161                 io 0x60 = 0x3f8
162                 irq 0x70 = 4
163               end
164               device pnp 2e.2 off               # Com2
165                 io 0x60 = 0x2f8
166                 irq 0x70 = 3
167               end
168               device pnp 2e.3 on                # Parallel port
169                 io 0x60 = 0x378
170                 irq 0x70 = 7
171               end
172               device pnp 2e.4 on                # Environment controller
173                 io 0x60 = 0x290
174                 io 0x62 = 0x230
175                 irq 0x70 = 0x00
176               end
177               device pnp 2e.5 off end           # PS/2 keyboard
178               device pnp 2e.6 off end           # PS/2 mouse
179               device pnp 2e.7 off end           # GPIO config
180               device pnp 2e.8 off end           # Midi port
181               device pnp 2e.9 off end           # Game port
182               device pnp 2e.a off end           # IR
183              end
184            end
185           device pci 12.0 on end                # VIA LAN
186           device pci 13.0 on end                # br
187           device pci 13.1 on end                # br2 need to have it here to discover it
188         end
189         chip southbridge/via/k8t890             # "Southbridge" K8M890
190         end
191       end
192       device pci 18.1 on end
193       device pci 18.2 on end
194       device pci 18.3 on end
195     end
196   end
197 end