-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelm.h
196 lines (178 loc) · 7.83 KB
/
elm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/**
* \file elm.h
*
* \brief Definitions used for ELM
*
* This file contains the driver API prototypes and macro definitions.
*/
/*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*/
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _ELM_H_
#define _ELM_H__
#include "hw_elm.h"
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
* MACRO DEFINITIONS
*******************************************************************************/
/*****************************************************************************/
/*
** Macros which can be used as 'configVal' parameter to ELMCAutoGatingConfig API
**
*/
#define ELM_AUTOGATING_OCP_FREE (0)
#define ELM_AUTOGATING_OCP_GATING (1)
/*
** Macros which can be used as 'configVal' parameter to ELMCIdleModeSelect API.
**
*/
#define ELM_IDLEMODE_FORCEIDLE (0)
#define ELM_IDLEMODE_NOIDLE (1)
#define ELM_IDLEMODE_SMARTIDLE (2)
/*
** Macros which can be used as 'configVal' parameter to ELMOCPClkActivityConfig
** API.
**
*/
#define ELM_CLOCKACTIVITYOCP_OCP_ON (1)
#define ELM_CLOCKACTIVITYOCP_OCP_OFF (0)
/*
** Macros which can be used as 'flag' parameter to ELMIntStatusGet API.
**
*/
#define ELM_LOC_VALID_0_STATUS (0)
#define ELM_LOC_VALID_1_STATUS (1)
#define ELM_LOC_VALID_2_STATUS (2)
#define ELM_LOC_VALID_3_STATUS (3)
#define ELM_LOC_VALID_4_STATUS (4)
#define ELM_LOC_VALID_5_STATUS (5)
#define ELM_LOC_VALID_6_STATUS (6)
#define ELM_LOC_VALID_7_STATUS (7)
#define ELM_PAGE_VALID_STATUS (8)
/*
** Macros which can be used as 'flag' parameter to ELMIntConfig API.
**
*/
#define ELM_INT_ENALBLE (1)
#define ELM_INT_DISALBLE (0)
/*
** Macros which can be used as 'bchECCLevel' parameter to
** ELMErrCorrectionLevelSet API.
**
*/
#define ELM_ECC_BCH_LEVEL_4BITS (0)
#define ELM_ECC_BCH_LEVEL_8BITS (1)
#define ELM_ECC_BCH_LEVEL_16BITS (2)
/*
** Macros which can be used as 'mode' parameter to ELMModeSet API.
**
*/
#define ELM_MODE_CONTINUOUS (0)
#define ELM_MODE_PAGE (1)
/*
** Macros which can be used as 'sectorNum' parameter to ELMModeSet API.
**
*/
#define ELM_PAGEMODE_SECTOR_0 (0)
#define ELM_PAGEMODE_SECTOR_1 (1)
#define ELM_PAGEMODE_SECTOR_2 (2)
#define ELM_PAGEMODE_SECTOR_3 (3)
#define ELM_PAGEMODE_SECTOR_4 (4)
#define ELM_PAGEMODE_SECTOR_5 (5)
#define ELM_PAGEMODE_SECTOR_6 (6)
#define ELM_PAGEMODE_SECTOR_7 (7)
/*
** Macros which can be used as 'synFrgmtId' parameter to ELMSyndromeFrgmtSet API
**
*/
#define ELM_SYNDROME_FRGMT_0 (0)
#define ELM_SYNDROME_FRGMT_1 (1)
#define ELM_SYNDROME_FRGMT_2 (2)
#define ELM_SYNDROME_FRGMT_3 (3)
#define ELM_SYNDROME_FRGMT_4 (4)
#define ELM_SYNDROME_FRGMT_5 (5)
#define ELM_SYNDROME_FRGMT_6 (6)
/*
** Macros which can be used as 'errNum' parameter to ELMErrLocBitAddrGet API.
**
*/
#define ELM_ERROR_NUM_0 (0)
#define ELM_ERROR_NUM_1 (1)
#define ELM_ERROR_NUM_2 (2)
#define ELM_ERROR_NUM_3 (3)
#define ELM_ERROR_NUM_4 (4)
#define ELM_ERROR_NUM_5 (5)
#define ELM_ERROR_NUM_6 (6)
#define ELM_ERROR_NUM_7 (7)
#define ELM_ERROR_NUM_8 (8)
#define ELM_ERROR_NUM_9 (9)
#define ELM_ERROR_NUM_10 (10)
#define ELM_ERROR_NUM_11 (11)
#define ELM_ERROR_NUM_12 (12)
#define ELM_ERROR_NUM_13 (13)
#define ELM_ERROR_NUM_14 (14)
#define ELM_ERROR_NUM_15 (15)
/*****************************************************************************
** FUNCTION PROTOTYPES
*****************************************************************************/
extern void ELMModuleReset(unsigned int baseAddr);
extern unsigned int ELMRevisionGet(unsigned int baseAddr);
extern unsigned int ELMNumOfErrsGet(unsigned int baseAddr);
extern void ELMErrLocProcessingStart(unsigned int baseAddr);
extern unsigned int ELMModuleResetStatusGet(unsigned int baseAddr);
extern unsigned int ELMErrLocProcessingStatusGet(unsigned int baseAddr);
extern void ELMECCSizeSet(unsigned int baseAddr, unsigned int eccSize);
extern void ELMIntStatusClear(unsigned int baseAddr, unsigned int flag);
extern void GPMCIntStatusClear(unsigned int baseAddr, unsigned int flag);
extern void ELMCIdleModeSelect(unsigned int baseAddr, unsigned int mode);
extern unsigned int ELMIntStatusGet(unsigned int baseAddr, unsigned int flag);
extern void ELMCAutoGatingConfig(unsigned int baseAddr,
unsigned int configVal);
extern unsigned int ELMErrLocBitAddrGet(unsigned int baseAddr,
unsigned int errNum);
extern void ELMOCPClkActivityConfig(unsigned int baseAddr,
unsigned int configVal);
extern void ELMErrCorrectionLevelSet(unsigned int baseAddr,
unsigned int bchECCLevel);
extern void ELMModeSet(unsigned int baseAddr, unsigned int mode,
unsigned int sectorNum);
extern void ELMIntConfig(unsigned int baseAddr, unsigned int intFlag,
unsigned int configVal);
extern void ELMSyndromeFrgmtSet(unsigned int baseAddr, unsigned int synFrgmtId,
unsigned int synFrgmtVal);
#ifdef __cplusplus
}
#endif
#endif