This reverts commit 73154541df.
Linker script was modified to work-around a bootgen issue with handling
multiple loadable sections. Now this issue is fixed in bootgen (PR#875808).
So reverting the commit.
FSBL configures the UART baud rate, MIOs and Clocks. UART init code in FW is
not fully functional and in some cases may interfere with settings done by FSBL.
So skip UART init in PMUFW to avoid conflicts.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Acked-by: Sarat Chand Savitala <saratcha@xilinx.com>
Provide tcl procedures to query for processors and os
supported by pmufw app. SDK uses the return values of these
procedures to make sure that pmufw app shows up in the apps
list only when the supported processor type (psu_microblaze)
and OS (standalone) are selected.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Acked-by: Srikanth Vemula <svemula@xilinx.com>
Bootgen currently has no support for multiple loadable sections
in elfs. So a workaround is being implemented in PMUFW linker
script. All sections are forced to be loadable and dummy bytes
are added to fill the gaps. This change causes linker to throw
a warning about bss section being made PROGBITS.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
DONT_SLEEP bit in PMU GLobal control register, if set, wakes up the
microblaze from sleep state. This makes the "sleep" instruction
ineffective by making the MB to toggle between sleep and wake states
in the core loop. So this bit is cleared to prevent such a situation
and ensure that MB wakes up only in case of an interrupt event.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Some registers in PMU Local register set are not intended to be
published out. So removing all register definitions which are not
used by PMU FW currently.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Exception handler is modified to log the ESR and EAR registers
into persistent global storage registers(0,1) and set FW error bit-0.
If bit-0 of FWError group in ERROR_2 register set is configured to do
a SRST,then post reset, SW can read the reason for exception from
these persistent registers.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Basic APIs are provided for modules to send/receive IPI messages.
These are wrappers around IPI driver functions and are intended to
support a common message structure. Currently only a module's IPI ID
is considered.This can be extended to include checksum and other fields in
IPI message and dispatching IPIs based on module id.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
A framework to enable handling of HW errors reported via ERROR_1 and ERROR_2
registers in PMU GLOBAL space is provided. User can choose to register an
action for an error by using the provided API. An API is provided to enable
Error reporting via PSERR pin.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Register for secure lock-down request from CSU and
call the corresponding ROM handler when this event occurs
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
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>
Add new events and supporting functions to handle legacy
ROM power up and power down requests that are initiated
using PMU GLOBAL registers.
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
Add DAP event handler to PMU Firmware as a new user module and pass on
the handling to respective ROM Handlers.When a DAP wake arrives,
PMU should ACK the DAP Wake using its local registers.
PMU ROM has handlers for these and we will re-use these handlers here.
This module is enabled only if ENABLE_PM is not defined to avoid conflict
with the PM module
Signed-off-by: Jyotheeswar Reddy <jyothee@xilinx.com>
This patch removes the gap in serial numbering of PM API ids
between PM_SET_MAX_LATENCY and PM_RESET_ASSERT defined in
pm_defs.h
Signed-off-by: Rohit Fule <rohitf@xilinx.com>
Tested-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-GpuPP now has its own PmSlave derived structure and the FSM
(new structure is added because there is no peripheral with
exactly the same behavior - Usbs have also their own power island,
but compared to them GpuPPs do not have wake-up capabilities
through GIC Proxy, and GpuPPs depend on FPD while LPD is
considered always-on)
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Tested-by: Rohit Fule <rohitf@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
The ROM handlers and hooks have a different signature.
Fixes: aea3444396c3 'ROM interface: Add ROM hook table'
Cc: Kristopher Bechamp <kristop@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
XpbrPwrUpFpdHandler used to not always return XST_SUCCESS, this
problem no longer exists hence the workaround can be dropped.
Signed-off-by: Davorin Mista <davorin.mista@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Added PLL nodes (PLLs are PM slaves)
-Implemented PLL's FSM in pm_pll.h/c
-Added PmRequirement structures for APU and RPU_0, both can request
any PLL for usage
-Implemented saving of FPD PLLs' context and powering down FPD PLLs
before FPD gets powered down (this is PLL suspend)
-Implemented restoring of PLL states when PLL is needed for usage
if FPD has been powered down (this is PLL resume)
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Added array of CRF_APB module's register address/value pairs used
for saving/restoring CRF_APB register contents (excluding PLL
registers - PLLs have their own logic for save/restore)
-Added saving context of CRF_APB registers before FPD is powered
down and restoring saved context after FPD is powered up
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Added PM_CAP_POWER as generic capability (defined in pm_defs).
-Slaves' FSMs should define PM_CAP_POWER capability in states which
require power parent to be ON before the state is entered. This
capability has no effect if slave node does not have power parent
-Powering up parent of a slave is done automatically by the
framework before the FSM of a slave is triggered to change the
state (slave's FSM should assume all prerequisites regarding power
are configured before FSM is triggered)
-Added PM_CAP_POWER capability in ON state of standard fsm (used for
SATA)
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-There was a bug in pmu-fw/pm binding through IPIs, because of
which in case of multiple IPI interrupts generated simultaneously
only first interrupt was handled, other interrupts were lost
-The bug existed because PM handles one request in each
XPfw_PmIpiHandler invocation, and pmu-fw clears all bitfields
in ISR register after PM handles request. Therefore, if multiple
bits were set in ISR register (simultaneous IPI interrupts), only
first one was handled and other bits were just cleared
-XPfw_PmIpiHandler now returns status and through an argument
pointer an IPI mask of master whose request has been handled
-In xpfw_user_startup.c/PmIpiHandler, return of XPfw_PmIpiHandler
is checked. If PM successfully handled IPI, only the bitfield of
master whose request is handled is set (only that IPI interrupt
is cleared). If something went wrong in PmIpiHandler/IPI0 case,
we clear all bits set in ISR register, to avoid system hanging on
this interrupt handler
-In pm_master, a check whether the master owns given mask was
performed by using '==' instead '&'. Therefore, when 2 masters
generated interrupt at the same time, PM function that checks
whether the IPI is PM related returned that the ISR value does
not match any master. This bug is fixed
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Replaced PM defined macro definitions with macros defined in
lpd_slcr.h
-Other macros that are defined in pm_slave.h do not exist as is,
therefore are still used
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Added macros in pm_defs.h for system shutdown argument 'restart'
-Exposed array of all masters needed to initiate their suspend upon
receiving of system shutdown call
-Added checking for restart argument of system shutdown call in pm_api.c
-Implemented PmSystemShutdown for argument restart=0 (shutdown)
-Further improvement in PmSystemShutdown depend on timeout implementation
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Signed-off-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Every master has unique bitfield in all IPI registers
-PMU power management accesses status, trigger and enable registers
for a master using the unique master's ipiMask now
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
Move the tracking of suspend requests into the corresponding master
structures.
This patch limits the number of possible requestors to 1.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Added structure PmSuspendRequest for tracking suspend request
related informations: which master is allowed to request whose
suspend, has the request been made, etc.
-Added functions in pm_master for handling requests
-Added calls in pm_proc for triggering acknowledge once primary
processor goes to sleep
-Added sending acknowledge if target master aborts suspend
-Timeouts to be implemented
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Changed code in PmUpdateSlave to first determine the state to be
entered
-Added function for finding the state with required capabilities
-Removed function which was finding and changing state of a slave
(not used anymore)
-Major reason for changing this code is the bug: in USB case,
when USB is already in right state and upon the set requirement
request which should be resolved to the same state (nothing to
configure, state is already configured as requested) PM
acknowledged an error, although there was no error
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
-Using int type for returns
-Error statuses are common Xilinx XST_* codes
-Additional power management status errors are defined in pm_defs.h
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Signed-off-by: Davorin Mista <davorin.mista@aggios.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
Signed-off-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Added reset assert for RPU0..1 processor's sleep functions.
Reset assert is done by directly writing into crl_apb registers,
becase pmu-rom does not expose function for only asserting reset.
Reset assert is a must in order to stop processor from executing
instructions once it's sleep handler gets executed.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
-Added default requirements field in PmRequirements structure
-Added notification of master when primary processor switches from
forced powerdown to active state. Master has to make sure that all
default requirements gets set before primary processor enters active
state.
-In PmMasterNotify, changed behavior when wake event is received:
if primary processor is in sleep state, everything works as before,
if primary processor is in forced powerdown, default requirements
are requested and configured
-In PmRequirementReleaseAll added a check is master using slave and
if yes, usage flag and requirements are cleared
-Added PmRequirementRequestDefault function called before primary
processor switches from forced powerdown to active. Function
automatically requests all default requirements which are later
configured by PmRequirementUpdateScheduled
-In PmRequirementUpdateScheduled when swapping requirements added
a check whether master has default requirements. If yes, default
reqs are saved as next reqs instead of current. Default requirements
have priority over current requirement. Example: RPU0 keeps boot code
in one TCM bank and when booted, during the runtime, it keeps that
bank in retention. For this bank RPU0 should have default requirements
= on state, and when it boots up it can request retention. If default
requirements wouldn't exist, it would have to request for boot bank to
switch from retention to on before calling self suspend, just to get
on state in scheduled reqs
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
Before, there was a check at the very beginning to see if current state
is having exact required capabilities. However, state should be checked
for having all required capabilities and not for having exact required
caps. Also, even when state have all required capabilities, there could
be state with lower power that still has all required capabilities.
Code is changed to implement above claims.
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <jyothee@xilinx.com>
-Removed action arrays and instId pointers used in PmSlaveFsm
-Removed unused macros and typedefs
-Removed redundant functions for Sram retention entry/exit
-Added enterState function in PmSlaveFsm. Slave state is entered
based on arguments (slave pointer and next state).
-Added xpbr function pointers in PmSlave derived objects (usb and sram)
Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Reviewed-by: Jyotheeswar Reddy <jyothee@xilinx.com>
We should only enable the scheduled wake-up sources in the GIC Proxy
if the processor is sleeping.
Signed-off-by: Davorin Mista <davorin.mista@aggios.com>
Reviewed-by: Jyotheeswar Reddy <jyothee@xilinx.com>