diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_dap.c b/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_dap.c new file mode 100644 index 00000000..f20d6e60 --- /dev/null +++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_dap.c @@ -0,0 +1,80 @@ +/****************************************************************************** +* +* 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" + +/* Enable DAP wake mod only if PM is disabled, to avoid conflicts */ +#ifndef ENABLE_PM +/* CfgInit Handler */ +static void DapCfgInit(const XPfw_Module_t *ModPtr, const u32 *CfgData, u32 Len) +{ + /* Used for DAP Wakes */ + XPfw_CoreRegisterEvent(ModPtr, XPFW_EV_DAP_RPU_WAKE); + XPfw_CoreRegisterEvent(ModPtr, XPFW_EV_DAP_FPD_WAKE); + + fw_printf("DAP_WAKE (MOD-%d): Initialized.\r\n", ModPtr->ModId); +} + +/* Event Handler */ +static void DapEventHandler(const XPfw_Module_t *ModPtr, u32 EventId) +{ + if (XPFW_EV_DAP_RPU_WAKE == EventId) { + /* Call ROM Handler for RPU Wake */ + XpbrServHndlrTbl[XPBR_SERV_EXT_DAPRPUWAKE](); + fw_printf("XPFW: DAP RPU WAKE.. Done\r\n"); + } + if (XPFW_EV_DAP_FPD_WAKE == EventId) { + /* Call ROM Handler for FPD Wake */ + XpbrServHndlrTbl[XPBR_SERV_EXT_DAPFPDWAKE](); + fw_printf("XPFW: DAP FPD WAKE.. Done\r\n"); + } +} + +/* + * Create a Mod and assign the Handlers. We will call this function + * from XPfw_UserStartup() + */ +void ModDapInit(void) +{ + const XPfw_Module_t *DapModPtr = XPfw_CoreCreateMod(); + + (void) XPfw_CoreSetCfgHandler(DapModPtr, DapCfgInit); + (void) XPfw_CoreSetEventHandler(DapModPtr, DapEventHandler); +} +#else + void ModDapInit(void) { } +#endif diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_dap.h b/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_dap.h new file mode 100644 index 00000000..9192118b --- /dev/null +++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_dap.h @@ -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_DAP_H_ +#define XPFW_MOD_DAP_H_ + +void ModDapInit(void); + +#endif /* XPFW_MOD_DAP_H_ */ diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_user_startup.c b/lib/sw_apps/zynqmp_pmufw/src/xpfw_user_startup.c index e9adf05e..c7628583 100644 --- a/lib/sw_apps/zynqmp_pmufw/src/xpfw_user_startup.c +++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_user_startup.c @@ -43,6 +43,8 @@ #include "ipi_buffer.h" #include "pm_defs.h" +#include "xpfw_mod_dap.h" + #ifdef ENABLE_PM static void PmIpiHandler(const XPfw_Module_t *ModPtr, u32 IpiNum, u32 SrcMask) { @@ -266,4 +268,5 @@ void XPfw_UserStartUp(void) ModEmInit(); ModPmInit(); (void)ModSchInit(); + ModDapInit(); } diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h b/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h index 556ab116..560e0b5e 100644 --- a/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h +++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_version.h @@ -1,4 +1,4 @@ #ifndef ZYNQMP_XPFW_VERSION__H_ #define ZYNQMP_XPFW_VERSION__H_ - #define ZYNQMP_XPFW_VERSION "2015.1-swbeta2-53-g20bb8d5c123c" + #define ZYNQMP_XPFW_VERSION "2015.3-rc1-4-gc5f26e664fa0" #endif