OSDN Git Service

imx25-pdk: create ds1338 for qtest inside the test
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 18 Mar 2019 14:56:23 +0000 (15:56 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Jun 2019 12:03:02 +0000 (14:03 +0200)
There is no need to have a test device created by the board.
Instead, create it in the qtest so that we will be able to run
it on other boards too.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/arm/imx25_pdk.c
tests/ds1338-test.c

index eef1b18..a0423ff 100644 (file)
@@ -131,15 +131,6 @@ static void imx25_pdk_init(MachineState *machine)
      */
     if (!qtest_enabled()) {
         arm_load_kernel(&s->soc.cpu, &imx25_pdk_binfo);
-    } else {
-        /*
-         * This I2C device doesn't exist on the real board.
-         * We add it here (only on qtest usage) to be able to do a bit
-         * of simple qtest. See "make check" for details.
-         */
-        i2c_create_slave((I2CBus *)qdev_get_child_bus(DEVICE(&s->soc.i2c[0]),
-                                                      "i2c-bus.0"),
-                         "ds1338", 0x68);
     }
 }
 
index 88f829f..bd72a15 100644 (file)
@@ -54,7 +54,7 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
 
-    s = qtest_start("-display none -machine imx25-pdk");
+    s = qtest_start("-display none -machine imx25-pdk -device ds1338,address=0x68");
     i2c = imx_i2c_create(s, IMX25_I2C_0_BASE);
     addr = DS1338_ADDR;