lib/sw_apps/zynqmp_pmufw/src/pm_power.c
static s32 PmPowerDownFpd(void)
{
	s32 status;
	u32 dbg0, dbg1, dbg2, dbg3;

	dbg0 = XPfw_Read32(A53_DBG_0_EDPRCR_REG);
	dbg1 = XPfw_Read32(A53_DBG_1_EDPRCR_REG);
	dbg2 = XPfw_Read32(A53_DBG_2_EDPRCR_REG);
	dbg3 = XPfw_Read32(A53_DBG_3_EDPRCR_REG);

	if (0U != (A53_DBG_EDPRCR_REG_MASK & (dbg0 | dbg1 | dbg2 | dbg3 ))) {
		PmInfo("Skipped FPD pwrdn (debugger connected)\r\n");
		return XST_SUCCESS;
	}

/* Block FPD power down if any of the LPD peripherals uses CCI path which is in FPD */
#ifdef XPAR_LPD_IS_CACHE_COHERENT
	PmErr("Blocked FPD pwrdn (CCI used by LPD)\r\n");
	status = XST_FAILURE;
	goto err;
#endif /* XPAR_LPD_IS_CACHE_COHERENT */

	PmFpdSaveContext();

	ddr_io_prepare();

	status = PmResetAssertInt(PM_RESET_FPD, PM_RESET_ACTION_ASSERT);
	if (XST_SUCCESS != status) {
		goto err;
	}

	XPfw_AibEnable(XPFW_AIB_LPD_TO_DDR);
	XPfw_AibEnable(XPFW_AIB_LPD_TO_FPD);

	status = (s32)XpbrPwrDnFpdHandler();
	if (XST_SUCCESS != status) {
		goto err;
	}

	/*
	 * When FPD is powered off, the APU-GIC will be affected too.
	 * GIC Proxy has to take over for all wake-up sources for
	 * the APU.
	 */
	pmMasterApu_g.gic->enable();

err:
	return status;
}
/**
 * PmPowerDownFpd() - Power down FPD domain
 *
 * @return      Status of the pmu-rom operations
 */
Power down FPD domain
@return      Status of the pmu-rom operations
Power down FPD domain @return Status of the pmu - rom operations
static s32 PmPowerDownFpd(void)
{
	s32 status;
	u32 dbg0, dbg1, dbg2, dbg3;
	dbg0 = XPfw_Read32(A53_DBG_0_EDPRCR_REG);
	dbg1 = XPfw_Read32(A53_DBG_1_EDPRCR_REG);
	dbg2 = XPfw_Read32(A53_DBG_2_EDPRCR_REG);
	dbg3 = XPfw_Read32(A53_DBG_3_EDPRCR_REG);
	if (0U != (A53_DBG_EDPRCR_REG_MASK & (dbg0 | dbg1 | dbg2 | dbg3 ))) {
		PmInfo("Skipped FPD pwrdn (debugger connected)\r\n");
		return XST_SUCCESS;
	}
#ifdef XPAR_LPD_IS_CACHE_COHERENT
	PmErr("Blocked FPD pwrdn (CCI used by LPD)\r\n");
	status = XST_FAILURE;
	goto err;
#endif 
	PmFpdSaveContext();
	ddr_io_prepare();
	status = PmResetAssertInt(PM_RESET_FPD, PM_RESET_ACTION_ASSERT);
	if (XST_SUCCESS != status) {
		goto err;
	}
	XPfw_AibEnable(XPFW_AIB_LPD_TO_DDR);
	XPfw_AibEnable(XPFW_AIB_LPD_TO_FPD);
	status = (s32)XpbrPwrDnFpdHandler();
	if (XST_SUCCESS != status) {
		goto err;
	}
	pmMasterApu_g.gic->enable();
err:
	return status;
}
static s32 PmPowerDownFpd ( void ) { s32 status ; u32 dbg0 , dbg1 , dbg2 , dbg3 ; dbg0 = XPfw_Read32 ( A53_DBG_0_EDPRCR_REG ) ; dbg1 = XPfw_Read32 ( A53_DBG_1_EDPRCR_REG ) ; dbg2 = XPfw_Read32 ( A53_DBG_2_EDPRCR_REG ) ; dbg3 = XPfw_Read32 ( A53_DBG_3_EDPRCR_REG ) ; if ( 0U != ( A53_DBG_EDPRCR_REG_MASK & ( dbg0 | dbg1 | dbg2 | dbg3 ) ) ) { PmInfo ( " \r \n " ) ; return XST_SUCCESS ; } #ifdef XPAR_LPD_IS_CACHE_COHERENT PmErr ( " \r \n " ) ; status = XST_FAILURE ; goto err ; #endif PmFpdSaveContext ( ) ; ddr_io_prepare ( ) ; status = PmResetAssertInt ( PM_RESET_FPD , PM_RESET_ACTION_ASSERT ) ; if ( XST_SUCCESS != status ) { goto err ; } XPfw_AibEnable ( XPFW_AIB_LPD_TO_DDR ) ; XPfw_AibEnable ( XPFW_AIB_LPD_TO_FPD ) ; status = ( s32 ) XpbrPwrDnFpdHandler ( ) ; if ( XST_SUCCESS != status ) { goto err ; } pmMasterApu_g . gic -> enable ( ) ; err : return status ; }
PmPowerDownFpd() - Power down FPD domain
 @return      Status of the pmu-rom operations
PmPowerDownFpd () - Power down FPD domain @return Status of the pmu - rom operations
/* Block FPD power down if any of the LPD peripherals uses CCI path which is in FPD */ /* XPAR_LPD_IS_CACHE_COHERENT */ /*
	 * When FPD is powered off, the APU-GIC will be affected too.
	 * GIC Proxy has to take over for all wake-up sources for
	 * the APU.
	 */