| OLD | NEW |
| 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. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #define INCLUDED_NVBCTLIB_H | 35 #define INCLUDED_NVBCTLIB_H |
| 36 | 36 |
| 37 #include <sys/types.h> | 37 #include <sys/types.h> |
| 38 /* | 38 /* |
| 39 * nvbct_lib_id defines tokens used for querying or setting values within, or | 39 * nvbct_lib_id defines tokens used for querying or setting values within, or |
| 40 * about, the BCT. These are used to identify values within structures, | 40 * about, the BCT. These are used to identify values within structures, |
| 41 * sizes and other properties of structures, and values for enumerated | 41 * sizes and other properties of structures, and values for enumerated |
| 42 * constants. | 42 * constants. |
| 43 */ | 43 */ |
| 44 typedef enum { | 44 typedef enum { |
| 45 nvbct_lib_id_none = 0, | 45 » nvbct_lib_id_none = 0, |
| 46 | 46 |
| 47 nvbct_lib_id_crypto_hash, | 47 » nvbct_lib_id_crypto_hash, |
| 48 nvbct_lib_id_random_aes_blk, | 48 » nvbct_lib_id_random_aes_blk, |
| 49 nvbct_lib_id_boot_data_version, | 49 » nvbct_lib_id_boot_data_version, |
| 50 nvbct_lib_id_block_size_log2, | 50 » nvbct_lib_id_block_size_log2, |
| 51 nvbct_lib_id_page_size_log2, | 51 » nvbct_lib_id_page_size_log2, |
| 52 nvbct_lib_id_partition_size, | 52 » nvbct_lib_id_partition_size, |
| 53 nvbct_lib_id_bootloader_used, | 53 » nvbct_lib_id_dev_type, |
| 54 nvbct_lib_id_bootloaders_max, | 54 » nvbct_lib_id_bootloader_used, |
| 55 nvbct_lib_id_reserved, | 55 » nvbct_lib_id_bootloaders_max, |
| 56 nvbct_lib_id_reserved_size, | 56 » nvbct_lib_id_reserved, |
| 57 nvbct_lib_id_reserved_offset, | 57 » nvbct_lib_id_reserved_size, |
| 58 nvbct_lib_id_bct_size, | 58 » nvbct_lib_id_reserved_offset, |
| 59 nvbct_lib_id_hash_size, | 59 » nvbct_lib_id_bct_size, |
| 60 nvbct_lib_id_crypto_offset, | 60 » nvbct_lib_id_hash_size, |
| 61 nvbct_lib_id_crypto_length, | 61 » nvbct_lib_id_crypto_offset, |
| 62 nvbct_lib_id_max_bct_search_blks, | 62 » nvbct_lib_id_crypto_length, |
| 63 » nvbct_lib_id_max_bct_search_blks, |
| 64 » nvbct_lib_id_num_param_sets, |
| 65 » nvbct_lib_id_dev_type_sdmmc, |
| 66 » nvbct_lib_id_dev_type_spi, |
| 63 | 67 |
| 64 nvbct_lib_id_bl_version, | 68 » nvbct_lib_id_sdmmc_clock_divider, |
| 65 nvbct_lib_id_bl_start_blk, | 69 » nvbct_lib_id_sdmmc_data_width, |
| 66 nvbct_lib_id_bl_start_page, | 70 » nvbct_lib_id_sdmmc_max_power_class_supported, |
| 67 nvbct_lib_id_bl_length, | 71 » nvbct_lib_id_spiflash_read_command_type_fast, |
| 68 nvbct_lib_id_bl_load_addr, | 72 » nvbct_lib_id_spiflash_clock_source, |
| 69 nvbct_lib_id_bl_entry_point, | 73 » nvbct_lib_id_spiflash_clock_divider, |
| 70 nvbct_lib_id_bl_attribute, | 74 » nvbct_lib_id_sdmmc_data_width_4bit, |
| 71 nvbct_lib_id_bl_crypto_hash, | 75 » nvbct_lib_id_sdmmc_data_width_8bit, |
| 76 » nvbct_lib_id_spi_clock_source_pllp_out0, |
| 77 » nvbct_lib_id_spi_clock_source_pllc_out0, |
| 78 » nvbct_lib_id_spi_clock_source_pllm_out0, |
| 79 » nvbct_lib_id_spi_clock_source_clockm, |
| 72 | 80 |
| 73 nvbct_lib_id_max, | 81 » nvbct_lib_id_bl_version, |
| 82 » nvbct_lib_id_bl_start_blk, |
| 83 » nvbct_lib_id_bl_start_page, |
| 84 » nvbct_lib_id_bl_length, |
| 85 » nvbct_lib_id_bl_load_addr, |
| 86 » nvbct_lib_id_bl_entry_point, |
| 87 » nvbct_lib_id_bl_attribute, |
| 88 » nvbct_lib_id_bl_crypto_hash, |
| 74 | 89 |
| 75 nvbct_lib_id_force32 = 0x7fffffff | 90 » nvbct_lib_id_max, |
| 91 |
| 92 » nvbct_lib_id_force32 = 0x7fffffff |
| 76 | 93 |
| 77 } nvbct_lib_id; | 94 } nvbct_lib_id; |
| 78 | 95 |
| 96 typedef int (*nvbct_lib_get_dev_param)(u_int32_t set, |
| 97 nvbct_lib_id id, |
| 98 u_int32_t *data, |
| 99 u_int8_t *bct); |
| 100 typedef int (*nvbct_lib_set_dev_param)(u_int32_t set, |
| 101 nvbct_lib_id id, |
| 102 u_int32_t data, |
| 103 u_int8_t *bct); |
| 104 |
| 79 typedef int (*nvbct_lib_get_bl_param)(u_int32_t set, | 105 typedef int (*nvbct_lib_get_bl_param)(u_int32_t set, |
| 80 nvbct_lib_id id, | 106 nvbct_lib_id id, |
| 81 u_int32_t *data, | 107 u_int32_t *data, |
| 82 u_int8_t *bct); | 108 u_int8_t *bct); |
| 83 typedef int (*nvbct_lib_set_bl_param)(u_int32_t set, | 109 typedef int (*nvbct_lib_set_bl_param)(u_int32_t set, |
| 84 nvbct_lib_id id, | 110 nvbct_lib_id id, |
| 85 u_int32_t *data, | 111 u_int32_t *data, |
| 86 u_int8_t *bct); | 112 u_int8_t *bct); |
| 87 | 113 |
| 88 typedef int (*nvbct_lib_get_value)(nvbct_lib_id id, | 114 typedef int (*nvbct_lib_get_value)(nvbct_lib_id id, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 103 typedef int (*nvbct_lib_set_data)(nvbct_lib_id id, | 129 typedef int (*nvbct_lib_set_data)(nvbct_lib_id id, |
| 104 u_int8_t *data, | 130 u_int8_t *data, |
| 105 u_int32_t length, | 131 u_int32_t length, |
| 106 u_int8_t *bct); | 132 u_int8_t *bct); |
| 107 | 133 |
| 108 /* | 134 /* |
| 109 * Structure of function pointers used to access a specific BCT variant. | 135 * Structure of function pointers used to access a specific BCT variant. |
| 110 */ | 136 */ |
| 111 typedef struct nvbct_lib_fns_rec | 137 typedef struct nvbct_lib_fns_rec |
| 112 { | 138 { |
| 113 nvbct_lib_get_value get_value; | 139 » nvbct_lib_get_value get_value; |
| 114 nvbct_lib_set_value set_value; | 140 » nvbct_lib_set_value set_value; |
| 115 | 141 |
| 116 nvbct_lib_get_data get_data; | 142 » nvbct_lib_get_data get_data; |
| 117 nvbct_lib_set_data set_data; | 143 » nvbct_lib_set_data set_data; |
| 118 | 144 |
| 119 nvbct_lib_get_bl_param getbl_param; | 145 » nvbct_lib_get_bl_param getbl_param; |
| 120 nvbct_lib_set_bl_param setbl_param; | 146 » nvbct_lib_set_bl_param setbl_param; |
| 121 | 147 |
| 148 nvbct_lib_get_dev_param getdev_param; |
| 149 nvbct_lib_set_dev_param setdev_param; |
| 122 } nvbct_lib_fns; | 150 } nvbct_lib_fns; |
| 123 | 151 |
| 124 void nvbct_lib_get_fns(nvbct_lib_fns *fns); | 152 void nvbct_lib_get_fns(nvbct_lib_fns *fns); |
| 125 | 153 |
| 126 #endif /* #ifndef INCLUDED_NVBCTLIB_H */ | 154 #endif /* #ifndef INCLUDED_NVBCTLIB_H */ |
| OLD | NEW |