Commit 1a5c55e8 authored by Neil Williams's avatar Neil Williams 💬 Committed by Rémi Duraffort

Add hi6220-hikey-r2 device-type template

New firmware (-r2) makes the hi6220 behave in precisely the
same way as the hi960 but the image files must still differ.
Test jobs for the hi6220-hikey must also differ from
hi6220-hikey-r2, so a new device-type is required.

Change-Id: I566942923d6cfb1feaac9697f6a682965c211e84
parent f1c8d9c7
{% extends 'base-fastboot.jinja2' %}
{% set boot_character_delay = 10 %}
{% set root_device = root_device | default('/dev/mmcblk0p9') %}
{% set base_kernel_args = base_kernel_args|default('') %}
{% set console_device = console_device|default('ttyAMA3') %}
{% set baud_rate = baud_rate|default('115200') %}
{% set fastboot_sequence = ['boot'] %}
{% set device_type = "hi6220-hikey-r2" %}
{% set fastboot_interrupt_params = "
interrupt_prompt: 'Android Fastboot mode'
interrupt_string: ' '"%}
{% set flash_cmds_order = ['ptable', 'xloader', 'fastboot', 'nvme', 'fw_lpm3',
'trustfirmware', 'boot', 'dts', 'system', 'userdata', 'cache'] %}
{% set fastboot_boot_grub = "
grub:
reset_device: False
sequence:
- wait-fastboot-interrupt
installed:
commands:
- boot
"%}
{% extends 'hi6220-hikey-r2.jinja2' %}
{% set adb_serial_number = '0123456789' %}
{% set fastboot_serial_number = 'usb:2-1.2' %}
{% set connection_list = ['uart0', 'uart1'] %}
{% set connection_commands = {'uart0': 'telnet localhost 4002', 'uart1': 'telnet 192.168.1.200 8001'} %}
{% set connection_tags = {'uart1': ['primary']} %}
{% set hard_reset_command = '/home/stylesen/work/pdu/pdu-control-reset.sh 0 5 1 5' %}
{% set soft_reset_command = 'fastboot -s usb:2-1.2 reboot' %}
{% set power_on_command = '/home/stylesen/work/pdu/pdu-control-on.sh 5' %}
{% set power_off_command = '/home/stylesen/work/pdu/pdu-control-off.sh 5' %}
{% set fastboot_options = ['-S', '256M'] %}
{% set device_info = [{'board_id': '0123456789'}] %}
{% set static_info = [{'board_id': 'S_N0123456'}] %}
......@@ -641,6 +641,28 @@ class TestTemplates(unittest.TestCase):
template_dict['actions']['boot']['methods']['grub-efi']['sata']
)
def test_hikey_r2_template(self):
with open(os.path.join(os.path.dirname(__file__), 'devices', 'hi6220-hikey-r2-01.jinja2')) as hikey:
data = hikey.read()
self.assertIsNotNone(data)
self.assertTrue(self.validate_data('hi6220-hikey-01', data))
test_template = prepare_jinja_template('staging-hikey-01', data)
rendered = test_template.render()
template_dict = yaml.load(rendered)
self.assertIsNotNone(template_dict)
self.assertIsInstance(template_dict['device_info'], list)
self.assertIsInstance(template_dict['static_info'], list)
self.assertEqual(template_dict['device_info'][0]['board_id'],
'0123456789')
self.assertEqual(template_dict['static_info'][0]['board_id'],
'S_N0123456')
self.assertIsInstance(template_dict['fastboot_options'], list)
self.assertEqual(template_dict['fastboot_options'], ['-S', '256M'])
order = template_dict['flash_cmds_order']
self.assertEqual(0, order.index('ptable'))
self.assertEqual(1, order.index('xloader'))
self.assertEqual(2, order.index('fastboot'))
def test_hikey_template(self):
with open(os.path.join(os.path.dirname(__file__), 'devices', 'hi6220-hikey-01.jinja2')) as hikey:
data = hikey.read()
......@@ -664,7 +686,7 @@ class TestTemplates(unittest.TestCase):
self.assertIn('cache', order)
self.assertIn('system', order)
self.assertIn('userdata', order)
self.assertNotIn('xloader', order)
# test support for retreiving MAC from device.
data += "{% set device_mac = '00:E0:4C:53:44:58' %}"
self.assertTrue(self.validate_data('hi6220-hikey-01', data))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment