Files
linux-hwpm/tegra-soc-hwpm-debugfs.c
Vedashree Vidwans 3edf3f6034 tegra: soc_hwpm: t234: move chip specific files
Move chip specific code to chip specific folder. This will allow
multiple chip support in the future.
Create new specific functions
- Initialize hwpm structures
- Reserve and release PMA and RTR apertures
- Zero, update and check allowlists
- Set and get fake registers for MC aperture on simulation
- perfmon dt aperture enums

Jira THWPM-41

Change-Id: Ib80f324283c8d29b5c6f7bb6345a6df2410954e6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2620234
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-12-10 19:17:55 -08:00

58 lines
1.6 KiB
C

/*
* tegra-soc-hwpm-debugfs.c:
* This file adds debugfs nodes for the Tegra SOC HWPM driver.
*
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
#include <linux/debugfs.h>
#include <hal/tegra-soc-hwpm-structures.h>
#include "tegra-soc-hwpm-log.h"
#include "tegra-soc-hwpm.h"
/* FIXME: This is a placeholder for now. We can add debugfs nodes as needed. */
void tegra_soc_hwpm_debugfs_init(struct tegra_soc_hwpm *hwpm)
{
if (!hwpm) {
tegra_soc_hwpm_err("Invalid hwpm struct");
return;
}
hwpm->debugfs_root = debugfs_create_dir(TEGRA_SOC_HWPM_MODULE_NAME, NULL);
if (!hwpm->debugfs_root) {
tegra_soc_hwpm_err("Failed to create debugfs root directory");
goto fail;
}
return;
fail:
debugfs_remove_recursive(hwpm->debugfs_root);
hwpm->debugfs_root = NULL;
}
void tegra_soc_hwpm_debugfs_deinit(struct tegra_soc_hwpm *hwpm)
{
if (!hwpm) {
tegra_soc_hwpm_err("Invalid hwpm struct");
return;
}
debugfs_remove_recursive(hwpm->debugfs_root);
hwpm->debugfs_root = NULL;
}