]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/sh/edk7708/v2_0/src/edk.S
Initial revision
[karo-tx-redboot.git] / packages / hal / sh / edk7708 / v2_0 / src / edk.S
1 ##=============================================================================
2 ##
3 ##      edk.S
4 ##
5 ##      EDK board hardware setup
6 ##
7 ##=============================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 ##
13 ## eCos is free software; you can redistribute it and/or modify it under
14 ## the terms of the GNU General Public License as published by the Free
15 ## Software Foundation; either version 2 or (at your option) any later version.
16 ##
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 ## for more details.
21 ##
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 ##
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
32 ##
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
35 ##
36 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 ## at http://sources.redhat.com/ecos/ecos-license/
38 ## -------------------------------------------
39 #####ECOSGPLCOPYRIGHTEND####
40 ##=============================================================================
41 #######DESCRIPTIONBEGIN####
42 ##
43 ## Author(s):   jskov
44 ## Contributors:jskov
45 ## Date:        1999-05-03
46 ## Purpose:     EDK7708 board hardware setup
47 ## Description: This file contains any code needed to initialize the
48 ##              hardware on a Hitachi SH3 EDK7708 board.
49 ##
50 ######DESCRIPTIONEND####
51 ##
52 ##=============================================================================
53
54 #include <pkgconf/hal.h>
55 #include <cyg/hal/sh_regs.h>
56
57         .globl  _hal_hardware_init
58 _hal_hardware_init:
59
60         // Set up the Bus State Controller
61         mov.l    $BSC_settings_table,r3
62 1:      mov.w    @r3+,r0                // Address (or zero)
63         cmp/eq   #0,r0
64         bt       2f
65         mov.w    @r3+,r1                // data
66         bra      1b
67          mov.w    r1,@r0                // delay slot
68
69 2:
70         rts
71          nop
72
73         .align  2
74 $BSC_settings_table:
75         .long   BSC_settings_table
76 BSC_settings_table:
77         # These are the settings set by the Hitachi ROM Monitor.
78
79         # BCR2: Bus size of areas 1-6 to 32 bits
80         .word   CYGARC_REG_BCR2
81         .word   0x3ffc
82         # BCR1: Areas 2 and 3 are SDRAM
83         .word   CYGARC_REG_BCR1
84         .word   0x080c
85         # BCR2: Bus size of areas 1-6 to 32 bits [note: second write!]
86         .word   CYGARC_REG_BCR2
87         .word   0x3ffc
88         # WCR1: 3 wait-state cycles inserted for all areas
89         .word   CYGARC_REG_WCR1
90         .word   0x3fff
91         # WCR2: extra wait states and full pitch for burst
92         .word   CYGARC_REG_WCR2
93         .word   0xffd7
94         # MCR: RAS/CAS & burst timing area 2/3
95         .word   CYGARC_REG_MCR
96         .word   0x963c
97 #if 0
98         # DCR: RAS/CAS & burst timing area 2
99         .word   CYGARC_REG_DCR
100         .word   0x0000
101         # PCR: PCMCIA disabled
102         .word   CYGARC_REG_PCR
103         .word   0x0000
104 #endif
105         # RTCNT: refresh counter (needs a5 in top byte to accept write)
106         .word   CYGARC_REG_RTCNT
107         .word   (0xa500 | 0x0000)
108         # RTCOR: refresh time constant (needs a5 in top byte to accept write)
109         .word   CYGARC_REG_RTCOR
110         .word   (0xa500 | 0x003b)
111         # RFCR:  refresh count register (needs a4 in top byte to accept write)
112         .word   CYGARC_REG_RFCR
113         .word   (0xa400 | 0x0000)
114         # RTCSR: refresh timer control (needs a5 in top byte to accept write)
115         .word   CYGARC_REG_RTCSR
116         .word   (0xa500 | 0x0008)
117
118         # Set SDMR to 0x220
119         .word    0xd880
120         .word    0       
121         
122         # Table end
123         .word   0
124
125 #------------------------------------------------------------------------------
126 # end of edk.S