From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328407; cv=none;
	d=zohomail.com; s=zohoarc;
	b=cTxgP9tF/615QTW3Gk2o5wlLfMQDoeVbLz4dGu7e8j2yI1/ePXkk8FA89y2KXqO8NCVO1e5NCN8wum+Rg1067jXn0TSSOUmgwliOg/HdzSOkATankEULnM8y/9hd7Q8IktasfRmU+pHZ5FEq3gPcJAqleU6eeQfR3J2cMhx4YEA=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328407;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=jXu/deQBUSnnpDSne97TzvwNxObiNI5E/wDmJP67j7k=;
	b=XU2NX4Nxq8izOk0F0lpfrmbcoJYbZ3EhW/Bj4UJy4rU5IgfcJyir1PKxi6x59KXjD9LQ0WuL//auL/iKo2EKSnRC8J94KYBIobP8gLYxnu5touTuD2nAu/gXAfgfVQ38bQfNe3clgBt0wtWzAEssYIrpczF9WXFS0QuqcGicq0o=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328407961831.0828542878462;
 Wed, 8 Jan 2025 01:26:47 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKR-0003y4-5z; Wed, 08 Jan 2025 04:26:20 -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 <shentey@gmail.com>)
 id 1tVSK3-0003uV-9D; Wed, 08 Jan 2025 04:25:56 -0500
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSK1-0004lj-P6; Wed, 08 Jan 2025 04:25:55 -0500
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5d90a5581fcso327131a12.1;
 Wed, 08 Jan 2025 01:25:52 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328351; x=1736933151; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=jXu/deQBUSnnpDSne97TzvwNxObiNI5E/wDmJP67j7k=;
 b=bSLMuEeTMsmKBN5B7XrmrNkmcwyBsCbLhbI5hPIuxmC4WWIJdhVF1E7I98wKjq/Ke2
 3FBv2sx8EBpWhq0ZD2a0k95Bj4e+xEWwxVLI9AhdDrjBb/C/qqO77Y6HS/O3leQsMUrA
 eoJcBamaRjjE4+y3jhMJkNcCRCyd0+Oag+pGOHL0WXKXrq/a5Ao/Pd+C80PBWhaZzdYc
 NqOaOyLk10ZDxtUEC2ftW4k7JY3YLUsqzg3q5IvEPaS/kplqAFqlMbmK9x5nrHsU4sKP
 Txs60waZPKl5qIMZUCzO77yIhw3cpLFFJlMG2yJW4lV/PiO2Crg2iow2ZooKo49zzbcY
 zP9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328351; x=1736933151;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=jXu/deQBUSnnpDSne97TzvwNxObiNI5E/wDmJP67j7k=;
 b=SxixJltMuBmIrsBR6eBlnvIKJ/PSJrrwhNtf0TI/YnfjPguhH2GLBB9M7tYM4DEAfW
 MTZbiH584CK6NwPdlVdNgNACMuTnd5K7zZJ7Y1ilX8/ZWzBA1PBmVJ4wfZUelg87J56O
 GH7F/4Y9wuXEZbEzFwqSH0NUflAIW/AeF/zaLnTuaX4T1n2cqb1m7eeuE+Mjt5Ace7LC
 t6Vt4iXxHwnk1E2lvdBFKiVcV8rgf71kYTKWGsnJH1OdW0kn/n/YhaxBNtfO0b5pgM2f
 Dm+4jy0hUHtIaoZhweVqv0QCw9iOE0c9gK/moW+V5OdNNDPcvlhD1yQsAl1zJGNcyiVf
 bKsQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVZVmYhkmp7isB7a+GR1edgmcPqXH63e5yz5Bf630pbtm0d0SomnnNAgfLS0XpBDXDBNWeBpSxd8w==@nongnu.org,
 AJvYcCX7ESo2vflDvZN0igpz3Tu/b//1RTHSiNK5gqVHMpnUBqcoEQXgtf58/vvJ2ogWI9EPiVUv+xWvMzmyBw==@nongnu.org
X-Gm-Message-State: AOJu0YxJrFQHHxfkgwha4dOoYehNHSlI03ygkhu06tvWeykg6qnqeN8e
 5PTmj8sF0yOar3kpqMah/Gfb0XI423gWpczmt2pyqT5gPY63l0LtG2oDNXCj
X-Gm-Gg: ASbGncu1KWvQSKLG0K7j/iC2vCqPhLslc4bSHvkKa6LqAmoekSuZtFaxbyi0LSXer01
 JJBbSA7+U6siCn8WNZ0ZEqaD0JOfBttunb+X1FnwaVMY+cQQDhnFQSTx8vq33zyN+J3bEGCmrv/
 MuhvzVO8zlB8jZrqebsxowOSdNhx3hWRlN0cHc1gxTX2n5/XdCCx9ArXE/oewenPwavQ476DHto
 S12kW2iJSPbT8cKoco0d8V3EX0EP+CYY1ewQp8MiYGlMcfDzk/oq9KYNK5DkUDXNseZDDzQhwHu
 aGOR5PybJKr5fqTYRZ6wuZg9bVNW0D8gz5FTvaW1HFaQqz0=
X-Google-Smtp-Source: 
 AGHT+IEdl0jXAisf4h7trCYbLzurFWxs9kxVpMSvY31SMbqVsugTdi+MxWUuUUa4zrb0mvLwGSE+Jg==
X-Received: by 2002:a05:6402:2347:b0:5d2:729f:995f with SMTP id
 4fb4d7f45d1cf-5d972e6f957mr1368915a12.29.1736328350418;
 Wed, 08 Jan 2025 01:25:50 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 01/14] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate
Date: Wed,  8 Jan 2025 10:25:25 +0100
Message-ID: <20250108092538.11474-2-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::534;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328408467116600
Content-Type: text/plain; charset="utf-8"

In U-Boot, the fsl_esdhc[_imx] driver waits for both "transmit completed" a=
nd
"DMA" bits in esdhc_send_cmd_common() by means of DATA_COMPLETE constant. Q=
EMU
currently misses to set the DMA bit which causes the driver to loop forever=
. Fix
that by setting the DMA bit if enabled when doing DMA block transfers.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/sd/sdhci.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 299cd4bc1b..a958c11497 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -665,12 +665,13 @@ static void sdhci_sdma_transfer_multi_blocks(SDHCISta=
te *s)
         }
     }
=20
+    if (s->norintstsen & SDHC_NISEN_DMA) {
+        s->norintsts |=3D SDHC_NIS_DMA;
+    }
+
     if (s->blkcnt =3D=3D 0) {
         sdhci_end_transfer(s);
     } else {
-        if (s->norintstsen & SDHC_NISEN_DMA) {
-            s->norintsts |=3D SDHC_NIS_DMA;
-        }
         sdhci_update_irq(s);
     }
 }
@@ -691,6 +692,10 @@ static void sdhci_sdma_transfer_single_block(SDHCIStat=
e *s)
     }
     s->blkcnt--;
=20
+    if (s->norintstsen & SDHC_NISEN_DMA) {
+        s->norintsts |=3D SDHC_NIS_DMA;
+    }
+
     sdhci_end_transfer(s);
 }
=20
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328451; cv=none;
	d=zohomail.com; s=zohoarc;
	b=Vqjbvv5QC0UBvOPiPD/Y+z5dbqJQsusZsEtSrn0qzjcX9bL5lv0X9ruI9REmVZHSBUsO/wORqyzgmWJmuvCEmB92ffzsvuHbCkOjRaFH8IjOHldxPEE3j+69qvyC7LClHe5Qv50+v30dIsCJQxGH6UMfncd9u3hpRNBCflWwDwY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328451;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=pwXzEhTAhGKIo4AswhlvC0Ew8f+aipAHcykX2e2ZcNs=;
	b=F9NNRwdTg7m1YAo+CeuyxaUl7zWYJvCPgWpnlPZQlZmTwQkaXm4HSFkL6PSgl8f/YoxBsCwDhHlOIJ3lP9jxfLIejIsiF4fXbauveCZhotkjTTDqOu5fM6u1AoYjS/9CZa1Z8Tq2dSxPTOeVSreZWVwwDydzq85HR/RGAODVf3w=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328451047572.2105830915832;
 Wed, 8 Jan 2025 01:27:31 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKb-00044Z-4q; Wed, 08 Jan 2025 04:26:29 -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 <shentey@gmail.com>)
 id 1tVSK5-0003ut-6H; Wed, 08 Jan 2025 04:25:58 -0500
Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSK3-0004lu-Mf; Wed, 08 Jan 2025 04:25:56 -0500
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5d3d143376dso24189511a12.3;
 Wed, 08 Jan 2025 01:25:54 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328352; x=1736933152; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=pwXzEhTAhGKIo4AswhlvC0Ew8f+aipAHcykX2e2ZcNs=;
 b=LYNt0DkYgosJXBySE2+TDhbWtejJADoEC12EKQ0tDAocPxhKw0nZVtlFhhlBEe9EmI
 8KeR3hn7a4wYPZc2Ewm4vQRtvbz2FaoYN81F6NIVZlJI2KMM3wpYO0L/stFpznmNPQbL
 jyvlRTNmboTZDDoTy0Rw+u9WiHNiXlghbp7/Q3ihPUmgv4Qu8X7Sj3lI2RmBVh2N3XLN
 Nj/mUXlAf/i3Ker4Z6XqwnlIiZHgqVMQ5cnYc/mQK1tam8wyj6wtuG9rAE/ctrtjgFu7
 3A2hygWqaHttI+yDJwqSm5JJ61ukzqvDC3SOvBarz2s2wCdWY0V0aQK1VVsByK3GH1l3
 67aA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328352; x=1736933152;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=pwXzEhTAhGKIo4AswhlvC0Ew8f+aipAHcykX2e2ZcNs=;
 b=P29GVU+tZxF2XUzHySmJ/jbeZFMpuP3wm/Rtv1bwPux30bFv6e7Mp4ItYNZsen/wnp
 xz4N0YgoepdVRd1r5XqjUM18neVlFRIv/Z+ckvbnNLYOeTnUs9XH2EjBgjX/3Ehe/5+2
 NvFa5fy0vTIjJtSVnGBjpCGfJMTybVZWz0xf+HKG6fFJckaE2ZZOM3yZJBQqWFbeWA0R
 w4pdlXlMdinT7aJ1QeDUz/TNZG2PlnSy5HjlCbIE7Dq8sD4nspOOTOvbE28/BBVeQ7zk
 H/GKcJz+LcbgWOXM7nCOceWpZtO3q7tZngo4ESJZDdxaSLLoGcvByzwP1j6f237Rehtz
 wO3g==
X-Forwarded-Encrypted: i=1;
 AJvYcCVjBtYaLD+gvDS6TNBo0ppbDlln9G4I151ULJZrzbxm2tqqAaDKd986tJfpjUWfaJkB+znUVvjOWr8aqA==@nongnu.org,
 AJvYcCWuJlSGLrtkXtPDBSwDI5laGJKwZ7d/PZwxNNO5uDI8V4vpP9cyjQmb7ab/+JydzHXWFiSYT9oaSA==@nongnu.org
X-Gm-Message-State: AOJu0YzxmeXUb1ClebA1skWlf9GMWOZUBj2RE+RPRbJfQ2cZmMqu9khS
 GHM6I1gVqYgPuoqGQXXKKBAajpnrzdbn0Zvvz1V9fsgFIEYQ191jWeOk+mhZ
X-Gm-Gg: ASbGncsrGuEcdfPd5ph1ol5oyOSfWDKuM43Rrfs3Dr7IMi61Q4prqPQAlWxGXrMvC2A
 CgimEPGavdXT0+Es1aIYeO9LvJoE/TUCevg/cUruPI6EcyjtZzUv77BbHjzIgwmoCGRbT9iq2WH
 TOdEjFo7Y7V02yO/UTnRAg2sXU5sXakZ0Tlc9sWc2/HjfOFQpezRltZHhkJbTwN0l6pgFuCgtL9
 vQ2uhigNDCVyHouD+PaFyt52lKVAW0RQJ/XVeewkvrssDCamKnc9IN9rsuiQ59c0+dldtmRcv3S
 Es/8hWGsNvZecGyC3HZCaB38PweQMczx5gFAf3h/x+pbTe8=
X-Google-Smtp-Source: 
 AGHT+IHooUNtU1SHuHJ8W88F7WGBPnxr1ss7L89Q8JzHOKPTP+CE60tv6LlDF9PydNLMb5WFTAcL/A==
X-Received: by 2002:a05:6402:4403:b0:5d0:e9de:5415 with SMTP id
 4fb4d7f45d1cf-5d972e08601mr1558175a12.14.1736328352217;
 Wed, 08 Jan 2025 01:25:52 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 02/14] hw/char/imx_serial: Fix reset value of UFCR register
Date: Wed,  8 Jan 2025 10:25:26 +0100
Message-ID: <20250108092538.11474-3-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::52f;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x52f.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328452519116600
Content-Type: text/plain; charset="utf-8"

The value of the UCFR register is respected when echoing characters to the
terminal, but its reset value is reserved. Fix the reset value to the one
documented in the datasheet.

While at it move the related attribute out of the section of unimplemented
registers since its value is actually respected.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 include/hw/char/imx_serial.h | 2 +-
 hw/char/imx_serial.c         | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h
index 65f0e97c76..90ba3ff18c 100644
--- a/include/hw/char/imx_serial.h
+++ b/include/hw/char/imx_serial.h
@@ -109,13 +109,13 @@ struct IMXSerialState {
     uint32_t ucr1;
     uint32_t ucr2;
     uint32_t uts1;
+    uint32_t ufcr;
=20
     /*
      * The registers below are implemented just so that the
      * guest OS sees what it has written
      */
     uint32_t onems;
-    uint32_t ufcr;
     uint32_t ubmr;
     uint32_t ubrc;
     uint32_t ucr3;
diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index 12705a1337..f805da23ff 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -159,6 +159,7 @@ static void imx_serial_reset(IMXSerialState *s)
     s->ucr3 =3D 0x700;
     s->ubmr =3D 0;
     s->ubrc =3D 4;
+    s->ufcr =3D BIT(11) | BIT(0);
=20
     fifo32_reset(&s->rx_fifo);
     timer_del(&s->ageing_timer);
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328541; cv=none;
	d=zohomail.com; s=zohoarc;
	b=G4nh9KbHmKU6IPPSDCFZo0bhIp/mFnS0ltnAMW0MAH8ut2tEDhZKd+WAqzgg2aLZGnBnPrzjmN/K6OeYeJP1d0C+L08ssrejprYoW+hUxEnZyymjm9nSyJf+JSOZ4haM1ncIGLcOEjCi8TpGlAr/iIn95Io76Jh2u7WX2RzFj58=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328541;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=WARyL/sIptXT/6LU6CvnimThOZH1GGz60bhERGh4Qio=;
	b=S01KFXt5Nbc0y0Wo1Kz+RX6vNAG+0RYXKtC8nMAbc123VI2sVyu6oxBjVmF5+IoZS7ATvea5D/XMtq6jJSnphUl9eypMqvlv4algfqj0hYhjGs1GivACZ+trWE19ogC7J1+Jo3t1rf+Y2uzUw5p6by7+8z9eCTGuW6cVeB53gFo=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328540998946.9808354909959;
 Wed, 8 Jan 2025 01:29:00 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKk-00048v-Fb; Wed, 08 Jan 2025 04:26:38 -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 <shentey@gmail.com>)
 id 1tVSK6-0003v7-MD; Wed, 08 Jan 2025 04:25:59 -0500
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSK4-0004m9-GP; Wed, 08 Jan 2025 04:25:58 -0500
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5d3cf094768so4477484a12.0;
 Wed, 08 Jan 2025 01:25:55 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328354; x=1736933154; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=WARyL/sIptXT/6LU6CvnimThOZH1GGz60bhERGh4Qio=;
 b=Ll+7BDf1I7g5wbiOCuj5bDsiQMrAcGsJx8M+3h7w5V5oflfrVCIj0LAd4GXTOJsyRd
 C9cl/Mfsmg3AvcfARaBAGnOub32Jg/syNdDpALDYIBN2Ce8r5JzgIWEMlPegNfLpBfTm
 lT4JzJFfNTP0yIYz21F4WT9PmOgzJ937XMNHwSXxC8dYxDDhRHbl0h9A+3Y7q7VQAZnd
 w85ugBX/aQEHN9HRGDUJqyejNIM5p4zICYfxmk2FWWAU2OM2fJTF1i5rTENumLpJX1N3
 NKo/4rrcfuYmVuzq7optpbRxm2sTy4gQgXfVejxxdRlWLMy4pM4nmDAcDvHPnBBOHrWf
 wUbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328354; x=1736933154;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=WARyL/sIptXT/6LU6CvnimThOZH1GGz60bhERGh4Qio=;
 b=DmfA4hLKAxgYgid/oxtJw0Pxpk8pACMT0rt1PUFWx8O0eNXXVNqmtYX8L3+H55n+Bk
 LZrrKqoBIHUcRy5wzHohfq/aRAdRCEyWYQORlN2RpNbbdImHZH9XFlF11XFS77LOe7LL
 /krSUYLopVsGc+0SouJCbojG07J9kljwbMmsTXKRg4ahwC/wJI+g6RPxYcGhvu5NANwl
 bt9bIZdyGXsaNBkF/xEJmSTQU6RzRi1ctDSJ7A5qsoCXSY29xmJsNj++hwQzh04OV9/Q
 IYvDFRtKg47aixzLhkcJ1ouoTXr52OUHVspIZ0/9wea0D0LVKi9hZVNFKu7EAEAxG9HP
 1mxA==
