qspi_write_twice(u_boot_console)
i = i + 1
+def qspi_write_continues(u_boot_console):
+
+ qspi_erase_block(u_boot_console)
+ expected_write = "Written: OK"
+ expected_read = "Read: OK"
+ addr = u_boot_utils.find_ram_base(u_boot_console)
+
+ output = u_boot_console.run_command('crc32 %x %x' % (addr + 0x10000, total_size))
+ m = re.search('==> (.+?)$', output)
+ if not m:
+ pytest.fail("CRC32 failed")
+ expected_crc32 = m.group(1)
+ # print expected_crc32
+
+ old_size = 0
+ for size in random.randint(4, page_size), random.randint(page_size, total_size), total_size:
+ size = size - old_size
+ output = u_boot_console.run_command('sf write %x %x %x' % (addr + 0x10000 + old_size, old_size, size))
+ assert expected_write in output
+ old_size = size
+
+ output = u_boot_console.run_command('sf read %x %x %x' % (addr + 0x10000 + total_size, 0, total_size))
+ assert expected_read in output
+
+ u_boot_console.run_command('md %x' % (addr + 0x10000 + total_size))
+
+ output = u_boot_console.run_command('crc32 %x %x' % (addr + 0x10000 + total_size, total_size))
+ assert expected_crc32 in output
+
+@pytest.mark.buildconfigspec('cmd_bdi')
+@pytest.mark.buildconfigspec('cmd_sf')
+@pytest.mark.buildconfigspec('cmd_memory')
+def test_qspi_write_continues(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_write_continues(u_boot_console)
+ i = i + 1
+
def qspi_erase_all(u_boot_console):
timeout = 10000000