1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - OS - include
3   File:     tcm.h
4 
5   Copyright 2003-2008 Nintendo.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-17#$
14   $Rev: 8556 $
15   $Author: okubata_ryoma $
16 
17  *---------------------------------------------------------------------------*/
18 
19 #ifndef NITRO_OS_TCM_H_
20 #define NITRO_OS_TCM_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #ifdef SDK_NITRO
27 #include <nitro/hw/ARM9/mmap_global.h>
28 #else
29 #include <twl/hw/ARM9/mmap_global.h>
30 #endif
31 
32 //=======================================================================
33 //           ITCM
34 //=======================================================================
35 /*---------------------------------------------------------------------------*
36   Name:         OS_EnableITCM
37 
38   Description:  enable ITCM
39 
40   Arguments:    None.
41 
42   Returns:      None.
43  *---------------------------------------------------------------------------*/
44 void    OS_EnableITCM(void);
45 
46 /*---------------------------------------------------------------------------*
47   Name:         OS_DisableITCM
48 
49   Description:  disable ITCM
50 
51   Arguments:    None.
52 
53   Returns:      None.
54  *---------------------------------------------------------------------------*/
55 void    OS_DisableITCM(void);
56 
57 /*---------------------------------------------------------------------------*
58   Name:         OS_SetITCMParam
59 
60   Description:  set parameter to ITCM
61 
62   Arguments:    param :  parameter to be set to ITCM
63 
64   Returns:      None.
65  *---------------------------------------------------------------------------*/
66 void    OS_SetITCMParam(u32 param);
67 
68 /*---------------------------------------------------------------------------*
69   Name:         OS_GetITCMParam
70 
71   Description:  get parameter to ITCM
72 
73   Arguments:    None
74 
75   Returns:      parameter about ITCM
76  *---------------------------------------------------------------------------*/
77 u32     OS_GetITCMParam(void);
78 
79 /*---------------------------------------------------------------------------*
80   Name:         OS_GetITCMAddress
81 
82   Description:  Get start address of ITCM
83                 this function always returns HW_ITCM.
84 
85   Arguments:    None.
86 
87   Returns:      start address of ITCM
88  *---------------------------------------------------------------------------*/
OS_GetITCMAddress(void)89 static inline u32 OS_GetITCMAddress(void)
90 {
91     return (u32)HW_ITCM;
92 }
93 
94 
95 //=======================================================================
96 //           DTCM
97 //=======================================================================
98 /*---------------------------------------------------------------------------*
99   Name:         OS_EnableDTCM
100 
101   Description:  enable DTCM
102 
103   Arguments:    None.
104 
105   Returns:      None.
106  *---------------------------------------------------------------------------*/
107 void    OS_EnableDTCM(void);
108 
109 /*---------------------------------------------------------------------------*
110   Name:         OS_DisableDTCM
111 
112   Description:  disable DTCM
113 
114   Arguments:    None.
115 
116   Returns:      None.
117  *---------------------------------------------------------------------------*/
118 void    OS_DisableDTCM(void);
119 
120 /*---------------------------------------------------------------------------*
121   Name:         OS_SetDTCMParam
122 
123   Description:  set parameter to DTCM
124 
125   Arguments:    param :  parameter to be set to DTCM
126 
127   Returns:      None.
128  *---------------------------------------------------------------------------*/
129 void    OS_SetDTCMParam(u32 param);
130 
131 /*---------------------------------------------------------------------------*
132   Name:         OS_GetDTCMParam
133 
134   Description:  get parameter to DTCM
135 
136   Arguments:    None
137 
138   Returns:      parameter about DTCM
139  *---------------------------------------------------------------------------*/
140 u32     OS_GetDTCMParam(void);
141 
142 
143 
144 //================================================================================
145 //          SET TCM ADDRESS
146 //================================================================================
147 /*---------------------------------------------------------------------------*
148   Name:         OS_SetDTCMAddress
149 
150   Description:  Set start address of DTCM
151 
152   Arguments:    start address of DTCM
153 
154   Returns:      None.
155  *---------------------------------------------------------------------------*/
156 void    OS_SetDTCMAddress(u32 address);
157 
158 
159 
160 //================================================================================
161 //          GET TCM ADDRESS
162 //================================================================================
163 /*---------------------------------------------------------------------------*
164   Name:         OS_GetDTCMAddress
165 
166   Description:  Get start address of DTCM
167 
168   Arguments:    None.
169 
170   Returns:      start address of DTCM
171  *---------------------------------------------------------------------------*/
172 u32     OS_GetDTCMAddress(void);
173 
174 
175 #ifdef __cplusplus
176 } /* extern "C" */
177 #endif
178 
179 /* NITRO_OS_TCM_H_ */
180 #endif
181