X-Forwarded-Encrypted: i=1;
 AJvYcCW7ZIdoEaA0Xv/ZzK3fgTm5ISSspF2gmfTW2z1tbBvwnlsLV13BBYFRQPBweq0ayBQhdae1SaRW8U4FcA==@nongnu.org,
 AJvYcCWYEXTd7XoEWKdUeDZCFSDb7oTBRVnXe8/OrS9rzDrRX7hrNAhKTZ5EdUzJ13UbejQGC4OHObh3gw==@nongnu.org
X-Gm-Message-State: AOJu0Yyt+Ch9o5G8vl3Q6yJnXK8aW2ip/XJV34QFOE+cPN/RM+JDXraH
 9lEgdlNXLSOZtpMbYCh4s/+A3F2LbbIXq5kbmQGEkjke5tYHakKyGJajHnS1
X-Gm-Gg: ASbGncuAMTxunaEX5lI4TuVbCzeH92Q/qWmKjqQ8aiuSFHxMP2gYTI/c8jxnHY4tSoN
 iyGKaufjbV+SaeyZDJLtoPVBQDPQaee/ihyEQWHf3Ta3Ip9KAhkmSvRmZSrkIDIro1iETmGhkko
 xut6YoNHr9r/bud4wnBbbMzu8F1De9WXYTZ8xjeYtZaENS4woIcb02WCUQwFgulSD6XuBKFoOxi
 eAXN9BqLchCzSalNufBDIxaCX0kDUNU7TBGVSuacLbooc+3ua3mF6tiCy7L1rHPpT3JVNFNpFYl
 oWajpg1phlW14OOC6CG3TqY7wOZgx+rRlR2iZ2j/xBs3ApY=
X-Google-Smtp-Source: 
 AGHT+IE1scwrn+1aPYcOQezRhReM9RpnOzi+LYbbriSddKttnoTUo9u5sN338NRmoif0SowZpTHRhA==
X-Received: by 2002:a05:6402:90e:b0:5d3:ec6e:64bf with SMTP id
 4fb4d7f45d1cf-5d972e6f92amr1699829a12.34.1736328353712;
 Wed, 08 Jan 2025 01:25:53 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 03/14] hw/char/imx_serial: Update all state before restarting
 ageing timer
Date: Wed,  8 Jan 2025 10:25:27 +0100
Message-ID: <20250108092538.11474-4-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::534;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328542837116600
Content-Type: text/plain; charset="utf-8"

Fixes characters to be "echoed" after each keystroke rather than after every
other since imx_serial_rx_fifo_ageing_timer_restart() would see ~UTS1_RXEMP=
TY
only after every other keystroke.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/char/imx_serial.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index f805da23ff..be06f39a4d 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -381,14 +381,14 @@ static void imx_put_data(void *opaque, uint32_t value)
     if (fifo32_num_used(&s->rx_fifo) >=3D rxtl) {
         s->usr1 |=3D USR1_RRDY;
     }
-
-    imx_serial_rx_fifo_ageing_timer_restart(s);
-
     s->usr2 |=3D USR2_RDR;
     s->uts1 &=3D ~UTS1_RXEMPTY;
     if (value & URXD_BRK) {
         s->usr2 |=3D USR2_BRCD;
     }
+
+    imx_serial_rx_fifo_ageing_timer_restart(s);
+
     imx_update(s);
 }
=20
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328587; cv=none;
	d=zohomail.com; s=zohoarc;
	b=JkllQ6v6xi7dQ7nPpLFg8hOVhP+C5gB8u1BpKOwUVZEbPOVDpuktnIGTgO1u92vJkKsfjFzYzk3+/HHRSJmMPHul7tWJFNOvMeNU6ZSUishkDAeLyBjDp6jeJEaWGtAF58U+TnwMv0p/3Xg+a5ySH2UTGxxwLH1pvk7vDAS8B8c=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328587;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=aPu1XN0WSJ78Dz4uVHZFF9UQOoIdIxv9/jGfNRVw5Jw=;
	b=mIEynGLFGMd9NTbsIg2gS8lWlD7cVNmt4AY0Zh31k1q6wdUFhSZmRSYDmagR9QDm+cdjO5thtMA2dV3j9eNga/q6b5KtP5zuAWQ49WAIw9yppadio8FvUB6lfQAfy5JJ7/cJaGc/h7/rMiDjzPH7Mwr5KJkyL2gpxFmtBpQg07o=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328587209725.6945017694205;
 Wed, 8 Jan 2025 01:29:47 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKi-00046y-RG; Wed, 08 Jan 2025 04:26:37 -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 <shentey@gmail.com>)
 id 1tVSK7-0003vO-Dr; Wed, 08 Jan 2025 04:25:59 -0500
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSK5-0004mT-Mj; Wed, 08 Jan 2025 04:25:59 -0500
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5d84179ef26so4889425a12.3;
 Wed, 08 Jan 2025 01:25:56 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328355; x=1736933155; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=aPu1XN0WSJ78Dz4uVHZFF9UQOoIdIxv9/jGfNRVw5Jw=;
 b=j7xb5pb2jPBVVRVNDtYjb7IclOXD/OEIYWugNEKIDc141FnTrrSNR66yLARw3cKRBD
 4VTPpJYs5dl4W2Uhdu38HY9DtCdTLAnSd2xVOpzOhZI0rQVc7YD2VjBcV588fi1W/qB3
 biRZpJsTRgNo7xl3nv0GpFuCZNSj9EsUqQCedzxYvt9+ve3lF4CkETBqSq+pBamdsys8
 yb6o4IRyqM5DjkAygo+0nFSO/nXaVjspA5v5GV3xivHXeV4TnNltOYXzvaLqHv58XzYa
 b5my6G1CqveArerkQiWXGIvldpMtt7VhYnC7j5I0tbsVcE9mzD/ECSpX26FelWz+HYmP
 EILg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328355; x=1736933155;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=aPu1XN0WSJ78Dz4uVHZFF9UQOoIdIxv9/jGfNRVw5Jw=;
 b=aIr9TtyYNChEHCJ4FQ9Sn8uxNPaOnASqzEQfdYW5T9tEyXwEgAvdWRfx/bpo25PCqg
 2EDf8vobyOg6ywq8hipIzkBQiASHyAyj6HunHU4lqvJfxkapXESP3eP8PBsIg1BPqmxX
 ldafjUKAewN6OSFsgaEmfOSHYnvYoFId7SFaBrFO9EsvV4tnHtnMSiRO74LQoX27vj7Z
 kewUuOJaKCLM2g1+Oknl03SvSoXrgcfHnm1W5beZLWe/l3KOWnsmryCzHxj7reDqYRuP
 b/NBCSKH/WWbknaOUDBJq+SgkYgDCXPUdEe55VzFsBoOPHWy5vUgXotIZwiFpVgZMkP4
 M1dg==
X-Forwarded-Encrypted: i=1;
 AJvYcCUSqrKRTgotxzcyQkLmPgKBahxYyy7EwatHnx+Bv4ZWyNmIrFpNzYy+6DfSKWk3tIkMhdImrtmglg==@nongnu.org,
 AJvYcCXYSb/X1hWNrdfvMQJTfTdUR3RDtsZoq0juy3QZqwcjyfQsn55v2yJdAImdoZK6/6TkZq0zMpoX0VhUVw==@nongnu.org
X-Gm-Message-State: AOJu0YzVskKmQIKscCIzye/WxRrXNPrZY6Ju1OzMo8UdgVH+Oq620YDl
 sxB3olhVDL3fgwnXM+WvGwRCtEFtbig/iHQ6ICaRX3861Rw54zDDiiJ6yybH
X-Gm-Gg: ASbGncuMacfI3iMYlq+czSp6BnhPB8RVSJne40j0dvjVabknfqw53mE6xLQzFvchS5O
 kKVr33uX0T9FWk/Tj3q6Y9F5tlDZynfaPVmt8l+ZZowcrR+cjGu53dengjSP7a1wp9Nco4WVmec
 79as4PF6ji3Q40eFAadG8Ew3yBPfE3LkIMjXNiKK+yGA5NPcIbAfmB6j+3VVHegxaSXfCTGo5kB
 kGL6oG0MRjkfAWxd/F2crqvWaNs4d8tcxhySmmlxX0h6aEyVT7yqR8MvP7qvewhhS21IIETEMv6
 FsKoPbR04c/r196XAwFlzQpyqxPnPPTlV4YggI/EqiGKqJA=
X-Google-Smtp-Source: 
 AGHT+IGIdvkIyqHc0FKN2Jp91DlocfLqEpUXXhnmKMVI6La0cBQr+vzBb8GswUzk1fQHEXmYFqBfuw==
X-Received: by 2002:a05:6402:354c:b0:5d3:fb9d:3f69 with SMTP id
 4fb4d7f45d1cf-5d972e4cdd8mr1521105a12.21.1736328355021;
 Wed, 08 Jan 2025 01:25:55 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 04/14] hw/core: Introduce TYPE_SHARED_IRQ
Date: Wed,  8 Jan 2025 10:25:28 +0100
Message-ID: <20250108092538.11474-5-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::531;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x531.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328589137116600
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 include/hw/core/shared-irq.h | 39 ++++++++++++++++
 hw/core/shared-irq.c         | 88 ++++++++++++++++++++++++++++++++++++
 hw/core/Kconfig              |  3 ++
 hw/core/meson.build          |  1 +
 4 files changed, 131 insertions(+)
 create mode 100644 include/hw/core/shared-irq.h
 create mode 100644 hw/core/shared-irq.c

diff --git a/include/hw/core/shared-irq.h b/include/hw/core/shared-irq.h
new file mode 100644
index 0000000000..803c303dd0
--- /dev/null
+++ b/include/hw/core/shared-irq.h
@@ -0,0 +1,39 @@
+/*
+ * IRQ sharing device.
+ *
+ * Copyright (c) 2025 Bernhard Beschow <shentey@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+/*
+ * This is a simple device which has one GPIO output line and multiple GPIO
+ * input lines. The output line is active if at least one of the input lin=
es is.
+ *
+ * QEMU interface:
+ *  + N unnamed GPIO inputs: the input lines
+ *  + one unnamed GPIO output: the output line
+ *  + QOM property "num-lines": sets the number of input lines
+ */
+#ifndef HW_SHARED_IRQ_H
+#define HW_SHARED_IRQ_H
+
+#include "hw/sysbus.h"
+#include "qom/object.h"
+
+#define TYPE_SHARED_IRQ "shared-irq"
+
+#define MAX_SHARED_LINES 16
+
+
+OBJECT_DECLARE_SIMPLE_TYPE(SharedIRQ, SHARED_IRQ)
+
+struct SharedIRQ {
+    DeviceState parent_obj;
+
+    qemu_irq out_irq;
+    uint16_t irq_states;
+    uint8_t num_lines;
+};
+
+#endif
diff --git a/hw/core/shared-irq.c b/hw/core/shared-irq.c
new file mode 100644
index 0000000000..b2a4ea4a66
--- /dev/null
+++ b/hw/core/shared-irq.c
@@ -0,0 +1,88 @@
+/*
+ * IRQ sharing device.
+ *
+ * Copyright (c) 2025 Bernhard Beschow <shentey@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "hw/core/shared-irq.h"
+#include "hw/irq.h"
+#include "hw/qdev-properties.h"
+#include "qapi/error.h"
+#include "migration/vmstate.h"
+
+static void shared_irq_handler(void *opaque, int n, int level)
+{
+    SharedIRQ *s =3D opaque;
+    uint16_t mask =3D BIT(n);
+
+    if (level) {
+        s->irq_states |=3D mask;
+    } else {
+        s->irq_states &=3D ~mask;
+    }
+
+    qemu_set_irq(s->out_irq, !!s->irq_states);
+}
+
+static void shared_irq_init(Object *obj)
+{
+    SharedIRQ *s =3D SHARED_IRQ(obj);
+
+    qdev_init_gpio_out(DEVICE(s), &s->out_irq, 1);
+}
+
+static void shared_irq_realize(DeviceState *dev, Error **errp)
+{
+    SharedIRQ *s =3D SHARED_IRQ(dev);
+
+    if (s->num_lines < 1 || s->num_lines >=3D MAX_SHARED_LINES) {
+        error_setg(errp,
+                   "IRQ shared number of lines %d must be between 1 and %d=
",
+                   s->num_lines, MAX_SHARED_LINES);
+        return;
+    }
+
+    qdev_init_gpio_in(dev, shared_irq_handler, s->num_lines);
+}
+
+static const Property shared_irq_properties[] =3D {
+    DEFINE_PROP_UINT8("num-lines", SharedIRQ, num_lines, 1),
+};
+
+static const VMStateDescription shared_irq_vmstate =3D {
+    .name =3D TYPE_SHARED_IRQ,
+    .version_id =3D 1,
+    .minimum_version_id =3D 1,
+    .fields =3D (const VMStateField[]) {
+        VMSTATE_UINT16(irq_states, SharedIRQ),
+        VMSTATE_END_OF_LIST()
+    },
+};
+
+static void shared_irq_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc =3D DEVICE_CLASS(klass);
+
+    /* No state to reset */
+    device_class_set_props(dc, shared_irq_properties);
+    dc->vmsd =3D &shared_irq_vmstate;
+    dc->realize =3D shared_irq_realize;
+
+    /* Reason: Needs to be wired up to work */
+    dc->user_creatable =3D false;
+}
+
+static const TypeInfo shared_irq_types[] =3D {
+    {
+       .name =3D TYPE_SHARED_IRQ,
+       .parent =3D TYPE_DEVICE,
+       .instance_size =3D sizeof(SharedIRQ),
+       .instance_init =3D shared_irq_init,
+       .class_init =3D shared_irq_class_init,
+    },
+};
+
+DEFINE_TYPES(shared_irq_types)
diff --git a/hw/core/Kconfig b/hw/core/Kconfig
index d1bdf765ee..ddff977963 100644
--- a/hw/core/Kconfig
+++ b/hw/core/Kconfig
@@ -32,6 +32,9 @@ config PLATFORM_BUS
 config REGISTER
     bool
=20
+config SHARED_IRQ
+    bool
+
 config SPLIT_IRQ
     bool
