mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-13 08:04:27 +00:00

MPMM - the Maximum Power Mitigation Mechanism - is an optional microarchitectural feature present on some Armv9-A cores, introduced with the Cortex-X2, Cortex-A710 and Cortex-A510 cores. MPMM allows the SoC firmware to detect and limit high activity events to assist in SoC processor power domain dynamic power budgeting and limit the triggering of whole-rail (i.e. clock chopping) responses to overcurrent conditions. This feature is enabled via the `ENABLE_MPMM` build option. Configuration can be done via FCONF by enabling `ENABLE_MPMM_FCONF`, or by via the plaform-implemented `plat_mpmm_topology` function. Change-Id: I77da82808ad4744ece8263f0bf215c5a091c3167 Signed-off-by: Chris Kay <chris.kay@arm.com>
57 lines
1.3 KiB
C
57 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2021, Arm Limited. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef MPMM_H
|
|
#define MPMM_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <platform_def.h>
|
|
|
|
/*
|
|
* Enable the Maximum Power Mitigation Mechanism.
|
|
*
|
|
* This function will enable MPMM for the current core. The AMU counters
|
|
* representing the MPMM gears must have been configured and enabled prior to
|
|
* calling this function.
|
|
*/
|
|
void mpmm_enable(void);
|
|
|
|
/*
|
|
* MPMM core data.
|
|
*
|
|
* This structure represents per-core data retrieved from the hardware
|
|
* configuration device tree.
|
|
*/
|
|
struct mpmm_core {
|
|
/*
|
|
* Whether MPMM is supported.
|
|
*
|
|
* Cores with support for MPMM offer one or more auxiliary AMU counters
|
|
* representing MPMM gears.
|
|
*/
|
|
bool supported;
|
|
};
|
|
|
|
/*
|
|
* MPMM topology.
|
|
*
|
|
* This topology structure describes the system-wide representation of the
|
|
* information retrieved from the hardware configuration device tree.
|
|
*/
|
|
struct mpmm_topology {
|
|
struct mpmm_core cores[PLATFORM_CORE_COUNT]; /* Per-core data */
|
|
};
|
|
|
|
#if !ENABLE_MPMM_FCONF
|
|
/*
|
|
* Retrieve the platform's MPMM topology. A `NULL` return value is treated as a
|
|
* non-fatal error, in which case MPMM will not be enabled for any core.
|
|
*/
|
|
const struct mpmm_topology *plat_mpmm_topology(void);
|
|
#endif /* ENABLE_MPMM_FCONF */
|
|
|
|
#endif /* MPMM_H */
|