Source
static int __issue_avs_command(struct private_data *priv, int cmd, bool is_send,
/*
* CPU frequency scaling for Broadcom SoCs with AVS firmware that
* supports DVS or DVFS
*
* Copyright (c) 2016 Broadcom
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* "AVS" is the name of a firmware developed at Broadcom. It derives
* its name from the technique called "Adaptive Voltage Scaling".
* Adaptive voltage scaling was the original purpose of this firmware.
* The AVS firmware still supports "AVS mode", where all it does is
* adaptive voltage scaling. However, on some newer Broadcom SoCs, the
* AVS Firmware, despite its unchanged name, also supports DFS mode and
* DVFS mode.
*
* In the context of this document and the related driver, "AVS" by
* itself always means the Broadcom firmware and never refers to the
* technique called "Adaptive Voltage Scaling".
*
* The Broadcom STB AVS CPUfreq driver provides voltage and frequency
* scaling on Broadcom SoCs using AVS firmware with support for DFS and
* DVFS. The AVS firmware is running on its own co-processor. The
* driver supports both uniprocessor (UP) and symmetric multiprocessor
* (SMP) systems which share clock and voltage across all CPUs.
*
* Actual voltage and frequency scaling is done solely by the AVS
* firmware. This driver does not change frequency or voltage itself.
* It provides a standard CPUfreq interface to the rest of the kernel
* and to userland. It interfaces with the AVS firmware to effect the
* requested changes and to report back the current system status in a
* way that is expected by existing tools.
*/
/* Max number of arguments AVS calls take */
/*
* This macro is used to generate AVS parameter register offsets. For
* x >= AVS_MAX_CMD_ARGS, it returns 0 to protect against accidental memory
* access outside of the parameter range. (Offset 0 is the first parameter.)
*/
/* AVS Mailbox Register offsets */