]> git.sur5r.net Git - openocd/commitdiff
zy1000: unlock flash upon startup for revc
authorØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 30 Dec 2009 11:36:22 +0000 (12:36 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 30 Dec 2009 11:36:22 +0000 (12:36 +0100)
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/ecosboard.c

index d7fdabdb4d348d1d77d9f6761c8ce94897adc397..c31c596167a079855ebabf096ca11bea99e06000 100644 (file)
@@ -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)
        {