| Index: embios/trunk/tools/embios.py |
| — | — | @@ -687,7 +687,7 @@ |
| 688 | 688 | self.logger.info("Pages per block: " + str(data["pagesperblock"]))
|
| 689 | 689 |
|
| 690 | 690 | @command
|
| 691 | | - def ipodnano2g_nandread(self, addr, start, count, doecc, checkempty):
|
| | 691 | + def ipodnano2g_nandread(self, addr, start, count, doecc=True, checkempty=True):
|
| 692 | 692 | """
|
| 693 | 693 | Target-specific function: ipodnano2g
|
| 694 | 694 | Reads data from the NAND chip into memory
|
| — | — | @@ -694,14 +694,14 @@ |
| 695 | 695 | <addr>: the memory location where the data is written to
|
| 696 | 696 | <start>: start block
|
| 697 | 697 | <count>: block count
|
| 698 | | - <doecc>: FIXME
|
| 699 | | - <checkempty>: FIXME
|
| | 698 | + [doecc]: use ecc error correction data
|
| | 699 | + [checkempty]: set statusflags if pages are empty
|
| 700 | 700 | """
|
| 701 | 701 | addr = self._hexint(addr)
|
| 702 | 702 | start = self._hexint(start)
|
| 703 | 703 | count = self._hexint(count)
|
| 704 | | - doecc = int(doecc) # FIXME shouldn't this be bool?
|
| 705 | | - checkempty = int(checkempty)
|
| | 704 | + doecc = self._bool(doecc)
|
| | 705 | + checkempty = self._bool(checkempty)
|
| 706 | 706 | self.logger.info("Reading " + self._hex(count) + " NAND pages starting at " + \
|
| 707 | 707 | self._hex(start) + " to " + self._hex(addr) + "...")
|
| 708 | 708 | self.embios.ipodnano2g_nandread(addr, start, count, doecc, checkempty)
|
| — | — | @@ -708,7 +708,7 @@ |
| 709 | 709 | self.logger.info("done\n")
|
| 710 | 710 |
|
| 711 | 711 | @command
|
| 712 | | - def ipodnano2g_nandwrite(self, addr, start, count, doecc):
|
| | 712 | + def ipodnano2g_nandwrite(self, addr, start, count, doecc=True):
|
| 713 | 713 | """
|
| 714 | 714 | Target-specific function: ipodnano2g
|
| 715 | 715 | Writes data to the NAND chip
|
| — | — | @@ -715,12 +715,12 @@ |
| 716 | 716 | <addr>: the memory location where the data is read from
|
| 717 | 717 | <start>: start block
|
| 718 | 718 | <count>: block count
|
| 719 | | - <doecc>: FIXME
|
| | 719 | + [doecc]: create ecc error correction data
|
| 720 | 720 | """
|
| 721 | 721 | addr = self._hexint(addr)
|
| 722 | 722 | start = self._hexint(start)
|
| 723 | 723 | count = self._hexint(count)
|
| 724 | | - doecc = int(doecc) # FIXME shouldn't this be bool?
|
| | 724 | + doecc = self._bool(doecc)
|
| 725 | 725 | self.logger.info("Writing " + self._hex(count) + " NAND pages starting at " + \
|
| 726 | 726 | self._hex(start) + " from " + self._hex(addr) + "...")
|
| 727 | 727 | self.embios.ipodnano2g_nandwrite(addr, start, count, doecc)
|
| — | — | @@ -825,7 +825,7 @@ |
| 826 | 826 | def getvolumeinfo(self, volume):
|
| 827 | 827 | """
|
| 828 | 828 | Gathers some information about a storage volume used
|
| 829 | | - <volume>: FIXME
|
| | 829 | + <volume>: volume id
|
| 830 | 830 | """
|
| 831 | 831 | volume = self._hexint(volume)
|
| 832 | 832 | data = self.embios.storage_get_info(volume)
|
| Index: embios/trunk/tools/libembios.py |
| — | — | @@ -550,7 +550,7 @@ |
| 551 | 551 | """ Target-specific function: ipodnano2g
|
| 552 | 552 | Reads data from the NAND chip into memory
|
| 553 | 553 | """
|
| 554 | | - return self.lib.monitorcommand(struct.pack("IIII", 0xffff0002, addr | (0x80000000 if doecc != 0 else 0) | (0x40000000 if checkempty != 0 else 0), start, count), "III", (None, None, None))
|
| | 554 | + return self.lib.monitorcommand(struct.pack("IIII", 0xffff0002, addr | (0x80000000 if doecc else 0) | (0x40000000 if checkempty else 0), start, count), "III", (None, None, None))
|
| 555 | 555 |
|
| 556 | 556 | @command(timeout = 30000, target = 0x47324e49)
|
| 557 | 557 | def ipodnano2g_nandwrite(self, addr, start, count, doecc):
|
| — | — | @@ -557,7 +557,7 @@ |
| 558 | 558 | """ Target-specific function: ipodnano2g
|
| 559 | 559 | Writes data to the NAND chip
|
| 560 | 560 | """
|
| 561 | | - return self.lib.monitorcommand(struct.pack("IIII", 0xffff0003, addr | (0x80000000 if doecc != 0 else 0), start, count), "III", (None, None, None))
|
| | 561 | + return self.lib.monitorcommand(struct.pack("IIII", 0xffff0003, addr | (0x80000000 if doecc else 0), start, count), "III", (None, None, None))
|
| 562 | 562 |
|
| 563 | 563 | @command(timeout = 30000, target = 0x47324e49)
|
| 564 | 564 | def ipodnano2g_nanderase(self, addr, start, count):
|