Commit Graph

50 Commits

Author SHA1 Message Date
Vedashree Vidwans
c220f9f46f tegra: hwpm: return error from read/write function
Currently, read/write functions validate aperture and mmio address
pointers. However, the error cannot be returned to the parent resulting
into undetected errors.
Modify all read write functions to return error on failure. This will
also allow HWPM driver to know about unavailable IP perfmuxes.

Jira THWPM-41

Change-Id: I6cc4ba7a831d5058657d4f2536b1ce3ab20b30c6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2707446
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
2022-05-17 08:43:13 -07:00
Vedashree Vidwans
8e27814e39 tegra: hwpm: return error for nested open
Currently, nested open for hwpm device node is not allowed. Return
error value of EAGAIN if hwpm device is already open.

Bug 3584058

Change-Id: I2e940620d8da5ddc432628569f839ead6ed490a7
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2707445
Reviewed-by: svcacv <svcacv@nvidia.com>
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
2022-05-17 08:43:07 -07:00
Vedashree Vidwans
3b6a1b35b7 tegra: hwpm: update basic structure layout
Introduced macros to define HWPM aperture types perfmon, perfmux and
broadcast.
Added new enum to define element type.
IP perfmux and IP broadcast are handled in similar way. Whereas, HWPM
perfmux should use HWPM perfmon functions.

Updated hwpm structures are as below
Parent HWPM structure
  -> Active chip structure
     -> Array of IPs
     -> HALs

IP structure
  -> Array of instances
  -> Array of instance info with respect to perfmon, perfmux, broadcast
  -> Instance mask : indicates available instances
  -> reserved status

Instance structure
  -> Array of element info with respect to perfmon, perfmux, broadcast
      -> Array of corresponding element structures
  -> Element mask : indicates available elements in the instance

Element structure
  -> Aperture address details
  -> DT node / MMIO details

Update all functions to use new HWPM structures.

Update hwpm_probe to include force IP enable step.

Jira THWPM-41

Change-Id: I9461063d2136b34e841322c4ddd77a20486424c6
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2706489
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
2022-05-17 08:43:01 -07:00
Vedashree Vidwans
7dd5b5c956 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
2022-05-17 08:42:56 -07:00
Vedashree Vidwans
25f0737897 tegra: hwpm: combine common functionality
- Many HWPM functions are performed on all apertures of all instances of
all IPs. Define below resource utility functions to perform a task on
all IPs, instances and apertures:
  - tegra_hwpm_func_all_IPs
  - tegra_hwpm_func_single_ip
  - tegra_hwpm_func_all_instance
  - tegra_hwpm_func_single_instance
  - tegra_hwpm_func_all_perfmuxes
  - tegra_hwpm_func_all_perfmons
  - tegra_hwpm_func_single_aperture
- Modify below functions to use above mentioned utility functions:
  - get allowlist size
  - combine allowlist
  - reserve resources
  - bind resources
  - release resources

This will make code more legible and maintainable.

This patch also defines new function that validates all HAL
initializations for the chip.

Jira THWPM-41

Change-Id: Icaeba4d94187b97022c0a6626584e7d61ab6d0e4
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2705524
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
2022-05-17 08:42:51 -07:00
Vedashree Vidwans
c5b3d09518 tegra: hwpm: remove force enable of PVA
PVA <-> HWPM interface is ready to be merged.
Remove force enable of PVA in HWPM driver.

Bug 3333034

Change-Id: Ide331e654ac0beaf0bcbdb987b726938927c6d54
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2710503
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-05-11 04:17:13 -07:00
Vedashree Vidwans
ea5e4e406b tegra: hwpm: add HALs to support multiple chip
Add below HALs to make code chip agnostic. This will allow us to use
t234 specific HALs for next chips.
- get_pma_int_idx: get PMA's internal index corresponding to active chip
- get_rtr_int_idx: get RTR's internal index corresponding to active chip
- get_ip_max_idx: get MAX IP index corresponding to active chip

Move chip agnostic code to common files.

Jira THWPM-41

