lib/sw_apps/zynqmp_pmufw/src/idle_hooks.c
void NodeTtcIdle(u32 FirstBaseAddress)
{
	u32 BaseAddress;

	for (BaseAddress = FirstBaseAddress; BaseAddress < FirstBaseAddress +
	     0xC; BaseAddress += 4) {
		u32 Val;

		/*Stop the TTC timer */
		Val = Xil_In32(BaseAddress + XTTCPS_CNT_CNTRL_OFFSET);
		Xil_Out32(BaseAddress + XTTCPS_CNT_CNTRL_OFFSET, (Val |
			  ~XTTCPS_CNT_CNTRL_DIS_MASK));

		/*
		 * Reset the counter control register
		 */
		XTtcPs_WriteReg(BaseAddress, XTTCPS_CNT_CNTRL_OFFSET,
				XTTCPS_CNT_CNTRL_RESET_VALUE);

		/*
		 * Clear counters interval values
		 */
		XTtcPs_WriteReg(BaseAddress, XTTCPS_INTERVAL_VAL_OFFSET, 0x0);

		/*
		 * Clear counters Match values
		 */
		XTtcPs_WriteReg(BaseAddress, XTTCPS_MATCH_0_OFFSET, 0x0);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_MATCH_1_OFFSET, 0x0);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_MATCH_2_OFFSET, 0x0);

		/*
		 * Disable counter's interrupts
		 */
		XTtcPs_WriteReg(BaseAddress, XTTCPS_IER_OFFSET, 0x0);

		/*
		 * Clear interrupts (status) for all the counters [clronrd]
		 */
		XTtcPs_ReadReg(BaseAddress, XTTCPS_ISR_OFFSET);
	}
}
/**
  * NodeTtcIdle() - Custom code to idle the TTC
  *
  * @BaseAddress: TTC base address
  */
Custom code to idle the TTC
@BaseAddress: TTC base address
Custom code to idle the TTC @BaseAddress : TTC base address
void NodeTtcIdle(u32 FirstBaseAddress)
{
	u32 BaseAddress;
	for (BaseAddress = FirstBaseAddress; BaseAddress < FirstBaseAddress +
	     0xC; BaseAddress += 4) {
		u32 Val;
		Val = Xil_In32(BaseAddress + XTTCPS_CNT_CNTRL_OFFSET);
		Xil_Out32(BaseAddress + XTTCPS_CNT_CNTRL_OFFSET, (Val |
			  ~XTTCPS_CNT_CNTRL_DIS_MASK));
		XTtcPs_WriteReg(BaseAddress, XTTCPS_CNT_CNTRL_OFFSET,
				XTTCPS_CNT_CNTRL_RESET_VALUE);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_INTERVAL_VAL_OFFSET, 0x0);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_MATCH_0_OFFSET, 0x0);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_MATCH_1_OFFSET, 0x0);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_MATCH_2_OFFSET, 0x0);
		XTtcPs_WriteReg(BaseAddress, XTTCPS_IER_OFFSET, 0x0);
		XTtcPs_ReadReg(BaseAddress, XTTCPS_ISR_OFFSET);
	}
}
void NodeTtcIdle ( u32 FirstBaseAddress ) { u32 BaseAddress ; for ( BaseAddress = FirstBaseAddress ; BaseAddress < FirstBaseAddress + 0xC ; BaseAddress += 4 ) { u32 Val ; Val = Xil_In32 ( BaseAddress + XTTCPS_CNT_CNTRL_OFFSET ) ; Xil_Out32 ( BaseAddress + XTTCPS_CNT_CNTRL_OFFSET , ( Val | ~ XTTCPS_CNT_CNTRL_DIS_MASK ) ) ; XTtcPs_WriteReg ( BaseAddress , XTTCPS_CNT_CNTRL_OFFSET , XTTCPS_CNT_CNTRL_RESET_VALUE ) ; XTtcPs_WriteReg ( BaseAddress , XTTCPS_INTERVAL_VAL_OFFSET , 0x0 ) ; XTtcPs_WriteReg ( BaseAddress , XTTCPS_MATCH_0_OFFSET , 0x0 ) ; XTtcPs_WriteReg ( BaseAddress , XTTCPS_MATCH_1_OFFSET , 0x0 ) ; XTtcPs_WriteReg ( BaseAddress , XTTCPS_MATCH_2_OFFSET , 0x0 ) ; XTtcPs_WriteReg ( BaseAddress , XTTCPS_IER_OFFSET , 0x0 ) ; XTtcPs_ReadReg ( BaseAddress , XTTCPS_ISR_OFFSET ) ; } }
NodeTtcIdle() - Custom code to idle the TTC
 @BaseAddress: TTC base address
NodeTtcIdle () - Custom code to idle the TTC @BaseAddress : TTC base address
/*Stop the TTC timer */ /*
		 * Reset the counter control register
		 */ /*
		 * Clear counters interval values
		 */ /*
		 * Clear counters Match values
		 */ /*
		 * Disable counter's interrupts
		 */ /*
		 * Clear interrupts (status) for all the counters [clronrd]
		 */