Coding-style fixes and simplifications for the ASUS A8N-E (trivial).
[coreboot.git] / src / mainboard / asus / a8n_e / 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 Philipp Degler <pdegler@rumms.uni-mannheim.de>
7 ## (Thanks to LSRA University of Mannheim for their support)
8 ##
9 ## This program is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2 of the License, or
12 ## (at your option) any later version.
13 ##
14 ## This program is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ## GNU General Public License for more details.
18 ##
19 ## You should have received a copy of the GNU General Public License
20 ## along with this program; if not, write to the Free Software
21 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
22 ##
23
24 if USE_FAILOVER_IMAGE
25         default ROM_SECTION_SIZE   = FAILOVER_SIZE
26         default ROM_SECTION_OFFSET = (ROM_SIZE - FAILOVER_SIZE)
27 else
28         if USE_FALLBACK_IMAGE
29                 default ROM_SECTION_SIZE   = FALLBACK_SIZE
30                 default ROM_SECTION_OFFSET = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
31         else
32                 default ROM_SECTION_SIZE   = (ROM_SIZE - FALLBACK_SIZE - FAILOVER_SIZE)
33                 default ROM_SECTION_OFFSET = 0
34         end
35 end
36 default PAYLOAD_SIZE = (ROM_SECTION_SIZE - ROM_IMAGE_SIZE)
37 default CONFIG_ROM_PAYLOAD_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
38 default _ROMBASE = (CONFIG_ROM_PAYLOAD_START + PAYLOAD_SIZE)
39 # XIP_ROM_SIZE must be a power of 2.
40 # XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE.
41 default XIP_ROM_SIZE = 64 * 1024
42 if USE_FAILOVER_IMAGE
43         default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
44 else
45         if USE_FALLBACK_IMAGE
46                 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE + FAILOVER_SIZE)
47         else
48                 default XIP_ROM_BASE = (_ROMBASE - XIP_ROM_SIZE + ROM_IMAGE_SIZE)
49         end
50 end
51 arch i386 end
52 driver mainboard.o
53 # Needed by irq_tables and mptable and acpi_tables.
54 object get_bus_conf.o
55 if HAVE_MP_TABLE object mptable.o end
56 if HAVE_PIRQ_TABLE object irq_tables.o end
57 if USE_DCACHE_RAM
58         if CONFIG_USE_INIT
59                 makerule ./auto.o
60                         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
61                         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -o $@"
62                 end
63         else
64                 makerule ./auto.inc
65                         depends "$(MAINBOARD)/cache_as_ram_auto.c option_table.h"
66                         action "$(CC) $(DISTRO_CFLAGS) -I$(TOP)/src -I. $(CPPFLAGS) $(MAINBOARD)/cache_as_ram_auto.c -Os -nostdinc -nostdlib -fno-builtin -Wall -c -S -o $@"
67                         action "perl -e 's/.rodata/.rom.data/g' -pi $@"
68                         action "perl -e 's/.text/.section .rom.text/g' -pi $@"
69                 end
70         end
71 end
72 if HAVE_FAILOVER_BOOT
73         if USE_FAILOVER_IMAGE
74                 mainboardinit cpu/x86/16bit/entry16.inc
75                 ldscript /cpu/x86/16bit/entry16.lds
76         end
77 else
78         if USE_FALLBACK_IMAGE
79                 mainboardinit cpu/x86/16bit/entry16.inc
80                 ldscript /cpu/x86/16bit/entry16.lds
81         end
82 end
83 mainboardinit cpu/x86/32bit/entry32.inc
84 if USE_DCACHE_RAM
85         if CONFIG_USE_INIT
86                 ldscript /cpu/x86/32bit/entry32.lds
87                 ldscript /cpu/amd/car/cache_as_ram.lds
88         end
89 end
90 if HAVE_FAILOVER_BOOT
91         if USE_FAILOVER_IMAGE
92                 mainboardinit cpu/x86/16bit/reset16.inc
93                 ldscript /cpu/x86/16bit/reset16.lds
94         else
95                 mainboardinit cpu/x86/32bit/reset32.inc
96                 ldscript /cpu/x86/32bit/reset32.lds
97         end
98 else
99         if USE_FALLBACK_IMAGE
100                 mainboardinit cpu/x86/16bit/reset16.inc
101                 ldscript /cpu/x86/16bit/reset16.lds
102         else
103                 mainboardinit cpu/x86/32bit/reset32.inc
104                 ldscript /cpu/x86/32bit/reset32.lds
105         end
106 end
107 if USE_DCACHE_RAM
108 else
109         mainboardinit arch/i386/lib/cpu_reset.inc
110 end
111 # Include an ID string (for safe flashing).
112 mainboardinit southbridge/nvidia/ck804/id.inc
113 ldscript /southbridge/nvidia/ck804/id.lds
114 # ROMSTRAP table for CK804.
115 if HAVE_FAILOVER_BOOT
116         if USE_FAILOVER_IMAGE
117                 mainboardinit southbridge/nvidia/ck804/romstrap.inc
118                 ldscript /southbridge/nvidia/ck804/romstrap.lds
119         end
120 else
121         if USE_FALLBACK_IMAGE
122                 mainboardinit southbridge/nvidia/ck804/romstrap.inc
123                 ldscript /southbridge/nvidia/ck804/romstrap.lds
124         end
125 end
126 if USE_DCACHE_RAM
127         mainboardinit cpu/amd/car/cache_as_ram.inc
128 end
129 if HAVE_FAILOVER_BOOT
130         if USE_FAILOVER_IMAGE
131                 if USE_DCACHE_RAM
132                         ldscript /arch/i386/lib/failover_failover.lds
133                 end
134         end
135 else
136         if USE_FALLBACK_IMAGE
137                 if USE_DCACHE_RAM
138                         ldscript /arch/i386/lib/failover.lds
139                 end
140         end
141 end
142 if USE_DCACHE_RAM
143         if CONFIG_USE_INIT
144                 initobject auto.o
145         else
146                 mainboardinit ./auto.inc
147         end
148 end
149 if CONFIG_CHIP_NAME
150         config chip.h
151 end
152
153 chip northbridge/amd/amdk8/root_complex         # Root complex
154   device apic_cluster 0 on                      # APIC cluster
155     chip cpu/amd/socket_939                     # Socket 939 CPU
156       device apic 0 on end                      # APIC
157     end
158   end
159
160   device pci_domain 0 on                        # PCI domain
161     chip northbridge/amd/amdk8                  # mc0
162       device pci 18.0 on                        # Northbridge
163         # Devices on link 0, link 0 == LDT 0
164         chip southbridge/nvidia/ck804           # Southbridge
165           device pci 0.0 on end                 # HT
166           device pci 1.0 on                     # LPC
167             chip superio/ite/it8712f            # Super I/O
168               device pnp 2e.0 off               # Floppy
169                 io 0x60 = 0x3f0
170                 irq 0x70 = 6
171                 drq 0x74 = 2
172               end
173               device pnp 2e.1 on                # Com1
174                 io 0x60 = 0x3f8
175                 irq 0x70 = 4
176               end
177               device pnp 2e.2 off               # Com2
178                 io 0x60 = 0x2f8
179                 irq 0x70 = 3
180               end
181               device pnp 2e.3 on                # Parallel port
182                 io 0x60 = 0x378
183                 irq 0x70 = 7
184               end
185               device pnp 2e.4 on                # Environment controller
186                 io 0x60 = 0x290
187                 io 0x62 = 0x0000
188                 irq 0x70 = 0x00
189               end
190               device pnp 2e.5 on                # PS/2 keyboard
191                 io 0x60 = 0x60
192                 io 0x62 = 0x64
193                 irq 0x70 = 1
194                 irq 0x71 = 2
195               end
196               device pnp 2e.6 on                # PS/2 mouse
197                 irq 0x70 = 12
198                 irq 0x71 = 2
199               end
200               device pnp 2e.7 on                # GPIO config
201                 # Set GPIO 1 & 2
202                 io 0x25 = 0x0000
203                 # Set GPIO 3 & 4
204                 io 0x27 = 0x2540
205                 # GPIO Polarity for Set 3
206                 io 0xb2 = 0x2100
207                 # GPIO Pin Internal Pull up for Set 3
208                 io 0xba = 0x0100
209                 # Simple I/O register config
210                 io 0xc0 = 0x0000
211                 io 0xc2 = 0x2540
212                 io 0xc8 = 0x0000
213                 io 0xca = 0x0500
214               end
215               device pnp 2e.8 off end           # Midi port
216               device pnp 2e.9 off end           # Game port
217               device pnp 2e.a off end           # IR
218             end
219           end
220           device pci 1.1 on                     # SM 0
221             # chip drivers/generic/generic #dimm 0-0-0
222             #   device i2c 50 on end
223             # end
224             # chip drivers/generic/generic #dimm 0-0-1
225             #   device i2c 51 on end
226             # end
227             # chip drivers/generic/generic #dimm 0-1-0
228             #   device i2c 52 on end
229             # end
230             # chip drivers/generic/generic #dimm 0-1-1
231             #   device i2c 53 on end
232             # end
233             # chip drivers/generic/generic #dimm 1-0-0
234             #   device i2c 54 on end
235             # end
236             # chip drivers/generic/generic #dimm 1-0-1
237             #   device i2c 55 on end
238             # end
239             # chip drivers/generic/generic #dimm 1-1-0
240             #   device i2c 56 on end
241             # end
242             # chip drivers/generic/generic #dimm 1-1-1
243             #   device i2c 57 on end
244             # end
245           end
246           device pci 2.0 on end                 # USB 1.1
247           device pci 2.1 on end                 # USB 2
248           device pci 4.0 off end                # Onboard audio (ACI)
249           device pci 4.1 off end                # Onboard modem (MCI)
250           device pci 6.0 on end                 # IDE
251           device pci 7.0 on end                 # SATA 1
252           device pci 8.0 on end                 # SATA 0
253           device pci 9.0 on end                 # PCI
254           device pci a.0 on end                 # NIC
255           device pci b.0 on end                 # PCI E 3
256           device pci c.0 on end                 # PCI E 2
257           device pci d.0 on end                 # PCI E 1
258           device pci e.0 on end                 # PCI E 0
259           register "ide0_enable" = "1"
260           register "ide1_enable" = "1"
261           register "sata0_enable" = "1"
262           register "sata1_enable" = "1"
263           # register "mac_eeprom_smbus" = "3"
264           # register "mac_eeprom_addr" = "0x51"
265         end
266       end
267       device pci 18.1 on end
268       device pci 18.2 on end
269       device pci 18.3 on end
270     end
271   end
272 end