qspi_pre_commands(u_boot_console, random.randint(min_f, max_f))
qspi_erase_all(u_boot_console)
i = i + 1
-
-# Load FIT image and write boot.bin to start of qspi to be ready for qspi boot
-def qspi_boot_images(u_boot_console):
-
- if not test_net.net_set_up:
- pytest.skip('Network not initialized')
-
- test_net.test_net_dhcp(u_boot_console)
- test_net.test_net_setup_static(u_boot_console)
- test_net.test_net_tftpboot(u_boot_console)
-
- f = u_boot_console.config.env.get('env__net_tftp_readable_file', None)
- if not f:
- pytest.skip('No TFTP readable file to read')
-
- addr = f.get('addr', None)
- if not addr:
- addr = u_boot_utils.find_ram_base(u_boot_console)
-
- map = 0x0
- temp = 0x50000
- expected_write = "OK"
- output = u_boot_console.run_command('imxtract %x boot@1 %x' % (addr, temp))
- assert expected_write in output
-
- expected_erase = "Erased: OK"
- output = u_boot_console.run_command('sf erase %x +$filesize ' % map)
- assert expected_erase in output
-
- expected_write = "Written: OK"
- output = u_boot_console.run_command('sf write %x %x $filesize' % (temp, map))
- assert expected_write in output
-
- map = u_boot_console.config.buildconfig.get('config_sys_spi_u_boot_offs', "0x1000")
- map = int(map, 16)
- expected_write = "OK"
- output = u_boot_console.run_command('imxtract %x boot@2 %x' % (addr, temp))
- assert expected_write in output
-
- expected_erase = "Erased: OK"
- output = u_boot_console.run_command('sf erase %x +$filesize ' % map)
- assert expected_erase in output
-
- expected_write = "Written: OK"
- output = u_boot_console.run_command('sf write %x %x $filesize' % (temp, map))
- assert expected_write in output
-
-@pytest.mark.buildconfigspec("cmd_bdi")
-@pytest.mark.buildconfigspec("cmd_sf")
-@pytest.mark.buildconfigspec("cmd_ximg")
-def test_qspi_boot_images(u_boot_console):
- qspi_find_freq_range(u_boot_console)
- i = 0
- while i < loop:
- qspi_pre_commands(u_boot_console, random.randint(min_f, max_f))
- qspi_boot_images(u_boot_console)
- i = i + 1