d0ff85f1df99e9ac43ca7cdc6e7a8bf2d4b34e1e
[coreboot.git] / src / mainboard / technologic / ts5300 / Config.lb
1 uses HAVE_MP_TABLE
2 uses HAVE_PIRQ_TABLE
3 uses USE_FALLBACK_IMAGE
4 uses HAVE_FALLBACK_BOOT
5 uses HAVE_HARD_RESET
6 uses HAVE_OPTION_TABLE
7 uses USE_OPTION_TABLE
8 uses CONFIG_ROM_STREAM
9 uses IRQ_SLOT_COUNT
10 uses MAINBOARD
11 uses ARCH
12 uses FALLBACK_SIZE
13 uses STACK_SIZE
14 uses HEAP_SIZE
15 uses ROM_SIZE
16 uses ROM_SECTION_SIZE
17 uses ROM_IMAGE_SIZE
18 uses ROM_SECTION_SIZE
19 uses ROM_SECTION_OFFSET
20 uses CONFIG_ROM_STREAM_START
21 uses PAYLOAD_SIZE
22 uses _ROMBASE
23 uses XIP_ROM_SIZE
24 uses XIP_ROM_BASE
25 uses HAVE_MP_TABLE
26
27 ## ROM_SIZE is the size of boot ROM that this board will use.
28 default ROM_SIZE  = 256*1024
29
30 ###
31 ### Build options
32 ###
33
34 ##
35 ## Build code for the fallback boot
36 ##
37 default HAVE_FALLBACK_BOOT=1
38
39 ##
40 ## no MP table
41 ##
42 default HAVE_MP_TABLE=0
43
44 ##
45 ## Build code to reset the motherboard from linuxBIOS
46 ##
47 default HAVE_HARD_RESET=1
48
49 ##
50 ## Build code to export a programmable irq routing table
51 ##
52 default HAVE_PIRQ_TABLE=1
53 default IRQ_SLOT_COUNT=5
54 object irq_tables.o
55
56 ##
57 ## Build code to export a CMOS option table
58 ##
59 default HAVE_OPTION_TABLE=1
60
61 ###
62 ### LinuxBIOS layout values
63 ###
64
65 ## ROM_IMAGE_SIZE is the amount of space to allow linuxBIOS to occupy.
66 default ROM_IMAGE_SIZE = 65536
67
68 ##
69 ## Use a small 8K stack
70 ##
71 default STACK_SIZE=0x2000
72
73 ##
74 ## Use a small 16K heap
75 ##
76 default HEAP_SIZE=0x4000
77
78 ##
79 ## Only use the option table in a normal image
80 ##
81 #default USE_OPTION_TABLE = !USE_FALLBACK_IMAGE
82 default USE_OPTION_TABLE = 0
83
84 ##
85 ## Compute the location and size of where this firmware image
86 ## (linuxBIOS plus bootloader) will live in the boot rom chip.
87 ##
88 if USE_FALLBACK_IMAGE
89         default ROM_SECTION_SIZE   = FALLBACK_SIZE
90         default ROM_SECTION_OFFSET = ( ROM_SIZE - FALLBACK_SIZE )
91 else
92         default ROM_SECTION_SIZE   = ( ROM_SIZE - FALLBACK_SIZE )
93         default ROM_SECTION_OFFSET = 0
94 end
95
96 ##
97 ## Compute the start location and size size of
98 ## The linuxBIOS bootloader.
99 ##
100 default PAYLOAD_SIZE            = ( ROM_SECTION_SIZE - ROM_IMAGE_SIZE )
101 default CONFIG_ROM_STREAM_START = (0xffffffff - ROM_SIZE + ROM_SECTION_OFFSET + 1)
102 default CONFIG_ROM_STREAM     = 1
103
104 ##
105 ## Compute where this copy of linuxBIOS will start in the boot rom
106 ##
107 default _ROMBASE      = ( CONFIG_ROM_STREAM_START + PAYLOAD_SIZE )
108
109 ##
110 ## Compute a range of ROM that can cached to speed up linuxBIOS,
111 ## execution speed.
112 ##
113 ## XIP_ROM_SIZE must be a power of 2.
114 ## XIP_ROM_BASE must be a multiple of XIP_ROM_SIZE
115 ##
116 default XIP_ROM_SIZE=65536
117 default XIP_ROM_BASE = ( _ROMBASE + ROM_IMAGE_SIZE - XIP_ROM_SIZE )
118
119 ##
120 ## Set all of the defaults for an x86 architecture
121 ##
122
123 arch i386 end
124
125 ##
126 ## Build the objects we have code for in this directory.
127 ##
128
129
130 driver mainboard.o
131 #object reset.o
132
133 ##
134 ## Romcc output
135 ##
136 makerule ./failover.E
137         depends "$(MAINBOARD)/failover.c" 
138         action "$(CPP) -I$(TOP)/src $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/failover.c > ./failover.E"
139 end
140
141 makerule ./failover.inc
142         depends "./failover.E ./romcc"
143         action "./romcc -O -mcpu=c3 -o failover.inc --label-prefix=failover ./failover.E"
144 end
145
146 makerule ./auto.E 
147         depends "$(MAINBOARD)/auto.c" 
148         action  "$(CPP) -I$(TOP)/src $(ROMCCPPFLAGS) $(CPPFLAGS) $(MAINBOARD)/auto.c > ./auto.E"
149 end
150 makerule ./auto.inc 
151         depends "./auto.E ./romcc"
152         action  "./romcc   -O -mcpu=c3 ./auto.E "
153 end
154
155 ##
156 ## Build our 16 bit and 32 bit linuxBIOS entry code
157 ##
158 mainboardinit cpu/i386/entry16.inc
159 mainboardinit cpu/i386/entry32.inc
160 ldscript /cpu/i386/entry16.lds
161 ldscript /cpu/i386/entry32.lds
162
163 ##
164 ## Build our reset vector (This is where linuxBIOS is entered)
165 ##
166 if USE_FALLBACK_IMAGE 
167         mainboardinit cpu/i386/reset16.inc 
168         ldscript /cpu/i386/reset16.lds 
169 else
170         mainboardinit cpu/i386/reset32.inc 
171         ldscript /cpu/i386/reset32.lds 
172 end
173
174 ### Should this be in the northbridge code?
175 mainboardinit arch/i386/lib/cpu_reset.inc
176
177 ##
178 ## Include an id string (For safe flashing)
179 ##
180 mainboardinit arch/i386/lib/id.inc
181 ldscript /arch/i386/lib/id.lds
182
183 ##
184 ## Setup our mtrrs
185 ##
186 # mainboardinit cpu/p6/earlymtrr.inc
187
188 ###
189 ### This is the early phase of linuxBIOS startup 
190 ### Things are delicate and we test to see if we should
191 ### failover to another image.
192 ###
193 if USE_FALLBACK_IMAGE
194         ldscript /arch/i386/lib/failover.lds 
195         mainboardinit ./failover.inc
196 end
197
198 ###
199 ### O.k. We aren't just an intermediary anymore!
200 ###
201
202 ##
203 ## Setup RAM
204 ##
205 mainboardinit ./auto.inc
206
207 ##
208 ## Include the secondary Configuration files 
209 ##
210 dir /pc80
211 config chip.h
212
213 chip northbridge/amd/sc520
214         chip southbridge amd/sc520
215                 register "enable_usb" = "0"
216                 register "enable_native_ide" = "1"
217                 register "enable_com_ports" = "1"
218                 register "enable_keyboard" = "0"
219                 register "enable_nvram" = "1"
220         end
221         chip cpu/amd/sc520
222 end