X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Flpc288x.c;h=d8cecc0b10d1a1fa7e18b9ab76f35234e06f9bdc;hp=446fc9da58677787236e61117056b83554a3fe74;hb=4cc359794420dbe0aedba38bde0ee4d871cdb354;hpb=fe9228a32db930be297d4d3b35ffb94d6de1b9ab diff --git a/src/flash/nor/lpc288x.c b/src/flash/nor/lpc288x.c index 446fc9da58..d8cecc0b10 100644 --- a/src/flash/nor/lpc288x.c +++ b/src/flash/nor/lpc288x.c @@ -31,8 +31,8 @@ #include "config.h" #endif -#include "lpc288x.h" -#include "binarybuffer.h" +#include "imp.h" +#include #define LOAD_TIMER_ERASE 0 @@ -84,6 +84,19 @@ /* F_CLK_TIME */ #define FCT_CLK_DIV_MASK 0x0FFF +struct lpc288x_flash_bank +{ + uint32_t working_area; + uint32_t working_area_size; + + /* chip id register */ + uint32_t cidr; + char * target_name; + uint32_t cclk; + + uint32_t sector_size_break; +}; + static uint32_t lpc288x_wait_status_busy(struct flash_bank *bank, int timeout); static void lpc288x_load_timer(int erase, struct target *target); static void lpc288x_set_flash_clk(struct flash_bank *bank); @@ -472,14 +485,15 @@ static int lpc288x_protect(struct flash_bank *bank, int set, int first, int last } struct flash_driver lpc288x_flash = { - .name = "lpc288x", - .flash_bank_command = &lpc288x_flash_bank_command, - .erase = &lpc288x_erase, - .protect = &lpc288x_protect, - .write = &lpc288x_write, - .probe = &lpc288x_probe, - .auto_probe = &lpc288x_probe, - .erase_check = &lpc288x_erase_check, - .protect_check = &lpc288x_protect_check, - .info = &lpc288x_info, - }; + .name = "lpc288x", + .flash_bank_command = lpc288x_flash_bank_command, + .erase = lpc288x_erase, + .protect = lpc288x_protect, + .write = lpc288x_write, + .read = default_flash_read, + .probe = lpc288x_probe, + .auto_probe = lpc288x_probe, + .erase_check = lpc288x_erase_check, + .protect_check = lpc288x_protect_check, + .info = lpc288x_info, +};