comparison packages/hal/mn10300/asb/current/include/platform.inc @ 208:e0c0827131d1 ecos

Merge from eCos master repository on 2002-05-20-20:11:54-BST
author jlarmour
date Mon, 20 May 2002 22:19:26 +0000
parents
children d2c90368aeef
comparison
equal deleted inserted replaced
207:74c807ddde34 208:e0c0827131d1
1 #ifndef CYGONCE_HAL_PLATFORM_INC
2 #define CYGONCE_HAL_PLATFORM_INC
3 ##=============================================================================
4 ##
5 ## platform.inc
6 ##
7 ## ASB2303 board assembler header file
8 ##
9 ##=============================================================================
10 #####ECOSGPLCOPYRIGHTBEGIN####
11 # -------------------------------------------
12 # This file is part of eCos, the Embedded Configurable Operating System.
13 # Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 #
15 # eCos is free software; you can redistribute it and/or modify it under
16 # the terms of the GNU General Public License as published by the Free
17 # Software Foundation; either version 2 or (at your option) any later version.
18 #
19 # eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # for more details.
23 #
24 # You should have received a copy of the GNU General Public License along
25 # with eCos; if not, write to the Free Software Foundation, Inc.,
26 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 #
28 # As a special exception, if other files instantiate templates or use macros
29 # or inline functions from this file, or you compile this file and link it
30 # with other works to produce a work based on this file, this file does not
31 # by itself cause the resulting work to be covered by the GNU General Public
32 # License. However the source code for this file must still be made available
33 # in accordance with section (3) of the GNU General Public License.
34 #
35 # This exception does not invalidate any other reasons why a work based on
36 # this file might be covered by the GNU General Public License.
37 #
38 # Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 # at http://sources.redhat.com/ecos/ecos-license
40 # -------------------------------------------
41 #####ECOSGPLCOPYRIGHTEND####
42 ##=============================================================================
43 #######DESCRIPTIONBEGIN####
44 ##
45 ## Author(s): dmoseley
46 ## Contributors:dmoseley
47 ## Date: 2000-08-11
48 ## Purpose: ASB board definitions.
49 ## Description: This file contains various definitions and macros that are
50 ## useful for writing assembly code for the ASB board.
51 ## Usage:
52 ## #include <cyg/hal/platform.inc>
53 ## ...
54 ##
55 ##
56 ######DESCRIPTIONEND####
57 ##
58 ##=============================================================================
59
60 #include <pkgconf/hal.h>
61 #include <cyg/hal/plf_io.h>
62
63 #------------------------------------------------------------------------------
64 # Diagnostics macros.
65
66 #include <cyg/hal/hal_io.h>
67
68 .macro hal_diag_data
69 .globl hal_diag_led_state
70 hal_diag_led_state: .long 0xffffffff
71 hal_diag_intr_count: .long 0
72 .endm
73
74 #define HAL_EARLY_INIT hal_led_init
75 .macro hal_led_init
76 # Setup Port 0 as all output
77 # Do this the very first thing so we have LED debugging available early
78 mov HAL_GPIO_MODE_ALL_OUTPUT,d0
79 mov HAL_GPIO_0_MODE,a0
80 mov d0,(a0)
81 .endm
82
83 .macro hal_diag_init
84 hal_led_init
85 jmp 1f
86
87 hal_diag_digits:
88 .byte 0x81 # 0
89 .byte 0xf3 # 1
90 .byte 0x49 # 2
91 .byte 0x61 # 3
92 .byte 0x33 # 4
93 .byte 0x25 # 5
94 .byte 0x05 # 6
95 .byte 0xf1 # 7
96 .byte 0x01 # 8
97 .byte 0x21 # 9
98 .byte 0x11 # A
99 .byte 0x07 # B
100 .byte 0x8d # C
101 .byte 0x43 # D
102 .byte 0x0d # E
103 .byte 0x1d # F
104
105 hal_diag_hex_digits:
106 .ascii "0123456789ABCDEF"
107
108 1:
109 hal_diag_led 0
110 .endm
111
112 .macro hal_diag_excpt_start
113 mov HAL_LED_ADDRESS,a0
114 mov (a0),d0
115 xor 0x01000000,d0
116 mov d0,(a0)
117 .endm
118
119 .macro hal_diag_intr_start
120 mov (hal_diag_intr_count),d1
121 inc d1
122 cmp 100,d1
123 bne x\@
124 clr d1
125 mov HAL_LED_ADDRESS,a0
126 mov (a0),d0
127 xor 0x00010000,d0
128 mov d0,(a0)
129 x\@:
130 mov d1,(hal_diag_intr_count)
131 .endm
132
133 .macro hal_diag_restore
134 mov (hal_diag_intr_count),d0
135 and 0x1000,d0
136 beq x\@
137 mov HAL_LED_ADDRESS,a0
138 mov (a0),d0
139 and 0xfffeffff,d0
140 mov d0,(a0)
141 x\@:
142 .endm
143
144 .macro hal_diag_led val
145 movm [d2,d3,a2],(sp)
146 0: mov hal_diag_digits,a2
147 mov \val,d2
148 and 0xf,d2
149 add d2,a2
150 movbu (a2),d3
151 mov HAL_LED_ADDRESS,a2
152 mov (a2),d2
153 asl 8,d2
154 or d3,d2
155 mov d2,(a2)
156 movm (sp),[d2,d3,a2]
157 .endm
158
159 #define CYGPKG_HAL_MN10300_DIAG_DEFINED
160
161 #------------------------------------------------------------------------------
162 # MEMC macros.
163
164 #ifndef CYGPKG_HAL_MN10300_MEMC_DEFINED
165
166 // These settings follow the recommended settings in the
167 // "MN103E010 Evaluation Board User's Guide"
168
169 #define BCCR 0xC0002000
170 #define BCCR_INIT 0x12040580
171
172 #define SBBASE0 0xD8C00100
173 #define SBBASE0_INIT 0x8000FC01
174 #define SBBASE1 0xD8C00110
175 #define SBBASE1_INIT 0x8400FC01
176 #define SBBASE2 0xD8C00120
177 #define SBBASE2_INIT 0x8600FFF1
178 #define SBBASE3 0xD8C00130
179 #define SBBASE3_INIT 0x00000000
180 #define SBBASE4 0xD8C00140
181 #define SBBASE4_INIT 0x00000000
182 #define SBBASE5 0xD8C00150
183 #define SBBASE5_INIT 0x00000000
184 #define SBBASE6 0xD8C00160
185 #define SBBASE6_INIT 0x00000000
186 #define SBBASE7 0xD8C00170
187 #define SBBASE7_INIT 0x00000000
188
189 #define SBCTRL00 0xD8C00200
190 #define SBCTRL00_INIT 0x21111000
191 #define SBCTRL10 0xD8C00210
192 #define SBCTRL10_INIT 0x21111000
193 #define SBCTRL20 0xD8C00220
194 #define SBCTRL20_INIT 0x21111000
195 #define SBCTRL30 0xD8C00230
196 #define SBCTRL30_INIT 0x00000000
197 #define SBCTRL40 0xD8C00240
198 #define SBCTRL40_INIT 0x00000000
199 #define SBCTRL50 0xD8C00250
200 #define SBCTRL50_INIT 0x00000000
201 #define SBCTRL60 0xD8C00260
202 #define SBCTRL60_INIT 0x00000000
203 #define SBCTRL70 0xD8C00270
204 #define SBCTRL70_INIT 0x00000000
205
206 #define SBCTRL01 0xD8C00204
207 #define SBCTRL01_INIT 0x00100200
208 #define SBCTRL11 0xD8C00214
209 #define SBCTRL11_INIT 0x00100200
210 #define SBCTRL21 0xD8C00224
211 #define SBCTRL21_INIT 0x00100200
212 #define SBCTRL31 0xD8C00234
213 #define SBCTRL31_INIT 0x00000000
214 #define SBCTRL41 0xD8C00244
215 #define SBCTRL41_INIT 0x00000000
216 #define SBCTRL51 0xD8C00254
217 #define SBCTRL51_INIT 0x00000000
218 #define SBCTRL61 0xD8C00264
219 #define SBCTRL61_INIT 0x00000000
220 #define SBCTRL71 0xD8C00274
221 #define SBCTRL71_INIT 0x00000000
222
223 #define SBCTRL02 0xD8C00208
224 #define SBCTRL02_INIT 0x00000004
225 #define SBCTRL12 0xD8C00218
226 #define SBCTRL12_INIT 0x00000004
227 #define SBCTRL22 0xD8C00228
228 #define SBCTRL22_INIT 0x00000004
229 #define SBCTRL32 0xD8C00238
230 #define SBCTRL32_INIT 0x00000000
231 #define SBCTRL42 0xD8C00248
232 #define SBCTRL42_INIT 0x00000000
233 #define SBCTRL52 0xD8C00258
234 #define SBCTRL52_INIT 0x00000000
235 #define SBCTRL62 0xD8C00268
236 #define SBCTRL62_INIT 0x00000000
237 #define SBCTRL72 0xD8C00278
238 #define SBCTRL72_INIT 0x00000000
239
240 #define SDBASE0 0xDA000008
241 #define SDBASE0_INIT 0x9000FF81
242 #define SDBASE1 0xDA00000C
243 #define SDBASE1_INIT 0x9080FF81
244 #define SDRAMBUS 0xDA000000
245 #define SDRAMBUS_INIT 0xA8990654
246
247 .macro hal_memc_init
248 mov BCCR,a0
249 mov BCCR_INIT,d0
250 mov d0,(a0)
251
252 mov SBBASE0,a0
253 mov SBBASE0_INIT,d0
254 mov d0,(a0)
255
256 mov SBBASE1,a0
257 mov SBBASE1_INIT,d0
258 mov d0,(a0)
259
260 mov SBBASE2,a0
261 mov SBBASE2_INIT,d0
262 mov d0,(a0)
263
264 mov SBBASE3,a0
265 mov SBBASE3_INIT,d0
266 mov d0,(a0)
267
268 mov SBBASE4,a0
269 mov SBBASE4_INIT,d0
270 mov d0,(a0)
271
272 mov SBBASE5,a0
273 mov SBBASE5_INIT,d0
274 mov d0,(a0)
275
276 mov SBBASE6,a0
277 mov SBBASE6_INIT,d0
278 mov d0,(a0)
279
280 mov SBBASE7,a0
281 mov SBBASE7_INIT,d0
282 mov d0,(a0)
283
284 mov SBCTRL00,a0
285 mov SBCTRL00_INIT,d0
286 mov d0,(a0)
287
288 mov SBCTRL10,a0
289 mov SBCTRL10_INIT,d0
290 mov d0,(a0)
291
292 mov SBCTRL20,a0
293 mov SBCTRL20_INIT,d0
294 mov d0,(a0)
295
296 mov SBCTRL30,a0
297 mov SBCTRL30_INIT,d0
298 mov d0,(a0)
299
300 mov SBCTRL40,a0
301 mov SBCTRL40_INIT,d0
302 mov d0,(a0)
303
304 mov SBCTRL50,a0
305 mov SBCTRL50_INIT,d0
306 mov d0,(a0)
307
308 mov SBCTRL60,a0
309 mov SBCTRL60_INIT,d0
310 mov d0,(a0)
311
312 mov SBCTRL70,a0
313 mov SBCTRL70_INIT,d0
314 mov d0,(a0)
315
316 mov SBCTRL01,a0
317 mov SBCTRL01_INIT,d0
318 mov d0,(a0)
319
320 mov SBCTRL11,a0
321 mov SBCTRL11_INIT,d0
322 mov d0,(a0)
323
324 mov SBCTRL21,a0
325 mov SBCTRL21_INIT,d0
326 mov d0,(a0)
327
328 mov SBCTRL31,a0
329 mov SBCTRL31_INIT,d0
330 mov d0,(a0)
331
332 mov SBCTRL41,a0
333 mov SBCTRL41_INIT,d0
334 mov d0,(a0)
335
336 mov SBCTRL51,a0
337 mov SBCTRL51_INIT,d0
338 mov d0,(a0)
339
340 mov SBCTRL61,a0
341 mov SBCTRL61_INIT,d0
342 mov d0,(a0)
343
344 mov SBCTRL71,a0
345 mov SBCTRL71_INIT,d0
346 mov d0,(a0)
347
348 mov SBCTRL02,a0
349 mov SBCTRL02_INIT,d0
350 mov d0,(a0)
351
352 mov SBCTRL12,a0
353 mov SBCTRL12_INIT,d0
354 mov d0,(a0)
355
356 mov SBCTRL22,a0
357 mov SBCTRL22_INIT,d0
358 mov d0,(a0)
359
360 mov SBCTRL32,a0
361 mov SBCTRL32_INIT,d0
362 mov d0,(a0)
363
364 mov SBCTRL42,a0
365 mov SBCTRL42_INIT,d0
366 mov d0,(a0)
367
368 mov SBCTRL52,a0
369 mov SBCTRL52_INIT,d0
370 mov d0,(a0)
371
372 mov SBCTRL62,a0
373 mov SBCTRL62_INIT,d0
374 mov d0,(a0)
375
376 mov SBCTRL72,a0
377 mov SBCTRL72_INIT,d0
378 mov d0,(a0)
379
380 mov SDBASE0,a0
381 mov SDBASE0_INIT,d0
382 mov d0,(a0)
383
384 mov SDBASE1,a0
385 mov SDBASE1_INIT,d0
386 mov d0,(a0)
387
388 mov SDRAMBUS,a0
389 mov SDRAMBUS_INIT,d0
390 mov d0,(a0)
391
392 # Jump forward so we start running from the 80000000 base address
393 mov 0f,a0
394 jmp (a0)
395 0:
396 .endm
397
398 #define CYGPKG_HAL_MN10300_MEMC_DEFINED
399
400 #endif
401
402
403 //-----------------------------------------------------------------------------
404 // Syscall support.
405 #ifdef CYGPKG_CYGMON
406 // Cygmon provides syscall handling for this board
407 // These must be kept in sync with the rest of the tree.
408 #define SIGSYS 12
409 #define SIGSYSCALL SIGSYS
410 #endif
411
412 #------------------------------------------------------------------------------
413 #endif // ifndef CYGONCE_HAL_PLATFORM_INC
414 # end of platform.inc