From: Michal Simek <michal.simek@xilinx.com>
To: Ben Levinsky <ben.levinsky@xilinx.com>,
ohad@wizery.com, bjorn.andersson@linaro.org,
michal.simek@xilinx.com, jollys@xilinx.com,
rajan.vaja@xilinx.com, robh+dt@kernel.org, mark.rutland@arm.com
Cc: linux-remoteproc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] firmware: xilinx: Add RPU configuration APIs
Date: Tue, 21 Apr 2020 07:59:16 +0200 [thread overview]
Message-ID: <18cf27ff-5175-bff1-d1d8-5ef077d4202a@xilinx.com> (raw)
In-Reply-To: <1587421629-914-4-git-send-email-ben.levinsky@xilinx.com>
On 21. 04. 20 0:27, Ben Levinsky wrote:
> This patch adds APIs to provide access and a configuration interface
> to the current power state of a sub-system on Zynqmp sub-system.
>
> Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
> ---
> changes since v2:
> - add xilinx-related platform mgmt fn's instead of wrapping around
> function pointer in xilinx eemi ops struct
> ---
> drivers/firmware/xilinx/zynqmp.c | 101 +++++++++++++++++++++++++++++++++++
> include/linux/firmware/xlnx-zynqmp.h | 30 +++++++++++
> 2 files changed, 131 insertions(+)
>
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index b0d140f..e0a906e 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -845,6 +845,63 @@ int zynqmp_pm_release_node(const u32 node)
> EXPORT_SYMBOL_GPL(zynqmp_pm_release_node);
>
> /**
> + * zynqmp_pm_get_rpu_mode() - Get RPU mode
> + * @node_id: Node ID of the device
> + * @arg1: Argument 1 to requested IOCTL call
> + * @arg2: Argument 2 to requested IOCTL call
> + * @out: Returned output value
> + *
> + * Return: Returns RPU mode
ditto.
> + */
> +int zynqmp_pm_get_rpu_mode(u32 node_id,
> + u32 arg1, u32 arg2, u32 *out)
> +{
> + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id,
> + IOCTL_GET_RPU_OPER_MODE, 0, 0, out);
> +}
> +EXPORT_SYMBOL_GPL(zynqmp_pm_get_rpu_mode);
> +
> +/**
> + * zynqmp_pm_set_rpu_mode() - Set RPU mode
> + * @node_id: Node ID of the device
> + * @ioctl_id: ID of the requested IOCTL
> + * @arg2: Argument 2 to requested IOCTL call
> + * @out: Returned output value
> + *
> + * This function is used to set RPU mode.
> + *
> + * Return: Returns status, either success or error+reason
> + */
> +int zynqmp_pm_set_rpu_mode(u32 node_id,
> + u32 arg1, u32 arg2, u32 *out)
> +{
> + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id,
> + IOCTL_SET_RPU_OPER_MODE, 0, 0, out);
> +}
> +EXPORT_SYMBOL_GPL(zynqmp_pm_set_rpu_mode);
> +
> +/**
> + * zynqmp_pm_tcm_comb_config - configure TCM
> + * @node_id: Node ID of the device
> + * @arg1: Argument 1 to requested IOCTL call
> + * @arg2: Argument 2 to requested IOCTL call
> + * @out: Returned output value
> + *
> + * This function is used to set RPU mode.
> + *
> + * Return: Returns status, either success or error+reason
> + */
> +int zynqmp_pm_set_tcm_config(u32 node_id,
> + u32 arg1, u32 arg2, u32 *out)
> +{
> + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id,
> + IOCTL_TCM_COMB_CONFIG, 0, 0, out);
> +
> +}
> +EXPORT_SYMBOL_GPL(zynqmp_pm_set_tcm_config);
> +
> +
double space here.
> +/**
> * zynqmp_pm_force_powerdown - PM call to request for another PU or subsystem to
> * be powered down forcefully
> * @target: Node ID of the targeted PU or subsystem
> @@ -880,6 +937,50 @@ int zynqmp_pm_request_wakeup(const u32 node,
> EXPORT_SYMBOL_GPL(zynqmp_pm_request_wakeup);
>
> /**
> + * zynqmp_pm_get_node_status - PM call to request a node's current power state
> + * @node: ID of the component or sub-system in question
> + * @status: Current operating state of the requested node
> + * @requirements: Current requirements asserted on the node,
> + * used for slave nodes only.
> + * @usage: Usage information, used for slave nodes only:
> + * PM_USAGE_NO_MASTER - No master is currently using
> + * the node
> + * PM_USAGE_CURRENT_MASTER - Only requesting master is
> + * currently using the node
> + * PM_USAGE_OTHER_MASTER - Only other masters are
> + * currently using the node
> + * PM_USAGE_BOTH_MASTERS - Both the current and at least
> + * one other master is currently
> + * using the node
> + *
> + * Return: Returns status, either success or error+reason
> + */
> +int zynqmp_pm_get_node_status(const u32 node,
> + u32 *status, u32 *requirements,
> + u32 *usage)
> +
> +{
> + u32 ret_payload[PAYLOAD_ARG_CNT];
> + int ret;
> +
> + if (!status)
> + return -EINVAL;
> +
> + ret = zynqmp_pm_invoke_fn(PM_GET_NODE_STATUS, node, 0, 0,
> + 0, ret_payload);
> + if (ret_payload[0] == XST_PM_SUCCESS) {
> + *status = ret_payload[1];
> + if (requirements)
> + *requirements = ret_payload[2];
> + if (usage)
> + *usage = ret_payload[3];
> + }
> +
> + return ret;
indentation.
M
next prev parent reply other threads:[~2020-04-21 5:59 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 22:27 [PATCH v3 0/5] remoteproc: Add zynqmp_r5 driver Ben Levinsky
2020-04-20 22:27 ` Ben Levinsky
2020-04-20 22:27 ` [PATCH v3 1/5] firmware: xilinx: Add ZynqMP firmware ioctl enums for RPU configuration Ben Levinsky
2020-04-20 22:27 ` Ben Levinsky
2020-04-21 5:49 ` Michal Simek
2020-04-21 5:49 ` Michal Simek
2020-04-20 22:27 ` [PATCH v3 2/5] firmware: xilinx: Add shutdown/wakeup APIs Ben Levinsky
2020-04-20 22:27 ` Ben Levinsky
2020-04-21 5:57 ` Michal Simek
2020-04-21 5:57 ` Michal Simek
2020-04-20 22:27 ` [PATCH v3 3/5] firmware: xilinx: Add RPU configuration APIs Ben Levinsky
2020-04-20 22:27 ` Ben Levinsky
2020-04-21 5:59 ` Michal Simek [this message]
2020-04-21 5:59 ` Michal Simek
2020-04-20 22:27 ` [PATCH v3 4/5] dt-bindings: remoteproc: Add documentation for ZynqMP R5 rproc bindings Ben Levinsky
2020-04-20 22:27 ` Ben Levinsky
2020-04-22 19:38 ` Rob Herring
2020-04-22 19:38 ` Rob Herring
2020-04-22 20:29 ` Ben Levinsky
2020-04-22 20:29 ` Ben Levinsky
2020-04-20 22:27 ` [PATCH v3 5/5] remoteproc: Add initial zynqmp R5 remoteproc driver Ben Levinsky
2020-04-20 22:27 ` Ben Levinsky
2020-04-21 5:57 ` [PATCH v3 0/5] remoteproc: Add zynqmp_r5 driver Michal Simek
2020-04-21 5:57 ` Michal Simek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18cf27ff-5175-bff1-d1d8-5ef077d4202a@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=ben.levinsky@xilinx.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=jollys@xilinx.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=ohad@wizery.com \
--cc=rajan.vaja@xilinx.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox