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

📄 mclk_6000.h

📁 在高通的手机平台下,一个下载手机.bin文件到手机的flash中的工具,包含PC端的程序代码和运行在基带处理器中的代码.
💻 H
字号:
#ifndef MCLK_5105_H
#define MCLK_5105_H

/*===========================================================================

   M I C R O   C L O C K   I N T E R N A L    H E A D E R    F I L E

DESCRIPTION
  This header file contains all the internal definitions used by the
  dynamic micro clock switching code.

  Copyright (c) 1999-2002 by QUALCOMM, Incorporated.  All Rights Reserved.
===========================================================================*/

/*===========================================================================

                      EDIT HISTORY FOR FILE

This section contains comments describing changes made to this file.
Notice that changes are listed in reverse chronological order.

$Header:   L:/src/asw/MSM6000/vcs/mclk_6000.h_v   1.1   20 Mar 2002 19:57:26   hromero  $   

when       who     what, where, why
--------   ---     ----------------------------------------------------------
06/12/01   rmd     Eliminated mclk_switching_set_current_speed() prototype
                   definition.
05/09/01   rmd     Created the following macros: MCLK_SWITCH_TO_FAST, 
                   MCLK_SWITCH_TO_NORM and MCLK_SWITCH_TO_SLEEP. Added
                   prototype definition for mclk_goto_sleep_clk_kill_tcxo(),
                   mclk_switching_set_current_speed() and
                   mclk_sleep. Plus some code clean up.
02/12/01   rmd     Initial Revision

===========================================================================*/

/*===========================================================================

                DEFINITIONS AND DECLARATIONS FOR MODULE

This section contains definitions for constants, macros, types, variables
and other items needed by this module.

===========================================================================*/

/* This type definition specifies the different speed modes of the MCLK */
typedef enum {
        CLK_NORM,
        CLK_FAST
} mclk_speed_type;

/* We use these type definitions to keep track on the micro clock settings*/
/* In the MSM5105, mclk_ctl_a = UP_CLK_CTL1 */
typedef struct{
        byte xtal_wu_duration;
        byte source;
} mclk_ctl_a_source_type;

typedef struct{
        mclk_ctl_a_source_type       micro_clk_ctla;
        byte                         divider;
        mclk_speed_type              mclk_speed;
} mclk_settings_type;


#if defined(FEATURE_MCLK_43TCXO)
/*===========================================================================

                        MACRO MCLK_SWITCH_TO_FAST

    This macro uses the new method of micro clock switching 
(switching on the fly) to switch the micro clock speed from any clock to 4/3 
TCXO. This is done as follows: 

1) Switch the micro clock to TCXO (through UP_CLK_CTL 0)
2) Prepare set the micro divider to DIV 3
3) Set UP_CLK_CTL1 source to 4/3 TCXO (PLL OUT)
4) Switch to UP_CLK_CTL1

===========================================================================*/                                                                  
#define MCLK_SWITCH_TO_FAST()                                     \
  /* switch to UP_CLK_CTL0 */                                     \
  outpw(SWITCH_CLK_WB, SWITCH_CLK_WB__UP_CLK_CTL0);               \
  /* Change the divider to 1/3 */                                 \
  outp(UP_CLK_CTL2_WB, UP_CLK_CTL2_WB__MCLK_RATE_DIV3);           \
  /* Prepare UP_CLK_CTL1 */                                       \
  outp(UP_CLK_CTL1_WB, UP_CLK_CTL1_WB__POWER_DOWN_DIS |           \
                       UP_CLK_CTL1_WB__XTAL_WU_DURATION_52USEC |  \
                       UP_CLK_CTL1_WB__UP_CLK_SRC_PLLOUT);        \
  /* switch to UP_CLK_CTL1 */                                     \
  outpw(SWITCH_CLK_WB, SWITCH_CLK_WB__UP_CLK_CTL1)                   
                       
#endif /*FEATURE_MCLK_43TCXO*/

