#include "config.h"
#endif
-#include "lpc288x.h"
-#include "binarybuffer.h"
+#include "imp.h"
+#include <helper/binarybuffer.h>
#define LOAD_TIMER_ERASE 0
/* 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;
+ const 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);
if (CMD_ARGC < 6)
{
- LOG_WARNING("incomplete flash_bank LPC288x configuration");
- return ERROR_FLASH_BANK_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
lpc288x_info = malloc(sizeof(struct lpc288x_flash_bank));
}
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,
+};