annotate packages/hal/arm/arm9/smdk2410/current/src/smdk2410_misc.c @ 2830:3caad2060bd3

Strip erroneous CR chars from text files in the eCos repository. [ Bugzilla 1000694]
author jld
date Wed, 25 Feb 2009 12:50:14 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
1 //==========================================================================
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
2 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
3 // smdk2410_misc.c
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
4 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
5 // HAL misc board support code for ARM9/SMDK2410
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
6 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
7 //==========================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
8 // ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
9 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
10 // This file is part of eCos, the Embedded Configurable Operating System.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
12 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
13 // eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
14 // the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
15 // Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
16 // version.
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
17 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
18 // eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
21 // for more details.
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
22 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
23 // You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
24 // along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
26 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
27 // As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
28 // macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
29 // and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
30 // this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
31 // the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
32 // must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
33 // General Public License v2.
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
34 //
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
35 // This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
36 // on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
37 // -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 1152
diff changeset
38 // ####ECOSGPLCOPYRIGHTEND####
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
39 //==========================================================================
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
40 //#####DESCRIPTIONBEGIN####
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
41 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
42 // Author(s): michael anburaj <michaelanburaj@hotmail.com>
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
43 // Contributors: michael anburaj <michaelanburaj@hotmail.com>
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
44 // Date: 2003-08-01
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
45 // Purpose: HAL board support
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
46 // Description: Implementations of HAL board interfaces
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
47 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
48 //####DESCRIPTIONEND####
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
49 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
50 //==========================================================================
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
51
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
52 #include <pkgconf/hal.h>
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
53 #include <pkgconf/system.h>
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
54 #include CYGBLD_HAL_PLATFORM_H
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
55
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
56 #include <cyg/infra/cyg_type.h> // base types
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
57 #include <cyg/infra/cyg_trac.h> // tracing macros
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
58 #include <cyg/infra/cyg_ass.h> // assertion macros
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
59
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
60 #include <cyg/hal/hal_io.h> // IO macros
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
61 #include <cyg/hal/hal_arch.h> // Register state info
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
62 #include <cyg/hal/hal_diag.h>
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
63 #include <cyg/hal/hal_intr.h> // Interrupt names
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
64 #include <cyg/hal/hal_cache.h>
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
65 #include <cyg/hal/s3c2410x.h> // Platform specifics
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
66
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
67 #include <cyg/infra/diag.h> // diag_printf
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
68
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
69 #include <string.h> // memset
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
70
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
71 // -------------------------------------------------------------------------
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
72 // MMU initialization:
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
73 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
74 // These structures are laid down in memory to define the translation
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
75 // table.
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
76 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
77
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
78 // ARM Translation Table Base Bit Masks
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
79 #define ARM_TRANSLATION_TABLE_MASK 0xFFFFC000
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
80
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
81 // ARM Domain Access Control Bit Masks
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
82 #define ARM_ACCESS_TYPE_NO_ACCESS(domain_num) (0x0 << (domain_num)*2)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
83 #define ARM_ACCESS_TYPE_CLIENT(domain_num) (0x1 << (domain_num)*2)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
84 #define ARM_ACCESS_TYPE_MANAGER(domain_num) (0x3 << (domain_num)*2)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
85
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
86 struct ARM_MMU_FIRST_LEVEL_FAULT {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
87 int id : 2;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
88 int sbz : 30;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
89 };
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
90 #define ARM_MMU_FIRST_LEVEL_FAULT_ID 0x0
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
91
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
92 struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
93 int id : 2;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
94 int imp : 2;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
95 int domain : 4;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
96 int sbz : 1;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
97 int base_address : 23;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
98 };
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
99 #define ARM_MMU_FIRST_LEVEL_PAGE_TABLE_ID 0x1
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
100
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
101 struct ARM_MMU_FIRST_LEVEL_SECTION {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
102 int id : 2;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
103 int b : 1;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
104 int c : 1;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
105 int imp : 1;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
106 int domain : 4;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
107 int sbz0 : 1;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
108 int ap : 2;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
109 int sbz1 : 8;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
110 int base_address : 12;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
111 };
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
112 #define ARM_MMU_FIRST_LEVEL_SECTION_ID 0x2
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
113
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
114 struct ARM_MMU_FIRST_LEVEL_RESERVED {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
115 int id : 2;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
116 int sbz : 30;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
117 };
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
118 #define ARM_MMU_FIRST_LEVEL_RESERVED_ID 0x3
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
119
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
120 #define ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, table_index) \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
121 (unsigned long *)((unsigned long)(ttb_base) + ((table_index) << 2))
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
122
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
123 #define ARM_FIRST_LEVEL_PAGE_TABLE_SIZE 0x4000
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
124
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
125 #define ARM_MMU_SECTION(ttb_base, actual_base, virtual_base, \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
126 cacheable, bufferable, perm) \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
127 CYG_MACRO_START \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
128 register union ARM_MMU_FIRST_LEVEL_DESCRIPTOR desc; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
129 \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
130 desc.word = 0; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
131 desc.section.id = ARM_MMU_FIRST_LEVEL_SECTION_ID; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
132 desc.section.imp = 1; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
133 desc.section.domain = 0; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
134 desc.section.c = (cacheable); \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
135 desc.section.b = (bufferable); \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
136 desc.section.ap = (perm); \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
137 desc.section.base_address = (actual_base); \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
138 *ARM_MMU_FIRST_LEVEL_DESCRIPTOR_ADDRESS(ttb_base, (virtual_base)) \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
139 = desc.word; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
140 CYG_MACRO_END
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
141
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
142 #define X_ARM_MMU_SECTION(abase,vbase,size,cache,buff,access) \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
143 { int i; int j = abase; int k = vbase; \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
144 for (i = size; i > 0 ; i--,j++,k++) \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
145 { \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
146 ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access); \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
147 } \
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
148 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
149
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
150 union ARM_MMU_FIRST_LEVEL_DESCRIPTOR {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
151 unsigned long word;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
152 struct ARM_MMU_FIRST_LEVEL_FAULT fault;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
153 struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE page_table;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
154 struct ARM_MMU_FIRST_LEVEL_SECTION section;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
155 struct ARM_MMU_FIRST_LEVEL_RESERVED reserved;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
156 };
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
157
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
158 #define ARM_UNCACHEABLE 0
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
159 #define ARM_CACHEABLE 1
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
160 #define ARM_UNBUFFERABLE 0
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
161 #define ARM_BUFFERABLE 1
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
162
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
163 #define ARM_ACCESS_PERM_NONE_NONE 0
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
164 #define ARM_ACCESS_PERM_RO_NONE 0
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
165 #define ARM_ACCESS_PERM_RO_RO 0
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
166 #define ARM_ACCESS_PERM_RW_NONE 1
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
167 #define ARM_ACCESS_PERM_RW_RO 2
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
168 #define ARM_ACCESS_PERM_RW_RW 3
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
169
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
170 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
171 hal_mmu_init(void)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
172 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
173 unsigned long ttb_base = SMDK2410_SDRAM_PHYS_BASE + 0x4000;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
174 unsigned long i;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
175
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
176 // Set the TTB register
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
177 asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb_base) /*:*/);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
178
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
179 // Set the Domain Access Control Register
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
180 i = ARM_ACCESS_TYPE_MANAGER(0) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
181 ARM_ACCESS_TYPE_NO_ACCESS(1) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
182 ARM_ACCESS_TYPE_NO_ACCESS(2) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
183 ARM_ACCESS_TYPE_NO_ACCESS(3) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
184 ARM_ACCESS_TYPE_NO_ACCESS(4) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
185 ARM_ACCESS_TYPE_NO_ACCESS(5) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
186 ARM_ACCESS_TYPE_NO_ACCESS(6) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
187 ARM_ACCESS_TYPE_NO_ACCESS(7) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
188 ARM_ACCESS_TYPE_NO_ACCESS(8) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
189 ARM_ACCESS_TYPE_NO_ACCESS(9) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
190 ARM_ACCESS_TYPE_NO_ACCESS(10) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
191 ARM_ACCESS_TYPE_NO_ACCESS(11) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
192 ARM_ACCESS_TYPE_NO_ACCESS(12) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
193 ARM_ACCESS_TYPE_NO_ACCESS(13) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
194 ARM_ACCESS_TYPE_NO_ACCESS(14) |
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
195 ARM_ACCESS_TYPE_NO_ACCESS(15);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
196 asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
197
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
198 // First clear all TT entries - ie Set them to Faulting
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
199 memset((void *)ttb_base, 0, ARM_FIRST_LEVEL_PAGE_TABLE_SIZE);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
200
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
201 // Memory layout after MMU is turned on
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
202 //
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
203 // SDRAM_BASE_ADDRESS: 0x00000000, 64M
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
204 // SRAM_BASE_ADDRESS: 0x40000000, 4K
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
205 // SFR_BASE_ADDRESS: 0x48000000, 512M
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
206 // FLASH_BASE_ADDRESS: 0x80000000, 2M
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
207
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
208 // Actual Virtual Size Attributes Function
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
209 // Base Base MB cached? buffered? access permissions
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
210 // xxx00000 xxx00000
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
211 X_ARM_MMU_SECTION(0x000, 0x800, 2, ARM_UNCACHEABLE, ARM_UNBUFFERABLE, ARM_ACCESS_PERM_RW_RW); // Flash
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
212 X_ARM_MMU_SECTION(0x300, 0x000, 64, ARM_CACHEABLE, ARM_BUFFERABLE, ARM_ACCESS_PERM_RW_RW); // SDRAM
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
213 X_ARM_MMU_SECTION(0x400, 0x400, 1, ARM_CACHEABLE, ARM_BUFFERABLE, ARM_ACCESS_PERM_RW_RW); // SRAM
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
214 X_ARM_MMU_SECTION(0x480, 0x480, 512, ARM_UNCACHEABLE, ARM_UNBUFFERABLE, ARM_ACCESS_PERM_RW_RW); // SFRs
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
215 X_ARM_MMU_SECTION(0x300, 0x300, 64, ARM_UNCACHEABLE, ARM_UNBUFFERABLE, ARM_ACCESS_PERM_RW_RW); // Raw SDRAM
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
216 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
217
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
218 //----------------------------------------------------------------------------
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
219 // Platform specific initialization
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
220
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
221 // This routine sets the default GPIO condition
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
222 static void port_init(void)
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
223 {
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
224 // Note: Follow the configuration order for setting the ports.
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
225 // 1) Set data register (GPnDAT)
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
226 // 2) Set control register (GPnCON)
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
227 // 3) Configure pull-up's (GPnUP)
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
228
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
229 //*** PORT A GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
230 //Ports : GPA22 GPA21 GPA20 GPA19 GPA18 GPA17 GPA16 GPA15 GPA14 GPA13 GPA12
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
231 //Signal : nFCE nRSTOUT nFRE nFWE ALE CLE nGCS5 nGCS4 nGCS3 nGCS2 nGCS1
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
232 //Binary : 1 1 1 1 1 1 1 1 1 1 1
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
233 //-----------------------------------------------------------------------------------------
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
234 //Ports : GPA11 GPA10 GPA9 GPA8 GPA7 GPA6 GPA5 GPA4 GPA3 GPA2 GPA1 GPA0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
235 //Signal : ADDR26 ADDR25 ADDR24 ADDR23 ADDR22 ADDR21 ADDR20 ADDR19 ADDR18 ADDR17 ADDR16 ADDR0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
236 //Binary : 1 1 1 1 1 1 1 1 1 1 1 1
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
237 HAL_WRITE_UINT32(GPACON, 0x7fffff);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
238
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
239 //**** PORT B GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
240 //Ports : GPB10 GPB9 GPB8 GPB7 GPB6 GPB5 GPB4 GPB3 GPB2 GPB1 GPB0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
241 //Signal : nXDREQ0 nXDACK0 nXDREQ1 nXDACK1 nSS_KBD nDIS_OFF L3CLOCK L3DATA L3MODE nIrDATXDEN Keyboard
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
242 //Setting: INPUT OUTPUT INPUT OUTPUT INPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
243 //Binary : 00 01 00 01 00 01 01 01 01 01 01
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
244 HAL_WRITE_UINT32(GPBCON, 0x044555);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
245 HAL_WRITE_UINT32(GPBUP, 0x7ff); // The pull up function is disabled GPB[10:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
246
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
247 //*** PORT C GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
248 //Ports : GPC15 GPC14 GPC13 GPC12 GPC11 GPC10 GPC9 GPC8 GPC7 GPC6 GPC5 GPC4 GPC3 GPC2 GPC1 GPC0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
249 //Signal : VD7 VD6 VD5 VD4 VD3 VD2 VD1 VD0 LCDVF2 LCDVF1 LCDVF0 VM VFRAME VLINE VCLK LEND
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
250 //Binary : 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
251 HAL_WRITE_UINT32(GPCCON, 0xaaaaaaaa);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
252 HAL_WRITE_UINT32(GPCUP, 0xffff); // The pull up function is disabled GPC[15:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
253
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
254 //*** PORT D GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
255 //Ports : GPD15 GPD14 GPD13 GPD12 GPD11 GPD10 GPD9 GPD8 GPD7 GPD6 GPD5 GPD4 GPD3 GPD2 GPD1 GPD0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
256 //Signal : VD23 VD22 VD21 VD20 VD19 VD18 VD17 VD16 VD15 VD14 VD13 VD12 VD11 VD10 VD9 VD8
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
257 //Binary : 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
258 HAL_WRITE_UINT32(GPDCON, 0xaaaaaaaa);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
259 HAL_WRITE_UINT32(GPDUP, 0xffff); // The pull up function is disabled GPD[15:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
260
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
261 //*** PORT E GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
262 //Ports : GPE15 GPE14 GPE13 GPE12 GPE11 GPE10 GPE9 GPE8 GPE7 GPE6 GPE5 GPE4
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
263 //Signal : IICSDA IICSCL SPICLK SPIMOSI SPIMISO SDDATA3 SDDATA2 SDDATA1 SDDATA0 SDCMD SDCLK I2SSDO
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
264 //Binary : 10 10 10 10 10 10 10 10 10 10 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
265 //------------------------------------------------------------------------------------------------
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
266 //Ports : GPE3 GPE2 GPE1 GPE0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
267 //Signal : I2SSDI CDCLK I2SSCLK I2SLRCK
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
268 //Binary : 10 10 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
269 HAL_WRITE_UINT32(GPECON, 0xaaaaaaaa);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
270 HAL_WRITE_UINT32(GPEUP, 0xffff); // The pull up function is disabled GPE[15:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
271
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
272 //*** PORT F GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
273 //Ports : GPF7 GPF6 GPF5 GPF4 GPF3 GPF2 GPF1 GPF0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
274 //Signal : nLED_8 nLED_4 nLED_2 nLED_1 nIRQ_PCMCIA EINT2 KBDINT EINT0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
275 //Setting: Output Output Output Output EINT3 EINT2 EINT1 EINT0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
276 //Binary : 01 01 01 01 10 10 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
277 HAL_WRITE_UINT32(GPFCON, 0x55aa);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
278 HAL_WRITE_UINT32(GPFUP, 0xff); // The pull up function is disabled GPF[7:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
279
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
280 //*** PORT G GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
281 //Ports : GPG15 GPG14 GPG13 GPG12 GPG11 GPG10 GPG9 GPG8 GPG7 GPG6
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
282 //Signal : nYPON YMON nXPON XMON EINT19 DMAMODE1 DMAMODE0 DMASTART KBDSPICLK KBDSPIMOSI
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
283 //Setting: nYPON YMON nXPON XMON EINT19 Output Output Output SPICLK1 SPIMOSI1
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
284 //Binary : 11 11 11 11 10 01 01 01 11 11
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
285 //-----------------------------------------------------------------------------------------
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
286 //Ports : GPG5 GPG4 GPG3 GPG2 GPG1 GPG0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
287 //Signal : KBDSPIMISO LCD_PWREN EINT11 nSS_SPI IRQ_LAN IRQ_PCMCIA
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
288 //Setting: SPIMISO1 LCD_PWRDN EINT11 nSS0 EINT9 EINT8
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
289 //Binary : 11 11 10 11 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
290 HAL_WRITE_UINT32(GPGCON, 0xff95ffba);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
291 HAL_WRITE_UINT32(GPGUP, 0xffff); // The pull up function is disabled GPG[15:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
292
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
293 //*** PORT H GROUP
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
294 //Ports : GPH10 GPH9 GPH8 GPH7 GPH6 GPH5 GPH4 GPH3 GPH2 GPH1 GPH0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
295 //Signal : CLKOUT1 CLKOUT0 UCLK nCTS1 nRTS1 RXD1 TXD1 RXD0 TXD0 nRTS0 nCTS0
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
296 //Binary : 10 10 10 11 11 10 10 10 10 10 10
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
297 HAL_WRITE_UINT32(GPHCON, 0x2afaaa);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
298 HAL_WRITE_UINT32(GPHUP, 0x7ff); // The pull up function is disabled GPH[10:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
299
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
300 //External interrupts will be falling edge triggered.
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
301 HAL_WRITE_UINT32(EXTINT0, 0x22222222); // EINT[7:0]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
302 HAL_WRITE_UINT32(EXTINT1, 0x22222222); // EINT[15:8]
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
303 HAL_WRITE_UINT32(EXTINT2, 0x22222222); // EINT[23:16]
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
304 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
305
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
306 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
307 plf_hardware_init(void)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
308 {
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
309 HAL_WRITE_UINT32(INTMOD, 0x0); //All=IRQ mode
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
310 HAL_WRITE_UINT32(INTMSK, BIT_ALLMSK); //All interrupt is masked.
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
311 HAL_WRITE_UINT32(INTSUBMSK, BIT_SUB_ALLMSK); //All sub-interrupt is masked.
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
312
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
313 port_init();
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
314
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
315 // Initialize real-time clock (for delays, etc, even if kernel doesn't use it)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
316 hal_clock_initialize(CYGNUM_HAL_RTC_PERIOD);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
317 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
318
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
319 // -------------------------------------------------------------------------
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
320 // Use Timer4 for system clock
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
321 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
322 hal_clock_initialize(cyg_uint32 period)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
323 {
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
324 cyg_uint32 temp;
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
325
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
326 // Configure the Prescaler1
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
327 HAL_READ_UINT32(TCFG0, temp);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
328 temp &= ~(0xff<<8);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
329 temp |= (CYGNUM_HAL_ARM_SMDK2410_TIMER_PRESCALE<<8);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
330 HAL_WRITE_UINT32(TCFG0, temp);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
331
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
332 // Configure the MUX to select the 1/2 divider
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
333 HAL_READ_UINT32(TCFG1, temp);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
334 temp &= ~(0xf<<16);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
335 temp |= (0x0<<16);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
336 HAL_WRITE_UINT32(TCFG1, temp);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
337
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
338 // Set up the Timer4 for period
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
339 HAL_WRITE_UINT32(TCNTB4, period);
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
340
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
341 // Start Timer4
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
342 HAL_READ_UINT32(TCON, temp);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
343 temp &= ~(0xf << 20);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
344 HAL_WRITE_UINT32(TCON, (temp|(6<<20)));
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
345 HAL_WRITE_UINT32(TCON, (temp|(5<<20)));
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
346
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
347 // Unmask Timer4 interrupt, need not be done here
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
348 //HAL_INTERRUPT_CONFIGURE( CYGNUM_HAL_INTERRUPT_RTC, 1, 1 );
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
349 //HAL_INTERRUPT_UNMASK( CYGNUM_HAL_INTERRUPT_RTC );
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
350 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
351
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
352 // This routine is called during a clock interrupt.
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
353 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
354 hal_clock_reset(cyg_uint32 vector, cyg_uint32 period)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
355 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
356 // Do nothing
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
357 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
358
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
359 // Read the current value of the clock, returning the number of hardware
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
360 // "ticks" that have occurred (i.e. how far away the current value is from
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
361 // the start)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
362 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
363 hal_clock_read(cyg_uint32 *pvalue)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
364 {
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
365 cyg_int32 clock_val;
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
366
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
367 // Read Timer4's current value
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
368 HAL_READ_UINT32(TCNTO4, clock_val);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
369
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
370 *pvalue = CYGNUM_HAL_RTC_PERIOD - (clock_val & 0xFFFF); // Note: counter is only 16 bits
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
371 // and decreases
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
372 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
373
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
374
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
375 // Delay for some number of micro-seconds
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
376 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
377 hal_delay_us(cyg_int32 usecs)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
378 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
379 cyg_uint32 ticks = 0;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
380 // Divide by 1000000 in two steps to preserve precision.
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
381 cyg_uint32 wait_ticks = (((PCLK/100000)*usecs)/CYGNUM_HAL_ARM_SMDK2410_TIMER_PRESCALE/2/10);
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
382 cyg_int32 val, prev, diff;
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
383
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
384 // Read Timer4's current value
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
385 HAL_READ_UINT32(TCNTO4, prev);
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
386 prev &= 0xFFFF;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
387
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
388 while (ticks < wait_ticks) {
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
389 while (true) {
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
390 // Read Timer4's current value
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
391 HAL_READ_UINT32(TCNTO4, val);
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
392 val &= 0xFFFF;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
393
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
394 diff = prev - val;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
395 if (diff != 0) {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
396 if(diff < 0)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
397 diff += (CYGNUM_HAL_RTC_PERIOD+1);
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
398
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
399 break; // atleast 1 tick has passed
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
400 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
401 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
402 prev = val;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
403 ticks += diff;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
404 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
405 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
406
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
407 // -------------------------------------------------------------------------
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
408
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
409 // This routine is called to respond to a hardware interrupt (IRQ). It
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
410 // should interrogate the hardware and return the IRQ vector number.
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
411 int
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
412 hal_IRQ_handler(void)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
413 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
414 cyg_uint32 ior;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
415
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
416 HAL_READ_UINT32(INTOFFSET, ior);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
417 return (int)ior;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
418 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
419
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
420 //----------------------------------------------------------------------------
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
421 // Interrupt control
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
422
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
423 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
424 hal_interrupt_mask(int vector)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
425 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
426 cyg_uint32 imr;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
427
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
428 CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX &&
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
429 vector >= CYGNUM_HAL_ISR_MIN , "Invalid vector");
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
430
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
431 HAL_READ_UINT32(INTMSK, imr);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
432 imr |= (1<<vector);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
433 HAL_WRITE_UINT32(INTMSK, imr);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
434 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
435
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
436 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
437 hal_interrupt_unmask(int vector)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
438 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
439 cyg_uint32 imr;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
440
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
441 CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX &&
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
442 vector >= CYGNUM_HAL_ISR_MIN , "Invalid vector");
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
443
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
444 HAL_READ_UINT32(INTMSK, imr);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
445 imr &= ~(1<<vector);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
446 HAL_WRITE_UINT32(INTMSK, imr);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
447 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
448
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
449 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
450 hal_interrupt_acknowledge(int vector)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
451 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
452 cyg_uint32 ipr;
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
453
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
454 CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX &&
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
455 vector >= CYGNUM_HAL_ISR_MIN , "Invalid vector");
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
456
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
457 HAL_WRITE_UINT32(SRCPND, (1<<vector));
2830
3caad2060bd3 Strip erroneous CR chars from text files in the eCos repository.
jld
parents: 2729
diff changeset
458 HAL_READ_UINT32(INTPND, ipr);
1152
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
459 HAL_WRITE_UINT32(INTPND, ipr);
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
460 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
461
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
462 void
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
463 hal_interrupt_configure(int vector, int level, int up)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
464 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
465 CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX &&
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
466 vector >= CYGNUM_HAL_ISR_MIN, "Invalid vector");
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
467 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
468
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
469 void hal_interrupt_set_level(int vector, int level)
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
470 {
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
471 CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX &&
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
472 vector >= CYGNUM_HAL_ISR_MIN, "Invalid vector");
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
473 }
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
474
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
475
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
476 //-----------------------------------------------------------------------------
74ebd002d7bd New package for the Samsung ARM9/SMDK2410 development
nickg
parents:
diff changeset
477 // End of smdk2410_misc.c