/*===========================================================================

                        MACRO MCLK_SWITCH_TO_NORM

    This macro uses the new method of micro clock switching 
(switching on the fly) to switch the micro clock speed from any clock to TCXO. 
This is done as follows: 

1) Switch the micro clock to TCXO (through UP_CLK_CTL 0)
2) Prepare set the micro divider to DIV 1
3) Set UP_CLK_CTL1 source to TCXO
4) Switch to UP_CLK_CTL1

===========================================================================*/

#define MCLK_SWITCH_TO_NORM()                                     \
  /* Switch to UP_CLK_CTL0 */                                     \
  outpw(SWITCH_CLK_WB, SWITCH_CLK_WB__UP_CLK_CTL0);               \
  /* Change the divider to 1   */                                 \
  outp(UP_CLK_CTL2_WB, UP_CLK_CTL2_WB__MCLK_RATE_DIV1);           \
  /* Prepare UP_CLK_CTL1 to switch to TCXO */                     \
  outp(UP_CLK_CTL1_WB, UP_CLK_CTL1_WB__POWER_DOWN_DIS |           \
                       UP_CLK_CTL1_WB__XTAL_WU_DURATION_52USEC |  \
                       UP_CLK_CTL1_WB__UP_CLK_SRC_TCXO);          \
  /* Switch to UP_CLK_CTL1 */                                     \
  outpw(SWITCH_CLK_WB, SWITCH_CLK_WB__UP_CLK_CTL1)
  
/*===========================================================================

                        MACRO MCLK_SWITCH_TO_SLEEP

    This macro uses the new method of micro clock switching 
(switching on the fly) to switch the micro clock speed from any clock to the 
sleep clock. This is done as follows: 

1) Switch the micro clock to TCXO (through UP_CLK_CTL 0)
2) Prepare set the micro divider to DIV 1
3) Set UP_CLK_CTL1 source to the sleep clock
4) Switch to UP_CLK_CTL1

===========================================================================*/

#define MCLK_SWITCH_TO_SLEEP()                                    \
  /* switch to UP_CLK_CTL0 */                                     \
  outpw(SWITCH_CLK_WB, SWITCH_CLK_WB__UP_CLK_CTL0);               \
  /* Change the divider to 1   */                                 \
  outp(UP_CLK_CTL2_WB, UP_CLK_CTL2_WB__MCLK_RATE_DIV1);           \
  /* Prepare UP_CLK_CTL1 to switch to SLEEP */                    \
  outp(UP_CLK_CTL1_WB, UP_CLK_CTL1_WB__POWER_DOWN_DIS |           \
                       UP_CLK_CTL1_WB__XTAL_WU_DURATION_52USEC |  \
                       UP_CLK_CTL1_WB__UP_CLK_SRC_SLEEP_XTAL_IN); \
  /* switch to UP_CLK_CTL1 */                                     \
  outpw(SWITCH_CLK_WB, SWITCH_CLK_WB__UP_CLK_CTL1)

/*===========================================================================

FUNCTION MCLK_SWITCHING_INIT


===========================================================================*/
void mclk_switching_init( void );

/*===========================================================================

FUNCTION MCLK_CONVERT_SCH_RATE_TO_SPEED

===========================================================================*/
void mclk_convert_sch_rate_to_speed(byte fsch_rate, byte rsch_rate);

/*===========================================================================

FUNCTION MCLK_SWITCHING_GET_CURRENT_SPEED


===========================================================================*/
mclk_speed_type mclk_switching_get_current_speed( void );

/*===========================================================================

FUNCTION MCLK_SWITCHING_THROTTLE


===========================================================================*/
void mclk_switching_throttle(mclk_speed_type mclk_speed);

/*===========================================================================

FUNCTION MCLK_GOTO_SLEEP_CLK_KILL_TCXO


===========================================================================*/
void mclk_goto_sleep_clk_kill_tcxo(void);

/*===========================================================================

FUNCTION MCLK_SLEEP


===========================================================================*/
void mclk_sleep(void);

#endif /*MCLK_5105_H*/

⌨️ 快捷键说明

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