#include <inc/hw_memmap.h>
#include <inc/hw_types.h>
#include <inc/hw_adi.h>
#include <inc/hw_adi_0_rf.h>
#include <inc/hw_adi_1_synth.h>
#include <inc/hw_adi_2_refsys.h>
#include <inc/hw_adi_3_refsys.h>
#include <inc/hw_adi_4_aux.h>
#include <inc/hw_aon_ioc.h>
#include <inc/hw_aon_sysctl.h>
#include <inc/hw_aon_wuc.h>
#include <inc/hw_aux_wuc.h>
#include <inc/hw_ccfg.h>
#include <inc/hw_chip_def.h>
#include <inc/hw_ddi.h>
#include <inc/hw_flash.h>
#include <inc/hw_fcfg1.h>
#include <inc/hw_ddi_0_osc.h>
#include <inc/hw_prcm.h>
#include <inc/hw_vims.h>
#include <inc/hw_aon_batmon.h>
#include <inc/hw_aon_rtc.h>
#include <driverlib/adi.h>
#include <driverlib/aon_batmon.h>
#include <driverlib/cpu.h>
#include <driverlib/chipinfo.h>
#include <driverlib/ddi.h>
#include <driverlib/ioc.h>
#include <driverlib/prcm.h>
#include <driverlib/setup.h>
#include <driverlib/sys_ctrl.h>
Go to the source code of this file.
Macros | |
#define | DELAY_20_USEC 0x140 |
Defined time delay assuming 48 MHz clock and resolution of 3 cycles. More... | |
#define | CPU_DELAY_MICRO_SECONDS(x) CPUdelay(((uint32_t)((( x ) * 48.0 ) / 5.0 )) - 1 ) |
#define | CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA_WIDTH 4 |
Functions | |
static uint32_t | GetTrimForAdcShModeEn (uint32_t ui32Fcfg1Revision) |
Returns the trim value from FCFG1 to be used as ADC_SH_MODE_EN setting. More... | |
static uint32_t | GetTrimForAdcShVbufEn (uint32_t ui32Fcfg1Revision) |
Returns the trim value from FCFG1 to be used as ADC_SH_VBUF_EN setting. More... | |
static uint32_t | GetTrimForAmpcompCtrl (uint32_t ui32Fcfg1Revision) |
Returns the trim value to be used for the AMPCOMP_CTRL register in OSC_DIG. More... | |
static uint32_t | GetTrimForAmpcompTh1 (void) |
Returns the trim value to be used for the AMPCOMP_TH1 register in OSC_DIG. More... | |
static uint32_t | GetTrimForAmpcompTh2 (void) |
Returns the trim value to be used for the AMPCOMP_TH2 register in OSC_DIG. More... | |
static uint32_t | GetTrimForAnabypassValue1 (uint32_t ccfg_ModeConfReg) |
Returns the trim value to be used for the ANABYPASS_VALUE1 register in OSC_DIG. More... | |
static uint32_t | GetTrimForDblrLoopFilterResetVoltage (uint32_t ui32Fcfg1Revision) |
Returns the trim value from FCFG1 to be used as DBLR_LOOP_FILTER_RESET_VOLTAGE setting. More... | |
static uint32_t | GetTrimForRadcExtCfg (uint32_t ui32Fcfg1Revision) |
Returns the trim value to be used for the RADCEXTCFG register in OSC_DIG. More... | |
static uint32_t | GetTrimForRcOscLfIBiasTrim (uint32_t ui32Fcfg1Revision) |
Returns the FCFG1_OSC_CONF_ATESTLF_RCOSCLF_IBIAS_TRIM. More... | |
static uint32_t | GetTrimForRcOscLfRtuneCtuneTrim (void) |
Returns the trim value to be used for the RCOSCLF_RTUNE_TRIM and the RCOSCLF_CTUNE_TRIM bit fields in the XOSCLF_RCOSCLF_CTRL register in OSC_DIG. More... | |
static uint32_t | GetTrimForXoscHfCtl (uint32_t ui32Fcfg1Revision) |
Returns the trim value to be used for the XOSCHFCTL register in OSC_DIG. More... | |
static uint32_t | GetTrimForXoscHfFastStart (void) |
Returns the trim value to be used as OSC_DIG:CTL1.XOSC_HF_FAST_START. More... | |
static uint32_t | GetTrimForXoscHfIbiastherm (void) |
Returns the trim value to be used for the XOSC_HF_IBIASTHERM bit field in the ANABYPASS_VALUE2 register in OSC_DIG. More... | |
static uint32_t | GetTrimForXoscLfRegulatorAndCmirrwrRatio (uint32_t ui32Fcfg1Revision) |
Returns XOSCLF_REGULATOR_TRIM and XOSCLF_CMIRRWR_RATIO as one packet spanning bits [5:0] in the returned value. More... | |
int32_t | SignExtendVddrTrimValue (uint32_t ui32VddrTrimVal) |
Sign extend the VDDR_TRIM setting (special format ranging from -10 to +21) More... | |
static void | HapiTrimDeviceColdReset (void) |
Trims to be applied when coming from PIN_RESET. More... | |
static void | HapiTrimDeviceShutDown (uint32_t ui32Fcfg1Revision) |
Trims to be applied when coming from SHUTDOWN (also called when coming from PIN_RESET). More... | |
static void | HapiTrimDevicePowerDown (void) |
Trims to be applied when coming from POWER_DOWN (also called when coming from SHUTDOWN and PIN_RESET). More... | |
static void | SetupCacheModeAccordingToCcfgSetting (void) |
Set correct VIMS_MODE according to CCFG setting (CACHE or GPRAM) More... | |
void | trimDevice (void) |
Performs the necessary trim of the device which is not done in boot code. More... | |
static void | SetAonRtcSubSecInc (uint32_t subSecInc) |
Doing the tricky stuff needed to enter new RTCSUBSECINC value. More... | |
#define CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA_WIDTH 4 |
Definition at line 130 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
#define CPU_DELAY_MICRO_SECONDS | ( | x | ) | CPUdelay(((uint32_t)((( x ) * 48.0 ) / 5.0 )) - 1 ) |
#define DELAY_20_USEC 0x140 |
|
static |
Returns the trim value from FCFG1 to be used as ADC_SH_MODE_EN setting.
Definition at line 983 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value from FCFG1 to be used as ADC_SH_VBUF_EN setting.
Definition at line 1002 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the AMPCOMP_CTRL register in OSC_DIG.
Definition at line 886 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the AMPCOMP_TH1 register in OSC_DIG.
Definition at line 851 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the AMPCOMP_TH2 register in OSC_DIG.
Definition at line 816 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the ANABYPASS_VALUE1 register in OSC_DIG.
Definition at line 698 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value from FCFG1 to be used as DBLR_LOOP_FILTER_RESET_VOLTAGE setting.
Definition at line 964 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the RADCEXTCFG register in OSC_DIG.
Definition at line 1071 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the FCFG1_OSC_CONF_ATESTLF_RCOSCLF_IBIAS_TRIM.
Definition at line 1103 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the RCOSCLF_RTUNE_TRIM and the RCOSCLF_CTUNE_TRIM bit fields in the XOSCLF_RCOSCLF_CTRL register in OSC_DIG.
Definition at line 768 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the XOSCHFCTL register in OSC_DIG.
Definition at line 1021 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used as OSC_DIG:CTL1.XOSC_HF_FAST_START.
Definition at line 1053 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns the trim value to be used for the XOSC_HF_IBIASTHERM bit field in the ANABYPASS_VALUE2 register in OSC_DIG.
Definition at line 796 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Returns XOSCLF_REGULATOR_TRIM and XOSCLF_CMIRRWR_RATIO as one packet spanning bits [5:0] in the returned value.
Definition at line 1123 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Trims to be applied when coming from PIN_RESET.
Definition at line 685 of file setup.c.
Referenced by trimDevice().
|
static |
Trims to be applied when coming from POWER_DOWN (also called when coming from SHUTDOWN and PIN_RESET).
Definition at line 339 of file setup.c.
Referenced by trimDevice().
|
static |
Trims to be applied when coming from SHUTDOWN (also called when coming from PIN_RESET).
Definition at line 381 of file setup.c.
Referenced by trimDevice().
|
static |
Doing the tricky stuff needed to enter new RTCSUBSECINC value.
Definition at line 354 of file setup.c.
Referenced by HapiTrimDeviceShutDown().
|
static |
Set correct VIMS_MODE according to CCFG setting (CACHE or GPRAM)
Definition at line 141 of file setup.c.
Referenced by trimDevice().
int32_t SignExtendVddrTrimValue | ( | uint32_t | ui32VddrTrimVal | ) |
Sign extend the VDDR_TRIM setting (special format ranging from -10 to +21)
Definition at line 664 of file setup.c.
Referenced by HapiTrimDeviceShutDown(), and SysCtrlSetRechargeBeforePowerDown().