CC26xx Driver Library
setup.c
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: setup.c
3 * Revised: 2015-09-24 10:59:51 +0200 (Thu, 24 Sep 2015)
4 * Revision: 44656
5 *
6 * Description: Setup file for CC13xx/CC26xx devices.
7 *
8 * Copyright (c) 2015, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 // Hardware headers
40 #include <inc/hw_memmap.h>
41 #include <inc/hw_types.h>
42 #include <inc/hw_adi.h>
43 #include <inc/hw_adi_0_rf.h>
44 #include <inc/hw_adi_1_synth.h>
45 #include <inc/hw_adi_2_refsys.h>
46 #include <inc/hw_adi_3_refsys.h>
47 #include <inc/hw_adi_4_aux.h>
48 #include <inc/hw_aon_ioc.h>
49 #include <inc/hw_aon_sysctl.h>
50 #include <inc/hw_aon_wuc.h>
51 #include <inc/hw_aux_wuc.h>
52 #include <inc/hw_ccfg.h>
53 #include <inc/hw_chip_def.h>
54 #include <inc/hw_ddi.h>
55 #include <inc/hw_flash.h>
56 #include <inc/hw_fcfg1.h>
57 #include <inc/hw_ddi_0_osc.h>
58 #include <inc/hw_prcm.h>
59 #include <inc/hw_vims.h>
60 #include <inc/hw_aon_batmon.h>
61 #include <inc/hw_aon_rtc.h>
62 // Driverlib headers
63 #include <driverlib/adi.h>
64 #include <driverlib/aon_batmon.h>
65 #include <driverlib/cpu.h>
66 #include <driverlib/chipinfo.h>
67 #include <driverlib/ddi.h>
68 #include <driverlib/ioc.h>
69 #include <driverlib/prcm.h>
70 #include <driverlib/setup.h>
71 #include <driverlib/sys_ctrl.h>
72 
73 // We need intrinsic functions for IAR (if used in source code)
74 #ifdef __IAR_SYSTEMS_ICC__
75 #include <intrinsics.h>
76 #endif
77 
78 //*****************************************************************************
79 //
80 // Function declarations
81 //
82 //*****************************************************************************
83 static uint32_t GetTrimForAdcShModeEn( uint32_t ui32Fcfg1Revision );
84 static uint32_t GetTrimForAdcShVbufEn( uint32_t ui32Fcfg1Revision );
85 static uint32_t GetTrimForAmpcompCtrl( uint32_t ui32Fcfg1Revision );
86 static uint32_t GetTrimForAmpcompTh1( void );
87 static uint32_t GetTrimForAmpcompTh2( void );
88 static uint32_t GetTrimForAnabypassValue1( uint32_t ccfg_ModeConfReg );
89 static uint32_t GetTrimForDblrLoopFilterResetVoltage( uint32_t ui32Fcfg1Revision );
90 static uint32_t GetTrimForRadcExtCfg( uint32_t ui32Fcfg1Revision );
91 static uint32_t GetTrimForRcOscLfIBiasTrim( uint32_t ui32Fcfg1Revision );
92 static uint32_t GetTrimForRcOscLfRtuneCtuneTrim( void );
93 static uint32_t GetTrimForXoscHfCtl( uint32_t ui32Fcfg1Revision );
94 static uint32_t GetTrimForXoscHfFastStart( void );
95 static uint32_t GetTrimForXoscHfIbiastherm( void );
96 static uint32_t GetTrimForXoscLfRegulatorAndCmirrwrRatio( uint32_t ui32Fcfg1Revision );
97 
98 int32_t SignExtendVddrTrimValue( uint32_t ui32VddrTrimVal );
99 static void HapiTrimDeviceColdReset( void );
100 static void HapiTrimDeviceShutDown( uint32_t ui32Fcfg1Revision );
101 static void HapiTrimDevicePowerDown( void );
102 
103 
104 //*****************************************************************************
105 //
107 //
108 //*****************************************************************************
109 #define DELAY_20_USEC 0x140
110 
111 
112 //*****************************************************************************
113 //
114 // Defined CPU delay macro with microseconds as input
115 // Quick check shows: (To be further investigated)
116 // At 48 MHz RCOSC and VIMS.CONTROL.PREFETCH = 0, there is 5 cycles
117 // At 48 MHz RCOSC and VIMS.CONTROL.PREFETCH = 1, there is 4 cycles
118 // At 24 MHz RCOSC and VIMS.CONTROL.PREFETCH = 0, there is 3 cycles
119 //
120 //*****************************************************************************
121 #define CPU_DELAY_MICRO_SECONDS( x ) \
122  CPUdelay(((uint32_t)((( x ) * 48.0 ) / 5.0 )) - 1 )
123 
124 
125 //*****************************************************************************
126 // Need to know the CCFG:MODE_CONF.VDDR_TRIM_SLEEP_DELTA field width in order
127 // to sign extend correctly but this is however not defined in the hardware
128 // description fields and is therefore defined separately here.
129 //*****************************************************************************
130 #define CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA_WIDTH 4
131 
132 
133 //*****************************************************************************
134 //
138 //
139 //*****************************************************************************
140 static void
142 {
143  //
144  // - Make sure to enable aggressive VIMS clock gating for power optimization
145  // Only for PG2 devices.
146  // - Enable cache prefetch enable as default setting
147  // (Slightly higher power consumption, but higher CPU performance)
148  // - IF ( CCFG_..._DIS_GPRAM == 1 )
149  // then: Enable cache (set cache mode = 1), even if set by ROM boot code
150  // (This is done because it's not set by boot code when running inside
151  // a debugger supporting the Halt In Boot (HIB) functionality).
152  // else: Set MODE_GPRAM if not already set (see inline comments as well)
153  //
154  uint32_t vimsCtlMode0 ;
155 
156  while ( HWREGBITW( VIMS_BASE + VIMS_O_STAT, VIMS_STAT_MODE_CHANGING_BITN )) {
157  // Do nothing - wait for an eventual ongoing mode change to complete.
158  // (There should typically be no wait time here, but need to be sure)
159  }
160 
161  //
162  // Note that Mode=0 is equal to MODE_GPRAM
163  //
164  vimsCtlMode0 = (( HWREG( VIMS_BASE + VIMS_O_CTL ) & ~VIMS_CTL_MODE_M ) | VIMS_CTL_DYN_CG_EN_M | VIMS_CTL_PREF_EN_M );
165 
166 
168  // Enable cache (and hence disable GPRAM)
169  HWREG( VIMS_BASE + VIMS_O_CTL ) = ( vimsCtlMode0 | VIMS_CTL_MODE_CACHE );
170  } else if (( HWREG( VIMS_BASE + VIMS_O_STAT ) & VIMS_STAT_MODE_M ) != VIMS_STAT_MODE_GPRAM ) {
171  //
172  // GPRAM is enabled in CCFG but not selected
173  // Note: It is recommended to go via MODE_OFF when switching to MODE_GPRAM
174  //
175  HWREG( VIMS_BASE + VIMS_O_CTL ) = ( vimsCtlMode0 | VIMS_CTL_MODE_OFF );
176  while (( HWREG( VIMS_BASE + VIMS_O_STAT ) & VIMS_STAT_MODE_M ) != VIMS_STAT_MODE_OFF ) {
177  // Do nothing - wait for an eventual mode change to complete (This goes fast).
178  }
179  HWREG( VIMS_BASE + VIMS_O_CTL ) = vimsCtlMode0;
180  } else {
181  // Correct mode, but make sure PREF_EN and DYN_CG_EN always are set
182  HWREG( VIMS_BASE + VIMS_O_CTL ) = vimsCtlMode0;
183  }
184 }
185 
186 
187 //*****************************************************************************
188 //
189 // Perform the necessary trim of the device which is not done in boot code
190 //
191 // This function should only execute coming from ROM boot. The current
192 // implementation does not take soft reset into account. However, it does no
193 // damage to execute it again. It only consumes time.
194 //
195 //*****************************************************************************
196 void
198 {
199  uint32_t ui32Fcfg1Revision;
200  uint32_t ui32AonSysResetctl;
201 
202  //
203  // Get layout revision of the factory configuration area
204  // (Handle undefined revision as revision = 0)
205  //
206  ui32Fcfg1Revision = HWREG(FCFG1_BASE + FCFG1_O_FCFG1_REVISION);
207  if ( ui32Fcfg1Revision == 0xFFFFFFFF ) {
208  ui32Fcfg1Revision = 0;
209  }
210 
211 
212  //
213  // This driverlib version and setup file is for CC26xx PG2.2 and later
214  // Halt if violated
215  //
217 
218  //
219  // Enable standby in flash bank
220  //
222 
223  //
224  // Clock must always be enabled for the semaphore module (due to ADI/DDI HW workaround)
225  //
227 
228  //
229  // Warm resets on CC26XX complicates software design as much of our software
230  // expect that initialization is done from a full system reset.
231  // This includes RTC setup, oscillator configuration and AUX setup.
232  // To ensure a full reset of the device is done when customers get e.g. a Watchdog
233  // reset, the following is set here:
234  //
236 
237  //
238  // Select correct CACHE mode and set correct CACHE configuration
239  //
241 
242  // 1. Check for powerdown
243  // 2. Check for shutdown
244  // 3. Assume cold reset if none of the above.
245  //
246  // It is always assumed that the application will freeze the latches in
247  // AON_IOC when going to powerdown in order to retain the values on the IOs.
248  //
249  // NB. If this bit is not cleared before proceeding to powerdown, the IOs
250  // will all default to the reset configuration when restarting.
252  {
253  //
254  // NB. This should be calling a ROM implementation of required trim and
255  // compensation
256  // e.g. HapiTrimDevicePowerDown()
258  }
259  // Check for shutdown
260  //
261  // When device is going to shutdown the hardware will automatically clear
262  // the SLEEPDIS bit in the SLEEP register in the AON_SYSCTRL12 module.
263  // It is left for the application to assert this bit when waking back up,
264  // but not before the desired IO configuration has been re-established.
266  {
267  //
268  // NB. This should be calling a ROM implementation of required trim and
269  // compensation
270  // e.g. HapiTrimDeviceShutDown() -->
271  // HapiTrimDevicePowerDown();
272  HapiTrimDeviceShutDown(ui32Fcfg1Revision);
274  }
275  else
276  {
277  // Consider adding a check for soft reset to allow debugging to skip
278  // this section!!!
279  //
280  // NB. This should be calling a ROM implementation of required trim and
281  // compensation
282  // e.g. HapiTrimDeviceColdReset() -->
283  // HapiTrimDeviceShutDown() -->
284  // HapiTrimDevicePowerDown()
286  HapiTrimDeviceShutDown(ui32Fcfg1Revision);
288 
289  }
290 
291  //
292  // Set VIMS power domain control.
293  // PDCTL1VIMS = 0 ==> VIMS power domain is only powered when CPU power domain is powered
294  //
295  HWREG( PRCM_BASE + PRCM_O_PDCTL1VIMS ) = 0;
296 
297  //
298  // Configure optimal wait time for flash FSM in cases where flash pump
299  // wakes up from sleep
300  //
301  HWREG(FLASH_BASE + FLASH_O_FPAC1) = (HWREG(FLASH_BASE + FLASH_O_FPAC1) &
303  (0x139<<FLASH_FPAC1_PSLEEPTDIS_S);
304 
305  //
306  // And finally at the end of the flash boot process:
307  // SET BOOT_DET bits in AON_SYSCTL to 3 if already found to be 1
308  // Note: The BOOT_DET_x_CLR/SET bits must be manually cleared
309  //
310  if ((( HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL ) &
313  {
314  ui32AonSysResetctl = ( HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL ) &
318  HWREG( AON_SYSCTL_BASE + AON_SYSCTL_O_RESETCTL ) = ui32AonSysResetctl;
319  }
320 
321  //
322  // Make sure there are no ongoing VIMS mode change when leaving trimDevice()
323  // (There should typically be no wait time here, but need to be sure)
324  //
325  while ( HWREGBITW( VIMS_BASE + VIMS_O_STAT, VIMS_STAT_MODE_CHANGING_BITN )) {
326  // Do nothing - wait for an eventual ongoing mode change to complete.
327  }
328 }
329 
330 //*****************************************************************************
331 //
336 //
337 //*****************************************************************************
338 static void
340 {
341  //
342  // Currently no specific trim for Powerdown
343  //
344 }
345 
346 //*****************************************************************************
347 //
351 //
352 //*****************************************************************************
353 static void
354 SetAonRtcSubSecInc( uint32_t subSecInc )
355 {
356  //
357  // Loading a new RTCSUBSECINC value is done in 5 steps:
358  // 1. Write bit[15:0] of new SUBSECINC value to AUX_WUC_O_RTCSUBSECINC0
359  // 2. Write bit[23:16] of new SUBSECINC value to AUX_WUC_O_RTCSUBSECINC1
361  // 4. Wait for AUX_WUC_RTCSUBSECINCCTL_UPD_ACK
363  //
365  HWREG( AUX_WUC_BASE + AUX_WUC_O_RTCSUBSECINC1 ) = (( subSecInc >> 16 ) & AUX_WUC_RTCSUBSECINC1_INC23_16_M );
366 
370 }
371 
372 //*****************************************************************************
373 //
378 //
379 //*****************************************************************************
380 static void
381 HapiTrimDeviceShutDown(uint32_t ui32Fcfg1Revision)
382 {
383  uint32_t ui32Trim ;
384  uint32_t ccfg_ModeConfReg ;
385  uint32_t currentHfClock ;
386  uint32_t ccfgExtLfClk ;
387  int32_t i32VddrSleepTrim ;
388  int32_t i32VddrSleepDelta ;
389 
390  //
391  // Force AUX on and enable clocks
392  //
393  // No need to save the current status of the power/clock registers.
394  // At this point both AUX and AON should have been reset to 0x0.
395  //
397 
398  //
399  // Wait for power on on the AUX domain
400  //
402 
403  //
404  // Enable the clocks for AUX_DDI0_OSC and AUX_ADI4
405  //
408 
409  //
410  // It's found to be optimal to override the FCFG1..DCDC_IPEAK setting as follows:
411  // if ( alternative DCDC setting in CCFG is enabled ) ADI3..IPEAK = CCFG..DCDC_IPEAK
412  // else ADI3..IPEAK = 2
413  //
415  //
416  // ADI_3_REFSYS:DCDCCTL5[3] (=DITHER_EN) = CCFG_MODE_CONF_1[19] (=ALT_DCDC_DITHER_EN)
417  // ADI_3_REFSYS:DCDCCTL5[2:0](=IPEAK ) = CCFG_MODE_CONF_1[18:16](=ALT_DCDC_IPEAK )
418  // Using a single 4-bit masked write since layout is equal for both source and destination
419  //
420  HWREGB( ADI3_BASE + ADI_O_MASK4B + ( ADI_3_REFSYS_O_DCDCCTL5 * 2 )) = ( 0xF0 |
422 
423  }
424 
425  //
426  // Enable for JTAG to be powered down (will still be powered on if debugger is connected)
427  //
429 
430  //
431  // read the MODE_CONF register in CCFG
432  //
433  ccfg_ModeConfReg = HWREG( CCFG_BASE + CCFG_O_MODE_CONF );
434 
435  {
436  i32VddrSleepTrim = SignExtendVddrTrimValue((
437  HWREG( FCFG1_BASE + FCFG1_O_LDO_TRIM ) &
440  }
441 
442  //
443  // Adjust the VDDR_TRIM_SLEEP value with value adjustable by customer (CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA)
444  // Read and sign extend VddrSleepDelta (in range -8 to +7)
445  //
446  i32VddrSleepDelta = ((((int32_t)ccfg_ModeConfReg )
449  // Calculate new VDDR sleep trim
450  i32VddrSleepTrim = ( i32VddrSleepTrim + i32VddrSleepDelta + 1 );
451  if ( i32VddrSleepTrim > 21 ) i32VddrSleepTrim = 21;
452  if ( i32VddrSleepTrim < -10 ) i32VddrSleepTrim = -10;
453  // Write adjusted value using MASKED write (MASK8)
454  HWREGH( ADI3_BASE + ADI_O_MASK8B + ( ADI_3_REFSYS_O_DCDCCTL1 * 2 )) = (( ADI_3_REFSYS_DCDCCTL1_VDDR_TRIM_SLEEP_M << 8 ) |
456 
457  //
458  // set the RECHARGE source based upon CCFG:MODE_CONF:DCDC_RECHARGE
459  // Note: Inverse polarity
460  //
462  ((( ccfg_ModeConfReg >> CCFG_MODE_CONF_DCDC_RECHARGE_S ) & 1 ) ^ 1 );
463 
464  //
465  // set the ACTIVE source based upon CCFG:MODE_CONF:DCDC_ACTIVE
466  // Note: Inverse polarity
467  //
469  ((( ccfg_ModeConfReg >> CCFG_MODE_CONF_DCDC_ACTIVE_S ) & 1 ) ^ 1 );
470 
471  //
472  // Following sequence is required for using XOSCHF, if not included
473  // devices crashes when trying to switch to XOSCHF.
474  //
475  // Trim CAP settings. Get and set trim value for the ANABYPASS_VALUE1
476  // register
477  ui32Trim = GetTrimForAnabypassValue1( ccfg_ModeConfReg );
479 
480  // Trim RCOSC_LF. Get and set trim values for the RCOSCLF_RTUNE_TRIM and
481  // RCOSCLF_CTUNE_TRIM fields in the XOSCLF_RCOSCLF_CTRL register.
482  ui32Trim = GetTrimForRcOscLfRtuneCtuneTrim();
487  ui32Trim);
488 
489  // Trim XOSCHF IBIAS THERM. Get and set trim value for the
490  // XOSCHF IBIAS THERM bit field in the ANABYPASS_VALUE2 register. Other
491  // register bit fields are set to 0.
492  ui32Trim = GetTrimForXoscHfIbiastherm();
495 
496  // Trim AMPCOMP settings required before switch to XOSCHF
497  ui32Trim = GetTrimForAmpcompTh2();
499  ui32Trim = GetTrimForAmpcompTh1();
501  ui32Trim = GetTrimForAmpcompCtrl( ui32Fcfg1Revision );
503 
504  //
505  // Set trim for DDI_0_OSC_ADCDOUBLERNANOAMPCTL_ADC_SH_MODE_EN in accordance to FCFG1 setting
506  // This is bit[5] in the DDI_0_OSC_O_ADCDOUBLERNANOAMPCTL register
507  // Using MASK4 write + 1 => writing to bits[7:4]
508  //
509  ui32Trim = GetTrimForAdcShModeEn( ui32Fcfg1Revision );
510  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_ADCDOUBLERNANOAMPCTL * 2 ) + 1 ) =
511  ( 0x20 | ( ui32Trim << 1 ));
512 
513  //
514  // Set trim for DDI_0_OSC_ADCDOUBLERNANOAMPCTL_ADC_SH_VBUF_EN in accordance to FCFG1 setting
515  // This is bit[4] in the DDI_0_OSC_O_ADCDOUBLERNANOAMPCTL register
516  // Using MASK4 write + 1 => writing to bits[7:4]
517  //
518  ui32Trim = GetTrimForAdcShVbufEn( ui32Fcfg1Revision );
519  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_ADCDOUBLERNANOAMPCTL * 2 ) + 1 ) =
520  ( 0x10 | ( ui32Trim ));
521 
522  //
523  // Set trim for the PEAK_DET_ITRIM, HP_BUF_ITRIM and LP_BUF_ITRIM bit fields
524  // in the DDI0_OSC_O_XOSCHFCTL register in accordance to FCFG1 setting.
525  // Remaining register bit fields are set to their reset values of 0.
526  //
527  ui32Trim = GetTrimForXoscHfCtl(ui32Fcfg1Revision);
529 
530  //
531  // Set trim for DBLR_LOOP_FILTER_RESET_VOLTAGE in accordance to FCFG1 setting
532  // (This is bits [18:17] in DDI_0_OSC_O_ADCDOUBLERNANOAMPCTL)
533  // (Using MASK4 write + 4 => writing to bits[19:16] => (4*4))
534  // (Assuming: DDI_0_OSC_ADCDOUBLERNANOAMPCTL_DBLR_LOOP_FILTER_RESET_VOLTAGE_S = 17 and
535  // that DDI_0_OSC_ADCDOUBLERNANOAMPCTL_DBLR_LOOP_FILTER_RESET_VOLTAGE_M = 0x00060000)
536  //
537  ui32Trim = GetTrimForDblrLoopFilterResetVoltage( ui32Fcfg1Revision );
538  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_ADCDOUBLERNANOAMPCTL * 2 ) + 4 ) =
539  ( 0x60 | ( ui32Trim << 1 ));
540 
541  //
542  // Update DDI_0_OSC_ATESTCTL_ATESTLF_RCOSCLF_IBIAS_TRIM with data from
544  // This is DDI_0_OSC_O_ATESTCTL bit[7]
545  // ( DDI_0_OSC_O_ATESTCTL is currently hidden (but=0x00000020))
546  // Using MASK4 write + 1 => writing to bits[7:4]
547  //
548  ui32Trim = GetTrimForRcOscLfIBiasTrim( ui32Fcfg1Revision );
549  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( 0x00000020 * 2 ) + 1 ) =
550  ( 0x80 | ( ui32Trim << 3 ));
551 
552  //
555  // This can be simplified since the registers are packed together in the same
556  // order both in FCFG1 and in the HW register.
557  // This spans DDI_0_OSC_O_LFOSCCTL bits[23:18]
558  // Using MASK8 write + 4 => writing to bits[23:16]
559  //
560  ui32Trim = GetTrimForXoscLfRegulatorAndCmirrwrRatio( ui32Fcfg1Revision );
561  HWREGH( AUX_DDI0_OSC_BASE + DDI_O_MASK8B + ( DDI_0_OSC_O_LFOSCCTL * 2 ) + 4 ) =
562  ( 0xFC00 | ( ui32Trim << 2 ));
563 
564  //
565  // Set trim the HPM_IBIAS_WAIT_CNT, LPM_IBIAS_WAIT_CNT and IDAC_STEP bit
566  // fields in the DDI0_OSC_O_RADCEXTCFG register in accordance to FCFG1 setting.
567  // Remaining register bit fields are set to their reset values of 0.
568  //
569  ui32Trim = GetTrimForRadcExtCfg(ui32Fcfg1Revision);
571 
572  // Setting FORCE_KICKSTART_EN (ref. CC26_V1_BUG00261). Should also be done for PG2
573  // (This is bit 22 in DDI_0_OSC_O_CTL0)
574  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_CTL0 * 2 ) + 5 ) = 0x44;
575 
576  // XOSC source is a 24 MHz xtal (default)
577  // Set bit DDI_0_OSC_CTL0_XTAL_IS_24M (this is bit 31 in DDI_0_OSC_O_CTL0)
578  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_CTL0 * 2 ) + 7 ) = 0x88;
579 
580  // Clear DDI_0_OSC_CTL0_CLK_LOSS_EN (ClockLossEventEnable()). This is bit 9 in DDI_0_OSC_O_CTL0.
581  // This is typically already 0 except on Lizard where it is set in ROM-boot
582  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_CTL0 * 2 ) + 2 ) = 0x20;
583 
584  // Setting DDI_0_OSC_CTL1_XOSC_HF_FAST_START according to value found in FCFG1
585  ui32Trim = GetTrimForXoscHfFastStart();
586  HWREGB( AUX_DDI0_OSC_BASE + DDI_O_MASK4B + ( DDI_0_OSC_O_CTL1 * 2 )) = ( 0x30 | ui32Trim );
587 
588  //
589  // setup the LF clock based upon CCFG:MODE_CONF:SCLK_LF_OPTION
590  //
591  switch (( ccfg_ModeConfReg & CCFG_MODE_CONF_SCLK_LF_OPTION_M ) >> CCFG_MODE_CONF_SCLK_LF_OPTION_S ) {
592  case 0 : // XOSC_HF_DLF (XOSCHF/1536) -> SCLK_LF (=31250Hz)
594  SetAonRtcSubSecInc( 0x8637BD );
595  break;
596  case 1 : // EXTERNAL signal -> SCLK_LF (frequency=2^38/CCFG_EXT_LF_CLK_RTC_INCREMENT)
597  // Set SCLK_LF to use the same source as SCLK_HF
598  // Can be simplified a bit since possible return values for HF matches LF settings
599  currentHfClock = OSCClockSourceGet( OSC_SRC_CLK_HF );
600  OSCClockSourceSet( OSC_SRC_CLK_LF, currentHfClock );
601  while( OSCClockSourceGet( OSC_SRC_CLK_LF ) != currentHfClock ) {
602  // Wait until switched
603  }
604  ccfgExtLfClk = HWREG( CCFG_BASE + CCFG_O_EXT_LF_CLK );
608  IOC_STD_INPUT | IOC_HYST_ENABLE ); // Route external clock to AON IOC w/hysteresis
609  // Set XOSC_LF in bypass mode to allow external 32k clock
611  // Fall through to set XOSC_LF as SCLK_LF source
612  case 2 : // XOSC_LF -> SLCK_LF (32768 Hz)
614  break;
615  default : // (=3) RCOSC_LF
617  break;
618  }
619 
620  //
621  // Update ADI_4_AUX_ADCREF1_VTRIM with value from FCFG1
622  //
623  HWREGB( AUX_ADI4_BASE + ADI_4_AUX_O_ADCREF1 ) =
628 
629  //
630  // Set ADI_4_AUX:ADC0.SMPL_CYCLE_EXP to it's default minimum value (=3)
631  // (Note: Using MASK8B requires that the bits to be modified must be within the same
632  // byte boundary which is the case for the ADI_4_AUX_ADC0_SMPL_CYCLE_EXP field)
633  //
634  HWREGH( AUX_ADI4_BASE + ADI_O_MASK8B + ( ADI_4_AUX_O_ADC0 * 2 )) =
636 
637  //
638  // Sync with AON
639  //
640  SysCtrlAonSync();
641 
642  //
643  // Allow AUX to power down
644  //
646 
647  //
648  // Leaving on AUX and clock for AUX_DDI0_OSC on but turn off clock for AUX_ADI4
649  //
651 
652  // Disable EFUSE clock
654 }
655 
656 //*****************************************************************************
657 //
661 //
662 //*****************************************************************************
663 int32_t
664 SignExtendVddrTrimValue( uint32_t ui32VddrTrimVal )
665 {
666  //
667  // The VDDR trim value is 5 bits representing the range from -10 to +21
668  // (where -10=0x16, -1=0x1F, 0=0x00, 1=0x01 and +21=0x15)
669  //
670  int32_t i32SignedVddrVal = ui32VddrTrimVal;
671  if ( i32SignedVddrVal > 0x15 ) {
672  i32SignedVddrVal -= 0x20;
673  }
674  return ( i32SignedVddrVal );
675 }
676 
677 //*****************************************************************************
678 //
682 //
683 //*****************************************************************************
684 static void
686 {
687  //
688  // Currently no specific trim for Cold Reset
689  //
690 }
691 
692 //*****************************************************************************
693 //
695 //
696 //*****************************************************************************
697 static uint32_t
698 GetTrimForAnabypassValue1( uint32_t ccfg_ModeConfReg )
699 {
700  uint32_t ui32Fcfg1Value ;
701  uint32_t ui32XoscHfRow ;
702  uint32_t ui32XoscHfCol ;
703  int32_t i32CustomerDeltaAdjust ;
704  uint32_t ui32TrimValue ;
705 
706  // Use device specific trim values located in factory configuration
707  // area for the XOSC_HF_COLUMN_Q12 and XOSC_HF_ROW_Q12 bit fields in
708  // the ANABYPASS_VALUE1 register. Value for the other bit fields
709  // are set to 0.
710 
711  ui32Fcfg1Value = HWREG(FCFG1_BASE + FCFG1_O_CONFIG_OSC_TOP);
712  ui32XoscHfRow = (( ui32Fcfg1Value &
715  ui32XoscHfCol = (( ui32Fcfg1Value &
718 
719  i32CustomerDeltaAdjust = 0;
720  if (( ccfg_ModeConfReg & CCFG_MODE_CONF_XOSC_CAP_MOD ) == 0 ) {
721  // XOSC_CAP_MOD = 0 means: CAP_ARRAY_DELTA is in use -> Apply compensation
722  // XOSC_CAPARRAY_DELTA is located in bit[15:8] of ccfg_ModeConfReg
723  // Note: HW_REV_DEPENDENT_IMPLEMENTATION. Field width is not given by
724  // a define and sign extension must therefore be hardcoded.
725  // ( A small test program is created verifying the code lines below:
726  // Ref.: ..\test\small_standalone_test_programs\CapArrayDeltaAdjust_test.c)
727  i32CustomerDeltaAdjust = ((int32_t)ccfg_ModeConfReg << 16 ) >> 24;
728 
729  while ( i32CustomerDeltaAdjust < 0 ) {
730  ui32XoscHfCol >>= 1; // COL 1 step down
731  if ( ui32XoscHfCol == 0 ) { // if COL below minimum
732  ui32XoscHfCol = 0xFFFF; // Set COL to maximum
733  ui32XoscHfRow >>= 1; // ROW 1 step down
734  if ( ui32XoscHfRow == 0 ) { // if ROW below minimum
735  ui32XoscHfRow = 1; // Set both ROW and COL
736  ui32XoscHfCol = 1; // to minimum
737  }
738  }
739  i32CustomerDeltaAdjust++;
740  }
741  while ( i32CustomerDeltaAdjust > 0 ) {
742  ui32XoscHfCol = ( ui32XoscHfCol << 1 ) | 1; // COL 1 step up
743  if ( ui32XoscHfCol > 0xFFFF ) { // if COL above maximum
744  ui32XoscHfCol = 1; // Set COL to minimum
745  ui32XoscHfRow = ( ui32XoscHfRow << 1 ) | 1; // ROW 1 step up
746  if ( ui32XoscHfRow > 0xF ) { // if ROW above maximum
747  ui32XoscHfRow = 0xF; // Set both ROW and COL
748  ui32XoscHfCol = 0xFFFF; // to maximum
749  }
750  }
751  i32CustomerDeltaAdjust--;
752  }
753  }
754 
755  ui32TrimValue = (( ui32XoscHfRow << DDI_0_OSC_ANABYPASSVAL1_XOSC_HF_ROW_Q12_S ) |
756  ( ui32XoscHfCol << DDI_0_OSC_ANABYPASSVAL1_XOSC_HF_COLUMN_Q12_S ) );
757 
758  return (ui32TrimValue);
759 }
760 
761 //*****************************************************************************
762 //
765 //
766 //*****************************************************************************
767 static uint32_t
769 {
770  uint32_t ui32TrimValue;
771 
772  // Use device specific trim values located in factory configuration
773  // area
774  ui32TrimValue =
779 
780  ui32TrimValue |=
785 
786  return(ui32TrimValue);
787 }
788 
789 //*****************************************************************************
790 //
793 //
794 //*****************************************************************************
795 static uint32_t
797 {
798  uint32_t ui32TrimValue;
799 
800  // Use device specific trim value located in factory configuration
801  // area
802  ui32TrimValue =
806 
807  return(ui32TrimValue);
808 }
809 
810 //*****************************************************************************
811 //
813 //
814 //*****************************************************************************
815 static uint32_t
817 {
818  uint32_t ui32TrimValue;
819  uint32_t ui32Fcfg1Value;
820 
821  // Use device specific trim value located in factory configuration
822  // area. All defined register bit fields have corresponding trim
823  // value in the factory configuration area
824  ui32Fcfg1Value = HWREG(FCFG1_BASE + FCFG1_O_AMPCOMP_TH2);
825  ui32TrimValue = ((ui32Fcfg1Value &
829  ui32TrimValue |= (((ui32Fcfg1Value &
833  ui32TrimValue |= (((ui32Fcfg1Value &
837  ui32TrimValue |= (((ui32Fcfg1Value &
841 
842  return(ui32TrimValue);
843 }
844 
845 //*****************************************************************************
846 //
848 //
849 //*****************************************************************************
850 static uint32_t
852 {
853  uint32_t ui32TrimValue;
854  uint32_t ui32Fcfg1Value;
855 
856  // Use device specific trim values located in factory configuration
857  // area. All defined register bit fields have a corresponding trim
858  // value in the factory configuration area
859  ui32Fcfg1Value = HWREG(FCFG1_BASE + FCFG1_O_AMPCOMP_TH1);
860  ui32TrimValue = (((ui32Fcfg1Value &
864  ui32TrimValue |= (((ui32Fcfg1Value &
868  ui32TrimValue |= (((ui32Fcfg1Value &
872  ui32TrimValue |= (((ui32Fcfg1Value &
876 
877  return(ui32TrimValue);
878 }
879 
880 //*****************************************************************************
881 //
883 //
884 //*****************************************************************************
885 static uint32_t
886 GetTrimForAmpcompCtrl( uint32_t ui32Fcfg1Revision )
887 {
888  uint32_t ui32TrimValue ;
889  uint32_t ui32Fcfg1Value ;
890  uint32_t ibiasOffset ;
891  uint32_t ibiasInit ;
892  uint32_t modeConf1 ;
893  int32_t deltaAdjust ;
894 
895  // Use device specific trim values located in factory configuration
896  // area. Register bit fields without trim values in the factory
897  // configuration area will be set to the value of 0.
898  ui32Fcfg1Value = HWREG( FCFG1_BASE + FCFG1_O_AMPCOMP_CTRL1 );
899 
900  ibiasOffset = ( ui32Fcfg1Value &
903  ibiasInit = ( ui32Fcfg1Value &
906 
908  // Adjust with DELTA_IBIAS_OFFSET and DELTA_IBIAS_INIT from CCFG
909  modeConf1 = HWREG( CCFG_BASE + CCFG_O_MODE_CONF_1 );
910 
911  // Both fields are signed 4-bit values. This is an assumption when doing the sign extension.
912  deltaAdjust = ((int32_t)modeConf1 << ( 32 - CCFG_MODE_CONF_1_DELTA_IBIAS_OFFSET_S - 4 )) >> 28;
913  deltaAdjust += (int32_t)ibiasOffset;
914  if ( deltaAdjust < 0 ) {
915  deltaAdjust = 0;
916  }
919  }
920  ibiasOffset = (uint32_t)deltaAdjust;
921 
922  deltaAdjust = ((int32_t)modeConf1 << ( 32 - CCFG_MODE_CONF_1_DELTA_IBIAS_INIT_S - 4 )) >> 28;
923  deltaAdjust += (int32_t)ibiasInit;
924  if ( deltaAdjust < 0 ) {
925  deltaAdjust = 0;
926  }
929  }
930  ibiasInit = (uint32_t)deltaAdjust;
931  }
932  ui32TrimValue = ( ibiasOffset << DDI_0_OSC_AMPCOMPCTL_IBIAS_OFFSET_S ) |
933  ( ibiasInit << DDI_0_OSC_AMPCOMPCTL_IBIAS_INIT_S ) ;
934 
935  ui32TrimValue |= (((ui32Fcfg1Value &
939  ui32TrimValue |= (((ui32Fcfg1Value &
943  ui32TrimValue |= (((ui32Fcfg1Value &
947 
948  if ( ui32Fcfg1Revision >= 0x00000022 ) {
949  ui32TrimValue |= ((( ui32Fcfg1Value &
953  }
954 
955  return(ui32TrimValue);
956 }
957 
958 //*****************************************************************************
959 //
961 //
962 //*****************************************************************************
963 static uint32_t
964 GetTrimForDblrLoopFilterResetVoltage( uint32_t ui32Fcfg1Revision )
965 {
966  uint32_t dblrLoopFilterResetVoltageValue = 0; // Reset value
967 
968  if ( ui32Fcfg1Revision >= 0x00000020 ) {
969  dblrLoopFilterResetVoltageValue = ( HWREG( FCFG1_BASE + FCFG1_O_MISC_OTP_DATA_1 ) &
972  }
973 
974  return ( dblrLoopFilterResetVoltageValue );
975 }
976 
977 //*****************************************************************************
978 //
980 //
981 //*****************************************************************************
982 static uint32_t
983 GetTrimForAdcShModeEn( uint32_t ui32Fcfg1Revision )
984 {
985  uint32_t getTrimForAdcShModeEnValue = 1; // Recommended default setting
986 
987  if ( ui32Fcfg1Revision >= 0x00000022 ) {
988  getTrimForAdcShModeEnValue = ( HWREG( FCFG1_BASE + FCFG1_O_OSC_CONF ) &
991  }
992 
993  return ( getTrimForAdcShModeEnValue );
994 }
995 
996 //*****************************************************************************
997 //
999 //
1000 //*****************************************************************************
1001 static uint32_t
1002 GetTrimForAdcShVbufEn( uint32_t ui32Fcfg1Revision )
1003 {
1004  uint32_t getTrimForAdcShVbufEnValue = 1; // Recommended default setting
1005 
1006  if ( ui32Fcfg1Revision >= 0x00000022 ) {
1007  getTrimForAdcShVbufEnValue = ( HWREG( FCFG1_BASE + FCFG1_O_OSC_CONF ) &
1010  }
1011 
1012  return ( getTrimForAdcShVbufEnValue );
1013 }
1014 
1015 //*****************************************************************************
1016 //
1018 //
1019 //*****************************************************************************
1020 static uint32_t
1021 GetTrimForXoscHfCtl( uint32_t ui32Fcfg1Revision )
1022 {
1023  uint32_t getTrimForXoschfCtlValue = 0; // Recommended default setting
1024  uint32_t fcfg1Data;
1025 
1026  if ( ui32Fcfg1Revision >= 0x00000020 ) {
1027  fcfg1Data = HWREG( FCFG1_BASE + FCFG1_O_MISC_OTP_DATA_1 );
1028  getTrimForXoschfCtlValue =
1029  ( ( ( fcfg1Data & FCFG1_MISC_OTP_DATA_1_PEAK_DET_ITRIM_M ) >>
1032 
1033  getTrimForXoschfCtlValue |=
1034  ( ( ( fcfg1Data & FCFG1_MISC_OTP_DATA_1_HP_BUF_ITRIM_M ) >>
1037 
1038  getTrimForXoschfCtlValue |=
1039  ( ( ( fcfg1Data & FCFG1_MISC_OTP_DATA_1_LP_BUF_ITRIM_M ) >>
1042  }
1043 
1044  return ( getTrimForXoschfCtlValue );
1045 }
1046 
1047 //*****************************************************************************
1048 //
1050 //
1051 //*****************************************************************************
1052 static uint32_t
1054 {
1055  uint32_t ui32XoscHfFastStartValue ;
1056 
1057  // Get value from FCFG1
1058  ui32XoscHfFastStartValue = ( HWREG( FCFG1_BASE + FCFG1_O_OSC_CONF ) &
1061 
1062  return ( ui32XoscHfFastStartValue );
1063 }
1064 
1065 //*****************************************************************************
1066 //
1068 //
1069 //*****************************************************************************
1070 static uint32_t
1071 GetTrimForRadcExtCfg( uint32_t ui32Fcfg1Revision )
1072 {
1073  uint32_t getTrimForRadcExtCfgValue = 0x403F8000; // Recommended default setting
1074  uint32_t fcfg1Data;
1075 
1076  if ( ui32Fcfg1Revision >= 0x00000020 ) {
1077  fcfg1Data = HWREG( FCFG1_BASE + FCFG1_O_MISC_OTP_DATA_1 );
1078  getTrimForRadcExtCfgValue =
1079  ( ( ( fcfg1Data & FCFG1_MISC_OTP_DATA_1_HPM_IBIAS_WAIT_CNT_M ) >>
1082 
1083  getTrimForRadcExtCfgValue |=
1084  ( ( ( fcfg1Data & FCFG1_MISC_OTP_DATA_1_LPM_IBIAS_WAIT_CNT_M ) >>
1087 
1088  getTrimForRadcExtCfgValue |=
1089  ( ( ( fcfg1Data & FCFG1_MISC_OTP_DATA_1_IDAC_STEP_M ) >>
1092  }
1093 
1094  return ( getTrimForRadcExtCfgValue );
1095 }
1096 
1097 //*****************************************************************************
1098 //
1100 //
1101 //*****************************************************************************
1102 static uint32_t
1103 GetTrimForRcOscLfIBiasTrim( uint32_t ui32Fcfg1Revision )
1104 {
1105  uint32_t trimForRcOscLfIBiasTrimValue = 0; // Default value
1106 
1107  if ( ui32Fcfg1Revision >= 0x00000022 ) {
1108  trimForRcOscLfIBiasTrimValue = ( HWREG( FCFG1_BASE + FCFG1_O_OSC_CONF ) &
1111  }
1112 
1113  return ( trimForRcOscLfIBiasTrimValue );
1114 }
1115 
1116 //*****************************************************************************
1117 //
1120 //
1121 //*****************************************************************************
1122 static uint32_t
1123 GetTrimForXoscLfRegulatorAndCmirrwrRatio( uint32_t ui32Fcfg1Revision )
1124 {
1125  uint32_t trimForXoscLfRegulatorAndCmirrwrRatioValue = 0; // Default value for both fields
1126 
1127  if ( ui32Fcfg1Revision >= 0x00000022 ) {
1128  trimForXoscLfRegulatorAndCmirrwrRatioValue = ( HWREG( FCFG1_BASE + FCFG1_O_OSC_CONF ) &
1132  }
1133 
1134  return ( trimForXoscLfRegulatorAndCmirrwrRatioValue );
1135 }
static void SysCtrlAonSync(void)
Sync all accesses to the AON register interface.
Definition: sys_ctrl.h:240
#define IOC_PORT_AON_CLK32K
Definition: ioc.h:174
static void DDI32RegWrite(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
Write a 32 bit value to a register in the DDI slave.
Definition: ddi.h:235
#define AUX_WUC_POWER_DOWN
Definition: aux_wuc.h:95
static void HapiTrimDevicePowerDown(void)
Trims to be applied when coming from POWER_DOWN (also called when coming from SHUTDOWN and PIN_RESET)...
Definition: setup.c:339
static void HapiTrimDeviceShutDown(uint32_t ui32Fcfg1Revision)
Trims to be applied when coming from SHUTDOWN (also called when coming from PIN_RESET).
Definition: setup.c:381
static uint32_t GetTrimForRadcExtCfg(uint32_t ui32Fcfg1Revision)
Returns the trim value to be used for the RADCEXTCFG register in OSC_DIG.
Definition: setup.c:1071
void AUXWUCPowerCtrl(uint32_t ui32PowerMode)
Control the power to the AUX domain.
Definition: aux_wuc.c:274
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...
Definition: setup.c:768
uint32_t OSCClockSourceGet(uint32_t ui32SrcClk)
Get the source clock settings.
Definition: osc.c:144
void DDI16BitfieldWrite(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32Shift, uint16_t ui32Data)
Write a bitfield via the DDI using 16-bit maskable write.
Definition: ddi.c:108
#define IOC_STD_INPUT
Definition: ioc.h:297
int32_t SignExtendVddrTrimValue(uint32_t ui32VddrTrimVal)
Sign extend the VDDR_TRIM setting (special format ranging from -10 to +21)
Definition: setup.c:664
static uint32_t GetTrimForRcOscLfIBiasTrim(uint32_t ui32Fcfg1Revision)
Definition: setup.c:1103
void ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated(void)
Verifies that current chip is built for CC26xx HwRev 2.2 or later and never returns if violated...
Definition: chipinfo.c:168
#define OSC_SRC_CLK_HF
Definition: osc.h:106
static uint32_t GetTrimForXoscLfRegulatorAndCmirrwrRatio(uint32_t ui32Fcfg1Revision)
Returns XOSCLF_REGULATOR_TRIM and XOSCLF_CMIRRWR_RATIO as one packet spanning bits [5:0] in the retur...
Definition: setup.c:1123
#define OSC_XOSC_HF
Definition: osc.h:111
#define OSC_SRC_CLK_LF
Definition: osc.h:108
static uint32_t GetTrimForAmpcompTh2(void)
Returns the trim value to be used for the AMPCOMP_TH2 register in OSC_DIG.
Definition: setup.c:816
static uint32_t GetTrimForAnabypassValue1(uint32_t ccfg_ModeConfReg)
Returns the trim value to be used for the ANABYPASS_VALUE1 register in OSC_DIG.
Definition: setup.c:698
static uint32_t GetTrimForDblrLoopFilterResetVoltage(uint32_t ui32Fcfg1Revision)
Returns the trim value from FCFG1 to be used as DBLR_LOOP_FILTER_RESET_VOLTAGE setting.
Definition: setup.c:964
static void HapiTrimDeviceColdReset(void)
Trims to be applied when coming from PIN_RESET.
Definition: setup.c:685
static uint32_t GetTrimForXoscHfFastStart(void)
Returns the trim value to be used as OSC_DIG:CTL1.XOSC_HF_FAST_START.
Definition: setup.c:1053
static uint32_t GetTrimForAdcShVbufEn(uint32_t ui32Fcfg1Revision)
Returns the trim value from FCFG1 to be used as ADC_SH_VBUF_EN setting.
Definition: setup.c:1002
#define CCFG_MODE_CONF_VDDR_TRIM_SLEEP_DELTA_WIDTH
Definition: setup.c:130
#define OSC_RCOSC_LF
Definition: osc.h:112
void IOCPortConfigureSet(uint32_t ui32IOId, uint32_t ui32PortId, uint32_t ui32IOConfig)
Set the configuration of an IO port.
Definition: ioc.c:115
#define IOC_HYST_ENABLE
Definition: ioc.h:221
static uint32_t GetTrimForXoscHfCtl(uint32_t ui32Fcfg1Revision)
Returns the trim value to be used for the XOSCHFCTL register in OSC_DIG.
Definition: setup.c:1021
static uint32_t GetTrimForAdcShModeEn(uint32_t ui32Fcfg1Revision)
Returns the trim value from FCFG1 to be used as ADC_SH_MODE_EN setting.
Definition: setup.c:983
static void SetAonRtcSubSecInc(uint32_t subSecInc)
Doing the tricky stuff needed to enter new RTCSUBSECINC value.
Definition: setup.c:354
static uint32_t GetTrimForXoscHfIbiastherm(void)
Returns the trim value to be used for the XOSC_HF_IBIASTHERM bit field in the ANABYPASS_VALUE2 regist...
Definition: setup.c:796
void OSCClockSourceSet(uint32_t ui32SrcClk, uint32_t ui32Osc)
Configure the oscillator input to the a source clock.
Definition: osc.c:85
static void SetupCacheModeAccordingToCcfgSetting(void)
Set correct VIMS_MODE according to CCFG setting (CACHE or GPRAM)
Definition: setup.c:141
static uint32_t GetTrimForAmpcompTh1(void)
Returns the trim value to be used for the AMPCOMP_TH1 register in OSC_DIG.
Definition: setup.c:851
#define OSC_XOSC_LF
Definition: osc.h:113
static uint32_t GetTrimForAmpcompCtrl(uint32_t ui32Fcfg1Revision)
Returns the trim value to be used for the AMPCOMP_CTRL register in OSC_DIG.
Definition: setup.c:886
void trimDevice(void)
Performs the necessary trim of the device which is not done in boot code.
Definition: setup.c:197
static void AONWUCJtagPowerOff(void)
Request power off of the JTAG domain.
Definition: aon_wuc.h:816