Change-Id: I5518469b1473fe7f66b6517cee729cf46520bbac
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675515
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
2022-04-20 13:26:32 -07:00
Vedashree Vidwans
53f8d0799c tegra: hwpm: update IP registration logic
HWPM supports various IPs which initialize at different times in boot
flow. Some IPs such as MSS, NVLINK initialize before HWPM device and
some IPs (VIC, OFA, NVDEC, NVDLA) are initialized after HWPM device.
Modify IP register function to store registration requests in a
linked list for IPs initialized before HWPM device is probed.
The linked list will be traversed to complete pending IP register
requests after HWPM device is initialized.
- Add struct tegra_hwpm_ip_ops internal to HWPM driver to include only
required ip_ops details.
- Replace init_fs_info HAL with finalize_chip_info to register ip_ops,
force enable IPs (if any).

Jira THWPM-41

Change-Id: I916b4fa50679e79025a941a9c1fc113bdfe92b41
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675472
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
2022-04-20 13:26:26 -07:00
vasukis
09ca7098e4 hwpm: Disable setting fs_info for hypervisor
Set the floorsweeping information for IPs only
if the configuration is non Hypervisor. Force
enable IPs are only valid for native-Linux config.
On hypervisor config, a driver is allowed to only
remap addresses owned by the device node.
Thus, ioremap of perfmux addresses is not allowed
in hypervisor configuration. Add check to prevent
force enable IPs and ioremap in hypervisor
configuration.

JIRA THWPM-45

Change-Id: I8fe6d3c4984c66be5a117e0cc2164ea20a5374cb
Signed-off-by: vasukis <vasukis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2674003
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-04-10 00:08:16 -07:00
Vedashree Vidwans
778356e12d tegra: hwpm: add device_opened flag
Add device_opened flag to indicate device node open success.
Use device_opened flag to allow execution of IOCTL and device teardown
functionality.

Jira THWPM-41

Change-Id: I218a45abed1de9f314cba696fd86c9bd8596cacc
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675514
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-17 19:45:12 -07:00
Vedashree Vidwans
9f2a83a828 tegra: hwpm: fix bugs in force enable IP
Use t234 specific enums to force enable MSS IPs supported by HWPM.
Correct logic to calculate MSS channel fs_info.

Jira THWPM-41

Change-Id: I343cec6f2c9aac78925b1eb441a119d4d6415c38
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2678497
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-15 17:33:06 -07:00
Vedashree Vidwans
bc59377a8f tegra: hwpm: rewrite active ip enum macros
- Update active ip enum flag macros to make it more legible.

Jira THWPM-41

Change-Id: Ic23f39c85080a931128592fef173c2257aa6cf9c
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675470
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
2022-03-15 17:33:00 -07:00
Vedashree Vidwans
9adf6a080d tegra: hwpm: use consistent function names
- Update common function names to tegra_hwpm_* instead of
tegra_soc_hwpm_*.
- Update header guards to follow similar naming guidelines.

Jira THWPM-41

Change-Id: If5ca4f136f5cb6659a99bae42030817142bd242c
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675469
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-15 17:32:54 -07:00
Vedashree Vidwans
edb9e2c245 tegra: hwpm: fix cert-c errors
Fix coding standard cert-c violations because of unsafe calculations.
Introduce safe subtract, add, multiply and cast APIs and use throughout
the hwpm driver.

Bug 3512545

Change-Id: If374629ac75b48a8bc08b1b7a9a41ea5ef0526b1
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2677160
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Prateek Patel <prpatel@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-15 17:32:48 -07:00
Vedashree Vidwans
aaf8e7f5e1 tegra: hwpm: modify floorsweep info for MSS
For MSS channel, hwpm client expects floorsweep info mask to indicate
available MSS chanenel perfmuxes.
HWPM driver would prefer to follow common fs_mask logic for IPs and is
being discussed.
Temporarily update floorsweep info logic for MSS channel, until
floorsweep info IOCTL modifications are finalized.

Bug 3477617

Change-Id: I75b51ccc60151e801dec50fa32b15b951db6e47e
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2672291
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-03-02 09:50:37 -08:00
Vedashree Vidwans
afc8321841 tegra: hwpm: fix bugs in ip_register function
- MSS IPs share combination of MC instances. In other words, not all MC
instances base addresses are available in each MSS IP. Handle this
difference while registering IP instances.

