Default JEDEC entry for M25P80 on Telos B.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 26 Feb 2011 18:34:58 +0000 (18:34 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 26 Feb 2011 18:34:58 +0000 (18:34 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@957 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETCCSPI.py
client/GoodFETSPI.py

index 3e17532..39fa181 100644 (file)
@@ -294,6 +294,7 @@ class GoodFETCCSPI(GoodFET):
         for foo in packet:
             s="%s %02x" % (s,ord(foo));
         print "#%s" % s;
+        
     def printdissect(self,packet):
         try:
             from scapy.all import Dot15d4
index 9c684b7..7f48a5a 100644 (file)
@@ -77,17 +77,24 @@ class GoodFETSPIFlash(GoodFETSPI):
     JEDECsize=0;
 
     def SPIjedec(self):
-        """Grab an SPI Flash ROM's JEDEC bytes."""
+        """Grab an SPI Flash ROM's JEDEC bytes.  Some chips don't implement
+        this, such as Numonyx M25P* except in the 110nm processed."""
         data=[0x9f, 0, 0, 0];
         data=self.SPItrans(data);
-        
+        jedec=0;
         self.JEDECmanufacturer=ord(data[1]);
-        self.JEDECtype=ord(data[2]);
-        self.JEDECcapacity=ord(data[3]);
+        if self.JEDECmanufacturer==0xFF:
+            self.JEDECtype=0x20;
+            self.JEDECcapacity=0x14;
+            jedec=0x202014;
+        else:
+            self.JEDECtype=ord(data[2]);
+            self.JEDECcapacity=ord(data[3]);
+            jedec=(ord(data[1])<<16)+(ord(data[2])<<8)+ord(data[3]);
         self.JEDECsize=self.JEDECsizes.get(self.JEDECcapacity);
         if self.JEDECsize==None:
             self.JEDECsize=0;
-        jedec=(ord(data[1])<<16)+(ord(data[2])<<8)+ord(data[3]);
+        
         if jedec==0x1F4501:
             self.JEDECsize=1024**2;
         self.JEDECdevice=jedec;