=20
diff --git a/hw/core/meson.build b/hw/core/meson.build
index ce9dfa3f4b..6b5bdc8ec7 100644
--- a/hw/core/meson.build
+++ b/hw/core/meson.build
@@ -21,6 +21,7 @@ system_ss.add(when: 'CONFIG_OR_IRQ', if_true: files('or-i=
rq.c'))
 system_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('platform-bus.c'=
))
 system_ss.add(when: 'CONFIG_PTIMER', if_true: files('ptimer.c'))
 system_ss.add(when: 'CONFIG_REGISTER', if_true: files('register.c'))
+system_ss.add(when: 'CONFIG_SHARED_IRQ', if_true: files('shared-irq.c'))
 system_ss.add(when: 'CONFIG_SPLIT_IRQ', if_true: files('split-irq.c'))
 system_ss.add(when: 'CONFIG_XILINX_AXI', if_true: files('stream.c'))
 system_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c'))
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328540; cv=none;
	d=zohomail.com; s=zohoarc;
	b=Z3DojiB7mqoL5dPWDOyNuBEZru2uOhlG1a4/9xKF16oaCE3RmWPEvfJsJqHf8+YvNKsewigh9TYpsBoPyRZHmH+vy3LjNdTFww6nmukTfojXDepxV/0s/4uHb6rAoeoDisAV0L+SQ6fIU4qij6GxvxEqj5c+r5i3igweiY6gWhg=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328540;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=PM/8KKqiIECK3XXxRS6QtoZVzE/WoFutF5vWyHTxbog=;
	b=XZe03vrfJMF7asFbkvxv3ThOBM+0JhTKDzZKGSH5NTJAM8jJVcIzG4IfX9aTP6DdIt0GnJXw0O0pxaSYOL/irCBHd4RjXqgAiflmJVsJ/QBsBIKLGv3cLv0MJ64uIAVdRbrppsbmC5hc2jqfw1OaxAHApOLRi1jYXvJGnFSYaGw=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328540193916.8821294217531;
 Wed, 8 Jan 2025 01:29:00 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKk-00048f-AL; Wed, 08 Jan 2025 04:26:38 -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 <shentey@gmail.com>)
 id 1tVSKA-0003wm-5O; Wed, 08 Jan 2025 04:26:03 -0500
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSK7-0004my-7p; Wed, 08 Jan 2025 04:26:01 -0500
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5d3f28a4fccso275202a12.2;
 Wed, 08 Jan 2025 01:25:58 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328357; x=1736933157; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=PM/8KKqiIECK3XXxRS6QtoZVzE/WoFutF5vWyHTxbog=;
 b=E3s2C/YSMC57cm9wHOnA+w0zFhkHLlJMAX3jJlipyiw7xGGpDS1FZHZ14j/x3bq1iT
 YGGqB9bXJy+9YFBcSGlIkm1lsV1KGYYbydcIaqUNMZPbxqeeXoM/hexvjveeqIDSZsVb
 swzCyytGuCZISErkFnSW6aSdFwD1xI7FQr3hhCc+a7UvBl4A9Zbf2TG8mJLpk/GJhxD/
 AAtk8irF7AAyDBp/QU/kb/Kf9C1X63U4EX5dgIKjGbjl9MWFI8y1kUVmuRDlJOzMGybz
 fHkKS9RCGGS2PsXuJpZwpMzfzZAdcMZeO8a9wnMGdW9p93xfqY5XCqDg9gSjq9qcmq/V
 p5MQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328357; x=1736933157;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=PM/8KKqiIECK3XXxRS6QtoZVzE/WoFutF5vWyHTxbog=;
 b=Jx9Ejv1oLYqJPYv4qgXoOubn3ex8PkRl8/B7lbgwr0ygfAHFb+Q+AkleWx4VcMieBX
 ORyWf3Rsiwn7OgdpBMZ7MraTd5lqjNHBAYwIGYeyvPu7ORZegU/MyfxHb+yZ2eTylM3m
 sSAQbnIPUOZ0WE9MiJuHRXQYW23enEx6jzrjGs/k8hpP7qqV0pqEMRFOM4pLRqz8uGIB
 GELREcLQ3nkhgq1GAZeHhk8TP/8hNxbN5dWpQPs7APvKrxDJ9LH5kh+D/EfdJBDHmDzL
 qRUAYlp/Ck11PyVL3I8R6Qxaz4JXVl8ciXC4O5WuTGroD8tjGWmPJThLk/s7iOqq71Oc
 BTtQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUmvs1HGaq4JoJBi+ZJLML8B10qXEqIVjWWA+HlpRc969zI0Z7/77PmppsLpUEn5xdZ72qthJKqKw==@nongnu.org,
 AJvYcCXLjKNkB77xgz1FPLow3m4JSxtWh7uciyVcH6oXUtvgZfc6pOyWTPAw+MwmFxn1CCqPbuCmsXNOUpQZ9Q==@nongnu.org
X-Gm-Message-State: AOJu0Yzx0EidvLbcp6DnWWWTT4VJ4FF//Aja0PiDkb/miCrTTLOI1v1V
 SwZmBwu9rfvfB71pwBFUz7MKLnI7f9HSacuzTjVGyWqOhZ7Ut3j3UXpVW1NP
X-Gm-Gg: ASbGnctVwB2oXkV6MiSdan08S+mLfEcuMjtfi8Y31yo4n3KyVWSB3jteOTGVi0Jhc0/
 ikMCgWy1+mSozZpR+PQYGmJLk/jWEWUdldEjlfc3rVgi0nTIVnpzeSk2hXsKzO/XbwcY6ggqW52
 ZnCW3lM4+8JYAM34224drbRONgdMCPm2554zm2jyepF/N5WdQrG8xrTAXeaHrYRfOVH4eJCEdc5
 JGHnn7MdB6+sdB/Gr3Ue5S67mpxXSN70wfbB0DEp8GlNH7O6UaVrVkiKBRLglGnxc+fLdrxpNNP
 26Me5fcymFHQ26XodNGe7WvdiLWa1dRcgI/cGEJ3ozz9NtE=
X-Google-Smtp-Source: 
 AGHT+IEdakuCjej9EJUNxs5Luvib7CIxx+NApOKVQiJ6uXZvv42n2n5as6KF5OgF5UZGQKM4shwGmQ==
X-Received: by 2002:a05:6402:278f:b0:5d0:e63e:21c3 with SMTP id
 4fb4d7f45d1cf-5d972e085d7mr1620432a12.14.1736328356339;
 Wed, 08 Jan 2025 01:25:56 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 05/14] hw/pci-host/designware: Expose MSI IRQ
Date: Wed,  8 Jan 2025 10:25:29 +0100
Message-ID: <20250108092538.11474-6-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::534;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328540871116600
Content-Type: text/plain; charset="utf-8"

Fixes INTD and MSI interrupts poking the same IRQ line without keeping trac=
k of
each other's IRQ level. Furthermore, SoCs such as the i.MX 8M Plus don't sh=
are
the MSI IRQ with the INTx lines, so expose it as a dedicated pin.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 include/hw/arm/fsl-imx6.h        |  4 +++-
 include/hw/arm/fsl-imx7.h        |  4 +++-
 include/hw/pci-host/designware.h |  1 +
 hw/arm/fsl-imx6.c                | 13 ++++++++++++-
 hw/arm/fsl-imx7.c                | 13 ++++++++++++-
 hw/pci-host/designware.c         |  7 +++----
 hw/arm/Kconfig                   |  2 ++
 7 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
index 61c593ffd2..4395b2ae5e 100644
--- a/include/hw/arm/fsl-imx6.h
+++ b/include/hw/arm/fsl-imx6.h
@@ -23,6 +23,7 @@
 #include "hw/misc/imx7_snvs.h"
 #include "hw/watchdog/wdt_imx2.h"
 #include "hw/char/imx_serial.h"
+#include "hw/core/shared-irq.h"
 #include "hw/timer/imx_gpt.h"
 #include "hw/timer/imx_epit.h"
 #include "hw/i2c/imx_i2c.h"
@@ -73,6 +74,7 @@ struct FslIMX6State {
     ChipideaState      usb[FSL_IMX6_NUM_USBS];
     IMXFECState        eth;
     DesignwarePCIEHost pcie;
+    SharedIRQ          pcie4_msi_irq;
     MemoryRegion       rom;
     MemoryRegion       caam;
     MemoryRegion       ocram;
@@ -457,7 +459,7 @@ struct FslIMX6State {
 #define FSL_IMX6_PCIE1_IRQ 120
 #define FSL_IMX6_PCIE2_IRQ 121
 #define FSL_IMX6_PCIE3_IRQ 122
-#define FSL_IMX6_PCIE4_IRQ 123
+#define FSL_IMX6_PCIE4_MSI_IRQ 123
 #define FSL_IMX6_DCIC1_IRQ 124
 #define FSL_IMX6_DCIC2_IRQ 125
 #define FSL_IMX6_MLB150_HIGH_IRQ 126
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
index 411fa1c2e3..2dccc4db67 100644
--- a/include/hw/arm/fsl-imx7.h
+++ b/include/hw/arm/fsl-imx7.h
@@ -28,6 +28,7 @@
 #include "hw/watchdog/wdt_imx2.h"
 #include "hw/gpio/imx_gpio.h"
 #include "hw/char/imx_serial.h"
+#include "hw/core/shared-irq.h"
 #include "hw/timer/imx_gpt.h"
 #include "hw/timer/imx_epit.h"
 #include "hw/i2c/imx_i2c.h"
@@ -85,6 +86,7 @@ struct FslIMX7State {
     IMX7GPRState       gpr;
     ChipideaState      usb[FSL_IMX7_NUM_USBS];
     DesignwarePCIEHost pcie;
+    SharedIRQ          pcie4_msi_irq;
     MemoryRegion       rom;
     MemoryRegion       caam;
     MemoryRegion       ocram;
@@ -428,7 +430,7 @@ enum FslIMX7IRQs {
     FSL_IMX7_PCI_INTA_IRQ =3D 125,
     FSL_IMX7_PCI_INTB_IRQ =3D 124,
     FSL_IMX7_PCI_INTC_IRQ =3D 123,
-    FSL_IMX7_PCI_INTD_IRQ =3D 122,
+    FSL_IMX7_PCI_INTD_MSI_IRQ =3D 122,
=20
     FSL_IMX7_UART7_IRQ    =3D 126,
=20
diff --git a/include/hw/pci-host/designware.h b/include/hw/pci-host/designw=
are.h
index c484e377a8..bf8b278978 100644
--- a/include/hw/pci-host/designware.h
+++ b/include/hw/pci-host/designware.h
@@ -86,6 +86,7 @@ struct DesignwarePCIEHost {
         MemoryRegion io;
=20
         qemu_irq     irqs[4];
+        qemu_irq     msi;
     } pci;
=20
     MemoryRegion mmio;
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index ac8c66e242..d8c6685bac 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -106,6 +106,8 @@ static void fsl_imx6_init(Object *obj)
     object_initialize_child(obj, "eth", &s->eth, TYPE_IMX_ENET);
=20
     object_initialize_child(obj, "pcie", &s->pcie, TYPE_DESIGNWARE_PCIE_HO=
ST);
+    object_initialize_child(obj, "pcie4-msi-irq", &s->pcie4_msi_irq,
+                            TYPE_SHARED_IRQ);
 }
=20
 static void fsl_imx6_realize(DeviceState *dev, Error **errp)
@@ -435,14 +437,23 @@ static void fsl_imx6_realize(DeviceState *dev, Error =
**errp)
     sysbus_realize(SYS_BUS_DEVICE(&s->pcie), &error_abort);
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->pcie), 0, FSL_IMX6_PCIe_REG_ADDR);
=20
+    object_property_set_int(OBJECT(&s->pcie4_msi_irq), "num-lines", 2,
+                            &error_abort);
+    qdev_realize(DEVICE(&s->pcie4_msi_irq), NULL, &error_abort);
+
+    irq =3D qdev_get_gpio_in(DEVICE(&s->a9mpcore), FSL_IMX6_PCIE4_MSI_IRQ);
+    qdev_connect_gpio_out(DEVICE(&s->pcie4_msi_irq), 0, irq);
+
     irq =3D qdev_get_gpio_in(DEVICE(&s->a9mpcore), FSL_IMX6_PCIE1_IRQ);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 0, irq);
     irq =3D qdev_get_gpio_in(DEVICE(&s->a9mpcore), FSL_IMX6_PCIE2_IRQ);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 1, irq);
     irq =3D qdev_get_gpio_in(DEVICE(&s->a9mpcore), FSL_IMX6_PCIE3_IRQ);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 2, irq);
