This file declares Resource Management (RM) module information and control APIs.
Data Structures | |
| struct | NvRmModuleInfoRec |
| Holds the module information. More... | |
| struct | NvRmModuleCapabilityRec |
| Holds DDK capability encapsualtion. More... | |
Macros | |
| #define | NvRmPrivModuleID_Num NvRmModuleID_Num |
| #define | NVRM_MODULE_0 (0x0) |
| Module bitfields that are compatible with the NV_DRF macros. More... | |
| #define | NVRM_MODULE_0_ID_RANGE 15:0 |
| #define | NVRM_MODULE_0_INSTANCE_RANGE 23:16 |
| #define | NVRM_MODULE_0_BAR_RANGE 27:24 |
| #define | NVRM_MODULE_ID(id, instance) |
| Creates a module ID with a given instance. More... | |
| #define | NVRM_MODULE_ID_MODULE(id) NV_DRF_VAL( NVRM, MODULE, ID, (id) ) |
| Gets the actual module ID. More... | |
| #define | NVRM_MODULE_ID_INSTANCE(id) NV_DRF_VAL( NVRM, MODULE, INSTANCE, (id) ) |
| Gets the instance number of the module ID. More... | |
| #define | NVRM_MODULE_ID_BAR(id) NV_DRF_VAL( NVRM, MODULE, BAR, (id) ) |
| Gets the bar number for the module. More... | |
| #define | NV_RM_CAPS_API_MODULE_PLATFORM (1) |
| Module Capability API tracking API changes. More... | |
| #define | NV_REGR(rm, aperture, offset) NvRegr((rm),(aperture),(offset)) |
| Registers read from hardware. More... | |
| #define | NV_REGW(rm, aperture, offset, data) NvRegw((rm),(aperture),(offset),(data)) |
| Register write to hardware. More... | |
| #define | NV_REGR_MULT(rm, aperture, num, offsets, values) NvRegrm((rm),(aperture),(num),(offsets),(values)) |
| Reads multiple registers from hardware. More... | |
| #define | NV_REGW_MULT(rm, aperture, num, offsets, values) NvRegwm((rm),(aperture),(num),(offsets),(values)) |
| Write multiple registers from hardware. More... | |
| #define | NV_REGW_BLOCK(rm, aperture, num, offset, values) NvRegwb((rm),(aperture),(num),(offset),(values)) |
| Writes a block of registers to hardware. More... | |
| #define | NV_REGR_BLOCK(rm, aperture, num, offset, values) NvRegrb((rm),(aperture),(num),(offset),(values)) |
| Reads a block of registers from hardware. More... | |
Typedefs | |
| typedef struct NvRmModuleIdRec * | NvRmModuleIdHandle |
| typedef struct NvRmModuleInfoRec | NvRmModuleInfo |
| Holds the module information. More... | |
| typedef struct NvRmModuleCapabilityRec | NvRmModuleCapability |
| Holds DDK capability encapsualtion. More... | |
Functions | |
| NvError | NvRmModuleGetModuleInfo (NvRmDeviceHandle hDevice, NvRmModuleID module, NvU32 *pNum, NvRmModuleInfo *pModuleInfo) |
| Returns a list of available module instances and their information. More... | |
| void | NvRmModuleGetBaseAddress (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID Module, NvRmPhysAddr *pBaseAddress, NvU32 *pSize) __DEPRECATED__ |
| Returns a physical address associated with a hardware module. More... | |
| NvError | NvRmFindModule (NvRmDeviceHandle hRmDeviceHandle, NvU32 Address, NvRmModuleIdHandle *phModuleId) |
| Find a module given its physical register address. More... | |
| NvU32 | NvRmModuleGetNumInstances (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID Module) |
| Returns the number of instances of a particular hardware module. More... | |
| void | NvRmModuleReset (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID Module) |
| Resets the module controller hardware. More... | |
| void | NvRmModuleResetWithHold (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID Module, NvBool bHold) |
| Resets the controller with an option to hold the controller in the reset. More... | |
| NvError | NvRmModuleGetCapabilities (NvRmDeviceHandle hDeviceHandle, NvRmModuleID Module, NvRmModuleCapability *pCaps, NvU32 NumCaps, void **Capability) __DEPRECATED__ |
| Returns a pointer to a class-specific capabilities structure. More... | |
| NvError | NvRmQueryChipUniqueId (NvRmDeviceHandle hDevHandle, NvU32 IdSize, void *pId) |
| Queries for the device unique ID. More... | |
| NvError | NvRmGetRandomBytes (NvRmDeviceHandle hRmDeviceHandle, NvU32 NumBytes, void *pBytes) |
| Returns random bytes using hardware sources of entropy. More... | |
| NvError | NvRmCheckValidSecureState (NvRmDeviceHandle hRmDeviceHandle) |
| Returns whether system is a valid SecureOS state. More... | |
| NvError | NvRmCheckValidNVSIState (NvRmDeviceHandle hRmDeviceHandle) |
| Returns whether system is in a valid NVSI state. More... | |
| NvU32 | NvRegr (NvRmDeviceHandle hDeviceHandle, NvRmModuleID aperture, NvU32 offset) |
| void | NvRegw (NvRmDeviceHandle hDeviceHandle, NvRmModuleID aperture, NvU32 offset, NvU32 data) |
| void | NvRegrm (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID aperture, NvU32 num, const NvU32 *offsets, NvU32 *values) |
| void | NvRegwm (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID aperture, NvU32 num, const NvU32 *offsets, const NvU32 *values) |
| void | NvRegwb (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID aperture, NvU32 num, NvU32 offset, const NvU32 *values) |
| void | NvRegrb (NvRmDeviceHandle hRmDeviceHandle, NvRmModuleID aperture, NvU32 num, NvU32 offset, NvU32 *values) |
| #define NV_REGR | ( | rm, | |
| aperture, | |||
| offset | |||
| ) | NvRegr((rm),(aperture),(offset)) |
Registers read from hardware.
The aperture comes from the RM's private module ID enumeration, which is a superset of the public enumeration from nvrm_module.h.
| rm | The RM istance. |
| aperture | The register aperture. |
| offset | The offset inside the aperture. |
Definition at line 787 of file nvrm_module.h.
| #define NV_REGR_BLOCK | ( | rm, | |
| aperture, | |||
| num, | |||
| offset, | |||
| values | |||
| ) | NvRegrb((rm),(aperture),(num),(offset),(values)) |
Reads a block of registers from hardware.
| rm | The resource manager istance. |
| aperture | The register aperture. |
| num | The number of registers. |
| offset | The beginning register offset. |
| values | The register values. |
Definition at line 887 of file nvrm_module.h.
| #define NV_REGR_MULT | ( | rm, | |
| aperture, | |||
| num, | |||
| offsets, | |||
| values | |||
| ) | NvRegrm((rm),(aperture),(num),(offsets),(values)) |
Reads multiple registers from hardware.
| rm | The resource manager istance. |
| aperture | The register aperture. |
| num | The number of registers. |
| offsets | The register offsets. |
| values | The register values. |
Definition at line 836 of file nvrm_module.h.
| #define NV_REGW | ( | rm, | |
| aperture, | |||
| offset, | |||
| data | |||
| ) | NvRegw((rm),(aperture),(offset),(data)) |
Register write to hardware.
The aperture comes from the RM's private module ID enumeration, which is a superset of the public enumeration from nvrm_module.h.
| rm | The resource manager istance. |
| aperture | The register aperture. |
| offset | The offset inside the aperture. |
| data | The data to write. |
Definition at line 806 of file nvrm_module.h.
| #define NV_REGW_BLOCK | ( | rm, | |
| aperture, | |||
| num, | |||
| offset, | |||
| values | |||
| ) | NvRegwb((rm),(aperture),(num),(offset),(values)) |
Writes a block of registers to hardware.
| rm | The resource manager istance. |
| aperture | The register aperture. |
| num | The number of registers. |
| offset | The beginning register offset. |
| values | The register values. |
Definition at line 870 of file nvrm_module.h.
| #define NV_REGW_MULT | ( | rm, | |
| aperture, | |||
| num, | |||
| offsets, | |||
| values | |||
| ) | NvRegwm((rm),(aperture),(num),(offsets),(values)) |
Write multiple registers from hardware.
| rm | The resource manager istance. |
| aperture | The register aperture. |
| num | The number of registers. |
| offsets | The register offsets. |
| values | The register values. |
Definition at line 853 of file nvrm_module.h.
| #define NV_RM_CAPS_API_MODULE_PLATFORM (1) |
Module Capability API tracking API changes.
0 : original API 1 : API changes: NvRmModulePlatform was added to NvRmModuleCapability.
Definition at line 637 of file nvrm_module.h.
| #define NVRM_MODULE_0 (0x0) |
Module bitfields that are compatible with the NV_DRF macros.
Multiple module instances are handled by packing the instance number into the high bits of the module ID. This avoids ponderous APIs with both module IDs and instance numbers.
Definition at line 484 of file nvrm_module.h.
| #define NVRM_MODULE_0_BAR_RANGE 27:24 |
Definition at line 487 of file nvrm_module.h.
| #define NVRM_MODULE_0_ID_RANGE 15:0 |
Definition at line 485 of file nvrm_module.h.
| #define NVRM_MODULE_0_INSTANCE_RANGE 23:16 |
Definition at line 486 of file nvrm_module.h.
| #define NVRM_MODULE_ID | ( | id, | |
| instance | |||
| ) |
Creates a module ID with a given instance.
Definition at line 492 of file nvrm_module.h.
| #define NVRM_MODULE_ID_BAR | ( | id | ) | NV_DRF_VAL( NVRM, MODULE, BAR, (id) ) |
Gets the bar number for the module.
Definition at line 512 of file nvrm_module.h.
| #define NVRM_MODULE_ID_INSTANCE | ( | id | ) | NV_DRF_VAL( NVRM, MODULE, INSTANCE, (id) ) |
Gets the instance number of the module ID.
Definition at line 506 of file nvrm_module.h.
| #define NVRM_MODULE_ID_MODULE | ( | id | ) | NV_DRF_VAL( NVRM, MODULE, ID, (id) ) |
Gets the actual module ID.
Definition at line 500 of file nvrm_module.h.
| #define NvRmPrivModuleID_Num NvRmModuleID_Num |
Definition at line 474 of file nvrm_module.h.
| typedef struct NvRmModuleCapabilityRec NvRmModuleCapability |
Holds DDK capability encapsualtion.
| typedef struct NvRmModuleIdRec* NvRmModuleIdHandle |
Definition at line 446 of file nvrm_module.h.
| typedef struct NvRmModuleInfoRec NvRmModuleInfo |
Holds the module information.
| enum NvRmModuleID |
Defines SOC hardware controller class identifiers.
There is module-ID mapping between userspace and kernelspace. So while adding new entry in this enum, please check if you need it in kernelspace also then add it with same value in enum nvhost_module_id defined in kernel @ $TOP/kernel/include/linux/nvhost.h
Definition at line 68 of file nvrm_module.h.
| enum NvRmModulePlatform |
Defines platform of operation.
| Enumerator | |
|---|---|
| NvRmModulePlatform_Silicon | |
| NvRmModulePlatform_Simulation | |
| NvRmModulePlatform_Emulation | |
| NvRmModulePlatform_Quickturn | |
| NvRmModulePlatform_Num | |
| NvRmModulePlatform_Force32 | |
Definition at line 452 of file nvrm_module.h.
| NvU32 NvRegr | ( | NvRmDeviceHandle | hDeviceHandle, |
| NvRmModuleID | aperture, | ||
| NvU32 | offset | ||
| ) |
| void NvRegrb | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | aperture, | ||
| NvU32 | num, | ||
| NvU32 | offset, | ||
| NvU32 * | values | ||
| ) |
| void NvRegrm | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | aperture, | ||
| NvU32 | num, | ||
| const NvU32 * | offsets, | ||
| NvU32 * | values | ||
| ) |
| void NvRegw | ( | NvRmDeviceHandle | hDeviceHandle, |
| NvRmModuleID | aperture, | ||
| NvU32 | offset, | ||
| NvU32 | data | ||
| ) |
| void NvRegwb | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | aperture, | ||
| NvU32 | num, | ||
| NvU32 | offset, | ||
| const NvU32 * | values | ||
| ) |
| void NvRegwm | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | aperture, | ||
| NvU32 | num, | ||
| const NvU32 * | offsets, | ||
| const NvU32 * | values | ||
| ) |
| NvError NvRmCheckValidNVSIState | ( | NvRmDeviceHandle | hRmDeviceHandle | ) |
Returns whether system is in a valid NVSI state.
| hRmDeviceHandle | The RM device handle. |
| ::NvError_Success | running in a valid configuration |
| ::NvError_NotSupported | running in an invalid configuraton |
| NvError NvRmCheckValidSecureState | ( | NvRmDeviceHandle | hRmDeviceHandle | ) |
Returns whether system is a valid SecureOS state.
| hRmDeviceHandle | The RM device handle. |
| ::NvError_Success | running in a valid configuration |
| ::NvError_NotSupported | running in an invalid configuraton |
| ::NvError_AccessDenied | unable to check configuration |
| NvError NvRmFindModule | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvU32 | Address, | ||
| NvRmModuleIdHandle * | phModuleId | ||
| ) |
Find a module given its physical register address.
| hRmDeviceHandle | The RM device handle. |
| Address | Physical base address of the module's registers |
| phModuleId | Handle to output parameter to hold the Id of the module which also includes the module instance. |
| ::NvError_Success | The module id was successfully identified and phModuleId points to the combined module id and instance. points to the actual size of the ID. . |
| ::NvError_ModuleNotPresent | No module exists at the specified physical base address. |
| ::NvError_BadParameter |
| NvError NvRmGetRandomBytes | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvU32 | NumBytes, | ||
| void * | pBytes | ||
| ) |
Returns random bytes using hardware sources of entropy.
| hRmDeviceHandle | The RM device handle. |
| NumBytes | Number of random bytes to return in pBytes. |
| pBytes | Array where the random bytes should be stored. |
| ::NvError_Success | |
| ::NvError_BadParameter | |
| ::NvError_NotSupported | If no hardware entropy source is available |
| void NvRmModuleGetBaseAddress | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | Module, | ||
| NvRmPhysAddr * | pBaseAddress, | ||
| NvU32 * | pSize | ||
| ) |
Returns a physical address associated with a hardware module.
(To be depcreated and replaced by NvRmModuleGetModuleInfo.)
| hRmDeviceHandle | The RM device handle. |
| Module | The module for which to get addresses. |
| pBaseAddress | A pointer to the beginning of the hardware register bank. |
| pSize | A pointer to the length of the aperture in bytes. |
| NvError NvRmModuleGetCapabilities | ( | NvRmDeviceHandle | hDeviceHandle, |
| NvRmModuleID | Module, | ||
| NvRmModuleCapability * | pCaps, | ||
| NvU32 | NumCaps, | ||
| void ** | Capability | ||
| ) |
Returns a pointer to a class-specific capabilities structure.
Each DDK will supply a list of ::NvRmCapability structures sorted by module Minor and Eco levels (assuming that no DDK supports two Major versions simulatenously). The last cap in the list that matches the hardware's version and eco level will be returned. If the current hardware's eco level is higher than the given module capability list, the last module capability with the highest eco level (the last in the list) will be returned.
| hRmDeviceHandle | The RM device handle. | |
| Module | The target module. | |
| pCaps | A pointer to the capability list. | |
| NumCaps | The number of capabilities in the list. | |
| [out] | Capability | The capability that maches the current hardware. |
| NvError NvRmModuleGetModuleInfo | ( | NvRmDeviceHandle | hDevice, |
| NvRmModuleID | module, | ||
| NvU32 * | pNum, | ||
| NvRmModuleInfo * | pModuleInfo | ||
| ) |
Returns a list of available module instances and their information.
| hDevice | The RM device handle. |
| module | The module for which to get the number of instances. |
| pNum | Unsigned integer indicating the number of module information structures in the array pModuleInfo. |
| pModuleInfo | A pointer to an array of module information structures, where the size of array is determined by the value in pNum. |
| NvSuccess | If successful, or the appropriate error. |
| NvU32 NvRmModuleGetNumInstances | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | Module | ||
| ) |
Returns the number of instances of a particular hardware module.
(To be depcreated and replaced by NvRmModuleGetModuleInfo.)
| hRmDeviceHandle | The RM device handle. |
| Module | The module for which to get the number of instances. |
| void NvRmModuleReset | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | Module | ||
| ) |
Resets the module controller hardware.
| hRmDeviceHandle | The RM device handle. |
| Module | The module to reset. |
| void NvRmModuleResetWithHold | ( | NvRmDeviceHandle | hRmDeviceHandle, |
| NvRmModuleID | Module, | ||
| NvBool | bHold | ||
| ) |
Resets the controller with an option to hold the controller in the reset.
| hRmDeviceHandle | RM device handle. |
| Module | The module to be reset |
| bHold | If NV_TRUE hold the module in reset; if NV_TRUE pulse the reset. So, to keep the module in reset and do something: NvRmModuleResetWithHold(hRm, ModId, NV_TRUE)To update some registers: NvRmModuleResetWithHold(hRm, ModId, NV_FALSE) |
| NvError NvRmQueryChipUniqueId | ( | NvRmDeviceHandle | hDevHandle, |
| NvU32 | IdSize, | ||
| void * | pId | ||
| ) |
Queries for the device unique ID.
| hDevHandle | The RM device handle |
| IdSize | An input, a pointer to a variable containing the size of the caller-allocated memory to hold the unique ID pointed to by pId. Upon successful return, this value is updated to reflect the actual size of the unique ID returned in pId. |
| pId | A pointer to an area of caller-allocated memory to hold the unique ID. |
| ::NvError_Success | pId points to the unique ID and pIdSize points to the actual size of the ID. |
| ::NvError_BadParameter | |
| ::NvError_NotSupported | |
| ::NvError_InsufficientMemory |