611f5776b78bd93d19aef13bb9db284a3606d5ca
[openwrt/svn-archive/archive.git] / target / linux / generic / files / crypto / ocf / kirkwood / mvHal / kw_family / ctrlEnv / sys / mvSysSata.h
1
2 /*******************************************************************************
3 Copyright (C) Marvell International Ltd. and its affiliates
4
5 This software file (the "File") is owned and distributed by Marvell
6 International Ltd. and/or its affiliates ("Marvell") under the following
7 alternative licensing terms. Once you have made an election to distribute the
8 File under one of the following license alternatives, please (i) delete this
9 introductory statement regarding license alternatives, (ii) delete the two
10 license alternatives that you have not elected to use and (iii) preserve the
11 Marvell copyright notice above.
12
13 ********************************************************************************
14 Marvell Commercial License Option
15
16 If you received this File from Marvell and you have entered into a commercial
17 license agreement (a "Commercial License") with Marvell, the File is licensed
18 to you under the terms of the applicable Commercial License.
19
20 ********************************************************************************
21 Marvell GPL License Option
22
23 If you received this File from Marvell, you may opt to use, redistribute and/or
24 modify this File in accordance with the terms and conditions of the General
25 Public License Version 2, June 1991 (the "GPL License"), a copy of which is
26 available along with the File in the license.txt file or by writing to the Free
27 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
28 on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
29
30 THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
31 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
32 DISCLAIMED. The GPL License provides additional details about this warranty
33 disclaimer.
34 ********************************************************************************
35 Marvell BSD License Option
36
37 If you received this File from Marvell, you may opt to use, redistribute and/or
38 modify this File under the following licensing terms.
39 Redistribution and use in source and binary forms, with or without modification,
40 are permitted provided that the following conditions are met:
41
42 * Redistributions of source code must retain the above copyright notice,
43 this list of conditions and the following disclaimer.
44
45 * Redistributions in binary form must reproduce the above copyright
46 notice, this list of conditions and the following disclaimer in the
47 documentation and/or other materials provided with the distribution.
48
49 * Neither the name of Marvell nor the names of its contributors may be
50 used to endorse or promote products derived from this software without
51 specific prior written permission.
52
53 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
54 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
55 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
56 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
57 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
58 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
59 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
60 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
62 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63
64 *******************************************************************************/
65 #ifndef __INCMVSysSataAddrDech
66 #define __INCMVSysSataAddrDech
67
68 #include "mvCommon.h"
69 #include "ctrlEnv/mvCtrlEnvLib.h"
70 #include "ctrlEnv/sys/mvCpuIf.h"
71
72
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76
77 typedef struct _mvSataDecWin
78 {
79 MV_TARGET target;
80 MV_ADDR_WIN addrWin; /* An address window*/
81 MV_BOOL enable; /* Address decode window is enabled/disabled */
82
83 } MV_SATA_DEC_WIN;
84
85
86 #define MV_SATA_MAX_ADDR_DECODE_WIN 4
87
88 #define MV_SATA_WIN_CTRL_REG(dev, win) (SATA_REG_BASE + 0x30 + ((win)<<4))
89 #define MV_SATA_WIN_BASE_REG(dev, win) (SATA_REG_BASE + 0x34 + ((win)<<4))
90
91 /* BITs in Bridge Interrupt Cause and Mask registers */
92 #define MV_SATA_ADDR_DECODE_ERROR_BIT 0
93 #define MV_SATA_ADDR_DECODE_ERROR_MASK (1<<MV_SATA_ADDR_DECODE_ERROR_BIT)
94
95 /* BITs in Windows 0-3 Control and Base Registers */
96 #define MV_SATA_WIN_ENABLE_BIT 0
97 #define MV_SATA_WIN_ENABLE_MASK (1<<MV_SATA_WIN_ENABLE_BIT)
98
99 #define MV_SATA_WIN_TARGET_OFFSET 4
100 #define MV_SATA_WIN_TARGET_MASK (0xF<<MV_SATA_WIN_TARGET_OFFSET)
101
102 #define MV_SATA_WIN_ATTR_OFFSET 8
103 #define MV_SATA_WIN_ATTR_MASK (0xFF<<MV_SATA_WIN_ATTR_OFFSET)
104
105 #define MV_SATA_WIN_SIZE_OFFSET 16
106 #define MV_SATA_WIN_SIZE_MASK (0xFFFF<<MV_SATA_WIN_SIZE_OFFSET)
107
108 #define MV_SATA_WIN_BASE_OFFSET 16
109 #define MV_SATA_WIN_BASE_MASK (0xFFFF<<MV_SATA_WIN_BASE_OFFSET)
110
111 MV_STATUS mvSataWinGet(int dev, MV_U32 winNum, MV_SATA_DEC_WIN *pAddrDecWin);
112 MV_STATUS mvSataWinSet(int dev, MV_U32 winNum, MV_SATA_DEC_WIN *pAddrDecWin);
113 MV_STATUS mvSataWinByTargetGet(MV_TARGET target, MV_SATA_DEC_WIN *pAddrDecWin);
114 MV_STATUS mvSataWinInit(MV_VOID);
115 MV_VOID mvSataAddrDecShow(MV_VOID);
116
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122
123 #endif
124
125
126
127
128