lib/sw_apps/zynqmp_pmufw/src/pm_hooks.c
u32 PmHookGetBootType(void)
{
	u32 bootType;

	/* Release GPIO reset */
	XPfw_RMW32(CRL_APB_RST_LPD_IOU2, CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK,
			~CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK);

	/* Read state of MIO26 pin which is used to detect boot type */
	bootType = XPfw_Read32(GPIO_DATA_1_RO) & 1U;
	bootType += 1U;

	/* Assert GPIO reset */
	XPfw_RMW32(CRL_APB_RST_LPD_IOU2, CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK,
			~CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK);

	/* Signal boot type to FSBL */
	XPfw_Write32(PMU_GLOBAL_GLOBAL_GEN_STORAGE1, bootType);

	/* Update last suspend type based on detected boot type */
	PmSystemSetSuspendType(bootType - 1U);

	return bootType;
}
/**
 * PmHookGetBootType() - User hook for detecting boot type
 */
User hook for detecting boot type
User hook for detecting boot type
u32 PmHookGetBootType(void)
{
	u32 bootType;
	XPfw_RMW32(CRL_APB_RST_LPD_IOU2, CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK,
			~CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK);
	bootType = XPfw_Read32(GPIO_DATA_1_RO) & 1U;
	bootType += 1U;
	XPfw_RMW32(CRL_APB_RST_LPD_IOU2, CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK,
			~CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK);
	XPfw_Write32(PMU_GLOBAL_GLOBAL_GEN_STORAGE1, bootType);
	PmSystemSetSuspendType(bootType - 1U);
	return bootType;
}
u32 PmHookGetBootType ( void ) { u32 bootType ; XPfw_RMW32 ( CRL_APB_RST_LPD_IOU2 , CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK , ~ CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK ) ; bootType = XPfw_Read32 ( GPIO_DATA_1_RO ) & 1U ; bootType += 1U ; XPfw_RMW32 ( CRL_APB_RST_LPD_IOU2 , CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK , ~ CRL_APB_RST_LPD_IOU2_GPIO_RESET_MASK ) ; XPfw_Write32 ( PMU_GLOBAL_GLOBAL_GEN_STORAGE1 , bootType ) ; PmSystemSetSuspendType ( bootType - 1U ) ; return bootType ; }
PmHookGetBootType() - User hook for detecting boot type
PmHookGetBootType () - User hook for detecting boot type
/* Release GPIO reset */ /* Read state of MIO26 pin which is used to detect boot type */ /* Assert GPIO reset */ /* Signal boot type to FSBL */ /* Update last suspend type based on detected boot type */