⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pmgr.h

📁 Xcale270Bsp包,wince平台
💻 H
字号:
#ifndef __PMGR_H__
#define __PMGR_H__
/******************************************************************************
**
** INTEL CONFIDENTIAL
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors.  Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.
**
** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
**
**  FILENAME:   pmgr.h
**
**  PURPOSE:    Contains constants and structures needed for pmgr.c
**
**
**  Assumes xllp_Pm_ProcRegInfo.h and xllp_Pm_SleepContext.h inclusion for pmgr.c
**
**  Assumes only xllp_defs.h inclusion for general usage.
**
******************************************************************************/
//#ifdef __PMGR_C_
// This section is of interest only to pmgr.c

/////////////////////////////////////////////////////////////////////////
//
// Constant definitions and defaults for parameter structure passed to
//  XllpPmEnterSleep() in XLLP_PM_ENTER_SLEEP_PARAMS_T structure
//

#include "xllp_Pm_SleepContext.h"

    // Begin control fields
#define PMGR_SleepOptions_DFLT      0u  // Not initially used, none selected

#define PMGR_LowPowerModeSelect_DFLT  MODE_SLEEP // Default is just sleep

                                    // Don't control the memc or IM clocks.
#define PMGR_CKEN_msk_DFLT          XLLP_CLKEN_RESERVED_BITS // Don't need to set CKEN during sleep for B0? (~(XLLP_CLKEN_MEMC|(0x1 << 20)|XLLP_CLKEN_AC97) )
#define PMGR_CKEN_vals_DFLT         0u   // Disable all unprotected CKEN during sleep

    // GPIO Sleep State Control
      // Control enable masks (0=use GPLR value; 1=use value from this param)

#define PMGR_PGSR0_msk_DFLT    (0xC0000000u  )
#define PMGR_PGSR1_msk_DFLT     0u
#define PMGR_PGSR2_msk_DFLT     0u
#define PMGR_PGSR3_msk_DFLT     (XLLP_PM_PGSR3_RESERVED_BITS|XLLP_GPIO_BIT_AC97_RESET_n)

      // Values to set.
      // Take values from xlli at first
#define PMGR_PGSR0_vals_DFLT    ((0x00008800u)| 0xC0000000u)   // xlli_GPSR0_value 
#define PMGR_PGSR1_vals_DFLT    (0x00000002u)  // xlli_GPSR1_value 
#define PMGR_PGSR2_vals_DFLT    (0x0001FC00u)  // xlli_GPSR2_value 
            // Must set AC97 reset line high (deasserted) in PGSR for ACUNIT to work after sleep
            // Force all reserved GPIO control bits low
#define PMGR_PGSR3_vals_DFLT    (0x00000000u|XLLP_GPIO_BIT_AC97_RESET_n)  // xlli_GPSR3_value 

    // Wakeup Enable Control: by default, wake up for any reason - 
    //      but default settings might not be used.
#define PMGR_PWER_DFLT          XLLP_VLD_MSK_PWER
#define PMGR_PRER_DFLT          XLLP_VLD_MSK_PRER
#define PMGR_PFER_DFLT          XLLP_VLD_MSK_PFER
#define PMGR_PKWR_DFLT          XLLP_VLD_MSK_PKWR

//
//  End of XLLP_PM_ENTER_SLEEP_PARAMS_T constants
//
/////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////
//
//  Structure Definitions
//

//------------------------
#ifdef  BUILDING_SAMPLE_OPT_REGLIST

    #define PM_OPTIONAL_REGLIST_SIZE 4
    extern volatile XLLP_VUINT32_T regListTestJunkArray[PM_OPTIONAL_REGLIST_SIZE];
    extern XLLP_PM_ADDR_WITH_MASK_T MyRegList [PM_OPTIONAL_REGLIST_SIZE];

#endif // def  BUILDING_SAMPLE_OPT_REGLIST

#ifdef  USING_EXTENDED_CHECKSUM_AREA
    #pragma pack (1)
    typedef struct  PM_SLEEP_SAVE_DATA_EXTENSIONS_S
    {
        #ifdef  BUILDING_SAMPLE_OPT_REGLIST
            XLLP_VUINT32_T  myRegListStorage[sizeof (MyRegList) /sizeof (XLLP_PM_ADDR_WITH_MASK_T)];
        #endif // def  BUILDING_SAMPLE_OPT_REGLIST
        unsigned long  i;    // example
        char x;              // example
            // example: only needed if there are chars or short ints.
        char padding_to_32_bit_boundary[(4-sizeof(char))/sizeof(char)]; 
    } PM_SLEEP_SAVE_DATA_EXTENSIONS_T , *P_PM_SLEEP_SAVE_DATA_EXTENSIONS_T;
    #pragma pack ()

    #define PM_SLEEP_SAVE_DATA_EXTENSIONS_SZ (sizeof (PM_SLEEP_SAVE_DATA_EXTENSIONS_T))

