From patchwork Thu Feb 8 18:12:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 770864 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp465091wre; Thu, 8 Feb 2024 10:15:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU+MYn4g4p+ZMsqL700VM6kpjmQMpI8Lh1TzmI/onEeYJ773ZSP8YEkqZIav3L6bUirLQ/4BrnSd9UhN+IzCtrE X-Google-Smtp-Source: AGHT+IGmeKSHhg66kv7Wm9hMDqTJ9zb57XOXKv6++puyvc7ogHWldhfqyt79YLh7NxPALeqpApC7 X-Received: by 2002:a05:6830:6d88:b0:6e0:b741:452d with SMTP id ea8-20020a0568306d8800b006e0b741452dmr348353otb.29.1707416101727; Thu, 08 Feb 2024 10:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416101; cv=none; d=google.com; s=arc-20160816; b=NF2I/6S3Fv2NWFJJOKGqujgtj/CTGa+a6ggbJEBlcAiIq/AY33D9FQr/YAJI0ylrQA 1Osz7OIFVBFCQTfR5iyZeMl9CLAIMhI0U0CJKQk/sF60IIyXtSCQjdOCJgYXrdgq3gir o8pEKrL9LXHarLjwnDS0o9gqjhYko5nF0mhWf/lgUMQyupsTfGQ907mIFAOok9InyCUb +RUphdiNIx5qVXSDOGsKbVlijwgcslhQVuQo/vN60847epUaP/ZhnoZIvYKTho1eDSVX TrLutFmlhuGg+RoPjlZ9j5FedIVDPqJZCZxBzgWbKIXkJ5eC6gwJk9TIDKCxgSoXxFVg B/3w== 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:cc:to :from:dkim-signature; bh=h2BaaqYtSB0f7aHxoF7miID3EmqxQDE1kM5wTAvRNjM=; fh=ceygyocNZIoq+LcjbZ3zxWJys1HoulPpqTElfyycH0I=; b=o4ZyUE8jNdlu1lb0snF1ZuwWON1esTDyPKgMcPTcSArgV2clbiW30idC8YQrOJKNEd bz6EGpJSaK8CoMMcfT2xM9YqmzAIKtcNG0awNVNtlCybbl7Nj8qic/WGShE6ww7F60Zd WLzoWM8kW1QWxZX8EX5PS4Cddyl7dd2MaCTvq/zWV6PuhAf8Fg/XpfX++EUKa10BE+K1 g0rP9xDklsJ9s1VkFb3ilzvV/dyE4nKaU3phHv4nqCEbaXqAy/bIhlEDx+0+0sXScVZz NosfWKVoZk0s7Ew/e2ysxqjrWgd4adQmqQ/gt3Z2f+fjic/07Iio2E9vz2B8WOiNM0AI vVaA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeQjWD0h; 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 X-Forwarded-Encrypted: i=1; AJvYcCVmuAne1va7JPUF+v8ZHiIUVPXYHhLvoj+jZDLGujm7UjFskCBmkmE4JEogeJUBECU+43CJU1auEWFdujzWB8Mq Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a3-20020ad45c43000000b0068c938c5548si80100qva.39.2024.02.08.10.15.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:15:01 -0800 (PST) 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=GeQjWD0h; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rY8uM-0005xe-DZ; Thu, 08 Feb 2024 13:13: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 1rY8uB-0005VB-JM for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:49 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8uA-0006rK-3V for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:47 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5602500d1a6so233246a12.3 for ; Thu, 08 Feb 2024 10:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416024; x=1708020824; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h2BaaqYtSB0f7aHxoF7miID3EmqxQDE1kM5wTAvRNjM=; b=GeQjWD0hwrVNlRHZmxEPTP6tyQcIhdu7ThSmsg3JuAQyfhnZ/iBw0jXKD5WFZfuLhN vea0W1fmtIOccNqdYvLjUIloC320gDzXEMHwHYMVlZLhOTBBbuJAmEiOYjEEqFE0StM6 AhKztkdodNRCBgmHt/SSPbbm3XPYAiPOisXftLvJ1VPBRrClj5WVXik5w1uwObDrcjFX mWF6AviTpDKxZcEhBGhmRuLiX9igkG/9Hqy90nbcQ5cU8e4FEca4GwbrqrcWrUTTw8WL QL1AUT/vI7ZYBq7SXIayileKeOx2hTo5TN9OTv9GT7hmCxlO2+vycmPjtH+JWBh99xBL gMIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416024; x=1708020824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h2BaaqYtSB0f7aHxoF7miID3EmqxQDE1kM5wTAvRNjM=; b=dGh2iMObraasJTsHgSJ/joTvQiodALVnNZCdpuuIUUQ1ZzYO8JGImbZ1k69ssFJlD0 TTKH9/ckLJV5GMxMYx9HlYWGPGnxcDs8kRUdk79csv/FDtjaxeydAO+jFtP/I460iiZO qBYiZZ89qVv+l/gl+asJX2tzjtvy/wg9ERzARcBRDtgzA58ac1BHxjnu8gyAfH5zbmwF Djxp9GfRzVWFZ133NRQhuHEqbBULNWWmYg4Riah6L+o4fR2Ymsb9ooiEwKrbng7hYqm0 8QPRYrNqoiz7DAGluSrk8CuSrrImuUuGGO3NK64yV6L3l3NGI88w4Vj1mIJ+kqW/Dcaa b9BA== X-Gm-Message-State: AOJu0YwDthDnunGz6cTDN5SHFPD0Oa1rTO6vPTNp+b3ZCxWMaQqbDnIH n7MTPwJDaxyrFmGWNN8m+7XKHztQXz86eALTygKyH7IzwtXNSvUE6SRtKlyM/Fr91xR1IY4OlgW 7Sqg= X-Received: by 2002:aa7:cfd1:0:b0:561:1602:949d with SMTP id r17-20020aa7cfd1000000b005611602949dmr30642edy.24.1707416024131; Thu, 08 Feb 2024 10:13:44 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWicqgbrRVVwmt+MjebO7v6rOOJM9EID8Ep0AD2RCmrZjRuPz/y71P7YBizYQkNbJCycYmDF50cJxHGydKsrrdguYSifoUEX87Hm6345qbhm4JJFsFTd//9NccnRs9w7q5aPE6NjpDk/3kXPcVY7oOiFZ8JFtF/peJGt/xfc4KL79ws8OuNzkKYkiCrb6+dvnefJeEOu1yXCiPRn0YW2xB9I6Ln7ng6rqVI9EkR8RYm9ViEkseqdEPTQmzJX/mytTS9Av2VqT9JbDIREFmbdrUDMF9yeq7QERypi46BCw5cIHMTPO2UGE/NqjCBHlLY52unYWlY8HXzXSw5mJNcXMH9IA7GLjSAdcB1e4aGms7zXd1FCx28TZHQgrbPmmma7zf8oONO/rNaEuIIBz5xN52d8WBkLp0JDts/Mw== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id cs16-20020a0564020c5000b005611d0f7339sm409781edb.41.2024.02.08.10.13.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Fabien Chouteau , Frederic Konrad , Artyom Tarasenko Subject: [PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it Date: Thu, 8 Feb 2024 19:12:42 +0100 Message-ID: <20240208181245.96617-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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-bounces+patch=linaro.org@nongnu.org We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 2dfb742566..0df5fc949d 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -263,10 +263,10 @@ static void leon3_generic_hw_init(MachineState *machine) irqmpdev = qdev_new(TYPE_GRLIB_IRQMP); qdev_init_gpio_in_named_with_opaque(DEVICE(cpu), leon3_set_pil_in, env, "pil", 1); - qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, - qdev_get_gpio_in_named(DEVICE(cpu), "pil", 0)); sysbus_realize_and_unref(SYS_BUS_DEVICE(irqmpdev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(irqmpdev), 0, LEON3_IRQMP_OFFSET); + qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, + qdev_get_gpio_in_named(DEVICE(cpu), "pil", 0)); env->irq_manager = irqmpdev; env->qemu_irq_ack = leon3_irq_manager; grlib_apb_pnp_add_entry(apb_pnp, LEON3_IRQMP_OFFSET, 0xFFF,