| Line 685... |
Line 685... |
| 685 |
self.logger.info("Number of blocks: " + str(data["blocks"])+"\n")
|
685 |
self.logger.info("Number of blocks: " + str(data["blocks"])+"\n")
|
| 686 |
self.logger.info("Number of user blocks: " + str(data["userblocks"])+"\n")
|
686 |
self.logger.info("Number of user blocks: " + str(data["userblocks"])+"\n")
|
| 687 |
self.logger.info("Pages per block: " + str(data["pagesperblock"]))
|
687 |
self.logger.info("Pages per block: " + str(data["pagesperblock"]))
|
| 688 |
|
688 |
|
| 689 |
@command
|
689 |
@command
|
| 690 |
def ipodnano2g_nandread(self, addr, start, count, doecc, checkempty):
|
690 |
def ipodnano2g_nandread(self, addr, start, count, doecc=True, checkempty=True):
|
| 691 |
"""
|
691 |
"""
|
| 692 |
Target-specific function: ipodnano2g
|
692 |
Target-specific function: ipodnano2g
|
| 693 |
Reads data from the NAND chip into memory
|
693 |
Reads data from the NAND chip into memory
|
| 694 |
<addr>: the memory location where the data is written to
|
694 |
<addr>: the memory location where the data is written to
|
| 695 |
<start>: start block
|
695 |
<start>: start block
|
| 696 |
<count>: block count
|
696 |
<count>: block count
|
| 697 |
<doecc>: FIXME
|
697 |
[doecc]: use ecc error correction data
|
| 698 |
<checkempty>: FIXME
|
698 |
[checkempty]: set statusflags if pages are empty
|
| 699 |
"""
|
699 |
"""
|
| 700 |
addr = self._hexint(addr)
|
700 |
addr = self._hexint(addr)
|
| 701 |
start = self._hexint(start)
|
701 |
start = self._hexint(start)
|
| 702 |
count = self._hexint(count)
|
702 |
count = self._hexint(count)
|
| 703 |
doecc = int(doecc) # FIXME shouldn't this be bool?
|
703 |
doecc = self._bool(doecc)
|
| 704 |
checkempty = int(checkempty)
|
704 |
checkempty = self._bool(checkempty)
|
| 705 |
self.logger.info("Reading " + self._hex(count) + " NAND pages starting at " + \
|
705 |
self.logger.info("Reading " + self._hex(count) + " NAND pages starting at " + \
|
| 706 |
self._hex(start) + " to " + self._hex(addr) + "...")
|
706 |
self._hex(start) + " to " + self._hex(addr) + "...")
|
| 707 |
self.embios.ipodnano2g_nandread(addr, start, count, doecc, checkempty)
|
707 |
self.embios.ipodnano2g_nandread(addr, start, count, doecc, checkempty)
|
| 708 |
self.logger.info("done\n")
|
708 |
self.logger.info("done\n")
|
| 709 |
|
709 |
|
| 710 |
@command
|
710 |
@command
|
| 711 |
def ipodnano2g_nandwrite(self, addr, start, count, doecc):
|
711 |
def ipodnano2g_nandwrite(self, addr, start, count, doecc=True):
|
| 712 |
"""
|
712 |
"""
|
| 713 |
Target-specific function: ipodnano2g
|
713 |
Target-specific function: ipodnano2g
|
| 714 |
Writes data to the NAND chip
|
714 |
Writes data to the NAND chip
|
| 715 |
<addr>: the memory location where the data is read from
|
715 |
<addr>: the memory location where the data is read from
|
| 716 |
<start>: start block
|
716 |
<start>: start block
|
| 717 |
<count>: block count
|
717 |
<count>: block count
|
| 718 |
<doecc>: FIXME
|
718 |
[doecc]: create ecc error correction data
|
| 719 |
"""
|
719 |
"""
|
| 720 |
addr = self._hexint(addr)
|
720 |
addr = self._hexint(addr)
|
| 721 |
start = self._hexint(start)
|
721 |
start = self._hexint(start)
|
| 722 |
count = self._hexint(count)
|
722 |
count = self._hexint(count)
|
| 723 |
doecc = int(doecc) # FIXME shouldn't this be bool?
|
723 |
doecc = self._bool(doecc)
|
| 724 |
self.logger.info("Writing " + self._hex(count) + " NAND pages starting at " + \
|
724 |
self.logger.info("Writing " + self._hex(count) + " NAND pages starting at " + \
|
| 725 |
self._hex(start) + " from " + self._hex(addr) + "...")
|
725 |
self._hex(start) + " from " + self._hex(addr) + "...")
|
| 726 |
self.embios.ipodnano2g_nandwrite(addr, start, count, doecc)
|
726 |
self.embios.ipodnano2g_nandwrite(addr, start, count, doecc)
|
| 727 |
self.logger.info("done\n")
|
727 |
self.logger.info("done\n")
|
| 728 |
|
728 |
|
| Line 823... |
Line 823... |
| 823 |
|
823 |
|
| 824 |
@command
|
824 |
@command
|
| 825 |
def getvolumeinfo(self, volume):
|
825 |
def getvolumeinfo(self, volume):
|
| 826 |
"""
|
826 |
"""
|
| 827 |
Gathers some information about a storage volume used
|
827 |
Gathers some information about a storage volume used
|
| 828 |
<volume>: FIXME
|
828 |
<volume>: volume id
|
| 829 |
"""
|
829 |
"""
|
| 830 |
volume = self._hexint(volume)
|
830 |
volume = self._hexint(volume)
|
| 831 |
data = self.embios.storage_get_info(volume)
|
831 |
data = self.embios.storage_get_info(volume)
|
| 832 |
self.logger.info("Sector size: "+str(data["sectorsize"])+"\n")
|
832 |
self.logger.info("Sector size: "+str(data["sectorsize"])+"\n")
|
| 833 |
self.logger.info("Number of sectors: "+str(data["numsectors"])+"\n")
|
833 |
self.logger.info("Number of sectors: "+str(data["numsectors"])+"\n")
|