for (i=0;i<count2;i++) *addr2++ = value2;
}
-#ifdef CSR_SPIFLASH_BASE
+#if (defined CSR_SPIFLASH_BASE && defined SPIFLASH_PAGE_SIZE)
static void fw(char *addr, char *value, char *count)
{
char *c;
puts("mr - read address space");
puts("mw - write address space");
puts("mc - copy address space");
+#if (defined CSR_SPIFLASH_BASE && defined SPIFLASH_PAGE_SIZE)
+ puts("fw - write to flash");
+#endif
puts("");
puts("crc - compute CRC32 of a part of the address space");
puts("ident - display identifier");
#endif
puts("serialboot - boot via SFL");
#ifdef FLASH_BOOT_ADDRESS
- puts("fw - write to flash");
puts("flashboot - boot from flash");
#endif
#ifdef ROM_BOOT_ADDRESS
if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
+#if (defined CSR_SPIFLASH_BASE && defined SPIFLASH_PAGE_SIZE)
+ else if(strcmp(token, "fw") == 0) fw(get_token(&c), get_token(&c), get_token(&c));
+#endif
else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));
else if(strcmp(token, "ident") == 0) ident();
else if(strcmp(token, "reboot") == 0) reboot();
#endif
#ifdef FLASH_BOOT_ADDRESS
- else if(strcmp(token, "fw") == 0) fw(get_token(&c), get_token(&c), get_token(&c));
else if(strcmp(token, "flashboot") == 0) flashboot();
#endif
#ifdef ROM_BOOT_ADDRESS