mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-22 17:30:40 +03:00
tegra: hwpm: Linux: IOCTL for Credit Programming
- Add IOCTL infra for Credit programming in Linux based OSs. Bug 4571175 Signed-off-by: vasukis <vasukis@nvidia.com> Change-Id: I1a5ff5aefcf8da6ad85507d71c0a9bd3b7f31f6d Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3136565 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b5f2672134
commit
5d80b2edb5
@@ -21,6 +21,7 @@
|
||||
#include <tegra_hwpm_log.h>
|
||||
#include <tegra_hwpm_common.h>
|
||||
#include <tegra_hwpm_static_analysis.h>
|
||||
#include <os/linux/driver.h>
|
||||
#include <os/linux/regops_utils.h>
|
||||
|
||||
static int tegra_hwpm_exec_reg_ops(struct tegra_soc_hwpm *hwpm,
|
||||
@@ -228,3 +229,33 @@ int tegra_hwpm_exec_regops(struct tegra_soc_hwpm *hwpm,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tegra_hwpm_credit_program(struct tegra_soc_hwpm *hwpm,
|
||||
struct tegra_soc_hwpm_exec_credit_program *credit_prog)
|
||||
{
|
||||
int idx = 0, ret = 0;
|
||||
struct tegra_soc_hwpm_credits_info *creditInfo = NULL;
|
||||
|
||||
tegra_hwpm_fn(hwpm, " ");
|
||||
|
||||
/* Check if credit_programming is defined for this chip*/
|
||||
if (hwpm->active_chip->credit_program == NULL) {
|
||||
tegra_hwpm_err(hwpm, "Credit programming not defined");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (idx = 0; idx <= credit_prog->num_entries; idx++) {
|
||||
//Extract the credit_info pointer for a given Credit packet.
|
||||
//This contains the num_credits param
|
||||
//which has to be updated in chip specific HALs.
|
||||
creditInfo = &(credit_prog->credit_info[idx]);
|
||||
|
||||
/* Call chip specific credit programming API */
|
||||
ret = hwpm->active_chip->credit_program(
|
||||
hwpm, &(creditInfo->num_credits),
|
||||
creditInfo->cblock_idx, credit_prog->pma_channel_idx,
|
||||
credit_prog->credit_cmd);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user