diff options
author | Penny Chiu <pchiu@nvidia.com> | 2014-04-11 17:50:40 +0800 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2014-04-15 12:02:06 -0600 |
commit | 0cb60abe4ad916103b947c87bd8a32749b8e0a2b (patch) | |
tree | cd3bf25b8cdfafd5608a8531b94288649eb5ca68 /src/t30 | |
parent | b81d219677b624ce4b554ab99c369e5ffeee5299 (diff) | |
download | cbootimage-0cb60abe4ad916103b947c87bd8a32749b8e0a2b.tar.gz |
Add token_supported function
Add a function called token_supported in cbootimage_soc_config.
It is used to check if the input token is supported in specific
tegra soc.
Signed-off-by: Penny Chiu <pchiu@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'src/t30')
-rw-r--r-- | src/t30/nvbctlib_t30.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/t30/nvbctlib_t30.c b/src/t30/nvbctlib_t30.c index a84b7c7..8c72d69 100644 --- a/src/t30/nvbctlib_t30.c +++ b/src/t30/nvbctlib_t30.c @@ -96,6 +96,21 @@ default : \ token, __LINE__); \ return 1 +parse_token t30_root_token_list[] = { + token_boot_data_version, + token_block_size_log2, + token_page_size_log2, + token_partition_size, + token_odm_data, + token_bootloader_used, + token_bootloaders_max, + token_bct_size, + token_hash_size, + token_crypto_offset, + token_crypto_length, + token_max_bct_search_blks +}; + int t30_set_dev_param(build_image_context *context, u_int32_t index, @@ -825,6 +840,17 @@ t30_bct_set_data(parse_token id, return 0; } +int t30_bct_token_supported(parse_token token) +{ + int index; + + for (index = 0; index < ARRAY_SIZE(t30_root_token_list); index++) + if (t30_root_token_list[index] == token) + return 1; + + return 0; +} + void t30_init_bad_block_table(build_image_context *context) { u_int32_t bytes_per_entry; @@ -858,6 +884,7 @@ cbootimage_soc_config tegra30_config = { .set_value = t30_bct_set_value, .get_value = t30_bct_get_value, .set_data = t30_bct_set_data, + .token_supported = t30_bct_token_supported, .devtype_table = s_devtype_table_t30, .sdmmc_data_width_table = s_sdmmc_data_width_table_t30, |