Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: nvboot_bct.h

Issue 6602078: Add the SDRAM parameter header file. (Closed) Base URL: http://git.chromium.org/git/cbootimage.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | nvboot_sdram_param.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. 2 * Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
3 * 3 *
4 * See file CREDITS for list of people who contributed to this 4 * See file CREDITS for list of people who contributed to this
5 * project. 5 * project.
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of 9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * This program is distributed in the hope that it will be useful, 12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details. 15 * GNU General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA 20 * MA 02111-1307 USA
21 */ 21 */
22 22
23 #ifndef INCLUDED_NVBOOT_BCT_H 23 #ifndef INCLUDED_NVBOOT_BCT_H
24 #define INCLUDED_NVBOOT_BCT_H 24 #define INCLUDED_NVBOOT_BCT_H
25 25
26 #include <sys/types.h> 26 #include <sys/types.h>
27 #include "nvboot_sdram_param.h"
27 28
28 /** 29 /**
29 * Defines the number of 32-bit words in the customer_data area of the BCT. 30 * Defines the number of 32-bit words in the customer_data area of the BCT.
30 */ 31 */
31 #define NVBOOT_BCT_CUSTOMER_DATA_WORDS 298 32 #define NVBOOT_BCT_CUSTOMER_DATA_WORDS 298
32 33
33 /** 34 /**
34 * Defines the number of bytes in the customer_data area of the BCT. 35 * Defines the number of bytes in the customer_data area of the BCT.
35 */ 36 */
36 #define NVBOOT_BCT_CUSTOMER_DATA_SIZE \ 37 #define NVBOOT_BCT_CUSTOMER_DATA_SIZE \
37 (NVBOOT_BCT_CUSTOMER_DATA_WORDS * 4) 38 (NVBOOT_BCT_CUSTOMER_DATA_WORDS * 4)
38 39
39 /** 40 /**
40 * Defines the number of bytes in the reserved area of the BCT. 41 * Defines the number of bytes in the reserved area of the BCT.
41 */ 42 */
42 #define NVBOOT_BCT_RESERVED_SIZE 3 43 #define NVBOOT_BCT_RESERVED_SIZE 3
43 44
44 /** 45 /**
45 * Defines the maximum number of bootloader descriptions in the BCT. 46 * Defines the maximum number of bootloader descriptions in the BCT.
46 */ 47 */
47 #define NVBOOT_MAX_BOOTLOADERS 4 48 #define NVBOOT_MAX_BOOTLOADERS 4
48 49
49 #define NVBOOT_BCT_USED_DATA_SIZE 2052
50
51 /** 50 /**
52 * Defines the maximum number of device parameter sets in the BCT. 51 * Defines the maximum number of device parameter sets in the BCT.
53 * The value must be equal to (1 << # of device straps) 52 * The value must be equal to (1 << # of device straps)
54 */ 53 */
55 #define NVBOOT_BCT_MAX_PARAM_SETS 4 54 #define NVBOOT_BCT_MAX_PARAM_SETS 4
56 55
57 /** 56 /**
57 * Defines the maximum number of SDRAM parameter sets in the BCT.
58 * The value must be equal to (1 << # of SDRAM straps)
59 */
60 #define NVBOOT_BCT_MAX_SDRAM_SETS 4
61
62 /**
58 * Defines the number of entries (bits) in the bad block table. 63 * Defines the number of entries (bits) in the bad block table.
59 * The consequences of changing its value are as follows. Using P as the 64 * The consequences of changing its value are as follows. Using P as the
60 * # of physical blocks in the boot loader and B as the value of this 65 * # of physical blocks in the boot loader and B as the value of this
61 * constant: 66 * constant:
62 * B > P: There will be unused storage in the bad block table. 67 * B > P: There will be unused storage in the bad block table.
63 * B < P: The virtual block size will be greater than the physical block 68 * B < P: The virtual block size will be greater than the physical block
64 * size, so the granularity of the bad block table will be less than 69 * size, so the granularity of the bad block table will be less than
65 * one bit per physical block. 70 * one bit per physical block.
66 * 71 *
67 * 4096 bits is enough to represent an 8MiB partition of 2KiB blocks with one 72 * 4096 bits is enough to represent an 8MiB partition of 2KiB blocks with one
(...skipping 24 matching lines...) Expand all
92 enum {NVBOOT_CMAC_AES_HASH_LENGTH = 4}; 97 enum {NVBOOT_CMAC_AES_HASH_LENGTH = 4};
93 98
94 /** 99 /**
95 * Defines the storage for a hash value (128 bits). 100 * Defines the storage for a hash value (128 bits).
96 */ 101 */
97 typedef struct nvboot_hash_rec 102 typedef struct nvboot_hash_rec
98 { 103 {
99 u_int32_t hash[NVBOOT_CMAC_AES_HASH_LENGTH]; 104 u_int32_t hash[NVBOOT_CMAC_AES_HASH_LENGTH];
100 } nvboot_hash; 105 } nvboot_hash;
101 106
107 /// Defines the params that can be configured for NAND devices.
108 typedef struct nvboot_nand_params_rec{
109 /**
110 * Specifies the clock divider for the PLL_P 432MHz source.
111 * If it is set to 18, then clock source to Nand controller is
112 * 432 / 18 = 24MHz.
113 */
114 u_int8_t clock_divider;
115
116 /// Specifies the value to be programmed to Nand Timing Register 1
117 u_int32_t nand_timing;
118
119 /// Specifies the value to be programmed to Nand Timing Register 2
120 u_int32_t nand_timing2;
121
122 /// Specifies the block size in log2 bytes
123 u_int8_t block_size_log2;
124
125 /// Specifies the page size in log2 bytes
126 u_int8_t page_size_log2;
127 } nvboot_nand_params;
128
102 /// Defines various data widths supported. 129 /// Defines various data widths supported.
103 typedef enum 130 typedef enum
104 { 131 {
105 /** 132 /**
106 * Specifies a 1 bit interface to eMMC. 133 * Specifies a 1 bit interface to eMMC.
107 * Note that 1-bit data width is only for the driver's internal use. 134 * Note that 1-bit data width is only for the driver's internal use.
108 * Fuses doesn't provide option to select 1-bit data width. 135 * Fuses doesn't provide option to select 1-bit data width.
109 * The driver selects 1-bit internally based on need. 136 * The driver selects 1-bit internally based on need.
110 * It is used for reading Extended CSD and when the power class 137 * It is used for reading Extended CSD and when the power class
111 * requirements of a card for 4-bit or 8-bit transfers are not 138 * requirements of a card for 4-bit or 8-bit transfers are not
(...skipping 24 matching lines...) Expand all
136 /// Specifies the data bus width. Supported data widths are 4/8 bits. 163 /// Specifies the data bus width. Supported data widths are 4/8 bits.
137 nvboot_sdmmc_data_width data_width; 164 nvboot_sdmmc_data_width data_width;
138 165
139 /** 166 /**
140 * Max Power class supported by the target board. 167 * Max Power class supported by the target board.
141 * The driver determines the best data width and clock frequency 168 * The driver determines the best data width and clock frequency
142 * supported within the power class range (0 to Max) if the selected 169 * supported within the power class range (0 to Max) if the selected
143 * data width cannot be used at the chosen clock frequency. 170 * data width cannot be used at the chosen clock frequency.
144 */ 171 */
145 u_int8_t max_power_class_supported; 172 u_int8_t max_power_class_supported;
146 u_int32_t reserved;
147 } nvboot_sdmmc_params; 173 } nvboot_sdmmc_params;
148 174
149 typedef enum 175 typedef enum
150 { 176 {
151 /// Specifies SPI clock source to be PLLP. 177 /// Specifies SPI clock source to be PLLP.
152 nvboot_spi_clock_source_pllp_out0 = 0, 178 nvboot_spi_clock_source_pllp_out0 = 0,
153 179
154 /// Specifies SPI clock source to be PLLC. 180 /// Specifies SPI clock source to be PLLC.
155 nvboot_spi_clock_source_pllc_out0, 181 nvboot_spi_clock_source_pllc_out0,
156 182
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 * NV_FALSE specifies a NORMAL_READ Command 218 * NV_FALSE specifies a NORMAL_READ Command
193 * NV_TRUE specifies a FAST_READ Command 219 * NV_TRUE specifies a FAST_READ Command
194 */ 220 */
195 u_int8_t read_command_type_fast; 221 u_int8_t read_command_type_fast;
196 } nvboot_spiflash_params; 222 } nvboot_spiflash_params;
197 223
198 /** 224 /**
199 * Defines the union of the parameters required by each device. 225 * Defines the union of the parameters required by each device.
200 */ 226 */
201 typedef union{ 227 typedef union{
228 /// Specifies optimized parameters for NAND
229 nvboot_nand_params nand_params;
202 /// Specifies optimized parameters for eMMC and eSD 230 /// Specifies optimized parameters for eMMC and eSD
203 nvboot_sdmmc_params sdmmc_params; 231 nvboot_sdmmc_params sdmmc_params;
204 /// Specifies optimized parameters for SPI NOR 232 /// Specifies optimized parameters for SPI NOR
205 nvboot_spiflash_params spiflash_params; 233 nvboot_spiflash_params spiflash_params;
206 } nvboot_dev_params; 234 } nvboot_dev_params;
207 235
208 /** 236 /**
209 * Identifies the types of devices from which the system booted. 237 * Identifies the types of devices from which the system booted.
210 * Used to identify primary and secondary boot devices. 238 * Used to identify primary and secondary boot devices.
211 * @note These no longer match the fuse API device values (for 239 * @note These no longer match the fuse API device values (for
212 * backward compatibility with AP15). 240 * backward compatibility with AP15).
213 */ 241 */
214 typedef enum 242 typedef enum
215 { 243 {
216 /// Specifies a default (unset) value. 244 /// Specifies a default (unset) value.
217 nvboot_dev_type_none = 0, 245 nvboot_dev_type_none = 0,
218 246
247 /// Specifies NAND.
248 nvboot_dev_type_nand,
249
219 /// Specifies SPI NOR. 250 /// Specifies SPI NOR.
220 nvboot_dev_type_spi = 3, 251 nvboot_dev_type_spi = 3,
221 252
222 /// Specifies SDMMC (either eMMC or eSD). 253 /// Specifies SDMMC (either eMMC or eSD).
223 nvboot_dev_type_sdmmc, 254 nvboot_dev_type_sdmmc,
224 255
225 nvboot_dev_type_max, 256 nvboot_dev_type_max,
226 257
227 /// Ignore -- Forces compilers to make 32-bit enums. 258 /// Ignore -- Forces compilers to make 32-bit enums.
228 nvboot_dev_type_force32 = 0x7FFFFFFF 259 nvboot_dev_type_force32 = 0x7FFFFFFF
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 { 300 {
270 nvboot_hash crypto_hash; 301 nvboot_hash crypto_hash;
271 nvboot_hash random_aes_blk; 302 nvboot_hash random_aes_blk;
272 u_int32_t boot_data_version; 303 u_int32_t boot_data_version;
273 u_int32_t block_size_log2; 304 u_int32_t block_size_log2;
274 u_int32_t page_size_log2; 305 u_int32_t page_size_log2;
275 u_int32_t partition_size; 306 u_int32_t partition_size;
276 u_int32_t num_param_sets; 307 u_int32_t num_param_sets;
277 nvboot_dev_type dev_type[NVBOOT_BCT_MAX_PARAM_SETS]; 308 nvboot_dev_type dev_type[NVBOOT_BCT_MAX_PARAM_SETS];
278 nvboot_dev_params dev_params[NVBOOT_BCT_MAX_PARAM_SETS]; 309 nvboot_dev_params dev_params[NVBOOT_BCT_MAX_PARAM_SETS];
279 » u_int8_t bct_used_data[NVBOOT_BCT_USED_DATA_SIZE]; 310 » u_int32_t num_sdram_sets;
311 » nvboot_sdram_params sdram_params[NVBOOT_BCT_MAX_SDRAM_SETS];
280 nvboot_badblock_table badblock_table; 312 nvboot_badblock_table badblock_table;
281 u_int32_t bootloader_used; 313 u_int32_t bootloader_used;
282 nv_bootloader_info bootloader[NVBOOT_MAX_BOOTLOADERS]; 314 nv_bootloader_info bootloader[NVBOOT_MAX_BOOTLOADERS];
283 u_int8_t customer_data[NVBOOT_BCT_CUSTOMER_DATA_SIZE]; 315 u_int8_t customer_data[NVBOOT_BCT_CUSTOMER_DATA_SIZE];
284 u_int8_t enable_fail_back; 316 u_int8_t enable_fail_back;
285 u_int8_t reserved[NVBOOT_BCT_RESERVED_SIZE]; 317 u_int8_t reserved[NVBOOT_BCT_RESERVED_SIZE];
286 } nvboot_config_table; 318 } nvboot_config_table;
287 319
288 /** @} */
289 #endif /* #ifndef INCLUDED_NVBOOT_BCT_H */ 320 #endif /* #ifndef INCLUDED_NVBOOT_BCT_H */
OLDNEW
« no previous file with comments | « no previous file | nvboot_sdram_param.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698