mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-12 07:59:04 +00:00
juno: use bootargs on hard_reset with u-boot
This commit is contained in:
parent
95c3f049fb
commit
205934d55b
@ -126,7 +126,10 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
|
|||||||
self._is_ready = False
|
self._is_ready = False
|
||||||
self._just_rebooted = True
|
self._just_rebooted = True
|
||||||
|
|
||||||
def boot(self, **kwargs):
|
def boot(self, hard=False, **kwargs):
|
||||||
|
if hard:
|
||||||
|
self.hard_reset()
|
||||||
|
else:
|
||||||
self.reset()
|
self.reset()
|
||||||
|
|
||||||
def connect(self): # NOQA pylint: disable=R0912
|
def connect(self): # NOQA pylint: disable=R0912
|
||||||
|
@ -563,7 +563,10 @@ class LinuxDevice(BaseLinuxDevice):
|
|||||||
super(LinuxDevice, self).hard_reset()
|
super(LinuxDevice, self).hard_reset()
|
||||||
self._is_ready = False
|
self._is_ready = False
|
||||||
|
|
||||||
def boot(self, **kwargs):
|
def boot(self, hard=False, **kwargs):
|
||||||
|
if hard:
|
||||||
|
self.hard_reset()
|
||||||
|
else:
|
||||||
self.reset()
|
self.reset()
|
||||||
self.logger.debug('Waiting for device...')
|
self.logger.debug('Waiting for device...')
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
@ -495,7 +495,7 @@ class Runner(object):
|
|||||||
if self.context.reboot_policy.can_reboot and self.device.can('reset_power'):
|
if self.context.reboot_policy.can_reboot and self.device.can('reset_power'):
|
||||||
self.logger.info('Attempting to hard-reset the device...')
|
self.logger.info('Attempting to hard-reset the device...')
|
||||||
try:
|
try:
|
||||||
self.device.hard_reset()
|
self.device.boot(hard=True)
|
||||||
self.device.connect()
|
self.device.connect()
|
||||||
except DeviceError: # hard_boot not implemented for the device.
|
except DeviceError: # hard_boot not implemented for the device.
|
||||||
raise e
|
raise e
|
||||||
@ -553,7 +553,7 @@ class Runner(object):
|
|||||||
except DeviceError: # device may be offline
|
except DeviceError: # device may be offline
|
||||||
if self.device.can('reset_power'):
|
if self.device.can('reset_power'):
|
||||||
with self._signal_wrap('INITIAL_BOOT'):
|
with self._signal_wrap('INITIAL_BOOT'):
|
||||||
self.device.hard_reset()
|
self.device.boot(hard=True)
|
||||||
else:
|
else:
|
||||||
raise DeviceError('Cannot connect to device for initial reboot; '
|
raise DeviceError('Cannot connect to device for initial reboot; '
|
||||||
'and device does not support hard reset.')
|
'and device does not support hard reset.')
|
||||||
|
@ -77,26 +77,36 @@ class Juno(BigLittleDevice):
|
|||||||
used, when flashing new images.''',
|
used, when flashing new images.''',
|
||||||
default={
|
default={
|
||||||
'image_name': 'Image',
|
'image_name': 'Image',
|
||||||
'image_args': 'console=ttyAMA0,115200 '
|
'image_args': None, # populated from bootargs if not specified
|
||||||
'earlyprintk=pl011,0x7ff80000 '
|
|
||||||
'verbose debug init=/init '
|
|
||||||
'root=/dev/sda1 rw ip=dhcp rootwait '
|
|
||||||
'video=DVI-D-1:1920x1080R@60',
|
|
||||||
'fdt_support': True,
|
'fdt_support': True,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
Parameter('bootargs', default='console=ttyAMA0,115200 earlyprintk=pl011,0x7ff80000 '
|
||||||
|
'verbose debug init=/init root=/dev/sda1 rw ip=dhcp '
|
||||||
|
'rootwait video=DVI-D-1:1920x1080R@60',
|
||||||
|
description='''Default boot arguments to use when boot_arguments were not.'''),
|
||||||
]
|
]
|
||||||
|
|
||||||
short_delay = 1
|
short_delay = 1
|
||||||
firmware_prompt = 'Cmd>'
|
firmware_prompt = 'Cmd>'
|
||||||
|
|
||||||
def boot(self, **kwargs):
|
def validate(self):
|
||||||
|
if not self.uefi_config.image_args:
|
||||||
|
self.uefi_config.image_args = self.bootargs
|
||||||
|
|
||||||
|
def boot(self, hard=False, **kwargs):
|
||||||
|
if kwargs:
|
||||||
|
self.bootargs = kwargs # pylint: disable=attribute-defined-outside-init
|
||||||
|
if hard:
|
||||||
|
self.logger.debug('Performing a hard reset.')
|
||||||
|
self.hard_reset()
|
||||||
|
else:
|
||||||
self.logger.debug('Resetting the device.')
|
self.logger.debug('Resetting the device.')
|
||||||
self.reset()
|
self.reset()
|
||||||
if self.bootloader == 'uefi':
|
if self.bootloader == 'uefi':
|
||||||
self._boot_via_uefi()
|
self._boot_via_uefi()
|
||||||
else:
|
else:
|
||||||
self._boot_via_uboot(**kwargs)
|
self._boot_via_uboot(**self.bootargs)
|
||||||
|
|
||||||
def _boot_via_uboot(self, **kwargs):
|
def _boot_via_uboot(self, **kwargs):
|
||||||
if not kwargs:
|
if not kwargs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user