-    irq =3D qdev_get_gpio_in(DEVICE(&s->a9mpcore), FSL_IMX6_PCIE4_IRQ);
+    irq =3D qdev_get_gpio_in(DEVICE(&s->pcie4_msi_irq), 0);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 3, irq);
+    irq =3D qdev_get_gpio_in(DEVICE(&s->pcie4_msi_irq), 1);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 4, irq);
=20
     /*
      * PCIe PHY
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
index 05e3389fbe..801f49c94a 100644
--- a/hw/arm/fsl-imx7.c
+++ b/hw/arm/fsl-imx7.c
@@ -150,6 +150,8 @@ static void fsl_imx7_init(Object *obj)
      * PCIE
      */
     object_initialize_child(obj, "pcie", &s->pcie, TYPE_DESIGNWARE_PCIE_HO=
ST);
+    object_initialize_child(obj, "pcie4-msi-irq", &s->pcie4_msi_irq,
+                            TYPE_SHARED_IRQ);
=20
     /*
      * USBs
@@ -597,14 +599,23 @@ static void fsl_imx7_realize(DeviceState *dev, Error =
**errp)
     sysbus_realize(SYS_BUS_DEVICE(&s->pcie), &error_abort);
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->pcie), 0, FSL_IMX7_PCIE_REG_ADDR);
=20
+    object_property_set_int(OBJECT(&s->pcie4_msi_irq), "num-lines", 2,
+                            &error_abort);
+    qdev_realize(DEVICE(&s->pcie4_msi_irq), NULL, &error_abort);
+
+    irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTD_MSI_I=
RQ);
+    qdev_connect_gpio_out(DEVICE(&s->pcie4_msi_irq), 0, irq);
+
     irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTA_IRQ);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 0, irq);
     irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTB_IRQ);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 1, irq);
     irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTC_IRQ);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 2, irq);
-    irq =3D qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTD_IRQ);
+    irq =3D qdev_get_gpio_in(DEVICE(&s->pcie4_msi_irq), 0);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 3, irq);
+    irq =3D qdev_get_gpio_in(DEVICE(&s->pcie4_msi_irq), 1);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 4, irq);
=20
     /*
      * USBs
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index c3fc37b904..3e8c36e6a7 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -55,8 +55,6 @@
 #define DESIGNWARE_PCIE_ATU_DEVFN(x)               (((x) >> 16) & 0xff)
 #define DESIGNWARE_PCIE_ATU_UPPER_TARGET           0x91C
=20
-#define DESIGNWARE_PCIE_IRQ_MSI                    3
-
 static DesignwarePCIEHost *
 designware_pcie_root_to_host(DesignwarePCIERoot *root)
 {
@@ -90,7 +88,7 @@ static void designware_pcie_root_msi_write(void *opaque, =
hwaddr addr,
     root->msi.intr[0].status |=3D BIT(val) & root->msi.intr[0].enable;
=20
     if (root->msi.intr[0].status & ~root->msi.intr[0].mask) {
-        qemu_set_irq(host->pci.irqs[DESIGNWARE_PCIE_IRQ_MSI], 1);
+        qemu_set_irq(host->pci.msi, 1);
     }
 }
=20
@@ -335,7 +333,7 @@ static void designware_pcie_root_config_write(PCIDevice=
 *d, uint32_t address,
     case DESIGNWARE_PCIE_MSI_INTR0_STATUS:
         root->msi.intr[0].status ^=3D val;
         if (!root->msi.intr[0].status) {
-            qemu_set_irq(host->pci.irqs[DESIGNWARE_PCIE_IRQ_MSI], 0);
+            qemu_set_irq(host->pci.msi, 0);
         }
         break;
=20
@@ -680,6 +678,7 @@ static void designware_pcie_host_realize(DeviceState *d=
ev, Error **errp)
     for (i =3D 0; i < ARRAY_SIZE(s->pci.irqs); i++) {
         sysbus_init_irq(sbd, &s->pci.irqs[i]);
     }
+    sysbus_init_irq(sbd, &s->pci.msi);
=20
     memory_region_init_io(&s->mmio,
                           OBJECT(s),
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e779b5af95..0c9ccd850d 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -516,6 +516,7 @@ config FSL_IMX6
     select PL310  # cache controller
     select PCI_EXPRESS_DESIGNWARE
     select SDHCI
+    select SHARED_IRQ
=20
 config ASPEED_SOC
     bool
@@ -573,6 +574,7 @@ config FSL_IMX7
     select WDT_IMX2
     select PCI_EXPRESS_DESIGNWARE
     select SDHCI
+    select SHARED_IRQ
     select UNIMP
=20
 config ARM_SMMUV3
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328587; cv=none;
	d=zohomail.com; s=zohoarc;
	b=kb0PoxVnjXpMhaMx2xsulVIRJZ53C13zjqSvKjuqjA1l6GIqUxuCUabkYXhorE16crnNmRx8UesBa7Izxu2C9bRQjZu/arc8QWWk6j5pE/b4gQM04mRTw7EPC5yLhvG3h1c14dEZjzTKdoeSQknvPpwPvlo+tCtqgoi5WeEdBFk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328587;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=+si41bX/Zyw/CBlcJY38zyFCCW9HNp1Mb/PQUkHCqIg=;
	b=ASKm1HHGjL+k4TlIMQbolIRU7t/eoiH0GCgqvKixD0JO0bYCazM5ir8DQds3hNNli7XGaWgvjWBo8NTDfMRIuNQ5/MnoVFQT9v+YYUW9s1O9GH+Fz7+6PB6DLBkxbA7tHzOOY5M2LF9XrD0UO0cMIfOsEm39zr+JKNSirBAiYFI=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328587483586.3434528453183;
 Wed, 8 Jan 2025 01:29:47 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKl-0004A6-Pw; Wed, 08 Jan 2025 04:26:39 -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 <shentey@gmail.com>)
 id 1tVSKB-0003wx-Lr; Wed, 08 Jan 2025 04:26:03 -0500
Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKA-0004nD-7O; Wed, 08 Jan 2025 04:26:03 -0500
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5d3e6f6cf69so28517611a12.1;
 Wed, 08 Jan 2025 01:25:59 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328358; x=1736933158; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=+si41bX/Zyw/CBlcJY38zyFCCW9HNp1Mb/PQUkHCqIg=;
 b=bl9a6pJmBCz2wPv98EFhCkdqK+6YERKDtpcLD0JhYVFu4DwEhQMaoAL2ib5ETeXPdX
 83m8YNAl2kYVyS8Ape1DsfOOzDa+F9xNtKZp7Vluoybvc/IKLNE8VZndauooxmHxdlD3
 b54w2V9Z4HwdjzDZPBbboa/hn4F20ntV1moJJ1WRFboVDrcwAYR5YFx/Cfd41seA0ik5
 /+3AUWh1IFRIE4QqhfBg4AY8Bi0gfK9NFaQGkwMxVbdDCf2nQyfdXsvMIeBxpRjEI2nc
 c8X1WG5uMupsdc5dbatYxvaSvVuFoAAbrzwvhLMeuxgvo22JCnS5nytbFk0dpZKnPYyG
 3O2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328358; x=1736933158;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=+si41bX/Zyw/CBlcJY38zyFCCW9HNp1Mb/PQUkHCqIg=;
 b=nlvYUMn0S8FS0vZKf6dAdXnePVt0h3LJmHLhfTt2M90+m/4Pxl5+YHi/NA7oAibtXj
 IhC7rlk+N43dub2VIVmKNYGTwatLTTegRtBB47Pojs/F289d7ii5qPnEIlzsJFd6Gim2
 k3GznbD8AoZ0hw+8lI0fahAhmFMKmruJFLaxSkbsj53CSMNw+OtdRS9H9hu5QHpEcQGC
 DlQAdkdgRv+tRsGyLTzMmTZnNvS4/JLW4GCmimGN8KpcnFUR8jpBi4LADbaR6mUXLoAS
 jbZUKd3F05RNJppvyXosegTAyagJ1dbrSQOGTQNN90g5YQ1uUkhyhdR0T9tjzRYYlCH3
 gT5g==
X-Forwarded-Encrypted: i=1;
 AJvYcCUcD2nb2HjiBmnlM9Nz6Bqs6PEwmhLbU4oDyJv3Fd1L1DAOr1XVaA+nZ8kjjXQK9rU/ktaTMRVj7w==@nongnu.org,
 AJvYcCXdeWYAz86CseCzoszZvH7pSmxBXKWYBYjVPws0avs5yrIVe9jY3V0AAAEtvrGNPtMRaJtKM7GlCgKHKQ==@nongnu.org
X-Gm-Message-State: AOJu0YwOzYWj9z3agDSItRTSn/rABt0KPhaL4Ix43QcSE+J9JmPnimJb
 hZWcR6qBmwJw8SxR0xvnMwsGj5a0LenCxjOBD0OmAa1weovkzGQEitw7sLEd
X-Gm-Gg: ASbGncv11QuDQvfC64uQvDzHjHGtGD/wnY8A/7H51yJuxGpM1M6gBmp94qXno20Sd3O
 SE1Ty7Fwu/vNjwIBFqLw8U+U5GPnLwaNPRH5vKyMTTx0Sg8ioWihjyXsGzN+A8ETNkn35PBvLqE
 8TwLEC94C82pRFhCdmcr4HdQWOvSaoTNcrRufkUHEIkfjCkIFPEtdaMXV/O6a6UY8ePDlVjraU3
 mWOOSwirrQP49/6ZtY/Je3u+eDFo6SkhC0bvu0C7jEsG+tfPKib2xxZd1mOM6no5397HPPEYtL5
 sjhM4LDtuhp6gYgBvbOxcV9hArX6eM6Ts5BAzQ5BWu+9KgM=
X-Google-Smtp-Source: 
 AGHT+IHTJKgXpBpaV9DwiHSMDTvrEBXWrZJ3MMT352iKGc38OyNTaSSgAOhnagmwbHEjmq9PrDB04Q==
X-Received: by 2002:a05:6402:388a:b0:5d1:2631:b897 with SMTP id
 4fb4d7f45d1cf-5d972e08403mr1799549a12.14.1736328357881;
 Wed, 08 Jan 2025 01:25:57 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 06/14] hw/gpio/imx_gpio: Don't clear input GPIO values upon
 reset
Date: Wed,  8 Jan 2025 10:25:30 +0100
Message-ID: <20250108092538.11474-7-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::52b;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x52b.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328588994116600
Content-Type: text/plain; charset="utf-8"

Input GPIO values such as a present SD card may get notified before the GPIO
controller itself gets reset. Claring the input values thus loses data. Ass=
uming
that input GPIO events are only fired when the state changes, the input val=
ues
shouldn't be reset.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/gpio/imx_gpio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
index 898f80f8c8..67c47a7280 100644
--- a/hw/gpio/imx_gpio.c
+++ b/hw/gpio/imx_gpio.c
@@ -302,7 +302,6 @@ static void imx_gpio_reset(DeviceState *dev)
=20
     s->dr       =3D 0;
     s->gdir     =3D 0;
-    s->psr      =3D 0;
     s->icr      =3D 0;
     s->imr      =3D 0;
     s->isr      =3D 0;
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328407; cv=none;
	d=zohomail.com; s=zohoarc;
	b=nC+2r5m81G+4N0l7pIImrPpgisXnFGUZZZZ5kkWdVUYoYJJcbKDbRxlpaQ10rYftw8EYT1A7d3NHZxcIH5uLN7C8B+mTWTNo0CX+PjclhRnZwQ8lwhWO4jYyHNF0z2i8oDM2ORPyROtEx4VNQtcvYppUMo58HwO0eqmCG1aRxJk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328407;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=KzIHVth2Q+M+ogDlevmRB8q7SrBSOXFLndAovQfPST0=;
	b=U0ugddLV26YbdoND0XVvkir5adTM0TvwPkFknPkJJSYr03noLPnFLsngzRsJWi/oe3E/lh9nhFfwmra4yyatwIp5bB7QJwBZ4de7V6adlSBrfbnKd4E3sgLYy8c7NyMVgA6tjK4RIuH6VT8n2sG9E63tOpioezbpJHU3ikBhk04=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328407743450.18556501745616;
 Wed, 8 Jan 2025 01:26:47 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKk-00049N-Rx; Wed, 08 Jan 2025 04:26:38 -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 <shentey@gmail.com>)
 id 1tVSKE-0003xZ-1U; Wed, 08 Jan 2025 04:26:07 -0500
Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKA-0004ne-IK; Wed, 08 Jan 2025 04:26:04 -0500
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5d0ac27b412so22353553a12.1;
 Wed, 08 Jan 2025 01:26:00 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328359; x=1736933159; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=KzIHVth2Q+M+ogDlevmRB8q7SrBSOXFLndAovQfPST0=;
 b=WZssVDQmV1F49VgbILRqFoTXrPql8SpKzdyGAzQU54eLAPe8usUM7UiFRaAh+SGuHj
 fzJVVboHuXB3XrWMxrU5372SRnS207Qe0Zq9HBvgL6cpm8KdvZRqa899Eb3gBEmwVc/X
 GSkvX6XuGs8+rv+AgiP6+jUt4/lXHPU2qSgRCWvMdo1sN/Iou/POeHlIY5evS2zRufXn
 y9R0gPjpIxZIiUhMO01x0OkCLnBf7XueX3cvLZI3H02BzDqve8DCfR7Qh2MoqDmlreXD
 4FYZm9//wZ8xUo7S69qJs6L+FNElxk/G/Snr7kuTe+iTklWjFNeRZZaTZzVrpiXNK1Pm
 SsTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328359; x=1736933159;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=KzIHVth2Q+M+ogDlevmRB8q7SrBSOXFLndAovQfPST0=;
 b=WoesRx+W5wcVAg1gySepAYxJU2j7lbX9HxwXZoXYGrTktWqLfJNNy4NibpJ6Y/cm39
 atdwHzFVwaSTPIszvax4WIaEBPnHqGi73Df9X15am3StHoJRknHX+5wsVMapZNJhBC4h
 DTeUXIDp/8SomV0u7DM3JlbLCfsGUmnDgzWxnZ5hok+QxbliD9ka32hQp2lQzDnhphB+
 t/Nc4u+n6jiNV/N972GKXKJ0KbC5rT4jmWjwXzEzyWUEVswUobSD0Ph+QMz9VIuUAaXi
 m4Lv9mdSZ2++pwmtuNRWZDbSN7cj9NZL/xxrDR7+9+Jdqp8+cWYZNmttjmjCdp6excz0
 7L0w==
X-Forwarded-Encrypted: i=1;
 AJvYcCWbJaN759HpjA4UjR7zjjQdrO+oAe9yDUZWgQLrlrUZW54bTG5rXeRLVDKA1vsn9Qr0JFsmnhTSW/+ctw==@nongnu.org,
 AJvYcCXeo/UTWA4a3Xlxf+RWw1Hg4zKiH8arntSQ1taR2/OZ2GZMEfUNDqFwQ/sbXgSti7cF0D+CXp43tw==@nongnu.org
X-Gm-Message-State: AOJu0YwAa5yJ2FxajmNPomvC9gxtFJeLTW8/Xp/p0NH5licq+aA6+L+k
 Itf5oMgyEmXEaNE9IU+V0iKUe5i4RB1leRhrcNu6aFkSWuzACmJ564dqTkET
X-Gm-Gg: ASbGncs/BLaNKNqTgBHJlKzQA3+iolGti5wJV98EGfmf7NOqcbIbeH28m/FHLxkb4kH
 yrik/Dtc+xK9Gjx/SNbIj4GmazOdGGMEgatzTAAs/mxvH72Zi7UZwiilAJPNLJjoE2irnmHLoGt
 l5BQ5fOyenTVGa0Cv9KmKj5QtpDzIIr/870yPjZdv8UduxALNjj0ZC4P2In5XtbIchf36FCyf/g
 boN2Ter+ZUY1STy2OnXFMk2DSACnlL8XfOqVYUlQzMC+5H+reUxL6FbCZGOinBnjyl5hRvUmXxM
 pyIBqcdJsOuyxsI7WQIx9IShMETm4GZhPIcETL8Ktki5paU=
X-Google-Smtp-Source: 
 AGHT+IG2Kdx4wMWM1JP9cUKXUCLFi2g52GRY7FjrQqyWacC/8sgNyDN2R5uZ2JVdLyaInljYOm9vIQ==
X-Received: by 2002:a05:6402:3225:b0:5d3:cf08:d64d with SMTP id
 4fb4d7f45d1cf-5d972e6f2d4mr1759834a12.32.1736328359089;
 Wed, 08 Jan 2025 01:25:59 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 07/14] hw/sd/sd: Remove legacy sd_set_cb() in favor of GPIOs
Date: Wed,  8 Jan 2025 10:25:31 +0100
Message-ID: <20250108092538.11474-8-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::536;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x536.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328408530116600
Content-Type: text/plain; charset="utf-8"

Commit ce5dd27534b0 "hw/sd: Remove omap2_mmc device" removed the last user =
of
sd_set_cb(). Rework this functionality into GPIOs.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 include/hw/sd/sdcard_legacy.h |  1 -
 hw/sd/sd.c                    | 31 ++++++++++++++-----------------
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h
index 0dc3889555..a121232560 100644
--- a/include/hw/sd/sdcard_legacy.h
+++ b/include/hw/sd/sdcard_legacy.h
@@ -36,7 +36,6 @@ SDState *sd_init(BlockBackend *blk, bool is_spi);
 int sd_do_command(SDState *card, SDRequest *request, uint8_t *response);
 void sd_write_byte(SDState *card, uint8_t value);
 uint8_t sd_read_byte(SDState *card);
-void sd_set_cb(SDState *card, qemu_irq readonly, qemu_irq insert);
=20
 /* sd_enable should not be used -- it is only used on the nseries boards,
  * where it is part of a broken implementation of the MMC card slot switch
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 0330d432fd..aa8d86e1af 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -820,6 +820,16 @@ static inline uint64_t sd_addr_to_wpnum(uint64_t addr)
     return addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT);
 }
=20
+static bool sd_get_inserted(SDState *sd)
+{
+    return sd->blk && blk_is_inserted(sd->blk);
+}
+
+static bool sd_get_readonly(SDState *sd)
+{
+    return sd->wp_switch;
+}
+
 static void sd_reset(DeviceState *dev)
 {
     SDState *sd =3D SDMMC_COMMON(dev);
@@ -865,16 +875,9 @@ static void sd_reset(DeviceState *dev)
     sd->dat_lines =3D 0xf;
     sd->cmd_line =3D true;
     sd->multi_blk_cnt =3D 0;
-}
=20
-static bool sd_get_inserted(SDState *sd)
-{
-    return sd->blk && blk_is_inserted(sd->blk);
-}
-
-static bool sd_get_readonly(SDState *sd)
-{
-    return sd->wp_switch;
+    qemu_set_irq(sd->readonly_cb, sd_get_readonly(sd));
+    qemu_set_irq(sd->inserted_cb, sd_get_inserted(sd));
 }
=20
 static void sd_cardchange(void *opaque, bool load, Error **errp)
@@ -1034,14 +1037,6 @@ SDState *sd_init(BlockBackend *blk, bool is_spi)
     return sd;
 }
=20
-void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert)
-{
-    sd->readonly_cb =3D readonly;
-    sd->inserted_cb =3D insert;
-    qemu_set_irq(readonly, sd->blk ? !blk_is_writable(sd->blk) : 0);
-    qemu_set_irq(insert, sd->blk ? blk_is_inserted(sd->blk) : 0);
-}
-
 static void sd_blk_read(SDState *sd, uint64_t addr, uint32_t len)
 {
     trace_sdcard_read_block(addr, len);
@@ -2727,6 +2722,8 @@ static void sd_instance_init(Object *obj)
     sd->last_cmd_name =3D "UNSET";
     sd->enable =3D true;
     sd->ocr_power_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL, sd_ocr_poweru=
p, sd);
+    qdev_init_gpio_out_named(DEVICE(sd), &sd->inserted_cb, "cd", 1);
+    qdev_init_gpio_out_named(DEVICE(sd), &sd->readonly_cb, "wp", 1);
 }
=20
 static void sd_instance_finalize(Object *obj)
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328540; cv=none;
	d=zohomail.com; s=zohoarc;
	b=MgK1uJhFtgCUITq3htJ+6w4+WTdHzIeojeYh6BDC1SGXGC8Ilvxi5CDdLQxIrerFtzs6op5jYISLM4OcIGgxu/p+7JTs3kCC/+qrV7l23bC370M+v1DfPzS1BY7liGOqxdTScVFH04nZn7s4biIFeVNBuSUe9e2eyyPRI3JvhpE=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328540;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=jwa3/hEOW5oIO38CwUoCPmmJJzY27pAglGUrj1yGlSY=;
	b=mv2G7iUKeCskaGi6kP7jGnoos81lWjNozMMt2v4LctVwlfgDgvVWR5A3Z6S+Pa4WNPA4wYKuKg8PgMYrwa9H+jre23WECSjX/j5AxLV74ZpwXF+BqKzd3rFGo8pzfu+N6M98rCBnu+I4fgOHBpeqiN0hB0K2IjOm5k07vcEP1EY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328540257863.1121190330117;
 Wed, 8 Jan 2025 01:29:00 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKd-00045m-Tc; Wed, 08 Jan 2025 04:26:32 -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 <shentey@gmail.com>)
 id 1tVSKE-0003xY-1F; Wed, 08 Jan 2025 04:26:07 -0500
Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKB-0004nq-57; Wed, 08 Jan 2025 04:26:04 -0500
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-aa679ad4265so124492766b.0;
 Wed, 08 Jan 2025 01:26:02 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.25.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:25:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328360; x=1736933160; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=jwa3/hEOW5oIO38CwUoCPmmJJzY27pAglGUrj1yGlSY=;
 b=DXTG3TmSEXzfjrsop/HHcOoMgxMls6jXmjnf/y0hHA/PmQZQa3wXHplZUdf0f4COsH
 FO9LLpxPfmdcNaYhaT68JN5UyXNXb23OmXl0a3o1yHZsBTRi/3KiBUQHyZAmw8iiyS2J
 ALySGEZMGILXr5czYpEVkaBw4D3ZxaeAMQMH1wn6thPa5CzMXAz+fTMZYJQPvdB1V0Ry
 mnjyzHPGVnvDfgrMDDXGqJu/7x81IPCv5eOSYkTMigWS/5JcW5uU5d2Rg817Wq0oP3VF
 X284d8n2tqAf1UlkNb3iIvYm0vh6OeNYAvWWhrCVMjPVmGBiBPCC5j5kJM8rX9sAKFJs
 v4qg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328360; x=1736933160;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=jwa3/hEOW5oIO38CwUoCPmmJJzY27pAglGUrj1yGlSY=;
 b=ISj+TzkrEWYv6x4eI6o684jwzCHuOD9Yv4JcwstQnxvj66gM7xsD3Zqbczw5YWaVoA
 zCeBon3wccOD5aWdYl8TnxG4dw1Lp0tNpWD8ctCDQh/PTlRuH8c+KWoYWgSo+NyHeXiY
 Lm1mNkJAjwBgQie2mTXd8ugqK3EJkMA0bNbsRH6HMGpyaPkJR0eFlM7ZU8higkzqIXS1
 v97TGe+K/lR594epxz9g6bPNu0EtSunpLwHRHl511q/FoJ65XyQ2TVDgRLuWsjyi2YUA
 1EBbPf7eRhuR9wIhMu4RIYJ13KDTvax10KaY54OyobcBu9NRsMj4/tRsEh98gq2nTPHX
 3gJw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVHhMvy10MrsdyzLbwR69kskGqTGpXmmsEnXInCL4q+MzfNCQKRaPcLGgLwuTM+Bts2gtqp3F1p9e2nxg==@nongnu.org,
 AJvYcCWgLniRdroZUOVMlr4wHNbhYGHTZN/tPo3H/vuL/iJ5uAzTAZIiPQG24Rhcwm3eQuObfQz/1uZ9Yw==@nongnu.org
X-Gm-Message-State: AOJu0YxWwD7GQbnKC5VHMY1R+SG884dtr/DYDSvmSjYoua/7ItP/inbt
 RXlm9DpYnx3eQBvASoajr/WVsj+k3spSrwUEagTSWW1I+BwBgNeKfkDq8dj+
X-Gm-Gg: ASbGncsrXlKy5E9lM9QaSmhZx1nVUEaGSM4u+6dtf2Mb8i0JYd7WXxP44XciE73NXF4
 UN/HxZL/QKZqE1unLDvjkz+VPbbpBEeXOqngIeGmIWayjFKguiJ+njSCMqDRNBp+S/EJg5sm023
 QcUjFwG7eeyAAnvuEuXOU+6vCbigRVt3dtcDZa42ve1p6wmd8Zk9DudhFGB0uAPVnzf37XS0vVT
 nKSUy4G8a02v5nZfpW5tT7lcDJ6jiy9w3NxAp/3UC3QQpI+fY1u2U/PMhuAVcD1eD+2XXrX0ZKX
 Fpg7WLoZTZQ7thPh6Ksm3rd3b7Ug/RcCZDUM/wctKTWjiy4=
X-Google-Smtp-Source: 
 AGHT+IE3MJUTGN02RSGBm+gICUokg6NzVTfHjBa/mSO5LLmYq6IvfY5dI8cRFwC2wRaYvczKkJZoog==
X-Received: by 2002:a17:907:7f16:b0:aa6:7ff9:d248 with SMTP id
 a640c23a62f3a-ab290501c47mr481318866b.8.1736328360298;
 Wed, 08 Jan 2025 01:26:00 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 08/14] hw/sd/sd: Allow for inverting polarities of presence
 and write-protect GPIOs
Date: Wed,  8 Jan 2025 10:25:32 +0100
Message-ID: <20250108092538.11474-9-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::631;
 envelope-from=shentey@gmail.com; helo=mail-ej1-x631.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328540995116600
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/sd/sd.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index aa8d86e1af..a50e5c20c8 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -181,6 +181,8 @@ struct SDState {
     qemu_irq inserted_cb;
     QEMUTimer *ocr_power_timer;
     bool enable;
+    bool readonly_active_low;
+    bool inserted_active_low;
     uint8_t dat_lines;
     bool cmd_line;
 };
@@ -876,8 +878,8 @@ static void sd_reset(DeviceState *dev)
     sd->cmd_line =3D true;
     sd->multi_blk_cnt =3D 0;
=20
-    qemu_set_irq(sd->readonly_cb, sd_get_readonly(sd));
-    qemu_set_irq(sd->inserted_cb, sd_get_inserted(sd));
+    qemu_set_irq(sd->readonly_cb, sd_get_readonly(sd) ^ sd->readonly_activ=
e_low);
+    qemu_set_irq(sd->inserted_cb, sd_get_inserted(sd) ^ sd->inserted_activ=
e_low);
 }
=20
 static void sd_cardchange(void *opaque, bool load, Error **errp)
@@ -896,9 +898,9 @@ static void sd_cardchange(void *opaque, bool load, Erro=
r **errp)
     }
=20
     if (sd->me_no_qdev_me_kill_mammoth_with_rocks) {
-        qemu_set_irq(sd->inserted_cb, inserted);
+        qemu_set_irq(sd->inserted_cb, inserted ^ sd->inserted_active_low);
         if (inserted) {
-            qemu_set_irq(sd->readonly_cb, readonly);
+            qemu_set_irq(sd->readonly_cb, readonly ^ sd->readonly_active_l=
ow);
         }
     } else {
         sdbus =3D SD_BUS(qdev_get_parent_bus(dev));
@@ -2797,6 +2799,8 @@ static void emmc_realize(DeviceState *dev, Error **er=
rp)
=20
 static const Property sdmmc_common_properties[] =3D {
     DEFINE_PROP_DRIVE("drive", SDState, blk),
+    DEFINE_PROP_BOOL("cd-active-low", SDState, inserted_active_low, false),
+    DEFINE_PROP_BOOL("wp-active-low", SDState, readonly_active_low, false),
 };
=20
 static const Property sd_properties[] =3D {
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328602; cv=none;
	d=zohomail.com; s=zohoarc;
	b=IYTWKQlnaJ4EAtcEAhnbNk32R2wZKioYCUd4tslIjE1lPWXMp2hN/C9LRHs2WfeeWynY2pe5zo4Lf4RdY73Y9R33naz/opN2OIQIWbpiL+wZXiGUJLIzjPu1+YYgtrOKoUmtnNj8YQ+N1GWtU5RZ7a6ZKFnlLm+Hg6QcmHrJehs=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328602;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=vMIpdFO0N7wGBeNJgw4ik62IVdc9YLqNPL4DIkZzaYo=;
	b=U2BpM3MDIrrXiMNJTta9wVEF/Br9vvnd5lfJ0cZ0+BApuqgJkCjD6YLIy2mnKiN5nRHjlV1QHxZV4Gko5XiCgqKpQdYyp+jc6t/mRjoo9nU10H2XbnCokSfCR2fO3cVWvtD6G9mrGnk2O9zTD6hAad3p0rv/O9FJmaGRAJR2uP0=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328602256821.12788428162;
 Wed, 8 Jan 2025 01:30:02 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKm-0004Cg-3g; Wed, 08 Jan 2025 04:26:40 -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 <shentey@gmail.com>)
 id 1tVSKF-0003xl-Du; Wed, 08 Jan 2025 04:26:10 -0500
Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKC-0004oH-7g; Wed, 08 Jan 2025 04:26:07 -0500
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5d3e8f64d5dso29736822a12.3;
 Wed, 08 Jan 2025 01:26:03 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.26.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:26:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328362; x=1736933162; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=vMIpdFO0N7wGBeNJgw4ik62IVdc9YLqNPL4DIkZzaYo=;
 b=EctkDglTzH6uvHBNnQrqNyVp7zLyVigORgTAxDiOtHfuinY4vSECv3mTMwFjxEpCYh
 y0CqjrYNtJYFSNd2eF67sBx6TjJpX+oMRxCsgjgZBrtC+V7JN/shdsf46TLIfrI5VDCC
 SFtILgKtGqVFkYIjtcS7xr51YLV5jZQ3HCN9VV3tkXBNO61/vP6yCjNomYalu0q32Fvo
 iAZqe8Mzn9E6Bw598nLk/0V9ErMARsbC9kGzZrZrDcJWiiYeZbNEgcIA75LkKRgA931L
 qihXUc6Y4+qpynq+9dJjZD9v1o2e7PHa3QXG64CgXHNVMGtLreapgdMskFP/CqRw0HIP
 Kaeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328362; x=1736933162;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=vMIpdFO0N7wGBeNJgw4ik62IVdc9YLqNPL4DIkZzaYo=;
 b=hoYjcuM0vLcWq9tRWdvYsS4WBxdQs39UCrSOPMpaB1ito4bQ0tNToP3OJvbFQgDaBq
 6wNmNZNMN6LMlib9Y12x+eDhR6Lf4tTrd9QmYjG+9oRHV6Cn/DdYOjkzkkInsupyXKC/
 PPIvKMPZbVVz1YRbQ1ahHSP3HnkM6rsE4dQWDtchKhx/TPf6TL0R1vfJyB0GAy8uPvbt
 E3TZHxi4Ohug+4bl/W37JyOZjXuC2P35Vav9HHv6Eh+TzKiePk+UNPR7qMEx0tBD9tBz
 8ajknWe6CvhWHEFd2515ZWNR5HFg5WmPcrTbeqEne8IovyCPPRo1FjPRIu+A7zru0eDo
 mGDw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVuq4kfmpeu0Ef9MkLnm8SJrCnA9os+nvUEh4fraOl2oNCwx5jxHquXsGDoDrZkWK2xzjmLLTqBcudfNg==@nongnu.org,
 AJvYcCX3LchvoIeHxRR7+sNLJ1EJ3+DAw2xKeEJQVVu1xfcxMUsvWEqxgG9MDxmYt1GRYtdNBaA8OQ0gCQ==@nongnu.org
X-Gm-Message-State: AOJu0YyJDUm/K5OfoABZsWxk5wXGNXSWieEh4CSA4WWhO7MutQvgVEcX
 ffOzWsxfiA6vGEaoVIy31MFunO49OOPLm5j3hwKiFwFPsEOi3ZB8NtRs36uK
X-Gm-Gg: ASbGncvOGq5Vzo0RP+RRecuZY0Zrv7ii0Ko2oXBnPAenVKeVhGdwW3Nn+QzKI7lTIaY
 5YTZxou/2wKM/QOTt2LVmetC7u0Y1jelprALLvd6fsDodn7euLPWP+B/rWzf2K6h/xMOgJLh/ct
 0+3/9tUjAXVuz+esTATeEnU2M7g8XvV8vYhVSCXohMSTfWVFnB8o9d2fqFlSPkBYjCdX4UPw6B1
 6L8iq1DgEgsEwfyES7+/kkh78LfKzuAGFGGn05VE0pWJLhirNemK1WAIeQnWWWz3qvSYk/+N0/X
 cyS2HAc9YiCaF0DfQ7yEU1kqSrQGX1lBtEcLJLuOnVqsbek=
X-Google-Smtp-Source: 
 AGHT+IHFQrFh6c57c1Coios4cW/pdrw9Wvf4lb/JVTP2PZXx04NVCsBCCfngWDORLJUGAI+7FR3yzw==
X-Received: by 2002:a05:6402:5288:b0:5d0:b7c5:c409 with SMTP id
 4fb4d7f45d1cf-5d972e0abe4mr1669542a12.14.1736328361615;
 Wed, 08 Jan 2025 01:26:01 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 09/14] hw/char/imx_serial: Turn some DPRINTF() statements into
 trace events
Date: Wed,  8 Jan 2025 10:25:33 +0100
Message-ID: <20250108092538.11474-10-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::534;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328603055116600
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/char/imx_serial.c | 58 +++++++++++++++++++++++++++++---------------
 hw/char/trace-events |  5 ++++
 2 files changed, 44 insertions(+), 19 deletions(-)

diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index be06f39a4d..38b4865157 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -27,6 +27,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "qemu/fifo32.h"
+#include "trace.h"
=20
 #ifndef DEBUG_IMX_UART
 #define DEBUG_IMX_UART 0
@@ -185,10 +186,10 @@ static uint64_t imx_serial_read(void *opaque, hwaddr =
offset,
                                 unsigned size)
 {
     IMXSerialState *s =3D (IMXSerialState *)opaque;
+    Chardev *chr =3D qemu_chr_fe_get_driver(&s->chr);
     uint32_t c, rx_used;
     uint8_t rxtl =3D s->ufcr & TL_MASK;
-
-    DPRINTF("read(offset=3D0x%" HWADDR_PRIx ")\n", offset);
+    uint64_t value;
=20
     switch (offset >> 2) {
     case 0x0: /* URXD */
