Hi All,

I have problems doing that and want to discuss with you to get best decision.
The problems are:
* flash command set different from one currently supported (current
command set is defined through macro-definitions)
* all pages need to be unlocked one by one with CLB command prior to
erasing even if EA (erase all) command is used.

I think, good way to do this support is to have some structure, which
describes flash interface (command set, capabilities, etc)
For example:

enum {
    CMD_WP,
    CMD_WPL,
    CMD_EA,
    ................
    CMD_LAST,
    CMD_UNSUPPORTED = 0x100
};


const uint16_t cmd_set_default[CMD_LAST] = { <default cmd set> };
const uint16_t cmd_set_L[CMD_LAST] = { [CMD_WP] = 0x01, [CMD_WPL] =
0x02 , <etc.> };

struct flash_descriptor {
    uint16_t num_pages,
    uint8_t num_nvmbits,
    uint16 ** cmd_set,
}


Something like that. Any other ideas?

Best regards, Denis Kuzmenko.
-- 
Please avoid sending me RAR archives, as I can't unpack them with free software.
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to