Hi all.
These are the changes I had to do the flashrom to get my in circuit
programer working. Not much as you can see.
Unfortunately it seems to have problems writing to the chip. The first
time I tried it it worked well. Writing random data to the chip. But
when I then tried to write the bios image. After several tries, adding
more capacitors, increasing the bus speed (yes increasing not
decreasing) and always erasing the chip before doing a write I got
good write. There where a couple of write runs that seems to be get
partial success, parts of the bios looked okay while parts where still
all FF. Increasing the bus speed seemed to make it write more data.
I have some pictures of the programer here:
http://irc.walkyrie.se/coreboot/pictures/
Signed-off-by: Jakob Bornecrantz <[email protected]>
Cheers Jakob.
Index: ft2232_spi.c
===================================================================
--- ft2232_spi.c (revision 632)
+++ ft2232_spi.c (working copy)
@@ -29,6 +29,14 @@
#include <ftdi.h>
+/* Select chip to connect to, exactly one must be set */
+#define USE_FT2232 1
+#define USE_FT4232 0
+
+/* Select interface to use, exactly one must be set.*/
+#define USE_INTERFACE_A 1
+#define USE_INTERFACE_B 0
+
/* the 'H' chips can run internally at either 12Mhz or 60Mhz.
* the non-H chips can only run at 12Mhz. */
#define CLOCK_5X 1
@@ -78,8 +86,13 @@
return EXIT_FAILURE;
}
- // f = ftdi_usb_open(ftdic, 0x0403, 0x6010); // FT2232
+#if USE_FT2232
+ f = ftdi_usb_open(ftdic, 0x0403, 0x6010); // FT2232
+#elif USE_FT4232
f = ftdi_usb_open(ftdic, 0x0403, 0x6011); // FT4232
+#else
+#error "Select either FT2232 or FT4232"
+#endif
if (f < 0 && f != -5) {
fprintf(stderr, "Unable to open ftdi device: %d (%s)\n", f,
@@ -87,10 +100,19 @@
exit(-1);
}
+#if USE_INTERFACE_A
+ if (ftdi_set_interface(ftdic, INTERFACE_A) < 0) {
+ fprintf(stderr, "Unable to select FT2232 channel A: %s\n",
+ ftdic->error_str);
+ }
+#elif USE_INTERFACE_B
if (ftdi_set_interface(ftdic, INTERFACE_B) < 0) {
fprintf(stderr, "Unable to select FT2232 channel B: %s\n",
ftdic->error_str);
}
+#else
+#error "Select either interface A or B"
+#endif
if (ftdi_usb_reset(ftdic) < 0) {
fprintf(stderr, "Unable to reset ftdi device\n");
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot