mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drm/tegra: Enable actmon for OFA
OFA has unit actmon monitoring its active time. Enabling actmon for OFA to export load information of OFA. Bug 4310958 Signed-off-by: Johnny Liu <johnliu@nvidia.com> Change-Id: I8df79f266da71c0cc248e603a07fec7508cbb8ce Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990240 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
0b989c71b1
commit
0840137ad6
@@ -25,9 +25,16 @@
|
||||
#include "hwpm.h"
|
||||
|
||||
#define OFA_TFBIF_TRANSCFG 0x1444
|
||||
#define OFA_TFBIF_ACTMON_ACTIVE_MASK 0x144c
|
||||
#define OFA_TFBIF_ACTMON_ACTIVE_BORPS 0x1450
|
||||
#define OFA_SAFETY_RAM_INIT_REQ 0x3320
|
||||
#define OFA_SAFETY_RAM_INIT_DONE 0x3324
|
||||
|
||||
#define OFA_TFBIF_ACTMON_ACTIVE_MASK_STARVED BIT(0)
|
||||
#define OFA_TFBIF_ACTMON_ACTIVE_MASK_STALLED BIT(1)
|
||||
#define OFA_TFBIF_ACTMON_ACTIVE_MASK_DELAYED BIT(2)
|
||||
#define OFA_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE BIT(7)
|
||||
|
||||
struct ofa_config {
|
||||
const char *firmware;
|
||||
unsigned int version;
|
||||
@@ -199,6 +206,18 @@ cleanup:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void ofa_actmon_reg_init(struct ofa *ofa)
|
||||
{
|
||||
ofa_writel(ofa,
|
||||
OFA_TFBIF_ACTMON_ACTIVE_MASK_STARVED |
|
||||
OFA_TFBIF_ACTMON_ACTIVE_MASK_STALLED |
|
||||
OFA_TFBIF_ACTMON_ACTIVE_MASK_DELAYED,
|
||||
OFA_TFBIF_ACTMON_ACTIVE_MASK);
|
||||
|
||||
ofa_writel(ofa,
|
||||
OFA_TFBIF_ACTMON_ACTIVE_BORPS_ACTIVE,
|
||||
OFA_TFBIF_ACTMON_ACTIVE_BORPS);
|
||||
}
|
||||
|
||||
static __maybe_unused int ofa_runtime_resume(struct device *dev)
|
||||
{
|
||||
@@ -219,6 +238,10 @@ static __maybe_unused int ofa_runtime_resume(struct device *dev)
|
||||
if (err < 0)
|
||||
goto disable;
|
||||
|
||||
ofa_actmon_reg_init(ofa);
|
||||
|
||||
host1x_actmon_enable(&ofa->client.base);
|
||||
|
||||
return 0;
|
||||
|
||||
disable:
|
||||
@@ -234,6 +257,8 @@ static __maybe_unused int ofa_runtime_suspend(struct device *dev)
|
||||
|
||||
clk_disable_unprepare(ofa->clk);
|
||||
|
||||
host1x_actmon_disable(&ofa->client.base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -370,6 +395,10 @@ static int ofa_probe(struct platform_device *pdev)
|
||||
goto exit_falcon;
|
||||
}
|
||||
|
||||
err = host1x_actmon_register(&ofa->client.base);
|
||||
if (err < 0)
|
||||
dev_info(dev, "failed to register host1x actmon: %d\n", err);
|
||||
|
||||
ofa->hwpm.dev = dev;
|
||||
ofa->hwpm.regs = ofa->regs;
|
||||
tegra_drm_hwpm_register(&ofa->hwpm, pdev->resource[0].start,
|
||||
@@ -396,6 +425,8 @@ static int ofa_remove(struct platform_device *pdev)
|
||||
tegra_drm_hwpm_unregister(&ofa->hwpm, pdev->resource[0].start,
|
||||
TEGRA_DRM_HWPM_IP_OFA);
|
||||
|
||||
host1x_actmon_unregister(&ofa->client.base);
|
||||
|
||||
host1x_client_unregister(&ofa->client.base);
|
||||
|
||||
falcon_exit(&ofa->falcon);
|
||||
|
||||
Reference in New Issue
Block a user