PMUFW: MOD: Add new module for legacy power request handling

CSU ROM and FSBL send power up/down requests to PMU via the
PWR_UP/PWR_DN request register in PMU_GLOBAL. This module
handles these requests and routes them to respective ROM handlers

Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
This commit is contained in:
Jyotheeswar Reddy 2015-08-06 11:02:18 -07:00 committed by Nava kishore Manne
parent bc66b745b7
commit 6b0ba64eda
4 changed files with 122 additions and 1 deletions

View file

@ -0,0 +1,81 @@
/******************************************************************************
*
* Copyright (C) 2015 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
#include "xpfw_default.h"
#include "xpfw_rom_interface.h"
#include "xpfw_config.h"
#include "xpfw_core.h"
#include "xpfw_events.h"
#include "xpfw_module.h"
/* CfgInit Handler */
static void LegacyCfgInit(const XPfw_Module_t *ModPtr, const u32 *CfgData,
u32 Len)
{
/* Used for Power Up/Dn request handling */
XPfw_CoreRegisterEvent(ModPtr, XPFW_EV_REQ_PWRUP);
XPfw_CoreRegisterEvent(ModPtr, XPFW_EV_REQ_PWRDN);
fw_printf("LEGACY PWR UP/DN (MOD-%d): Initialized.\r\n", ModPtr->ModId);
}
/* Event Handler */
static void LegacyEventHandler(const XPfw_Module_t *ModPtr, u32 EventId)
{
if (XPFW_EV_REQ_PWRUP == EventId) {
/* Call ROM Handler for PwrUp */
fw_printf("XPFW: Calling ROM PWRUP Handler..");
XpbrServHndlrTbl[XPBR_SERV_EXT_PWRUP_REQS]();
fw_printf("Done\r\n");
}
if (XPFW_EV_REQ_PWRDN == EventId) {
/* Call ROM Handler for PwrDn */
fw_printf("XPFW: Calling ROM PWRDN Handler..");
XpbrServHndlrTbl[XPBR_SERV_EXT_PWRDN_REQS]();
fw_printf("Done\r\n");
}
}
/*
* Create a Mod and assign the Handlers. We will call this function
* from XPfw_UserStartup()
*/
void ModLegacyInit(void)
{
const XPfw_Module_t *LegacyModPtr = XPfw_CoreCreateMod();
(void) XPfw_CoreSetCfgHandler(LegacyModPtr, LegacyCfgInit);
(void) XPfw_CoreSetEventHandler(LegacyModPtr, LegacyEventHandler);
}

View file

@ -0,0 +1,38 @@
/******************************************************************************
*
* Copyright (C) 2015 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
#ifndef XPFW_MOD_LEGACY_H_
#define XPFW_MOD_LEGACY_H_
void ModLegacyInit(void);
#endif /* XPFW_MOD_LEGACY_H_ */

View file

@ -44,6 +44,7 @@
#include "pm_defs.h"
#include "xpfw_mod_dap.h"
#include "xpfw_mod_legacy.h"
#ifdef ENABLE_PM
static void PmIpiHandler(const XPfw_Module_t *ModPtr, u32 IpiNum, u32 SrcMask)
@ -269,4 +270,5 @@ void XPfw_UserStartUp(void)
ModPmInit();
(void)ModSchInit();
ModDapInit();
ModLegacyInit();
}

View file

@ -1,4 +1,4 @@
#ifndef ZYNQMP_XPFW_VERSION__H_
#define ZYNQMP_XPFW_VERSION__H_
#define ZYNQMP_XPFW_VERSION "2015.3-rc1-5-gf87012a6ce99"
#define ZYNQMP_XPFW_VERSION "2015.3-rc1-6-g61cf37508b43"
#endif