lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /*******************************************************************************
|
| 2 | * Copyright (C) 2007, ZTE Corporation.
|
| 3 | *
|
| 4 | * File Name:
|
| 5 | * File Mark:
|
| 6 | * Description: all function defines provided by sys module
|
| 7 | * Others:
|
| 8 | * Version: 1.0
|
| 9 | * Author: chenjianguo
|
| 10 | * Date: 2013-5-31
|
| 11 | * History 1:
|
| 12 | * Date:
|
| 13 | * Version:
|
| 14 | * Author:
|
| 15 | * Modification:
|
| 16 | * History 2:
|
| 17 | ********************************************************************************/
|
| 18 |
|
| 19 | #ifndef _DRVS_SPINLOCK_H
|
| 20 | #define _DRVS_SPINLOCK_H
|
| 21 |
|
| 22 | #include "drvs_general.h"
|
| 23 | /****************************************************************************
|
| 24 | * Include files
|
| 25 | ****************************************************************************/
|
| 26 |
|
| 27 | /****************************************************************************
|
| 28 | * Macros
|
| 29 | ****************************************************************************/
|
| 30 |
|
| 31 | /****************************************************************************
|
| 32 | * Types
|
| 33 | ****************************************************************************/
|
| 34 | typedef enum
|
| 35 | {
|
| 36 | CORE_ID_PS=210,
|
| 37 | CORE_ID_PHY=211,
|
| 38 | CORE_ID_ZSP=212,
|
| 39 | CORE_ID_M0=213,
|
| 40 | CORE_ID_AP=214,
|
| 41 | CORE_ID_NUM = 215
|
| 42 | } T_ZDrvSpinlock_CpuId;
|
| 43 | /* ±êʶӲ¼þËø*/
|
| 44 | typedef enum
|
| 45 | {
|
| 46 | PCU_HWLOCK = 0,/*PCU*/
|
| 47 | CLK_HWLOCK = 1,/*Clock*/
|
| 48 | REGLOCK_HWLOCK = 2,/*Reg*/
|
| 49 | SOFTLOCK_HWLOCK = 3,/*Software*/
|
| 50 | HWLOCK_NUM
|
| 51 | } T_ZDrvSpinlock_HwLockId;
|
| 52 |
|
| 53 | /* ±êʶÈí¼þËø*/
|
| 54 | typedef enum
|
| 55 | {
|
| 56 | I2C0_SFLOCK = 0,/*i2c0*/
|
| 57 | I2C1_SFLOCK = 1,/*i2c1*/
|
| 58 | I2C2_SFLOCK = 2,/*pmic-i2c*/
|
| 59 | NAND_SFLOCK = 3,/*NAND*/
|
| 60 | SD0_SFLOCK,
|
| 61 | SD1_SFLOCK,
|
| 62 | ADC_SFLOCK, /*pmic adc*/
|
| 63 | UART_SFLOCK,
|
| 64 | SFLOCK_ID8,
|
| 65 | SFLOCK_ID9,
|
| 66 | SFLOCK_ID10,
|
| 67 | SFLOCK_ID11,
|
| 68 | SFLOCK_ID12,
|
| 69 | SFLOCK_ID13,
|
| 70 | SFLOCK_ID14,
|
| 71 | SFLOCK_ID15,
|
| 72 | SFLOCK_ID16,
|
| 73 | SFLOCK_ID17,
|
| 74 | SFLOCK_ID18,
|
| 75 | SFLOCK_ID19,
|
| 76 | SFLOCK_ID20,
|
| 77 | SFLOCK_ID21,
|
| 78 | SFLOCK_ID22,
|
| 79 | SFLOCK_ID23,
|
| 80 | SFLOCK_ID24,
|
| 81 | SFLOCK_ID25,
|
| 82 | SFLOCK_ID26,
|
| 83 | SFLOCK_ID27,
|
| 84 | SFLOCK_ID28,
|
| 85 | SFLOCK_ID29,
|
| 86 | SFLOCK_ID30,
|
| 87 | REG_SFLOCK = 31,/*reg*/
|
| 88 | SFLOCK_NUM
|
| 89 | } T_ZDrvSpinlock_SfLockId;
|
| 90 | /****************************************************************************
|
| 91 | * Constants
|
| 92 | ****************************************************************************/
|
| 93 |
|
| 94 | /****************************************************************************
|
| 95 | * Global Variables
|
| 96 | ****************************************************************************/
|
| 97 |
|
| 98 | /****************************************************************************
|
| 99 | * Function Prototypes
|
| 100 | ****************************************************************************/
|
| 101 | /*******************************************************************************
|
| 102 | * Function: zDrvSysSpinlock_HwLock
|
| 103 | * Description:»ñȡӲ¼þËø£¬id 0~1£¬
|
| 104 | * id 4±£Áô¸øÈí¼þËøÊ¹Óã¬ÍⲿÇý¶¯²»¿ÉÓá£
|
| 105 | * Parameters:
|
| 106 | * Input:
|
| 107 | *
|
| 108 | * Output:
|
| 109 | *
|
| 110 | * Returns:
|
| 111 | *
|
| 112 | *
|
| 113 | * Others:
|
| 114 | ********************************************************************************/
|
| 115 | VOID zDrvSysSpinlock_HwLock(T_ZDrvSpinlock_HwLockId hwid);
|
| 116 | /*******************************************************************************
|
| 117 | * Function: zDrvSysSpinlock_HwUnlock
|
| 118 | * Description:Çý¶¯ÊÍ·ÅÓ²¼þËø£¬id 0~1
|
| 119 | * Parameters:
|
| 120 | * Input:
|
| 121 | *
|
| 122 | * Output:
|
| 123 | *
|
| 124 | * Returns:
|
| 125 | *
|
| 126 | *
|
| 127 | * Others:
|
| 128 | ********************************************************************************/
|
| 129 | VOID zDrvSysSpinlock_HwUnlock(T_ZDrvSpinlock_HwLockId hwid);
|
| 130 | /*******************************************************************************
|
| 131 | * Function: zDrvSysSpinlock_SoftLock
|
| 132 | * Description:Çý¶¯»ñµÃÈí¼þËø½Ó¿Ú
|
| 133 | * Parameters:
|
| 134 | * Input: sfid: Èí¼þËøid¡£
|
| 135 | *
|
| 136 | * Output:
|
| 137 | *
|
| 138 | * Returns:
|
| 139 | *
|
| 140 | *
|
| 141 | * Others:
|
| 142 | ********************************************************************************/
|
| 143 | VOID zDrvSysSpinlock_SoftLock(T_ZDrvSpinlock_SfLockId sfid);
|
| 144 | /*******************************************************************************
|
| 145 | * Function: zDrvSysSpinlock_soft_unlock
|
| 146 | * Description:ÓëzDrvSysSpinlock_SoftLock¶ÔÓ¦µÄÊÍ·ÅÈí¼þËø½Ó¿Ú¡£
|
| 147 | * Parameters:
|
| 148 | * Input:
|
| 149 | *
|
| 150 | * Output:
|
| 151 | *
|
| 152 | * Returns:
|
| 153 | *
|
| 154 | *
|
| 155 | * Others:
|
| 156 | ********************************************************************************/
|
| 157 | VOID zDrvSysSpinlock_SoftUnlock(T_ZDrvSpinlock_SfLockId sfid);
|
| 158 | /*******************************************************************************
|
| 159 | * Function: zDrvSysSpinlock_SoftLockPsm
|
| 160 | * Description:Çý¶¯»ñµÃÈí¼þËø½Ó¿Ú(Ê¡µçרÓÃ)
|
| 161 | * Parameters:
|
| 162 | * Input: sfid: Èí¼þËøid¡£
|
| 163 | * coreid: ±£³ÖidºÅΪsfidÈí¼þËøµÄcpuid¡£
|
| 164 | * Output:
|
| 165 | *
|
| 166 | * Returns:
|
| 167 | *
|
| 168 | *
|
| 169 | * Others:
|
| 170 | ********************************************************************************/
|
| 171 | VOID zDrvSysSpinlock_SoftLockPsm(T_ZDrvSpinlock_SfLockId sfid);
|
| 172 |
|
| 173 | /*******************************************************************************
|
| 174 | * Function: zDrvSysSpinlock_SoftUnlockPsm
|
| 175 | * Description:ÓëzDrvSysSpinlock_SoftLockPsm¶ÔÓ¦µÄÊÍ·ÅÈí¼þËø½Ó¿Ú¡£
|
| 176 | * Parameters:
|
| 177 | * Input:
|
| 178 | *
|
| 179 | * Output:
|
| 180 | *
|
| 181 | * Returns:
|
| 182 | *
|
| 183 | *
|
| 184 | * Others:
|
| 185 | ********************************************************************************/
|
| 186 | VOID zDrvSysSpinlock_SoftUnlockPsm(T_ZDrvSpinlock_SfLockId sfid);
|
| 187 |
|
| 188 | /*******************************************************************************
|
| 189 | * Function: zDrvSysSpinlock_RegLock
|
| 190 | * Description:Çý¶¯»ñµÃÈí¼þËø½Ó¿Ú
|
| 191 | * Parameters:
|
| 192 | * Input:
|
| 193 | *
|
| 194 | * Output:
|
| 195 | *
|
| 196 | * Returns:
|
| 197 | *
|
| 198 | *
|
| 199 | * Others:
|
| 200 | ********************************************************************************/
|
| 201 | VOID zDrvSysSpinlock_RegLock(VOID);
|
| 202 | /*******************************************************************************
|
| 203 | * Function: zDrvSysSpinlock_reg_unlock
|
| 204 | * Description:ÓëzDrvSysSpinlock_RegLock¶ÔÓ¦µÄÊÍ·ÅÈí¼þËø½Ó¿Ú¡£
|
| 205 | * Parameters:
|
| 206 | * Input:
|
| 207 | *
|
| 208 | * Output:
|
| 209 | *
|
| 210 | * Returns:
|
| 211 | *
|
| 212 | *
|
| 213 | * Others:
|
| 214 | ********************************************************************************/
|
| 215 | VOID zDrvSysSpinlock_RegUnlock(VOID);
|
| 216 | /*******************************************************************************
|
| 217 | * Function: zDrvSysSpinlock_Initiate
|
| 218 | * Description:Èí¼þËø³õʼ»¯¡£
|
| 219 | * Parameters:
|
| 220 | * Input:
|
| 221 | *
|
| 222 | * Output:
|
| 223 | *
|
| 224 | * Returns:
|
| 225 | *
|
| 226 | *
|
| 227 | * Others:
|
| 228 | ********************************************************************************/
|
| 229 | SINT32 zDrvSysSpinlock_Initiate(VOID);
|
| 230 | #endif/*_DRVS_SYS_H*/
|
| 231 |
|