Here is a patch for homieflash 1.6 ...
Gives you the prompts to tinker with A16 -- not the cleanest code, but it works. I did try not to break the existing code, but I have no way of testing it. There is a patch file attached.
--- a/homieflash.c 2010-08-04 21:55:11.000000000 -0500
+++ b//homieflash.c 2010-08-04 21:55:17.000000000 -0500
@@ -97,6 +97,7 @@
*/
extern int errno; /* System error code */
off_t flash_start = FLASH_START;
+uint8_t lim64k = 0; /* true if we are limited to prog 64k at a time */
void
fatal(char *fmt, ...)
@@ -318,6 +319,19 @@
}
static void
+check_limit(const uint32_t index)
+{
+ // just skip all this if we don't have the a16 limitation
+ if (!lim64k) return;
+
+ if ( (1<<16) == index )
+ {
+ printf("assert A16 and then press enter\n");
+ getchar();
+ }
+}
+
+static void
flash_write(volatile uint8_t *flash, size_t flash_mem_size, u_char flags,
uint8_t *newflash)
{
@@ -341,6 +355,10 @@
}
printf("programming...\n");
for (c = 0; c < flash_mem_size; c++) {
+
+ check_limit(c);
+
+
if (flags & FLASH_FLAG_INTEL) {
intel_writebyte(flash, c, newflash[c]);
} else {
@@ -351,8 +369,19 @@
/* Switch back to read mode */
flash[COMMAND1_ADDR] = 0x00;
}
+
+
+ if (lim64k)
+ {
+ printf("deassert A16 and then press enter\n");
+ getchar();
+ }
+
printf("verifying...\n");
for (c = 0; c < flash_mem_size; c++) {
+
+ check_limit(c);
+
if (flash[c] == newflash[c]) {
continue;
}
@@ -378,7 +407,7 @@
flash_mem_size = FLASH_SIZE;
dump = dowrite = 0;
filename = NULL;
- while ((ch = getopt(argc, argv, "f:d:w:")) != EOF) {
+ while ((ch = getopt(argc, argv, "f:d:w:g")) != EOF) {
switch (ch) {
case 'f':
if (sscanf(optarg, "%x", &addr) == EOF) {
@@ -398,6 +427,9 @@
filename = optarg;
dowrite = 1;
break;
+ case 'g':
+ lim64k = 1;
+ break;
default:
badarg(argv[0]);
}
@@ -424,23 +456,44 @@
if (newflash == NULL) {
fatal("can't malloc flash buffer");
}
+
+
if (dump) {
printf("Dumping flash contents to %s...\n", filename);
ofd = creat(filename, 0666);
if (ofd == -1) {
fatal("Cannot open output file %s", filename);
}
+
+
/* Read flash to memory, to be extra cautious */
- memcpy(newflash, flash, flash_mem_size);
+ if (lim64k)
+ {
+ printf("deassert A16 press enter to continue\n"); getchar();
+ memcpy(newflash, flash, (1<<16));
+ printf("assert A16 press enter to continue\n"); getchar();
+ memcpy(newflash + (1<<16), flash+(1<<16), (1<<16));
+ }
+ else
+ {
+ memcpy(newflash, flash, flash_mem_size);
+ }
if (write(ofd, newflash, flash_mem_size) != flash_mem_size) {
fatal("error writing %s", filename);
}
+
+
close(ofd);
printf("Saving to %s complete\n", filename);
} else if (dowrite) {
if (readfile(filename, newflash, flash_mem_size)) {
fatal("error reading %s", filename);
}
+ if (lim64k)
+ {
+ printf("deassert A16 press enter to continue\n"); getchar();
+ }
+
flash_write(flash, flash_mem_size, flash_ent->flags, newflash);
}


Reply With Quote
anyway, the only other thing is just to know which way the switch is asserted and deasserted and you will be good to go. 
