tegra: hwpm: consider PMA as regular IP

PMA and RTR perfmuxes contain registers required to configure HWPM.
So currently, PMA and RTR IPs are treated as special case and
initialized - released along with the driver.
However, as RTR IP includes both router and pma apertures, only treat
RTR as special IP. Change RTR config to have router and pma apertures
as separate instances. Define macros for router and pma instance index.
This will be allow to retrieve router and pma aperture structures.

Remove PMA IP reservation during driver init and PMA IP release at
driver close. As PMA IP is not treated special now,
remove get_pma_ip_idx() HAL.

Modify HWPM configuration functions to use router and pma apertures
initialized as part of RTR IP.

Jira THWPM-41

Change-Id: Ic82b2d07769c1b5c4601e07776be06087468657d
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2706488
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Vedashree Vidwans
2022-04-30 23:16:07 -07:00
committed by mobile promotions
parent 25f0737897
commit 7dd5b5c956
12 changed files with 71 additions and 307 deletions

View File

@@ -139,17 +139,11 @@ int tegra_hwpm_setup_hw(struct tegra_soc_hwpm *hwpm)
tegra_hwpm_fn(hwpm, " ");
/*
* Map PMA and RTR apertures
* PMA and RTR are hwpm apertures which include hwpm config registers.
* Map RTR aperture
* RTR is hwpm aperture which includes hwpm config registers.
* Map/reserve these apertures to get MMIO address required for hwpm
* configuration (following steps).
*/
ret = hwpm->active_chip->reserve_pma(hwpm);
if (ret < 0) {
tegra_hwpm_err(hwpm, "Unable to reserve PMA aperture");
goto fail;
}
ret = hwpm->active_chip->reserve_rtr(hwpm);
if (ret < 0) {
tegra_hwpm_err(hwpm, "Unable to reserve RTR aperture");
@@ -196,8 +190,8 @@ int tegra_hwpm_release_hw(struct tegra_soc_hwpm *hwpm)
}
/*
* Unmap PMA and RTR apertures
* Since, PMA and RTR hwpm apertures consist of hwpm config registers,
* Unmap RTR apertures
* Since, RTR hwpm apertures consist of hwpm config registers,
* these aperture mappings are required to reset hwpm config.
* Hence, explicitly unmap/release these apertures as a last step.
*/
@@ -207,12 +201,6 @@ int tegra_hwpm_release_hw(struct tegra_soc_hwpm *hwpm)
goto fail;
}
ret = hwpm->active_chip->release_pma(hwpm);
if (ret < 0) {
tegra_hwpm_err(hwpm, "Unable to release PMA aperture");
goto fail;
}
return 0;
fail:
return ret;