Jira THWPM-41

Change-Id: I82f7c0a3640ebd9af5599c258cb0e8f45dd7eedf
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675471
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
2022-03-02 09:50:22 -08:00
Vedashree Vidwans
7f5bfd3176 tegra: hwpm: resolve coverity defects
Resolve coverity violations:
- Correct invalid arguments in debug prints
- Modify if statement to compare similar data types
- Update tegra_hwpm_map_stream_buffer() return statements.

Bug 3461002

Change-Id: Ic299a594bc371bac4a96a035f31961a586486083
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2675433
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-03-01 00:10:40 -08:00
Vedashree Vidwans
92be6f7a00 tegra: hwpm: restructure HWPM driver
- Update HWPM driver to add HAL layer. This will allow support for multiple chips.
- Add below data structure hierarchy for HWPM driver
HWPM driver structure -> chip info struct -> ip info array -> perfmux/perfmon info array
NOTE: To make commit message more legible, using "aperture" instead of "perfmux and/or perfmon"
- Chip info structure contains
  - Array of IP info
  - HAL function pointers
- IP info structure contains IP specific info
  - Number of instances
  - Number of apertures per instance
  - Aperture ranges, strides, static info array
  - Aperture dynamic arrays
- Aperture info structure contains
  - Hw index
  - Physical address info
  - MMIO address info
- Add separate IP info files
- Create separate files that include logic for allowlist, memory buffer, resources, ip, regops to make functions more legible.
- Move probe, ioctl and io functions to os/linux path.
- Add fn, info, register and verbose debug log levels to controls debug messages
  - add debugfs node to update dbg_mask
- Correct MGBE perfmux base address

Jira THWPM-41

Change-Id: I8ffdaa657789e2a187cbb98502d0359bb57f9c54
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2651377
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-02-09 09:46:25 -08:00
Prateek Patel
96db4ef5ab tegra: hwpm: fix null check Coverity defect
Null-checking inode suggests that it may be null, but it has already
been dereferenced on path leading to the check. Fix it by adding the
null check in correct sequence.

CID 10127947

Bug 3461002

Change-Id: Ib9135bdb67c489fa52f5dda6725d3cbd1faddd1e
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645543
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-01-05 17:25:53 -08:00
Prateek Patel
28bcbc77d2 tegra: hwpm: fix invalid_type Coverity defect
Fix invalid type in argument to printf format specifier.

CID 10127836
CID 10127935

Bug 3461002

Change-Id: Icbc2c55d739c206f0107eff6b9ce4fade07e3755
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2643090
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-01-05 17:25:37 -08:00
Prateek Patel
90a328b59a tegra: hwpm: fix Out-of-bounds read
Overrunning array ioctls of 9 24-byte elements at element index 9 OR
less than 0 by using index ioctl_num. Fix it by returning on failure.

CID 10127854

Bug 3461002

Change-Id: If1774967e28f7042f903027b1a18ce89139306e4
Signed-off-by: Prateek Patel <prpatel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2645564
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-01-04 16:56:20 -08:00
Vedashree Vidwans
fbfb46dc21 tegra: t234: soc hwpm: add ip reg read/write support
If IP driver supports register read/write mechanism
then call register call back for register offset read/write.

Bug 3333031
Bug 3333042

Change-Id: I37e0726edadac9b03d2a5368d0ec7b404cb6dfd3
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2628129
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:18:02 -08:00
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
Seshendra Gadagottu
1dd2527129 tegra: t234: soc hwpm: NULL check for ip dev registration
Add "NULL" check for ip_dev in tegra_soc_hwpm_ip_register
and tegra_soc_hwpm_ip_unregister function.

Also reduced log level to dbg to avoid kernel warning message
for legacy chips to indicate soc_hwpm driver is not available.

Bug 3333031
Bug 3333042

Change-Id: If3a82fdc3ceb0f935750c1fee661828a04c306e9
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2627691
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>
GVS: Gerrit_Virtual_Submit
Tested-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-11-24 15:59:36 -08:00
Vedashree Vidwans
48b63d2e3f tegra: hwpm: t234: update mgbe, display allowlist
Update register offset allowlist for MGBE and display IPs.

