Ejemplo n.º 1
0
static void PmIpiHandler(const XPfw_Module_t *ModPtr, u32 IpiNum, u32 SrcMask)
{
	u32 isrVal, isrClr, apiId;
	XPfw_PmIpiStatus ipiStatus;
	XStatus status;

	switch (IpiNum) {
	case 0:
		isrVal = XPfw_Read32(IPI_PMU_0_ISR);
		fw_printf("Received IPI Mask:0x%08x\r\n", isrVal);
		ipiStatus = XPfw_PmCheckIpiRequest(isrVal, &apiId);
		if (XPFW_PM_IPI_IS_PM_CALL == ipiStatus) {
			/* Power management API processing */
			status = XPfw_PmIpiHandler(isrVal, apiId, &isrClr);
			if (XST_SUCCESS == status) {
				/* Clear only irq for handled PM request */
				XPfw_Write32(IPI_PMU_0_ISR, isrClr);
			}
		} else {
			status = XST_NO_FEATURE;
			fw_printf("MOD-%d: Non-PM IPI-%d call received\r\n", ModPtr->ModId, IpiNum);
		}

		if (XST_SUCCESS != status) {
			/*
			 * Clear all irqs if something went wrong, to avoid
			 * system looping in interrupt handler because of error
			 */
			XPfw_Write32(IPI_PMU_0_ISR, isrVal);
			fw_printf("ERROR #%d : IPI-%d\r\n", status, IpiNum);
		}
		break;

	case 1:
		isrVal = XPfw_Read32(IPI_PMU_1_ISR);
		XPfw_Write32(IPI_PMU_1_ISR, isrVal);
		break;

	case 2:
		isrVal = XPfw_Read32(IPI_PMU_2_ISR);
		XPfw_Write32(IPI_PMU_2_ISR, isrVal);
		break;

	case 3:
		isrVal = XPfw_Read32(IPI_PMU_3_ISR);
		XPfw_Write32(IPI_PMU_3_ISR, isrVal);
		break;

	default:
		fw_printf("ERROR: Invalid IPI Number: %d\r\n", IpiNum);
	}
}
Ejemplo n.º 2
0
/**
 * PmAcknowledgeCb() - sends acknowledge via callback
 * @master      Master who is blocked and waiting for the acknowledge
 * @nodeId      Node id of the node in question
 * @status      Status of the PM operation
 * @oppoint     Operating point of the node in question
 *
 * @note        Master is not blocked waiting for this acknowledge. Master
 *              acknowledge through the IPI interrupt and registered callback.
 */
void PmAcknowledgeCb(const PmMaster* const master, const PmNodeId nodeId,
		     const u32 status, const u32 oppoint)
{
	IPI_REQUEST4(master->pmuBuffer, PM_ACKNOWLEDGE_CB, nodeId, status,
		     oppoint);
	XPfw_Write32(IPI_PMU_0_TRIG, master->ipiMask);
}
Ejemplo n.º 3
0
/**
 * PmCrfRestoreContext() - Restore context of CRF_APB module (FPD has been
 *                         powered up)
 */
static void PmCrfRestoreContext(void)
{
	u32 i;

	for (i = 0U; i < ARRAY_SIZE(pmCrfContext); i++) {
		XPfw_Write32(pmCrfContext[i].addr, pmCrfContext[i].value);
	}
}
Ejemplo n.º 4
0
/**
 * PmInitSuspendCb() - request a master to suspend itself
 * @master      Master to be asked to suspend
 * @reason      The reason of initiating the suspend
 * @latency     Not supported
 * @state       State to which the master should suspend
 * @timeout     How much time the master has to respond
 */
void PmInitSuspendCb(const PmMaster* const master, const u32 reason,
		     const u32 latency, const u32 state, const u32 timeout)
{
	PmDbg("of %s (%lu, %lu, %lu, %lu)\n", PmStrNode(master->nid), reason,
	      latency, state, timeout);

	IPI_REQUEST5(master->pmuBuffer, PM_INIT_SUSPEND_CB, reason, latency,
		     state, timeout);
	XPfw_Write32(IPI_PMU_0_TRIG, master->ipiMask);
}
Ejemplo n.º 5
0
/**
 * PmNotifyCb() - notifies a master about an event occurance
 * @master      Master to be notified about the event
 * @nodeId      Node id regarding which the event is triggered
 * @event       Event to informa master about
 * @oppoint     Optionally event is related to some operating point change
 */
void PmNotifyCb(const PmMaster* const master, const PmNodeId nodeId,
		const u32 event, const u32 oppoint)
{
	IPI_REQUEST4(master->pmuBuffer, PM_NOTIFY_CB, nodeId, event, oppoint);
	XPfw_Write32(IPI_PMU_0_TRIG, master->ipiMask);
}