mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 20:38:57 +00:00
commit
f165969d61
@ -81,9 +81,7 @@ class Juno(BigLittleDevice):
|
|||||||
'fdt_support': True,
|
'fdt_support': True,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
Parameter('bootargs', default='console=ttyAMA0,115200 earlyprintk=pl011,0x7ff80000 '
|
Parameter('bootargs',
|
||||||
'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.'''),
|
description='''Default boot arguments to use when boot_arguments were not.'''),
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -158,7 +156,7 @@ class Juno(BigLittleDevice):
|
|||||||
target.sendline('ip addr list eth0')
|
target.sendline('ip addr list eth0')
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
try:
|
try:
|
||||||
target.expect('inet ([1-9]\d*.\d+.\d+.\d+)', timeout=10)
|
target.expect(r'inet ([1-9]\d*.\d+.\d+.\d+)', timeout=10)
|
||||||
self.adb_name = target.match.group(1) + ':5555' # pylint: disable=W0201
|
self.adb_name = target.match.group(1) + ':5555' # pylint: disable=W0201
|
||||||
break
|
break
|
||||||
except pexpect.TIMEOUT:
|
except pexpect.TIMEOUT:
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
|
from distutils.version import LooseVersion
|
||||||
from wlauto.utils.serial_port import TIMEOUT
|
from wlauto.utils.serial_port import TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
@ -32,11 +32,14 @@ class UbootMenu(object):
|
|||||||
option_regex = re.compile(r'^\[(\d+)\]\s+([^\r]+)\r\n', re.M)
|
option_regex = re.compile(r'^\[(\d+)\]\s+([^\r]+)\r\n', re.M)
|
||||||
prompt_regex = re.compile(r'^([^\r\n]+):\s*', re.M)
|
prompt_regex = re.compile(r'^([^\r\n]+):\s*', re.M)
|
||||||
invalid_regex = re.compile(r'Invalid input \(max (\d+)\)', re.M)
|
invalid_regex = re.compile(r'Invalid input \(max (\d+)\)', re.M)
|
||||||
|
uboot_regex = re.compile(r"U-Boot\s(\d\S*)\s")
|
||||||
|
|
||||||
load_delay = 1 # seconds
|
load_delay = 1 # seconds
|
||||||
default_timeout = 60 # seconds
|
default_timeout = 60 # seconds
|
||||||
|
fixed_uboot_version = '2016.03' # The version on U-Boot that fixed newlines
|
||||||
|
|
||||||
def __init__(self, conn, start_prompt='Hit any key to stop autoboot'):
|
def __init__(self, conn,
|
||||||
|
start_prompt='Hit any key to stop autoboot'):
|
||||||
"""
|
"""
|
||||||
:param conn: A serial connection as returned by ``pexect.spawn()``.
|
:param conn: A serial connection as returned by ``pexect.spawn()``.
|
||||||
:param prompt: U-Boot menu prompt
|
:param prompt: U-Boot menu prompt
|
||||||
@ -44,7 +47,7 @@ class UbootMenu(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
self.conn = conn
|
self.conn = conn
|
||||||
self.conn.crlf = '\n\r' # TODO: this has *got* to be a bug in U-Boot...
|
self.conn.crlf = None
|
||||||
self.start_prompt = start_prompt
|
self.start_prompt = start_prompt
|
||||||
self.options = {}
|
self.options = {}
|
||||||
self.prompt = None
|
self.prompt = None
|
||||||
@ -56,6 +59,7 @@ class UbootMenu(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
self.conn.expect(self.start_prompt, timeout)
|
self.conn.expect(self.start_prompt, timeout)
|
||||||
|
self._set_line_separator()
|
||||||
self.conn.sendline('')
|
self.conn.sendline('')
|
||||||
time.sleep(self.load_delay)
|
time.sleep(self.load_delay)
|
||||||
self.conn.readline() # garbage
|
self.conn.readline() # garbage
|
||||||
@ -114,3 +118,10 @@ class UbootMenu(object):
|
|||||||
pass
|
pass
|
||||||
self.conn.buffer = ''
|
self.conn.buffer = ''
|
||||||
|
|
||||||
|
def _set_line_separator(self):
|
||||||
|
uboot_text = self.conn.before
|
||||||
|
uboot_ver = self.uboot_regex.findall(uboot_text)
|
||||||
|
if uboot_ver and LooseVersion(uboot_ver[0]) < LooseVersion(self.fixed_uboot_version):
|
||||||
|
self.conn.crlf = "\n\r"
|
||||||
|
else:
|
||||||
|
self.conn.crlf = "\r\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user