Jira THWPM-14

Change-Id: I63c27e0dfcb6a953ce2a722c9f3106b6ad532495
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2618971
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-15 07:27:17 -08:00
Vedashree Vidwans
c7db51d6df tegra: hwpm: separate ip_map for t234
Move ip_maps specific to t234 to a separate file.
This will allow support for multiple chips.
Add new member index_mask to hwpm_resource_aperture structure. The
index_mask will be used to reserve available IP instances.

Jira THWPM-41

Change-Id: Ia20b8d2a176602d8f1d7f077263f66a400c22ee0
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2614690
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-11-15 07:27:11 -08:00
Seshendra Gadagottu
99a6e78975 tegra: t234: soc hwpm: set la_clk to 625MHz
Set la_clk rate to 625MHz. It's default parent
"clk_m" only supports 19.2MHz, set parent clock
to "pllrefe_vcoout_gated" for getting 625MHz.

Bug 3405893

Change-Id: Ifedc55f67f16697f9c0e74dbbc753202c7bc71e7
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2614645
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-29 18:58:03 -07:00
Vedashree Vidwans
aef209f1f5 tegra: soc_hwpm: update soc_hwpm_release logic
Update soc_hwpm IP release logic to invoke hwpm_ip_pm only for reserved
perfmons.

Bug 3333031
Bug 3333042

Change-Id: I78ab369b0803de4ca326603fd97b21ea157c2eae
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2614689
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@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-10-29 01:37:17 -07:00
Sahil Mukund Patki
649b353b01 tegra: soc_hwpm: Fix debugfs compilation errors
The member debugfs_root is only defined in struct tegra_soc_hwpm when
debugfs is enabled. So its use when debugfs is disabled leads to
compilation errors which is seen in function tegra_soc_hwpm_debugfs_init.
This function when debugfs disabled just sets the debugfs_root to NULL.
This has been removed to fix the compilation error.

Bug 200755555

Change-Id: I6e4fa7e330dbe468ba216e98d29d58877e250fa4
Signed-off-by: Sahil Mukund Patki <spatki@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2616087
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2021-10-27 11:58:54 -07:00
Vedashree Vidwans
8c4e714e52 tegra: soc_hwpm: enable available IPs for Si
Enable below IPs for HWPM on Si
- ISP
- VIC
- OFA
- PVA
- NVDLA
- SCF
- NVDEC
- NVENC
- MSS *

Change-Id: Id35cb48ac5447e5b54ff9066a6f38e3f45e103bf
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2601361
Reviewed-by: svcacv <svcacv@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-21 02:49:54 -07:00
Vedashree Vidwans
08cf289cbd tegra: hwpm: t234: use autogenerated regops allowlist
- Replace keyword whitelist with allowlist.
- Update driver to use auto-genrated regops allowlist.
- This will allow support for multiple chips.

Jira THWPM-14

Change-Id: I076ee1b425dfef53650477518c846e9e4d4a9e23
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2605889
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-21 02:49:49 -07:00
Seshendra Gadagottu
a894ff75c0 tegra: hwpm: register hwpm driver early
Register hwpm driver early, so that IP drivers
can register with their callbacks with hwpm driver.
For this, tegra_soc_hwpm_init is registered with
postcore_initcall instead of module_init.

Bug 3333031
Bug 3333042

Change-Id: I6d5f2fbc515f15848d9062e8a25a5b296b5f7a27
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2607266
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-10-15 16:32:45 -07:00
Seshendra Gadagottu
579bc23ee6 tegra: hwpm: add support for SOC HWPM <-> IP interface
Add support for IP registering mechanism for runtime
callback and perfmux read/writes.
void tegra_soc_hwpm_ip_register(struct tegra_soc_hwpm_ip_ops *hwpm_ip_ops);

IP's callback are called to disable and enable IP runtime pm.
At this moment, only VIC/NVENC/OFA driver registration is supported.
Also will take-up perfmux register read/write in follow-up patch.

