From nobody Tue May 14 07:05:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671561016127753.6774669642695; Tue, 20 Dec 2022 10:30:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7gPG-0001Mh-Ua; Tue, 20 Dec 2022 12:27:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7gPA-0001LB-B3; Tue, 20 Dec 2022 12:27:52 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7gP6-000575-6H; Tue, 20 Dec 2022 12:27:52 -0500 Received: (Authenticated sender: jcd@tribudubois.net) by mail.gandi.net (Postfix) with ESMTPSA id 6B0CFC0008; Tue, 20 Dec 2022 17:27:35 +0000 (UTC) From: Jean-Christophe Dubois To: qemu-devel@nongnu.org Cc: Jean-Christophe Dubois , qemu-arm@nongnu.org Subject: [PATCH] i.MX7D: Connect GPT timers to IRQ Date: Tue, 20 Dec 2022 18:27:30 +0100 Message-Id: <63a81cac41c769989e23caebb476dc078e83731d.1671548388.git.jcd@tribudubois.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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=217.70.183.198; envelope-from=jcd@tribudubois.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1671561018232100003 Content-Type: text/plain; charset="utf-8" So far the GPT timers were unable to raise IRQs to the processor. Signed-off-by: Jean-Christophe Dubois --- hw/arm/fsl-imx7.c | 10 ++++++++++ include/hw/arm/fsl-imx7.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index cc6fdb9373..146bb559bb 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -219,9 +219,19 @@ static void fsl_imx7_realize(DeviceState *dev, Error *= *errp) FSL_IMX7_GPT4_ADDR, }; =20 + static const int FSL_IMX7_GPTn_IRQ[FSL_IMX7_NUM_GPTS] =3D { + FSL_IMX7_GPT1_IRQ, + FSL_IMX7_GPT2_IRQ, + FSL_IMX7_GPT3_IRQ, + FSL_IMX7_GPT4_IRQ, + }; + s->gpt[i].ccm =3D IMX_CCM(&s->ccm); sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), &error_abort); sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt[i]), 0, FSL_IMX7_GPTn_ADDR[= i]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpt[i]), 0, + qdev_get_gpio_in(DEVICE(&s->a7mpcore), + FSL_IMX7_GPTn_IRQ[i])); } =20 for (i =3D 0; i < FSL_IMX7_NUM_GPIOS; i++) { diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 1c5fa6fd67..50f19d8db0 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -235,6 +235,11 @@ enum FslIMX7IRQs { FSL_IMX7_USB2_IRQ =3D 42, FSL_IMX7_USB3_IRQ =3D 40, =20 + FSL_IMX7_GPT1_IRQ =3D 55, + FSL_IMX7_GPT2_IRQ =3D 54, + FSL_IMX7_GPT3_IRQ =3D 53, + FSL_IMX7_GPT4_IRQ =3D 52, + FSL_IMX7_WDOG1_IRQ =3D 78, FSL_IMX7_WDOG2_IRQ =3D 79, FSL_IMX7_WDOG3_IRQ =3D 10, --=20 2.34.1