hi everyone !!
I'm trying to burn romimage on the VIA-EPIA (VIA C3-800 Mhz, VT8231)
I just succeeded in making romimage, and I cd into /freebios/util/flash_and_burn, and type make to compile.
Finally, I got excutive file "flash_rom".
To test "flash_rom", I typed flash_rom without any parameter. and I saw following message
Calibrating timer since microsleep sucks ... takes a second Setting up microsecond timing loop 153M loops per second OK, calibrated, now do the deed Enabling flash write on VT8231...tried to set 0x44 to 0x54 on VT8231 failed (WARNING ONLY) Trying Am29F040B, 512 KB probe_29f040b: id1 0x25, id2 0xa6 Trying At29C040A, 512 KB probe_jedec: id1 0xbf, id2 0xb6 Trying Mx29f002, 256 KB probe_29f002: id1 191, id2 182 Trying SST29EE020A, 256 KB probe_jedec: id1 0xbf, id2 0xb6 Trying SST28SF040A, 512 KB probe_28sf040: id1 0x25, id2 0xa6 Trying SST39SF020A, 256 KB probe_39sf020: id1 0xbf, id2 0xb6 SST39SF020A found at physical address: 0xfffc0000 Part is SST39SF020A OK, only ENABLING flash write, but NOT FLASHING
and then, I type "./flash_rom /root/epia/romimage".
"/root/epia/romimage" is a full path of romimage I had made.
I saw messges like below
Calibrating timer since microsleep sucks ... takes a second Setting up microsecond timing loop 152M loops per second OK, calibrated, now do the deed Enabling flash write on VT8231...OK Trying Am29F040B, 512 KB probe_29f040b: id1 0x25, id2 0xa6 Trying At29C040A, 512 KB probe_jedec: id1 0xbf, id2 0xb6 Trying Mx29f002, 256 KB probe_29f002: id1 191, id2 182 Trying SST29EE020A, 256 KB probe_jedec: id1 0xbf, id2 0xb6 Trying SST28SF040A, 512 KB probe_28sf040: id1 0x25, id2 0xa6 Trying SST39SF020A, 256 KB probe_39sf020: id1 0xbf, id2 0xb6 SST39SF020A found at physical address: 0xfffc0000 Part is SST39SF020A
I thought, romimage was burnt on my rom......... I reboot the system, buf nothing was changed............
What's wrong with my procedure.....................
I did change original rom..............................
is it impossible to burn image on the original rom ?
If so, What should I do?
Please, give me your wise advice.....
_________________________________________________________________ 책상위에 다리 올리고 느긋하게 즐긴다... MSN 온라인 상영관 http://vod.msn.co.kr
On Wed, 23 Jul 2003, gimyung han wrote:
and then, I type "./flash_rom /root/epia/romimage".
it's annoying, but you have to say: ./flash_rom -w /root/epia/romimage.
That should do it.
ron
On Wed, Jul 23, 2003 at 12:51:00PM -0600, ron minnich wrote:
On Wed, 23 Jul 2003, gimyung han wrote:
and then, I type "./flash_rom /root/epia/romimage".
it's annoying, but you have to say: ./flash_rom -w /root/epia/romimage.
I thought this was a bug made by me and sent a patch to Ron some weeks ago, but it seems it is not committed.
-- Takeshi
On Thu, 24 Jul 2003, SONE Takeshi wrote:
On Wed, Jul 23, 2003 at 12:51:00PM -0600, ron minnich wrote:
On Wed, 23 Jul 2003, gimyung han wrote:
and then, I type "./flash_rom /root/epia/romimage".
it's annoying, but you have to say: ./flash_rom -w /root/epia/romimage.
I thought this was a bug made by me and sent a patch to Ron some weeks ago, but it seems it is not committed.
resend patch?
ron
On Thu, Jul 24, 2003 at 08:38:44AM -0600, ron minnich wrote:
I thought this was a bug made by me and sent a patch to Ron some weeks ago, but it seems it is not committed.
resend patch?
Attached is CVS diff against my current tree. Beside 2 bug fixes (both by me), this includes some enhancements. If you can't accept these, I will make a patch consists of only bug fixes.
* Fixed to do write operation when no option but a filename is supplied * Fixed wrong error report when enabling flash on vt8231 * Changed to report progress every 4KB instead of byte by byte on some chips (significantly speeds up flashing those chips) * Added -c option: only specified Flash ROM is probed; this saves BIOS Savior users from accidentially overwrite the "known good" BIOS if he/she forgot to toggle the switch.
Index: flash_rom.c =================================================================== RCS file: /cvsroot/freebios/freebios/util/flash_and_burn/flash_rom.c,v retrieving revision 1.21 diff -u -r1.21 flash_rom.c --- flash_rom.c 22 Jul 2003 10:12:08 -0000 1.21 +++ flash_rom.c 24 Jul 2003 17:02:07 -0000 @@ -33,6 +33,7 @@ #include <unistd.h> #include <stdio.h> #include <pci/pci.h> +#include <string.h>
#include "flash.h" #include "jedec.h" @@ -69,6 +70,8 @@ {NULL,} };
+char *chip_to_probe = NULL; + int enable_flash_sis630 (struct pci_dev *dev, char *name) { char b; @@ -127,7 +130,6 @@ enable_flash_e7500(struct pci_dev *dev, char *name) { /* register 4e.b gets or'ed with one */ unsigned char old, new; - int ok; /* if it fails, it fails. There are so many variations of broken mobos * that it is hard to argue that we should quit at this point. */ @@ -139,11 +141,11 @@ if (new == old) return 0;
- ok = pci_write_byte(dev, 0x4e, new); + pci_write_byte(dev, 0x4e, new);
- if (ok != new) { + if (pci_read_byte(dev, 0x4e) != new) { printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", - old, new, name); + 0x4e, new, name); return -1; } return 0; @@ -189,21 +191,15 @@
int enable_flash_vt8231(struct pci_dev *dev, char *name) { - unsigned char old, new; - int ok; + unsigned char val;
- old = pci_read_byte(dev, 0x40); - - new = old | 0x10; + val = pci_read_byte(dev, 0x40); + val |= 0x10; + pci_write_byte(dev, 0x40, val);
- if (new == old) - return 0; - - ok = pci_write_byte(dev, 0x40, new); - - if (ok != 0) { + if (pci_read_byte(dev, 0x40) != val) { printf("tried to set 0x%x to 0x%x on %s failed (WARNING ONLY)\n", - old, new, name); + 0x40, val, name); return -1; } return 0; @@ -278,6 +274,10 @@ }
while (flash->name != NULL) { + if (chip_to_probe && strcmp(flash->name, chip_to_probe) != 0) { + flash++; + continue; + } printf("Trying %s, %d KB\n", flash->name, flash->total_size); size = flash->total_size * 1024; bios = mmap (0, size, PROT_WRITE | PROT_READ, MAP_SHARED, @@ -425,10 +425,11 @@
void usage(const char *name) { - printf("usage: %s [-rwv] [file]\n", name); + printf("usage: %s [-rwv] [-c chipname][file]\n", name); printf("-r: read flash and save into file\n" "-w: write file into flash (default when file is specified)\n" "-v: verify flash against file\n" + "-c: probe only for specified flash chip\n" " If no file is specified, then all that happens\n" " is that flash info is dumped\n"); exit(1); @@ -444,7 +445,10 @@ int opt; int read_it = 0, write_it = 0, verify_it = 0; char *filename = NULL; - while ((opt = getopt(argc, argv, "rwv")) != EOF) { + + setbuf(stdout, NULL); + + while ((opt = getopt(argc, argv, "rwvc:")) != EOF) { switch (opt) { case 'r': read_it = 1; @@ -455,6 +459,9 @@ case 'v': verify_it = 1; break; + case 'c': + chip_to_probe = strdup(optarg); + break; default: usage(argv[0]); break; @@ -509,7 +516,7 @@ fclose(image); }
- if (write_it) + if (write_it || (!read_it && !verify_it)) flash->write (flash, buf); if (verify_it) verify_flash (flash, buf, /* verbose = */ 0); Index: mx29f002.c =================================================================== RCS file: /cvsroot/freebios/freebios/util/flash_and_burn/mx29f002.c,v retrieving revision 1.4 diff -u -r1.4 mx29f002.c --- mx29f002.c 11 Feb 2003 16:09:12 -0000 1.4 +++ mx29f002.c 24 Jul 2003 17:02:07 -0000 @@ -97,7 +97,8 @@ printf ("Programming Page: "); for (i = 0; i < total_size; i++) { /* write to the sector */ - printf ("address: 0x%08lx", i); + if ((i & 0xfff) == 0) + printf ("address: 0x%08lx", i); *(bios + 0x5555) = 0xAA; *(bios + 0x2AAA) = 0x55; *(bios + 0x5555) = 0xA0; @@ -106,7 +107,8 @@ /* wait for Toggle bit ready */ toggle_ready_jedec(dst);
- printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); + if ((i & 0xfff) == 0) + printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); } #endif printf("\n"); Index: w49f002u.c =================================================================== RCS file: /cvsroot/freebios/freebios/util/flash_and_burn/w49f002u.c,v retrieving revision 1.2 diff -u -r1.2 w49f002u.c --- w49f002u.c 28 Feb 2003 17:21:38 -0000 1.2 +++ w49f002u.c 24 Jul 2003 17:02:07 -0000 @@ -97,7 +97,8 @@ printf ("Programming Page: "); for (i = 0; i < total_size; i++) { /* write to the sector */ - printf ("address: 0x%08lx", i); + if ((i & 0xfff) == 0) + printf ("address: 0x%08lx", i); *(bios + 0x5555) = 0xAA; *(bios + 0x2AAA) = 0x55; *(bios + 0x5555) = 0xA0; @@ -106,7 +107,8 @@ /* wait for Toggle bit ready */ toggle_ready_jedec(dst);
- printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); + if ((i & 0xfff) == 0) + printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); } #endif printf("\n");
I committed these patches, please test.
thanks
ron
On Thu, Jul 24, 2003 at 10:38:08PM -0600, ron minnich wrote:
I committed these patches, please test.
It compiles and works fine for me.
Btw, Ron, could you commit my other fix to elfboot.c in the freebios tree? It's a trivial bug fix, the freebios2 tree seems already has that fix applied by Eric.
Index: elfboot.c =================================================================== RCS file: /cvsroot/freebios/freebios/src/lib/elfboot.c,v retrieving revision 1.15 diff -u -r1.15 elfboot.c --- elfboot.c 10 Oct 2002 22:23:43 -0000 1.15 +++ elfboot.c 26 Jul 2003 17:37:56 -0000 @@ -368,6 +368,7 @@ int i; memset(head, 0, sizeof(*head)); head->next = head->prev = head; + head->phdr_next = head->phdr_prev = head; for(i = 0; i < headers; i++) { struct segment *new; /* Ignore data that I don't need to handle */
try using the -w switch with the path to your rom
Brian G Rhodes bgr@linespeed.net brhodes@visualcircuits.com +1 612-741-1191
On Wed, 23 Jul 2003, gimyung han wrote:
hi everyone !!
I'm trying to burn romimage on the VIA-EPIA (VIA C3-800 Mhz, VT8231)
I just succeeded in making romimage, and I cd into /freebios/util/flash_and_burn, and type make to compile.
Finally, I got excutive file "flash_rom".
To test "flash_rom", I typed flash_rom without any parameter. and I saw following message
Calibrating timer since microsleep sucks ... takes a second Setting up microsecond timing loop 153M loops per second OK, calibrated, now do the deed Enabling flash write on VT8231...tried to set 0x44 to 0x54 on VT8231 failed (WARNING ONLY) Trying Am29F040B, 512 KB probe_29f040b: id1 0x25, id2 0xa6 Trying At29C040A, 512 KB probe_jedec: id1 0xbf, id2 0xb6 Trying Mx29f002, 256 KB probe_29f002: id1 191, id2 182 Trying SST29EE020A, 256 KB probe_jedec: id1 0xbf, id2 0xb6 Trying SST28SF040A, 512 KB probe_28sf040: id1 0x25, id2 0xa6 Trying SST39SF020A, 256 KB probe_39sf020: id1 0xbf, id2 0xb6 SST39SF020A found at physical address: 0xfffc0000 Part is SST39SF020A OK, only ENABLING flash write, but NOT FLASHING
and then, I type "./flash_rom /root/epia/romimage".
"/root/epia/romimage" is a full path of romimage I had made.
I saw messges like below
Calibrating timer since microsleep sucks ... takes a second Setting up microsecond timing loop 152M loops per second OK, calibrated, now do the deed Enabling flash write on VT8231...OK Trying Am29F040B, 512 KB probe_29f040b: id1 0x25, id2 0xa6 Trying At29C040A, 512 KB probe_jedec: id1 0xbf, id2 0xb6 Trying Mx29f002, 256 KB probe_29f002: id1 191, id2 182 Trying SST29EE020A, 256 KB probe_jedec: id1 0xbf, id2 0xb6 Trying SST28SF040A, 512 KB probe_28sf040: id1 0x25, id2 0xa6 Trying SST39SF020A, 256 KB probe_39sf020: id1 0xbf, id2 0xb6 SST39SF020A found at physical address: 0xfffc0000 Part is SST39SF020A
I thought, romimage was burnt on my rom......... I reboot the system, buf nothing was changed............
What's wrong with my procedure.....................
I did change original rom..............................
is it impossible to burn image on the original rom ?
If so, What should I do?
Please, give me your wise advice.....
책상위에 다리 올리고 느긋하게 즐긴다... MSN 온라인 상영관 http://vod.msn.co.kr
Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios