| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-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_avs_priv.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/3 $ |
|---|
| 12 | * $brcm_Date: 3/15/12 3:49p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/basemodules/chp/7425/bchp_avs_priv.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/3 3/15/12 3:49p rjlewis |
|---|
| 21 | * SW7425-2218: Updated to support new voltage data structure and get |
|---|
| 22 | * function. |
|---|
| 23 | * |
|---|
| 24 | * Hydra_Software_Devel/2 3/2/12 6:22p rjlewis |
|---|
| 25 | * SW7425-2218: Added function for getting number of central oscillators. |
|---|
| 26 | * |
|---|
| 27 | * Hydra_Software_Devel/1 2/17/12 6:08p rjlewis |
|---|
| 28 | * SW7346-117: new priv include file for test software. |
|---|
| 29 | * |
|---|
| 30 | * |
|---|
| 31 | ***************************************************************************/ |
|---|
| 32 | #ifndef BCHP_AVS_PRIV_H__ |
|---|
| 33 | #define BCHP_AVS_PRIV_H__ |
|---|
| 34 | |
|---|
| 35 | #include "bstd.h" |
|---|
| 36 | #include "bchp.h" |
|---|
| 37 | |
|---|
| 38 | /* |
|---|
| 39 | ** The functions in this file are used to provide dymanic testing (or checking) of the AVS module. |
|---|
| 40 | ** These functions should only be used for testing/validation purposes. They can be destructive |
|---|
| 41 | ** and cause the system to crash. Use these functions with extreme caution. |
|---|
| 42 | */ |
|---|
| 43 | |
|---|
| 44 | typedef struct { |
|---|
| 45 | bool valid; /* true if data filled in */ |
|---|
| 46 | |
|---|
| 47 | uint32_t last_dac; /* the last value written to the DAC */ |
|---|
| 48 | uint32_t last_temp; /* last data read from temperature register */ |
|---|
| 49 | |
|---|
| 50 | uint32_t V_0p99, V_1p1_0, V_1p1_1, V_2p75, V_3p63; /* last values read from voltage registers */ |
|---|
| 51 | /* below are the converted (to voltages) values of above */ |
|---|
| 52 | uint32_t last_voltage_1p1_0, last_voltage_1p1_1, last_voltage_0p99, last_voltage_2p75, last_voltage_3p63; |
|---|
| 53 | } AvsTestData; |
|---|
| 54 | |
|---|
| 55 | #ifdef __cplusplus |
|---|
| 56 | extern "C" { |
|---|
| 57 | #endif |
|---|
| 58 | |
|---|
| 59 | /* The number of oscillators varies from platform to platform -- here is the number on this platform */ |
|---|
| 60 | unsigned AvsGetNumberCentrals(void); |
|---|
| 61 | unsigned AvsGetNumberRemotes(void); |
|---|
| 62 | |
|---|
| 63 | /* Get/Set the DAC */ |
|---|
| 64 | uint32_t AvsGetDAC(BCHP_P_AvsHandle hHandle); |
|---|
| 65 | void AvsSetDAC(BCHP_P_AvsHandle hHandle, uint32_t dac_code); |
|---|
| 66 | |
|---|
| 67 | /* Get status value of a specific oscillator */ |
|---|
| 68 | uint32_t AvsReadCentralOscillator(BREG_Handle hRegister, unsigned oscillator); |
|---|
| 69 | uint32_t AvsReadRemoteOscillator(BREG_Handle hRegister, unsigned oscillator); |
|---|
| 70 | |
|---|
| 71 | /* Get threshold values for a specific oscillator */ |
|---|
| 72 | void AvsReadCentralOscThresholds(BREG_Handle hRegister, unsigned oscillator, uint32_t *reg_min, uint32_t *reg_max); |
|---|
| 73 | void AvsReadRemoteOscThresholds(BREG_Handle hRegister, unsigned oscillator, uint32_t *reg_min, uint32_t *reg_max); |
|---|
| 74 | |
|---|
| 75 | /* This is used to prevent the AVS processing from verifying any of its registers */ |
|---|
| 76 | BERR_Code AvsLock(BCHP_P_AvsHandle hHandle); |
|---|
| 77 | |
|---|
| 78 | /* This un-does the Lock operation */ |
|---|
| 79 | BERR_Code AvsUnlock(BCHP_P_AvsHandle hHandle); |
|---|
| 80 | |
|---|
| 81 | /* This provides miscellaneous AVS data for test purposes */ |
|---|
| 82 | void AvsGetTestData(BCHP_P_AvsHandle hHandle, AvsTestData *data); |
|---|
| 83 | |
|---|
| 84 | #ifdef __cplusplus |
|---|
| 85 | } |
|---|
| 86 | #endif |
|---|
| 87 | |
|---|
| 88 | #endif /* BCHP_AVS_PRIV_H__ */ |
|---|
| 89 | |
|---|