FreeBSD kernel CXGBE device code
cudbg_flash_utils.c File Reference
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/param.h>
#include "common/common.h"
#include "common/t4_regs.h"
#include "cudbg.h"
#include "cudbg_lib_common.h"
Include dependency graph for cudbg_flash_utils.c:

Go to the source code of this file.

Enumerations

enum  {
  SF_ATTEMPTS = 10 , SF_PROG_PAGE = 2 , SF_WR_DISABLE = 4 , SF_RD_STATUS = 5 ,
  SF_WR_ENABLE = 6 , SF_RD_DATA_FAST = 0xb , SF_RD_ID = 0x9f , SF_ERASE_SECTOR = 0xd8
}
 

Functions

 __FBSDID ("$FreeBSD$")
 
int write_flash (struct adapter *adap, u32 start_sec, void *data, u32 size)
 
int read_flash (struct adapter *adap, u32 start_sec, void *data, u32 size, u32 start_address)
 
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)
 
static int find_empty_sec (struct cudbg_flash_sec_info *sec_info)
 
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_write_flash (void *handle, u64 timestamp, void *data, u32 start_offset, u32 cur_entity_hdr_offset, u32 cur_entity_size, u32 ext_size)
 
int cudbg_read_flash_details (void *handle, struct cudbg_flash_hdr *data)
 
int cudbg_read_flash_data (void *handle, void *buf, u32 buf_size)
 
int cudbg_read_flash (void *handle, void *data, u32 size, int data_flag)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SF_ATTEMPTS 
SF_PROG_PAGE 
SF_WR_DISABLE 
SF_RD_STATUS 
SF_WR_ENABLE 
SF_RD_DATA_FAST 
SF_RD_ID 
SF_ERASE_SECTOR 

Definition at line 38 of file cudbg_flash_utils.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ cudbg_read_flash()

◆ cudbg_read_flash_data()

int cudbg_read_flash_data ( void *  handle,
void *  data_buf,
u32  data_buf_size 
)

cudbg_read_flash_data - Read cudbg dump contents stored in flash.

Parameters

@handle : A pointer returned by cudbg_hello. @data_buf : A pointer to data buffer. @data_buf_size : Data buffer size.

Definition at line 302 of file cudbg_flash_utils.c.

References CUDBG_MAX_ENTITY, and cudbg_read_flash().

Here is the call graph for this function:

◆ cudbg_read_flash_details()

int cudbg_read_flash_details ( void *  handle,
struct cudbg_flash_hdr data 
)

cudbg_read_flash_data - Read cudbg “flash” header from adapter flash. This will be used by the consumer mainly to know the size of the data in flash.

Parameters

@handle : A pointer returned by cudbg_hello. @data : A pointer to data/header buffer

Definition at line 293 of file cudbg_flash_utils.c.

References cudbg_read_flash().

Here is the call graph for this function:

◆ cudbg_write_flash()

◆ find_empty_sec()

static int find_empty_sec ( struct cudbg_flash_sec_info sec_info)
static

Definition at line 74 of file cudbg_flash_utils.c.

References CUDBG_SF_MAX_SECTOR, CUDBG_START_SEC, CUDBG_STATUS_FLASH_FULL, and cudbg_flash_sec_info::sec_bitmap.

Referenced by cudbg_write_flash().

Here is the caller graph for this function:

◆ read_flash()

int read_flash ( struct adapter adap,
u32  start_sec,
void *  data,
u32  size,
u32  start_address 
)

Definition at line 468 of file cudbg_flash_utils.c.

References CUDBG_SF_SECTOR_SIZE, SF_PAGE_SIZE, and t4_read_flash().

Referenced by cudbg_read_flash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_sector_availability()

static void set_sector_availability ( struct cudbg_flash_sec_info sec_info,
int  sector_nu,
int  avail 
)
static

Definition at line 62 of file cudbg_flash_utils.c.

References CUDBG_START_SEC, reset_dbg_bitmap(), cudbg_flash_sec_info::sec_bitmap, and set_dbg_bitmap().

Referenced by cudbg_write_flash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_headers()

◆ update_skip_size()

void update_skip_size ( struct cudbg_flash_sec_info sec_info,
u32  size 
)

Definition at line 56 of file cudbg_flash_utils.c.

References cudbg_flash_sec_info::skip_size.

Referenced by wr_entity_to_flash().

Here is the caller graph for this function:

◆ write_flash()

int write_flash ( struct adapter adap,
u32  start_sec,
void *  data,
u32  size 
)

Definition at line 249 of file cudbg_flash_utils.c.

References CUDBG_SF_SECTOR_SIZE, DIV_ROUND_UP, adapter::params, adapter_params::sf_nsec, SF_PAGE_SIZE, adapter_params::sf_size, t4_flash_erase_sectors(), and t4_write_flash().

Referenced by cudbg_write_flash().

Here is the call graph for this function:
Here is the caller graph for this function: