1 #ifndef CYGONCE_HAL_PLATFORM_SETUP_H
2 #define CYGONCE_HAL_PLATFORM_SETUP_H
4 /*=============================================================================
6 // hal_platform_setup.h
8 // Platform specific support for HAL (assembly code)
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.
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.
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
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.
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.
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.
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####
49 // Purpose: E7T platform specific support routines
51 // Usage: #include <cyg/hal/hal_platform_setup.h>
53 //####DESCRIPTIONEND####
55 //===========================================================================*/
57 #include <cyg/hal/plf_io.h>
59 #define CYGHWR_LED_MACRO \
60 ldr r0,=E7T_IOPDATA ;\
61 mov r1, #((15 & (\x)) << 4) ;\
64 #if CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE==4096
65 // Override default to a more sensible value
66 #undef CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
67 #define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 2048
70 #if defined(CYG_HAL_STARTUP_ROM) || defined(CYG_HAL_STARTUP_ROMRAM)
71 #define PLATFORM_SETUP1 ;\
73 ldr r2,=0x0001fcf0 /* set led + seg to output */ ;\
75 ldr r1,=E7T_IOPDATA ;\
76 ldr r2,=0x00000050 /* set leds */ ;\
82 ldr r0,=E7T_EXTDBWTH ;\
86 /* The below are set with a store-multiple instruction */ ;\
87 /* Flash is 16 bit, SRAM is 32 bit */ ;\
88 /* .long E7T_EXTDBWTH */ ;\
89 12: .long ( (E7T_EXTDBWTH_16BIT<<E7T_EXTDBWTH_DSR0_shift) \
90 |(E7T_EXTDBWTH_32BIT<<E7T_EXTDBWTH_DSR1_shift) \
91 |(E7T_EXTDBWTH_32BIT<<E7T_EXTDBWTH_DSR2_shift) ) ;\
92 /* Flash at 0x01800000-0x01880000, 5 cycles, 4 cycles */ ;\
93 /* .long E7T_ROMCON0 */ ;\
94 .long ( (E7T_ROMCON_PMC_ROM) \
95 |(E7T_ROMCON_TPA_5C) \
96 |(E7T_ROMCON_TACC_4C) \
97 |((0x01800000 >> 16) << E7T_ROMCON_BASE_shift) \
98 |((0x01880000 >> 16) << E7T_ROMCON_NEXT_shift)) ;\
99 /* SRAM at 0x00000000-0x00400000, 5 cycles, 2 cycles */ ;\
100 /* .long E7T_ROMCON1 */ ;\
101 .long ( (E7T_ROMCON_PMC_ROM) \
102 |(E7T_ROMCON_TPA_5C) \
103 |(E7T_ROMCON_TACC_2C) \
104 |((0x00000000 >> 16) << E7T_ROMCON_BASE_shift) \
105 |((0x00040000 >> 16) << E7T_ROMCON_NEXT_shift)) ;\
106 /* SRAM at 0x00400000-0x00800000, 5 cycles, 2 cycles */ ;\
107 /* .long E7T_ROMCON2 */ ;\
108 .long ( (E7T_ROMCON_PMC_ROM) \
109 |(E7T_ROMCON_TPA_5C) \
110 |(E7T_ROMCON_TACC_2C) \
111 |((0x00040000 >> 16) << E7T_ROMCON_BASE_shift) \
112 |((0x00080000 >> 16) << E7T_ROMCON_NEXT_shift)) ;\
113 /* Below values are what Boot Monitor sets up */ ;\
114 /* .long E7T_ROMCON3 */ ;\
116 /* .long E7T_ROMCON4 */ ;\
118 /* .long E7T_ROMCON5 */ ;\
120 /* .long E7T_DRAMCON0 */ ;\
122 /* .long E7T_DRAMCON1 */ ;\
124 /* .long E7T_DRAMCON2 */ ;\
126 /* .long E7T_DRAMCON3 */ ;\
128 /* .long E7T_REFEXTCON */ ;\
133 #define PLATFORM_SETUP1
136 //-----------------------------------------------------------------------------
137 // end of hal_platform_setup.h
138 #endif // CYGONCE_HAL_PLATFORM_SETUP_H