#include <common.h>
#include <flash.h>
#include <asm/io.h>
-#include "memio.h"
+#include "memio.h"
/*---------------------------------------------------------------------*/
#undef DEBUG_FLASH
-//#define DEBUG_FLASH
#ifdef DEBUG_FLASH
#define DEBUGF(fmt,args...) printf(fmt ,##args)
unsigned char x;
flash_xd_nest --;
-
+
if (flash_xd_nest == 0)
{
DEBUGF("Flash on memory bus\n");
/* monitor protection ON by default */
flash_protect(FLAG_PROTECT_SET,
CFG_MONITOR_BASE,
- CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+ CFG_MONITOR_BASE + monitor_flash_len - 1,
&flash_info[0]);
#endif
/* set sector offsets for uniform sector type */
for (i = 0; i < info->sector_count; i++) {
info->start[i] = base + i * info->size /
- info->sector_count;
+ info->sector_count;
}
break;
default:
}
if ((rc = write_word(info, wp, data)) != 0) {
- flash_to_mem();
+ flash_to_mem();
return (rc);
}
wp += 4;
data = (data << 8) | *src++;
}
if ((rc = write_word(info, wp, data)) != 0) {
- flash_to_mem();
+ flash_to_mem();
return (rc);
}
wp += 4;
*/
static void flash_reset (ulong addr)
{
- flash_to_xd();
+ flash_to_xd();
out8(addr, 0xF0); /* reset bank */
iobarrier_rw();
flash_to_mem();
info->size / 0x100000, info->sector_count);
} else if (info->size % 0x400 == 0) {
printf (" Size: %ld KB in %d Sectors\n",
- info->size / 0x400, info->sector_count);
+ info->size / 0x400, info->sector_count);
} else {
printf (" Size: %ld B in %d Sectors\n",
- info->size, info->sector_count);
+ info->size, info->sector_count);
}
printf (" Sector Start Addresses:");