OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2007-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 /** |
| 34 * @file |
| 35 * <b>NVIDIA Tegra ODM Kit: |
| 36 * Memory Controller Query Interface</b> |
| 37 * |
| 38 * @b Description: Defines the ODM query interface for Memory Controller. |
| 39 */ |
| 40 |
| 41 #ifndef INCLUDED_NVODM_QUERY_MEMC_H |
| 42 #define INCLUDED_NVODM_QUERY_MEMC_H |
| 43 |
| 44 /** |
| 45 * @defgroup nvodm_memc Memory Controller Query Interface |
| 46 * This is the ODM query interface for memory controller. |
| 47 * @ingroup nvodm_query |
| 48 * @{ |
| 49 */ |
| 50 |
| 51 #include "nvcommon.h" |
| 52 #include "nvodm_query.h" |
| 53 |
| 54 #if defined(__cplusplus) |
| 55 extern "C" |
| 56 { |
| 57 #endif |
| 58 |
| 59 /** |
| 60 * Holds the configuration parameters for asynchronous memory like NOR flash |
| 61 * or Memory Mapped I/O (MIO). |
| 62 */ |
| 63 |
| 64 typedef struct |
| 65 { |
| 66 /// Holds TRUE for enabling access time extension using ROM busy pin. |
| 67 NvBool isRomBusyEnable; |
| 68 |
| 69 /// Holds the dead time in nano seconds between the end of a write access an
d |
| 70 /// the start of the following access (write or read) for NOR/MIO memory. |
| 71 NvU32 WriteDeadTime; |
| 72 |
| 73 /// Holds the access time in nano seconds for which write signal is asserted |
| 74 /// during a write access for MIO/NOR memory. |
| 75 NvU32 WriteAccessTime; |
| 76 |
| 77 /// Holds the dead time in nano seconds between the end of a read access and |
| 78 /// the start of the following access (write or read) for MIO/NOR memory. |
| 79 NvU32 ReadDeadTime; |
| 80 |
| 81 /// Holds the access time in nano seconds for which read signal is asserted |
| 82 /// during a read access. |
| 83 NvU32 ReadAccessTime; |
| 84 |
| 85 } NvOdmAsynchMemConfig; |
| 86 |
| 87 /** |
| 88 * Holds synchronous memory (SDRAM) controller configuration parameters for the |
| 89 * specified SDRAM frequency and controller core voltage. This structure is |
| 90 * assigned fixed revision 1.0. |
| 91 */ |
| 92 typedef struct NvOdmSdramControllerConfigRec |
| 93 { |
| 94 /// Holds the SDRAM frequency in kHz. |
| 95 NvU32 SdramKHz; |
| 96 |
| 97 /// Holds minimum core voltage in mV for memory controller operations at |
| 98 /// the specified SDRAM frequency. Actual core voltage can be set higher by |
| 99 /// DVFS depending on the operation requirements for other SoC modules. |
| 100 NvU32 EmcCoreVoltageMv; |
| 101 |
| 102 /// Holds the memory controller timing parameter 0. |
| 103 NvU32 EmcTiming0; |
| 104 |
| 105 /// Holds the memory controller timing parameter 1. |
| 106 NvU32 EmcTiming1; |
| 107 |
| 108 /// Holds the memory controller timing parameter 2. |
| 109 NvU32 EmcTiming2; |
| 110 |
| 111 /// Holds the memory controller timing parameter 3. |
| 112 NvU32 EmcTiming3; |
| 113 |
| 114 /// Holds the memory controller timing parameter 4. |
| 115 NvU32 EmcTiming4; |
| 116 |
| 117 /// Holds the memory controller timing parameter 5. |
| 118 NvU32 EmcTiming5; |
| 119 |
| 120 /// Holds the memory controller FBIO configuration parameter 6. |
| 121 NvU32 EmcFbioCfg6; |
| 122 |
| 123 /// Holds the memory controller FBIO QSIB delay parameter. |
| 124 NvU32 EmcFbioDqsibDly; |
| 125 |
| 126 /// Holds the emory controller FBIO QUSE delay parameter. |
| 127 NvU32 EmcFbioQuseDly; |
| 128 } NvOdmSdramControllerConfig; |
| 129 |
| 130 /// Defines revision for basic memory controller configuration structure, |
| 131 /// i.e., 0x10 is Rev 1.0. |
| 132 #define NV_EMC_BASIC_REV (0x10) |
| 133 |
| 134 /// Defines maximum number of advanced memory controller timing parameters. |
| 135 #define NV_EMC_ADV_PARAM_NUM_MAX (50) |
| 136 |
| 137 /** |
| 138 * Holds synchronous memory (SDRAM) advanced controller configuration |
| 139 * parameters for the specified SDRAM frequency and controller core voltage. |
| 140 * The revision of this structure is started with 2.0, and it is embedded as |
| 141 * the structure field. |
| 142 */ |
| 143 typedef struct NvOdmSdramControllerConfigAdvRec |
| 144 { |
| 145 /// Holds revision of this structure, e.g., 0x20 is Rev 2.0. |
| 146 NvU32 Revision; |
| 147 |
| 148 /// Holds the SDRAM frequency in kHz. |
| 149 NvU32 SdramKHz; |
| 150 |
| 151 /// Holds minimum core voltage in mV for memory controller operations at |
| 152 /// the specified SDRAM frequency. Actual core voltage can be set higher by |
| 153 /// DVFS depending on the operation requirements for other SoC modules. |
| 154 NvU32 EmcCoreVoltageMv; |
| 155 |
| 156 /// Holds the number of advanced memory controller timing parameters. |
| 157 NvU32 EmcTimingParamNum; |
| 158 |
| 159 /// Holds the advanced memory controller timing parameters. |
| 160 NvU32 EmcTimingParameters[NV_EMC_ADV_PARAM_NUM_MAX]; |
| 161 } NvOdmSdramControllerConfigAdv; |
| 162 |
| 163 /** |
| 164 * Gets the device memory controller configuration. |
| 165 * |
| 166 * @note This function is called early from the boot process where |
| 167 * global variables are not yet valid. Care must be taken not to |
| 168 * use global variables in the implementation of this function. |
| 169 * |
| 170 * @note The implementation of this function must not make reference to |
| 171 * any global or static variables of any kind whatsoever. |
| 172 * |
| 173 * @see NvOdmAsynchMemConfig |
| 174 * |
| 175 * @param ChipSelect The chip select for which configuration |
| 176 * is required: |
| 177 * - 0 means chip select A |
| 178 * - 1 means chip select B |
| 179 * - 2 means chip select C |
| 180 * - and so on. |
| 181 * |
| 182 * @param pMemConfig A pointer to the returned NOR memory configuration. |
| 183 * |
| 184 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 185 * |
| 186 */ |
| 187 NvBool NvOdmQueryAsynchMemConfig(NvU32 ChipSelect, NvOdmAsynchMemConfig *pMemCon
fig); |
| 188 |
| 189 |
| 190 /** |
| 191 * Gets the configuration table that provides SDRAM controller parameters for |
| 192 * the selected set of SDRAM frequencies and controller core voltages. This |
| 193 * table is used by the memory controller DVFS. |
| 194 * |
| 195 * @sa NvOdmSdramControllerConfig structure description for the format of each |
| 196 * table entry, revision 1.0. |
| 197 * @sa NvOdmSdramControllerConfigAdv structure description for the format of |
| 198 * each table entry, revision 2.0. |
| 199 * |
| 200 * @note The maximum scaled SDRAM frequency Fmax is limited by boot configuratio
n |
| 201 * of memory: |
| 202 * <pre> |
| 203 * PLL - PLLM: Fmax = (PLLM boot output frequency)/2 |
| 204 * </pre> |
| 205 * The minimum scaled SDRAM frequency is fixed as |
| 206 * <pre> |
| 207 * Fmin = 12MHz |
| 208 * </pre> |
| 209 * |
| 210 * @par SDRAM Frequency Ladders |
| 211 * |
| 212 * Revision 1.0 - Only entries for Fmax and evenly |
| 213 * divided from Fmax SDRAM frequencies above Fmin are used by DVFS (e.g. Fmax, |
| 214 * Fmax/2, Fmax/4, Fmax/6, etc). All other entries are ignored. Hence, one |
| 215 * table can contain entries for all different PLLM configurations used for the |
| 216 * particular ODM platform, and DVFS will automatically select the frequency lad
der |
| 217 * based on the boot settings. For example, the table can mix entries for Fmax |
| 218 * = 166MHz ladder (166/83/41.5/27.6) and Fmax = 133MHz ladder (133/66.5/33.25/ |
| 219 * 21.16). The table is not required to be sorted in any way. |
| 220 * |
| 221 * Revision 2.0 - Only entries for Fmax and .... |
| 222 * ladders |
| 223 * |
| 224 * The memory controller DVFS is enabled, provided all of the following |
| 225 * conditions are true: |
| 226 * - This function returns a non-NULL pointer to the table. |
| 227 * - The table includes an entry for Fmax SDRAM frequency. |
| 228 * - The table includes an entry for boot SDRAM frequency (if boot configuration |
| 229 * utilizes EMC divider to set initial SDRAM frequency different from Fmax). |
| 230 * This condition is applicable only to Revision 1.0 configuration. |
| 231 * If any of the above conditions are not met, memory controller DVFS will be |
| 232 * disabled and boot SDRAM configuration is preserved during run time. |
| 233 * |
| 234 * @param pEntries A pointer to a variable which this function sets to the |
| 235 * number of entires in the configuration table. |
| 236 * @param pRevision A pointer to a variable which this function sets to the |
| 237 * revision number of the configuration table entry structure. |
| 238 * |
| 239 * @return A const pointer to the configuration table, or NULL if EMC DVFS |
| 240 * is disabled. |
| 241 */ |
| 242 const void* |
| 243 NvOdmQuerySdramControllerConfigGet(NvU32 *pEntries, NvU32 *pRevision); |
| 244 |
| 245 #if defined(__cplusplus) |
| 246 } |
| 247 #endif |
| 248 |
| 249 /** @} */ |
| 250 |
| 251 #endif // INCLUDED_NVODM_QUERY_MEMC_H |
OLD | NEW |