Bug 3333031
Bug 3333042

Change-Id: If559cae73be1edbdb7139b4183ce3e1dc0943053
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2607267
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-10-14 17:03:53 -07:00
Seshendra Gadagottu
9b5017b5da tegra: t234: hwpm: set appropriate dma_mask bit
On t234, 39-bit addressing is supported.
So, set dma_mask bit to 39 on t234.

Bug 200776516

Change-Id: I5240486c2c930605f9dfff708112982572441f84
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2599497
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-24 03:07:16 -07:00
Vedashree Vidwans
f64c161132 tegra: hwpm: correct pma_enginestatus expected val
During HWPM release, driver checks PMA engine status before disabling IP
perfmons. Correct the computation of pma engine status expected value.

THWPM-2

Change-Id: I7b0e1497efd67610f6daf39cb1fe411e04eeee11
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2586075
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-03 20:27:37 -07:00
Vedashree Vidwans
f7fa0cd28f tegra: hwpm: add IP floorsweep info for silicon
Add floorsweep masks for IPs on silicon. Only verified IPs at the moment
are enabled in the driver.

Bug 3335822

Change-Id: I449d44e4430d273b0680ef9b7f89106df9376d5e
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2585983
Reviewed-by: svcacv <svcacv@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-03 20:27:31 -07:00
Vedashree Vidwans
818008bdaf tegra: hwpm: Update PMMSYS CG2 SLCG field values
Update driver release function to write all SLCG fields of PMMSYS CG2
with prod values which enables SLCG for SOC HWPM HW.
Modify driver open function to correctly disable SLCG through all PMMSYS
CG2 fields.

THWPM-2

Change-Id: Id7f725c0cf3f05179295002479f9422cc99a2297
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2585982
Reviewed-by: svcacv <svcacv@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-03 20:27:24 -07:00
Vedashree Vidwans
93b933c955 tegra: hwpm: move clock-reset assert to func end
Clock/reset should be disabled/asserted after all register accesses.
Move la and hwpm clk/reset disable/assert to the end of
tegra_soc_hwpm_release().

THWPM-2

Change-Id: I8e71ec5a9251bf76d785d0dc23cc4c8edbb5267f
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2585981
Reviewed-by: svcacv <svcacv@nvidia.com>
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-03 20:27:18 -07:00
Vedashree Vidwans
ba34af77a4 tegra: hwpm: update hwpm readl/writel debug prints
Add dt_aperture address to hwpm readl/writel prints, this helps during
debugs.

THWPM-2

Change-Id: I2be3c9a5e2f023673c96e6f261a73117f0e2c6d4
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2585980
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>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-09-03 20:27:12 -07:00
Vedashree Vidwans
8d085e2f74 tegra: hwpm: fix regops ioctl logic
IP perfmon base address value is determined by iomap(). This iomap
address is dependent on many factors like platform, carveout, etc.
Currently, soc hwpm user passes static perfmon addresses to execute
reg ops.
Modify hwpm_resource_aperture struct to hold absolute/static start and
end address of the aperture. These new variables will indicate absolute
register range of the aperture.
Modify reg ops ioctl to determine aperture of given phys addr based on
IP's absolute register range.

Bug 3346199

Change-Id: I73b341633d2c780ad0f126ebc609d65cdb7f6cc9
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2564539
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Krishna Reddy <vdumpa@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-07-29 21:13:51 -07:00
Vedashree Vidwans
3940977659 tegra: hwpm: add floorsweep_info IOCTL
Add floorsweep_info IOCTL for userspace to query IP instance information
This IOCTL will update the floorsweep_info struct with
- status: valid - query ip_type is valid but IP instances are absent
          invalid - query ip_type is invalid
          exists - query ip_type is valid and IP instances are available
- ip_inst_info: 64-bit mask, where each set bit corresponds to available
          IP instance.

All reserving resources depending on IP floorsweep info.

Bug 3335822
Bug 3338138

