63 int sector_nu,
int avail)
81 if (!(sec_info->
sec_bitmap[index] & (1 << bit)))
91 u64 timestamp,
u32 cur_entity_hdr_offset,
92 u32 start_offset,
u32 ext_size)
103 u32 sec_hdr_start_addr;
109 sec_hdr = sec_info->
sec_data + sec_hdr_start_addr;
117 if ((start_offset - sec_info->
skip_size) == data_hdr_size) {
125 memcpy((
void *)((
char *)sec_hdr + hdr_offset),
126 (
void *)((
char *)dbg_buff->
data), data_hdr_size);
128 memcpy((
void *)((
char *)sec_hdr +
130 cur_entity_hdr_offset),
131 (
void *)((
char *)dbg_buff->
data +
132 cur_entity_hdr_offset),
141 cur_entity_hdr_offset);
153 u32 start_offset,
u32 cur_entity_hdr_offset,
167 u32 sec_hdr_start_addr;
177 sec_data_size = sec_hdr_start_addr;
186 cur_entity_hdr_offset,
187 start_offset, ext_size);
204 if (cur_entity_size > space_left) {
209 while (cur_entity_size > 0) {
223 if (cur_entity_size + sec_data_offset > sec_data_size) {
224 tmp_size = sec_data_size - sec_data_offset;
226 tmp_size = cur_entity_size;
232 memcpy((
void *)((
char *)sec_info->
sec_data + sec_data_offset),
233 (
void *)((
char *)dbg_buff->
data + start_offset),
241 cur_entity_size -= tmp_size;
243 start_offset += tmp_size;
253 unsigned int sf_sec_size;
256 u8 *ptr = (
u8 *)data;
305 u32 total_hdr_size, data_header_size;
306 void *payload = NULL;
307 u32 payload_size = 0;
317 payload = (
char *)buf + total_hdr_size;
318 payload_size = buf_size - total_hdr_size;
338 u32 sec_hdr_start_addr;
347 "Try Again...readflash\n\n");
380 "found in flash\n\n");
391 memset(&flash_hdr, 0,
418 size, sec_hdr_start_addr);
440 if (size + total_hdr_size >
454 (
void *)((
char *)data +
457 data_offset += (tmp_size);
471 unsigned int addr, i, n;
int t4_get_flash_params(struct adapter *adapter)
int t4_write_flash(struct adapter *adapter, unsigned int addr, unsigned int n, const u8 *data, int byte_oriented)
int t4_flash_erase_sectors(struct adapter *adapter, int start, int end)
int t4_read_flash(struct adapter *adapter, unsigned int addr, unsigned int nwords, u32 *data, int byte_oriented)
static void set_dbg_bitmap(u8 *bitmap, enum CUDBG_DBG_ENTITY_TYPE type)
static void reset_dbg_bitmap(u8 *bitmap, enum CUDBG_DBG_ENTITY_TYPE type)
#define CUDBG_STATUS_FLASH_FULL
#define CUDBG_STATUS_NO_SIGNATURE
static void update_headers(void *handle, struct cudbg_buffer *dbg_buff, u64 timestamp, u32 cur_entity_hdr_offset, u32 start_offset, u32 ext_size)
int cudbg_read_flash_data(void *handle, void *buf, u32 buf_size)
int cudbg_write_flash(void *handle, u64 timestamp, void *data, u32 start_offset, u32 cur_entity_hdr_offset, u32 cur_entity_size, u32 ext_size)
static int find_empty_sec(struct cudbg_flash_sec_info *sec_info)
void update_skip_size(struct cudbg_flash_sec_info *sec_info, u32 size)
static void set_sector_availability(struct cudbg_flash_sec_info *sec_info, int sector_nu, int avail)
int cudbg_read_flash(void *handle, void *data, u32 size, int data_flag)
int write_flash(struct adapter *adap, u32 start_sec, void *data, u32 size)
int cudbg_read_flash_details(void *handle, struct cudbg_flash_hdr *data)
int read_flash(struct adapter *adap, u32 start_sec, void *data, u32 size, u32 start_address)
#define CUDBG_FL_SIGNATURE
#define CUDBG_SF_MAX_SECTOR
#define CUDBG_FL_BUILD_VERSION
#define CUDBG_FL_MAJOR_VERSION
#define CUDBG_SF_SECTOR_SIZE
#define CUDBG_FL_MINOR_VERSION
#define DIV_ROUND_UP(x, y)
struct adapter_params params
char sec_data[CUDBG_SF_SECTOR_SIZE]
struct cudbg_flash_sec_info sec_info
struct cudbg_init dbg_init