OpenOCD
fm3.c File Reference
Include dependency graph for fm3.c:

Go to the source code of this file.

Data Structures

struct  fm3_flash_bank
 

Macros

#define FLASH_DQ5   0x20 /* Time limit exceeding flag bit (TLOV) position */
 
#define FLASH_DQ6   0x40 /* Data toggle flag bit (TOGG) position */
 

Enumerations

enum  fm3_flash_type { FM3_NO_FLASH_TYPE = 0 , FM3_FLASH_TYPE1 = 1 , FM3_FLASH_TYPE2 = 2 }
 
enum  fm3_variant {
  MB9BFXX1 , MB9BFXX2 , MB9BFXX3 , MB9BFXX4 ,
  MB9BFXX5 , MB9BFXX6 , MB9BFXX7 , MB9BFXX8 ,
  MB9AFXX1 , MB9AFXX2 , MB9AFXX3 , MB9AFXX4 ,
  MB9AFXX5 , MB9AFXX6 , MB9AFXX7 , MB9AFXX8
}
 

Functions

 COMMAND_HANDLER (fm3_handle_chip_erase_command)
 
 FLASH_BANK_COMMAND_HANDLER (fm3_flash_bank_command)
 
static int fm3_auto_probe (struct flash_bank *bank)
 
static int fm3_busy_wait (struct target *target, uint32_t offset, int timeout_ms)
 
static int fm3_chip_erase (struct flash_bank *bank)
 
static int fm3_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int fm3_probe (struct flash_bank *bank)
 
static int fm3_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 

Variables

static const struct command_registration fm3_command_handlers []
 
static const struct command_registration fm3_exec_command_handlers []
 
const struct flash_driver fm3_flash
 

Macro Definition Documentation

◆ FLASH_DQ5

#define FLASH_DQ5   0x20 /* Time limit exceeding flag bit (TLOV) position */

Definition at line 22 of file fm3.c.

◆ FLASH_DQ6

#define FLASH_DQ6   0x40 /* Data toggle flag bit (TOGG) position */

Definition at line 21 of file fm3.c.

Enumeration Type Documentation

◆ fm3_flash_type

Enumerator
FM3_NO_FLASH_TYPE 
FM3_FLASH_TYPE1 
FM3_FLASH_TYPE2 

Definition at line 44 of file fm3.c.

◆ fm3_variant

Enumerator
MB9BFXX1 
MB9BFXX2 
MB9BFXX3 
MB9BFXX4 
MB9BFXX5 
MB9BFXX6 
MB9BFXX7 
MB9BFXX8 
MB9AFXX1 
MB9AFXX2 
MB9AFXX3 
MB9AFXX4 
MB9AFXX5 
MB9AFXX6 
MB9AFXX7 
MB9AFXX8 

Definition at line 24 of file fm3.c.

Function Documentation

◆ COMMAND_HANDLER()

COMMAND_HANDLER ( fm3_handle_chip_erase_command  )

Definition at line 933 of file fm3.c.

◆ FLASH_BANK_COMMAND_HANDLER()

◆ fm3_auto_probe()

static int fm3_auto_probe ( struct flash_bank bank)
static

Definition at line 793 of file fm3.c.

References bank, ERROR_OK, fm3_probe(), and fm3_flash_bank::probed.

◆ fm3_busy_wait()

static int fm3_busy_wait ( struct target target,
uint32_t  offset,
int  timeout_ms 
)
static

◆ fm3_chip_erase()

◆ fm3_erase()

◆ fm3_probe()

◆ fm3_write_block()

Variable Documentation

◆ fm3_command_handlers

const struct command_registration fm3_command_handlers[]
static
Initial value:
= {
{
.name = "fm3",
.mode = COMMAND_ANY,
.help = "fm3 Flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration fm3_exec_command_handlers[]
Definition: fm3.c:952

Definition at line 933 of file fm3.c.

◆ fm3_exec_command_handlers

const struct command_registration fm3_exec_command_handlers[]
static
Initial value:
= {
{
.name = "chip_erase",
.usage = "<bank>",
.handler = fm3_handle_chip_erase_command,
.mode = COMMAND_EXEC,
.help = "Erase entire Flash device.",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 933 of file fm3.c.

◆ fm3_flash

const struct flash_driver fm3_flash
Initial value:
= {
.name = "fm3",
.commands = fm3_command_handlers,
.flash_bank_command = fm3_flash_bank_command,
.erase = fm3_erase,
.write = fm3_write_block,
.probe = fm3_probe,
.auto_probe = fm3_auto_probe,
.erase_check = default_flash_blank_check,
.free_driver_priv = default_flash_free_driver_priv,
}
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
static int fm3_probe(struct flash_bank *bank)
Definition: fm3.c:622
static int fm3_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: fm3.c:193
static const struct command_registration fm3_command_handlers[]
Definition: fm3.c:963
static int fm3_auto_probe(struct flash_bank *bank)
Definition: fm3.c:793
static int fm3_write_block(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: fm3.c:337

Definition at line 933 of file fm3.c.