Root/target/linux/generic/files/crypto/ocf/kirkwood/mvHal/kw_family/ctrlEnv/mvCtrlEnvLib.h

1/*******************************************************************************
2Copyright (C) Marvell International Ltd. and its affiliates
3
4This software file (the "File") is owned and distributed by Marvell
5International Ltd. and/or its affiliates ("Marvell") under the following
6alternative licensing terms. Once you have made an election to distribute the
7File under one of the following license alternatives, please (i) delete this
8introductory statement regarding license alternatives, (ii) delete the two
9license alternatives that you have not elected to use and (iii) preserve the
10Marvell copyright notice above.
11
12********************************************************************************
13Marvell Commercial License Option
14
15If you received this File from Marvell and you have entered into a commercial
16license agreement (a "Commercial License") with Marvell, the File is licensed
17to you under the terms of the applicable Commercial License.
18
19********************************************************************************
20Marvell GPL License Option
21
22If you received this File from Marvell, you may opt to use, redistribute and/or
23modify this File in accordance with the terms and conditions of the General
24Public License Version 2, June 1991 (the "GPL License"), a copy of which is
25available along with the File in the license.txt file or by writing to the Free
26Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
27on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
28
29THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
30WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
31DISCLAIMED. The GPL License provides additional details about this warranty
32disclaimer.
33********************************************************************************
34Marvell BSD License Option
35
36If you received this File from Marvell, you may opt to use, redistribute and/or
37modify this File under the following licensing terms.
38Redistribution and use in source and binary forms, with or without modification,
39are permitted provided that the following conditions are met:
40
41    * Redistributions of source code must retain the above copyright notice,
42        this list of conditions and the following disclaimer.
43
44    * Redistributions in binary form must reproduce the above copyright
45        notice, this list of conditions and the following disclaimer in the
46        documentation and/or other materials provided with the distribution.
47
48    * Neither the name of Marvell nor the names of its contributors may be
49        used to endorse or promote products derived from this software without
50        specific prior written permission.
51    
52THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
53ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
54WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
55DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
56ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
57(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
58LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
59ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
61SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62
63*******************************************************************************/
64
65
66#ifndef __INCmvCtrlEnvLibh
67#define __INCmvCtrlEnvLibh
68
69/* includes */
70#include "mvSysHwConfig.h"
71#include "mvCommon.h"
72#include "mvTypes.h"
73#include "mvOs.h"
74#include "boardEnv/mvBoardEnvLib.h"
75#include "ctrlEnv/mvCtrlEnvSpec.h"
76#include "ctrlEnv/mvCtrlEnvRegs.h"
77#include "ctrlEnv/mvCtrlEnvAddrDec.h"
78
79
80/* typedefs */
81
82/* This enumerator describes the possible HW cache coherency policies the */
83/* controllers supports. */
84typedef enum _mvCachePolicy
85{
86    NO_COHERENCY, /* No HW cache coherency support */
87    WT_COHERENCY, /* HW cache coherency supported in Write Through policy */
88    WB_COHERENCY /* HW cache coherency supported in Write Back policy */
89}MV_CACHE_POLICY;
90
91
92/* The swapping is referred to a 64-bit words (as this is the controller */
93/* internal data path width). This enumerator describes the possible */
94/* data swap types. Below is an example of the data 0x0011223344556677 */
95typedef enum _mvSwapType
96{
97    MV_BYTE_SWAP, /* Byte Swap 77 66 55 44 33 22 11 00 */
98    MV_NO_SWAP, /* No swapping 00 11 22 33 44 55 66 77 */
99    MV_BYTE_WORD_SWAP, /* Both byte and word swap 33 22 11 00 77 66 55 44 */
100    MV_WORD_SWAP, /* Word swap 44 55 66 77 00 11 22 33 */
101    SWAP_TYPE_MAX /* Delimiter for this enumerator */
102}MV_SWAP_TYPE;
103
104/* This structure describes access rights for Access protection windows */
105/* that can be found in IDMA, XOR, Ethernet and MPSC units. */
106/* Note that the permission enumerator coresponds to its register format. */
107/* For example, Read only premission is presented as "1" in register field. */
108typedef enum _mvAccessRights
109{
110        NO_ACCESS_ALLOWED = 0, /* No access allowed */
111        READ_ONLY = 1, /* Read only permission */
112    ACC_RESERVED = 2, /* Reserved access right */
113        FULL_ACCESS = 3, /* Read and Write permission */
114    MAX_ACC_RIGHTS
115}MV_ACCESS_RIGHTS;
116
117
118/* mcspLib.h API list */
119
120MV_STATUS mvCtrlEnvInit(MV_VOID);
121MV_U32 mvCtrlMppRegGet(MV_U32 mppGroup);
122
123#if defined(MV_INCLUDE_PEX)
124MV_U32 mvCtrlPexMaxIfGet(MV_VOID);
125#else
126#define mvCtrlPexMaxIfGet() (0)
127#endif
128
129#define mvCtrlPciIfMaxIfGet() (0)
130
131#if defined(MV_INCLUDE_GIG_ETH)
132MV_U32 mvCtrlEthMaxPortGet(MV_VOID);
133#endif
134#if defined(MV_INCLUDE_XOR)
135MV_U32 mvCtrlXorMaxChanGet(MV_VOID);
136#endif
137#if defined(MV_INCLUDE_USB)
138MV_U32 mvCtrlUsbMaxGet(MV_VOID);
139#endif
140#if defined(MV_INCLUDE_NAND)
141MV_U32 mvCtrlNandSupport(MV_VOID);
142#endif
143#if defined(MV_INCLUDE_SDIO)
144MV_U32 mvCtrlSdioSupport(MV_VOID);
145#endif
146#if defined(MV_INCLUDE_TS)
147MV_U32 mvCtrlTsSupport(MV_VOID);
148#endif
149#if defined(MV_INCLUDE_AUDIO)
150MV_U32 mvCtrlAudioSupport(MV_VOID);
151#endif
152#if defined(MV_INCLUDE_TDM)
153MV_U32 mvCtrlTdmSupport(MV_VOID);
154#endif
155
156MV_U16 mvCtrlModelGet(MV_VOID);
157MV_U8 mvCtrlRevGet(MV_VOID);
158MV_STATUS mvCtrlNameGet(char *pNameBuff);
159MV_U32 mvCtrlModelRevGet(MV_VOID);
160MV_STATUS mvCtrlModelRevNameGet(char *pNameBuff);
161MV_VOID mvCtrlAddrDecShow(MV_VOID);
162const MV_8* mvCtrlTargetNameGet(MV_TARGET target);
163MV_U32 ctrlSizeToReg(MV_U32 size, MV_U32 alignment);
164MV_U32 ctrlRegToSize(MV_U32 regSize, MV_U32 alignment);
165MV_U32 ctrlSizeRegRoundUp(MV_U32 size, MV_U32 alignment);
166MV_U32 mvCtrlSysRstLengthCounterGet(MV_VOID);
167MV_STATUS ctrlWinOverlapTest(MV_ADDR_WIN *pAddrWin1, MV_ADDR_WIN *pAddrWin2);
168MV_STATUS ctrlWinWithinWinTest(MV_ADDR_WIN *pAddrWin1, MV_ADDR_WIN *pAddrWin2);
169
170MV_VOID mvCtrlPwrClckSet(MV_UNIT_ID unitId, MV_U32 index, MV_BOOL enable);
171MV_BOOL mvCtrlPwrClckGet(MV_UNIT_ID unitId, MV_U32 index);
172MV_VOID mvCtrlPwrMemSet(MV_UNIT_ID unitId, MV_U32 index, MV_BOOL enable);
173MV_BOOL mvCtrlIsBootFromSPI(MV_VOID);
174MV_BOOL mvCtrlIsBootFromSPIUseNAND(MV_VOID);
175MV_BOOL mvCtrlIsBootFromNAND(MV_VOID);
176#if defined(MV_INCLUDE_CLK_PWR_CNTRL)
177MV_VOID mvCtrlPwrSaveOn(MV_VOID);
178MV_VOID mvCtrlPwrSaveOff(MV_VOID);
179#endif
180MV_BOOL mvCtrlPwrMemGet(MV_UNIT_ID unitId, MV_U32 index);
181MV_VOID mvMPPConfigToSPI(MV_VOID);
182MV_VOID mvMPPConfigToDefault(MV_VOID);
183
184
185#endif /* __INCmvCtrlEnvLibh */
186

Archive Download this file



interactive