]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/h8300/aki3068net/v2_0/include/platform.inc
Initial revision
[karo-tx-redboot.git] / packages / hal / h8300 / aki3068net / v2_0 / include / platform.inc
1 #ifndef CYGONCE_HAL_PLATFORM_INC
2 #define CYGONCE_HAL_PLATFORM_INC
3 ##=============================================================================
4 ##
5 ##      platform.inc
6 ##
7 ##      AKI3068NET "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):    Yoshinori Saro
46 ## Contributors: Yoshinori Sato
47 ## Date:         2002-04-06
48 ## Purpose:      AKI3068NET "board" definitions.
49 ## Description:  This file contains various definitions and macros that are
50 ##               required for writing assembly code for the AKI3068NET board
51 ##               Currently there are none
52 ## Usage:
53 ##               #include <cyg/hal/platform.inc>
54 ##               ...
55 ##              
56 ##
57 ######DESCRIPTIONEND####
58 ##
59 ##=============================================================================
60
61 #include <pkgconf/hal.h>
62
63 #include <cyg/hal/mod_regs_bsc.h>
64 #include <cyg/hal/mod_regs_pio.h>
65
66 ##-----------------------------------------------------------------------------
67
68 #if (CYGINT_HAL_PLF_IF_IDE != 0 && (CYGHWR_HAL_IDE_BUSWIDTH == 16))
69 #define ABWCR_VAL ~((1 << ((CYGHWR_HAL_IDE_REGISTER >> 21) & 7)) |\
70                     (1 << ((CYGHWR_HAL_IDE_ALT_REGS >> 21) & 7))) 
71 #else
72 #define ABWCR_VAL 0xff
73 #endif
74 #if (CYGINT_HAL_PLF_IF_IDE != 0)
75 #define CSCR_VAL ((1 << ((CYGHWR_HAL_IDE_REGISTER >> 21) & 7)) |\
76                   (1 << ((CYGHWR_HAL_IDE_ALT_REGS >> 21) & 7))) 
77 #endif
78
79 #define CYGPKG_HAL_H8300_MEMC_DEFINED
80         .macro  hal_memc_init
81 #if defined(CYG_HAL_STARTUP_ROM)
82         mov.l   #init_regs,er0
83 1:
84         mov.w   @er0+,r2
85         beq     1f
86         mov.w   #0x00ff,e2      ; internal I/O regs (2) high address
87         cmp.w   #0xf000,r2
88         bhi     2f
89         dec.w   #1,e2           ; internal I/O regs (1) high address
90 2:
91         mov.w   @er0+,r1
92         mov.b   r1l,@er2
93         bra     1b
94
95 #define INIT_REGS_DATA(REGS,DATA) \
96         .word   (REGS & 0xffff),DATA
97
98 init_regs:
99 INIT_REGS_DATA(CYGARC_RTCOR,9)
100 INIT_REGS_DATA(CYGARC_RTMCSR,0x30)
101 INIT_REGS_DATA(CYGARC_DRCRB,0x98)
102 INIT_REGS_DATA(CYGARC_DRCRA,0x38)
103 INIT_REGS_DATA(CYGARC_ASTCR,0xfb)
104 INIT_REGS_DATA(CYGARC_ABWCR,ABWCR_VAL)
105 #if defined(CSCR_VAL)
106 INIT_REGS_DATA(CYGARC_CSCR,((CSCR_VAL) & 0xf0) | 0x0f)
107 #endif
108 INIT_REGS_DATA(CYGARC_WCRH ,0xff)
109 INIT_REGS_DATA(CYGARC_WCRL ,0xc8)
110 INIT_REGS_DATA(CYGARC_P1DDR,0xff)
111 INIT_REGS_DATA(CYGARC_P2DDR,0xff)
112 INIT_REGS_DATA(CYGARC_P5DDR,0x01)
113 INIT_REGS_DATA(CYGARC_P8DDR,0x0e)
114         .word   0
115 init_regs_end:
116 ;; Thanks Hiroyuki Senshu & Hiroki Minematsu
117
118 ;; External peripheral setup delay
119 1:
120         mov.l   #420000,er0     ;wait 50ms
121 2:
122         dec.l   #1,er0
123         bpl     2b
124 #endif
125         .endm
126
127 #define CYGPKG_HAL_H8300_DIAG_DEFINED
128
129         .macro  hal_diag_init
130         mov.b   #0x83,r0l
131         mov.b   r0l,@CYGARC_PADDR
132         mov.b   #0,r0l
133         mov.b   r0l,@CYGARC_PADR
134         .endm
135
136         .macro  hal_diag_excpt_start
137         .endm
138
139         .macro  hal_diag_intr_start
140         .endm
141
142         .macro  hal_diag_restore
143         .endm
144
145         .macro  hal_diag_data
146         .endm
147
148 #if defined(CYGPKG_IO_ETH_DRIVERS)
149 #define CYGPKG_HAL_H8300_SAVED_VECTORS
150         .macro  h8300_save_vectors
151         .byte   15
152         .endm
153 #endif
154
155 #------------------------------------------------------------------------------
156 #endif // ifndef CYGONCE_HAL_PLATFORM_INC
157 # end of platform.inc