OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | ath79_flash_bank |
struct | ath79_spi_ctx |
struct | ath79_target |
Macros | |
#define | ATH79_MAX_TIMEOUT (3000) |
#define | ATH79_REG_CLOCK 4 |
#define | ATH79_REG_DATA 12 |
#define | ATH79_REG_FS 0 |
#define | ATH79_REG_WRITE 8 |
#define | ATH79_SPI_CE_HI 0x00100 |
#define | ATH79_SPI_CS0_HI 0x10000 |
#define | ATH79_SPI_CS1_HI 0x20000 |
#define | ATH79_SPI_CS2_HI 0x40000 |
#define | ATH79_SPI_CS_ALLHI 0x70000 |
#define | ATH79_SPI_DO_HI 0x00001 |
#define | ATH79_XFER_FINAL 0x00000001 |
#define | ATH79_XFER_PARTIAL 0x00000000 |
#define | BITS_PER_BYTE 8 |
Functions | |
static int | ath79_auto_probe (struct flash_bank *bank) |
static int | ath79_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | ath79_erase_sector (struct flash_bank *bank, int sector) |
static int | ath79_flash_blank_check (struct flash_bank *bank) |
static void | ath79_pracc_addn (struct pracc_queue_info *ctx, const uint32_t *instr, int n) |
static int | ath79_probe (struct flash_bank *bank) |
static int | ath79_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | ath79_protect_check (struct flash_bank *bank) |
static int | ath79_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | ath79_read_buffer (struct flash_bank *bank, uint8_t *buffer, uint32_t address, uint32_t len) |
static int | ath79_spi_bitbang_bytes (struct flash_bank *bank, uint8_t *data, int len, uint32_t flags) |
static int | ath79_spi_bitbang_chunk (struct flash_bank *bank, uint8_t *data, int len, int *transferred) |
static int | ath79_spi_bitbang_codegen (struct ath79_flash_bank *ath79_info, struct pracc_queue_info *ctx, uint8_t *data, int len, int partial_xfer) |
static void | ath79_spi_bitbang_prepare (struct flash_bank *bank) |
static int | ath79_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | ath79_write_buffer (struct flash_bank *bank, const uint8_t *buffer, uint32_t address, uint32_t len) |
static int | ath79_write_enable (struct flash_bank *bank) |
static int | ath79_write_page (struct flash_bank *bank, const uint8_t *buffer, uint32_t address, uint32_t len) |
static int | erase_command (struct flash_bank *bank, int sector) |
FLASH_BANK_COMMAND_HANDLER (ath79_flash_bank_command) | |
static int | get_ath79_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | read_flash_id (struct flash_bank *bank, uint32_t *id) |
static int | read_status_reg (struct flash_bank *bank, uint32_t *status) |
static int | wait_till_ready (struct flash_bank *bank, int timeout) |
Variables | |
static const uint32_t | ath79_chipselects [] |
const struct flash_driver | ath79_flash |
static const struct ath79_target | target_devices [] |
|
static |
Definition at line 845 of file ath79.c.
References ath79_probe(), bank, ERROR_OK, and ath79_flash_bank::probed.
|
static |
Definition at line 489 of file ath79.c.
References ath79_erase_sector(), bank, ath79_flash_bank::dev, flash_device::erase_cmd, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, keep_alive(), LOG_DEBUG, LOG_ERROR, ath79_flash_bank::probed, target::state, and TARGET_HALTED.
|
static |
Definition at line 473 of file ath79.c.
References ATH79_MAX_TIMEOUT, ath79_write_enable(), bank, erase_command(), ERROR_OK, and wait_till_ready().
Referenced by ath79_erase().
|
static |
|
static |
Definition at line 105 of file ath79.c.
References pracc_add().
Referenced by ath79_spi_bitbang_codegen().
|
static |
Definition at line 754 of file ath79.c.
References bank, ath79_flash_bank::dev, flash_device::device_id, ERROR_FAIL, ERROR_OK, flash_devices, jtag_tap::idcode, ath79_flash_bank::io_base, ath79_target::io_base, flash_sector::is_erased, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, ath79_target::name, flash_device::name, NULL, flash_sector::offset, ath79_spi_ctx::page_buf, flash_device::pagesize, ath79_flash_bank::probed, read_flash_id(), flash_device::sectorsize, flash_sector::size, flash_device::size_in_bytes, ath79_flash_bank::spi, SPIFLASH_DEF_PAGESIZE, target::tap, ath79_target::tap_idcode, TARGET_ADDR_FMT, and target_devices.
Referenced by ath79_auto_probe().
|
static |
|
static |
|
static |
Definition at line 702 of file ath79.c.
References ath79_read_buffer(), bank, buffer, count, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, LOG_WARNING, offset, target::state, and TARGET_HALTED.
|
static |
Definition at line 668 of file ath79.c.
References ath79_spi_bitbang_bytes(), ath79_spi_bitbang_prepare(), ATH79_XFER_FINAL, ATH79_XFER_PARTIAL, bank, buffer, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, LOG_INFO, and SPIFLASH_READ.
Referenced by ath79_read().
|
static |
Definition at line 324 of file ath79.c.
References ath79_spi_bitbang_chunk(), ATH79_XFER_FINAL, bank, ERROR_OK, ath79_spi_ctx::post_deselect, and ath79_flash_bank::spi.
Referenced by ath79_read_buffer(), ath79_write_enable(), ath79_write_page(), erase_command(), read_flash_id(), and read_status_reg().
|
static |
Definition at line 233 of file ath79.c.
References ath79_spi_bitbang_codegen(), bank, BITS_PER_BYTE, pracc_queue_info::code_count, mips32_common::ejtag_info, pracc_queue_info::ejtag_info, ERROR_FAIL, ERROR_OK, ath79_flash_bank::io_base, LOG_DEBUG, LOG_ERROR, LOG_LEVEL_IS, LOG_LVL_DEBUG, mips32_pracc_queue_exec(), PRACC_MAX_INSTRUCTIONS, pracc_queue_free(), pracc_queue_init(), pracc_queue_info::retval, pracc_queue_info::store_count, target_buffer_set_u32_array(), and target_to_mips32().
Referenced by ath79_spi_bitbang_bytes().
|
static |
Definition at line 113 of file ath79.c.
References ARRAY_SIZE, ath79_chipselects, ath79_pracc_addn(), ATH79_REG_DATA, ATH79_REG_FS, ATH79_REG_WRITE, ATH79_SPI_CE_HI, ATH79_SPI_CS_ALLHI, bit(), BITS_PER_BYTE, ath79_flash_bank::chipselect, pracc_queue_info::code_count, ath79_flash_bank::io_base, ath79_target::io_base, LOWER16, MIPS32_B, MIPS32_LUI, MIPS32_LW, MIPS32_MFC0, MIPS32_ORI, MIPS32_PRACC_PARAM_OUT, MIPS32_SW, MIPS32_XORI, NEG16, ath79_spi_ctx::post_deselect, pracc_add(), PRACC_OUT_OFFSET, PRACC_UPPER_BASE_ADDR, ath79_spi_ctx::pre_deselect, ath79_flash_bank::spi, and UPPER16.
Referenced by ath79_spi_bitbang_chunk().
|
static |
Definition at line 317 of file ath79.c.
References bank, ath79_spi_ctx::pre_deselect, and ath79_flash_bank::spi.
Referenced by ath79_read_buffer(), ath79_write_enable(), ath79_write_page(), erase_command(), read_flash_id(), and read_status_reg().
|
static |
Definition at line 633 of file ath79.c.
References ath79_write_buffer(), bank, buffer, count, ERROR_FAIL, ERROR_TARGET_NOT_HALTED, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_WARNING, flash_sector::offset, offset, flash_sector::size, target::state, and TARGET_HALTED.
|
static |
Definition at line 603 of file ath79.c.
References ath79_write_page(), bank, buffer, ath79_flash_bank::dev, ERROR_OK, LOG_DEBUG, flash_device::pagesize, and SPIFLASH_DEF_PAGESIZE.
Referenced by ath79_write().
|
static |
Definition at line 424 of file ath79.c.
References ath79_spi_bitbang_bytes(), ath79_spi_bitbang_prepare(), ATH79_XFER_FINAL, bank, ERROR_FAIL, ERROR_OK, LOG_ERROR, read_status_reg(), SPIFLASH_WE_BIT, SPIFLASH_WRITE_ENABLE, and status.
Referenced by ath79_erase_sector(), and ath79_write_page().
|
static |
Definition at line 541 of file ath79.c.
References ath79_spi_bitbang_bytes(), ath79_spi_bitbang_prepare(), ath79_write_enable(), ATH79_XFER_FINAL, ATH79_XFER_PARTIAL, bank, buffer, ath79_flash_bank::dev, ERROR_FAIL, ERROR_OK, LOG_ERROR, LOG_INFO, ath79_spi_ctx::page_buf, flash_device::pagesize, ath79_flash_bank::spi, SPIFLASH_DEF_PAGESIZE, and SPIFLASH_PAGE_PROGRAM.
Referenced by ath79_write_buffer().
|
static |
Definition at line 454 of file ath79.c.
References ath79_spi_bitbang_bytes(), ath79_spi_bitbang_prepare(), ATH79_XFER_FINAL, bank, ath79_flash_bank::dev, flash_device::erase_cmd, and offset.
Referenced by ath79_erase_sector().
FLASH_BANK_COMMAND_HANDLER | ( | ath79_flash_bank_command | ) |
Definition at line 347 of file ath79.c.
References bank, ath79_flash_bank::chipselect, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, LOG_DEBUG, and LOG_ERROR.
|
static |
|
static |
Definition at line 724 of file ath79.c.
References ath79_spi_bitbang_bytes(), ath79_spi_bitbang_prepare(), ATH79_XFER_FINAL, bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, SPIFLASH_READ_ID, target::state, and TARGET_HALTED.
Referenced by ath79_probe().
|
static |
Definition at line 383 of file ath79.c.
References ath79_spi_bitbang_bytes(), ath79_spi_bitbang_prepare(), ATH79_XFER_FINAL, bank, SPIFLASH_READ_STATUS, and status.
Referenced by ath79_write_enable(), and wait_till_ready().
|
static |
Definition at line 401 of file ath79.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, LOG_ERROR, read_status_reg(), SPIFLASH_BSY_BIT, status, and timeval_ms().
Referenced by ath79_erase_sector().
|
static |
Definition at line 99 of file ath79.c.
Referenced by ath79_spi_bitbang_codegen().
const struct flash_driver ath79_flash |
|
static |