''' Get SPI device test parameters from boardenv file '''
f = u_boot_console.config.env.get('env__spi_device_test', None)
if not f:
- pytest.skip('No env file to read for SPI family device test')
+ pytest.skip('No SPI test device configured')
bus = f.get('bus', 0)
cs = f.get('chip_select', 0)
timeout = f.get('timeout', None)
if not part_name:
- pytest.skip('No env file to read SPI family flash part name')
+ pytest.skip('No SPI test device configured')
return bus, cs, mode, part_name, timeout
'''Find out minimum and maximum frequnecies that SPI device can operate'''
f = u_boot_console.config.env.get('env__spi_device_test', None)
if not f:
- pytest.skip('No env file to read for SPI family device test')
+ pytest.skip('No SPI test device configured')
min_f = f.get('min_freq', None)
max_f = f.get('max_freq', None)
pytest.fail('No SPI device available')
if not part_name in output:
- pytest.fail('SPI flash part name not recognized')
+ pytest.fail('Not recognized the SPI flash part name')
m = re.search('page size (.+?) Bytes', output)
if m:
try:
page_size = int(m.group(1))
except ValueError:
- pytest.fail('SPI page size not recognized')
+ pytest.fail('Not recognized the SPI page size')
m = re.search('erase size (.+?) KiB', output)
if m:
try:
erase_size = int(m.group(1))
except ValueError:
- pytest.fail('SPI erase size not recognized')
+ pytest.fail('Not recognized the SPI erase size')
erase_size *= 1024
try:
total_size = int(m.group(1))
except ValueError:
- pytest.fail('SPI total size not recognized')
+ pytest.fail('Not recognized the SPI total size')
total_size *= 1024 * 1024
flash_part = m.group(1)
assert flash_part == part_name
except ValueError:
- pytest.fail('SPI flash part not recognized')
+ pytest.fail('Not recognized the SPI flash part')
global SPI_DATA
SPI_DATA = {
min_f, max_f, loop = spi_find_freq_range(u_boot_console)
flashes = u_boot_console.config.env.get('env__spi_lock_unlock', False)
if not flashes:
- pytest.skip('No supported flash list for lock/unlock provided')
+ pytest.skip('No SPI test device configured for lock/unlock')
i = 0
while i < loop: