Atmel JEDEC info for SPI Flash.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 29 Sep 2009 23:06:39 +0000 (23:06 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 29 Sep 2009 23:06:39 +0000 (23:06 +0000)
Commented choice of chunk size, which must be an even fraction of the page size.

git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@155 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETSPI.py
client/goodfet.spiflash
firmware/apps/spi/spi.c
firmware/lib/command.c

index e0a6126..5d42354 100644 (file)
@@ -29,7 +29,8 @@ class GoodFETSPIFlash(GoodFETSPI):
     JEDECmanufacturers={0xFF: "MISSING",
                         0xEF: "Winbond",
                         0xC2: "MXIC",
-                        0x20: "Numonyx/ST"
+                        0x20: "Numonyx/ST",
+                        0x1F: "Atmel"
                         };
 
     JEDECdevices={0xFFFFFF: "MISSING",
index 8d93e3a..1005617 100755 (executable)
@@ -126,6 +126,8 @@ if(sys.argv[1]=="flash"):
 
     i=start;
     chars=list(file.read());
+    
+    #N.B., chunksize must be an even fraction of 0x100.
     chunksize=0x80;
     
     while i<=stop:
index c21cbc1..6e503f2 100644 (file)
@@ -66,9 +66,11 @@ unsigned char spitrans8(unsigned char byte){
 //! Enable SPI writing
 void spiflash_wrten(){
   SETSS;
+  /*
   P5OUT&=~SS; //Drop !SS to begin transaction.
   spitrans8(0x04);//Write Disable
   P5OUT|=SS;  //Raise !SS to end transaction.
+  */
   P5OUT&=~SS; //Drop !SS to begin transaction.
   spitrans8(0x06);//Write Enable
   P5OUT|=SS;  //Raise !SS to end transaction.
@@ -205,7 +207,7 @@ void spihandle(unsigned char app,
   case SPI_JEDEC://Grab 3-byte JEDEC ID.
     P5OUT&=~SS; //Drop !SS to begin transaction.
     spitrans8(0x9f);
-    len=3;
+    len=3;  //Length is variable in some chips, 3 minimum.
     for(i=0;i<len;i++)
       cmddata[i]=spitrans8(cmddata[i]);
     txdata(app,verb,len);
index afeb3f9..35afbfb 100644 (file)
@@ -9,7 +9,6 @@
 
 unsigned char cmddata[256];
 
-
 //! Transmit a string.
 void txstring(unsigned char app,
              unsigned char verb,