From patchwork Thu Mar 24 18:15:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zongyuan Li X-Patchwork-Id: 12790965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8E5CC433FE for ; Thu, 24 Mar 2022 18:20:01 +0000 (UTC) Received: from localhost ([::1]:58978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXS40-00088R-RV for qemu-devel@archiver.kernel.org; Thu, 24 Mar 2022 14:20:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXS0M-0005ql-2N for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:14 -0400 Received: from [2607:f8b0:4864:20::431] (port=34455 helo=mail-pf1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXS0K-00033E-KL for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:13 -0400 Received: by mail-pf1-x431.google.com with SMTP id h19so3602945pfv.1 for ; Thu, 24 Mar 2022 11:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5SrYGGx56D5KZCgDRAE+ARenQHiw5A2xBeYHRC7blJI=; b=rDHG9AqpGCyEQHWiSxi8VCe4kJs2bIUZHzrzyG/78OW+dLVWl7qmiBYd5d2/Cz7xwP 57KwaiNe7DdQDwMOG4GWWnZeG4QE+bsAsaSRMKqpiAD4+3e4MH+FMkNbvAZgTP/QU2oE SvoXiNPFK81biDCvluJvePFLmKa+kjfo5yTm0nI5I3BdR5XDCtMQSjYoEvtad3fem9EC 8yxpX5myPgo1EyE6AInA1jw4xxBhvK4m1lujj+WEy837dNszGND1rhNhpjBVt0kjANea 7LCNTA5dfntHwXgEkISSyCRDGDV0ZhXHLayp+Tr22GDfZaAdIL3Lyaa4dKAq4mLzshxL tf0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5SrYGGx56D5KZCgDRAE+ARenQHiw5A2xBeYHRC7blJI=; b=nUaj1Kn8ta7olWLO8/URF6zSqIaLJAGR2KHn/trBUjaBgcRL1YPyayyrkFuY9zh5Di 4tyrYD/ExvjhhsoPeLtFAZisKhSVy8fnvQhfi5D27uxMCo2wgrfho+d8nXfNII3ZxrWk 9FLzEx235DgdgelaTOxy5cTtzHLEj66q8KroHYaitMDxjsJydJdxI1SNpBXDWqzx0Njp EqQPDZ0jNsWlly2EQDAqkLIFofErjDqsnsEH3BV2Yd/CvNIzTIIk02/6okLCj6JPntIa YBzaOH+1zmWHL7Q/WaJyylAIw0oa5LlcmyNkA4Fk+qhOsGJxON4hAX5UnihhcfuXVhcD 5a1A== X-Gm-Message-State: AOAM530ZgYEw6Lh7L5e3W/J7IBtLjmdU4i7U7S5OmxGNnI9x+yT6P8y4 zuwQ/ImP2eaVHCpmNOaiUgsx0tBeIQUaag== X-Google-Smtp-Source: ABdhPJwpSz3xLGe3oOZ0PZsFrh+ZXI+QqWL0xL8vit6tT7rD0dKLyHEruJHVF9VB2HbN6lSeoaUJmQ== X-Received: by 2002:a65:424a:0:b0:375:6d8b:8d44 with SMTP id d10-20020a65424a000000b003756d8b8d44mr5055867pgq.170.1648145770176; Thu, 24 Mar 2022 11:16:10 -0700 (PDT) Received: from dev.lizongyuan.local ([103.177.44.101]) by smtp.gmail.com with ESMTPSA id u10-20020a17090a2b8a00b001c6594e5ddcsm3577725pjd.15.2022.03.24.11.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 11:16:09 -0700 (PDT) From: Zongyuan Li To: qemu-devel@nongnu.org Subject: [PATCH v5 1/4] hw/arm/realview: replace 'qemu_split_irq' with 'TYPE_SPLIT_IRQ' Date: Fri, 25 Mar 2022 02:15:54 +0800 Message-Id: <20220324181557.203805-2-zongyuan.li@smartx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220324181557.203805-1-zongyuan.li@smartx.com> References: <20220324181557.203805-1-zongyuan.li@smartx.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::431 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::431; envelope-from=zongyuan.li@smartx.com; helo=mail-pf1-x431.google.com X-Spam_score_int: 29 X-Spam_score: 2.9 X-Spam_bar: ++ X-Spam_report: (2.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Peter Maydell , "open list:Real View" , Zongyuan Li Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Zongyuan Li Reviewed-by: Peter Maydell --- hw/arm/realview.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 7b424e94a5..d2dc8a8952 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -13,9 +13,11 @@ #include "hw/sysbus.h" #include "hw/arm/boot.h" #include "hw/arm/primecell.h" +#include "hw/core/split-irq.h" #include "hw/net/lan9118.h" #include "hw/net/smc91c111.h" #include "hw/pci/pci.h" +#include "hw/qdev-core.h" #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h" @@ -53,6 +55,20 @@ static const int realview_board_id[] = { 0x76d }; +static void split_irq_from_named(DeviceState *src, const char* outname, + qemu_irq out1, qemu_irq out2) { + DeviceState *splitter = qdev_new(TYPE_SPLIT_IRQ); + + qdev_prop_set_uint32(splitter, "num-lines", 2); + + qdev_realize_and_unref(splitter, NULL, &error_fatal); + + qdev_connect_gpio_out(splitter, 0, out1); + qdev_connect_gpio_out(splitter, 1, out2); + qdev_connect_gpio_out_named(src, outname, 0, + qdev_get_gpio_in(splitter, 0)); +} + static void realview_init(MachineState *machine, enum realview_board_type board_type) { @@ -66,7 +82,6 @@ static void realview_init(MachineState *machine, DeviceState *dev, *sysctl, *gpio2, *pl041; SysBusDevice *busdev; qemu_irq pic[64]; - qemu_irq mmc_irq[2]; PCIBus *pci_bus = NULL; NICInfo *nd; DriveInfo *dinfo; @@ -229,14 +244,14 @@ static void realview_init(MachineState *machine, * and the PL061 has them the other way about. Also the card * detect line is inverted. */ - mmc_irq[0] = qemu_irq_split( - qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_WPROT), - qdev_get_gpio_in(gpio2, 1)); - mmc_irq[1] = qemu_irq_split( - qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN), - qemu_irq_invert(qdev_get_gpio_in(gpio2, 0))); - qdev_connect_gpio_out_named(dev, "card-read-only", 0, mmc_irq[0]); - qdev_connect_gpio_out_named(dev, "card-inserted", 0, mmc_irq[1]); + split_irq_from_named(dev, "card-read-only", + qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_WPROT), + qdev_get_gpio_in(gpio2, 1)); + + split_irq_from_named(dev, "card-inserted", + qdev_get_gpio_in(sysctl, ARM_SYSCTL_GPIO_MMC_CARDIN), + qemu_irq_invert(qdev_get_gpio_in(gpio2, 0))); + dinfo = drive_get(IF_SD, 0, 0); if (dinfo) { DeviceState *card; From patchwork Thu Mar 24 18:15:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zongyuan Li X-Patchwork-Id: 12790969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BAFB4C433EF for ; Thu, 24 Mar 2022 18:29:56 +0000 (UTC) Received: from localhost ([::1]:42378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXSDb-0007t0-2s for qemu-devel@archiver.kernel.org; Thu, 24 Mar 2022 14:29:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXS0P-0005rH-GG for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:20 -0400 Received: from [2607:f8b0:4864:20::62f] (port=34779 helo=mail-pl1-x62f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXS0O-00034u-45 for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:17 -0400 Received: by mail-pl1-x62f.google.com with SMTP id i11so5622477plr.1 for ; Thu, 24 Mar 2022 11:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dh5aVmO3EARkPNjd2r1sV1+I0MHmPFomuINkwCaVeDs=; b=LP9p4lD/45bdCY0knp7T1DdLwKKTIDOVTGIsjLBybHdN9cAn2V5JzSJlwBoF7AiILc yuUpoYDXQ89tmlVjvtSurxqldbMZL3pMvRHf7IkTg8FoyMRJ5U3PpvR1jU5ituJTj4WJ bF1+fdlvOvAIzgN+4Fhz5BuhUI46QY0sa1mpiQS9tv4fiRrlZbXYrZ3NgSBeWDCC+p/K 1wr9ajXpPN45fOwoCBXjoAMHSpQXs18b36mmtXuOY56Eo4V5r6NfY5lOuQUJCdRrkYFI x47juzemxNV5c+S2VRVj5LJRllRoFM/Z2XD3wlO8g9PME0rZmn837jHSZwjB6grmx5xM kplQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dh5aVmO3EARkPNjd2r1sV1+I0MHmPFomuINkwCaVeDs=; b=jJlcoVfchIWGUide5uYOnheBlq1iGHh95A6gkcf/5UNhQiau7arpzaQClk/qm7lMB7 UB1t+IXfuvxtALPneu0UNaJE3Xv8trjAjb5W1xwMlqZ00JmDuOddMUjzsKKzEZmCDmDp YeY/3L65d5weblr3LDf/G/P7xy6MFht5304gMczWpW33YbIUMCPj23wktzHWbMZkFpUt pN6zdlqQs6/sGTzplAuwEgQWgx3krYWCqypjFJm5xW/dgy0zgwQXIB2l1LHuzbI6htMI d9k8kTZveVZqS3mAzZ+eEaKDD1xUOmaNQryOYJl8pPc8qyclW00oDL8Or+ZurE7D13j4 771Q== X-Gm-Message-State: AOAM531rjl4yUID1k/pKEU+q4qKA2tDt69QrQ2+Wqv6YZnVLpxoak+nK P2tGEaO+WwGn9O0oC+E+oH/hi4oN1I3Q8A== X-Google-Smtp-Source: ABdhPJweC4Ku17/8nL3nw5f7ekkVVaL2g4dxczaZE4+tSEdjza+zU5tnDna1MAUM+pgzw4bMhLJpww== X-Received: by 2002:a17:902:e5cc:b0:154:57cf:e393 with SMTP id u12-20020a170902e5cc00b0015457cfe393mr7364086plf.24.1648145774085; Thu, 24 Mar 2022 11:16:14 -0700 (PDT) Received: from dev.lizongyuan.local ([103.177.44.101]) by smtp.gmail.com with ESMTPSA id u10-20020a17090a2b8a00b001c6594e5ddcsm3577725pjd.15.2022.03.24.11.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 11:16:13 -0700 (PDT) From: Zongyuan Li To: qemu-devel@nongnu.org Subject: [PATCH v5 2/4] hw/arm/stellaris: replace 'qemu_split_irq' with 'TYPE_SPLIT_IRQ' Date: Fri, 25 Mar 2022 02:15:55 +0800 Message-Id: <20220324181557.203805-3-zongyuan.li@smartx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220324181557.203805-1-zongyuan.li@smartx.com> References: <20220324181557.203805-1-zongyuan.li@smartx.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62f (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::62f; envelope-from=zongyuan.li@smartx.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: 29 X-Spam_score: 2.9 X-Spam_bar: ++ X-Spam_report: (2.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Peter Maydell , "open list:Stellaris" , Zongyuan Li Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Zongyuan Li Reviewed-by: Peter Maydell --- hw/arm/stellaris.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index b6c8a5d609..12c673c917 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "hw/core/split-irq.h" #include "hw/sysbus.h" #include "hw/sd/sd.h" #include "hw/ssi/ssi.h" @@ -1160,6 +1161,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) DeviceState *ssddev; DriveInfo *dinfo; DeviceState *carddev; + DeviceState *gpio_d_splitter; BlockBackend *blk; /* @@ -1237,9 +1239,18 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) &error_fatal); ssddev = ssi_create_peripheral(bus, "ssd0323"); - gpio_out[GPIO_D][0] = qemu_irq_split( - qdev_get_gpio_in_named(sddev, SSI_GPIO_CS, 0), + + gpio_d_splitter = qdev_new(TYPE_SPLIT_IRQ); + qdev_prop_set_uint32(gpio_d_splitter, "num-lines", 2); + qdev_realize_and_unref(gpio_d_splitter, NULL, &error_fatal); + qdev_connect_gpio_out( + gpio_d_splitter, 0, + qdev_get_gpio_in_named(sddev, SSI_GPIO_CS, 0)); + qdev_connect_gpio_out( + gpio_d_splitter, 1, qdev_get_gpio_in_named(ssddev, SSI_GPIO_CS, 0)); + gpio_out[GPIO_D][0] = qdev_get_gpio_in(gpio_d_splitter, 0); + gpio_out[GPIO_C][7] = qdev_get_gpio_in(ssddev, 0); /* Make sure the select pin is high. */ From patchwork Thu Mar 24 18:15:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zongyuan Li X-Patchwork-Id: 12790968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1AFEC433F5 for ; Thu, 24 Mar 2022 18:28:51 +0000 (UTC) Received: from localhost ([::1]:40612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXSCY-0006fF-LN for qemu-devel@archiver.kernel.org; Thu, 24 Mar 2022 14:28:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXS0V-0005tW-O2 for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:23 -0400 Received: from [2607:f8b0:4864:20::635] (port=34785 helo=mail-pl1-x635.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXS0T-00035h-Bk for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:23 -0400 Received: by mail-pl1-x635.google.com with SMTP id i11so5622721plr.1 for ; Thu, 24 Mar 2022 11:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r9B6mV80OgqdiI83ewaqC80HWu/UbOOhNxA7lQxIlI8=; b=msRaTW7Wh1RhszjFBzjpEZZtDQa/ZjCSSxsduINZ3T3WDQv9OAJKS8KFPC+jJWVwzz zckfW1hHBGABJPe70kiYUcvGRsHb/dn/yIWYjSEnIGIahuoY5KYiZokzX3LBrNRgB5FF Bpnp80QgKlo+Gh2P5DqGVCGJwr27EzyJzoVhg6iC5sHkjWFypWUU+Z2JzVqVO8Wbupoq 2OrnflgmfA8gf0ErsVY+y4FCWcZcB5C/aw0qwLxs5reIp8i1pPSGCvY7p7FePyWTtZCW KBwD9foKzwuIPWHxNybp+WHyZgS/VXrpaD2NC0WWg8K2Eog1lLbXrQFmfXoqS+olmp2b sZHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r9B6mV80OgqdiI83ewaqC80HWu/UbOOhNxA7lQxIlI8=; b=yCal5HItRMoCoCSklHhk3kVScLF15lcnmCgRWihVA/jh46oqTBrGEthKcl2gPRO97W k6DWuY4dk8PzS+HkBbfIJRTBiUSGwt4LgWHWFtoFbewDm4Vi0UXr5okGxy+0t/gqEMvJ OQmqQaRN+L2/woFAaFxe7JGsgDvrWaA+nL+y8xRuBjBUXk8LejZMSvl6ujRmsDnSncua BemmZzfL6ApbxQeQ9si1s+AvC+1hZ8UkFpq6/tpXWO/kOTx4eYlJFSquRHFJ93z0C53j e7F0TrxsmvaC6WiFS4PAeHerN5FSWTk2GXOba66/Yxr752/SEuYg3I4POzY5Nzb+EaHm 36mQ== X-Gm-Message-State: AOAM532lfPqxEv+zWp8p92dygYKCuHNuoNWvDoS0ZwveN1YN6E8UMpfL GOAM8ydbgRvom4Q2zktZKaPdZi6g8S3xzA== X-Google-Smtp-Source: ABdhPJx856d+uj572Oto/CbHbITA5sDDhcrx9woUOIpDJVuVJugOKaq/GRdbYFKnlmf4TPtz8qVIUg== X-Received: by 2002:a17:90a:8a91:b0:1c6:9f99:e671 with SMTP id x17-20020a17090a8a9100b001c69f99e671mr19859368pjn.100.1648145779767; Thu, 24 Mar 2022 11:16:19 -0700 (PDT) Received: from dev.lizongyuan.local ([103.177.44.101]) by smtp.gmail.com with ESMTPSA id u10-20020a17090a2b8a00b001c6594e5ddcsm3577725pjd.15.2022.03.24.11.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 11:16:19 -0700 (PDT) From: Zongyuan Li To: qemu-devel@nongnu.org Subject: [PATCH v5 3/4] hw/intc/exynos4210: replace 'qemu_split_irq' in combiner and gic Date: Fri, 25 Mar 2022 02:15:56 +0800 Message-Id: <20220324181557.203805-4-zongyuan.li@smartx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220324181557.203805-1-zongyuan.li@smartx.com> References: <20220324181557.203805-1-zongyuan.li@smartx.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::635 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::635; envelope-from=zongyuan.li@smartx.com; helo=mail-pl1-x635.google.com X-Spam_score_int: 29 X-Spam_score: 2.9 X-Spam_bar: ++ X-Spam_report: (2.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Igor Mitsyanko , Peter Maydell , "open list:Exynos" , Zongyuan Li Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Zongyuan Li --- hw/arm/exynos4210.c | 26 +++++++++++ hw/intc/exynos4210_combiner.c | 81 +++++++++++++++++++++++++++-------- hw/intc/exynos4210_gic.c | 36 +++++++++++++--- include/hw/arm/exynos4210.h | 11 ++--- include/hw/core/split-irq.h | 5 +-- 5 files changed, 126 insertions(+), 33 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 0299e81f85..28bcf97af9 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -288,6 +288,7 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) for (n = 0; n < EXYNOS4210_MAX_INT_COMBINER_OUT_IRQ; n++) { sysbus_connect_irq(busdev, n, s->irqs.int_gic_irq[n]); } + /* SplitIRQ for internal irq realized here */ exynos4210_combiner_get_gpioin(&s->irqs, dev, 0); sysbus_mmio_map(busdev, 0, EXYNOS4210_INT_COMBINER_BASE_ADDR); @@ -299,6 +300,7 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) for (n = 0; n < EXYNOS4210_MAX_INT_COMBINER_OUT_IRQ; n++) { sysbus_connect_irq(busdev, n, s->irqs.ext_gic_irq[n]); } + /* SplitIRQ for external irq realized here */ exynos4210_combiner_get_gpioin(&s->irqs, dev, 1); sysbus_mmio_map(busdev, 0, EXYNOS4210_EXT_COMBINER_BASE_ADDR); @@ -488,6 +490,30 @@ static void exynos4210_init(Object *obj) object_initialize_child(obj, name, orgate, TYPE_OR_IRQ); g_free(name); } + + for (i = 0; i < ARRAY_SIZE(s->irqs.int_combiner_irq); i++) { + char *name = g_strdup_printf("internal-combiner-irq-%d", i); + + object_initialize_child(obj, name, &s->irqs.int_combiner_irq[i], + TYPE_SPLIT_IRQ); + g_free(name); + } + + for (i = 0; i < ARRAY_SIZE(s->irqs.ext_combiner_irq); i++) { + char *name = g_strdup_printf("external-combiner-irq-%d", i); + + object_initialize_child(obj, name, &s->irqs.ext_combiner_irq[i], + TYPE_SPLIT_IRQ); + g_free(name); + } + + for (i = 0; i < ARRAY_SIZE(s->irqs.board_irqs); i++) { + char *name = g_strdup_printf("board-irq-%d", i); + + object_initialize_child(obj, name, &s->irqs.board_irqs[i], + TYPE_SPLIT_IRQ); + g_free(name); + } } static void exynos4210_class_init(ObjectClass *klass, void *data) diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c index 4534ee248d..fafcfc484d 100644 --- a/hw/intc/exynos4210_combiner.c +++ b/hw/intc/exynos4210_combiner.c @@ -31,6 +31,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qemu/module.h" +#include "qapi/error.h" #include "hw/arm/exynos4210.h" #include "hw/hw.h" @@ -105,16 +106,39 @@ static const VMStateDescription vmstate_exynos4210_combiner = { } }; +static void split_irq(SplitIRQ *splitter, qemu_irq out1, qemu_irq out2) +{ + DeviceState *dev = DEVICE(splitter); + + qdev_prop_set_uint32(dev, "num-lines", 2); + + qdev_realize(dev, NULL, &error_fatal); + + qdev_connect_gpio_out(dev, 0, out1); + qdev_connect_gpio_out(dev, 1, out2); +} + +static void passthrough_irq(SplitIRQ *splitter, qemu_irq out) +{ + DeviceState *dev = DEVICE(splitter); + + qdev_prop_set_uint32(dev, "num-lines", 1); + + qdev_realize(dev, NULL, &error_fatal); + + qdev_connect_gpio_out(dev, 0, out); +} + /* * Get Combiner input GPIO into irqs structure */ -void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *dev, - int ext) +void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *combiner, + int ext) { int n; int bit; int max; - qemu_irq *irq; + SplitIRQ *irq; max = ext ? EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ : EXYNOS4210_MAX_INT_COMBINER_IN_IRQ; @@ -132,53 +156,74 @@ void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *dev, /* MDNIE_LCD1 INTG1 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(1, 0) ... EXYNOS4210_COMBINER_GET_IRQ_NUM(1, 3): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(0, bit + 4)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(0, bit + 4)]), + 0)); continue; /* TMU INTG3 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(3, 4): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(2, bit)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(2, bit)]), + 0)); continue; /* LCD1 INTG12 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 0) ... EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 3): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(11, bit + 4)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(11, bit + 4)]), + 0)); continue; /* Multi-Core Timer INTG12 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 4) ... EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 8): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]), + 0)); continue; /* Multi-Core Timer INTG35 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(35, 4) ... EXYNOS4210_COMBINER_GET_IRQ_NUM(35, 8): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]), + 0)); continue; /* Multi-Core Timer INTG51 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(51, 4) ... EXYNOS4210_COMBINER_GET_IRQ_NUM(51, 8): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]), + 0)); continue; /* Multi-Core Timer INTG53 */ case EXYNOS4210_COMBINER_GET_IRQ_NUM(53, 4) ... EXYNOS4210_COMBINER_GET_IRQ_NUM(53, 8): - irq[n] = qemu_irq_split(qdev_get_gpio_in(dev, n), - irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]); + split_irq(&irq[n], qdev_get_gpio_in(combiner, n), + qdev_get_gpio_in( + DEVICE( + &irq[EXYNOS4210_COMBINER_GET_IRQ_NUM(1, bit + 4)]), + 0)); continue; } - irq[n] = qdev_get_gpio_in(dev, n); + passthrough_irq(&irq[n], qdev_get_gpio_in(combiner, n)); } } diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index bc73d1f115..888233c681 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -29,6 +29,7 @@ #include "hw/qdev-properties.h" #include "hw/arm/exynos4210.h" #include "qom/object.h" +#include "hw/hw.h" enum ExtGicId { EXT_GIC_ID_MDMA_LCD0 = 66, @@ -197,7 +198,7 @@ static void exynos4210_irq_handler(void *opaque, int irq, int level) Exynos4210Irq *s = (Exynos4210Irq *)opaque; /* Bypass */ - qemu_set_irq(s->board_irqs[irq], level); + qemu_set_irq(qdev_get_gpio_in(DEVICE(&s->board_irqs[irq]), 0), level); } /* @@ -218,6 +219,12 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s) uint32_t grp, bit, irq_id, n; for (n = 0; n < EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ; n++) { + SplitIRQ *splitter = &s->board_irqs[n]; + DeviceState *dev = DEVICE(splitter); + + qdev_prop_set_uint32(dev, "num-lines", 2); + qdev_realize(dev, NULL, &error_fatal); + irq_id = 0; if (n == EXYNOS4210_COMBINER_GET_IRQ_NUM(1, 4) || n == EXYNOS4210_COMBINER_GET_IRQ_NUM(12, 4)) { @@ -229,15 +236,28 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s) /* MCT_G1 is passed to External and GIC */ irq_id = EXT_GIC_ID_MCT_G1; } + if (irq_id) { - s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], - s->ext_gic_irq[irq_id-32]); + qdev_connect_gpio_out(dev, 0, + qdev_get_gpio_in( + DEVICE(&s->int_combiner_irq[n]), 0)); + qdev_connect_gpio_out(dev, 1, s->ext_gic_irq[irq_id - 32]); } else { - s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], - s->ext_combiner_irq[n]); + qdev_connect_gpio_out(dev, 0, + qdev_get_gpio_in( + DEVICE(&s->int_combiner_irq[n]), 0)); + qdev_connect_gpio_out(dev, 1, + qdev_get_gpio_in( + DEVICE(&s->ext_combiner_irq[n]), 0)); } } for (; n < EXYNOS4210_MAX_INT_COMBINER_IN_IRQ; n++) { + SplitIRQ *splitter = &s->board_irqs[n]; + DeviceState *dev = DEVICE(splitter); + + qdev_prop_set_uint32(dev, "num-lines", 2); + qdev_realize(dev, NULL, &error_fatal); + /* these IDs are passed to Internal Combiner and External GIC */ grp = EXYNOS4210_COMBINER_GET_GRP_NUM(n); bit = EXYNOS4210_COMBINER_GET_BIT_NUM(n); @@ -245,8 +265,10 @@ void exynos4210_init_board_irqs(Exynos4210Irq *s) EXYNOS4210_MAX_EXT_COMBINER_OUT_IRQ][bit]; if (irq_id) { - s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], - s->ext_gic_irq[irq_id-32]); + qdev_connect_gpio_out(dev, 0, + qdev_get_gpio_in( + DEVICE(&s->int_combiner_irq[n]), 0)); + qdev_connect_gpio_out(dev, 1, s->ext_gic_irq[irq_id - 32]); } } } diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index 60b9e126f5..be36665e04 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -28,6 +28,7 @@ #include "hw/sysbus.h" #include "target/arm/cpu-qom.h" #include "qom/object.h" +#include "hw/core/split-irq.h" #define EXYNOS4210_NCPUS 2 @@ -79,11 +80,11 @@ #define EXYNOS4210_NUM_DMA 3 typedef struct Exynos4210Irq { - qemu_irq int_combiner_irq[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; - qemu_irq ext_combiner_irq[EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ]; + SplitIRQ int_combiner_irq[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; + SplitIRQ ext_combiner_irq[EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ]; qemu_irq int_gic_irq[EXYNOS4210_INT_GIC_NIRQ]; qemu_irq ext_gic_irq[EXYNOS4210_EXT_GIC_NIRQ]; - qemu_irq board_irqs[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; + SplitIRQ board_irqs[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; } Exynos4210Irq; struct Exynos4210State { @@ -115,7 +116,7 @@ qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); /* Initialize board IRQs. * These IRQs contain splitted Int/External Combiner and External Gic IRQs */ -void exynos4210_init_board_irqs(Exynos4210Irq *s); +void exynos4210_init_board_irqs(Exynos4210Irq *irqs); /* Get IRQ number from exynos4210 IRQ subsystem stub. * To identify IRQ source use internal combiner group and bit number @@ -126,7 +127,7 @@ uint32_t exynos4210_get_irq(uint32_t grp, uint32_t bit); /* * Get Combiner input GPIO into irqs structure */ -void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *dev, +void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, DeviceState *combiner, int ext); /* diff --git a/include/hw/core/split-irq.h b/include/hw/core/split-irq.h index ff8852f407..eb485dd7a6 100644 --- a/include/hw/core/split-irq.h +++ b/include/hw/core/split-irq.h @@ -42,9 +42,6 @@ #define MAX_SPLIT_LINES 16 - -OBJECT_DECLARE_SIMPLE_TYPE(SplitIRQ, SPLIT_IRQ) - struct SplitIRQ { DeviceState parent_obj; @@ -52,4 +49,6 @@ struct SplitIRQ { uint16_t num_lines; }; +OBJECT_DECLARE_SIMPLE_TYPE(SplitIRQ, SPLIT_IRQ) + #endif From patchwork Thu Mar 24 18:15:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zongyuan Li X-Patchwork-Id: 12790967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 889B1C433EF for ; Thu, 24 Mar 2022 18:25:13 +0000 (UTC) Received: from localhost ([::1]:37852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXS92-0004eL-B3 for qemu-devel@archiver.kernel.org; Thu, 24 Mar 2022 14:25:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXS0Z-00062G-BT for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:27 -0400 Received: from [2607:f8b0:4864:20::42f] (port=47046 helo=mail-pf1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXS0X-00036C-Rt for qemu-devel@nongnu.org; Thu, 24 Mar 2022 14:16:27 -0400 Received: by mail-pf1-x42f.google.com with SMTP id s11so4564409pfu.13 for ; Thu, 24 Mar 2022 11:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z8/3sggV+dBbiO1PXwaQwIz5VINnWuh2AxxWFR/Xqcs=; b=n74/903K9K91arDavIWSUjrmzgHmJcYhR9NuK+0bYhjBSeppUF+hdchUvL80I7WSBh 1NwamyFVC3C3Qm3wRy3SKG2DyKpb+eDmZGqSShKQ7t5tdnP/g6IS5Xp7wHFZUlegnxqA 9vUdH97SF9wL1phB5QxyadvvZd2LMnhsleF443yvD1YOA9RHYaoUJk3fQF6aDY2+nE4d 4Xo/xa0fh1cf/Ec88ey3mNKl6f9rA4SElcjDYebwqYdWjlG7soHXvR5RxBhRRdQ88azI YGBnIAKc6DU94HNCwdu+vnPlJmqA9xVNlIqK2uU7A1KSUcjFkgSz7bpQU24zi0QxPPWt /ebA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z8/3sggV+dBbiO1PXwaQwIz5VINnWuh2AxxWFR/Xqcs=; b=cp/oeCjrGPvfvsd6I8lfz7tnRmjH3LYHk/toKzpc0tJfAwYj6uPUwPprdnifUxsH0h lLlH3AMNamUCqyg+jWJY5WEOv0MLeiWxurWX5YwssIuzgbE3kjePyHN743UihqJvDzYQ Gl9MV8EiEYasep1zI4lUAR1W82OxIE1+CTebxmLJjlulDwEnZM4IO71Xquq/FkgrCnda Wr90WQU2l0A6AXmcbPp8xzXkWdFUlL1q+iP4HxzVv2xIim+Q1TnDwcLaP/PfL3GVZkVK i0/gdhcbOALZzhp6QxEljzmOIG8mQWGYp/E3qgQNChXgEdgBe5NfB8HZAMdx0COSyMLx cCuw== X-Gm-Message-State: AOAM532NBGzfVeva9UFXAWZL6OBqW5tQOwpVB8q5es0fj61pRKMdS3a4 jArZwM7ywNxuuQ9OdtgJUTQ5FxVYpj29Yg== X-Google-Smtp-Source: ABdhPJwZpdY2shn5imVKbiEbaYKx/g5YfcokJBKH/RNAgd0cxXmBUnFjy+hdJNTRySSZfL9JU/Q6LQ== X-Received: by 2002:a05:6a00:16c7:b0:4f7:e497:69b8 with SMTP id l7-20020a056a0016c700b004f7e49769b8mr6427731pfc.6.1648145784468; Thu, 24 Mar 2022 11:16:24 -0700 (PDT) Received: from dev.lizongyuan.local ([103.177.44.101]) by smtp.gmail.com with ESMTPSA id u10-20020a17090a2b8a00b001c6594e5ddcsm3577725pjd.15.2022.03.24.11.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 11:16:24 -0700 (PDT) From: Zongyuan Li To: qemu-devel@nongnu.org Subject: [PATCH v5 4/4] hw/core/irq: remove unused 'qemu_irq_split' function Date: Fri, 25 Mar 2022 02:15:57 +0800 Message-Id: <20220324181557.203805-5-zongyuan.li@smartx.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220324181557.203805-1-zongyuan.li@smartx.com> References: <20220324181557.203805-1-zongyuan.li@smartx.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42f (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::42f; envelope-from=zongyuan.li@smartx.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: 29 X-Spam_score: 2.9 X-Spam_bar: ++ X-Spam_report: (2.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Peter Maydell , Zongyuan Li Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Zongyuan Li Reviewed-by: Peter Maydell Resolves: https://gitlab.com/qemu-project/qemu/-/issues/811 --- hw/core/irq.c | 15 --------------- include/hw/irq.h | 5 ----- 2 files changed, 20 deletions(-) diff --git a/hw/core/irq.c b/hw/core/irq.c index 741219277b..3623f711fe 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -106,21 +106,6 @@ qemu_irq qemu_irq_invert(qemu_irq irq) return qemu_allocate_irq(qemu_notirq, irq, 0); } -static void qemu_splitirq(void *opaque, int line, int level) -{ - struct IRQState **irq = opaque; - irq[0]->handler(irq[0]->opaque, irq[0]->n, level); - irq[1]->handler(irq[1]->opaque, irq[1]->n, level); -} - -qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2) -{ - qemu_irq *s = g_new0(qemu_irq, 2); - s[0] = irq1; - s[1] = irq2; - return qemu_allocate_irq(qemu_splitirq, s, 0); -} - void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n) { int i; diff --git a/include/hw/irq.h b/include/hw/irq.h index dc7abf199e..645b73d251 100644 --- a/include/hw/irq.h +++ b/include/hw/irq.h @@ -46,11 +46,6 @@ void qemu_free_irq(qemu_irq irq); /* Returns a new IRQ with opposite polarity. */ qemu_irq qemu_irq_invert(qemu_irq irq); -/* Returns a new IRQ which feeds into both the passed IRQs. - * It's probably better to use the TYPE_SPLIT_IRQ device instead. - */ -qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2); - /* For internal use in qtest. Similar to qemu_irq_split, but operating on an existing vector of qemu_irq. */ void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n);