This patch adds support for MCF SOC performance
monitoring in the driver. MCF SOC has two different
types of perfmuxes connected to the same perfmon:
one is the OCU type and the other is IBHX and OBHX.
IBHX is only accessible via MC16 aperture. Therefore,
this patch adds two separate IPs: OCU and IOBHX.
However, both are tied to the MCF SOC perfmon (mcfsoc0).
Bug 4287384
Signed-off-by: Vishal Aslot <vaslot@nvidia.com>
Change-Id: If15498a44e02270f9106337078931edbe043c254
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2986232
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
This patch adds support for C-NVLINK performance
monitoring in the driver. C-NVLINK consists of
RX, TX, and CTRL apertures, each with its own
perfmux signals and perfmons. So this patch
breaks them up into three sets of perfmux-perfmon
data structures.
Bug 4287384
Signed-off-by: Vishal Aslot <vaslot@nvidia.com>
Change-Id: Id8be4c965018125765f75a7b8bc8ab809bb7f976
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2999166
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
In Linux v6.2, the 'struct class.devnode()' function was updated to take
a 'const struct device *' instead of a 'struct device *'. A test has
been added to the conftest script to check for this and so instead of
relying on kernel version, use the definition generated by conftest to
select the appropriate function to use.
This is beneficial for working with 3rd party Linux kernels that may
have back-ported upstream changes into their kernel and so the kernel
version checks do not work.
Bug 4119327
Change-Id: I751b7401adee7b337192e255253b974cbd803642
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2991966
(cherry picked from commit 4b2fd8250d)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2995574
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
HWPM resource manager in QNX will query register read/write
ops to the IP debug node exposed. This is done via devctl
calls from the HWPM Res Mgr. Hence, update the NVDEC debug
node name in ip source file.
Bug 4170733
DOS-SHR-7601
Change-Id: I817aa18be43534907d761c992b9953918a39525d
Signed-off-by: vasukis <vasukis@nvidia.com>
(cherry picked from commit 7ed60c287e1253b834bfe050952240e97549e320)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2991341
Reviewed-by: Vishal Aslot <vaslot@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- Set the 'CONFIG_T234_HWPM_IP_NVDEC' defconfig in HWPM
Makefile, so that nvdec IP related code can be compiled
alongside HWPM driver. This is required for enabling
NVDEC IP for profiling by HWPM.
- This change affects both L4T and AV+L configs.
DOS-SHR-7601
Change-Id: I654fc3024731660d20c874b1e31659bc28627191
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2983399
Reviewed-by: Vishal Aslot <vaslot@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- HALs get_rtr_int_idx and get_ip_max_idx return the chip specific
router index and number of IPs. This information is static for a chip
and doesn't require any input. Hence, update the HAL definition to not
require hwpm pointer as an argument. Update definition and references
for these HALs.
- Add new HAL to get PMA and RTR structure pointers. Implement and
update other chip specific functions to use new HAL.
- Add new timer macro to check a condition and timeout after given
retries. Update necessary code to use new timer macro.
- Correct validate_emc_config function to compute correct available mss
channel mask based on fuse value.
- Update tegra_hwpm_readl and tegra_hwpm_writel macros to assert error
value. This way error checks are added at one spot and not sprinkled all
over the driver code.
- Update get_mem_bytes_put_ptr() and membuf_overflow_status() to return
error as function return and accept arguments to return mem_head pointer
and overflow status respectively. Add overflow status macros to use
throughout driver. Update HAL definition and references accordingly.
- conftest is only compiled for OOT config atm. Add OOT config check to
include conftest header.
Jira THWPM-109
Change-Id: I77d150e860fa344a1604d241e27718150fdb8647
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2982555
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: Vishal Aslot <vaslot@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
HWPM resource manager in QNX will query register read/write
ops to the IP debug nodes exposed. This is done via devctl
calls from the HWPM Res Mgr. Hence, update the IP debug node
names in ip souce files.
Bug 4170733
DOS-SHR-7601
Change-Id: I58a39305aa8d6fcbbe01494d1e18069a369ee46f
Signed-off-by: vasukis <vasukis@nvidia.com>
(cherry picked from commit d37297cb494bb6bfc3b531e38302de18d0fddfc5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2985248
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Determining whether the header file iosys-map.h is present in the kernel
is currently determine by kernel version. However, for Linux v5.15,
iosys-map.h has been backported in order to support simple-framebuffer
for early display. Therefore, we cannot rely on the kernel version to
indicate whether iosys-map is present. This is also true for 3rd party
Linux kernels that backport changes as well. Fix this by adding a
compile time flag, that will be set accordingly by the conftest script
if this header is present.
Bug 4119327
Bug 4228080
Change-Id: I9de07a4615a6c9da504b36750c48e73e200da301
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2974080
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Remove unused vmas parameter from get_user_pages() based
on following change in core kernel.
=====
Upstream commit "54d020692b34"
mm/gup: remove unused vmas parameter from get_user_pages()
Patch series "remove the vmas parameter from GUP APIs", v6.
(pin_/get)_user_pages[_remote]() each provide an optional output parameter
for an array of VMA objects associated with each page in the input range.
These provide the means for VMAs to be returned, as long as mm->mmap_lock
is never released during the GUP operation (i.e. the internal flag
FOLL_UNLOCKABLE is not specified).
In addition, these VMAs can only be accessed with the mmap_lock held and
become invalidated the moment it is released.
The vast majority of invocations do not use this functionality and of
those that do, all but one case retrieve a single VMA to perform checks
upon.
It is not egregious in the single VMA cases to simply replace the
operation with a vma_lookup(). In these cases we duplicate the (fast)
lookup on a slow path already under the mmap_lock, abstracted to a new
get_user_page_vma_remote() inline helper function which also performs
error checking and reference count maintenance.
The special case is io_uring, where io_pin_pages() specifically needs to
assert that the VMAs underlying the range do not result in broken
long-term GUP file-backed mappings.
As GUP now internally asserts that FOLL_LONGTERM mappings are not
file-backed in a broken fashion (i.e. requiring dirty tracking) - as
implemented in "mm/gup: disallow FOLL_LONGTERM GUP-nonfast writing to
file-backed mappings" - this logic is no longer required and so we can
simply remove it altogether from io_uring.
Eliminating the vmas parameter eliminates an entire class of danging
pointer errors that might have occured should the lock have been
incorrectly released.
In addition, the API is simplified and now clearly expresses what it is
intended for - applying the specified GUP flags and (if pinning) returning
pinned pages.
This change additionally opens the door to further potential improvements
in GUP and the possible marrying of disparate code paths.
I have run this series against gup_test with no issues.
Thanks to Matthew Wilcox for suggesting this refactoring!
This patch (of 6):
No invocation of get_user_pages() use the vmas parameter, so remove it.
The GUP API is confusing and caveated. Recent changes have done much to
improve that, however there is more we can do. Exporting vmas is a prime
target as the caller has to be extremely careful to preclude their use
after the mmap_lock has expired or otherwise be left with dangling
pointers.
Removing the vmas parameter focuses the GUP functions upon their primary
purpose - pinning (and outputting) pages as well as performing the actions
implied by the input flags.
This is part of a patch series aiming to remove the vmas parameter
altogether.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
=====
Bug 4276500
Change-Id: Ie2833b7aa4e8fef1362694de6e8a27bba553e3d4
Signed-off-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2978634
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Kernel 5.10 support
- Use code from HWPM repo with kernel 5.10 builds.
- Add HWPM source files as built-in driver as IP drivers like PVA,
DLA are built-in and dependent on HWPM for IP registration.
HWPM next chips support
- Currently, only HWPM code in the current (public) repo is included in
compilation on TOT. This patch includes Makefile from HWPM next repo for
next/future chips.
Jira THWPM-69
Change-Id: I8f2bbcabf0c01f2b2cbc722c481a1fe83490c76b
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2921358
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- CONFIG_TEGRA_LINUX_PROD is used to indicate if the build belongs
to that of Prod or Prod_Debug. Use the Config to compile mock
hwpm driver in case of Prod builds. The reason being, IPs like
PVA and NVDLA are dependent on tegra_soc_hwpm_ip_register and
tegra_soc_hwpm_ip_unregister Symbols during boot.
- The packaging files only look for the nvhwpm drivers on
all build flavor. Hence, keep the same name HWPM driver
regardless of how it is build, fully supported or mock.
Bug 4206386
Change-Id: Ic554a7e7a22d55adb802636fd669c7d1fcb82830
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
(cherry picked from commit e2f7b1a75312cfe486d9b256aefa263c151ccb68)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2948941
Tested-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
The config flags defined in Kconfig file are not available/used with
OOT kernel builds. To support all kernel versions, HWPM compiles
independent of CONFIG_TEGRA_SOC_HWPM flag. This also applies to
IP config flags which are not supported as well. Hence,
include HWPM IP files irrespective of the IP config flag status.
For OOT builds, use tegra_is_hypervisor_mode() instead of using
static function defined in HWPM driver.
Bug 4061775
Change-Id: Ifab4ad5c7c652a4ad17820a82b363e92280fdd1a
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2918870
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Building HWPM with Linux v5.14 currently fails because the arguments
passed to the dma_buf_vmap and dma_buf_vunmap functions is incorrect.
The arguments passed to the dma_buf_vmap and dma_buf_vunmap functions
were actually updated in Linux kernel version v5.11 and not v5.15. So
correct the kernel version in the HWPM driver so that the correct
version of the APIs are used for Linux kernels v5.11+.
Finally, drop the kernel version check around the inclusion of module.h
and the import of the module namespace because this is not necessary.
Bug 3918909
Change-Id: I98eef5c69af058abfd5ac925614954404371175c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2860794
(cherry picked from commit 72f00b64c3871e69e7242516849a76bde106ae17)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2888555
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
On production board, MC config details are available through fuses. Add
function to read MC config fuse. Use the floorsweep fuse info to find
available elements.
Bug 3936487
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Change-Id: I9e1549e3dfb9c06d8013ca2e1d43eb21bf0289f4
(cherry picked from commit f38e98a94ab8d478af3ebe1c922da606df9b67dc)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2888554
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- Create tegra_hwpm_element_enable() instead of directly using
perfmon_enable() HAL. This will allow us to expand
tegra_hwpm_element_enable in future.
- Update log messages in ip structure init code and floorsweep info
function.
- It is possible that IP instances and elements to have 0 start range
address. So, modify check for available elements to use range end
instead.
- Use tegra_hwpm_fake_readl() and tegra_hwpm_fake_writel() macros
instead of fake_readl() and fake_write() functions. That way we have
similar implementation of IO functions and macros can be used across
OSes.
- Check that reserve perfmon function is invoked only for HWPM
components. This check will be useful for expansion in types of
components in the future.
- Clean up and rearrange tegra_hwpm_regops_readl_impl() and
tegra_hwpm_regops_writel_impl() to have designated code corresponding to
the element type.
- Currently, device open and release functions are incorrectly using
clock enable/disable functions instead of using HALs. Correct open and
close functions to use lock HALs.
- Currently, tegra_hwpm_update_mem_bytes() doesn't validate mem_mgmt
structure allocation before accessing mem_bytes_kernel pointer. This can
lead to kernel crash. Update tegra_hwpm_update_mem_bytes() to return
error if mem_mgmt structure s not allocated.
Jira THWPM-74
Change-Id: Ia40bd51187e5ea08572dbee81e577dacf5fb66b6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
(cherry picked from commit 411f07484d68dfde0d350a5c67f2748e876b11b8)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2888553
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Add support to make the HWPM driver as module.
Set appropriate path and environment variable
which needs to be passed when building the driver
as module.
Use basic fuse.h file instead of using fuse-helper.h which is not
available in OOT builds.
Introduce HWPM mock file to add definitions for register and
unregister used if HWPM is not compiled in a build.
Bug 4088571
Change-Id: Id6cfb78356d752b963ad7eb16e39b85df92a9a4b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2894547
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Modify OS agnostic files in common, hal and include folder to use MIT
license. This will allow the files to be shared between different OSes.
Modify OS specific files in os/linux and uapi folders to add SPDX
identifier for GPLv2.
Jira THWPM-69
Change-Id: I4fef142354a46fc23b67616204ccf0712a99caec
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2797453
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
HWPM components (PMA, RTR, perfmon) have MMIO address space and a
corresponding virtual address region. It is possible that both MMIO and
virtual addresses are same for an aperture.
MMIO address of an aperture is used in device node to enable the
aperture and further to map HWPM component in the driver.
Virtual addresses are used by the applications to execute regops on HWPM
apertures. Virtual addresses are also used to fake aperture address
space in simulation.
This patch updates
- HWPM aperture structures to include MMIO address.
- aperture ioremap function to use MMIO address values.
- fake register allocation to use virtual address values.
Jira THWPM-41
Change-Id: I05acb68dcb278722cd333e1187b2355d1d739e93
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
(cherry picked from commit 1c0e8107b4cddad7532c10dddc22bb30cef2540b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2853213
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Currently on TOT, stream buffer map functions results in kernel crash.
The kernel crash is an effect of incorrect conditions in the mapping
function. Fix the code logic to use correct kernel version conditions to
use appropriate DMA buffer structures.
Bug 3893741
Change-Id: I3888ec01fdb2025f6d9c3a22296ca9d1abbcadb0
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
(cherry picked from commit 5a3476cfb6574eb5ace29801a4f428ce9d694ce9)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2853211
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Below listed functions are defined and used in the same source file,
hence update the functions to be static.
- tegra_hwpm_element_disable
- tegra_hwpm_element_reserve
- tegra_hwpm_element_release
Bug 3528414
Change-Id: Ib9aa44001fb5fac1e339b3264a4d750af09b9a01
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2847009
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Upstream Linux kernel commit ff62b8e6588f ("driver core: make struct
class.devnode() take a const *") updated the 'devnode' function pointer
under the class structure to take a const device struct. This breaks
building the Tegra HWPM driver with Linux v6.2. Make the necessary
changes to the HWPM driver to fix the build breakage.
Bug 3936429
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I54b7bcefbd5a2e6e88c13b3714ea012cc2a73615
(cherry picked from commit de9dd40f6a4dc35e6ee9e6140cac148171bcd6e1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2847008
Tested-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Kernel version beyond 5.10 introduces dma_buf_map structure (called
iosys_map in later versions). Kernel virtual address corresponding to a
dma_buf is stored in the dma_buf_map structure.
- This patch updates memory management function to use correct mem bytes
buffer kernel virtual address stored in the corresponding dma_buf_map
structure.
- Use dma_buf_map structure pointer to unmap kernel virtual address.
- During release, poll mem bytes buffer with finite timeout value.
- Add description for use of dma_set_mask_and_coherent.
Bug 3893741
Change-Id: I42ace2fe70b36d7d5d1a4c5fee21786826f24a07
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
(cherry picked from commit ce852be6b39ef39affccdee41ad436fc70bf86b5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2847007
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
- HWPM driver requires to know if an IP is available for performance
measurements. The ideal way is for IP driver registration with HWPM
driver. This way IP driver can share required power management and
register access function pointers.
- For IPs that do not have registration mechanism implemented, a
workaround to set an IP enabled is implemented in the HWPM driver.
- In the recent releases, MSS channel, PVA and DLA IPs are the only PORs
for production builds. Currently, this is acheived using the combination
of minimal build and force enable flags.
- However, this implementation limits the number of enabled IPs on TOT
to only minimal expected ones.
- This patch modifies the force enable IP logic implementation to make
force enable and minimal IP flag definition more clear.
- CONFIG_T234_HWPM_ALLOW_FORCE_ENABLE should be used to purposely enable
IPs that do not have registration mechanism implemented. This flag is
used for POR or non-POR IPs. Ideally, all IPs should implement HWPM
registration and force enable flag should not be required.
- CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE should be used to implement logic
for POR IPs. In other words, if CONFIG_TEGRA_HWPM_MINIMAL_IP_ENABLE is
not defined, non-POR IPs should be included in the builds. This patch
sets MINIMAL IP config only for external non-safety builds.
- Fix include t234_perfmon_device_index.h error in t234_mss_mcf.c file.
- Add missing device index for PVA perfmon C0.
Jira THWPM-41
Change-Id: I20651eac14b6d42e5bf3cc5164d1f64ec208dc04
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2818735
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Property support-soc-tools was added mainly to provide user's control to
enable/disable HWPM feature. Since, the same functionality can be
achieved using "status" in device node, support-soc-tools property is
redundant. Hence, this property is removed from HWPM device node.
Update HWPM driver probe to not depend on support-soc-tools property.
JIRA THWPM-48
Change-Id: Ieaa5c77e6c62a59e938832f886c5a82031139ac6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2797449
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Add Device_index tag to read IP perfmon register address
index from ACPI or DTSI tables. Device_index will be
used to retrieve resource information from acpi tables
or device trees. This will replace current logic to
procure resource details using device names.
JIRA THWPM-71
Change-Id: I964546f2262dd77ec0acfb58f49d044c870deae6
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2797448
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Currently, dt_index aperture spec actually holds the element index of
the aperture within the IP instance. Hence, replace dt_index with
element_index to better indicate its purpose.
JIRA THWPM-71
Change-Id: Ic805da3281c60991e7966a80f442d84a2cfcf7cc
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2797447
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
- Make clock reset functions into HALs. This way we can control
clock-reset logic for any chip. Set clock-reset HAL pointers to
appropriate functions.
- Remove clock-reset function wrappers as these will not be required and
corresponding HAL pointers will be used.
- As clock reset init is defined as a HAL, modify probe logic to
initialize chip info before invoking any HALs.
- Move common/primary HAL validation logic to common code and implement
new HAL to validate chip specific HALs. This way we can ensure that HAL
pointers are set as expected.
- Keep only one definition for t234_hwpm_init_chip_info as t234 should
always be initialized and hence only single definition should be
available.
- Expected return value of 0 indicates success and any other value
(mostly negative in current logic) indicates error, compare function
returns with 0 to print error in tegra_hwpm_release().
- Since a build can support both ACPI and device tree, update
init_chip_info() to retrieve chip information from ACPI and device tree
in case of failure.
Jira THWPM-41
Bug 3583624
Change-Id: I03fefae0b3b0c8ce46d175d39e4fdbb45e2bb22f
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2789668
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2797445
- Zeroing of PMA trigger registers is unnecessary. Remove corresponding
logic from HWPM teardown function.
- During device open, add a check for PMA/RTR status. This will ensure
that PMA/RTR are ready to start new profiling session. Device open will
fail if RTR and PMA enginestatus is not ready(idle).
- SOC HWPM driver disables and releases all reserved IPs before teardown
steps. Update teardown logic to zero out IP allowlist registers during
teardown.
Jira THWPM-41
Bug 3714516
Change-Id: Iede5a5ed9860e2a73c8e4a04aeedfc061458c793
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2776229
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2797444
HWPM files are copied from the previous source in linux-nvidia repo
withgit history. Create folders and move files to obtain expected folder
structure.
Bug 3787076
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>