lib/sw_apps/zynqmp_fsbl/src/xfsbl_hooks.c
u32 XFsbl_HookPsuInit(void)
{
	u32 Status;
#ifdef XFSBL_ENABLE_DDR_SR
	u32 RegVal;
#endif

	/* Add the code here */

#ifdef XFSBL_ENABLE_DDR_SR
	/* Check if DDR is in self refresh mode */
	RegVal = Xil_In32(XFSBL_DDR_STATUS_REGISTER_OFFSET) &
		DDR_STATUS_FLAG_MASK;
	if (RegVal) {
		Status = (u32)psu_init_ddr_self_refresh();
	} else {
		Status = (u32)psu_init();
	}
#else
	Status = (u32)psu_init();
#endif

	if (XFSBL_SUCCESS != Status) {
			XFsbl_Printf(DEBUG_GENERAL,"XFSBL_PSU_INIT_FAILED\n\r");
			/**
			 * Need to check a way to communicate both FSBL code
			 * and PSU init error code
			 */
			Status = XFSBL_PSU_INIT_FAILED + Status;
	}

	/**
	 * PS_SYSMON_ANALOG_BUS register determines mapping between SysMon supply
	 * sense channel to SysMon supply registers inside the IP. This register
	 * must be programmed to complete SysMon IP configuration.
	 * The default register configuration after power-up is incorrect.
	 * Hence, fix this by writing the correct value - 0x3210.
	 */

	XFsbl_Out32(AMS_PS_SYSMON_ANALOG_BUS, PS_SYSMON_ANALOG_BUS_VAL);

	return Status;
}
/*****************************************************************************/
/**
 * This function facilitates users to define different variants of psu_init()
 * functions based on different configurations in Vivado. The default call to
 * psu_init() can then be swapped with the alternate variant based on the
 * requirement.
 *
 * @param none
 *
 * @return error status based on implemented functionality (SUCCESS by default)
 *
  *****************************************************************************/
This function facilitates users to define different variants of psu_init()
functions based on different configurations in Vivado. The default call to
psu_init() can then be swapped with the alternate variant based on the
requirement.

@param none

@return error status based on implemented functionality (SUCCESS by default)
This function facilitates users to define different variants of psu_init () functions based on different configurations in Vivado . The default call to psu_init () can then be swapped with the alternate variant based on the requirement . @param none @return error status based on implemented functionality ( SUCCESS by default )
u32 XFsbl_HookPsuInit(void)
{
	u32 Status;
#ifdef XFSBL_ENABLE_DDR_SR
	u32 RegVal;
#endif
#ifdef XFSBL_ENABLE_DDR_SR
	RegVal = Xil_In32(XFSBL_DDR_STATUS_REGISTER_OFFSET) &
		DDR_STATUS_FLAG_MASK;
	if (RegVal) {
		Status = (u32)psu_init_ddr_self_refresh();
	} else {
		Status = (u32)psu_init();
	}
#else
	Status = (u32)psu_init();
#endif
	if (XFSBL_SUCCESS != Status) {
			XFsbl_Printf(DEBUG_GENERAL,"XFSBL_PSU_INIT_FAILED\n\r");
			Status = XFSBL_PSU_INIT_FAILED + Status;
	}
	XFsbl_Out32(AMS_PS_SYSMON_ANALOG_BUS, PS_SYSMON_ANALOG_BUS_VAL);
	return Status;
}
u32 XFsbl_HookPsuInit ( void ) { u32 Status ; #ifdef XFSBL_ENABLE_DDR_SR u32 RegVal ; #endif #ifdef XFSBL_ENABLE_DDR_SR RegVal = Xil_In32 ( XFSBL_DDR_STATUS_REGISTER_OFFSET ) & DDR_STATUS_FLAG_MASK ; if ( RegVal ) { Status = ( u32 ) psu_init_ddr_self_refresh ( ) ; } else { Status = ( u32 ) psu_init ( ) ; } #else Status = ( u32 ) psu_init ( ) ; #endif if ( XFSBL_SUCCESS != Status ) { XFsbl_Printf ( DEBUG_GENERAL , " \n \r " ) ; Status = XFSBL_PSU_INIT_FAILED + Status ; } XFsbl_Out32 ( AMS_PS_SYSMON_ANALOG_BUS , PS_SYSMON_ANALOG_BUS_VAL ) ; return Status ; }
This function facilitates users to define different variants of psu_init()
 functions based on different configurations in Vivado.
This function facilitates users to define different variants of psu_init () functions based on different configurations in Vivado .
/* Add the code here */ /* Check if DDR is in self refresh mode */ /**
			 * Need to check a way to communicate both FSBL code
			 * and PSU init error code
			 */ /**
	 * PS_SYSMON_ANALOG_BUS register determines mapping between SysMon supply
	 * sense channel to SysMon supply registers inside the IP. This register
	 * must be programmed to complete SysMon IP configuration.
	 * The default register configuration after power-up is incorrect.
	 * Hence, fix this by writing the correct value - 0x3210.
	 */