Debian Codegraph @

util/nvidia/cbootimage/src/parse.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * See file CREDITS for list of people who contributed to this
17 * project.
18 */
19
20 /*
21 * parse.h - Definitions for the cbootimage parsing code.
22 */
23
24 /*
25 * TODO / Notes
26 * - Add doxygen commentary
27 */
28
29 #ifndef INCLUDED_PARSE_H
30 #define INCLUDED_PARSE_H
31
32 #include "cbootimage.h"
33
34
35 /*
36 * Enums
37 */
38
39 typedef enum
40 {
41 token_none = 0,
42 token_attribute,
43 token_bootloader,
44 token_mts_preboot,
45 token_mts,
46 token_block_size,
47 token_page_size,
48 token_partition_size,
49 token_dev_type,
50 token_dev_param,
51 token_redundancy,
52 token_version,
53 token_odm_data,
54 token_bct_file,
55 token_bct_copy,
56 token_bct_size,
57 token_nand_params,
58 token_sdmmc_params,
59 token_spiflash_params,
60 token_data_width,
61 token_clock_divider,
62 token_clock_source,
63 token_read_command_type_fast,
64 token_max_power_class_supported,
65 token_sd_controller,
66 token_nand_timing2,
67 token_nand_timing,
68 token_block_size_log2,
69 token_page_size_log2,
70 token_nand_async_timing0,
71 token_nand_async_timing1,
72 token_nand_async_timing2,
73 token_nand_async_timing3,
74 token_nand_sddr_timing0,
75 token_nand_sddr_timing1,
76 token_nand_tddr_timing0,
77 token_nand_tddr_timing1,
78 token_nand_fbio_dqsib_dly_byte,
79 token_nand_fbio_quse_dly_byte,
80 token_nand_fbio_cfg_quse_late,
81 token_async_timing0,
82 token_async_timing1,
83 token_async_timing2,
84 token_async_timing3,
85 token_sddr_timing0,
86 token_sddr_timing1,
87 token_tddr_timing0,
88 token_tddr_timing1,
89 token_fbio_dqsib_dly_byte,
90 token_fbio_quse_dly_byte,
91 token_fbio_cfg_quse_late,
92 token_disable_sync_ddr,
93 token_nand_disable_sync_ddr,
94 token_sdram,
95 token_crypto_hash,
96 token_random_aes_blk,
97 token_boot_data_version,
98 token_bootloader_used,
99 token_bootloaders_max,
100 token_reserved,
101 token_reserved_size,
102 token_reserved_offset,
103 token_hash_size,
104 token_crypto_offset,
105 token_crypto_length,
106 token_max_bct_search_blks,
107 token_num_param_sets,
108 token_dev_type_nand,
109 token_dev_type_sdmmc,
110 token_dev_type_spi,
111 token_num_sdram_sets,
112 token_pre_bct_pad_blocks,
113 token_unique_chip_id,
114 token_secure_jtag_control,
115 token_secure_debug_control,
116
117 token_rsa_key_modulus,
118 token_rsa_pss_sig_bl,
119 token_rsa_pss_sig_bct,
120 token_sign_bl,
121
122 token_nand_clock_divider,
123 token_nand_nand_timing,
124 token_nand_nand_timing2,
125 token_nand_block_size_log2,
126 token_nand_page_size_log2,
127 token_sdmmc_clock_divider,
128 token_sdmmc_data_width,
129 token_sdmmc_multi_page_support,
130 token_sdmmc_sd_controller,
131 token_sdmmc_max_power_class_supported,
132 token_spiflash_read_command_type_fast,
133 token_spiflash_page_size_2k_or_16k,
134 token_spiflash_clock_source,
135 token_spiflash_clock_divider,
136 token_sdmmc_data_width_4bit,
137 token_sdmmc_data_width_8bit,
138 token_spi_clock_source_pllp_out0,
139 token_spi_clock_source_pllc_out0,
140 token_spi_clock_source_pllm_out0,
141 token_spi_clock_source_clockm,
142 token_memory_type_none,
143 token_memory_type_ddr,
144 token_memory_type_lpddr,
145 token_memory_type_ddr2,
146 token_memory_type_lpddr2,
147 token_memory_type_ddr3,
148 token_memory_type_lpddr4,
149
150 token_bl_version,
151 token_bl_start_blk,
152 token_bl_start_page,
153 token_bl_length,
154 token_bl_load_addr,
155 token_bl_entry_point,
156 token_bl_attribute,
157 token_bl_crypto_hash,
158
159 token_memory_type,
160 token_pllm_charge_pump_setup_ctrl,
161 token_pllm_loop_filter_setup_ctrl,
162 token_pllm_input_divider,
163 token_pllm_feedback_divider,
164 token_pllm_post_divider,
165 token_pllm_stable_time,
166 token_pllm_setup_control,
167 token_pllm_select_div2,
168 token_pllm_pdlshift_ph45,
169 token_pllm_pdlshift_ph90,
170 token_pllm_pdlshift_ph135,
171 token_pllm_kcp,
172 token_pllm_kvco,
173 token_emc_bct_spare0,
174 token_emc_bct_spare1,
175 token_emc_bct_spare2,
176 token_emc_bct_spare3,
177 token_emc_bct_spare4,
178 token_emc_bct_spare5,
179 token_emc_bct_spare6,
180 token_emc_bct_spare7,
181 token_emc_bct_spare8,
182 token_emc_bct_spare9,
183 token_emc_bct_spare10,
184 token_emc_bct_spare11,
185 token_emc_bct_spare12,
186 token_emc_bct_spare13,
187 token_emc_clock_divider,
188 token_emc_auto_cal_interval,
189 token_emc_auto_cal_config,
190 token_emc_auto_cal_config2,
191 token_emc_auto_cal_config3,
192 token_emc_auto_cal_wait,
193
194 token_emc_xm2_comp_pad_ctrl,
195 token_emc_xm2_comp_pad_ctrl2,
196 token_emc_xm2_comp_pad_ctrl3,
197
198 token_emc_pin_program_wait,
199 token_emc_rc,
200 token_emc_rfc,
201
202 token_emc_rfc_pb,
203 token_emc_ref_ctrl2,
204
205 token_emc_rfc_slr,
206 token_emc_ras,
207 token_emc_rp,
208 token_emc_r2r,
209 token_emc_w2w,
210 token_emc_r2w,
211 token_emc_w2r,
212 token_emc_r2p,
213 token_emc_w2p,
214
215 token_emc_tppd,
216 token_emc_ccdmw,
217
218 token_emc_rd_rcd,
219 token_emc_wr_rcd,
220 token_emc_rrd,
221 token_emc_rext,
222 token_emc_wdv,
223
224 token_emc_wdv_chk,
225 token_emc_wsv,
226 token_emc_wev,
227
228 token_emc_wdv_mask,
229
230 token_emc_ws_duration,
231 token_emc_we_duration,
232
233 token_emc_quse,
234 token_emc_quse_width,
235 token_emc_ibdly,
236
237 token_emc_obdly,
238
239 token_emc_einput,
240 token_emc_einput_duration,
241 token_emc_puterm_extra,
242 token_emc_puterm_width,
243 token_emc_puterm_adj,
244 token_emc_cdb_cntl1,
245 token_emc_cdb_cntl2,
246 token_emc_cdb_cntl3,
247 token_emc_qrst,
248 token_emc_qsafe,
249 token_emc_rdv,
250 token_emc_rdv_mask,
251
252 token_emc_rdv_early,
253 token_emc_rdv_early_mask,
254
255 token_emc_qpop,
256 token_emc_refresh,
257 token_emc_burst_refresh_num,
258 token_emc_pdex2wr,
259 token_emc_pdex2rd,
260 token_emc_pchg2pden,
261 token_emc_act2pden,
262 token_emc_ar2pden,
263 token_emc_rw2pden,
264
265 token_emc_cke2pden,
266 token_emc_pdex2che,
267 token_emc_pdex2mrr,
268
269 token_emc_txsr,
270 token_emc_tcke,
271 token_emc_tckesr,
272 token_emc_tpd,
273 token_emc_tfaw,
274 token_emc_trpab,
275 token_emc_tclkstable,
276 token_emc_tclkstop,
277 token_emc_trefbw,
278 token_emc_quse_extra,
279 token_emc_fbio_cfg5,
280 token_emc_fbio_cfg6,
281
282 token_emc_fbio_cfg7,
283 token_emc_fbio_cfg8,
284
285 /* Command mapping for CMD brick 0 */
286 token_emc_cmd_mapping_cmd0_0,
287 token_emc_cmd_mapping_cmd0_1,
288 token_emc_cmd_mapping_cmd0_2,
289 token_emc_cmd_mapping_cmd1_0,
290 token_emc_cmd_mapping_cmd1_1,
291 token_emc_cmd_mapping_cmd1_2,
292 token_emc_cmd_mapping_cmd2_0,
293 token_emc_cmd_mapping_cmd2_1,
294 token_emc_cmd_mapping_cmd2_2,
295 token_emc_cmd_mapping_cmd3_0,
296 token_emc_cmd_mapping_cmd3_1,
297 token_emc_cmd_mapping_cmd3_2,
298 token_emc_cmd_mapping_byte,
299
300 token_emc_fbio_spare,
301 token_emc_mrs,
302 token_emc_emrs,
303 token_emc_emrs2,
304 token_emc_emrs3,
305 token_emc_mrw1,
306 token_emc_mrw2,
307 token_emc_mrw3,
308 token_emc_mrw4,
309
310 /* Specifies the programming to LPDDR4 Mode Register 3 at cold boot */
311 token_emc_mrw6,
312 /* Specifies the programming to LPDDR4 Mode Register 11 at cold boot */
313 token_emc_mrw8,
314 /* Specifies the programming to LPDDR4 Mode Register 11 at cold boot */
315 token_emc_mrw9,
316 /* Specifies the programming to LPDDR4 Mode Register 12 at cold boot */
317 token_emc_mrw10,
318 /* Specifies the programming to LPDDR4 Mode Register 14 at cold boot */
319 token_emc_mrw12,
320 /* Specifies the programming to LPDDR4 Mode Register 14 at cold boot */
321 token_emc_mrw13,
322 /* Specifies the programming to LPDDR4 Mode Register 22 at cold boot */
323 token_emc_mrw14,
324
325 token_emc_mrw_reset_command,
326 token_emc_mrw_reset_ninit_wait,
327 token_emc_adr_cfg,
328 token_mc_emem_cfg,
329 token_emc_cfg,
330 token_emc_cfg2,
331 token_emc_cfg_pipe,
332
333 token_emc_cfg_pipe_clk,
334 token_emc_fdpd_ctrl_cmd_no_ramp,
335 token_emc_cfg_update,
336
337 token_emc_dbg,
338
339 token_emc_dbg_write_mux,
340
341 token_emc_cfg_dig_dll,
342 token_emc_cfg_dig_dll_1,
343 token_emc_cfg_dig_dll_period,
344 token_warm_boot_wait,
345 token_emc_ctt_term_ctrl,
346 token_emc_odt_write,
347 token_emc_odt_read,
348 token_emc_zcal_ref_cnt,
349 token_emc_zcal_wait_cnt,
350 token_emc_zcal_mrw_cmd,
351 token_emc_mrs_reset_dll,
352 token_emc_mrs_reset_dll_wait,
353 token_emc_emrs_emr2,
354 token_emc_emrs_emr3,
355 token_emc_emrs_ddr2_dll_enable,
356 token_emc_mrs_ddr2_dll_reset,
357 token_emc_emrs_ddr2_ocd_calib,
358 token_emc_ddr2_wait,
359 token_pmc_ddr_pwr,
360
361 token_emc_fbio_cfg1,
362 token_emc_fbio_dqsib_dly,
363 token_emc_fbio_dqsib_dly_msb,
364 token_emc_fbio_quse_dly,
365 token_emc_fbio_quse_dly_msb,
366 token_emc_adr_cfg1,
367 token_mc_lowlatency_config,
368 token_emc_cfg_clktrim0,
369 token_emc_cfg_clktrim1,
370 token_emc_cfg_clktrim2,
371 token_ahb_arbitration_xbar_ctrl,
372 token_emc_dll_xform_dqs,
373 token_emc_dll_xform_quse,
374 token_emc_mrw_zq_init_dev0,
375 token_emc_mrw_zq_init_dev1,
376 token_emc_mrw_zq_init_wait,
377 token_apb_misc_gp_xm2cfga_pad_ctrl,
378 token_apb_misc_gp_xm2cfgc_pad_ctrl,
379 token_apb_misc_gp_xm2cfgc_pad_ctrl2,
380 token_apb_misc_gp_xm2cfgd_pad_ctrl,
381 token_apb_misc_gp_xm2cfgd_pad_ctrl2,
382 token_apb_misc_gp_xm2clkcfg_Pad_ctrl,
383 token_apb_misc_gp_xm2comp_pad_ctrl,
384 token_apb_misc_gp_xm2vttgen_pad_ctrl,
385
386 token_emc_clock_source,
387
388 token_emc_clock_source_dll,
389 token_clk_rst_pllm_misc20_override,
390 token_clk_rst_pllm_misc20_override_enable,
391 token_clear_clock2_mc1,
392
393 token_emc_clock_use_pll_mud,
394 token_emc_pin_extra_wait,
395
396 token_emc_pin_gpio_enable,
397 token_emc_pin_gpio,
398
399 token_emc_timing_control_wait,
400 token_emc_wext,
401 token_emc_ctt,
402 token_emc_ctt_duration,
403 token_emc_prerefresh_req_cnt,
404 token_emc_txsr_dll,
405 token_emc_cfg_rsv,
406 token_emc_mrw_extra,
407 token_emc_warm_boot_mrw1,
408 token_emc_warm_boot_mrw2,
409 token_emc_warm_boot_mrw3,
410 token_emc_warm_boot_mrw_extra,
411 token_emc_warm_boot_extramode_reg_write_enable,
412 token_emc_extramode_reg_write_enable,
413 token_emc_mrs_wait_cnt,
414 token_emc_mrs_wait_cnt2,
415 token_emc_cmd_q,
416 token_emc_mc2emc_q,
417 token_emc_dyn_self_ref_control,
418 token_ahb_arbitration_xbar_ctrl_meminit_done,
419 token_emc_dev_select,
420 token_emc_sel_dpd_ctrl,
421
422 /* Pads trimmer delays */
423 token_emc_fdpd_ctrl_dq,
424 token_emc_fdpd_ctrl_cmd,
425 token_emc_pmacro_ib_vref_dq_0,
426 token_emc_pmacro_ib_vref_dq_1,
427 token_emc_pmacro_ib_vref_dqs_0,
428 token_emc_pmacro_ib_vref_dqs_1,
429 token_emc_pmacro_ib_rxrt,
430 token_emc_cfg_pipe1,
431 token_emc_cfg_pipe2,
432
433 /* Specifies the value for EMC_PMACRO_QUSE_DDLL_RANK0_0 */
434 token_emc_pmacro_quse_ddll_rank0_0,
435 token_emc_pmacro_quse_ddll_rank0_1,
436 token_emc_pmacro_quse_ddll_rank0_2,
437 token_emc_pmacro_quse_ddll_rank0_3,
438 token_emc_pmacro_quse_ddll_rank0_4,
439 token_emc_pmacro_quse_ddll_rank0_5,
440 token_emc_pmacro_quse_ddll_rank1_0,
441 token_emc_pmacro_quse_ddll_rank1_1,
442 token_emc_pmacro_quse_ddll_rank1_2,
443 token_emc_pmacro_quse_ddll_rank1_3,
444 token_emc_pmacro_quse_ddll_rank1_4,
445 token_emc_pmacro_quse_ddll_rank1_5,
446
447 token_emc_pmacro_ob_ddll_long_dq_rank0_0,
448 token_emc_pmacro_ob_ddll_long_dq_rank0_1,
449 token_emc_pmacro_ob_ddll_long_dq_rank0_2,
450 token_emc_pmacro_ob_ddll_long_dq_rank0_3,
451 token_emc_pmacro_ob_ddll_long_dq_rank0_4,
452 token_emc_pmacro_ob_ddll_long_dq_rank0_5,
453 token_emc_pmacro_ob_ddll_long_dq_rank1_0,
454 token_emc_pmacro_ob_ddll_long_dq_rank1_1,
455 token_emc_pmacro_ob_ddll_long_dq_rank1_2,
456 token_emc_pmacro_ob_ddll_long_dq_rank1_3,
457 token_emc_pmacro_ob_ddll_long_dq_rank1_4,
458 token_emc_pmacro_ob_ddll_long_dq_rank1_5,
459
460 token_emc_pmacro_ob_ddll_long_dqs_rank0_0,
461 token_emc_pmacro_ob_ddll_long_dqs_rank0_1,
462 token_emc_pmacro_ob_ddll_long_dqs_rank0_2,
463 token_emc_pmacro_ob_ddll_long_dqs_rank0_3,
464 token_emc_pmacro_ob_ddll_long_dqs_rank0_4,
465 token_emc_pmacro_ob_ddll_long_dqs_rank0_5,
466 token_emc_pmacro_ob_ddll_long_dqs_rank1_0,
467 token_emc_pmacro_ob_ddll_long_dqs_rank1_1,
468 token_emc_pmacro_ob_ddll_long_dqs_rank1_2,
469 token_emc_pmacro_ob_ddll_long_dqs_rank1_3,
470 token_emc_pmacro_ob_ddll_long_dqs_rank1_4,
471 token_emc_pmacro_ob_ddll_long_dqs_rank1_5,
472
473 token_emc_pmacro_ib_ddll_long_dqs_rank0_0,
474 token_emc_pmacro_ib_ddll_long_dqs_rank0_1,
475 token_emc_pmacro_ib_ddll_long_dqs_rank0_2,
476 token_emc_pmacro_ib_ddll_long_dqs_rank0_3,
477 token_emc_pmacro_ib_ddll_long_dqs_rank1_0,
478 token_emc_pmacro_ib_ddll_long_dqs_rank1_1,
479 token_emc_pmacro_ib_ddll_long_dqs_rank1_2,
480 token_emc_pmacro_ib_ddll_long_dqs_rank1_3,
481
482 token_emc_pmacro_ddll_long_cmd_0,
483 token_emc_pmacro_ddll_long_cmd_1,
484 token_emc_pmacro_ddll_long_cmd_2,
485 token_emc_pmacro_ddll_long_cmd_3,
486 token_emc_pmacro_ddll_long_cmd_4,
487 token_emc_pmacro_ddll_short_cmd_0,
488 token_emc_pmacro_ddll_short_cmd_1,
489 token_emc_pmacro_ddll_short_cmd_2,
490
491 token_emc_dll_xform_dqs0,
492 token_emc_dll_xform_dqs1,
493 token_emc_dll_xform_dqs2,
494 token_emc_dll_xform_dqs3,
495 token_emc_dll_xform_dqs4,
496 token_emc_dll_xform_dqs5,
497 token_emc_dll_xform_dqs6,
498 token_emc_dll_xform_dqs7,
499 token_emc_dll_xform_dqs8,
500 token_emc_dll_xform_dqs9,
501 token_emc_dll_xform_dqs10,
502 token_emc_dll_xform_dqs11,
503 token_emc_dll_xform_dqs12,
504 token_emc_dll_xform_dqs13,
505 token_emc_dll_xform_dqs14,
506 token_emc_dll_xform_dqs15,
507 token_emc_dll_xform_quse0,
508 token_emc_dll_xform_quse1,
509 token_emc_dll_xform_quse2,
510 token_emc_dll_xform_quse3,
511 token_emc_dll_xform_quse4,
512 token_emc_dll_xform_quse5,
513 token_emc_dll_xform_quse6,
514 token_emc_dll_xform_quse7,
515 token_emc_dll_xform_addr0,
516 token_emc_dll_xform_addr1,
517 token_emc_dll_xform_addr2,
518 token_emc_dll_xform_addr3,
519 token_emc_dll_xform_addr4,
520 token_emc_dll_xform_addr5,
521 token_emc_dll_xform_quse8,
522 token_emc_dll_xform_quse9,
523 token_emc_dll_xform_quse10,
524 token_emc_dll_xform_quse11,
525 token_emc_dll_xform_quse12,
526 token_emc_dll_xform_quse13,
527 token_emc_dll_xform_quse14,
528 token_emc_dll_xform_quse15,
529 token_emc_dli_trim_tx_dqs0,
530 token_emc_dli_trim_tx_dqs1,
531 token_emc_dli_trim_tx_dqs2,
532 token_emc_dli_trim_tx_dqs3,
533 token_emc_dli_trim_tx_dqs4,
534 token_emc_dli_trim_tx_dqs5,
535 token_emc_dli_trim_tx_dqs6,
536 token_emc_dli_trim_tx_dqs7,
537 token_emc_dli_trim_tx_dqs8,
538 token_emc_dli_trim_tx_dqs9,
539 token_emc_dli_trim_tx_dqs10,
540 token_emc_dli_trim_tx_dqs11,
541 token_emc_dli_trim_tx_dqs12,
542 token_emc_dli_trim_tx_dqs13,
543 token_emc_dli_trim_tx_dqs14,
544 token_emc_dli_trim_tx_dqs15,
545 token_emc_dll_xform_dq0,
546 token_emc_dll_xform_dq1,
547 token_emc_dll_xform_dq2,
548 token_emc_dll_xform_dq3,
549 token_emc_dll_xform_dq4,
550 token_emc_dll_xform_dq5,
551 token_emc_dll_xform_dq6,
552 token_emc_dll_xform_dq7,
553 token_emc_zcal_interval,
554 token_emc_zcal_init_dev0,
555 token_emc_zcal_init_dev1,
556 token_emc_zcal_init_wait,
557 token_emc_zcal_cold_boot_enable,
558 token_emc_zcal_warm_boot_enable,
559 token_emc_zcal_warm_cold_boot_enables,
560 token_emc_mrw_lpddr2zcal_warm_boot,
561 token_emc_zqcal_ddr3_warm_boot,
562 token_emc_zqcal_lpddr4_warm_boot,
563 token_emc_zcal_warm_boot_wait,
564 token_emc_mrs_warm_boot_enable,
565 token_emc_mrs_extra,
566 token_emc_warm_boot_mrs,
567 token_emc_warm_boot_emrs,
568 token_emc_warm_boot_emr2,
569 token_emc_warm_boot_emr3,
570 token_emc_warm_boot_mrs_extra,
571 token_emc_clken_override,
572 token_mc_dis_extra_snap_levels,
573 token_emc_extra_refresh_num,
574 token_emc_clken_override_allwarm_boot,
575 token_mc_clken_override_allwarm_boot,
576 token_emc_cfg_dig_dll_period_warm_boot,
577 token_pmc_vddp_sel,
578 token_pmc_vddp_sel_wait,
579 token_pmc_ddr_cfg,
580 token_pmc_io_dpd_req,
581 token_pmc_io_dpd2_req,
582 token_pmc_io_dpd3_req,
583 token_pmc_io_dpd3_req_wait,
584 token_pmc_io_dpd4_req_wait,
585 token_pmc_reg_short,
586 token_pmc_eno_vtt_gen,
587 token_pmc_no_io_power,
588
589 token_pmc_ddr_ctrl_wait,
590 token_pmc_ddr_ctrl,
591
592 token_pmc_por_dpd_ctrl_wait,
593 token_emc_xm2cmd_pad_ctrl,
594 token_emc_xm2cmd_pad_ctrl2,
595 token_emc_xm2cmd_pad_ctrl3,
596 token_emc_xm2cmd_pad_ctrl4,
597 token_emc_xm2cmd_pad_ctrl5,
598 token_emc_xm2dqs_pad_ctrl,
599 token_emc_xm2dqs_pad_ctrl2,
600 token_emc_xm2dqs_pad_ctrl3,
601 token_emc_xm2dqs_pad_ctrl4,
602 token_emc_xm2dqs_pad_ctrl5,
603 token_emc_xm2dqs_pad_ctrl6,
604 token_emc_xm2dq_pad_ctrl,
605 token_emc_xm2dq_pad_ctrl2,
606 token_emc_xm2dq_pad_ctrl3,
607 token_emc_xm2clk_pad_ctrl,
608 token_emc_xm2clk_pad_ctrl2,
609 token_emc_xm2comp_pad_ctrl,
610 token_emc_xm2vttgen_pad_ctrl,
611 token_emc_xm2vttgen_pad_ctrl2,
612 token_emc_xm2vttgen_pad_ctrl3,
613 token_emc_xm2quse_pad_ctrl,
614 token_emc_acpd_control,
615 token_emc_swizzle_rank0_byte_cfg,
616 token_emc_swizzle_rank0_byte0,
617 token_emc_swizzle_rank0_byte1,
618 token_emc_swizzle_rank0_byte2,
619 token_emc_swizzle_rank0_byte3,
620 token_emc_swizzle_rank1_byte_cfg,
621 token_emc_swizzle_rank1_byte0,
622 token_emc_swizzle_rank1_byte1,
623 token_emc_swizzle_rank1_byte2,
624 token_emc_swizzle_rank1_byte3,
625 token_emc_addr_swizzle_stack1a,
626 token_emc_addr_swizzle_stack1b,
627 token_emc_addr_swizzle_stack2a,
628 token_emc_addr_swizzle_stack2b,
629 token_emc_addr_swizzle_stack3,
630 token_emc_dsr_vttgen_drv,
631 token_emc_txdsrvttgen,
632
633 /* Specifies the value for EMC_DATA_BRLSHFT_0 */
634 token_emc_data_brlshft0,
635 token_emc_data_brlshft1,
636
637 token_emc_dqs_brlshft0,
638 token_emc_dqs_brlshft1,
639
640 token_emc_cmd_brlshft0,
641 token_emc_cmd_brlshft1,
642 token_emc_cmd_brlshft2,
643 token_emc_cmd_brlshft3,
644
645 token_emc_quse_brlshft0,
646 token_emc_quse_brlshft1,
647 token_emc_quse_brlshft2,
648 token_emc_quse_brlshft3,
649
650 token_emc_dll_cfg0,
651 token_emc_dll_cfg1,
652
653 token_emc_pmc_scratch1,
654 token_emc_pmc_scratch2,
655 token_emc_pmc_scratch3,
656
657 token_emc_pmacro_pad_cfg_ctrl,
658
659 token_emc_pmacro_vttgen_ctrl0,
660 token_emc_pmacro_vttgen_ctrl1,
661 token_emc_pmacro_vttgen_ctrl2,
662
663 token_emc_pmacro_brick_ctrl_rfu1,
664 token_emc_pmacro_cmd_brick_ctrl_fdpd,
665 token_emc_pmacro_brick_ctrl_rfu2,
666 token_emc_pmacro_data_brick_ctrl_fdpd,
667 token_emc_pmacro_bg_bias_ctrl0,
668 token_emc_pmacro_data_pad_rx_ctrl,
669 token_emc_pmacro_cmd_pad_rx_ctrl,
670 token_emc_pmacro_data_rx_term_mode,
671 token_emc_pmacro_cmd_rx_term_mode,
672 token_emc_pmacro_data_pad_tx_ctrl,
673 token_emc_pmacro_common_pad_tx_ctrl,
674 token_emc_pmacro_cmd_pad_tx_ctrl,
675 token_emc_cfg3,
676
677 token_emc_pmacro_tx_pwrd0,
678 token_emc_pmacro_tx_pwrd1,
679 token_emc_pmacro_tx_pwrd2,
680 token_emc_pmacro_tx_pwrd3,
681 token_emc_pmacro_tx_pwrd4,
682 token_emc_pmacro_tx_pwrd5,
683
684 token_emc_config_sample_delay,
685
686 token_emc_pmacro_brick_mapping0,
687 token_emc_pmacro_brick_mapping1,
688 token_emc_pmacro_brick_mapping2,
689
690 token_emc_pmacro_tx_sel_clk_src0,
691 token_emc_pmacro_tx_sel_clk_src1,
692 token_emc_pmacro_tx_sel_clk_src2,
693 token_emc_pmacro_tx_sel_clk_src3,
694 token_emc_pmacro_tx_sel_clk_src4,
695 token_emc_pmacro_tx_sel_clk_src5,
696
697 token_emc_pmacro_ddll_bypass,
698
699 token_emc_pmacro_ddll_pwrd0,
700 token_emc_pmacro_ddll_pwrd1,
701 token_emc_pmacro_ddll_pwrd2,
702
703 token_emc_pmacro_cmd_ctrl0,
704 token_emc_pmacro_cmd_ctrl1,
705 token_emc_pmacro_cmd_ctrl2,
706
707 token_emc_bgbias_ctl0,
708 token_mc_emem_adr_cfg,
709 token_mc_emem_adr_cfg_dev0,
710 token_mc_emem_adr_cfg_dev1,
711 token_mc_emem_adr_cfg_channel_mask,
712 token_mc_emem_adr_cfg_channel_mask_propagation_count,
713 token_mc_emem_adr_cfg_bank_mask0,
714 token_mc_emem_adr_cfg_bank_mask1,
715 token_mc_emem_adr_cfg_bank_mask2,
716 token_mc_emem_adr_cfg_bank_swizzle3,
717 token_mc_emem_arb_cfg,
718 token_mc_emem_arb_outstanding_req,
719
720 token_emc_emem_arb_refpb_hp_ctrl,
721 token_emc_emem_arb_refpb_bank_ctrl,
722
723 token_mc_emem_arb_timing_rcd,
724 token_mc_emem_arb_timing_rp,
725 token_mc_emem_arb_timing_rc,
726 token_mc_emem_arb_timing_ras,
727 token_mc_emem_arb_timing_faw,
728 token_mc_emem_arb_timing_rrd,
729 token_mc_emem_arb_timing_rap2pre,
730 token_mc_emem_arb_timing_wap2pre,
731 token_mc_emem_arb_timing_r2r,
732 token_mc_emem_arb_timing_w2w,
733 token_mc_emem_arb_timing_r2w,
734 token_mc_emem_arb_timing_w2r,
735
736 token_mc_emem_arb_timing_rfcpb,
737
738 token_mc_emem_arb_da_turns,
739 token_mc_emem_arb_da_covers,
740 token_mc_emem_arb_misc0,
741 token_mc_emem_arb_misc1,
742 token_mc_emem_arb_misc2,
743
744 token_mc_emem_arb_ring1_throttle,
745 token_mc_emem_arb_override,
746 token_mc_emem_arb_override1,
747 token_mc_emem_arb_rsv,
748
749 token_mc_da_cfg0,
750 token_mc_emem_arb_timing_ccdmw,
751
752 token_mc_clken_override,
753 token_mc_emc_reg_mode,
754 token_mc_stat_control,
755 token_mc_display_snap_ring,
756 token_mc_video_protect_bom,
757 token_mc_video_protect_bom_adr_hi,
758 token_mc_video_protect_size_mb,
759 token_mc_video_protect_vpr_override,
760 token_mc_video_protect_vpr_override1,
761 token_mc_video_protect_gpu_override0,
762 token_mc_video_protect_gpu_override1,
763 token_mc_sec_carveout_bom,
764 token_mc_sec_carveout_adr_hi,
765 token_mc_sec_carveout_size_mb,
766 token_mc_video_protect_write_access,
767 token_mc_sec_carveout_protect_write_access,
768
769 token_mc_generalized_carveout1_bom,
770 token_mc_generalized_carveout1_bom_hi,
771 token_mc_generalized_carveout1_size_128kb,
772 token_mc_generalized_carveout1_access0,
773 token_mc_generalized_carveout1_access1,
774 token_mc_generalized_carveout1_access2,
775 token_mc_generalized_carveout1_access3,
776 token_mc_generalized_carveout1_access4,
777 token_mc_generalized_carveout1_force_internal_access0,
778 token_mc_generalized_carveout1_force_internal_access1,
779 token_mc_generalized_carveout1_force_internal_access2,
780 token_mc_generalized_carveout1_force_internal_access3,
781 token_mc_generalized_carveout1_force_internal_access4,
782 token_mc_generalized_carveout1_cfg0,
783
784 token_mc_generalized_carveout2_bom,
785 token_mc_generalized_carveout2_bom_hi,
786 token_mc_generalized_carveout2_size_128kb,
787 token_mc_generalized_carveout2_access0,
788 token_mc_generalized_carveout2_access1,
789 token_mc_generalized_carveout2_access2,
790 token_mc_generalized_carveout2_access3,
791 token_mc_generalized_carveout2_access4,
792 token_mc_generalized_carveout2_force_internal_access0,
793 token_mc_generalized_carveout2_force_internal_access1,
794 token_mc_generalized_carveout2_force_internal_access2,
795 token_mc_generalized_carveout2_force_internal_access3,
796 token_mc_generalized_carveout2_force_internal_access4,
797 token_mc_generalized_carveout2_cfg0,
798
799 token_mc_generalized_carveout3_bom,
800 token_mc_generalized_carveout3_bom_hi,
801 token_mc_generalized_carveout3_size_128kb,
802 token_mc_generalized_carveout3_access0,
803 token_mc_generalized_carveout3_access1,
804 token_mc_generalized_carveout3_access2,
805 token_mc_generalized_carveout3_access3,
806 token_mc_generalized_carveout3_access4,
807 token_mc_generalized_carveout3_force_internal_access0,
808 token_mc_generalized_carveout3_force_internal_access1,
809 token_mc_generalized_carveout3_force_internal_access2,
810 token_mc_generalized_carveout3_force_internal_access3,
811 token_mc_generalized_carveout3_force_internal_access4,
812 token_mc_generalized_carveout3_cfg0,
813
814 token_mc_generalized_carveout4_bom,
815 token_mc_generalized_carveout4_bom_hi,
816 token_mc_generalized_carveout4_size_128kb,
817 token_mc_generalized_carveout4_access0,
818 token_mc_generalized_carveout4_access1,
819 token_mc_generalized_carveout4_access2,
820 token_mc_generalized_carveout4_access3,
821 token_mc_generalized_carveout4_access4,
822 token_mc_generalized_carveout4_force_internal_access0,
823 token_mc_generalized_carveout4_force_internal_access1,
824 token_mc_generalized_carveout4_force_internal_access2,
825 token_mc_generalized_carveout4_force_internal_access3,
826 token_mc_generalized_carveout4_force_internal_access4,
827 token_mc_generalized_carveout4_cfg0,
828
829 token_mc_generalized_carveout5_bom,
830 token_mc_generalized_carveout5_bom_hi,
831 token_mc_generalized_carveout5_size_128kb,
832 token_mc_generalized_carveout5_access0,
833 token_mc_generalized_carveout5_access1,
834 token_mc_generalized_carveout5_access2,
835 token_mc_generalized_carveout5_access3,
836 token_mc_generalized_carveout5_access4,
837 token_mc_generalized_carveout5_force_internal_access0,
838 token_mc_generalized_carveout5_force_internal_access1,
839 token_mc_generalized_carveout5_force_internal_access2,
840 token_mc_generalized_carveout5_force_internal_access3,
841 token_mc_generalized_carveout5_force_internal_access4,
842 token_mc_generalized_carveout5_cfg0,
843
844 token_emc_ca_training_enable,
845 token_emc_ca_training_timing_cntl1,
846 token_emc_ca_training_timing_cntl2,
847 token_swizzle_rank_byte_encode,
848 token_boot_rom_patch_control,
849 token_boot_rom_patch_data,
850 token_ch1_emc_dll_xform_dqs0,
851 token_ch1_emc_dll_xform_dqs1,
852 token_ch1_emc_dll_xform_dqs2,
853 token_ch1_emc_dll_xform_dqs3,
854 token_ch1_emc_dll_xform_dqs4,
855 token_ch1_emc_dll_xform_dqs5,
856 token_ch1_emc_dll_xform_dqs6,
857 token_ch1_emc_dll_xform_dqs7,
858 token_ch1_emc_dll_xform_quse0,
859 token_ch1_emc_dll_xform_quse1,
860 token_ch1_emc_dll_xform_quse2,
861 token_ch1_emc_dll_xform_quse3,
862 token_ch1_emc_dll_xform_quse4,
863 token_ch1_emc_dll_xform_quse5,
864 token_ch1_emc_dll_xform_quse6,
865 token_ch1_emc_dll_xform_quse7,
866 token_ch1_emc_dli_trim_tx_dqs0,
867 token_ch1_emc_dli_trim_tx_dqs1,
868 token_ch1_emc_dli_trim_tx_dqs2,
869 token_ch1_emc_dli_trim_tx_dqs3,
870 token_ch1_emc_dli_trim_tx_dqs4,
871 token_ch1_emc_dli_trim_tx_dqs5,
872 token_ch1_emc_dli_trim_tx_dqs6,
873 token_ch1_emc_dli_trim_tx_dqs7,
874 token_ch1_emc_dll_xform_dq0,
875 token_ch1_emc_dll_xform_dq1,
876 token_ch1_emc_dll_xform_dq2,
877 token_ch1_emc_dll_xform_dq3,
878 token_ch1_emc_swizzle_rank0_byte_cfg,
879 token_ch1_emc_swizzle_rank0_byte0,
880 token_ch1_emc_swizzle_rank0_byte1,
881 token_ch1_emc_swizzle_rank0_byte2,
882 token_ch1_emc_swizzle_rank0_byte3,
883 token_ch1_emc_swizzle_rank1_byte_cfg,
884 token_ch1_emc_swizzle_rank1_byte0,
885 token_ch1_emc_swizzle_rank1_byte1,
886 token_ch1_emc_swizzle_rank1_byte2,
887 token_ch1_emc_swizzle_rank1_byte3,
888 token_ch1_emc_addr_swizzle_stack1a,
889 token_ch1_emc_addr_swizzle_stack1b,
890 token_ch1_emc_addr_swizzle_stack2a,
891 token_ch1_emc_addr_swizzle_stack2b,
892 token_ch1_emc_addr_swizzle_stack3,
893 token_ch1_emc_auto_cal_config,
894 token_ch1_emc_auto_cal_config2,
895 token_ch1_emc_auto_cal_config3,
896
897 token_emc_auto_cal_config4,
898 token_emc_auto_cal_config5,
899 token_emc_auto_cal_config6,
900 token_emc_auto_cal_config7,
901 token_emc_auto_cal_config8,
902 /* Specifies the value for EMC_AUTO_CAL_VREF_SEL_0 */
903 token_emc_auto_cal_vref_sel0,
904 token_emc_auto_cal_vref_sel1,
905
906 /* Specifies the value for EMC_AUTO_CAL_CHANNEL */
907 token_emc_auto_cal_channel,
908
909 /* Specifies the value for EMC_PMACRO_AUTOCAL_CFG_0 */
910 token_emc_pmacro_auto_cal_cfg0,
911 token_emc_pmacro_auto_cal_cfg1,
912 token_emc_pmacro_auto_cal_cfg2,
913
914 token_emc_pmacro_rx_term,
915 token_emc_pmacro_dq_tx_drive,
916 token_emc_pmacro_ca_tx_drive,
917 token_emc_pmacro_cmd_tx_drive,
918 token_emc_pmacro_auto_cal_common,
919 token_emc_pmacro_zcrtl,
920
921 token_ch1_emc_cdb_cntl1,
922 token_ch1_emc_dll_xform_addr0,
923 token_ch1_emc_dll_xform_addr1,
924 token_ch1_emc_dll_xform_addr2,
925 token_ch1_emc_fbio_spare,
926 token_ch1_emc_xm2_clk_pad_ctrl,
927 token_ch1_emc_xm2_clk_pad_ctrl2,
928 token_ch1_emc_xm2_cmd_pad_ctrl2,
929 token_ch1_emc_xm2_cmd_pad_ctrl3,
930 token_ch1_emc_xm2_cmd_pad_ctrl4,
931 token_ch1_emc_xm2_dq_pad_ctrl,
932 token_ch1_emc_xm2_dq_pad_ctrl2,
933 token_ch1_emc_xm2_dqs_pad_ctrl,
934 token_ch1_emc_xm2_dqs_pad_ctrl3,
935 token_ch1_emc_xm2_dqs_pad_ctrl4,
936 token_mc_mts_carveout_bom,
937 token_mc_mts_carveout_adr_hi,
938 token_mc_mts_carveout_size_mb,
939 token_mc_mts_carveout_reg_ctrl,
940
941 token_mts_info_version,
942 token_mts_info_start_blk,
943 token_mts_info_start_page,
944 token_mts_info_length,
945 token_mts_info_load_addr,
946 token_mts_info_entry_point,
947 token_mts_info_attribute,
948
949 token_mts_used,
950 token_mts_max,
951
952 token_force32 = 0x7fffffff
953 } parse_token;
954
955 typedef enum
956 {
957 field_type_none = 0,
958 field_type_enum,
959 field_type_u32,
960 field_type_u8,
961 field_type_force32 = 0x7fffffff
962 } field_type;
963
964 /* Forward declarations */
965 typedef int (*process_function)(build_image_context *context,
966 parse_token token,
967 char *remainder);
968
969 typedef int (*process_subfield_function)(build_image_context *context,
970 uint32_t index,
971 parse_token token,
972 uint32_t value);
973
974
975 typedef struct
976 {
977 char *name;
978 uint32_t value;
979 } enum_item;
980
981 typedef struct
982 {
983 char *name;
984 uint32_t token;
985 field_type type;
986 enum_item *enum_table;
987 } field_item;
988
989
990 typedef struct
991 {
992 char *prefix;
993 parse_token token;
994 field_item *field_table;
995 process_subfield_function process;
996 } parse_subfield_item;
997
998 typedef struct
999 {
1000 char *prefix;
1001 parse_token token;
1002 process_function process;
1003 } parse_item;
1004
1005 /*
1006 * Set of function pointers and table pointers to be used to access the different hardware
1007 * interface for setting/getting bct information.
1008 */
1009 typedef struct cbootimage_soc_config_rec {
1010 /*
1011 * Set device parameters in bct according to the value listed
1012 *
1013 * @param context The main context pointer
1014 * @param index The device index in bct field
1015 * @param token The parse token value
1016 * @param value Value to set
1017 * @return 0 and -ENODATA for success and failure
1018 */
1019 int (*set_dev_param)(build_image_context *context,
1020 uint32_t index,
1021 parse_token token,
1022 uint32_t value);
1023 /*
1024 * Get the specified device parameters from bct data stored
1025 * in context.
1026 *
1027 * @param context The main context pointer
1028 * @param index The device index in bct field
1029 * @param token The parse token value
1030 * @param value Return value get from bct field
1031 * @return 0 and -ENODATA for success and failure
1032 */
1033 int (*get_dev_param)(build_image_context *context,
1034 uint32_t index,
1035 parse_token token,
1036 uint32_t *value);
1037 /*
1038 * Set sdram parameters in bct according to the value listed
1039 * in config file.
1040 *
1041 * @param context The main context pointer
1042 * @param index The sdram index in bct field
1043 * @param token The parse token value
1044 * @param value Value to set
1045 * @return 0 and 1 for success and failure
1046 */
1047 int (*set_sdram_param)(build_image_context *context,
1048 uint32_t index,
1049 parse_token token,
1050 uint32_t value);
1051 /*
1052 * Get the specified sdram parameters from bct data stored
1053 * in context.
1054 *
1055 * @param context The main context pointer
1056 * @param index The sdram index in bct field
1057 * @param token The parse token value
1058 * @param value Return value get from bct field
1059 * @return 0 and 1 for success and failure
1060 */
1061 int (*get_sdram_param)(build_image_context *context,
1062 uint32_t index,
1063 parse_token token,
1064 uint32_t *value);
1065 /*
1066 * Set bootloader parameters in bct according to the value listed
1067 * in config file.
1068 *
1069 * @param set Bootloader index
1070 * @param id The parse token value
1071 * @param data Value to set
1072 * @param bct Bct pointer
1073 * @return 0 and -ENODATA for success and failure
1074 */
1075 int (*setbl_param)(uint32_t set,
1076 parse_token id,
1077 uint32_t *data,
1078 uint8_t *bct);
1079 /*
1080 * Get the specified bootloader parameters from bct data stored
1081 * in context.
1082 *
1083 * @param set Bootloader index
1084 * @param id The parse token value
1085 * @param data Return value get from bct data
1086 * @param bct Bct pointer
1087 * @return 0 and -ENODATA for success and failure
1088 */
1089 int (*getbl_param)(uint32_t set,
1090 parse_token id,
1091 uint32_t *data,
1092 uint8_t *bct);
1093 /*
1094 * Set the specified bct value stored in context bct data structure.
1095 *
1096 * @param id The parse token value
1097 * @param data Pointer of value to set
1098 * @param bct Bct pointer
1099 * @return 0 and -ENODATA for success and failure
1100 */
1101 int (*set_value)(parse_token id,
1102 void *data,
1103 uint8_t *bct);
1104 /*
1105 * Get the specified bct value or some constant value of clocks and
1106 * hw type.
1107 *
1108 * @param id The parse token value
1109 * @param data Return value get from bct data
1110 * @param bct Bct pointer
1111 * @return 0 and -ENODATA for success and failure
1112 */
1113 int (*get_value)(parse_token id,
1114 void *data,
1115 uint8_t *bct);
1116 /*
1117 * Get the size of specified bct field
1118 *
1119 * @param id The parse token
1120 * @return size or 0/-ENODATA for failure
1121 */
1122 int (*get_value_size)(parse_token id);
1123
1124 /*
1125 * Set the bct crypto hash data.
1126 *
1127 * @param id The parse token value
1128 * @param data Value to set
1129 * @param length Length of data to set
1130 * @param bct Bct pointer
1131 * @return 0 and -ENODATA for success and failure
1132 */
1133 int (*set_data)(parse_token id,
1134 uint8_t *data,
1135 uint32_t length,
1136 uint8_t *bct);
1137
1138 /*
1139 * Get the BCT structure size
1140 *
1141 * @return BCT size
1142 */
1143 int (*get_bct_size)();
1144
1145 /*
1146 * Set MTS information in bct according to the value listed
1147 * in config file.
1148 *
1149 * @param context The main context pointer
1150 * @param index The mts_info index in bct field
1151 * @param token The parse token value
1152 * @param value Value to set
1153 * @return 0 and 1 for success and failure
1154 */
1155 int (*set_mts_info)(build_image_context *context,
1156 uint32_t index,
1157 parse_token token,
1158 uint32_t value);
1159 /*
1160 * Get the specified MTS information from bct data stored
1161 * in context.
1162 *
1163 * @param context The main context pointer
1164 * @param index The mts_info index in bct field
1165 * @param token The parse token value
1166 * @param value Return value get from bct field
1167 * @return 0 and 1 for success and failure
1168 */
1169 int (*get_mts_info)(build_image_context *context,
1170 uint32_t index,
1171 parse_token token,
1172 uint32_t *value);
1173
1174 /*
1175 * Check if the token is supported to dump
1176 *
1177 * @param id The parse token value
1178 * @return 0 and 1 for unsupported and supported
1179 */
1180 int (*token_supported)(parse_token id);
1181
1182 void (*init_bad_block_table)(build_image_context *context);
1183
1184 enum_item *devtype_table;
1185 enum_item *sdmmc_data_width_table;
1186 enum_item *spi_clock_source_table;
1187 enum_item *nvboot_memory_type_table;
1188 field_item *sdram_field_table;
1189 field_item *nand_table;
1190 field_item *sdmmc_table;
1191 field_item *spiflash_table;
1192 parse_subfield_item *device_type_table;
1193 } cbootimage_soc_config;
1194
1195 void process_config_file(build_image_context *context, uint8_t simple_parse);
1196
1197 void t210_get_soc_config(build_image_context *context,
1198 cbootimage_soc_config **soc_config);
1199 void t132_get_soc_config(build_image_context *context,
1200 cbootimage_soc_config **soc_config);
1201 void t124_get_soc_config(build_image_context *context,
1202 cbootimage_soc_config **soc_config);
1203 void t114_get_soc_config(build_image_context *context,
1204 cbootimage_soc_config **soc_config);
1205 void t30_get_soc_config(build_image_context *context,
1206 cbootimage_soc_config **soc_config);
1207 void t20_get_soc_config(build_image_context *context,
1208 cbootimage_soc_config **soc_config);
1209
1210 int if_bct_is_t210_get_soc_config(build_image_context *context,
1211 cbootimage_soc_config **soc_config);
1212 int if_bct_is_t132_get_soc_config(build_image_context *context,
1213 cbootimage_soc_config **soc_config);
1214 int if_bct_is_t124_get_soc_config(build_image_context *context,
1215 cbootimage_soc_config **soc_config);
1216 int if_bct_is_t114_get_soc_config(build_image_context *context,
1217 cbootimage_soc_config **soc_config);
1218 int if_bct_is_t30_get_soc_config(build_image_context *context,
1219 cbootimage_soc_config **soc_config);
1220 int if_bct_is_t20_get_soc_config(build_image_context *context,
1221 cbootimage_soc_config **soc_config);
1222
1223 int
1224 t132_get_dev_param(build_image_context *context,
1225 uint32_t index,
1226 parse_token token,
1227 uint32_t *value);
1228 int
1229 t132_set_dev_param(build_image_context *context,
1230 uint32_t index,
1231 parse_token token,
1232 uint32_t value);
1233 int
1234 t132_get_sdram_param(build_image_context *context,
1235 uint32_t index,
1236 parse_token token,
1237 uint32_t *value);
1238 int
1239 t132_set_sdram_param(build_image_context *context,
1240 uint32_t index,
1241 parse_token token,
1242 uint32_t value);
1243
1244 int
1245 t210_get_dev_param(build_image_context *context,
1246 uint32_t index,
1247 parse_token token,
1248 uint32_t *value);
1249 int
1250 t210_set_dev_param(build_image_context *context,
1251 uint32_t index,
1252 parse_token token,
1253 uint32_t value);
1254 int
1255 t210_get_sdram_param(build_image_context *context,
1256 uint32_t index,
1257 parse_token token,
1258 uint32_t *value);
1259 int
1260 t210_set_sdram_param(build_image_context *context,
1261 uint32_t index,
1262 parse_token token,
1263 uint32_t value);
1264
1265 int
1266 t124_get_dev_param(build_image_context *context,
1267 uint32_t index,
1268 parse_token token,
1269 uint32_t *value);
1270 int
1271 t124_set_dev_param(build_image_context *context,
1272 uint32_t index,
1273 parse_token token,
1274 uint32_t value);
1275 int
1276 t124_get_sdram_param(build_image_context *context,
1277 uint32_t index,
1278 parse_token token,
1279 uint32_t *value);
1280 int
1281 t124_set_sdram_param(build_image_context *context,
1282 uint32_t index,
1283 parse_token token,
1284 uint32_t value);
1285 int
1286 t114_get_dev_param(build_image_context *context,
1287 uint32_t index,
1288 parse_token token,
1289 uint32_t *value);
1290 int
1291 t114_set_dev_param(build_image_context *context,
1292 uint32_t index,
1293 parse_token token,
1294 uint32_t value);
1295 int
1296 t114_get_sdram_param(build_image_context *context,
1297 uint32_t index,
1298 parse_token token,
1299 uint32_t *value);
1300 int
1301 t114_set_sdram_param(build_image_context *context,
1302 uint32_t index,
1303 parse_token token,
1304 uint32_t value);
1305 int
1306 t30_get_dev_param(build_image_context *context,
1307 uint32_t index,
1308 parse_token token,
1309 uint32_t *value);
1310 int
1311 t30_set_dev_param(build_image_context *context,
1312 uint32_t index,
1313 parse_token token,
1314 uint32_t value);
1315 int
1316 t30_get_sdram_param(build_image_context *context,
1317 uint32_t index,
1318 parse_token token,
1319 uint32_t *value);
1320 int
1321 t30_set_sdram_param(build_image_context *context,
1322 uint32_t index,
1323 parse_token token,
1324 uint32_t value);
1325 int
1326 t20_get_dev_param(build_image_context *context,
1327 uint32_t index,
1328 parse_token token,
1329 uint32_t *value);
1330 int
1331 t20_set_dev_param(build_image_context *context,
1332 uint32_t index,
1333 parse_token token,
1334 uint32_t value);
1335
1336 int
1337 t20_get_sdram_param(build_image_context *context,
1338 uint32_t index,
1339 parse_token token,
1340 uint32_t *value);
1341 int
1342 t20_set_sdram_param(build_image_context *context,
1343 uint32_t index,
1344 parse_token token,
1345 uint32_t value);
1346
1347 uint32_t iceil_log2(uint32_t a, uint32_t b);
1348
1349 /* Returns the smallest power of 2 >= a */
1350 uint32_t ceil_log2(uint32_t a);
1351
1352 extern cbootimage_soc_config *g_soc_config;
1353
1354 /*
1355 * Dummy function for unsupported token
1356 */
1357 int bct_get_unsupported(parse_token id);
1358
1359 /*
1360 * Provide access to enum and field tables. These tables are useful when
1361 * pretty printing a BCT file using bct_dump.
1362 */
1363
1364 extern enum_item s_devtype_table_t20[];
1365 extern enum_item s_devtype_table_t30[];
1366 extern enum_item s_devtype_table_t114[];
1367 extern enum_item s_devtype_table_t124[];
1368 extern enum_item s_devtype_table_t132[];
1369 extern enum_item s_devtype_table_t210[];
1370
1371 extern enum_item s_sdmmc_data_width_table_t20[];
1372 extern enum_item s_sdmmc_data_width_table_t30[];
1373 extern enum_item s_sdmmc_data_width_table_t114[];
1374 extern enum_item s_sdmmc_data_width_table_t124[];
1375 extern enum_item s_sdmmc_data_width_table_t132[];
1376 extern enum_item s_sdmmc_data_width_table_t210[];
1377
1378 extern enum_item s_spi_clock_source_table_t20[];
1379 extern enum_item s_spi_clock_source_table_t30[];
1380 extern enum_item s_spi_clock_source_table_t114[];
1381 extern enum_item s_spi_clock_source_table_t124[];
1382 extern enum_item s_spi_clock_source_table_t132[];
1383 extern enum_item s_spi_clock_source_table_t210[];
1384
1385 extern enum_item s_nvboot_memory_type_table_t20[];
1386 extern enum_item s_nvboot_memory_type_table_t30[];
1387 extern enum_item s_nvboot_memory_type_table_t114[];
1388 extern enum_item s_nvboot_memory_type_table_t124[];
1389 extern enum_item s_nvboot_memory_type_table_t132[];
1390 extern enum_item s_nvboot_memory_type_table_t210[];
1391
1392 extern field_item s_sdram_field_table_t20[];
1393 extern field_item s_sdram_field_table_t30[];
1394 extern field_item s_sdram_field_table_t114[];
1395 extern field_item s_sdram_field_table_t124[];
1396 extern field_item s_sdram_field_table_t132[];
1397 extern field_item s_sdram_field_table_t210[];
1398
1399 extern field_item s_nand_table_t20[];
1400 extern field_item s_nand_table_t30[];
1401
1402 extern field_item s_sdmmc_table_t20[];
1403 extern field_item s_sdmmc_table_t30[];
1404 extern field_item s_sdmmc_table_t114[];
1405 extern field_item s_sdmmc_table_t124[];
1406 extern field_item s_sdmmc_table_t132[];
1407 extern field_item s_sdmmc_table_t210[];
1408
1409 extern field_item s_spiflash_table_t20[];
1410 extern field_item s_spiflash_table_t30[];
1411 extern field_item s_spiflash_table_t114[];
1412 extern field_item s_spiflash_table_t124[];
1413 extern field_item s_spiflash_table_t132[];
1414 extern field_item s_spiflash_table_t210[];
1415
1416 extern parse_subfield_item s_device_type_table_t20[];
1417 extern parse_subfield_item s_device_type_table_t30[];
1418 extern parse_subfield_item s_device_type_table_t114[];
1419 extern parse_subfield_item s_device_type_table_t124[];
1420 extern parse_subfield_item s_device_type_table_t132[];
1421 extern parse_subfield_item s_device_type_table_t210[];
1422
1423 #endif /* #ifndef INCLUDED_PARSE_H */