Eliminate special case id.inc/id.lds in favor of a configuration variable ID_SECTION_...
[coreboot.git] / src / mainboard / tyan / s2895 / Config.lb
1 ## CONFIG_XIP_ROM_SIZE must be a power of 2.
2 default CONFIG_XIP_ROM_SIZE = 64 * 1024
3 include /config/failovercalculation.lb
4
5 arch i386 end
6
7 ##
8 ## Build the objects we have code for in this directory.
9 ##
10
11 driver mainboard.o
12 #needed by irq_tables and mptable and acpi_tables
13 object get_bus_conf.o
14
15 if CONFIG_GENERATE_MP_TABLE object mptable.o end
16 if CONFIG_GENERATE_PIRQ_TABLE object irq_tables.o end
17
18 if CONFIG_GENERATE_ACPI_TABLES
19         object acpi_tables.o
20         makerule dsdt.c
21                 depends "$(CONFIG_MAINBOARD)/dsdt.dsl"
22                 action  "iasl -p $(CURDIR)/dsdt -tc $(CONFIG_MAINBOARD)/dsdt.dsl"
23                 action  "mv dsdt.hex dsdt.c"
24         end
25         object ./dsdt.o
26         #./ssdt.o is moved to northbridge/amd/amdk8/Config.lb
27         #./fadt.o is moved to southbridge/nvidia/ck804/Config.lb
28 end
29
30 if CONFIG_USE_INIT
31         makerule ./auto.o
32                 depends "$(CONFIG_MAINBOARD)/cache_as_ram_auto.c option_table.h"
33                 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) -I$(TOP)/src -I. -c $(CONFIG_MAINBOARD)/cache_as_ram_auto.c -o $@"
34         end
35 else
36         makerule ./auto.inc
37                 depends "$(CONFIG_MAINBOARD)/cache_as_ram_auto.c option_table.h"
38                 action "$(CC) $(DISTRO_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(DEBUG_CFLAGS) -I$(TOP)/src -I. -c -S $(CONFIG_MAINBOARD)/cache_as_ram_auto.c -o $@"
39                 action "perl -e 's/\.rodata/.rom.data/g' -pi $@"
40                 action "perl -e 's/\.text/.section .rom.text/g' -pi $@"
41         end
42 end
43
44 ##
45 ## Build our 16 bit and 32 bit coreboot entry code
46 ##
47 if CONFIG_HAVE_FAILOVER_BOOT
48         if CONFIG_USE_FAILOVER_IMAGE
49                 mainboardinit cpu/x86/16bit/entry16.inc
50                 ldscript /cpu/x86/16bit/entry16.lds
51         end
52 else
53         if CONFIG_USE_FALLBACK_IMAGE
54                 mainboardinit cpu/x86/16bit/entry16.inc
55                 ldscript /cpu/x86/16bit/entry16.lds
56         end
57 end
58
59 mainboardinit cpu/x86/32bit/entry32.inc
60
61         if CONFIG_USE_INIT
62                 ldscript /cpu/x86/32bit/entry32.lds
63         end
64
65         if CONFIG_USE_INIT
66                 ldscript /cpu/amd/car/cache_as_ram.lds
67         end
68
69 ##
70 ## Build our reset vector (This is where coreboot is entered)
71 ##
72 if CONFIG_HAVE_FAILOVER_BOOT
73     if CONFIG_USE_FAILOVER_IMAGE
74         mainboardinit cpu/x86/16bit/reset16.inc
75         ldscript /cpu/x86/16bit/reset16.lds
76     else
77         mainboardinit cpu/x86/32bit/reset32.inc
78         ldscript /cpu/x86/32bit/reset32.lds
79     end
80 else
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 end
89
90 ##
91 ## Include an id string (For safe flashing)
92 ##
93 mainboardinit arch/i386/lib/id.inc
94 ldscript /arch/i386/lib/id.lds
95
96 ##
97 ## ROMSTRAP table for CK804
98 ##
99 if CONFIG_HAVE_FAILOVER_BOOT
100         if CONFIG_USE_FAILOVER_IMAGE
101                 mainboardinit southbridge/nvidia/ck804/romstrap.inc
102                 ldscript /southbridge/nvidia/ck804/romstrap.lds
103         end
104 else
105         if CONFIG_USE_FALLBACK_IMAGE
106                 mainboardinit southbridge/nvidia/ck804/romstrap.inc
107                 ldscript /southbridge/nvidia/ck804/romstrap.lds
108         end
109 end
110
111 ##
112 ## Setup Cache-As-Ram
113 ##
114         mainboardinit cpu/amd/car/cache_as_ram.inc
115
116 ###
117 ### This is the early phase of coreboot startup
118 ### Things are delicate and we test to see if we should
119 ### failover to another image.
120 ###
121 if CONFIG_HAVE_FAILOVER_BOOT
122         if CONFIG_USE_FAILOVER_IMAGE
123                         ldscript /arch/i386/lib/failover_failover.lds
124         end
125 else
126         if CONFIG_USE_FALLBACK_IMAGE
127                         ldscript /arch/i386/lib/failover.lds
128         end
129 end
130
131 ##
132 ## Setup RAM
133 ##
134         if CONFIG_USE_INIT
135                 initobject auto.o
136         else
137                 mainboardinit ./auto.inc
138         end
139
140 ##
141 ## Include the secondary Configuration files
142 ##
143 config chip.h
144
145 include devicetree.cb