1 |
27 |
unneback |
#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 Red Hat, 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 version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
21 |
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License along
|
26 |
|
|
// with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use macros
|
30 |
|
|
// or inline functions from this file, or you compile this file and link it
|
31 |
|
|
// with other works to produce a work based on this file, this file does not
|
32 |
|
|
// by itself cause the resulting work to be covered by the GNU General Public
|
33 |
|
|
// License. However the source code for this file must still be made available
|
34 |
|
|
// in accordance with section (3) of the GNU General Public License.
|
35 |
|
|
//
|
36 |
|
|
// This exception does not invalidate any other reasons why a work based on
|
37 |
|
|
// this file might be covered by the GNU General Public License.
|
38 |
|
|
//
|
39 |
|
|
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
40 |
|
|
// at http://sources.redhat.com/ecos/ecos-license/
|
41 |
|
|
// -------------------------------------------
|
42 |
|
|
//####ECOSGPLCOPYRIGHTEND####
|
43 |
|
|
//=============================================================================
|
44 |
|
|
//#####DESCRIPTIONBEGIN####
|
45 |
|
|
//
|
46 |
|
|
// Author(s): David A Rusling
|
47 |
|
|
// Contributors: Philippe Robin
|
48 |
|
|
// Date: November 7, 2000
|
49 |
|
|
// Purpose: ARM INTEGRATOR platform specific support routines
|
50 |
|
|
// Description:
|
51 |
|
|
// Usage: #include <cyg/hal/hal_platform_setup.h>
|
52 |
|
|
//
|
53 |
|
|
//####DESCRIPTIONEND####
|
54 |
|
|
//
|
55 |
|
|
//===========================================================================*/
|
56 |
|
|
|
57 |
|
|
#include <cyg/hal/hal_integrator.h>
|
58 |
|
|
|
59 |
|
|
#ifdef CYG_HAL_STARTUP_ROMRAM
|
60 |
|
|
#define CYGSEM_HAL_ROM_RESET_USES_JUMP
|
61 |
|
|
#endif
|
62 |
|
|
|
63 |
|
|
// Define macro used to diddle the LEDs during early initialization.
|
64 |
|
|
// Can use r0+r1. Argument in \x.
|
65 |
|
|
// Control the LEDs PP0-PP3. This requires the jumpers on pins 9-16 to
|
66 |
|
|
// be set on LK11 in order to be visible. Otherwise the parallel port
|
67 |
|
|
// data pins are diddled instead.
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
#ifdef CYGHWR_HAL_ARM_INTEGRATOR_DIAG_LEDS
|
71 |
|
|
#define CYGHWR_LED_MACRO \
|
72 |
|
|
mov r1, #(15 & (\x)) ;\
|
73 |
|
|
ldr r0,=INTEGRATOR_DBG_BASE ;\
|
74 |
|
|
strb r1, [r0, #INTEGRATOR_DBG_LEDS_OFFSET] ;
|
75 |
|
|
#endif
|
76 |
|
|
|
77 |
|
|
#define PLATFORM_SETUP1 platform_setup1
|
78 |
|
|
|
79 |
|
|
.macro platform_setup1
|
80 |
|
|
#ifdef CYG_HAL_STARTUP_ROMRAM
|
81 |
|
|
// This warps execution away from location 0+x to 0x24000000+x
|
82 |
|
|
// so that we can turn the FLASH remapping off.
|
83 |
|
|
orr pc,pc,#0x24000000
|
84 |
|
|
nop
|
85 |
|
|
nop
|
86 |
|
|
nop
|
87 |
|
|
nop
|
88 |
|
|
#endif
|
89 |
|
|
ldr r0,=INTEGRATOR_DBG_BASE
|
90 |
|
|
ldr r1,=0
|
91 |
|
|
strb r1, [r0, #INTEGRATOR_DBG_LEDS_OFFSET]
|
92 |
|
|
ldr r0, =INTEGRATOR_HDR_BASE
|
93 |
|
|
ldr r1, [r0, #INTEGRATOR_HDR_CTRL_OFFSET]
|
94 |
|
|
orr r1, r1, #INTEGRATOR_HDR_CTRL_REMAP
|
95 |
|
|
str r1, [r0, #INTEGRATOR_HDR_CTRL_OFFSET]
|
96 |
|
|
ldr r1, =INTEGRATOR_IRQCONT_BASE
|
97 |
|
|
ldr r0, =0xFFFFFFFF
|
98 |
|
|
str r0, [r1, #INTEGRATOR_IRQENABLECLEAR]
|
99 |
|
|
str r0, [r1, #INTEGRATOR_FIQENABLECLEAR]
|
100 |
|
|
ldr r0,=INTEGRATOR_DBG_BASE
|
101 |
|
|
ldr r1,=0xF
|
102 |
|
|
strb r1, [r0, #INTEGRATOR_DBG_LEDS_OFFSET]
|
103 |
|
|
|
104 |
|
|
LED 7
|
105 |
|
|
#ifdef CYG_HAL_STARTUP_ROMRAM
|
106 |
|
|
#if 0
|
107 |
|
|
// Compute [logical] base address of this image in ROM
|
108 |
|
|
bl 10f
|
109 |
|
|
10: mov r9,lr // R9 = ROM address of 10:
|
110 |
|
|
ldr r8,=10b // R8 = RAM address of 10:
|
111 |
|
|
sub r9,r9,r8 // R9 = ROM-RAM
|
112 |
|
|
ldr r0,=__exception_handlers // R0 = RAM address of __exception_handlers
|
113 |
|
|
add r0,r0,r9 // R0 = ROM address of __exception_handlers
|
114 |
|
|
#endif
|
115 |
|
|
|
116 |
|
|
ldr r0,=0x24000000
|
117 |
|
|
ldr r1,=__exception_handlers // ram base & length
|
118 |
|
|
ldr r2,=__rom_data_end
|
119 |
|
|
20: ldr r3,[r0],#4
|
120 |
|
|
str r3,[r1],#4
|
121 |
|
|
cmp r1,r2
|
122 |
|
|
bne 20b
|
123 |
|
|
ldr r0,=30f
|
124 |
|
|
mov pc,r0
|
125 |
|
|
nop
|
126 |
|
|
nop
|
127 |
|
|
nop
|
128 |
|
|
nop
|
129 |
|
|
30:
|
130 |
|
|
#endif
|
131 |
|
|
LED 6
|
132 |
|
|
|
133 |
|
|
.endm
|
134 |
|
|
|
135 |
|
|
/*---------------------------------------------------------------------------*/
|
136 |
|
|
/* end of hal_platform_setup.h */
|
137 |
|
|
#endif /* CYGONCE_HAL_PLATFORM_SETUP_H */
|