projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changes to the rtr sweep method in communication file
[goodfet]
/
client
/
GoodFETSPI.py
diff --git
a/client/GoodFETSPI.py
b/client/GoodFETSPI.py
index
6c8f504
..
b071d50
100644
(file)
--- a/
client/GoodFETSPI.py
+++ b/
client/GoodFETSPI.py
@@
-5,11
+5,12
@@
#
# This code is being rewritten and refactored. You've been warned!
#
# This code is being rewritten and refactored. You've been warned!
-import sys, time, string, cStringIO, struct, glob,
serial,
os;
+import sys, time, string, cStringIO, struct, glob, os;
from GoodFET import GoodFET;
class GoodFETSPI(GoodFET):
from GoodFET import GoodFET;
class GoodFETSPI(GoodFET):
+ APP=0x01;
def SPIsetup(self):
"""Move the FET into the SPI application."""
self.writecmd(0x01,0x10,0,self.data); #SPI/SETUP
def SPIsetup(self):
"""Move the FET into the SPI application."""
self.writecmd(0x01,0x10,0,self.data); #SPI/SETUP
@@
-61,6
+62,7
@@
class GoodFETSPIFlash(GoodFETSPI):
0xC22014: "MX25L8005",
0xC22013: "MX25L4005",
0x204011: "M45PE10",
0xC22014: "MX25L8005",
0xC22013: "MX25L4005",
0x204011: "M45PE10",
+ 0x202014: "M25P80",
0x1f4501: "AT24DF081",
};
0x1f4501: "AT24DF081",
};
@@
-76,17
+78,24
@@
class GoodFETSPIFlash(GoodFETSPI):
JEDECsize=0;
def SPIjedec(self):
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);
data=[0x9f, 0, 0, 0];
data=self.SPItrans(data);
-
+ jedec=0;
self.JEDECmanufacturer=ord(data[1]);
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;
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;
if jedec==0x1F4501:
self.JEDECsize=1024**2;
self.JEDECdevice=jedec;