aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/tests/device-types/juno-uboot.jinja2
blob: fd9875378b85c5310268e66f5289dfb33cb3c660 (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
{% extends 'base-uboot.jinja2' %}

{% set console_device = console_device | default('ttyAMA0') %}
{% set baud_rate = baud_rate | default('115200') %}
{% set juno_kernel_args = 'ip=dhcp rw rootwait earlycon=pl011,0x7ff80000 debug systemd.log_target=null user_debug=31 androidboot.hardware=juno loglevel=9' %}

{% set uboot_initrd_high = '0xffffffffffffffff' %}
{% set uboot_fdt_high = '0xffffffffffffffff' %}

{% set base_uboot_commands_juno_extras =
"          - setenv bootdelay 1
          - setenv ethact smc911x-0" -%}

{% set base_load_commands = load_commands | default(
"          - setenv loadkernel 'afs load ${kernel_name} {KERNEL_ADDR}'
          - setenv loadfdt 'afs load ${fdtfile} {DTB_ADDR} ; fdt addr {DTB_ADDR}; fdt resize'
          - setenv loadinitrd 'afs load ${initrd_name} {RAMDISK_ADDR}; setenv initrd_param {RAMDISK_ADDR}'") -%}

{% block body %}
device_type: juno

board_id: '{{ board_id|default('0000000000') }}'
usb_vendor_id: '{{ usb_vendor_id|default('0000') }}'
usb_product_id: '{{ usb_product_id|default('0000') }}'
usb_filesystem_label: '{{ usb_filesystem_label|default('JUNO') }}'

{% block parameters -%}
parameters:
  booti:
    kernel: '{{ booti_kernel_addr|default('0x80080000') }}'
    ramdisk: '{{ booti_ramdisk_addr|default('0x84000000') }}'
    dtb: '{{ booti_dtb_addr|default('0x83000000') }}'
  interfaces:
{% if device_ip or device_mac %}
    target:
      ip: {{ device_ip|default('') }}
      mac: '{{ device_mac|default('') }}'
{% endif %}
{% if interfaces %}
{% for interface in interfaces %}
    {{ interface }}:
      sysfs: "{{ sysfs.get(interface) }}"
      mac: "{{ mac_addr.get(interface) }}"
{% for switch, port in map.get(interface).items() %}
      switch: "{{ switch }}"
      port: {{ port }}
{% endfor %}
      tags:
{% if tags.get(interface) %}
{% for tag in tags.get(interface) %}
      - {{ tag }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
  media:  # four USB slots.
    usb:
      UUID-required: True
      {{ usb_label|default('SanDisk_Ultra') }}:
        uuid: "{{ usb_uuid }}"
        device_id: {{ usb_device_id|default(0) }}  # the bootloader device id for this media on the 'usb' interface
{% endblock parameters -%}

actions:
  deploy:
    parameters:
      mkimage_arch: arm64
      add_header: u-boot
    # list of deployment methods which this device supports
    methods:
      lxc:
      nfs:
      tftp:
      usb:
      ssh:
        options:
{{ ssh_options }}
        host: '{{ ssh_host|default('') }}'
        user: {{ ssh_user|default('root') }}
        port: {{ ssh_port|default(22) }}
        identity_file: {{ ssh_identity_file }}
      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...') }}'
    connections:
      adb:
      lxc:
      serial:
  boot:
    # list of connection methods which this device supports
    connections:
      adb:
      lxc:
      serial:
      ssh:
    # list of boot methods which this device supports.
    methods:
      lxc:
      ssh:
      u-boot:
        parameters:
          bootloader_prompt: VExpress64
          boot_message: {{ boot_message|default('Linux version') }}
          mkimage_arch: arm64
        ramdisk-local:
          commands:
{{ base_uboot_commands }}
{{ base_uboot_commands_juno_extras }}
          - setenv fdtfile board.dtb
          - setenv initrd_name ramdisk.img
          - setenv kernel_name norkern
{{ base_load_commands }}
          - setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/sda2 {{ juno_kernel_args }}'
{{ base_uboot_bootcmd }}
        nfs-local:
          commands:
{{ base_uboot_commands }}
{{ base_uboot_commands_juno_extras }}
          - setenv fdtfile board.dtb
          - setenv initrd_name ramdisk.img
          - setenv kernel_name norkern
{{ base_load_commands }}
          - setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs {{ base_nfsroot_args }} {{ juno_kernel_args }}'
{{ base_uboot_nfs_bootcmd }}
        ramdisk-tftp:
          commands:
{{ base_uboot_commands }}
{{ base_uboot_commands_juno_extras }}
{{ base_uboot_addr_commands }}
{{ base_uboot_tftp_commands }}
          - setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs {{ base_nfsroot_args}} {{ juno_kernel_args }}'
{{ base_uboot_tftp_bootcmd }}
        ramdisk-tftp-usb:
          commands:
{{ base_uboot_commands }}
{{ base_uboot_commands_juno_extras }}
{{ base_uboot_addr_commands }}
{{ base_uboot_tftp_commands }}
          - setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/sda2 {{ juno_kernel_args }}'
{{ base_uboot_tftp_bootcmd }}
        tftp-local-ramdisk-nfsroot:
          commands:
{{ base_uboot_commands }}
          - setenv initrd_name ramdisk.img
          - setenv loadfdt 'tftp {DTB_ADDR} {DTB}'
          - setenv loadkernel 'tftp {KERNEL_ADDR} {KERNEL}'
          - setenv loadinitrd 'afs load ramdisk.img {RAMDISK_ADDR}; setenv initrd_param {RAMDISK_ADDR}'
          - setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root=/dev/nfs {{ base_nfsroot_args }} {{ juno_kernel_args }}'
{{ base_tftp_uboot_bootcmd }}
        usb:
          commands:
          - usb start
          - usb info
{{ base_uboot_commands }}
          - setenv kernel_addr_r '{KERNEL_ADDR}'
          - setenv initrd_addr_r '{RAMDISK_ADDR}'
          - setenv fdt_addr_r '{DTB_ADDR}'
          - setenv loadkernel 'load usb 0:{ROOT_PART} ${kernel_addr_r} {KERNEL}'
          - setenv loadinitrd 'load usb 0:{ROOT_PART} ${initrd_addr_r} {RAMDISK}; setenv initrd_size ${filesize}'
          - setenv loadfdt 'load usb 0:{ROOT_PART} ${fdt_addr_r} {DTB}'
          - setenv bootargs 'console={{ console_device }},{{ baud_rate }}n8 root={ROOT} {{ juno_kernel_args }}'
{{ base_uboot_bootcmd }}
        use-defaults:
          commands:
          - boot
{% endblock body -%}

{% block timeouts %}
timeouts:
  actions:
    apply-overlay-image:
      minutes: {{ action_timeout_apply_overlay_image | default(2) }}
    dd-image:
      minutes: {{ action_timeout_dd_image | default(20) }}
    download-retry:
      minutes: {{ action_timeout_download_retry | default(5) }}
    http-download:
      minutes: {{ action_timeout_http_download | default(10) }} # large due to android images etc
    lava-test-shell:
      minutes: {{ action_timeout_lava_test_shell | default(3) }}
    nfs-deploy:
      minutes: {{ action_timeout_nfs_deploy | default(10) }}
    power-off:
      seconds: {{ action_timeout_power_off | default(5) }}
    bootloader-commands:
      minutes: {{ action_timeout_bootloader_commands | default(3) }}
    bootloader-interrupt:
      seconds: {{ action_timeout_bootloader_interrupt | default(30) }}
    u-boot-interrupt:
      minutes: {{ action_timeout_u_boot_interrupt | default(2) }}
    u-boot-commands:
      minutes: {{ action_timeout_u_boot_commands | default(2) }}
    umount-retry:
      seconds: {{ action_timeout_umount_retry | default(45) }}
    auto-login-action:
      minutes: {{ action_timeout_auto_login | default(5) }}
    bootloader-action:
      minutes: {{ action_timeout_bootloader_action | default(3)}}
    uboot-action:
      minutes: {{ action_timeout_uboot_action | default(3)}}
    uboot-retry:
      minutes: {{ action_timeout_uboot_retry | default(3)}}
    bootloader-retry:
      minutes: {{ action_timeout_bootloader_retry | default(3)}}
    boot-qemu-image:
      minutes: {{ action_timeout_boot_qemu_image | default(2) }}
    boot-image-retry:
      minutes: {{ action_timeout_boot_image_retry | default(2) }}
  connections:
    dd-image:
      minutes: {{ connection_timeout_dd_image | default(20) }}
    u-boot-interrupt:
      minutes: {{ action_timeout_u_boot_interrupt | default(2) }}
    uboot-retry:
      minutes: {{ action_timeout_u_boot_retry | default(3) }}
    u-boot-commands:
      minutes: {{ action_timeout_u_boot_commands | default(2) }}
    bootloader-commands:
      seconds: {{ connection_timeout_bootloader_commands | default(30) }}
    auto-login-action:
      minutes: {{ connection_timeout_auto_login | default(5) }}
    bootloader-interrupt:
      seconds: {{ connection_timeout_bootloader_interrupt | default(30) }}
    http-download:
      minutes: {{ action_timeout_http_download | default(10) }} # large due to android images etc
    u-boot-interrupt:
      minutes: {{ connection_timeout_u_boot_interrupt | default(2) }}
{% endblock timeouts -%}