From nobody Fri Apr 4 21:32:31 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=csclub.uwaterloo.ca ARC-Seal: i=1; a=rsa-sha256; t=1739685551; cv=none; d=zohomail.com; s=zohoarc; b=SZhf5zWU6a78eTN5iP5lWKGSZPAHrglXHOFAl70r75QpItgbUp6Gc8Rp5WTRiecxyfmkDozAzKwzwgRZgugwNY3v4eFyL23H0yR53Sx7//Owtsq7vTn6QQ8+mNJRk8v5+KAP4Z0kXXsxvn51TKL30wUHsRPCRqQfmJlLs5+/+iQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739685551; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JmtHLnlzelDiMG/aaAhaae/vF1+y41ZDzU76AdNWZlM=; b=gfIqUBuiCGDP6MXHOyw0X8OCZOrDOTIv15BXgXVDC4FbTVrVnaYIny30HWRNwXmXX/JsOjJy2HgtVtIR9xiStdwW0nOSxfIUe209ZZdzFCQQVQFCqYR2oiDsqk2iY/bTga2prwsxw36nQ/8IGE4RLpCfs5Hr4dIbrJ6qQsNdeHQ= 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= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739685551454827.4122683080824; Sat, 15 Feb 2025 21:59:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tjXfm-00087H-5P; Sun, 16 Feb 2025 00:58:34 -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 1tjVk1-0003o8-An; Sat, 15 Feb 2025 22:54:49 -0500 Received: from mail.csclub.uwaterloo.ca ([129.97.134.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tjVjz-000340-3j; Sat, 15 Feb 2025 22:54:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csclub.uwaterloo.ca; s=csc; t=1739678083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmtHLnlzelDiMG/aaAhaae/vF1+y41ZDzU76AdNWZlM=; b=tqJopBqybRmYP3sSVvS/W4ny0Z/5LJpT9w8GxjOit1iN4v93RaVnoAJvr2iiONPhn0A+w0 +pzbfC6HoxwICHlQF5JSlxs7OaIJFOfIKqvM6qregBnqFjtOCJ7EtIn4cYXDjn6byOUJBS IdZ3zKmedoKaMYsdo4O4T+kk/omwBjI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=csclub.uwaterloo.ca; s=202502e; t=1739678083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JmtHLnlzelDiMG/aaAhaae/vF1+y41ZDzU76AdNWZlM=; b=XGNIuT/chy/ms9JubnMhf+jaY3Sy8Maib76ovN+NH9p17ebODeaaH7lgGFpZi6utvLtoaw 6c0VcoI35tT7aHBQ== Message-ID: <3cca4eb3-09d1-4467-81fd-27a5bfe19a3e@csclub.uwaterloo.ca> Date: Sat, 15 Feb 2025 22:54:42 -0500 MIME-Version: 1.0 Content-Language: en-US To: qemu-devel@nongnu.org From: Sourojeet Adhikari Cc: peter.maydell@linaro.org, philmd@linaro.org, qemu-arm@nongnu.org Subject: [PATCH] bcm2838: Add GIC-400 timer interupt connections Content-Type: text/plain; charset="utf-8"; format="flowed" 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=129.97.134.52; envelope-from=s23adhik@csclub.uwaterloo.ca; helo=mail.csclub.uwaterloo.ca X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 16 Feb 2025 00:58:33 -0500 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-ZohoMail-DKIM: pass (identity @csclub.uwaterloo.ca) X-ZM-MESSAGEID: 1739685552956019000 Hello everyone, This patch adds support for the system timer interrupts in QEMU's BCM2838 model. It defines a new constant called GIC400_TIMER_INT, and connects 4 timer interupts to the GIC-400. Previously timer interupts were not being routed to the interupt controller, causing scheduling, and some other stuff to have issues (me and a few friends bumped into this, and that's why this was written lol). Signed-off-by: Sourojeet Adhikari --- =C2=A0hw/arm/bcm2838.c | 11 +++++++++++ =C2=A01 file changed, 11 insertions(+) diff --git a/hw/arm/bcm2838.c b/hw/arm/bcm2838.c index ddb7c5f..0a4179f 100644 --- a/hw/arm/bcm2838.c +++ b/hw/arm/bcm2838.c @@ -21,6 +21,8 @@ =C2=A0#define GIC400_TIMER_S_EL1_IRQ=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 13 =C2=A0#define GIC400_TIMER_NS_EL1_IRQ=C2=A0=C2=A0=C2=A0=C2=A0 14 =C2=A0#define GIC400_LEGACY_IRQ=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 15 +#define GIC400_TIMER_INT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (96 - 32) + =C2=A0/* Number of external interrupt lines to configure the GIC with */ =C2=A0#define GIC_NUM_IRQS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 192 @@ -176,6 +178,15 @@ static void bcm2838_realize(DeviceState *dev, Error=20 **errp) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qdev_get_gpio_in(gicdev, P= PI(n, VIRTUAL_PMU_IRQ))); =C2=A0=C2=A0=C2=A0=C2=A0 } +=C2=A0=C2=A0=C2=A0 sysbus_connect_irq(SYS_BUS_DEVICE(&ps_base->systmr), 0, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qdev_get_gpio_in(DEVICE(&s->gic= ), GIC400_TIMER_INT +=20 INTERRUPT_TIMER0)); +=C2=A0=C2=A0=C2=A0 sysbus_connect_irq(SYS_BUS_DEVICE(&ps_base->systmr), 1, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qdev_get_gpio_in(DEVICE(&s->gic= ), GIC400_TIMER_INT +=20 INTERRUPT_TIMER1)); +=C2=A0=C2=A0=C2=A0 sysbus_connect_irq(SYS_BUS_DEVICE(&ps_base->systmr), 2, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qdev_get_gpio_in(DEVICE(&s->gic= ), GIC400_TIMER_INT +=20 INTERRUPT_TIMER2)); +=C2=A0=C2=A0=C2=A0 sysbus_connect_irq(SYS_BUS_DEVICE(&ps_base->systmr), 3, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qdev_get_gpio_in(DEVICE(&s->gic= ), GIC400_TIMER_INT +=20 INTERRUPT_TIMER3)); + =C2=A0=C2=A0=C2=A0=C2=A0 /* Connect UART0 to the interrupt controller */ =C2=A0=C2=A0=C2=A0=C2=A0 sysbus_connect_irq(SYS_BUS_DEVICE(&ps_base->uart0= ), 0, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 qdev_get= _gpio_in(gicdev, GIC_SPI_INTERRUPT_UART0)); --=20 2.48.1