source: svn/trunk/newcon3bcm2_21bu/magnum/basemodules/chp/bchp_priv.h @ 55

Last change on this file since 55 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 8.0 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2012, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bchp_priv.h $
11 * $brcm_Revision: Hydra_Software_Devel/16 $
12 * $brcm_Date: 2/10/12 5:25p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/basemodules/chp/bchp_priv.h $
19 *
20 * Hydra_Software_Devel/16   2/10/12 5:25p rjlewis
21 * SW7425-2218: removed AvsLock/Unlock and added get handle.
22 *
23 * Hydra_Software_Devel/15   2/1/12 7:03p rjlewis
24 * SW7425-2216: Adding support for AVS Lock/Unlock.
25 *
26 * Hydra_Software_Devel/14   8/16/11 11:31a rjlewis
27 * SW7346-117: Added support for a chip specific stand-by mode function.
28 *
29 * Hydra_Software_Devel/13   8/3/11 11:46a rjlewis
30 * SW7346-117: added support for GetAvsData function.
31 *
32 * Hydra_Software_Devel/12   6/20/11 12:01p jtna
33 * SW7425-752: handle shared nodes correctly
34 *
35 * Hydra_Software_Devel/11   1/20/11 1:40p gmohile
36 * SW7408-212 : Add support for avs settings
37 *
38 * Hydra_Software_Devel/10   1/18/11 4:12p jtna
39 * SW7420-972: added initComplete member
40 *
41 * Hydra_Software_Devel/9   11/18/10 7:33p jtna
42 * SW7420-972: refactor init process
43 *
44 * Hydra_Software_Devel/8   10/20/10 6:45p jtna
45 * SW7420-972: rewrite to support HW_ -> HW_ dependency
46 *
47 * Hydra_Software_Devel/7   9/24/10 4:29p jtna
48 * SW7420-972: change regHandle from void* to BREG_Handle
49 *
50 * Hydra_Software_Devel/6   9/1/10 3:34p jtna
51 * SW7420-972: add bchp_pwr resource init scheme
52 *
53 * Hydra_Software_Devel/5   8/20/10 12:31p jtna
54 * SW7405-4433: change pHandle to handle
55 *
56 * Hydra_Software_Devel/4   8/19/10 3:10p jtna
57 * SW7405-4433: merge BCHP_PWR
58 *
59 * Hydra_Software_Devel/3   6/10/04 5:43p jasonh
60 * PR 11257: Added initial support of BCHP_GetFeature for 7038 chipsets.
61 *
62 * Hydra_Software_Devel/2   9/26/03 8:49a dlwin
63 * Updated to return 16 bits for Chip ID and Chip Rev.
64 *
65 * Hydra_Software_Devel/1   9/24/03 11:30a dlwin
66 * Initial version
67 *
68 ***************************************************************************/
69#ifndef BCHP_PRIV_H__
70#define BCHP_PRIV_H__
71
72#include "bstd.h"
73#include "bchp.h"
74#include "breg_mem.h"
75#include "bkni_multi.h"
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81/***************************************************************************
82Summary:
83        This typedef defines the pointer to chip Close function.
84
85Description:
86        If the close function pointer is used, then open function pointer must
87        also exist.
88
89See Also:
90        BCHP_Close()
91
92****************************************************************************/
93typedef BERR_Code (*BCHP_CloseFunc)(
94        BCHP_Handle hChip                                               /* [in] Chip handle */
95        );
96
97/***************************************************************************
98Summary:
99        This typedef defines the pointer to chip GetChipInfo function.
100
101Description:
102        This function pointer is provided for chips that requires specific needs
103        when BCHP_GetChipInfo() is called.
104
105See Also:
106        BCHP_GetChipInfo()
107
108****************************************************************************/
109typedef BERR_Code (*BCHP_GetChipInfoFunc)(
110        const BCHP_Handle hChip,                                /* [in] Chip handle */
111        uint16_t *pChipId,                                              /* [out] Chip Id */
112        uint16_t *pChipRev                                              /* [out] Chip Rev. */
113        );
114
115/***************************************************************************
116Summary:
117        This typedef defines the pointer to chip GetFeature function.
118
119Description:
120        This function pointer is provided for chips that have specific features
121        that need to be queried.
122
123See Also:
124        BCHP_GetFeature()
125
126****************************************************************************/
127typedef BERR_Code (*BCHP_GetFeatureFunc)(
128        const BCHP_Handle hChip,                                /* [in] Chip handle. */
129        const BCHP_Feature eFeature,                    /* [in] Feature to be queried. */
130        void *pFeatureValue                                             /* [out] Feature value .*/
131        );
132
133/***************************************************************************
134Summary:
135        This typedef defines the pointer to chip MonitorPvt function.
136
137Description:
138        This function pointer is provided for chips that have AVS
139
140See Also:
141        BCHP_MonitorPvt()
142
143****************************************************************************/
144typedef void (*BCHP_MonitorPvtFunc)(
145        const BCHP_Handle hChip,            /* [in] Chip handle. */
146        BCHP_AvsSettings *pSettings     /* [in] AVS settings. */       
147        );
148
149
150/***************************************************************************
151Summary:
152        This typedef defines the pointer to chip GetAvsData function.
153
154Description:
155        This function pointer is provided for chips that have AVS.
156
157See Also:
158        BCHP_GetAvsData()
159
160****************************************************************************/
161typedef BERR_Code (*BCHP_GetAvsDataFunc)(
162        const BCHP_Handle hChip,            /* [in] Chip handle */
163        BCHP_AvsData *pData             /* [out] pointer to location to return data */
164        );
165
166/***************************************************************************
167Summary:
168        This typedef defines the pointer to chip StandbyMode function.
169
170Description:
171        This function pointer is provided for chips that support changing power modes.
172
173See Also:
174        BCHP_StandbyMode()
175
176****************************************************************************/
177typedef BERR_Code (*BCHP_StandbyModeFunc)(
178        const BCHP_Handle hChip,  /* [in] Chip handle. */
179        bool activate             /* [in] true to activate standby mode */
180        );
181
182
183typedef struct BCHP_PWR_P_Context {
184    BKNI_MutexHandle lock; /* for internal sync */
185   
186    unsigned *pubRefcnt;   /* public refcnt is non-recursive and enforces that you only release
187                              what you've previously acquired. only applies to nonleaf nodes */
188
189    unsigned *privRefcnt;  /* private refcnt is recursive. applies to all nodes */
190    bool *init;            /* every HW node must be initialized before it can be acquired/released.
191                              initialized means powered down */
192    bool initComplete;     /* true if BCHP_PWR_P_Init() has completed */
193    bool *magnumCtrl;      /* true if MAGNUM_CONTROLLED HW_ node */
194    bool *sharedCtrl;      /* true if HW_ node has at least one HW_ node parent that is
195                              MAGNUM_CONTROLLED and one that is not */
196} BCHP_PWR_P_Context;
197
198typedef struct BCHP_PWR_P_Context *BCHP_PWR_Handle;
199typedef struct BCHP_AVS_P_Context *BCHP_AVS_Handle;
200
201typedef struct BCHP_P_Context
202{
203        void *chipHandle;                                               /* Chip Specific handle */
204        BREG_Handle regHandle;                                  /* register handle */
205        BCHP_CloseFunc pCloseFunc;                              /* ptr to Close func. */
206        BCHP_GetChipInfoFunc pGetChipInfoFunc;  /* ptr to GetChipInfo func. */
207        BCHP_GetFeatureFunc pGetFeatureFunc;    /* ptr to GetFeature func. */
208        BCHP_MonitorPvtFunc pMonitorPvtFunc;    /* ptr to MonitorPvtFunc func. */
209        BCHP_GetAvsDataFunc pGetAvsDataFunc;    /* ptr to GetAvsDataFunc func. */
210        BCHP_StandbyModeFunc pStandbyModeFunc;  /* ptr to StandbyModeFunc func. */
211        BCHP_PWR_Handle pwrManager;                             /* BCHP_PWR handle */
212        BCHP_AVS_Handle avsHandle;                              /* BCHP_AVS handle */
213} BCHP_P_Context;
214
215typedef enum BCHP_PWR_P_ResourceType {
216    BCHP_PWR_P_ResourceType_eLeaf,     /* a leaf node is always a HW_ node */
217    BCHP_PWR_P_ResourceType_eNonLeaf,  /* a non-leaf node that is not a HW_ node */
218    BCHP_PWR_P_ResourceType_eNonLeafHw /* a non-leaf node that is also a HW_ node.
219                                          these nodes can only have other HW_ nodes as dependencies */
220
221} BCHP_PWR_P_ResourceType;
222
223struct BCHP_PWR_P_Resource {
224    BCHP_PWR_P_ResourceType type;
225    unsigned id; /* the #define number */
226    const char name[32];
227};
228
229typedef struct BCHP_PWR_P_Resource BCHP_PWR_P_Resource;
230
231BERR_Code BCHP_PWR_Open(
232    BCHP_PWR_Handle *pHandle, /* [out] */
233    BCHP_Handle chp           /* [in] */
234    );
235
236void BCHP_PWR_Close(
237    BCHP_PWR_Handle handle   /* [in] */
238    );
239
240#ifdef __cplusplus
241}
242#endif
243
244#endif /*BCHP_PRIV_H__*/
245
Note: See TracBrowser for help on using the repository browser.