X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETSPI.py;h=9c684b7c7fd14b1af7c96b830a29888385427162;hp=cab2a371fd2a7c05adeba87de8f53fbe3912c27f;hb=4c3cdeb4d074b093a6806929f2b25c61890439b0;hpb=a84301b1952e524c5ebc4731cddc6b0ec406a9a8 diff --git a/client/GoodFETSPI.py b/client/GoodFETSPI.py index cab2a37..9c684b7 100644 --- a/client/GoodFETSPI.py +++ b/client/GoodFETSPI.py @@ -34,7 +34,7 @@ class GoodFETSPI25C(GoodFETSPI): READ=0x03; WRITE=0x02; - def peek8(self,adr): + def peek8(self,adr,memory="vn"): """Read a byte from the given address.""" data=self.SPItrans([self.READ,(adr>>8)&0xFF,adr&0xFF,0x00]); return ord(data[3]); @@ -60,7 +60,9 @@ class GoodFETSPIFlash(GoodFETSPI): 0xC22015: "MX25L1605D", 0xC22014: "MX25L8005", 0xC22013: "MX25L4005", - 0x204011: "M45PE10" + 0x204011: "M45PE10", + 0x202014: "M25P80", + 0x1f4501: "AT24DF081", }; JEDECsizes={0x17: 0x800000, @@ -85,7 +87,10 @@ class GoodFETSPIFlash(GoodFETSPI): self.JEDECsize=self.JEDECsizes.get(self.JEDECcapacity); if self.JEDECsize==None: self.JEDECsize=0; - self.JEDECdevice=(ord(data[1])<<16)+(ord(data[2])<<8)+ord(data[3]); + jedec=(ord(data[1])<<16)+(ord(data[2])<<8)+ord(data[3]); + if jedec==0x1F4501: + self.JEDECsize=1024**2; + self.JEDECdevice=jedec; return data; def SPIpeek(self,adr): """Grab a byte from an SPI Flash ROM."""