Files
linux-hwpm/drivers/tegra/hwpm/os/linux/io_utils.h
Vedashree Vidwans 845a7137ae tegra: hwpm: add func to write sticky bits
Currently, HWPM requires raw readl/writel functions
to access sticky bits and as workaround for IP registers.
- Move the raw readl/writel logic along with IO mapping
of the address to a static function.
- Implement the wrapper functions to access sticky bits
and IP registers to use the created static functions.

Jira THWPM-86

Change-Id: Ib0b3229d4b8795d19aca142233622a166436e3bd
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3014028
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-15 09:33:12 -08:00

44 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. 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/>.
*/
#ifndef TEGRA_HWPM_OS_LINUX_IO_UTILS_H
#define TEGRA_HWPM_OS_LINUX_IO_UTILS_H
struct tegra_soc_hwpm;
struct hwpm_ip_inst;
struct hwpm_ip_aperture;
int tegra_hwpm_read_sticky_bits_impl(struct tegra_soc_hwpm *hwpm,
u64 reg_base, u64 reg_offset, u32 *val);
int tegra_hwpm_write_sticky_bits_impl(struct tegra_soc_hwpm *hwpm,
u64 reg_base, u64 reg_offset, u32 val);
int tegra_hwpm_fake_readl_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *aperture, u64 offset, u32 *val);
int tegra_hwpm_fake_writel_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *aperture, u64 offset, u32 val);
int tegra_hwpm_readl_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *aperture, u64 addr, u32 *val);
int tegra_hwpm_writel_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *aperture, u64 addr, u32 val);
int tegra_hwpm_regops_readl_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *aperture,
u64 addr, u32 *val);
int tegra_hwpm_regops_writel_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *aperture,
u64 addr, u32 val);
#endif /* TEGRA_HWPM_OS_LINUX_IO_UTILS_H */