aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorTimo Alho <talho@nvidia.com>2018-10-22 09:19:36 -0400
committerThierry Reding <treding@nvidia.com>2018-11-08 06:49:25 -0500
commitd78b5bde0ffc33d20f014b3ad4d7aaac8b79d34e (patch)
treedd3766d6b88c176abde694cacc7e366777571ffd /drivers/firmware
parent651022382c7f8da46cb4872a545ee1da6d097d2a (diff)
firmware: tegra: Add helper to check for supported MRQs
Add a helper function to check that firmware is supporting a given MRQ command. Signed-off-by: Timo Alho <talho@nvidia.com> Acked-by: Sivaram Nair <sivaramn@nvidia.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/tegra/bpmp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
index a3d5b518c10e..90c6089fed84 100644
--- a/drivers/firmware/tegra/bpmp.c
+++ b/drivers/firmware/tegra/bpmp.c
@@ -470,6 +470,31 @@ unlock:
470} 470}
471EXPORT_SYMBOL_GPL(tegra_bpmp_free_mrq); 471EXPORT_SYMBOL_GPL(tegra_bpmp_free_mrq);
472 472
473bool tegra_bpmp_mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq)
474{
475 struct mrq_query_abi_request req = { .mrq = cpu_to_le32(mrq) };
476 struct mrq_query_abi_response resp;
477 struct tegra_bpmp_message msg = {
478 .mrq = MRQ_QUERY_ABI,
479 .tx = {
480 .data = &req,
481 .size = sizeof(req),
482 },
483 .rx = {
484 .data = &resp,
485 .size = sizeof(resp),
486 },
487 };
488 int ret;
489
490 ret = tegra_bpmp_transfer(bpmp, &msg);
491 if (ret || msg.rx.ret)
492 return false;
493
494 return resp.status == 0;
495}
496EXPORT_SYMBOL_GPL(tegra_bpmp_mrq_is_supported);
497
473static void tegra_bpmp_mrq_handle_ping(unsigned int mrq, 498static void tegra_bpmp_mrq_handle_ping(unsigned int mrq,
474 struct tegra_bpmp_channel *channel, 499 struct tegra_bpmp_channel *channel,
475 void *data) 500 void *data)