summaryrefslogtreecommitdiff
path: root/test/py/tests/test_mmc_rd.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-04-07 16:40:02 -0600
committerTom Rini <trini@konsulko.com>2025-04-08 11:43:23 -0600
commitff61d6bfd1c9534d3fc2397846a5899639f2e55d (patch)
treedcfe4bc52848a5637c975a3352b57885e5b8a06d /test/py/tests/test_mmc_rd.py
parent34820924edbc4ec7803eb89d9852f4b870fa760a (diff)
parentf892a7f397a66d8d09f418d1e0e06dfb48bac27d (diff)
Merge branch 'next'
Note that this undoes the changes of commit cf6d4535cc4c ("x86: emulation: Disable bloblist for now") as that was intended only for the release due to time.
Diffstat (limited to 'test/py/tests/test_mmc_rd.py')
-rw-r--r--test/py/tests/test_mmc_rd.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/test/py/tests/test_mmc_rd.py b/test/py/tests/test_mmc_rd.py
index ea652f91361..cd1e299aa9d 100644
--- a/test/py/tests/test_mmc_rd.py
+++ b/test/py/tests/test_mmc_rd.py
@@ -7,7 +7,7 @@
import pytest
import time
-import u_boot_utils
+import utils
"""
This test relies on boardenv_* to containing configuration values to define
@@ -105,11 +105,11 @@ env__mmc_rd_configs = (
)
"""
-def mmc_dev(u_boot_console, is_emmc, devid, partid):
+def mmc_dev(ubman, is_emmc, devid, partid):
"""Run the "mmc dev" command.
Args:
- u_boot_console: A U-Boot console connection.
+ ubman: A U-Boot console connection.
is_emmc: Whether the device is eMMC
devid: Device ID
partid: Partition ID
@@ -122,7 +122,7 @@ def mmc_dev(u_boot_console, is_emmc, devid, partid):
cmd = 'mmc dev %d' % devid
if is_emmc:
cmd += ' %d' % partid
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
assert 'no card present' not in response
if is_emmc:
partid_response = '(part %d)' % partid
@@ -132,11 +132,11 @@ def mmc_dev(u_boot_console, is_emmc, devid, partid):
assert good_response in response
@pytest.mark.buildconfigspec('cmd_mmc')
-def test_mmc_dev(u_boot_console, env__mmc_dev_config):
+def test_mmc_dev(ubman, env__mmc_dev_config):
"""Test the "mmc dev" command.
Args:
- u_boot_console: A U-Boot console connection.
+ ubman: A U-Boot console connection.
env__mmc_dev_config: The single MMC configuration on which
to run the test. See the file-level comment above for details
of the format.
@@ -150,14 +150,14 @@ def test_mmc_dev(u_boot_console, env__mmc_dev_config):
partid = env__mmc_dev_config.get('partid', 0)
# Select MMC device
- mmc_dev(u_boot_console, is_emmc, devid, partid)
+ mmc_dev(ubman, is_emmc, devid, partid)
@pytest.mark.buildconfigspec('cmd_mmc')
-def test_mmc_rescan(u_boot_console, env__mmc_dev_config):
+def test_mmc_rescan(ubman, env__mmc_dev_config):
"""Test the "mmc rescan" command.
Args:
- u_boot_console: A U-Boot console connection.
+ ubman: A U-Boot console connection.
env__mmc_dev_config: The single MMC configuration on which
to run the test. See the file-level comment above for details
of the format.
@@ -171,19 +171,19 @@ def test_mmc_rescan(u_boot_console, env__mmc_dev_config):
partid = env__mmc_dev_config.get('partid', 0)
# Select MMC device
- mmc_dev(u_boot_console, is_emmc, devid, partid)
+ mmc_dev(ubman, is_emmc, devid, partid)
# Rescan MMC device
cmd = 'mmc rescan'
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
assert 'no card present' not in response
@pytest.mark.buildconfigspec('cmd_mmc')
-def test_mmc_info(u_boot_console, env__mmc_dev_config):
+def test_mmc_info(ubman, env__mmc_dev_config):
"""Test the "mmc info" command.
Args:
- u_boot_console: A U-Boot console connection.
+ ubman: A U-Boot console connection.
env__mmc_dev_config: The single MMC configuration on which
to run the test. See the file-level comment above for details
of the format.
@@ -201,11 +201,11 @@ def test_mmc_info(u_boot_console, env__mmc_dev_config):
info_buswidth = env__mmc_dev_config['info_buswidth']
# Select MMC device
- mmc_dev(u_boot_console, is_emmc, devid, partid)
+ mmc_dev(ubman, is_emmc, devid, partid)
# Read MMC device information
cmd = 'mmc info'
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
good_response = "Device: %s" % info_device
assert good_response in response
good_response = "Bus Speed: %s" % info_speed
@@ -216,11 +216,11 @@ def test_mmc_info(u_boot_console, env__mmc_dev_config):
assert good_response in response
@pytest.mark.buildconfigspec('cmd_mmc')
-def test_mmc_rd(u_boot_console, env__mmc_rd_config):
+def test_mmc_rd(ubman, env__mmc_rd_config):
"""Test the "mmc read" command.
Args:
- u_boot_console: A U-Boot console connection.
+ ubman: A U-Boot console connection.
env__mmc_rd_config: The single MMC configuration on which
to run the test. See the file-level comment above for details
of the format.
@@ -238,32 +238,32 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
read_duration_max = env__mmc_rd_config.get('read_duration_max', 0)
count_bytes = count_sectors * 512
- bcfg = u_boot_console.config.buildconfig
+ bcfg = ubman.config.buildconfig
has_cmd_memory = bcfg.get('config_cmd_memory', 'n') == 'y'
has_cmd_crc32 = bcfg.get('config_cmd_crc32', 'n') == 'y'
- ram_base = u_boot_utils.find_ram_base(u_boot_console)
+ ram_base = utils.find_ram_base(ubman)
addr = '0x%08x' % ram_base
# Select MMC device
- mmc_dev(u_boot_console, is_emmc, devid, partid)
+ mmc_dev(ubman, is_emmc, devid, partid)
# Clear target RAM
if expected_crc32:
if has_cmd_memory and has_cmd_crc32:
cmd = 'mw.b %s 0 0x%x' % (addr, count_bytes)
- u_boot_console.run_command(cmd)
+ ubman.run_command(cmd)
cmd = 'crc32 %s 0x%x' % (addr, count_bytes)
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
assert expected_crc32 not in response
else:
- u_boot_console.log.warning(
+ ubman.log.warning(
'CONFIG_CMD_MEMORY or CONFIG_CMD_CRC32 != y: Skipping RAM clear')
# Read data
cmd = 'mmc read %s %x %x' % (addr, sector, count_sectors)
tstart = time.time()
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
tend = time.time()
good_response = 'MMC read: dev # %d, block # %d, count %d ... %d blocks read: OK' % (
devid, sector, count_sectors, count_sectors)
@@ -273,14 +273,14 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
if expected_crc32:
if has_cmd_crc32:
cmd = 'crc32 %s 0x%x' % (addr, count_bytes)
- response = u_boot_console.run_command(cmd)
+ response = ubman.run_command(cmd)
assert expected_crc32 in response
else:
- u_boot_console.log.warning('CONFIG_CMD_CRC32 != y: Skipping check')
+ ubman.log.warning('CONFIG_CMD_CRC32 != y: Skipping check')
# Check if the command did not take too long
if read_duration_max:
elapsed = tend - tstart
- u_boot_console.log.info('Reading %d bytes took %f seconds' %
+ ubman.log.info('Reading %d bytes took %f seconds' %
(count_bytes, elapsed))
assert elapsed <= (read_duration_max - 0.01)