@@ -209,49 +210,67 @@ static uint64_t imx_serial_read(void *opaque, hwaddr =
offset,
             imx_serial_rx_fifo_ageing_timer_restart(s);
             qemu_chr_fe_accept_input(&s->chr);
         }
-        return c;
+        value =3D c;
+        break;
=20
     case 0x20: /* UCR1 */
-        return s->ucr1;
+        value =3D s->ucr1;
+        break;
=20
     case 0x21: /* UCR2 */
-        return s->ucr2;
+        value =3D s->ucr2;
+        break;
=20
     case 0x25: /* USR1 */
-        return s->usr1;
+        value =3D s->usr1;
+        break;
=20
     case 0x26: /* USR2 */
-        return s->usr2;
+        value =3D s->usr2;
+        break;
=20
     case 0x2A: /* BRM Modulator */
-        return s->ubmr;
+        value =3D s->ubmr;
+        break;
=20
     case 0x2B: /* Baud Rate Count */
-        return s->ubrc;
+        value =3D s->ubrc;
+        break;
=20
     case 0x2d: /* Test register */
-        return s->uts1;
+        value =3D s->uts1;
+        break;
=20
     case 0x24: /* UFCR */
-        return s->ufcr;
+        value =3D s->ufcr;
+        break;
=20
     case 0x2c:
