From patchwork Sat Jan 11 18:36:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13936120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56B06E7719A for ; Sat, 11 Jan 2025 18:39:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWgMR-00070x-Sw; Sat, 11 Jan 2025 13:37:27 -0500 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 1tWgMP-000709-N2; Sat, 11 Jan 2025 13:37:25 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWgMO-0003tp-41; Sat, 11 Jan 2025 13:37:25 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaf3c3c104fso528238566b.1; Sat, 11 Jan 2025 10:37:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736620640; x=1737225440; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RoziYUKRnYnrxagpLXRXx22rtFkGtEbmADAZ6jidbtg=; b=OwvfuzPOdQZHszqMwynIoTfA5qlgqfi18H4oJHmJX/Si2+7/Q5JymMjJX0A9myT8c/ hOG47uVlsaV/OC0ffVMs96c8uVBBMS/Dm4hSqAP3+Cvl9MSrH2foKDk4/43mbZeZxNx3 hnRfyssQE9vU7FktVu7wMLsrNMSHhGLS1wK3rvDkkC+pyLvNJEB79FU0CAtR3OWfmdHT vQh7XeA8UDWk9PYD9Np+fMbPfmLsSkCMqA0KbZvapZPbm1367dvKEIaD88VjXOtAQkps IJHhnU1wo4hmG9FM7+6ix2OY/FhueDpW/BVLG1LQTCGhTVBX+0XgDtbKqrq81PAqDsG7 bU7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736620640; x=1737225440; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RoziYUKRnYnrxagpLXRXx22rtFkGtEbmADAZ6jidbtg=; b=jaQ06C8grMurkfOMiu3V5K6fq5ZQ29gqsqvIdfwnwimEkSwnpGAGhGa8nw/4CuXFqH o/gdlqE+AtZhNB3bPvpUGUfskzqJ6+qhwl5DTUjLDftzqQH3WTBH2b6yhmGC7AbuhUOZ I11tA52blj9SjZFQkCAELYZroJPyAQsQa+bILDlND3rinufsKdThzTkjgwwFW2vGaxQ8 IcZOfaMesUFZDZxgePDbxXnF0geJn1Dsqc84AbLpT2mlXdBOI27d8soAoVUC4D7WhFZi udQlNv0hM/p8lnAESE/8EQlKKuA0mSuY5bw8JpzwvpGBAAIhwVEVQD4XPMcQspd4cmtu tThQ== X-Forwarded-Encrypted: i=1; AJvYcCU1miFvCSJe7XZHiZKO17GH3HtuTXj+fg3re31XwQJ+FKdXp0MqC+5EO3c9P8mwIVi6LL1oUiS6aQZUyw==@nongnu.org, AJvYcCUDjKCN4roJVOpY4LB6vJV9+BsuNPz4ia3dcjyKOKkkmls+KOZdHMv+QhrD8agVRrrISvM+EWFqNg==@nongnu.org X-Gm-Message-State: AOJu0Yyp20mbCpS7c1MckK3fOGUCC7/80dXiUp6YyAYwr54WIoNNRx97 dHkXD/KH7Rnodd9ripNUG745bclvLFniHRpLElfInwtNc8iDjVMDU9KNIg== X-Gm-Gg: ASbGncuTj0A1wxbAgPANhV7XEcQatESzH/SCaEXwABfLcKgJKwI0bG54SNSbW8x3K/I Z+UembypqamE49nGK8DZEjJcOo6Y52Y1uRP+zecUkRb4Mn/KjeSv2OeyPpZkf2yGxhCCY3fCMCX J3fiiWd6qjTWqhj3wYvT0yPfdz1qw8JnDWdd0hJF5IizTSFufJb9L4Pl90LnPpNeT/+7j2mcTl2 EgUDIOFuFp/PzTknwPDnQ4rsQAcnJKibcV/8mxfpTtHmscyv6IufGuX40Rfi4btz9fYr6WwpG2M 3Zjx76Qa8ZKCB6UaWChsVJt+yAnv+XEKlsJX8ztC9D8= X-Google-Smtp-Source: AGHT+IEo9jM0CqOrvAxD15rCaGEwbz1WfiRt4FyB7MwtqZHr62JhXzdLVkhTU8qGvPTX3xt/mcmZAQ== X-Received: by 2002:a17:907:6d23:b0:aae:a087:f972 with SMTP id a640c23a62f3a-ab2ab16b1d6mr1255846866b.11.1736620639504; Sat, 11 Jan 2025 10:37:19 -0800 (PST) Received: from Provence.localdomain (dynamic-078-054-101-099.78.54.pool.telefonica.de. [78.54.101.99]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95af187sm299026666b.142.2025.01.11.10.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 10:37:19 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Paolo Bonzini , Guenter Roeck , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Andrey Smirnov , qemu-arm@nongnu.org, =?utf-8?q?M?= =?utf-8?q?arc-Andr=C3=A9_Lureau?= , Jean-Christophe Dubois , Laurent Vivier , Bin Meng , qemu-block@nongnu.org, Bernhard Beschow Subject: [PATCH v2 00/13] i.MX and SDHCI improvements Date: Sat, 11 Jan 2025 19:36:58 +0100 Message-ID: <20250111183711.2338-1-shentey@gmail.com> X-Mailer: git-send-email 2.48.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=shentey@gmail.com; helo=mail-ej1-x632.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This series fixes some details in i.MX platform devices, improves SDHCI compatibility with U-Boot and modernizes some code. The first 5 patches are bugfixes 1/ resolving infinite loop in U-Boot esdhc driver, 2/ fixing a character echoing issue in imx-serial, 3/ fixing IRQ sharing issue in Designware PCIe emulation, and 4/ fixing GPIO level preservation across resets in imx-gpio. Patches 6 and 7 modernize SD card emulation by turning presence and write-protect GPIOs into qdev GPIOs and then further allowing the GPIOs to be inverted, just like device tree allows. The rest of the series is cosmetics including turning DPRINTF() into trace events which eases debugging. v2: * Drop redundant implementation of TYPE_OR_IRQ (David, Zoltan) * Use absolute QOM paths when tracing in imx_gpio and imx_i2c (Phil) * Trace hexadecimal values in imx_serial (Phil) * Do NOT move inversion of presence and write-protect GPIOs since that changes the internal logic of the device Bernhard Beschow (13): hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate hw/char/imx_serial: Fix reset value of UFCR register hw/char/imx_serial: Update all state before restarting ageing timer hw/pci-host/designware: Expose MSI IRQ hw/gpio/imx_gpio: Don't clear input GPIO values upon reset hw/sd/sd: Remove legacy sd_set_cb() in favor of GPIOs hw/sd/sd: Allow for inverting polarities of presence and write-protect GPIOs hw/char/imx_serial: Turn some DPRINTF() statements into trace events hw/timer/imx_gpt: Remove unused define tests/qtest/libqos: Reuse TYPE_IMX_I2C define hw/i2c/imx_i2c: Convert DPRINTF() to trace events hw/misc/imx6_src: Convert DPRINTF() to trace events hw/gpio/imx_gpio: Turn DPRINTF() into trace events include/hw/arm/fsl-imx6.h | 4 +- include/hw/arm/fsl-imx7.h | 4 +- include/hw/char/imx_serial.h | 2 +- include/hw/pci-host/designware.h | 1 + include/hw/sd/sdcard_legacy.h | 1 - hw/arm/fsl-imx6.c | 13 ++++- hw/arm/fsl-imx7.c | 13 ++++- hw/char/imx_serial.c | 65 ++++++++++++++-------- hw/gpio/imx_gpio.c | 19 +++---- hw/i2c/imx_i2c.c | 21 ++----- hw/misc/imx6_src.c | 23 ++------ hw/pci-host/designware.c | 7 +-- hw/sd/sd.c | 39 ++++++------- hw/sd/sdhci.c | 11 +++- hw/timer/imx_gpt.c | 4 -- tests/qtest/libqos/arm-imx25-pdk-machine.c | 5 +- tests/qtest/libqos/i2c-imx.c | 4 +- hw/arm/Kconfig | 2 + hw/char/trace-events | 5 ++ hw/gpio/trace-events | 5 ++ hw/i2c/trace-events | 5 ++ hw/misc/trace-events | 6 ++ 22 files changed, 151 insertions(+), 108 deletions(-)