]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mac7100/mac7100evb/v2_0/include/hal_platform_setup.h
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / mac7100 / mac7100evb / v2_0 / include / hal_platform_setup.h
1 #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 // Copyright (C) 2003 Nick Garnett <nickg@calivar.com>
16 // Copyright (C) 2006 eCosCentric Ltd
17 //
18 // eCos is free software; you can redistribute it and/or modify it under
19 // the terms of the GNU General Public License as published by the Free
20 // Software Foundation; either version 2 or (at your option) any later version.
21 //
22 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
23 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
24 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25 // for more details.
26 //
27 // You should have received a copy of the GNU General Public License along
28 // with eCos; if not, write to the Free Software Foundation, Inc.,
29 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
30 //
31 // As a special exception, if other files instantiate templates or use macros
32 // or inline functions from this file, or you compile this file and link it
33 // with other works to produce a work based on this file, this file does not
34 // by itself cause the resulting work to be covered by the GNU General Public
35 // License. However the source code for this file must still be made available
36 // in accordance with section (3) of the GNU General Public License.
37 //
38 // This exception does not invalidate any other reasons why a work based on
39 // this file might be covered by the GNU General Public License.
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //=============================================================================
43 //#####DESCRIPTIONBEGIN####
44 //
45 // Author(s):   Ilija Koco <ilijak@siva.com.mk>
46 // Contributors:
47 // Date:        2006-06-07
48 // Purpose:     MAC7100EVB 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 #include <cyg/hal/hal_var_setup.h>
58 //===========================================================================
59
60     .macro _led y
61         ldr r0,=MAC7100_PIM_PORTDATA(MAC7100_PORT_F_OFFSET)
62         ldrh r1,[r0]
63         and r1,r1,#0x00ff
64         orr r1,r1,#(((~\y)&0xff)<<8)
65         strh r1,[r0]
66     .endm
67
68
69 // Initialize LED PORT
70 // Set appropriate peripheral pins
71     .macro  _led_init
72         _led    0       // Set initial LED state. 
73         mov r1, #MAC7100_PIM_DDR  // Pin setting: Output+Low
74         ldr r0,=MAC7100_PIM_CONFIG(MAC7100_PORT_F_OFFSET, 8) // LED pin cfg
75         strh r1,[r0],#2 // LED: LSB ...
76         strh r1,[r0],#2
77         strh r1,[r0],#2
78         strh r1,[r0],#2
79         strh r1,[r0],#2
80         strh r1,[r0],#2
81         strh r1,[r0],#2
82         strh r1,[r0],#2 // LED: ... MSB
83     .endm
84
85
86 // Clock initilalization
87     .macro  _pclock_init
88                 _mac7100_setpll
89     .endm
90
91 // Memory re-mapping
92     .macro _memory_remap
93                 _mac7100_remap_single_chip
94     .endm
95
96
97 // Initialize paralel port
98     .macro  _pio_init
99     .endm
100
101
102 #define CYGHWR_LED_MACRO _led \x
103
104 //===========================================================================
105                         
106 #if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
107
108     .macro  _setup
109         ldr r0,=VAE_MAC7100_FlashSecurity
110         _led_init
111         _memory_remap
112         _pclock_init
113         _pio_init
114     .endm
115
116 #define CYGSEM_HAL_ROM_RESET_USES_JUMP
117
118 #else
119
120     .macro  _setup
121         _led_init
122         _led 16
123         _pclock_init
124         _pio_init        
125     .endm
126         
127 #endif
128
129 #define PLATFORM_SETUP1     _setup
130
131 //-----------------------------------------------------------------------------
132 // end of hal_platform_setup.h
133 #endif // CYGONCE_HAL_PLATFORM_SETUP_H