def get_spawn(self):
        """Connect to a fresh U-Boot instance.

        The target board is reset, so that U-Boot begins running from scratch.

        Args:
            None.

        Returns:
            A u_boot_spawn.Spawn object that is attached to U-Boot.
        """

        args = [self.config.board_type, self.config.board_identity]
        s = Spawn(['u-boot-test-console'] + args)

        try:
            self.log.action('Resetting board')
            cmd = ['u-boot-test-reset'] + args
            runner = self.log.get_runner(cmd[0], sys.stdout)
            runner.run(cmd)
            runner.close()
        except:
            s.close()
            raise

        return s
    def get_spawn(self):
        """Connect to a fresh U-Boot instance.

        A new sandbox process is created, so that U-Boot begins running from
        scratch.

        Args:
            None.

        Returns:
            A u_boot_spawn.Spawn object that is attached to U-Boot.
        """

        bcfg = self.config.buildconfig
        config_spl = bcfg.get('config_spl', 'n') == 'y'
        fname = '/spl/u-boot-spl' if config_spl else '/u-boot'
        print fname
        cmd = []
        if self.config.gdbserver:
            cmd += ['gdbserver', self.config.gdbserver]
        cmd += [self.config.build_dir + fname, '-v', '-d', self.config.dtb]
        return Spawn(cmd, cwd=self.config.source_dir)
    def get_spawn(self):
        """Connect to a fresh U-Boot instance.

        A new sandbox process is created, so that U-Boot begins running from
        scratch.

        Args:
            None.

        Returns:
            A u_boot_spawn.Spawn object that is attached to U-Boot.
        """

        cmd = []
        if self.config.gdbserver:
            cmd += ['gdbserver', self.config.gdbserver]
        cmd += [
            self.config.build_dir + '/u-boot',
            '-v',
            '-d',
            self.config.build_dir + '/arch/sandbox/dts/test.dtb'
        ]
        return Spawn(cmd, cwd=self.config.source_dir)