OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [arm/] [at91/] [eb40/] [current/] [include/] [hal_platform_setup.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
#ifndef CYGONCE_HAL_PLATFORM_SETUP_H
2
#define CYGONCE_HAL_PLATFORM_SETUP_H
3
 
4
/*=============================================================================
5
//
6
//      hal_platform_setup.h
7
//
8
//      Platform specific support for HAL (assembly code)
9
//
10
//=============================================================================
11
// ####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
15
//
16
// eCos is free software; you can redistribute it and/or modify it under
17
// the terms of the GNU General Public License as published by the Free
18
// Software Foundation; either version 2 or (at your option) any later
19
// version.
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License
27
// along with eCos; if not, write to the Free Software Foundation, Inc.,
28
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
29
//
30
// As a special exception, if other files instantiate templates or use
31
// macros or inline functions from this file, or you compile this file
32
// and link it with other works to produce a work based on this file,
33
// this file does not by itself cause the resulting work to be covered by
34
// the GNU General Public License. However the source code for this file
35
// must still be made available in accordance with section (3) of the GNU
36
// General Public License v2.
37
//
38
// This exception does not invalidate any other reasons why a work based
39
// on this file might be covered by the GNU General Public License.
40
// -------------------------------------------
41
// ####ECOSGPLCOPYRIGHTEND####
42
//=============================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):   gthomas
46
// Contributors:gthomas
47
// Date:        2001-07-12
48
// Purpose:     AT91/EB40 platform specific support routines
49
// Description:
50
// Usage:       #include <cyg/hal/hal_platform_setup.h>
51
//
52
//####DESCRIPTIONEND####
53
//
54
//===========================================================================*/
55
 
56
#include <cyg/hal/var_io.h>
57
 
58
#if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
59
 
60
        .macro  _setup
61
        ldr     r10,=_InitMemory        // Initialize memory controller
62
        movs    r0,pc,lsr #20           // If ROM startup, PC < 0x100000
63
        moveq   r10,r10,lsl #12         //   mask address to low 20 bits
64
        moveq   r10,r10,lsr #12
65
        ldmia   r10!,{r0-r9,r11-r12}    // Table of initialization constants
66
#if defined(CYG_HAL_STARTUP_ROMRAM)
67
        ldr     r10,=0x0000FFFF
68
        and     r12,r12,r10
69
        ldr     r10,=0x01010000
70
        orr     r12,r12,r10
71
#endif        
72
        stmia   r11!,{r0-r9}            // Write to controller
73
        mov     pc,r12                  // Change address space, break pipeline
74
_InitMemory:
75
        .long   0x01002535  // 0x01000000, 16MB,  2 cycles after transfer, 16-bit, 6 wait states
76
        .long   0x02002121  // 0x02000000, 16MB,  0 cycles after transfer, 16-bit, 1 wait state
77
        .long   0x20000000  // unused
78
        .long   0x30000000  // unused
79
        .long   0x40000000  // unused
80
        .long   0x50000000  // unused
81
        .long   0x60000000  // unused
82
        .long   0x70000000  // unused
83
        .long   0x00000001  // REMAP command
84
        .long   0x00000006  // 7 memory regions, standard read
85
        .long   AT91_EBI    // External Bus Interface address
86
        .long   10f         // address where to jump
87
10:
88
 
89
#if defined(CYG_HAL_STARTUP_ROMRAM)
90
        ldr     r0,=0x01010000          // Relocate FLASH/ROM to on-chip RAM
91
        ldr     r1,=0x02000000          // RAM base & length
92
        ldr     r2,=0x02010000
93
20:     ldr     r3,[r0],#4
94
        str     r3,[r1],#4
95
        cmp     r1,r2
96
        bne     20b
97
        ldr     r0,=30f
98
        mov     pc,r0
99
30:
100
#endif
101
 
102
        ldr     r0,=AT91_PS             // Power saving interface
103
        ldr     r1,=0xFFFFFFFF          // Enable all peripheral [clocks]
104
        str     r1,[r0,#AT91_PS_PCER]
105
        ldr     r0,=AT91_PIO            // Disable PIO (so peripherals can use bits)
106
        ldr     r1,=0x0070FE49          // UART, FIQ, EINT, Timer clocks
107
        str     r1,[r0,#AT91_PIO_PDR]
108
        ldr     r1,=0x000001B6          // LEDs
109
        str     r1,[r0,#AT91_PIO_OER]
110
        str     r1,[r0,#AT91_PIO_SODR]
111
        .endm
112
 
113
#define CYGSEM_HAL_ROM_RESET_USES_JUMP
114
#define PLATFORM_SETUP1     _setup
115
#else
116
#define PLATFORM_SETUP1
117
#endif
118
 
119
//-----------------------------------------------------------------------------
120
// end of hal_platform_setup.h
121
#endif // CYGONCE_HAL_PLATFORM_SETUP_H

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.