aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/tests/device-types/vexpress.jinja2
blob: 0432055484977c6975a115be76ae2ba8806f6a37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{% extends 'base.jinja2' %}

{% set vexpress_supports_vemsd = vexpress_supports_vemsd|default(true) %}
{% set vexpress_supports_uboot = vexpress_supports_uboot|default(true) %}
{% set vexpress_supports_uefi = vexpress_supports_uefi|default(true) %}

{% set base_high_limits = base_high_limits|default(true) %}
{% set base_uboot_commands = (
"          - setenv autoload no
          - setenv bootdelay 1
          - setenv ethact smc911x-0") -%}

{% set base_uboot_high_limits =(
"          - setenv initrd_high " + vexpress_uboot_initrd_high|default('0xffffffff') + "
          - setenv fdt_high " + vexpress_uboot_fdt_high|default('0xffffffff') ) -%}

{% set base_uboot_tftp_commands = uboot_tftp_commands|default(
"          - setenv loadkernel 'tftp {KERNEL_ADDR} {KERNEL}'
          - setenv loadinitrd 'tftp {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'
          - setenv loadfdt 'tftp {DTB_ADDR} {DTB}'") -%}

{% set base_uboot_bootcmd = uboot_bootcmd|default(
"          - setenv bootcmd 'run loadkernel; run loadinitrd; run loadfdt; " + uboot_bootx_cmd|default('{BOOTX}') + "'
          - run bootcmd") -%}

{% set base_uboot_tftp_bootcmd = uboot_tftp_bootcmd|default(
"          - setenv bootcmd '" + uboot_ipaddr_cmd|default('dhcp') + "; setenv serverip {SERVER_IP}; run loadkernel; run loadinitrd; run loadfdt; " + uboot_bootx_cmd|default('{BOOTX}') + "'
          - run bootcmd") -%}

{% set base_uboot_nfs_bootcmd = uboot_nfs_bootcmd|default(
"          - setenv bootcmd '" + uboot_ipaddr_cmd|default('dhcp') + "; setenv serverip {SERVER_IP}; run loadkernel; run loadinitrd; run loadfdt; run nfsargs; " + uboot_bootx_cmd|default('{BOOTX}') + "'
          - run bootcmd") -%}

{% set base_uboot_usb_commands = uboot_usb_commands|default(
"          - usb start") -%}

{% set uboot_needs_usb = uboot_needs_usb|default(false) %}

{% set usb_uuid = usb_uuid|default('') %}
{% set usb_device_id = usb_device_id|default(0) %}

{% set uboot_mac_addr = uboot_mac_addr|default('') %}
{% set base_uboot_set_mac = (
"          - setenv ethaddr " + uboot_mac_addr) -%}

{% set uboot_set_mac = uboot_set_mac|default(false) %}

{% set boot_character_delay = 30 %}

{# adds the parameters: top level block #}
{% block vland %}
{{ super() -}}
{% if text_offset %}
  text_offset: '{{text_offset}}'
{% endif %}
{% if vexpress_booti_kernel_addr %}
  image:
    kernel: '{{ booti_kernel_addr|default(vexpress_booti_kernel_addr) }}'
    ramdisk: '{{ booti_ramdisk_addr|default(vexpress_booti_ramdisk_addr) }}'
    dtb: '{{ booti_dtb_addr|default(vexpress_booti_dtb_addr) }}'
  booti:
    kernel: '{{ booti_kernel_addr|default(vexpress_booti_kernel_addr) }}'
    ramdisk: '{{ booti_ramdisk_addr|default(vexpress_booti_ramdisk_addr) }}'
    dtb: '{{ booti_dtb_addr|default(vexpress_booti_dtb_addr) }}'
{% endif %}
{% if vexpress_bootm_kernel_addr %}
  uimage:
    kernel: '{{ bootm_kernel_addr|default(vexpress_bootm_kernel_addr) }}'
    ramdisk: '{{ bootm_ramdisk_addr|default(vexpress_bootm_ramdisk_addr) }}'
    dtb: '{{ bootm_dtb_addr|default(vexpress_bootm_dtb_addr) }}'
  bootm:
    kernel: '{{ bootm_kernel_addr|default(vexpress_bootm_kernel_addr) }}'
    ramdisk: '{{ bootm_ramdisk_addr|default(vexpress_bootm_ramdisk_addr) }}'
    dtb: '{{ bootm_dtb_addr|default(vexpress_bootm_dtb_addr) }}'
{% endif %}
{% if vexpress_bootz_kernel_addr %}
  zimage:
    kernel: '{{ bootz_kernel_addr|default(vexpress_bootz_kernel_addr) }}'
    ramdisk: '{{ bootz_ramdisk_addr|default(vexpress_bootz_ramdisk_addr) }}'
    dtb: '{{ bootz_dtb_addr|default(vexpress_bootz_dtb_addr) }}'
  bootz:
    kernel: '{{ bootz_kernel_addr|default(vexpress_bootz_kernel_addr) }}'
    ramdisk: '{{ bootz_ramdisk_addr|default(vexpress_bootz_ramdisk_addr) }}'
    dtb: '{{ bootz_dtb_addr|default(vexpress_bootz_dtb_addr) }}'
{% endif %}
{%- if sata_uuid or sd_uuid or usb_uuid %}
  media:
{% if sata_uuid %}
    sata:
      UUID-required: False
      {{ sata_label|default('ST160LM003') }}:
        uuid: {{ sata_uuid }}
        device_id: {{ sata_id|default(0) }}
        uboot_interface: {{ sata_interface|default('scsi') }}
{% endif %}
{% if sd_uuid %}
    sd:
      {{ sd_label }}:
        uuid: {{ sd_uuid }}
        device_id: {{ sd_device_id }}  # the bootloader device id for this media on the 'sd' interface
{% endif %}
{% if usb_uuid %}
    usb:
      {{ usb_label|default('SanDisk_Ultra') }}:
        uuid: {{ usb_uuid }}  # /dev/disk/by-id/
        device_id: {{ usb_device_id }}  # the bootloader device id for this media on the 'usb' interface
{% endif %}
{%- endif %}
{% endblock vland %}


{% set action_timeout_auto_login = action_timeout_auto_login | default(5) %}
{% set action_timeout_bootloader_commands = action_timeout_bootloader_commands | default(3) %}
{% set action_timeout_u_boot_interrupt = action_timeout_u_boot_interrupt | default(120) %}
{% set action_timeout_uboot_retry = action_timeout_uboot_retry | default(4) %}
{% set action_timeout_uboot_action = action_timeout_uboot_action | default(4) %}

{% set connection_timeout_auto_login = connection_timeout_auto_login | default(5) %}
{% set connection_timeout_bootloader_commands = connection_timeout_bootloader_commands | default(30) %}
{% set connection_timeout_u_boot_interrupt = connection_timeout_u_boot_interrupt | default(120) %}
{% set connection_timeout_uboot_retry = connection_timeout_uboot_retry | default(4) %}


{% block body %}
device_type: {{ device_type|default('vexpress') }}

usb_filesystem_label: '{{ usb_filesystem_label|default('VEMSD') }}'

{% set console_device = console_device | default('ttyAMA0') %}
{% set baud_rate = baud_rate | default(115200) %}
{% set base_kernel_args = extra_kernel_args | default(vexpress_kernel_args) %}
{% set action_timeout_bootloader_commands = action_timeout_bootloader_commands | default(3) %}
{% set connection_timeout_bootloader_commands = connection_timeout_bootloader_commands | default(30) %}

{% if vexpress_sky2_mac %}
{% set base_kernel_args = base_kernel_args + ' sky2.mac_address=' + vexpress_sky2_mac %}
{% endif %}

actions:
  deploy:
    parameters:
      add_header: u-boot
      mkimage_arch: {{ uboot_mkimage_arch|default('arm64') }} # string to pass to mkimage -A when adding UBoot headers
      append_dtb: {{ append_dtb|default(false) }}
      use_xip: {{ use_xip|default(false) }}
    connections:
      lxc:
      serial:
    methods:
      lxc:
      nfs:
      ssh:
        options:
{{ ssh_options }}
        host: '{{ ssh_host|default('') }}'
        port: {{ ssh_port|default(22) }}
        user: {{ ssh_user|default('root') }}
        identity_file: {{ ssh_identity_file }}
{% if usb_uuid %}
      usb:
{% endif %}
      tftp:
{% if vexpress_supports_vemsd %}
      vemsd:
        parameters:
          mcc_prompt: '{{ mcc_prompt|default('Cmd>') }}'
          msd_mount_cmd: '{{ msd_mount_cmd|default('usb_on') }}'
          flash_prompt: '{{ flash_prompt|default('Flash>') }}'
          flash_enter_cmd: '{{ flash_enter_cmd|default('flash') }}'
          flash_erase_cmd: '{{ flash_erase_cmd|default('eraseall') }}'
          flash_erase_msg: '{{ flash_erase_msg|default('Erasing Flash') }}'
          flash_exit_cmd: '{{ flash_exit_cmd|default('exit') }}'
          autorun_prompt: '{{ autorun_prompt|default('Press Enter to stop auto boot...') }}'
{% endif %}
  boot:
    connections:
      lxc:
      serial:
    methods:
      minimal:
      uefi-menu:
        parameters:
          interrupt_prompt: '{{ interrupt_prompt|default('The default boot selection will start in') }}'
          interrupt_string: '{{ interrupt_string|default(' ') }}'
          item_markup:
            - "["
            - "]"
          item_class: '{{ item_class|default('0-9') }}'
          separator: '{{ separator|default(' ') }}'
          label_class: '{{ label_class|default('a-zA-Z0-9 \s\:') }}'
          bootloader_prompt: '{{ bootloader_prompt|default('Start:') }}'
          boot_message: '{{ boot_message|default('Linux version') }}'
        tftp:
        - select:
            items:
             - 'Boot Manager'
            wait: "Choice:"
        - select:
            items:
               - 'Add Boot Device Entry'
            wait: "Select the Boot Device:"
        - select:
            items:
               - 'TFTP on MAC Address: {{ device_mac }}'
            wait: "Get the IP address from DHCP:"
        - select:
            enter: y
            wait: "Get the TFTP server IP address:"
        - select:
            enter: '{SERVER_IP}'
            wait: "File path of the EFI Application or the kernel :"
        - select:
            enter: '{KERNEL}'
            wait: 'Is an EFI Application?'
        - select:
            enter: n
            wait: 'Has FDT support?'
        - select:
            enter: y
            wait: "Add an initrd:"
        - select:
            enter: n
            wait: "Arguments to pass to the binary:"
        - select:
            enter: "console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs rw nfsroot={SERVER_IP}:{NFSROOTFS},tcp,hard,intr {{ base_kernel_args }} {{ base_ip_args }}"
            wait: "Description for this new Entry:"
        - select:
            enter: LAVA TEST TFTP
            wait: "Choice:"
        - select:
            items:
              - "Update FDT path"
            wait: "Select the Boot Device"
        - select:
            items:
               - 'TFTP on MAC Address: {{ device_mac }}'  # substitute the MAC in the template
            wait: "Get the IP address from DHCP:"
        - select:
            enter: "y"
            wait: "Get the TFTP server IP address"
        - select:
            enter: "{SERVER_IP}"
            wait: "File path of the FDT blob :"
        - select:
            enter: "{DTB}"
            wait: "Choice:"
        - select:
            items:
              - "Return to main menu"
            wait: "Start:"
        - select:
            items:
              - LAVA TEST TFTP
      uefi:
        parameters:
           bootloader_prompt: '{{ bootloader_prompt|default('Shell>') }}'
           shell_interrupt_prompt: '{{ shell_interrupt_prompt|default('any other key to continue') }}'
           shell_interrupt_string: '{{ shell_interrupt_string|default(' ') }}'
           boot_message: '{{ boot_message|default('Linux version') }}'
           shell_menu: shell
           # Menu options
           interrupt_prompt: The default boot selection will start in
           interrupt_string: '{{ interrupt_string|default(' ') }}'
           menu_boot_message: '{{ menu_boot_message|default('UEFI Interactive Shell') }}'
           menu_prompt: '{{ menu_prompt|default('Start:') }}'
           item_markup:
           - '['
           - ']'
           item_class: '{{ item_class|default('0-9') }}'
           separator: '{{ separator|default(' ') }}'
           line_separator: '{{ line_separator|default('dos') }}'
           label_class: '{{ label_class|default('a-zA-Z0-9\s\:') }}'
        shell:
        - select:
            items:
            - 'Shell'
        nfs:
          commands:
          - norkern console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs rw {{ base_nfsroot_args }} {{ base_kernel_args }} {{ base_ip_args }} dtb=board.dtb
{% if uefi_usb_id %}
        usb:
          # This assumes that an image has been dd'ed to the USB device
          # and that this device then contains two partitions, sda1 and sda2.
          # The first, is the boot device, which appears in UEFI as <uefi_usb_id>.
          # The second is the root filesystem.
          commands:
          # Go to usb boot partition
          - "{{ uefi_usb_id }}:"
          # Launch Image from boot partition, specifying sda2 as the root filesystem.
          - Image console={{ console_device }},{{ baud_rate }}n8 root=/dev/sda2 rw {{ base_nfsroot_args }} {{ base_kernel_args }} {{ base_ip_args }} dtb={{ device_type }}.dtb
{% endif %}
      ssh:
{% if vexpress_supports_uboot %}
      u-boot:
        parameters:
          mkimage_arch: {{ uboot_mkimage_arch|default('arm') }}
          bootloader_prompt: {{ bootloader_prompt|default('VExpress64') }}
          interrupt_prompt: {{ interrupt_prompt|default('Hit any key to stop autoboot') }}
          interrupt_char: "{{ interrupt_char|default('') }}"
          boot_message: {{ boot_message|default('Booting Linux') }}
        defaults:
          commands:
          - "boot"
        nfs:
          commands:
{% if uboot_needs_usb %}
{{ base_uboot_usb_commands }}
{% endif -%}
{{ base_uboot_commands }}
{% if base_high_limits %}
{{ base_uboot_high_limits }}
{% endif %}
{% if uboot_set_mac %}
{{ base_uboot_set_mac }}
{% endif -%}
{{ base_uboot_tftp_commands }}
          - "setenv nfsargs 'setenv bootargs console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs rw
            {{ base_nfsroot_args }} {{ base_kernel_args }} {{ base_ip_args }}'"
{{ base_uboot_nfs_bootcmd }}
        norflash:
          commands:
          - "setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs rw
            {{ base_nfsroot_args }} {{ base_kernel_args }} {{ base_ip_args }}'"
          - "boot"
        ramdisk:
          commands:
{% if uboot_needs_usb %}
{{ base_uboot_usb_commands }}
{% endif -%}
{{ base_uboot_commands }}
{% if base_high_limits %}
{{ base_uboot_high_limits }}
{% endif %}
{% if uboot_set_mac %}
{{ base_uboot_set_mac }}
{% endif -%}
{{ base_uboot_tftp_commands }}
          - "setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/ram0 {{ base_kernel_args }} {{ base_ip_args }}'"
{{ base_uboot_tftp_bootcmd }}
        sata:
          commands:
          - scsi scan
{{ base_uboot_commands }}
          - "setenv loadkernel 'load scsi {ROOT_PART} {KERNEL_ADDR} {KERNEL}'"
          - "setenv loadinitrd 'load scsi {ROOT_PART} {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'"
          - "setenv loadfdt 'load scsi {ROOT_PART} {DTB_ADDR} {DTB}'"
          - "setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root={ROOT} {{ base_kernel_args }} {{ base_ip_args }}'"
{{ base_uboot_bootcmd }}
        usb:
          commands:
{{ base_uboot_usb_commands }}
{{ base_uboot_commands }}
{{ base_uboot_addr_commands }}
          - "setenv loadkernel 'load usb {{ usb_device_id }}:{ROOT_PART} {KERNEL_ADDR} {KERNEL}'"
          - "setenv loadinitrd 'load usb {{ usb_device_id }}:{ROOT_PART} {RAMDISK_ADDR} {RAMDISK}; setenv initrd_size ${filesize}'"
          - "setenv loadfdt 'load usb {{ usb_device_id }}:{ROOT_PART} {DTB_ADDR} {DTB}'"
          - "setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root={ROOT} {{ base_kernel_args }} {{ base_ip_args }}'"
{{ base_uboot_bootcmd }}
{% endif %}
{% endblock body %}