diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2009-12-30 12:36:22 +0100 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2009-12-30 12:36:22 +0100 |
commit | 2cf6d473752982b2ea46bf083ac9f5e7fe9c9d1b (patch) | |
tree | 9faf80df41aa6ca2ba772fa654b2a40f27c16d6a /src | |
parent | 272c33c190a72999697dd1d7b74a7603d30a84b8 (diff) | |
download | openocd+libswd-2cf6d473752982b2ea46bf083ac9f5e7fe9c9d1b.tar.gz openocd+libswd-2cf6d473752982b2ea46bf083ac9f5e7fe9c9d1b.tar.bz2 openocd+libswd-2cf6d473752982b2ea46bf083ac9f5e7fe9c9d1b.tar.xz openocd+libswd-2cf6d473752982b2ea46bf083ac9f5e7fe9c9d1b.zip |
zy1000: unlock flash upon startup for revc
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ecosboard.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ecosboard.c b/src/ecosboard.c index d7fdabdb..c31c5961 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -995,6 +995,20 @@ int main(int argc, char *argv[]) copydir("/rom", "/ram/cgi"); +#ifdef CYGPKG_HAL_NIOS2 + cyg_flashaddr_t err_address; +#define UNCACHED_EXT_FLASH_BASE (0x80000000 + EXT_FLASH_BASE) + /* The revc flash is locked upon reset, unlock it */ +#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING + if ((err = flash_unlock((void *) UNCACHED_EXT_FLASH_BASE, EXT_FLASH_SPAN, + (void **) &err_address)) != 0) + { + diag_printf("Error: could not unlock flash\n"); + } +#endif +#endif + + err = mount("/dev/flash1", "/config", "jffs2"); if (err < 0) { |