X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETARM7.py;h=88da8ac0a7dd704a901bee2f995452da3c52e910;hp=21f4fe7438d46276326d7838ec094dabd1c23a4e;hb=ea94279f763800d71e86d9bb25d140bf78dfb4ea;hpb=46911acb1c879cf7f43f2ac0ae56478a1b4fee24 diff --git a/client/GoodFETARM7.py b/client/GoodFETARM7.py index 21f4fe7..88da8ac 100644 --- a/client/GoodFETARM7.py +++ b/client/GoodFETARM7.py @@ -40,7 +40,7 @@ OK = 0x7F IR_SHIFT = 0x80 DR_SHIFT = 0x81 RESETTAP = 0x82 -RESETTARGET = 0x86 +RESETTARGET = 0x83 GET_REGISTER = 0x87 SET_REGISTER = 0x88 DEBUG_INSTR = 0x89 @@ -313,9 +313,9 @@ class GoodFETARM(GoodFET): """Set ARM Registers""" for x in xrange(15): if (1< 0): @@ -518,9 +519,36 @@ class GoodFETARM(GoodFET): output.extend([self.ARMget_register(x) for x in xrange(count)]) wordcount -= count adr += count*4 - print hex(adr) + #print hex(adr) # FIXME: handle the rest of the wordcount here. + self.ARMset_registers(regs,0xe) return output + def ARMreadStream(self, adr, bytecount): + data = [struct.unpack(" 0): + count = (wordcount, 0xe)[wordcount>0xd] + bitmask = LDM_BITMASKS[count] + self.ARMset_register(14,adr) + print len(wordarray),bin(bitmask) + self.ARMset_registers(wordarray[:count],bitmask) + self.ARM_nop(1) + self.ARMdebuginstr(ARM_INSTR_STMIA_R14_r0_rx | bitmask ,0) + #FIXME: do we need the extra nop here? + self.ARMrestart() + self.ARMwaitDBG() + wordarray = wordarray[count:] + wordcount -= count + adr += count*4 + print hex(adr) + # FIXME: handle the rest of the wordcount here. def ARMwriteMem(self, adr, wordarray): r0 = self.ARMget_register(0); # store R0 and R1 r1 = self.ARMget_register(1); @@ -552,7 +580,8 @@ class GoodFETARM(GoodFET): 0x02 : "force dbgrq", 0x01 : "force dbgack" } - + def ARMresettarget(self, delay=10): + return self.writecmd(0x13,RESETTARGET,2, [ delay&0xff, (delay>>8)&0xff ] ) def ARMchain0(self, address, bits=0x819684c054, data=0): bulk = chop(address,4) bulk.extend(chop(bits,8))