source: svn/newcon3bcm2_21bu/magnum/portinginterface/pwr/7552/bpwr.h @ 76

Last change on this file since 76 was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 13.0 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2010, 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: bpwr.h $
11 * $brcm_Revision: Hydra_Software_Devel/1 $
12 * $brcm_Date: 11/23/10 2:10p $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/pwr/7552/bpwr.h $
19 *
20 * Hydra_Software_Devel/1   11/23/10 2:10p xhuang
21 * SW7552-9: Add support for 97552
22 *
23 *
24 ***************************************************************************/
25#ifndef BPWR_H__
26#define BPWR_H__
27
28#include "bstd_ids.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/*=************************ Module Overview ********************************
35The Power Management API is a library that allows the shutting down and
36subsequent power up of specified hardware blocks.
37
38This API is targeted for Hydra core based chip, and future chips.  This API
39exploits all possible power management modes provided by chip capabilities.
40It also attempts to hide all the gritty hardware details from the application.
41
42The API operates on a context handle.  There is a main PWR handle which
43represents a certain state of the power management software object. This object
44may contain information regarding the hardware blocks that are currently
45active and RTS settings, if any of inactive blocks that were previously
46shut down.
47
48Most of the API functions are used in user mode context.  It is assumed that
49there are no critical sections in the a software module whose
50corespodning hardware blocks are shutdown. As such any register writes
51are allowed without going through critical sections.
52
53In the user mode context, after one has completed the intended setup for a
54ppwer management context, one "applies" it to the hardware.  It is only at this time
55that the actual configuration (i.e. register writes or queues) of the
56hardware occurs.  Modifying a power management context does not affect the
57hardware at all until it is applied.  Please notice that the setup calls
58between two "applyings" is order independent, and that if there is conflict
59found as "applying" all new settings would not be applied.
60
61For more details, please refer to the description of BPWR_Handle.
62***************************************************************************/
63
64/***************************************************************************
65 * PWR data types
66 **************************************************************************/
67
68/***************************************************************************
69Summary:
70        This enum lists the possible power modes for a given module
71
72Description:
73        BPWR_ePowerMode is an enumeration that lists the possible power
74        modes for a given PI module. A module's initial mode is undefined and
75        is set via BPWR_SetMode or BPWR_SetAllMode.
76
77***************************************************************************/
78typedef enum BPWR_ePowerMode
79{
80        BPWR_Mode_ePowerDown = 0,
81        BPWR_Mode_ePowerUp,
82        BPWR_Mode_ePowerUndefined
83} BPWR_ePowerMode;
84
85/***************************************************************************
86Summary:
87        This structure describes the settings for the power management.
88
89Description:
90        BPWR_Settings is a structure that use to describe the public
91        settings for power management.
92
93        This structure is not used in 7405. The code will read from Sun_Top+Ctrl_Strap to figure out
94        the memory configuration. The portinginterface only handle MEMC 1 for non-UMA memory
95        configuration.
96
97        ulMemc0ClientStartAddr - address of MEMC0's 1st client
98        ulMemc0ClientCount     - number of MEMC0 clients
99        ulMemc1ClientStartAddr - address of MEMC1's 1st client
100        ulMemc1ClientCount     - number of MEMC1 clients
101        ulMemc2ClientStartAddr - address of MEMC2's 1st client
102        ulMemc2ClientCount     - number of MEMC2 clients
103
104        The default values for all the fields is 0; hence, these must be defined
105        by the application. If none of the start addresses are defined, an error
106        will be returned.
107
108***************************************************************************/
109typedef struct BPWR_Settings
110{
111        uint32_t ulMemc0StartAddr;
112        uint32_t ulMemc0ClientCount;
113        uint32_t ulMemc1StartAddr;
114        uint32_t ulMemc1ClientCount;
115        uint32_t ulMemc2StartAddr;
116        uint32_t ulMemc2ClientCount;
117} BPWR_Settings;
118
119/***************************************************************************
120 * PWR handles
121 **************************************************************************/
122
123/***************************************************************************
124Summary:
125        Main Power Management (PWR) context handle.
126
127Description:
128        This is an opaque handle that application created with BPWR_Open.
129        BPWR_Handle holds the context of the Power Management module.  There
130        should only one BPWR_Handle per chip.
131
132See Also:
133        BPWR_Open, BPWR_Close.
134***************************************************************************/
135typedef struct BPWR_P_Context          *BPWR_Handle;
136
137
138/***************************************************************************
139 * Public API
140 **************************************************************************/
141
142/***************************************************************************
143 * Function prototype
144 **************************************************************************/
145/***************************************************************************
146Summary:
147        This function gets BPWR's inherent default setting structure.
148
149Description:
150        BPWR's inherent default setting structure could be queried by this API
151        function prior to BPWR_Open, modified and then passed to BPWR_Open.
152        This save application tedious work of filling in the configuration
153        structure.
154
155Input:
156        <None>
157
158Output:
159        pDefSettings - A reference to default settings structure.
160
161Returns:
162        BERR_INVALID_PARAMETER - Invalid function parameters.
163        BERR_SUCCESS - Successfully get PWR default settings.
164
165See Also:
166        BPWR_Open.
167**************************************************************************/
168BERR_Code BPWR_GetDefaultSettings
169        ( BPWR_Settings                   *pDefSettings );
170
171/***************************************************************************
172Summary:
173        This function opens and initializes the power management object.
174
175Description:
176        The first thing one need to do is open a PWR (also create a PWR
177        main context handle, BPWR_Handle).  This will hold the states
178        of different hardware blocks.  From this handle, the user can
179        shutdown and/or power up desired hardware blocks. This handle is
180        required when we call BPWR_ApplyChanges to update the hardware.
181        This handle eventually be closed by calling BVDC_Close.
182
183Input:
184        hChip - BCHP handle
185        hReg - BREG handle
186        pDefSettings - The default setting that user want the BPWR to be
187        in. This parameter can be NULL. In this case BPWR's inherent default
188        structure will be used. This inherent structure could be queried prior
189        to BPWR_Open with BPWR_GetDefaultSettings, modified and passed to
190        BPWR_Open.
191
192Output:
193        phPwr - a reference to a PWR handle.  Upon successful open this will
194        reference to a fresh new PWR handle (context).  If error occur during
195        BPWR_Open *phPwr be NULL.
196
197Returns:
198        BERR_INVALID_PARAMETER - Invalid function parameters.
199        BERR_SUCCESS - Successfully opened PWR.
200
201See Also:
202        BPWR_Close, BPWR_GetDefaultSettings.
203**************************************************************************/
204BERR_Code BPWR_Open
205        ( BPWR_Handle                                     *phPwr,
206          BCHP_Handle                                      hChip,
207          BREG_Handle                                      hRegister,
208          const BPWR_Settings                     *pDefSettings );
209
210/***************************************************************************
211Summary:
212        This function closes the power management object..
213
214Description:
215        Upon terminating power managemment, the application needs to call BPWR_Close
216        to close the power management object. After close, PWR is an invalid handle,
217        and should not be use with any other PWR functions.  Failure to close will
218        result in undefined     consequences. BPWR_Close returns success if hPwr is NULL.
219
220Input:
221        hPwr - Power management handle that was previously opened by
222        BPWR_Open.
223
224Output:
225        hPwr - Power management handle becomes invalid.
226
227Returns:
228        BERR_INVALID_PARAMETER - Invalid function parameters.
229        BERR_SUCCESS - Successfully closed PWR.
230
231See Also:
232        BPWR_Open.
233**************************************************************************/
234BERR_Code BPWR_Close
235        ( BPWR_Handle                      hPwr );
236
237/***************************************************************************
238Summary:
239        This function "Apply Changes" and update the desired hardware in the
240        power management object.
241
242Description:
243        After all settings in the user mode context have been made which
244        include configuring the the hardware blocks clocks and other parameters,
245        BPWR_ApplyChanges will "apply" the "changes" to hardware.  It is
246        possible the the context handle is not setup correctly.  In that case an
247        error will return, and no hardware will be updated.  The hardware it
248        updates will depend on the software modules specified by BPWR_SetMode.
249        This function is optimized to only update required registers.
250
251        BPWR_ApplyChanges actually uses register reads and writes.
252
253Input:
254        hPwr - PowerManagement handle that was previously opened by
255        BPWR_Open, and setup with BPWR calls.
256
257Output:
258        <None>
259
260Returns:
261        BERR_INVALID_PARAMETER - Invalid function parameters.
262        BERR_SUCCESS - Successfully updated hardware.
263
264See Also:
265        BREG_Handle.
266**************************************************************************/
267BERR_Code BPWR_ApplyChanges
268        ( BPWR_Handle                      hPwr );
269
270/***************************************************************************
271Summary:
272        This function specifies which software module need to be shutdown or
273        powered up.
274
275Description:
276
277Input:
278        hPwr  - A valid power management handle created ealier.
279        module - The software module to be shutdown.
280        eMode - BPWR_Mode_ePowerUp, BPWR_Mode_ePowerUp
281
282Output:
283        None.
284
285Returns:
286        BERR_INVALID_PARAMETER - Invalid function parameters.
287        BERR_SUCCESS - Function succeed
288
289See Also:
290        BPWR_ApplyChanges, BPWR_ePowerMode
291**************************************************************************/
292BERR_Code BPWR_SetMode
293        ( const BPWR_Handle                hPwr,
294          BSTD_Module                      module,
295          BPWR_ePowerMode                  eMode );
296
297/***************************************************************************
298Summary:
299        This function gets the mode of a given module
300
301Description:
302
303Input:
304        hPwr  - A valid power management handle created ealier.
305        module - The software module to be shutdown.
306
307Output:
308        peMode - the mode of the module
309
310Returns:
311        BERR_NOT_SUPPORTED - Module is not supported.
312        BERR_SUCCESS - Function succeed
313
314See Also:
315        BPWR_ApplyChanges, BPWR_ePowerMode
316**************************************************************************/
317BERR_Code BPWR_GetMode
318        ( const BPWR_Handle                        hPwr,
319          BSTD_Module                                      module,
320          BPWR_ePowerMode                                 *peMode );
321
322/***************************************************************************
323Summary:
324        This function gets the number of modules
325
326Description:
327
328Input:
329        hPwr  - A valid power management handle created ealier.
330
331Output:
332        pulModuleCount - the number of modules
333
334Returns:
335        BERR_SUCCESS - Function succeed. This function cannot fail.
336
337See Also: BPWR_GetModuleList
338**************************************************************************/
339
340BERR_Code BPWR_GetModuleCount
341        ( BPWR_Handle                      hPwr,
342          uint32_t                            *pulModuleCount );
343
344
345/***************************************************************************
346Summary:
347        This function gets the list of available modules
348
349Description:
350
351Input:
352        hPwr  - A valid power management handle created ealier.
353
354Output:
355        pModuleList - the list of modules
356        ulModuleCount - number of entries in pModuleList array
357
358Returns:
359        BERR_NOT_SUPPORTED - ulModuleCount not large enough hold all modules for this chip
360        BERR_SUCCESS - Function succeed
361
362See Also: BPWR_GetModuleCount, BSTD_Module
363**************************************************************************/
364BERR_Code BPWR_GetModuleList
365        ( BPWR_Handle                      hPwr,
366          BSTD_Module                     *pModuleList,
367          unsigned                         ulModuleCount );
368
369
370/***************************************************************************
371Summary:
372        This function sets the modes of the modules in a given list
373
374Description:
375
376Input:
377        hPwr  - A valid power management handle created ealier.
378        pModuleList - the list of modules
379        ulModuleCount - the number of modules
380        eMode - the power mode
381
382Output:
383
384Returns:
385        BERR_NOT_SUPPORTED - Module is not supported.
386        BERR_SUCCESS - Function succeed
387
388See Also:
389        BPWR_ApplyChanges, BPWR_ePowerMode, BSTD_Module
390**************************************************************************/
391BERR_Code BPWR_SetModes
392        ( BPWR_Handle                     hPwr,
393          BSTD_Module                    *pModuleList,
394          uint32_t                                ulModuleCount,
395          BPWR_ePowerMode                 eMode );
396
397
398
399#ifdef __cplusplus
400}
401#endif
402
403#endif /* #ifndef BPWR_H__ */
404
405/* End of File */
Note: See TracBrowser for help on using the repository browser.