X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fecosboard.c;h=2e73585d0bedfb7f591118961ef80fd5df767182;hb=b7fa16eeacb368dca8862168088bc6c491f0ffb1;hp=2a9950d6c9f9d4ec504f007b27009f7b311e2ccf;hpb=4639366947427da6face9cb6954b6603eb2e2fd3;p=openocd.git diff --git a/src/ecosboard.c b/src/ecosboard.c index 2a9950d6c9..2e73585d0b 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -32,6 +32,7 @@ #include #include + #include #include #include @@ -53,33 +54,15 @@ #include #include #include -#include -#include -#include #include +#include #include -#include "rom.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include -#include +#include "rom.h" #ifdef CYGPKG_HAL_NIOS2 +#include #define ZY1000_SER_DEV "/dev/uart_0" #else #define ZY1000_SER_DEV "/dev/ser0" @@ -163,7 +146,14 @@ static void zylinjtag_reboot(cyg_addrword_t data) diag_printf("Unmounting /config..\n"); umount("/config"); diag_printf("Rebooting..\n"); +#ifdef CYGPKG_HAL_NIOS2 + /* This will reboot & reconfigure the FPGA from the bootloader + * and on. + */ + IOWR(REMOTE_UPDATE_BASE, 0x20, 0x1); +#else HAL_PLATFORM_RESET(); +#endif } static cyg_thread zylinjtag_thread_object; static cyg_handle_t zylinjtag_thread_handle; @@ -966,7 +956,11 @@ int main(int argc, char *argv[]) diag_init_putc(_zylinjtag_diag_write_char); // We want this in the log. - diag_printf("Zylin ZY1000.\n"); +#ifdef CYGPKG_HAL_NIOS2 + diag_printf("Zylin ZY1000 PCB revc.\n"); +#else + diag_printf("Zylin ZY1000 PCB revb.\n"); +#endif err = mount("", "/ram", "ramfs"); if (err < 0) @@ -1005,6 +999,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) { @@ -1093,7 +1101,7 @@ int main(int argc, char *argv[]) NULL, NULL); #endif - Jim_CreateCommand(httpstate.jim_interp, "uart", zylinjtag_Jim_Command_uart, NULL, NULL); + Jim_CreateCommand(httpstate.jim_interp, "zy1000_uart", zylinjtag_Jim_Command_uart, NULL, NULL); log_init();