From patchwork Sun Apr 21 14:02:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?In=C3=A8s_Varhol?= X-Patchwork-Id: 1925908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=telecom-paris.fr header.i=@telecom-paris.fr header.a=rsa-sha256 header.s=A35C7578-1106-11E5-A17F-C303FDDA8F2E header.b=YtPDNzaJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VMqvb6J8sz1yZS for ; Mon, 22 Apr 2024 00:07:22 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryXps-0001Qe-1d; Sun, 21 Apr 2024 10:06:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryXpm-0001PI-TV; Sun, 21 Apr 2024 10:06:22 -0400 Received: from zproxy4.enst.fr ([2001:660:330f:2::df]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryXpk-0008KR-DC; Sun, 21 Apr 2024 10:06:22 -0400 Received: from localhost (localhost [IPv6:::1]) by zproxy4.enst.fr (Postfix) with ESMTP id 9FB7E2066A; Sun, 21 Apr 2024 16:06:14 +0200 (CEST) Received: from zproxy4.enst.fr ([IPv6:::1]) by localhost (zproxy4.enst.fr [IPv6:::1]) (amavis, port 10032) with ESMTP id 09e0s9xG2QB5; Sun, 21 Apr 2024 16:06:13 +0200 (CEST) Received: from localhost (localhost [IPv6:::1]) by zproxy4.enst.fr (Postfix) with ESMTP id 91E5B2061F; Sun, 21 Apr 2024 16:06:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zproxy4.enst.fr 91E5B2061F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telecom-paris.fr; s=A35C7578-1106-11E5-A17F-C303FDDA8F2E; t=1713708373; bh=bLqPec3FceI5R9NLnnSodI+Knv8HoQGLvkpWNn2IWV4=; h=From:To:Date:Message-ID:MIME-Version; b=YtPDNzaJl+46hexN1Ggds/fW9sqDpTkeZDiAT9+8fOPefJv4h/PYi1H47+arUskZU D5/iIbeCSiyaC31nmxh9cku+NU104Us9Yq4pq+vf33qpW9Di/eASvPmUiY185+comB OTmB9PUSa40JqE2oHz9dueetyK8yq+AsdxDA/R9k= X-Virus-Scanned: amavis at enst.fr Received: from zproxy4.enst.fr ([IPv6:::1]) by localhost (zproxy4.enst.fr [IPv6:::1]) (amavis, port 10026) with ESMTP id lbi1dKfJn23E; Sun, 21 Apr 2024 16:06:13 +0200 (CEST) Received: from inesv-Inspiron-3501.. (unknown [IPv6:2a02:1808:204:e56c:d081:2a7:415b:bbbd]) by zproxy4.enst.fr (Postfix) with ESMTPSA id 4918820600; Sun, 21 Apr 2024 16:06:12 +0200 (CEST) From: =?utf-8?q?In=C3=A8s_Varhol?= To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini , Peter Maydell , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Samuel Tardieu , Arnaud Minier , qemu-arm@nongnu.org, =?utf-8?q?In=C3=A8s_Varhol?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 0/5] Add device DM163 (led driver, matrix colors shield & display) Date: Sun, 21 Apr 2024 16:02:43 +0200 Message-ID: <20240421140604.111262-1-ines.varhol@telecom-paris.fr> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2001:660:330f:2::df; envelope-from=ines.varhol@telecom-paris.fr; helo=zproxy4.enst.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This device implements the IM120417002 colors shield v1.1 for Arduino (which relies on the DM163 8x3-channel led driving logic) and features a simple display of an 8x8 RGB matrix. This color shield can be plugged on the Arduino board (or the B-L475E-IOT01A board) to drive an 8x8 RGB led matrix. This RGB led matrix takes advantage of retinal persistance to seemingly display different colors in each row. Hello, I'm planning to add a more thorough test of the display functionality in a later patch, based on the avocado test `machine_m68k_nextcube.py`. Thank you for the reviews. Changes from v4 : dm163 - redefine `DM163_NUM_LEDS` for clarity - change definition of `COLOR_BUFFER_SIZE` - rename `age_of_row` to `row_persistance_delay` - remove unnecessary QOM cast macro in GPIO handlers - remove unnecessary inline of `dm163_bank0` and `dm163_bank1` - replace occurrences of number 8 by the right define macro - use unsigned type to print GPIO input `new_stateq` STM32L4x5 qtests - add comment to explain GPIO forwarding to SoC B-L475E-IOT01A - correct formatting - use unsigned for gpio pins' indices DM163 qtest - use an enum for dm163 inputs - inline ['dm163-test'] in meson.build (I don't plan on adding qtests) OTHER - update copyrights to 2023-2024 Changes from v3 (review of the 1st commit by Peter Maydell) : - dm163.c : instead of redrawing the entire console each frame, only redraw the rows that changed using a new variable `redraw` - reset all the fields in `dm163_reset_hold` - correcting typos : persistance -> persistence - b-l475e-iot01a.rst : correcting typo Changes from v2 : Corrected typo in the Based-on message id Changes from v1 : - moving the DM163 from the SoC to the B-L475E-IOT01A machine (changing config files and tests accordingly) - restricting DM163 test to ARM & DM163 availability - using `object_class_by_name()` to check for DM163 presence at run-time - exporting SYSCFG inputs to the SoC (and adapting tests accordingly) Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Inès Varhol (5): hw/display : Add device DM163 hw/arm : Pass STM32L4x5 SYSCFG gpios to STM32L4x5 SoC hw/arm : Create Bl475eMachineState hw/arm : Connect DM163 to B-L475E-IOT01A tests/qtest : Add testcase for DM163 docs/system/arm/b-l475e-iot01a.rst | 3 +- include/hw/display/dm163.h | 59 +++++ hw/arm/b-l475e-iot01a.c | 105 +++++++-- hw/arm/stm32l4x5_soc.c | 6 +- hw/display/dm163.c | 334 ++++++++++++++++++++++++++++ tests/qtest/dm163-test.c | 194 ++++++++++++++++ tests/qtest/stm32l4x5_gpio-test.c | 13 +- tests/qtest/stm32l4x5_syscfg-test.c | 17 +- hw/arm/Kconfig | 1 + hw/display/Kconfig | 3 + hw/display/meson.build | 1 + hw/display/trace-events | 14 ++ tests/qtest/meson.build | 2 + 13 files changed, 721 insertions(+), 31 deletions(-) create mode 100644 include/hw/display/dm163.h create mode 100644 hw/display/dm163.c create mode 100644 tests/qtest/dm163-test.c