Change-Id: Ic593186fd0b25ee8c493722b60120eec3c5c4350
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2562757
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Krishna Reddy <vdumpa@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-07-29 21:13:45 -07:00
Vedashree Vidwans
6fb6e2e503 tegra: hwpm: add device_info IOCTL
Add device_info IOCTL for userspace to query current chip's information.
This IOCTL will return a device_info struct with
- chip_id: gives arch id of the chip
- chip_revision: gives chip id revision
- revision: gives major and minor chip revision info
- platform: gives current platform info

Bug 3335823
THWPM-26

Change-Id: I8275a26a812ab7a1b7013ee579f4746d4e5add3d
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2559087
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-07-17 01:05:37 -07:00
Vedashree Vidwans
ae2a1e7dfc tegra: hwpm: redraft regops ioctl return status
- As regops ioctl status is an output from kernel, the status cannot be
invalid. So, remove TEGRA_SOC_HWPM_REG_OP_STATUS_INVALID define.
- Redefine regops ioctl status to make SUCCESS equivalent to value 0.
- Add TEGRA_SOC_HWPM_REG_OP_STATUS_WR_FAILED to indicate failure in
regops write command.

Bug 3335825

Change-Id: I31152f1ce2558fdf4c8829dd19fbcb9c87e20572
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2556234
Reviewed-by: svcacv <svcacv@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-07-16 19:56:52 -07:00
Vedashree Vidwans
492dd01e04 tegra: hwpm: enable clock/reset/unpowergate sequence
Enable clock/reset/unpowergate sequence for silicon.

THWPM-2

Change-Id: I5a9ad97b053b8b8b2409077e99cb206dcc4b544f
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2556233
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-07-16 19:56:47 -07:00
Seshendra Gadagottu
5013f24212 tegra: t234: hwpm: make hwpm driver specific to t234
Change driver compatible string to "nvidia,t234-soc-hwpm".
Make current soc hwpm driver specific to t234 instead of
t23x.

Bug 3341154

Change-Id: I121d9074afc46993514fbb640e7c3ae8e6878827
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2559831
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-07-16 16:41:51 -07:00
Vedashree Vidwans
0cb6f6b48f tegra: hwpm: t234: add generated hw headers
- Generate HWPM hw headers using register generator tool.
- Add required hw headers to include/hw/ path
- Update driver code to replace static hw defines with hw header
definitions.
- Remove unused static hw defines.

THWPM-39

Change-Id: I57566d51657bb6b22c4b581acd257f1871438adf
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2552741
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-07-12 23:35:58 -07:00
Seshendra Gadagottu
78465d56ca t23x: hwpm: fix NULL pointer in exec_reg_ops_ioctl
First do the assignment to reg_op before referring it in
debug print info.

Bug 200702306

Change-Id: Ic0a5ea352793858a746e6fd28759b41e99270be6
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2532594
Tested-by: Vedashree Vidwans <vvidwans@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-05-21 20:01:11 -07:00
Seshendra Gadagottu
ce130e224f t23x: hwpm: fix issue in tegra_soc_hwpm_open
For successful tegra_soc_hwpm_open, return success without
falling through failure case.

Added debug info in tegra_soc_hwpm_open function to
indicate failure case.

Bug 200702306

Change-Id: Ib107d9a89c185d913dc88843e750f36765790bbf
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2532084
Tested-by: Vedashree Vidwans <vvidwans@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-05-21 20:00:32 -07:00
Adeel Raza
4e01e6e523 platform: tegra: hwpm: Remove SCF FIXME
All SCF apertures have been added. Remove the unnecessary FIXME.

Change-Id: Id63ce53a448366a4ba3cdcb60f077d748e5c28be
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2532539
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-05-20 21:36:57 -07:00
Adeel Raza
70941decf9 tegra: hwpm: add SOC HWPM driver
Add a driver for programming the Tegra SOC HWPM path. SOC HWPM allows
performance monitoring of various Tegra IPs.

The profiling tests cases are configured through IOCTLs sent by a
userspace profiling app. The IOCTLs provide the following features:
  - IP discovery and reservation
  - Buffer management
  - Whitelist query
  - Register read/write ops

Bug 200702306
Bug 3305495

Change-Id: I65003b126e01bd03d856767c55aa2424bcfd11fb
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t23x/+/2515148
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2021-05-19 00:33:31 -07:00