-        return s->onems;
+        value =3D s->onems;
+        break;
=20
     case 0x22: /* UCR3 */
-        return s->ucr3;
+        value =3D s->ucr3;
+        break;
=20
     case 0x23: /* UCR4 */
-        return s->ucr4;
+        value =3D s->ucr4;
+        break;
=20
     case 0x29: /* BRM Incremental */
-        return 0x0; /* TODO */
+        value =3D 0x0; /* TODO */
+        break;
=20
     default:
         qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%"
                       HWADDR_PRIx "\n", TYPE_IMX_SERIAL, __func__, offset);
-        return 0;
+        value =3D 0;
+        break;
     }
+
+    trace_imx_serial_read(chr ? chr->label : "NODEV", offset, value);
+
+    return value;
 }
=20
 static void imx_serial_write(void *opaque, hwaddr offset,
@@ -261,8 +280,7 @@ static void imx_serial_write(void *opaque, hwaddr offse=
t,
     Chardev *chr =3D qemu_chr_fe_get_driver(&s->chr);
     unsigned char ch;
=20
-    DPRINTF("write(offset=3D0x%" HWADDR_PRIx ", value =3D 0x%x) to %s\n",
-            offset, (unsigned int)value, chr ? chr->label : "NODEV");
+    trace_imx_serial_write(chr ? chr->label : "NODEV", offset, value);
=20
     switch (offset >> 2) {
     case 0x10: /* UTXD */
@@ -374,9 +392,11 @@ static int imx_can_receive(void *opaque)
 static void imx_put_data(void *opaque, uint32_t value)
 {
     IMXSerialState *s =3D (IMXSerialState *)opaque;
+    Chardev *chr =3D qemu_chr_fe_get_driver(&s->chr);
     uint8_t rxtl =3D s->ufcr & TL_MASK;
=20
-    DPRINTF("received char\n");
+    trace_imx_serial_put_data(chr ? chr->label : "NODEV", value);
+
     imx_serial_rx_fifo_push(s, value);
     if (fifo32_num_used(&s->rx_fifo) >=3D rxtl) {
         s->usr1 |=3D USR1_RRDY;
diff --git a/hw/char/trace-events b/hw/char/trace-events
index 59e1f734a7..4c6d401b4b 100644
--- a/hw/char/trace-events
+++ b/hw/char/trace-events
@@ -52,6 +52,11 @@ escc_sunkbd_event_out(int ch) "Translated keycode 0x%2.2=
x"
 escc_kbd_command(int val) "Command %d"
 escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=3D%d dy=3D%d bu=
ttons=3D0x%01x"
=20
+# imx_serial.c
+imx_serial_read(const char *chrname, uint64_t addr, uint64_t value) "%s:[0=
x%03" PRIu64 "] -> 0x%08" PRIu64
+imx_serial_write(const char *chrname, uint64_t addr, uint64_t value) "%s:[=
0x%03" PRIu64 "] <- 0x%08" PRIu64
+imx_serial_put_data(const char *chrname, uint32_t value) "%s: 0x%" PRIu32
+
 # pl011.c
 pl011_irq_state(int level) "irq state %d"
 pl011_read(uint32_t addr, uint32_t value, const char *regname) "addr 0x%03=
x value 0x%08x reg %s"
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328555; cv=none;
	d=zohomail.com; s=zohoarc;
	b=eygN3pWyj2ACnhdIrvvu4hdpqob9hEuAOplnj8NrJ9Jt8LdCPUjrSmfD9vxA/RHG0+4qEVZSdPyo3ZVIqou1gPb1b5SoCn5h2FrWPhUO8ymHwY559WRHjJmyw73WmdSl1YyrRwpgOOuDnFNJFqVFjOAywkxoWdruu8qhSJFiyXY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328555;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=fs6DjGCcdE+uixmXV2Su2ClqzCx3jJdPOZ1E1qUMw70=;
	b=NGp5XSZv7Y5WbvGtzN88+KulAIXA3HcqWcacLTwXn/jB3Qqdbtz9UuyGJ7uuEN0jdabfq0nPBFgW1uMvjBk/On9TCZVmny0Q193qvu1qI1VVROvD23qrfH5EQ/OMT8ISb2T5MDAzS+qPBTSQqOSVaDenFPh351LooRtQ30jzTqk=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328555896622.9654888217855;
 Wed, 8 Jan 2025 01:29:15 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSLY-000535-03; Wed, 08 Jan 2025 04:27:29 -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 <shentey@gmail.com>)
 id 1tVSKG-0003xn-2I; Wed, 08 Jan 2025 04:26:14 -0500
Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKE-0004p0-Eu; Wed, 08 Jan 2025 04:26:07 -0500
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5d3f65844deso28025980a12.0;
 Wed, 08 Jan 2025 01:26:05 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.26.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:26:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328363; x=1736933163; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=fs6DjGCcdE+uixmXV2Su2ClqzCx3jJdPOZ1E1qUMw70=;
 b=HzpZ8LHpCXR62ipeE/AxTEjvjifSOzQHr+wePIAioKKProLTMjpmrgb1rR1ZWCTdZL
 E9Eaw/Sy76LYf4PZuLy4+hiuDbg9kDr1gWXz4CCGytMUcUWfufM6IZpmDrcctEPdz+ko
 zQ6mnsLH97ohxE4CkRyW4exjgYcTsU9RIpf24DsUZuKMSF0pH+pE4Ez3x23oRoWyZq/o
 HoCDkn5xtifVJxV/kMT9XpmDnby+g0Jk2aCUttrPitth3zOWQxSdJjs0IFP1V5vx8Twi
 V1fmOKx3Z5V54e+xCg2W+gkNNHUjASRBztMwMG+UiPAPWcyutxM325xv+bbA0ULwGpAj
 iWMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328363; x=1736933163;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=fs6DjGCcdE+uixmXV2Su2ClqzCx3jJdPOZ1E1qUMw70=;
 b=pP238RTg/seakgGYu+rk4s/VPt6tw/HrkD9krh2quFQJv0rSKcb3v4MunNHnCAr07w
 9HaMY+KaoYfOUNkxDjGc0Eh30yLJfY8AMINhg3iACPpj9xVEaXTXaNUXva2rN0K0F6uQ
 +RccgS9sRJgdrjRs89MMApvHkmrzo7VNP+XvFyO211cXGQfWbVD691VoMrtSHM2ZNua9
 e7+hGHyVvYaxNKNCoBkkSws4dBQ16F51uL4x/gR0a/DqKdNw5RGfHc6z6EY+RWCMhq48
 UEZNDambhse0P0EacH0LfB8kAmm1mmnLZiYTNxGNrCdLCgn3hHWGb7nFSs+bWT4nNnkW
 rDKg==
X-Forwarded-Encrypted: i=1;
 AJvYcCUY2M7WVzFAhyCgQdCak6HKEUy+b4GXJzCNyIq6M588h1FDBueyEnz6NHQoLZGY1EEdvuMhi1q3XQ==@nongnu.org,
 AJvYcCWBGJFy05IXmH8z/ezGJbljd9AJTNmEWdvoZnsie821Ut2XIMNsj/5Km3NLatgqiBNAbGUtWVP+HSGUDw==@nongnu.org
X-Gm-Message-State: AOJu0YwCs6N/SXGiGkSpuOUsqc8/jt+tmBE7LFNdTcGP+GjUDYTmn+mB
 KLGnfSo/eW0X8rpRTS2GS4XuA4JrG0e64WbzxzInfz/LnfrSRFAeApx2nYEs
X-Gm-Gg: ASbGnct+TVlSEPPnSh6NDdPxI+ydfNiv/+KFg8ZWQHkSlTS4vjCHmzPYU+OVnHdKW7V
 WR9b6dozu7stnH70Cq84wiU2fKvX8parzyIirOzLUWzGdYwqTzsZeaxdhvDJ/q7hRnLxsGss95s
 iZ2rGD0ymyv4Neqxo9cRl92hinFxXfIZIVP+NRItKwLtUYmeXrkbSreofLnIDDDzgvUwCNqOZxZ
 Y9yYcLul8P9OFxwF3aD5GuoPrN9cuEQoS3+MDFb2nBfjj1x7dHJFsgbKd6YCTLnRIuGrvVov+/g
 hTqHxSGEdx2/Q6HWRS68Sse4EQvCSpFl+nedavbp3wbgFzc=
X-Google-Smtp-Source: 
 AGHT+IGHNLsXgqgzzRHrOSFFAiuB5D72sJFKZmgk3zOb/nTianpJix3O2TyoK6rTfZXEBrHE3/fPBg==
X-Received: by 2002:a05:6402:268c:b0:5d2:d72a:77e4 with SMTP id
 4fb4d7f45d1cf-5d972e6c9b0mr1687005a12.28.1736328363114;
 Wed, 08 Jan 2025 01:26:03 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 10/14] hw/timer/imx_gpt: Remove unused define
Date: Wed,  8 Jan 2025 10:25:34 +0100
Message-ID: <20250108092538.11474-11-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::529;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x529.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328556874116600
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/timer/imx_gpt.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/hw/timer/imx_gpt.c b/hw/timer/imx_gpt.c
index 2663a9d9ef..11eca9fa4d 100644
--- a/hw/timer/imx_gpt.c
+++ b/hw/timer/imx_gpt.c
@@ -20,10 +20,6 @@
 #include "qemu/log.h"
 #include "trace.h"
=20
-#ifndef DEBUG_IMX_GPT
-#define DEBUG_IMX_GPT 0
-#endif
-
 static const char *imx_gpt_reg_name(uint32_t reg)
 {
     switch (reg) {
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328610; cv=none;
	d=zohomail.com; s=zohoarc;
	b=YKswxpJkEuzUSXJtabpBlDxVgJ4z5GyBenBu+mAECZM0nlxEag/YlCGWe7SYYCv2MCvIVuYG1v4eLjqM/WtK0Pbc34otcBRT6W1oJRBRv8wOD5T8vOprC9oPon7hbDrugHnibRtl4e0UPKlHfqIrlpdK5WFG+1LqqUpmgclh3dU=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328610;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=qbHAwk39a0EI/mfJEXYlFT6Wq50d666L3aYBs+8Wil0=;
	b=IXJh8rp8aqDRRCvrmJwEa3ZnvEVGd2neJVSRG0BNNAB+zoTHwjgojLWrmc3+5UNb4xoiYY9B9wi4+k5K7dX5Cb0up2rYkU6t14Mp9GxfSWWolH3WwP+xFUsCO3V/WejvfakJX9G9y1AR6wbtuW8uWoWKQ2bMndxH7HwEgR+ramU=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 173632861042058.62540965128585;
 Wed, 8 Jan 2025 01:30:10 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKr-0004G6-Kl; Wed, 08 Jan 2025 04:26:46 -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 <shentey@gmail.com>)
 id 1tVSKH-0003xy-3N; Wed, 08 Jan 2025 04:26:14 -0500
Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKF-0004pJ-GZ; Wed, 08 Jan 2025 04:26:08 -0500
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5d7e3f1fdafso34640631a12.0;
 Wed, 08 Jan 2025 01:26:06 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.26.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:26:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328365; x=1736933165; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=qbHAwk39a0EI/mfJEXYlFT6Wq50d666L3aYBs+8Wil0=;
 b=O3kQTyyvy9f32SQTLnuUfCI0K5LE9l5SW9WjfkF7h8QAf57NKnNOVhuN2rbD4BMZOZ
 OwsUGE13yvS66AnvIb87Pa34/o8I7s83eWokn0m5dlmjt97P35BMOAf4LKJJTMiqIY0j
 G0m6g2DTcFXGY8Az5P1LUvhQiVDV7BihnXtMzybIDID4AkvyjgAE816ngS891EW+aPHg
 WkZQffqChRSBL9Pq28IPYWj/13VcZy6PAkxabEPnWdZgJ7nKIRzKa1L1DO8rKHfhU9zr
 70nzYQtjw7UuhzgcsWzX8gDIwzU+G/Pap0rrk6afoc53YrHM4FNObQsVuFiFknqHdLuG
 nEDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328365; x=1736933165;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=qbHAwk39a0EI/mfJEXYlFT6Wq50d666L3aYBs+8Wil0=;
 b=dZDZlIlv2mxvNk2P+E+FFY9j1N1tmVSvEnw44Tc1IBKa/ScIoeQl9tX9O0IjGpD+tP
 TxvH5cnufvdHYzPYLhZXPmuluKTTcDmwN/u+94US3gXVV8kXPWC0u7+dJnH0ZrpUfkfM
 lS8cfWMwlj7LQNPA21On7s7+ooMx+8+3ZOMXJ+SaN9VPyMtUu8YVsQFLv6DOG0c0x6pj
 XNdBWBni52zFFh74AEVfHA0Syhr1S/golv3VyTg/v8dmn7OaUs6oR3DSeAFB+MlRRFWD
 0TiWB5FLtqk9Fv0/xquf1UFstd+OXNMlV/WCa2TYlH1vkVLcJCXZmiHOoWZhJAd7CwNz
 c/vg==
X-Forwarded-Encrypted: i=1;
 AJvYcCUDCv6WP5IfXJDiWXQVN28lx+AwskstaF/1Mq4q8EMUbctVYNQ0DJOtJV65PZW6Bkm6Fdvf/yUvaw==@nongnu.org,
 AJvYcCW00OfVpW22CrWG9jEvbW36eR7Jah9o5sZoTzKEZqoLSTucav/IXZjcN1LpZh9viwuamkiRcbEJ+dPRjg==@nongnu.org
X-Gm-Message-State: AOJu0Ywm6I7Fs7q+eeePq7GOGiSwLbRGZ3cWvoodwcU5rd+GM97dTlsj
 PPMkc787/nDft28J7hvrQO2JhqzOLBRs/uhUAlnbbGnZP7zOMUcXda0A4+Wi
X-Gm-Gg: ASbGncvJ6IQ1Sx94pr/A6BKD5PzpeHa7m92tszSRMPWSh46u4Ol2LWDWpy+RSMj4V9h
 To7Dz3tBII8MNkZi+zPh6gPuRR8Hq4qnUUUNkOmK5g6vFWwSzDLEilhzExvLiPszKWbKMPgt7KQ
 7lrq9m8qvujndilyMEKM3UoesWHT22w0BoDcVOJRRYZCJpxQA8+xxFQ/rFnkE9QGWs5yAPcwowg
 qFjzk5JDfZLSdPMiqeLEGVfjM+Gps6QIr5jbNo5bN9SlU45Xza//cFeWmar2CFtEpNXiw3hgveQ
 /jXxYXT8IWqt2Dx2ICr769jpElCbPR/X4zJ/zmJaaXU2AWM=
X-Google-Smtp-Source: 
 AGHT+IE340ZO7/O4tWuw3vvS7/AUxeFEvFt5RUzTOe8GQ+NPh/kb66lntRwqwh+XS39R3YcbD8t8pg==
X-Received: by 2002:a05:6402:2686:b0:5d9:a55:810c with SMTP id
 4fb4d7f45d1cf-5d972df64c2mr1509804a12.5.1736328364806;
 Wed, 08 Jan 2025 01:26:04 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 11/14] tests/qtest/libqos: Reuse TYPE_IMX_I2C define
Date: Wed,  8 Jan 2025 10:25:35 +0100
Message-ID: <20250108092538.11474-12-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::535;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x535.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328611073116600
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 tests/qtest/libqos/arm-imx25-pdk-machine.c | 5 +++--
 tests/qtest/libqos/i2c-imx.c               | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/qtest/libqos/arm-imx25-pdk-machine.c b/tests/qtest/libqo=
s/arm-imx25-pdk-machine.c
index 8fe128fae8..2d8b754343 100644
--- a/tests/qtest/libqos/arm-imx25-pdk-machine.c
+++ b/tests/qtest/libqos/arm-imx25-pdk-machine.c
@@ -23,6 +23,7 @@
 #include "libqos-malloc.h"
 #include "qgraph.h"
 #include "i2c.h"
+#include "hw/i2c/imx_i2c.h"
=20
 #define ARM_PAGE_SIZE            4096
 #define IMX25_PDK_RAM_START      0x80000000
@@ -50,7 +51,7 @@ static void *imx25_pdk_get_driver(void *object, const cha=
r *interface)
 static QOSGraphObject *imx25_pdk_get_device(void *obj, const char *device)
 {
     QIMX25PDKMachine *machine =3D obj;
-    if (!g_strcmp0(device, "imx.i2c")) {
+    if (!g_strcmp0(device, TYPE_IMX_I2C)) {
         return &machine->i2c_1.obj;
     }
=20
@@ -86,7 +87,7 @@ static void imx25_pdk_register_nodes(void)
         .extra_device_opts =3D "bus=3Di2c-bus.0"
     };
     qos_node_create_machine("arm/imx25-pdk", qos_create_machine_arm_imx25_=
pdk);
-    qos_node_contains("arm/imx25-pdk", "imx.i2c", &edge, NULL);
+    qos_node_contains("arm/imx25-pdk", TYPE_IMX_I2C, &edge, NULL);
 }
=20
 libqos_init(imx25_pdk_register_nodes);
diff --git a/tests/qtest/libqos/i2c-imx.c b/tests/qtest/libqos/i2c-imx.c
index 710cb926d6..6d868e4cc4 100644
--- a/tests/qtest/libqos/i2c-imx.c
+++ b/tests/qtest/libqos/i2c-imx.c
@@ -209,8 +209,8 @@ void imx_i2c_init(IMXI2C *s, QTestState *qts, uint64_t =
addr)
=20
 static void imx_i2c_register_nodes(void)
 {
-    qos_node_create_driver("imx.i2c", NULL);
-    qos_node_produces("imx.i2c", "i2c-bus");
+    qos_node_create_driver(TYPE_IMX_I2C, NULL);
+    qos_node_produces(TYPE_IMX_I2C, "i2c-bus");
 }
=20
 libqos_init(imx_i2c_register_nodes);
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328470; cv=none;
	d=zohomail.com; s=zohoarc;
	b=NUYvZCD/+ZC1zdM84hcksFDMp0MoGXt726H8ycuuqhC1idAavO5eOUCZt/xfF4jqWquHCQh9fiSTqLSHU1TWftupnFEItVMDz6iA0KESxdwzsDRJUpldjslKPlFAM/pqT6yeaISC2peDNtjxgpsRX6Ft/RAgFAUTSgAUPhSO5UY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328470;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=47JwbBXTIXSphmQBXHikRa/hsHdiVRz6iqvffl0LB6Y=;
	b=M2wZV5DHFDTG2FmgQ9SwfEA+DIZ/+A/mGSewvza865h9C+Z3uY9ihjaRvA/KN33hHnXTW1vKS1YfTmC722gKo4VCn3ooak+KV/ZRH5cz30vEvUbWa48Z4hJMnb58s7w0JnsYNAYKKLMB7I9Ow8KRJTnlMFWhawfz3/l1iZMWNY4=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328470683796.5522376995946;
 Wed, 8 Jan 2025 01:27:50 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSLk-0005Zw-Pr; Wed, 08 Jan 2025 04:27:42 -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 <shentey@gmail.com>)
 id 1tVSKI-0003y2-T6; Wed, 08 Jan 2025 04:26:14 -0500
Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKH-0004pr-9K; Wed, 08 Jan 2025 04:26:10 -0500
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-aaedd529ba1so1881761266b.1;
 Wed, 08 Jan 2025 01:26:08 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.26.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:26:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328366; x=1736933166; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=47JwbBXTIXSphmQBXHikRa/hsHdiVRz6iqvffl0LB6Y=;
 b=SMOG6IyZyNdqlFTLY3aZlsh9BjgDQvAQ4i9wDoPydWZcexIaOuRlDKgSW7F+7yzc9s
 xQ5PqZWdjUCNKF5ySU9cFO8ZLzo01p2q6CjMiDNp2/5x04oBmaXmRElNmKEwFbpOL4ci
 IwCJ30VhbMgZzZWOZEmSL90m2zIg0yTobTbpsDAWwNXBcayjXAEbQByqHAV5SL7GvwDn
 1SiwiPreOchYD6owf7Cz+u4UX1FSlPGP5nRqelwcK3jk8ddpDgm1cLZa4fXRQEJJdPT8
 H5UyRWz/LCUSpZhVYm13QvIe0nBykay1qSLzAw9kNTAFlqbn0d5ueH7lk2O60hvo/0D+
 lOUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328366; x=1736933166;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=47JwbBXTIXSphmQBXHikRa/hsHdiVRz6iqvffl0LB6Y=;
 b=Vl4k3iYZok1I6awFiPMMv95tVuBTAb1Mr0CVmUddDJnVv4AMU+czoREuwdfVQRoM6p
 nW+TbnCSYZ6ZpnydGuuXgz5sn3zzGxVxoSvEHjxnoF/xtpFOO47q3bPqYbqOWCz7/MvI
 r8EdZMPq18T26gL/1RIYAkSUeTp6owPfEWBPUwi/rYEX0OTxznBher4tt6BAGcY0RqRm
 NgSgnyGbbhLJjbbBMklDncdX4H+CXvduLEx4RMSqIwLw7+X3Z68jl78WTHKpWB1w7Uet
 XSk33Lh2SJsd2rfbQzPp8Ik/MVrdsyHyIAGGgQJOgYN11bohZgw1Sh+j+wE9pFDlgO9p
 dyyw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUmdJlQcm6bqu5sYUplGIEYK812C0H7/6nN6PIRf11VEh3FJ7jQJexdaFPogI+9Ckt8zqEYewvv5D5Kzg==@nongnu.org,
 AJvYcCVxUt1m0aX4RJei2RFa8Z4A0xF0PquaZVAJrj9IsfzuAgK02I3zXv2tzBwQLzpL12frSG7O8P/R9g==@nongnu.org
