OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2009 NVIDIA Corporation. |
| 3 * All rights reserved. |
| 4 * |
| 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: |
| 7 * |
| 8 * Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. |
| 10 * |
| 11 * Redistributions in binary form must reproduce the above copyright notice, |
| 12 * this list of conditions and the following disclaimer in the documentation |
| 13 * and/or other materials provided with the distribution. |
| 14 * |
| 15 * Neither the name of the NVIDIA Corporation nor the names of its contributors |
| 16 * may be used to endorse or promote products derived from this software |
| 17 * without specific prior written permission. |
| 18 * |
| 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 * POSSIBILITY OF SUCH DAMAGE. |
| 30 * |
| 31 */ |
| 32 |
| 33 #ifndef INCLUDED_nvrm_pinmux_H |
| 34 #define INCLUDED_nvrm_pinmux_H |
| 35 |
| 36 |
| 37 #if defined(__cplusplus) |
| 38 extern "C" |
| 39 { |
| 40 #endif |
| 41 |
| 42 #include "nvrm_module.h" |
| 43 #include "nvrm_init.h" |
| 44 |
| 45 #include "nvodm_modules.h" |
| 46 |
| 47 /** |
| 48 * For each module that has pins (an I/O module), there may be several muxing |
| 49 * configurations. This allows a driver to select or query a particular |
| 50 * configuration per I/O module. I/O modules may be instantiated on the |
| 51 * chip multiple times. |
| 52 * |
| 53 * Certain combinations of modules configurations may not be physically |
| 54 * possible; say that a hypothetical SPI controller configuration 3 uses pins |
| 55 * that are shared by a hypothectial UART configuration 2. Presently, these |
| 56 * conflicting configurations are managed via an external tool provided by |
| 57 * SysEng, which identifies the configurations for the ODM pin-mux tables |
| 58 * depending upon choices made by the ODM. |
| 59 */ |
| 60 |
| 61 /** |
| 62 * Sets the module to tristate configuration. |
| 63 * Use enable to release the pinmux. The pins will be |
| 64 * tri-stated when not in use to save power. |
| 65 * |
| 66 * @param hDevice The RM instance |
| 67 * @param RmModule The module to set |
| 68 * @param EnableTristate NV_TRUE will tristate the specified pins, NV_FALSE will
un-tristate |
| 69 */ |
| 70 |
| 71 NvError NvRmSetModuleTristate( |
| 72 NvRmDeviceHandle hDevice, |
| 73 NvRmModuleID RmModule, |
| 74 NvBool EnableTristate ); |
| 75 |
| 76 /** |
| 77 * Sets an ODM module ID to tristate configuration. Analagous to @see NvRmSetMo
duleTristate, |
| 78 * but indexed based on the ODM module ID, rather than the controller ID. |
| 79 * |
| 80 * @param hDevice The RM instance |
| 81 * @param OdmModule The module to set (should be of type NvOdmIoModule) |
| 82 * @param OdmInstance The instance of the module to set |
| 83 * @param EnableTristate NV_TRUE will tristate the specified pins, NV_FALSE will
un-tristate |
| 84 */ |
| 85 |
| 86 NvError NvRmSetOdmModuleTristate( |
| 87 NvRmDeviceHandle hDevice, |
| 88 NvU32 OdmModule, |
| 89 NvU32 OdmInstance, |
| 90 NvBool EnableTristate ); |
| 91 |
| 92 /** |
| 93 * Configures modules which can provide clock sources to peripherals. |
| 94 * If a Tegra application processor is expected to provide a clock source |
| 95 * to an external peripheral, this API should be called to configure the |
| 96 * clock source and to ensure that its pins are driven prior to attempting |
| 97 * to program the peripheral through a command interface (e.g., SPI). |
| 98 * |
| 99 * @param hDevice The RM instance |
| 100 * @param IoModule The module to set, must be NvOdmIoModule_ExternalClock |
| 101 * @param Instance The instance of the I/O module to be set. |
| 102 * @param Config The pin map configuration for the I/O module. |
| 103 * @param EnableTristate NV_TRUE will tristate the specified clock source, |
| 104 * NV_FALSE will drive it. |
| 105 * |
| 106 * @retval Returns the clock frequency, in KHz, that is output on the |
| 107 * designated pin (or '0' if no clock frequency is specified or found). |
| 108 */ |
| 109 |
| 110 NvU32 NvRmExternalClockConfig( |
| 111 NvRmDeviceHandle hDevice, |
| 112 NvU32 IoModule, |
| 113 NvU32 Instance, |
| 114 NvU32 Config, |
| 115 NvBool EnableTristate ); |
| 116 |
| 117 typedef struct NvRmModuleSdmmcInterfaceCapsRec |
| 118 { |
| 119 |
| 120 /// Maximum bus width supported by the physical interface |
| 121 /// Will be 2, 4 or 8 depending on the selected pin mux |
| 122 NvU32 MmcInterfaceWidth; |
| 123 } NvRmModuleSdmmcInterfaceCaps; |
| 124 |
| 125 typedef struct NvRmModulePcieInterfaceCapsRec |
| 126 { |
| 127 |
| 128 /// Maximum bus type supported by the physical interface |
| 129 /// Will be 4X1 or 2X2 depending on the selected pin mux |
| 130 NvU32 PcieNumEndPoints; |
| 131 NvU32 PcieLanesPerEp; |
| 132 } NvRmModulePcieInterfaceCaps; |
| 133 |
| 134 typedef struct NvRmModulePwmInterfaceCapsRec |
| 135 { |
| 136 |
| 137 /// The OR bits value of PWM Output IDs supported by the |
| 138 /// physical interface depending on the selected pin mux. |
| 139 /// Hence, PwmOutputId_PWM0 = bit 0, PwmOutputId_PWM1 = bit 1, |
| 140 /// PwmOutputId_PWM2 = bit 2, PwmOutputId_PWM3 = bit 3 |
| 141 NvU32 PwmOutputIdSupported; |
| 142 } NvRmModulePwmInterfaceCaps; |
| 143 |
| 144 typedef struct NvRmModuleNandInterfaceCapsRec |
| 145 { |
| 146 |
| 147 /// Maximum bus width supported by the physical interface |
| 148 /// Will be 8 or 16 depending on the selected pin mux |
| 149 NvU8 NandInterfaceWidth; |
| 150 NvBool IsCombRbsyMode; |
| 151 } NvRmModuleNandInterfaceCaps; |
| 152 |
| 153 typedef struct NvRmModuleUartInterfaceCapsRec |
| 154 { |
| 155 |
| 156 /// Maximum number of the interface lines supported by the physical interfac
e. |
| 157 /// Will be 0, 2, 4 or 8 depending on the selected pin mux. |
| 158 /// 0 means there is no physical interface for the uart. |
| 159 /// 2 means only rx/tx lines are supported. |
| 160 /// 4 means only rx/tx/rtx/cts lines are supported. |
| 161 /// 8 means full modem lines are supported. |
| 162 NvU32 NumberOfInterfaceLines; |
| 163 } NvRmModuleUartInterfaceCaps; |
| 164 |
| 165 /** |
| 166 * @brief Query the board-defined capabilities of an I/O controller |
| 167 * |
| 168 * This API will return capabilities for controller modules based on |
| 169 * interface properties defined by ODM query interfaces, such as the |
| 170 * pin mux query. |
| 171 * |
| 172 * pCap should be a pointer to the matching NvRmxxxInterfaceCaps structure |
| 173 * (defined above) for the ModuleId, and CapStructSize should be |
| 174 * the sizeof(structure type). and also should be word aligned. |
| 175 * |
| 176 * @retval NvError_NotSupported if the specified ModuleID does not |
| 177 * exist on the current platform. |
| 178 */ |
| 179 |
| 180 NvError NvRmGetModuleInterfaceCapabilities( |
| 181 NvRmDeviceHandle hRm, |
| 182 NvRmModuleID ModuleId, |
| 183 NvU32 CapStructSize, |
| 184 void* pCaps ); |
| 185 |
| 186 /** |
| 187 * Defines SoC strap groups. |
| 188 */ |
| 189 |
| 190 typedef enum |
| 191 { |
| 192 |
| 193 /// ram_code strap group |
| 194 NvRmStrapGroup_RamCode = 1, |
| 195 NvRmStrapGroup_Num, |
| 196 NvRmStrapGroup_Force32 = 0x7FFFFFFF |
| 197 } NvRmStrapGroup; |
| 198 |
| 199 /** |
| 200 * Gets SoC strap value for the given strap group. |
| 201 * |
| 202 * @param hDevice The RM instance |
| 203 * @param StrapGroup Strap group to be read. |
| 204 * @pStrapValue A pointer to the returned strap group value. |
| 205 * |
| 206 * @retval NvSuccess if strap value is read successfully |
| 207 * @retval NvError_NotSupported if the specified strap group does not |
| 208 * exist on the current SoC. |
| 209 */ |
| 210 |
| 211 NvError NvRmGetStraps( |
| 212 NvRmDeviceHandle hDevice, |
| 213 NvRmStrapGroup StrapGroup, |
| 214 NvU32 * pStrapValue ); |
| 215 |
| 216 /** @} */ |
| 217 |
| 218 #if defined(__cplusplus) |
| 219 } |
| 220 #endif |
| 221 |
| 222 #endif |
OLD | NEW |