From patchwork Thu Apr 21 11:18:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 564339 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp359348map; Thu, 21 Apr 2022 04:48:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9pl9AFh1Lv6CrQlJgVlf0nSXTAU3NkMDKpJZIiZwCUL/vi40MaQjCDc5NTc7XLl7JS1vp X-Received: by 2002:a37:aa97:0:b0:69e:5c01:86f4 with SMTP id t145-20020a37aa97000000b0069e5c0186f4mr15763538qke.366.1650541681517; Thu, 21 Apr 2022 04:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650541681; cv=none; d=google.com; s=arc-20160816; b=zOJC/gj/4k8fxT0gETFjEqXkh5RaJ+kMMdjzq6qtuA2IMCvUPU1M+zemhg1fyAtur1 va5/pLhSL1HySakkrTY2HSTR2gMSZcbpwckn1I3Jq34yeL6IWNJsZvlS86QOrEgIQP5k q9f/XYWV+7FdcQVVJ0oBRl4wW+UGnC1XEmSjkEn98yWtSiNamoO3sa1M2hCwWpdeLPj+ iHqJsSa1+c0AhCPKnFa2vSOU8S4bxqL2CnMB2DMJBhcO3tb5i0106HoOYjxHeQKGUr1e iKI74ReOk/AoyPLHgZJra3MrvaPQW8vLxJQUrSmcRfNQ6pFqp6sAgIkBo+wI/71wQBcr k4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=yNOaXUrJUAeJ+AixS5fcfCSvW1JdJPD9+7LfvbRwH6I=; b=SirOWMc1xm1m3j86yUHOFNr2eMqAoLmp/nY2i4ZW/7wVABOYZYsWhrwbtpsFdWQ3h0 onVOxT47ukHLbd7iLsJrexqXkfK/mA5u4BQ5jMHOdBgqvXlayhcIOZXq/fc2WXySrSdY 0owVKnkZurAybJNDycBRbvtkP5mZlhCEzTkYvEPL1RPTZCd/0GWn//VgKWBxaOxw/iIx +bjZZ7tcpYSY94KjugEUZeVMquEeBF52AIf4y420tkfnz+WCa9/mAil51QqU+DN8QqET eaqT/vZA33f1iJq23bwUOvVFGeac0wsQ1laW2XjiCDyktuLULJdtoHUMb5u8EDUioaxA aEPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aA/uLGOQ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f19-20020a05620a409300b0069c6169256esi1404644qko.4.2022.04.21.04.48.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 04:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aA/uLGOQ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhVI0-0001dL-Tz for patch@linaro.org; Thu, 21 Apr 2022 07:48:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhUqS-0003Hn-Rj for qemu-devel@nongnu.org; Thu, 21 Apr 2022 07:19:32 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:37807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhUqG-0003Xb-DV for qemu-devel@nongnu.org; Thu, 21 Apr 2022 07:19:27 -0400 Received: by mail-wr1-x42b.google.com with SMTP id t6so2774198wra.4 for ; Thu, 21 Apr 2022 04:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yNOaXUrJUAeJ+AixS5fcfCSvW1JdJPD9+7LfvbRwH6I=; b=aA/uLGOQsns/PX4347e8rd7Y08PUpzNqA8Pi3t/J/s4riXwYLlqIOfjzXRvlY6+35u TyuIwZiAliJ9Yd0gD53ytcH/BV9jyLnOkduKIZDxk9mdCPtIHkldXOtw/ppoI0ScpgnA yubLZf2oOlZqXVaiQ1b7VCt1uMGXUuoNK+36oD/sTgktbl3edCCqJ8Qj8V5/rPkKVAgc j7jRRsZXEZZ64mXRtJ8kGubKALqOhj8dL8vqoTavfbLCFgixRn7nONXMXoQD0BYbp0Ix tWSON7WbvSluiARaih7Ugy8DEwb6K2wcf+baz/vNO2JQLeNs0J0rGDb8HEZQMYf8pI2u aAIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yNOaXUrJUAeJ+AixS5fcfCSvW1JdJPD9+7LfvbRwH6I=; b=4GozdLVR3xqNzfl3yiLAtKUeKKfOai9n526I2PDSjm6jVpQUD8oq8gTbdk89yj28gj tacXDzBWQSXiHPVuZI8Z0YXmmLOIwC9Xt4l43oblS45wwVlXUotxyxK/WKEKuEl6B87L 3E+Q1APV6SrF57pdNBLtEoAJj5+PU0++2rJUXjuZJg3ma0SVavuCnOLMM2EsC3v3p+WK OddKPICplMb+lqU7n9R/e52asXYsJIBOrVYF6D9mrxvETrX6L8W3VS/7e0Dm1ja7h/XS oAV8EG0vTPSY/sB4espYJ4oDqRm7TpSyp3iOqHLxnkzE26iXnbzfRAIER6nlbOzbQ9Bv d7yw== X-Gm-Message-State: AOAM530NKWuG7eyULG2z6+CbYSPApjHFZ3DqAorvi+CIhoXZ15oIZVxl dQ76mvaQ+SE5KJ8qbM9w6WQR+zdcgOPh1g== X-Received: by 2002:a05:6000:156a:b0:20a:9c1b:6b1b with SMTP id 10-20020a056000156a00b0020a9c1b6b1bmr13222289wrz.683.1650539952579; Thu, 21 Apr 2022 04:19:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e4-20020a5d6d04000000b0020a8bbbb72bsm2597694wrq.97.2022.04.21.04.19.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 04:19:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/31] hw/arm/exynos4210: Drop Exynos4210Irq struct Date: Thu, 21 Apr 2022 12:18:40 +0100 Message-Id: <20220421111846.2011565-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421111846.2011565-1-peter.maydell@linaro.org> References: <20220421111846.2011565-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The only time we use the int_combiner_irq[] and ext_combiner_irq[] arrays in the Exynos4210Irq struct is during realize of the SoC -- we initialize them with the input IRQs of the combiner devices, and then connect those to outputs of other devices in exynos4210_init_board_irqs(). Now that the combiner objects are easily accessible as s->int_combiner and s->ext_combiner we can make the connections directly from one device to the other without going via these arrays. Since these are the only two remaining elements of Exynos4210Irq, we can remove that struct entirely. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220404154658.565020-19-peter.maydell@linaro.org --- include/hw/arm/exynos4210.h | 6 ------ hw/arm/exynos4210.c | 34 ++++++++-------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index d38be8767b3..97353f1c02f 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -82,17 +82,11 @@ */ #define EXYNOS4210_NUM_SPLITTERS (EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ + 38) -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]; -} Exynos4210Irq; - struct Exynos4210State { /*< private >*/ SysBusDevice parent_obj; /*< public >*/ ARMCPU *cpu[EXYNOS4210_NCPUS]; - Exynos4210Irq irqs; qemu_irq irq_table[EXYNOS4210_MAX_INT_COMBINER_IN_IRQ]; MemoryRegion chipid_mem; diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 27c6ab27123..8dafa2215b6 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -331,8 +331,9 @@ static int mapline_size(const int *mapline) static void exynos4210_init_board_irqs(Exynos4210State *s) { uint32_t grp, bit, irq_id, n; - Exynos4210Irq *is = &s->irqs; DeviceState *extgicdev = DEVICE(&s->ext_gic); + DeviceState *intcdev = DEVICE(&s->int_combiner); + DeviceState *extcdev = DEVICE(&s->ext_combiner); int splitcount = 0; DeviceState *splitter; const int *mapline; @@ -375,8 +376,10 @@ static void exynos4210_init_board_irqs(Exynos4210State *s) splitin = 0; for (;;) { s->irq_table[in] = qdev_get_gpio_in(splitter, 0); - qdev_connect_gpio_out(splitter, splitin, is->int_combiner_irq[in]); - qdev_connect_gpio_out(splitter, splitin + 1, is->ext_combiner_irq[in]); + qdev_connect_gpio_out(splitter, splitin, + qdev_get_gpio_in(intcdev, in)); + qdev_connect_gpio_out(splitter, splitin + 1, + qdev_get_gpio_in(extcdev, in)); splitin += 2; if (!mapline) { break; @@ -414,11 +417,11 @@ static void exynos4210_init_board_irqs(Exynos4210State *s) qdev_realize(splitter, NULL, &error_abort); splitcount++; s->irq_table[n] = qdev_get_gpio_in(splitter, 0); - qdev_connect_gpio_out(splitter, 0, is->int_combiner_irq[n]); + qdev_connect_gpio_out(splitter, 0, qdev_get_gpio_in(intcdev, n)); qdev_connect_gpio_out(splitter, 1, qdev_get_gpio_in(extgicdev, irq_id - 32)); } else { - s->irq_table[n] = is->int_combiner_irq[n]; + s->irq_table[n] = qdev_get_gpio_in(intcdev, n); } } /* @@ -440,25 +443,6 @@ uint32_t exynos4210_get_irq(uint32_t grp, uint32_t bit) return EXYNOS4210_COMBINER_GET_IRQ_NUM(grp, bit); } -/* - * Get Combiner input GPIO into irqs structure - */ -static void exynos4210_combiner_get_gpioin(Exynos4210Irq *irqs, - DeviceState *dev, int ext) -{ - int n; - int max; - qemu_irq *irq; - - max = ext ? EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ : - EXYNOS4210_MAX_INT_COMBINER_IN_IRQ; - irq = ext ? irqs->ext_combiner_irq : irqs->int_combiner_irq; - - for (n = 0; n < max; n++) { - irq[n] = qdev_get_gpio_in(dev, n); - } -} - static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, 0x09, 0x00, 0x00, 0x00 }; @@ -630,7 +614,6 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) sysbus_connect_irq(busdev, n, qdev_get_gpio_in(DEVICE(&s->a9mpcore), n)); } - exynos4210_combiner_get_gpioin(&s->irqs, DEVICE(&s->int_combiner), 0); sysbus_mmio_map(busdev, 0, EXYNOS4210_INT_COMBINER_BASE_ADDR); /* External Interrupt Combiner */ @@ -640,7 +623,6 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp) for (n = 0; n < EXYNOS4210_MAX_INT_COMBINER_OUT_IRQ; n++) { sysbus_connect_irq(busdev, n, qdev_get_gpio_in(DEVICE(&s->ext_gic), n)); } - exynos4210_combiner_get_gpioin(&s->irqs, DEVICE(&s->ext_combiner), 1); sysbus_mmio_map(busdev, 0, EXYNOS4210_EXT_COMBINER_BASE_ADDR); /* Initialize board IRQs. */