X-Gm-Message-State: AOJu0YzupVRBsLYYN7o+vRuq7dpVa17/Y91BVRS7ks/xpAnUjJZBjFO8
 R/ixVdSk5+61moCMG/BLa+YwKo9fwGVqGCyfI25fboqA9uVeNXder6NpihY6
X-Gm-Gg: ASbGncsFo5tqqIxoJRdwhzSpilUpqnUqtVo6w1LRvaseEMg+yj4P7DQOQ1wP/RNMgm4
 YLi6sEpLHKui0xWgiY5K0H1Po+4vDcksm7Hy/TRerLdqTBbQqVQMYs09t/OraZDX87GxTjifz8l
 grGjcsGLqobNGS+IDmKMzpoeoYOv3Nu2zJ1GBRBKpvNnlYNUQbAaztgmynAvOFYtWbrkvm47NiT
 36pLm35MpS1+YsUwx6Fa5sS+57f82JNWe3aKbowpMf0bPJC7MiHwMFR/YD5elfv3Wc0JOYFsVEZ
 Jv5p7zIug9RZ9m8qqOkFqUauuDyFeZgrGXFuSMHfuJesErw=
X-Google-Smtp-Source: 
 AGHT+IF37DM0lPHB6Ht98gxxrmOuEFwmsCCUIHmk5DNfMwiQGRjHc//EVHJJ1SocaxQ68nZdO5pjog==
X-Received: by 2002:a05:6402:4405:b0:5d4:35c7:cd7a with SMTP id
 4fb4d7f45d1cf-5d972e0b20cmr4743427a12.10.1736328366331;
 Wed, 08 Jan 2025 01:26:06 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 12/14] hw/i2c/imx_i2c: Convert DPRINTF() to trace events
Date: Wed,  8 Jan 2025 10:25:36 +0100
Message-ID: <20250108092538.11474-13-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::62c;
 envelope-from=shentey@gmail.com; helo=mail-ej1-x62c.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328472652116600
Content-Type: text/plain; charset="utf-8"

Also print the MMIO address when tracing. This allows to distinguishing the
many instances a typical i.MX SoC has.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/i2c/imx_i2c.c    | 21 +++++----------------
 hw/i2c/trace-events |  5 +++++
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/hw/i2c/imx_i2c.c b/hw/i2c/imx_i2c.c
index c565fd5b8a..be1688c064 100644
--- a/hw/i2c/imx_i2c.c
+++ b/hw/i2c/imx_i2c.c
@@ -25,18 +25,7 @@
 #include "hw/i2c/i2c.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
-
-#ifndef DEBUG_IMX_I2C
-#define DEBUG_IMX_I2C 0
-#endif
-
-#define DPRINTF(fmt, args...) \
-    do { \
-        if (DEBUG_IMX_I2C) { \
-            fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_I2C, \
-                                             __func__, ##args); \
-        } \
-    } while (0)
+#include "trace.h"
=20
 static const char *imx_i2c_get_regname(unsigned offset)
 {
@@ -152,8 +141,8 @@ static uint64_t imx_i2c_read(void *opaque, hwaddr offse=
t,
         break;
     }
=20
-    DPRINTF("read %s [0x%" HWADDR_PRIx "] -> 0x%02x\n",
-            imx_i2c_get_regname(offset), offset, value);
+    trace_imx_i2c_read(s->iomem.addr, imx_i2c_get_regname(offset), offset,
+                       value);
=20
     return (uint64_t)value;
 }
@@ -163,8 +152,8 @@ static void imx_i2c_write(void *opaque, hwaddr offset,
 {
     IMXI2CState *s =3D IMX_I2C(opaque);
=20
-    DPRINTF("write %s [0x%" HWADDR_PRIx "] <- 0x%02x\n",
-            imx_i2c_get_regname(offset), offset, (int)value);
+    trace_imx_i2c_read(s->iomem.addr, imx_i2c_get_regname(offset), offset,
+                       value);
=20
     value &=3D 0xff;
=20
diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events
index f708a7ace1..c6cba1ecf6 100644
--- a/hw/i2c/trace-events
+++ b/hw/i2c/trace-events
@@ -56,3 +56,8 @@ npcm7xx_smbus_recv_fifo(const char *id, uint8_t received,=
 uint8_t expected) "%s
=20
 pca954x_write_bytes(uint8_t value) "PCA954X write data: 0x%02x"
 pca954x_read_data(uint8_t value) "PCA954X read data: 0x%02x"
+
+# imx_i2c.c
+
+imx_i2c_read(uint64_t addr, const char *reg, uint64_t ofs, uint64_t value)=
 "0x%" PRIx64 ":[%s (0x%" PRIx64 ")] -> 0x%02" PRIx64
+imx_i2c_write(uint64_t addr, const char *reg, uint64_t ofs, uint64_t value=
) "0x%" PRIx64 ":[%s (0x%" PRIx64 ")] <- 0x%02" PRIx64
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328576; cv=none;
	d=zohomail.com; s=zohoarc;
	b=BzfQVgGZjfrK9SGin0gPABlfNlcjbibBct66SthoOyKy9bgzj2tA/vsOjPYcn7XSkhns2sO0d3v29XVTvbQlIMUkq8xxRJsifVLRELf0gjvxjP2d+Myht4BxhVcp9o7ran8rZRFMPMM4Zz3/zwJb+oXk0ZlInh++JmVpYGZpGTE=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328576;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=y5XIWWZbGtFfQ4MTLsvT7sCPSQ8s8Yj74r5V10Of4Ng=;
	b=MWdSqVtExG6RQ0TRKpARHGrgeKiLg1TRv0xba1mj+N8qKb34nayA3rtqR9VSFUMEh/OOw9t2ymFjmrKu85nPG3efjDecfRHOdUQ6TUKhoFm2d+6HhwWaYwAyK1VOSjrG/Gmzzk0SzO2xH5PKuLIi0WxFXoZyb7ot/+1ctjlC6Ro=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328576354286.84354643610845;
 Wed, 8 Jan 2025 01:29:36 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSKu-0004Ks-LQ; Wed, 08 Jan 2025 04:26:49 -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 <shentey@gmail.com>)
 id 1tVSKK-0003y6-75; Wed, 08 Jan 2025 04:26:14 -0500
Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKI-0004q7-Hb; Wed, 08 Jan 2025 04:26:11 -0500
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5d4e2aa7ea9so31100716a12.2;
 Wed, 08 Jan 2025 01:26:09 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.26.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:26:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328368; x=1736933168; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=y5XIWWZbGtFfQ4MTLsvT7sCPSQ8s8Yj74r5V10Of4Ng=;
 b=WrpVF1nwocm3q7Url/4je2qzu7K93pg8drKXvh9TTOO608LdLhbKyjB13iy1X44sRX
 ruThUaUcHnXuC2arIwmLGzDi5L/UqiEu3XXGyhed86I0VwHv2BYh23t0tmq+RNWC6olP
 /Q3M4Gh/v64VTSwGcUMCHj3tYdIfZneAnvf1B+ZBVWr0X3ZuNU+0EaPHFwDjGLtfxEEy
 94Tj8pzvlhC4C1xRdADQNCpwrosm4pWvRLXqvRmOR8qX63gap84juoQkti2H0Khxtf/Z
 TR5jzYa7oC/3DZqgd6VvO9tlQyzYvbYfWTGaxeNoJIyLTjJJuJvsyd+VutQEkON5U3cl
 dMtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328368; x=1736933168;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=y5XIWWZbGtFfQ4MTLsvT7sCPSQ8s8Yj74r5V10Of4Ng=;
 b=GYuNxu/013Q0ZjSF7WAFaL6GtwGfS3t1fEwmZzTR7VFO8NvXdHLZHyH4/kD0zWrcBv
 XEB1FkaC4iZgdsDV9xIY++EcZZz/Ca3BqrZIoI1FjSAz6zU3bVvSLnu4oNJTbPPsdHTQ
 uFcPaf6Us4srsVwpkgRlwSpwf5i6Jl+XE1WYthSOlqdHnfeanf7ba+cNQmaX7tPMrrKS
 KFW5Fakpu9PfeIMX2rlSlB4eFfgbFEK2RjwTJqnjp8xkTfM/M0Bibm86yyqvD19Qd9tn
 E6mv4Lsu/zdjgo86GibF9YrBF5SiFH5jZUBupXbah2YBvYPkWyU+sjw8TR9E1HQOpVJi
 2DmQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCU8d8jgTa31uc2IPaIVBcVhgjY2F4uh9Rsmhkxf2+jimP3FftjEhnjcD5dBG/lOaUlf3NAlrDN8ja06zg==@nongnu.org,
 AJvYcCUweHQJGs43wsqUru3SOKD3L8m1WtmfeKFN85eWRizczUtm/jb6EaCael1T8QHhk01Dj4IFIHqkrg==@nongnu.org
X-Gm-Message-State: AOJu0Yy634PZH+3HXd8goOrqKttVoW8YQ6Oa7z31pCzSqrI0DRMuj3s8
 9l/Kow6apo/kAFYXWla8+6XDB3Tj5UkA4Umi55nX6j+vaeDbT4N0t5ebF4VT
X-Gm-Gg: ASbGncsSMDY9mbxAK4+/kQ3rsHSyzSyGLRTM1/Lm1wJEgbobnjghkoxHCVvWz3gcluu
 GUyS/aPzLdK2s0mbJj4J8u7y822R8TldvSVPCScjkZFNnjC7aKn4rk5GUTON93vweK8aAbzDD94
 5Doee78bqU38usTQ5HVmgQ2FOwXcaeu3nAyBRo84xo5fiRNg2355zjcViXm/vDdbtdyHwCdbn0q
 yyIjAGn2wS5WSmMGe/Muudvuv3IfE0q4hVwj3AFF5ys/5oLywW3pKR7ga3u/WSrSEDzCl6qegZy
 zlztqZJ5V/MUUZghmjKmWadNBgVlq/Slu0301LMYj4TD9bY=
X-Google-Smtp-Source: 
 AGHT+IESIs4boSwLec1jkASIU/5xuPkKSIQRIUMB9EtuREGeKhWy9xY49lqjFfexevUm5noIheWOjw==
X-Received: by 2002:a05:6402:388a:b0:5d1:2631:b897 with SMTP id
 4fb4d7f45d1cf-5d972e08403mr1800015a12.14.1736328367863;
 Wed, 08 Jan 2025 01:26:07 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 13/14] hw/misc/imx6_src: Convert DPRINTF() to trace events
