def __init__(self, uboot, board, loader, nand_block_size=0, nand_page_size=0, ram_load_addr=None, dryrun=False): """ :param uboot: :class:`Uboot` instance. :param board: :class:`Board` instance. :param loader: :class:`RamLoader` instance. :param nand_block_size: NAND block size (bytes). If not given, the value will be obtained from uboot (once). :param nand_page_size: NAND page size (bytes). If not given, the value will be obtained from uboot (once). :param ram_load_addr: RAM address to load components, in decimal or hexadecimal (`'0x'` prefix). :param dryrun: Enable dryrun mode. System and uboot commands will be logged, but not executed. :type dryrun: boolean """ self._l = utils.logger.get_global_logger() self._e = utils.executer.get_global_executer() self._u = uboot self._board = board self._loader = loader self._nand_block_size = nand_block_size self._nand_page_size = nand_page_size self._ram_load_addr = None if hexutils.is_valid_addr(ram_load_addr): self._ram_load_addr = hexutils.str_to_hex(str(ram_load_addr)) self._dryrun = dryrun self._board.dryrun = dryrun self._e.dryrun = dryrun self._u.dryrun = dryrun self._loader.dryrun = dryrun self._partitions = []
def __set_ram_load_addr(self, ram_load_addr): if hexutils.is_valid_addr(ram_load_addr): self._ram_load_addr = hexutils.to_hex(str(ram_load_addr)) else: self._ram_load_addr = None raise NandInstallerError('Invalid RAM load address: %s' % ram_load_addr)
def __set_uboot_load_addr(self, uboot_load_addr): if hexutils.is_valid_addr(uboot_load_addr): self._uboot_load_addr = uboot_load_addr else: self._l.error('Invalid u-boot load address: %s' % uboot_load_addr) self._uboot_load_addr = None