Modifications for 1.1.6:
======================================================================
+* Fixed flash problems on OXC board.
+
+* That ugly bug raised it's head again: Fixed mkimage bug that caused
+ bad headers when image was on NFS mounted filesystem (reported for
+ RH-7.1 on client and server)
+
* Added MVS1 configuration
(Howard Gray, 23 Apr 2002)
flash_info[i].flash_id = FLASH_UNKNOWN;
}
- size = flash_get_size((vu_char *)CFG_FLASH0_BASE, &flash_info[0]);
- if (!size || (flash_info[0].flash_id != FLASH_STM800DB &&
- flash_info[0].flash_id != FLASH_STM800DT))
+ /*
+ * We use the following trick here: since flash is cyclically
+ * mapped in the 0xFF800000-0xFFFFFFFF area, we detect the type
+ * and the size of flash using 0xFF800000 as the base address,
+ * and then call flash_get_size() again to fill flash_info.
+ */
+ size = flash_get_size((vu_char *)CFG_FLASH_PRELIMBASE, &flash_info[0]);
+ if (size)
{
- size = flash_get_size((vu_char *)CFG_FLASH1_BASE, &flash_info[0]);
+ flash_get_size((vu_char *)(-size), &flash_info[0]);
}
#if (CFG_MONITOR_BASE >= CFG_FLASH0_BASE) || \
return;
}
- switch (info->flash_id >> 16) {
- case 0x20:
+ switch (info->flash_id & FLASH_VENDMASK) {
+ case FLASH_MAN_STM:
printf ("ST ");
break;
default:
devid = addr[2];
/* only support STM */
- if (vendor != 0x20) {
+ if ((vendor << 16) != FLASH_MAN_STM) {
return 0;
}
(void) munmap((void *)ptr, sbuf.st_size);
+ /* We're a bit of paranoid */
+#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__)
+ (void) fdatasync (ifd);
+#else
+ (void) fsync (ifd);
+#endif
+
if (close(ifd)) {
fprintf (stderr, "%s: Write error on %s: %s\n",
cmdname, imagefile, strerror(errno));