[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 5/5] tests/qtest : Add testcase for DM163
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 5/5] tests/qtest : Add testcase for DM163 |
Date: |
Mon, 15 Apr 2024 11:37:14 +0200 |
User-agent: |
Mozilla Thunderbird |
On 14/4/24 15:05, Inès Varhol wrote:
`test_dm163_bank()`
Checks that the pin "sout" of the DM163 led driver outputs the values
received on pin "sin" with the expected latency (depending on the bank).
`test_dm163_gpio_connection()`
Check that changes to relevant STM32L4x5 GPIO pins are propagated to the
DM163 device.
Signed-off-by: Arnaud Minier <arnaud.minier@telecom-paris.fr>
Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
---
tests/qtest/dm163-test.c | 192 +++++++++++++++++++++++++++++++++++++++
tests/qtest/meson.build | 5 +
2 files changed, 197 insertions(+)
create mode 100644 tests/qtest/dm163-test.c
diff --git a/tests/qtest/dm163-test.c b/tests/qtest/dm163-test.c
new file mode 100644
index 0000000000..6f88ceef44
--- /dev/null
+++ b/tests/qtest/dm163-test.c
@@ -0,0 +1,192 @@
+/*
+ * QTest testcase for DM163
+ *
+ * Copyright (C) 2024 Samuel Tardieu <sam@rfc1149.net>
+ * Copyright (C) 2024 Arnaud Minier <arnaud.minier@telecom-paris.fr>
+ * Copyright (C) 2024 Inès Varhol <ines.varhol@telecom-paris.fr>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "libqtest.h"
+
+#define SIN 8
+#define DCK 9
+#define RST_B 10
+#define LAT_B 11
+#define SELBK 12
+#define EN_B 13
(Preferably enum).
+static void test_dm163_bank(const void *opaque)
+{
+ const long bank = (uintptr_t) opaque;
s/long/unsigned/ is enough.
+ const int width = bank ? 192 : 144;
+
+ QTestState *qts = qtest_initf("-M b-l475e-iot01a");
+ qtest_irq_intercept_out_named(qts, DEVICE_NAME, "sout");
+ GPIO_OUT(RST_B, 1);
+ GPIO_OUT(EN_B, 0);
+ GPIO_OUT(DCK, 0);
+ GPIO_OUT(SELBK, bank);
+ GPIO_OUT(LAT_B, 1);
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
- [PATCH v4 0/5] Add device DM163 (led driver, matrix colors shield & display), Inès Varhol, 2024/04/14
- [PATCH v4 5/5] tests/qtest : Add testcase for DM163, Inès Varhol, 2024/04/14
- [PATCH v4 2/5] hw/arm : Pass STM32L4x5 SYSCFG gpios to STM32L4x5 SoC, Inès Varhol, 2024/04/14
- [PATCH v4 4/5] hw/arm : Connect DM163 to B-L475E-IOT01A, Inès Varhol, 2024/04/14
- [PATCH v4 3/5] hw/arm : Create Bl475eMachineState, Inès Varhol, 2024/04/14
- [PATCH v4 1/5] hw/display : Add device DM163, Inès Varhol, 2024/04/14