From nobody Tue Feb 10 05:02:46 2026 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=quarantine dis=none) header.from=fel.cvut.cz ARC-Seal: i=1; a=rsa-sha256; t=1733787484; cv=none; d=zohomail.com; s=zohoarc; b=cPs3kvo3gwT/4t4kseka/i/7V/my7zn3+j3MxJM9xMZ2dlp8TELi9dlx5kDojrTM9DoX/oVBaxY5yLan3Q2BQHaRwAB/DM6bno6CbIn694aT7/keLZ8IWNyIQ2E+JZckadv/HmjuctMFi6UmeyfXm5AEt8tJYQYymuqMGunUCdw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733787484; 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=yLW8IpbgYzCaxyrZWdDzDzRJttkMgWDc27IfUecH8bw=; b=JdGGY96u2SfGrhXpcjWmWBGI2B3FBxCZogYWNrtwH/k0S/pQv62pY40MouZC4nlgHlh/W5F5+xtW9T31PeadDH+g+KJqUhbIKlQS0/TSdzjt2oQNoVFB4Ic0tyzfj4gha8dcrOOofBOApiErV5OMSG1YboVq/u79EiGOlrblTyQ= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1733787484489771.4997208932359; Mon, 9 Dec 2024 15:38:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKnJa-00074n-0S; Mon, 09 Dec 2024 18:37:22 -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 1tKnJV-00074B-Ut for qemu-devel@nongnu.org; Mon, 09 Dec 2024 18:37:17 -0500 Received: from smtpx.feld.cvut.cz ([147.32.210.153] helo=smtpx.fel.cvut.cz) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1tKnJU-0007E3-Gp for qemu-devel@nongnu.org; Mon, 09 Dec 2024 18:37:17 -0500 Received: from localhost (unknown [192.168.200.27]) by smtpx.fel.cvut.cz (Postfix) with ESMTP id 6E8D640E31; Tue, 10 Dec 2024 00:37:15 +0100 (CET) Received: from smtpx.fel.cvut.cz ([192.168.200.2]) by localhost (cerokez-250.feld.cvut.cz [192.168.200.27]) (amavis, port 10060) with ESMTP id lxDOULqeGGsw; Tue, 10 Dec 2024 00:37:12 +0100 (CET) Received: from fel.cvut.cz (static-84-242-78-234.bb.vodafone.cz [84.242.78.234]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pisa) by smtpx.fel.cvut.cz (Postfix) with ESMTPSA id 96AF94097E; Tue, 10 Dec 2024 00:33:24 +0100 (CET) X-Virus-Scanned: IMAP STYX AMAVIS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fel.cvut.cz; s=felmail; t=1733787205; bh=yLW8IpbgYzCaxyrZWdDzDzRJttkMgWDc27IfUecH8bw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T+w2IqBv1bOYs3wcAbnni+43TICkPZ3hemAgA2rnKBGDhSdye9o+hsVqTT9XwUOwf tu9Gq6ks4/5Po5NwdU46Cuno5GD0LfnU0BKUoIlzv5VSCRjwi4M3lm6RhEvEjBI2uh Dz3HMVybjAvshLn1RQlBJ7Guq/Nua2NFo9lM1xxYDwqRgvanwsBlDuUT0TtHqZjPh4 XEM3LG/XW/SeHPek5la0GhCysqLe1XNWn8XhPO0WP5pZIpaT2j5iYKVo3wd0YmgVfx opw0IDj6KciGiGvJviubcZi9Jbzga+rsqrpf9nPyv8iJxmpQZZjnpxODOCfEbqLyWA DxFztgcZT0v+g== From: Pavel Pisa To: qemu-devel@nongnu.org, Peter Maydell , Gustavo Romero Cc: Paolo Bonzini , Jason Wang , Francisco Iglesias , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pavel Pisa Subject: [RFC 3/3] hw/net/can: WIP CTU CAN FD add parameter to specify IRQ controller on command line Date: Tue, 10 Dec 2024 00:32:53 +0100 Message-Id: <2756d5a4999239f5ba9bd07237ab88230e7b7855.1733783500.git.pisa@cmp.felk.cvut.cz> X-Mailer: git-send-email 2.39.5 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=147.32.210.153; envelope-from=pisa@fel.cvut.cz; helo=smtpx.fel.cvut.cz X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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-ZohoMail-DKIM: pass (identity @fel.cvut.cz) X-ZM-MESSAGEID: 1733787488496116600 Content-Type: text/plain; charset="utf-8" From: Pavel Pisa Signed-off-by: Pavel Pisa --- hw/net/can/ctucan_mm.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/hw/net/can/ctucan_mm.c b/hw/net/can/ctucan_mm.c index 6d6b8aecb8..e599df18be 100644 --- a/hw/net/can/ctucan_mm.c +++ b/hw/net/can/ctucan_mm.c @@ -59,7 +59,8 @@ struct CtuCanMmState { =20 struct { uint64_t iobase; - uint32_t irq; + uint32_t irqnum; + char *irqctrl; } cfg; =20 MemoryRegion ctucan_io_region; @@ -144,9 +145,16 @@ static void ctucan_mm_realize(DeviceState *dev, Error = **errp) if (d->cfg.iobase !=3D 0) { sysbus_mmio_map(sbd, 0, d->cfg.iobase); } - if (d->cfg.irq !=3D 0) { + if (d->cfg.irqnum !=3D 0) { //const char *id =3D "/machine/unattached/device[3]/gic"; - const char *id =3D "/machine/unattached/device[3]"; + //const char *id =3D "/machine/unattached/device[3]"; + char *id =3D d->cfg.irqctrl; + + if (!id) { + error_setg(errp, "irqctrl object path is mandatory when irqnum= is specified"); + return; + } + Object *obj =3D object_resolve_path_at(container_get(qdev_get_mach= ine(), "/peripheral"), id); DeviceState *gicdev; if (!obj) { @@ -158,7 +166,7 @@ static void ctucan_mm_realize(DeviceState *dev, Error *= *errp) error_setg(errp, "%s is not a hotpluggable device", id); return; } - sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(gicdev, d->cfg.irq)); + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(gicdev, d->cfg.irqnum)= ); } for (i =3D 0 ; i < CTUCAN_MM_CORE_COUNT; i++) { ctucan_init(&d->ctucan_state[i], d->irq); @@ -243,7 +251,8 @@ static Property ctucan_mm_properties[] =3D { //DEFINE_PROP_UNSIGNED_NODEFAULT("base", CtuCanMmState, cfg.base, // qdev_prop_uint64, uint64_t), DEFINE_PROP_UINT64("iobase", CtuCanMmState, cfg.iobase, 0), - DEFINE_PROP_UINT32("irq", CtuCanMmState, cfg.irq, 0), + DEFINE_PROP_UINT32("irqnum", CtuCanMmState, cfg.irqnum, 0), + DEFINE_PROP_STRING("irqctrl", CtuCanMmState, cfg.irqctrl), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.39.5