1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

Merge pull request #153 from ep1cman/juno-fixes

Juno fixes
This commit is contained in:
setrofim 2016-05-04 11:57:56 +01:00
commit f165969d61
2 changed files with 16 additions and 7 deletions

View File

@ -81,9 +81,7 @@ class Juno(BigLittleDevice):
'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',
Parameter('bootargs',
description='''Default boot arguments to use when boot_arguments were not.'''),
]
@ -158,7 +156,7 @@ class Juno(BigLittleDevice):
target.sendline('ip addr list eth0')
time.sleep(1)
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
break
except pexpect.TIMEOUT:

View File

@ -16,7 +16,7 @@
import re
import time
import logging
from distutils.version import LooseVersion
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)
prompt_regex = re.compile(r'^([^\r\n]+):\s*', 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
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 prompt: U-Boot menu prompt
@ -44,7 +47,7 @@ class UbootMenu(object):
"""
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.options = {}
self.prompt = None
@ -56,6 +59,7 @@ class UbootMenu(object):
"""
self.conn.expect(self.start_prompt, timeout)
self._set_line_separator()
self.conn.sendline('')
time.sleep(self.load_delay)
self.conn.readline() # garbage
@ -114,3 +118,10 @@ class UbootMenu(object):
pass
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"