Date: Wed,  8 Jan 2025 10:25:37 +0100
Message-ID: <20250108092538.11474-14-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::52e;
 envelope-from=shentey@gmail.com; helo=mail-ed1-x52e.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328577167116600
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/misc/imx6_src.c   | 23 +++++------------------
 hw/misc/trace-events |  6 ++++++
 2 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c
index dc6a2b92ba..06cc46292e 100644
--- a/hw/misc/imx6_src.c
+++ b/hw/misc/imx6_src.c
@@ -17,18 +17,7 @@
 #include "qemu/module.h"
 #include "target/arm/arm-powerctl.h"
 #include "hw/core/cpu.h"
-
-#ifndef DEBUG_IMX6_SRC
-#define DEBUG_IMX6_SRC 0
-#endif
-
-#define DPRINTF(fmt, args...) \
-    do { \
-        if (DEBUG_IMX6_SRC) { \
-            fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX6_SRC, \
-                                             __func__, ##args); \
-        } \
-    } while (0)
+#include "trace.h"
=20
 static const char *imx6_src_reg_name(uint32_t reg)
 {
@@ -87,7 +76,7 @@ static void imx6_src_reset(DeviceState *dev)
 {
     IMX6SRCState *s =3D IMX6_SRC(dev);
=20
-    DPRINTF("\n");
+    trace_imx6_src_reset();
=20
     memset(s->regs, 0, sizeof(s->regs));
=20
@@ -111,7 +100,7 @@ static uint64_t imx6_src_read(void *opaque, hwaddr offs=
et, unsigned size)
=20
     }
=20
-    DPRINTF("reg[%s] =3D> 0x%" PRIx32 "\n", imx6_src_reg_name(index), valu=
e);
+    trace_imx6_src_read(imx6_src_reg_name(index), value);
=20
     return value;
 }
@@ -134,8 +123,7 @@ static void imx6_clear_reset_bit(CPUState *cpu, run_on_=
cpu_data data)
     assert(bql_locked());
=20
     s->regs[SRC_SCR] =3D deposit32(s->regs[SRC_SCR], ri->reset_bit, 1, 0);
-    DPRINTF("reg[%s] <=3D 0x%" PRIx32 "\n",
-            imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR]);
+    trace_imx6_clear_reset_bit(imx6_src_reg_name(SRC_SCR), s->regs[SRC_SCR=
]);
=20
     g_free(ri);
 }
@@ -173,8 +161,7 @@ static void imx6_src_write(void *opaque, hwaddr offset,=
 uint64_t value,
         return;
     }
=20
-    DPRINTF("reg[%s] <=3D 0x%" PRIx32 "\n", imx6_src_reg_name(index),
-            (uint32_t)current_value);
+    trace_imx6_src_write(imx6_src_reg_name(index), value);
=20
     change_mask =3D s->regs[index] ^ (uint32_t)current_value;
=20
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index 0f5d2b5666..cf1abe6928 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -253,6 +253,12 @@ ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock =
=3D %d) =3D %d"
 ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <=3D 0x%" PRIx=
32
 ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] =3D> 0x%" PRI=
x32
=20
+# imx6_src.c
+imx6_src_read(const char *reg_name, uint32_t value) "reg[%s] =3D> 0x%" PRI=
x32
+imx6_src_write(const char *reg_name, uint64_t value) "reg[%s] <=3D 0x%" PR=
Ix64
+imx6_clear_reset_bit(const char *reg_name, uint32_t value) "reg[%s] <=3D 0=
x%" PRIx32
+imx6_src_reset(void) ""
+
 # imx7_src.c
 imx7_src_read(const char *reg_name, uint32_t value) "reg[%s] =3D> 0x%" PRI=
x32
 imx7_src_write(const char *reg_name, uint32_t value) "reg[%s] <=3D 0x%" PR=
Ix32
--=20
2.47.1
From nobody Wed Apr  9 20:46:28 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=gmail.com
ARC-Seal: i=1; a=rsa-sha256; t=1736328613; cv=none;
	d=zohomail.com; s=zohoarc;
	b=X32kklc1kAETWjbLr9+8uZnFDYFtb6f2FEB7yxIIZ8b/m6LEuc0tm+iXWvlQ2eoYn1QjuSlnSQTCInWbqYz7YGmlAK70R5j0dUGLowWEUi99AbpaxviiIBtmOBoshxpOcUT9kHUMza9OrzQDpgjtLgKceDekkVdJvCG5pmkfAjw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1736328613;
 h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To;
	bh=BWONvS3zrMT7DHIR9fjnPk/2xHHvbX1PNKzkC10sjG4=;
	b=UUqE5DL5zPnf0y/T4v4lldzv2Jczq5XqjC3cHh9VcEILhrwYzBoMOPaCGY/G5aiEohZbeIt2dHpHQzwb/3GakIqzRgdgIdQV9LRQFFaD2XjOlajxEYxI6UUbRMT2mjR5uCg03Z8HpRZK4R6D1iLos88joweVIZeHShW2jjqCZhw=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<shentey@gmail.com> (p=none dis=none)
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1736328613325692.0109206822132;
 Wed, 8 Jan 2025 01:30:13 -0800 (PST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces@nongnu.org>)
	id 1tVSLX-00052c-8t; Wed, 08 Jan 2025 04:27: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 <shentey@gmail.com>)
 id 1tVSKL-0003yB-DN; Wed, 08 Jan 2025 04:26:14 -0500
Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <shentey@gmail.com>)
 id 1tVSKJ-0004qK-SV; Wed, 08 Jan 2025 04:26:13 -0500
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-aaeec07b705so1943716866b.2;
 Wed, 08 Jan 2025 01:26:10 -0800 (PST)
Received: from Provence.localdomain
 (dynamic-077-188-106-228.77.188.pool.telefonica.de. [77.188.106.228])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5d806feddfasm26116096a12.58.2025.01.08.01.26.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jan 2025 01:26:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1736328369; x=1736933169; darn=nongnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=BWONvS3zrMT7DHIR9fjnPk/2xHHvbX1PNKzkC10sjG4=;
 b=hAC2A1WWz1ZgGcldU8hLDqxqrxRF+AO/J08ZoDFleHhGpcotFqqyMiLGu8Y5dSqPsv
 boEkBIXz0f0mWYS8A3tk7iLMF+cyuzkSVqv9jwXixEEZ6BkUcaY19IvW30SkIQlLSXqk
 sDRX6aSo1cAm6rBF5Ywdgjjm+6dW+dRGTAbGQKwhKyY5bCfN59XZXXeM25BFIOB9+pVz
 tTkNfZ2UgUpTMJs0Zs/9k8QJ4hJSR0ZF/NFgHDhqLqQI+x2zdEbKu5N2jr1E1hSq16an
 LiIeDis4YVrGNplNbliWVgQH3JaFzzcajq20t8lXEL19BWsNud/EFjztoGEY7S5UVPJD
 DJIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736328369; x=1736933169;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=BWONvS3zrMT7DHIR9fjnPk/2xHHvbX1PNKzkC10sjG4=;
 b=SAg21YSZAG8PIxTPqyPsBZREM7z5/Jq9Cda3EuFbIKcxv93TNfxz8vW6fZ6cvqyynX
 3J2ParraRr5BH1XZoW+CNAvNQ90Dwj79JFeXbqKmpvvWCEUXvLwtuCNNPHZiENwyLMUg
 mXfF3rmLUouHxliaJacsQEZxUUVVa4/oYM6comjMI8py7wUYweF4NGcrvAArYOHCz6mI
 oabb/+8q9qTUjHuMYr3dSiXEq34AxVSQzAwn7pMr27GmXhCJPDrPOu15SZyPYId99arO
 M6CI/6IAoyS7lAzT59uRa24GfyKvPAYPm+xGbQ2EenCSkSZhl4qjHeESUvy3EeCaJIpV
 6aZA==
X-Forwarded-Encrypted: i=1;
 AJvYcCWkoCHWoA/ehS+TStLU8ksdlwKG8JsRV7RY3qPLX/2csGFcJfnODtWyzJ5H44lKvN7V109D5bSc7d3ZFQ==@nongnu.org,
 AJvYcCXunRkFzMnEfLUzvBau0ggULpAVecLNLbYDLT9EVf9GQ6dGcT/reOUIDZl1tEGNIBg+S+ntCNGmmQ==@nongnu.org
X-Gm-Message-State: AOJu0YwRcI9Pax5PrkcbMUUm5ALUNjQArCue7TZVBxUTuoXTinXOj2B3
 WP4vKLLD3m6eqEHFzaiG29D5ytAeoikTb/S2rEKmC4+Ju+dE26BQyizbQ+vt
X-Gm-Gg: ASbGncubilwiabOiEpiygyQhMLmBl0BpS2O1Czn3gXcbf3z9y8qqsEzjPrIc+pFwaQ8
 BNsB8ru9JVhndE9doneTjXC01rDm4ANIBN2yvjhHUmLfo5QA60nSsEHFrqeYebsfJAxdtkpzrqG
 cSSS6qf309fGzT4UJotARLCp6Sh/5vXbwCdKyxhPNtOw9UEfBDhpCaeoYrUezp+r1zrRIFb6E6+
 egd887kZ+kSXSKzO7e3U2660Cj5i3LKnisQ0aFCF/e9ZD1wBuhOQQ7X0ryWOFm5smjxAbb5lCIW
 AbTmn6FFkQJWX8guMBwisIE41SNk6lyDydD/IgERv8z1hQc=
X-Google-Smtp-Source: 
 AGHT+IH9lqeLlDGFhP94E+1BYC9pSCPPb/pa+WFbrAoa0miigwPvyDPcSV/Ws4jJJwZsOeJojbu8dA==
X-Received: by 2002:a17:907:3e9f:b0:aae:bd4c:22c0 with SMTP id
 a640c23a62f3a-ab2ab70aeccmr157228366b.19.1736328369051;
 Wed, 08 Jan 2025 01:26:09 -0800 (PST)
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bmeng.cn@gmail.com>, Fabiano Rosas <farosas@suse.de>,
 Guenter Roeck <linux@roeck-us.net>,
 Andrey Smirnov <andrew.smirnov@gmail.com>,
 Jean-Christophe Dubois <jcd@tribudubois.net>,
 Peter Maydell <peter.maydell@linaro.org>, qemu-block@nongnu.org,
 Laurent Vivier <lvivier@redhat.com>, qemu-arm@nongnu.org,
 =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>,
 Paolo Bonzini <pbonzini@redhat.com>,
 =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@linaro.org>,
 Bernhard Beschow <shentey@gmail.com>
Subject: [PATCH 14/14] hw/gpio/imx_gpio: Turn DPRINTF() into trace events
Date: Wed,  8 Jan 2025 10:25:38 +0100
Message-ID: <20250108092538.11474-15-shentey@gmail.com>
X-Mailer: git-send-email 2.47.1
In-Reply-To: <20250108092538.11474-1-shentey@gmail.com>
References: <20250108092538.11474-1-shentey@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::629;
 envelope-from=shentey@gmail.com; helo=mail-ej1-x629.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: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org
X-ZohoMail-DKIM: pass (identity @gmail.com)
X-ZM-MESSAGEID: 1736328615381116600
Content-Type: text/plain; charset="utf-8"

While at it add a trace event for input GPIO events.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daud=C3=A9 <philmd@linaro.org>
---
 hw/gpio/imx_gpio.c   | 16 +++++-----------
 hw/gpio/trace-events |  5 +++++
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c
index 67c47a7280..f77132fe04 100644
--- a/hw/gpio/imx_gpio.c
+++ b/hw/gpio/imx_gpio.c
@@ -24,6 +24,7 @@
 #include "migration/vmstate.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
+#include "trace.h"
=20
 #ifndef DEBUG_IMX_GPIO
 #define DEBUG_IMX_GPIO 0
@@ -34,14 +35,6 @@ typedef enum IMXGPIOLevel {
     IMX_GPIO_LEVEL_HIGH =3D 1,
 } IMXGPIOLevel;
=20
-#define DPRINTF(fmt, args...) \
-    do { \
-        if (DEBUG_IMX_GPIO) { \
-            fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_GPIO, \
-                                             __func__, ##args); \
-        } \
-    } while (0)
-
 static const char *imx_gpio_reg_name(uint32_t reg)
 {
     switch (reg) {
@@ -111,6 +104,8 @@ static void imx_gpio_set(void *opaque, int line, int le=
vel)
     IMXGPIOState *s =3D IMX_GPIO(opaque);
     IMXGPIOLevel imx_level =3D level ? IMX_GPIO_LEVEL_HIGH : IMX_GPIO_LEVE=
L_LOW;
=20
+    trace_imx_gpio_set(s->iomem.addr, line, imx_level);
+
     imx_gpio_set_int_line(s, line, imx_level);
=20
     /* this is an input signal, so set PSR */
@@ -200,7 +195,7 @@ static uint64_t imx_gpio_read(void *opaque, hwaddr offs=
et, unsigned size)
         break;
     }
=20
-    DPRINTF("(%s) =3D 0x%" PRIx32 "\n", imx_gpio_reg_name(offset), reg_val=
ue);
+    trace_imx_gpio_read(s->iomem.addr, imx_gpio_reg_name(offset), reg_valu=
e);
=20
     return reg_value;
 }
@@ -210,8 +205,7 @@ static void imx_gpio_write(void *opaque, hwaddr offset,=
 uint64_t value,
 {
     IMXGPIOState *s =3D IMX_GPIO(opaque);
=20
-    DPRINTF("(%s, value =3D 0x%" PRIx32 ")\n", imx_gpio_reg_name(offset),
-            (uint32_t)value);
+    trace_imx_gpio_write(s->iomem.addr, imx_gpio_reg_name(offset), value);
=20
     switch (offset) {
     case DR_ADDR:
diff --git a/hw/gpio/trace-events b/hw/gpio/trace-events
index b91cc7e9a4..9ddacc12e3 100644
--- a/hw/gpio/trace-events
+++ b/hw/gpio/trace-events
@@ -1,5 +1,10 @@
 # See docs/devel/tracing.rst for syntax documentation.
=20
+# imx_gpio.c
+imx_gpio_read(uint64_t base, const char *reg, uint32_t value) "0x%" PRIx64=
 ":[%s] -> 0x%" PRIx32
+imx_gpio_write(uint64_t base, const char *reg, uint32_t value) "0x%" PRIx6=
4 ":[%s] <- 0x%" PRIx32
+imx_gpio_set(uint64_t base, int line, int level) "0x%" PRIx64 ":[%d] <- %d"
+
 # npcm7xx_gpio.c
 npcm7xx_gpio_read(const char *id, uint64_t offset, uint64_t value) " %s of=
fset: 0x%04" PRIx64 " value 0x%08" PRIx64
 npcm7xx_gpio_write(const char *id, uint64_t offset, uint64_t value) "%s of=
fset: 0x%04" PRIx64 " value 0x%08" PRIx64
--=20
2.47.1