]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
py: test: Set device before running probe
authorMichal Simek <michal.simek@xilinx.com>
Thu, 21 Dec 2017 13:11:56 +0000 (14:11 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 4 Jan 2018 15:19:13 +0000 (16:19 +0100)
Several zynq/zynqmp boards are reading mac address from eeprom that's
why device is already selected. For zc1751-dc1 this is not used that's
why i2c dev needs to be called.
In general setting the first controller is good thing to do.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
test/py/tests/test_i2c.py

index d423c36fb3f79adce4d7e1db50b1117cd58a8c52..723eb0552c368b80082e25cef18a907972416b03 100644 (file)
@@ -29,6 +29,9 @@ def test_i2c_dev(u_boot_console):
 
 @pytest.mark.buildconfigspec("cmd_i2c")
 def test_i2c_probe(u_boot_console):
+    expected_response = "Setting bus to 0"
+    response = u_boot_console.run_command("i2c dev 0")
+    assert(expected_response in response)
     expected_response = "Valid chip addresses:"
     response = u_boot_console.run_command("i2c probe")
     assert(expected_response in response)