Commit 5aeea7af authored by Philippe Mazet's avatar Philippe Mazet
Browse files

Rework of imx8m templates

Moving all common setting into imx8m-common file.
Those new templates support the new uuu feature (IMX flashing tool),
and can be used to deploy either Android or Yocto on the same hardware.
parent 4c5246a2
{% 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.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}
......@@ -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' %}
......@@ -462,23 +462,27 @@ class TestUbootTemplates(BaseTemplate.BaseTemplateCases):
def test_imx8m_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")
......@@ -486,19 +490,19 @@ class TestUbootTemplates(BaseTemplate.BaseTemplateCases):
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=>"}
context = {"bootloader_prompt": "=>"}
rendered = self.render_device_dictionary_file("imx8m-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"
],
......
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