Commit 72d8b9fa authored by Rémi Duraffort's avatar Rémi Duraffort
Browse files

Merge branch 'imx_templates_rework' into 'master'

NXP IMX templates rework

See merge request lava/lava!1014
parents 65f22568 789ae043
{% extends 'imx8m-common.jinja2' %}
{% set root_device = root_device | default('/dev/ttymxc1') %}
{% set baud_rate = baud_rate|default('115200') %}
{% set kernel_args = kernel_args | default("earlycon=ec_imx6q,0x30890000") %}
{% set console_device = console_device|default('ttymcx1') %}
{% set booti_kernel_addr = booti_kernel_addr | default('0x40480000') %}
{% set booti_ramdisk_addr = booti_ramdisk_addr | default('0x44000000') %}
{% set booti_dtb_addr = booti_dtb_addr | default('0x43000000') %}
{% set bootz_kernel_addr = booti_kernel_addr %}
{% set bootz_ramdisk_addr = booti_ramdisk_addr %}
{% set bootz_dtb_addr = booti_dtb_addr %}
{% set bootm_kernel_addr = bootz_kernel_addr %}
{% set bootm_ramdisk_addr = bootz_ramdisk_addr %}
{% set bootm_dtb_addr = bootz_dtb_addr %}
{% extends 'base-uboot.jinja2' %}
{% set action_timeout_power_off = action_timeout_power_off | default(10) %}
{% set action_timeout_download_retry = action_timeout_download_retry | default(15) %}
{% set action_timeout_http_download = action_timeout_http_download | default(15) %}
{% set base_kernel_args = base_kernel_args|default('') %}
{% set uboot_bootx_cmd = 'boot' %}
{% set base_uboot_bootcmd = uboot_bootcmd|default(
" - '" + uboot_bootx_cmd|default('{BOOTX}')) + "'" -%}
{% set baud_rate = baud_rate|default('115200') %}
{% set root_device = root_device|default('/dev/ttymxc0') %}
{% set console_device = console_device|default('ttymxc0,115200 earlycon=ec_imx6q,0x30860000') %}
{% set uboot_ums_flash = uboot_ums_flash|default(False) %}
{% set ums_command = ums_command|default('ums 0 mmc 1') %}
{% set fastboot_options = fastboot_options|default(['-i', '0x0525']) %}
{% set fastboot_sequence = fastboot_sequence|default(['reboot']) %}
{% set adb_serial_number = adb_serial_number|default(fastboot_serial_number) %}
{% set fastboot_deploy_uboot_commands = fastboot_deploy_uboot_commands|default(['fastboot 0']) %}
{% set flash_cmds_order = flash_cmds_order|default(['bootloader', 'bootloader_a', 'bootloader_b', 'bootloader0',
'gpt', 'boot', 'boot_a', 'boot_b', 'dtbo', 'dtbo_a', 'dtbo_b',
'vbmeta', 'vbmeta_a', 'vbmeta_b', 'system', 'system_a', 'system_b',
'vendor', 'vendor_a', 'vendor_b', 'recovery']) %}
{% set device_info = device_info|default([{'board_id': fastboot_serial_number}]) %}
{% set base_high_limits = base_high_limits|default(false) %}
{% set boot_character_delay = boot_character_delay|default(5) %}
{% set uboot_extra_error_message = 'Invalid partition' %}
{% set uboot_mkimage_arch = 'arm' %}
{% set usb_uuid = usb_uuid|default('') %}
{% set test_character_delay = test_character_delay|default(5) %}
{% set base_kernel_args = base_kernel_args|default('') %}
{% set booti_kernel_addr = booti_kernel_addr | default('0x40480000') %}
{% set booti_ramdisk_addr = booti_ramdisk_addr | default('0x44000000') %}
{% set booti_dtb_addr = booti_dtb_addr | default('0x43000000') %}
{% set bootz_kernel_addr = booti_kernel_addr %}
{% set bootz_ramdisk_addr = booti_ramdisk_addr %}
{% set bootz_dtb_addr = booti_dtb_addr %}
{% set bootm_kernel_addr = bootz_kernel_addr %}
{% set bootm_ramdisk_addr = bootz_ramdisk_addr %}
{% set bootm_dtb_addr = bootz_dtb_addr %}
{% set usb_device_id = usb_device_id|default('') %}
{% set bootloader_prompt = bootloader_prompt|default('u-boot=>') %}
{% set interrupt_prompt = interrupt_prompt|default('Hit any key to stop autoboot') %}
{% set interrupt_char = interrupt_char|default(' ') %}
{% set adb_serial_number = adb_serial_number|default("'0000000000'") %}
{% set fastboot_serial_number = fastboot_serial_number|default("'0000000000'") %}
{% set device_info = device_info|default([{'board_id': fastboot_serial_number}]) %}
{% set fastboot_deploy_uboot_commands = fastboot_deploy_uboot_commands|default(["fastboot 0"]) %}
{% set fastboot_boot_uboot = "
# method specific stanza
mmc:
commands:
- setenv console ttyUSB0,115200n8
- " + base_uboot_bootcmd + "
" %}
{% set fastboot_sequence = fastboot_sequence|default(['reboot']) %}
{% set uboot_extra_error_message = uboot_extra_error_message|default('Invalid partition') %}
{% set extra_nfsroot_args = extra_nfsroot_args|default(",v3") %}
{% if save_uboot_env %}
{% set customized_uboot_boot_commands = ([
"setenv bootcmd 'tftp {KERNEL_ADDR} {KERNEL}; tftp {DTB_ADDR} {DTB}; booti {KERNEL_ADDR} - {DTB_ADDR}'",
"saveenv"])
-%}
{% endif %}
{% extends 'imx8m-common.jinja2' %}
{% set root_device = root_device | default('/dev/ttymxc0') %}
{% set baud_rate = baud_rate|default('115200') %}
{% set kernel_args = kernel_args | default("earlycon=ec_imx6q,0x30860000") %}
{% set console_device = console_device|default('ttymxc0') %}
{% set booti_kernel_addr = booti_kernel_addr | default('0x80080000') %}
{% set booti_ramdisk_addr = booti_ramdisk_addr | default('0x84000000') %}
{% set booti_dtb_addr = booti_dtb_addr | default('0x83000000') %}
{% set bootz_kernel_addr = booti_kernel_addr %}
{% set bootz_ramdisk_addr = booti_ramdisk_addr %}
{% set bootz_dtb_addr = booti_dtb_addr %}
{% set bootm_kernel_addr = bootz_kernel_addr %}
{% set bootm_ramdisk_addr = bootz_ramdisk_addr %}
{% set bootm_dtb_addr = bootz_dtb_addr %}
{% extends 'imx8m.jinja2' %}
\ No newline at end of file
{% extends 'imx8m-common.jinja2' %}
\ No newline at end of file
......@@ -91,8 +91,6 @@
- {class: power.PDUReboot, name: pdu-reboot}
- {class: actions.boot.BootloaderInterruptAction, name: bootloader-interrupt}
- {class: connections.lxc.ConnectLxc, name: connect-lxc}
- {class: utils.udev.WaitDeviceBoardID, name: wait-device-boardid}
- {class: actions.boot.fastboot.FastbootRebootAction, name: fastboot-reboot}
- {class: actions.boot.AutoLoginAction, name: auto-login-action}
- class: actions.test.shell.TestShellRetry
name: lava-test-retry
......@@ -103,3 +101,4 @@
pipeline:
- {class: power.PowerOff, name: power-off}
- {class: power.ReadFeedback, name: read-feedback}
......@@ -610,10 +610,12 @@ class TestFastbootDeploy(StdoutTestCase):
self.assertEqual([], lxc_cmd_prefix(job))
def test_fastboot_boot_commands(self):
job = self.factory.create_job("imx8m-01.jinja2", "sample_jobs/imx8m.yaml")
job = self.factory.create_job(
"imx8mq-evk-01.jinja2", "sample_jobs/imx8mq-evk.yaml"
)
boot = [
action for action in job.pipeline.actions if action.name == "fastboot-boot"
][0]
self.assertIn("commands", boot.parameters)
self.assertEqual("130651d6f060954b", job.device["fastboot_serial_number"])
self.assertEqual("191c51d6f060954b", job.device["fastboot_serial_number"])
self.assertIsInstance(boot.parameters["commands"], list)
......@@ -657,11 +657,13 @@ class TestUbootAction(StdoutTestCase):
@unittest.skipIf(infrastructure_error("lxc-start"), "lxc-start not installed")
def test_imx8m(self):
job = self.factory.create_job("imx8m-01.jinja2", "sample_jobs/imx8m.yaml")
job = self.factory.create_job(
"imx8mq-evk-01.jinja2", "sample_jobs/imx8mq-evk.yaml"
)
self.assertIsNotNone(job)
job.validate()
self.assertEqual(job.pipeline.errors, [])
description_ref = self.pipeline_reference("imx8m.yaml", job=job)
description_ref = self.pipeline_reference("imx8mq-evk.yaml", job=job)
self.assertEqual(description_ref, job.pipeline.describe(False))
deploy = [
action
......
{% extends 'imx8m.jinja2' %}
{# USB C cable in Cambrionix port 7 #}
{% set fastboot_serial_number = '130651d6f060954b' %}
{% set adb_serial_number = fastboot_serial_number %}
{% set connection_list = ['uart0'] %}
{% set connection_tags = {'uart0': ['primary', 'telnet']} %}
{% set connection_commands = {'uart0': 'telnet azrael 2030'} %}
{% set soft_reset_command = 'fastboot -u -s ' + fastboot_serial_number + ' reboot' %}
{% set hard_reset_command = [
'/usr/bin/pduclient --daemon calvin --hostname pdu2 --command off --port 01',
'/home/neil/code/lava-lab/shared/lab-scripts/usb_hub_control -u 7 -p 4000 -m off',
'sleep 20',
'/home/neil/code/lava-lab/shared/lab-scripts/usb_hub_control -u 7 -p 4000 -m sync',
'/usr/bin/pduclient --daemon calvin --hostname pdu2 --command on --port 01'] %}
{% set power_off_command = '/usr/bin/pduclient --daemon calvin --hostname pdu2 --command off --port 01' %}
{% set power_on_command = '/usr/bin/pduclient --daemon calvin --hostname pdu2 --command on --port 01' %}
{% set adb_command = 'adb -s ' + fastboot_serial_number %}
{% set fastboot_command = 'fastboot -u -s ' + fastboot_serial_number %}
{% set device_info = [{'board_id': fastboot_serial_number}] %}
{% set fastboot_options = ['-i', '0x0525'] %}
......@@ -3,15 +3,14 @@
{% set connection_list = ['uart0'] %}
{% set connection_tags = {'uart0': ['primary', 'telnet']} %}
{% set connection_commands = {'uart0': 'telnet localhost 7000'} %}
{% set soft_reset_command = 'reboot' %}
{% set hard_reset_command = ['/usr/local/lab-scripts/pdu_by_board.sh fsl-imx8mq-evk-linux-fr01 reboot'] %}
{% set power_off_command = ['/usr/local/lab-scripts/pdu_by_board.sh fsl-imx8mq-evk-linux-fr01 off'] %}
{% set power_on_command = ['/usr/local/lab-scripts/pdu_by_board.sh fsl-imx8mq-evk-linux-fr01 on'] %}
{% set usb_device_id = '007FD18D' %}
{% set usb_vendor_id = '10c4' %}
{% set usb_product_id = 'ea70' %}
{% set device_info = [{'board_id': usb_device_id}] %}
{% set uuu_usb_otg_path = '2:143' %}
{% set uuu_corrupt_boot_media_command = ['mmc dev 1', 'mmc erase 0 0x400'] %}
{% set ums_command = 'ums 0 mmc 1' %}
{% set uboot_mass_storage_device = '/dev/disk/by-id/usb-Linux_UMS_disk_0_191c51d6f060954b-0:0' %}
{% set fastboot_serial_number = '191c51d6f060954b' %}
......@@ -460,45 +460,49 @@ class TestUbootTemplates(BaseTemplate.BaseTemplateCases):
if not check:
self.fail("Unable to find setenv nfsargs")
def test_imx8m_template(self):
def test_imx8mq_evk_template(self):
fastboot_cmd_order = [
"update",
"ptable",
"partition",
"hyp",
"modem",
"rpm",
"sbl1",
"sbl2",
"sec",
"tz",
"aboot",
"bootloader",
"bootloader_a",
"bootloader_b",
"bootloader0",
"gpt",
"boot",
"rootfs",
"vendor",
"boot_a",
"boot_b",
"dtbo",
"dtbo_a",
"dtbo_b",
"vbmeta",
"vbmeta_a",
"vbmeta_b",
"system",
"cache",
"userdata",
"system_a",
"system_b",
"vendor",
"vendor_a",
"vendor_b",
"recovery",
]
rendered = self.render_device_dictionary_file("imx8m-01.jinja2")
rendered = self.render_device_dictionary_file("imx8mq-evk-01.jinja2")
template_dict = yaml_safe_load(rendered)
self.assertIsNotNone(template_dict)
self.assertIn("error-messages", template_dict["constants"]["u-boot"])
self.assertEqual(
"u-boot=>",
"=>",
template_dict["actions"]["boot"]["methods"]["u-boot"]["parameters"][
"bootloader_prompt"
],
)
context = {"bootloader_prompt": "imx8m=>"}
rendered = self.render_device_dictionary_file("imx8m-01.jinja2", context)
context = {"bootloader_prompt": "=>"}
rendered = self.render_device_dictionary_file("imx8mq-evk-01.jinja2", context)
template_dict = yaml_safe_load(rendered)
self.assertIsNotNone(template_dict)
self.assertIn("error-messages", template_dict["constants"]["u-boot"])
self.assertEqual(
"imx8m=>",
"=>",
template_dict["actions"]["boot"]["methods"]["u-boot"]["parameters"][
"bootloader_prompt"
],
......@@ -510,7 +514,7 @@ class TestUbootTemplates(BaseTemplate.BaseTemplateCases):
# test overwriting kernel args
checked = False
context = {"console_device": "ttyUSB1"}
rendered = self.render_device_dictionary_file("imx8m-01.jinja2", context)
rendered = self.render_device_dictionary_file("imx8mq-evk-01.jinja2", context)
template_dict = yaml_safe_load(rendered)
commands = template_dict["actions"]["boot"]["methods"]["u-boot"]["ramdisk"][
"commands"
......
Supports Markdown
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