#else // #ifdef USING_EXTENDED_CHECKSUM_AREA

    #define PM_SLEEP_SAVE_DATA_EXTENSIONS_SZ 0

#endif // #else of #ifdef  USING_EXTENDED_CHECKSUM_AREA

//------------------------


// Terminal material for sleep data area
typedef struct  PM_SLEEP_DATA_TM_S
{
    XLLP_UINT32_T  resetLaunchAddr;  // Must be next to end of structure
    XLLP_UINT32_T  sleepType;        // Must be at end of structure

} PM_SLEEP_DATA_TM_T , *P_PM_SLEEP_DATA_TM_T;


#pragma pack (1)
typedef struct  PM_SLEEP_DATA_S
{
    // Standard data save area must be first entry in structure.
    XLLP_PM_SLEEP_SAVE_DATA_T standardDataSaveArea;
    #ifdef  USING_EXTENDED_CHECKSUM_AREA
        // Anything to be protected by XLLP PM engine checksums must immediately
        //  follow the Standard data save area
        PM_SLEEP_SAVE_DATA_EXTENSIONS_T sleepExtraChecksummedData;
    #endif // def  USING_EXTENDED_CHECKSUM_AREA
    XLLP_PM_ENTER_SLEEP_PARAMS_T    sleepParameters;

    XLLP_UINT8_T pad0[SLEEP_SAVE_BYTES-(sizeof(XLLP_PM_SLEEP_SAVE_DATA_T)
                                        +PM_SLEEP_SAVE_DATA_EXTENSIONS_SZ
                                        +sizeof(XLLP_PM_ENTER_SLEEP_PARAMS_T)
                                        +sizeof(PM_SLEEP_DATA_TM_T))];
    // Must always be at end.
    PM_SLEEP_DATA_TM_T  sleepTM;

} PM_SLEEP_DATA_T , *P_PM_SLEEP_DATA_T;
#pragma pack ()


////////////////////////////////////////////////
//
//  Function prototypes for pmgr.c internal use
//

void OEMPowerOff (void);
void PmgrProcessorFlushAll (void);
void PmgrDumpOSCRs(void);
static void PmgrCheckForForcedWakeup(void);
static void PmgrOsSuspendOptionalFn(void);
static void PmgrOsResumeOptionalFn(void);

#ifdef BSP_MAINSTONE
    static void PmgrBlankLeds(void);
#endif // def BSP_MAINSTONE
//#endif // def __PMGR_C_

////////////////////////////////////////////////
//
//  Enums for sleep value control
//

typedef enum {
     PMDS_SLEEP_TYPE = 1,
     PMDS_UNKNOWN

} PMGR_DATUM_SELECTOR_T, *P_PMGR_DATUM_SELECTOR_T;


////////////////////////////////////////////////
//
//  #defines for sleep value control
//

//    ; Normal sleep with standard resume desired is standard
//    ; Use 0 as basic mode for simplicity, because this area is zero-initialized at powerup
#define SLEEP_TYPE_STANDARD         0u  
#define SLEEP_TYPE_SOFT_RESET       1u  


////////////////////////////////////////////////
//
//  Function prototypes for general use
//

// Restricted usage!  Serialization assumed.
extern XLLP_STATUS_T PmgrInitSleepParam(PVOID pvu_SleepAreaBase, // Virtual Uncached Addr of SleepDataArea
                                        BOOL forceReset); // Unless forced, skips init if done.

// Note: the following two functions will eventually cause a need for a sleep parameter mutex.

// Limited usage OK.  Serialization assumed.
extern XLLP_STATUS_T PmgrSetValue(PVOID pvu_SleepAreaBase,
                                  PMGR_DATUM_SELECTOR_T selector,
                                  XLLP_UINT32_T value);

// General usage OK.  Serialization assumed if needed.
extern XLLP_STATUS_T PmgrGetValue(PVOID pvu_SleepAreaBase,
                                  PMGR_DATUM_SELECTOR_T selector,
                                  P_XLLP_UINT32_T pu32_Value);

#endif  // __PMGR_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -