From patchwork Thu Feb 15 17:57:22 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: 772960 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp965319wre; Thu, 15 Feb 2024 10:02:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX0DryinQKKD0t1jnX70oqujRFqGs+Cp12Qmo1x203VK0+cNEYhzqosAnw9+dfXStNVDVTjG0MZUQH26YQ9ol6A X-Google-Smtp-Source: AGHT+IGesHhQcW797IxOgCh/m2XrwaJm/naejD3LMAtypMiZoQQokNfuUqWjBbtPtiVoyFX/viDw X-Received: by 2002:a05:620a:2488:b0:787:2606:14e2 with SMTP id i8-20020a05620a248800b00787260614e2mr3431374qkn.42.1708020157396; Thu, 15 Feb 2024 10:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708020157; cv=none; d=google.com; s=arc-20160816; b=Z1hu9bUL7tZT/qBg+R67+60808pI5G4AU3i6Yqe0xGAgR0Ot6CN/CD582nEqRBDy/s l+HgDAcpDp9IQ6p1coe0M6fLXDLX8DhzF70PuBZr3AVGYb7ZCf2o2A6NqjBcAiyjuTXE HasYX5YK6a5SfmsrrIyJUtEXJCHOXJdZSkCaSMI8T7M6nmI2B3k/uh/p9Snt7WxsztTi RkSlM1/hW7Mm3ZjY/FdDtz2xI/cQPcALcq2cUHyA3x6Ii3WG8o3a92xVHhKPz2SnSEz8 GcYXQjTJE/gjToXqP82lNCdA48VGwEhXjIb0bc4kZ6J9gVK5h0coXMlCC01YDmwsWoiJ UIWA== 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=K9qIQKhs5a0rBnt1RjYr8e6nFgX9Qz3kgk9xy5OfTBw=; fh=ji8Yh8nl+lQsmijHgb8xFeSweOuU6hlZqBsT4ihbGqw=; b=Nlhr0xKHezZ5oqQx4yJD1fXjcMG5W6dEbJIOUekAAnWLjVczGBNAozRwv/sJDZ8MYo hwEXmAcp4RPhq+qejNwscH7Xo4erOk3bX3t1rm8PRqii/XCa8RQIqbOMTbFWQiuh78Oc HYS8ScYgVyKXQT7CpDO3iE5GUIL10IILPtgrX6NHg9re6/MMFY/0B8IVTa3W1VN7VVe2 o4lJAknLyi3jIAjNrsddrqs32byEXMsWZ6ExNWacEodXLziLv/UGybwsXBZDiTQ7QWNC wi13dx0YGo65AUNNYKLfUKsAvpPSHF6My75z2ZS16U5SlLVdV3QnsSt7Ukw9Nf9/SBO/ 6Lxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jcVjhbk2; 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 o17-20020a0561023f9100b004679c371a51si441610vsv.709.2024.02.15.10.02.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 10:02:36 -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=jcVjhbk2; 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 1rag2v-0002MF-Ts; Thu, 15 Feb 2024 13:01:18 -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 1rag2n-00022O-Ny for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:01:10 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rag2j-0002PA-Bt for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:01:09 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a3566c0309fso144975166b.1 for ; Thu, 15 Feb 2024 10:01:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708020062; x=1708624862; 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=K9qIQKhs5a0rBnt1RjYr8e6nFgX9Qz3kgk9xy5OfTBw=; b=jcVjhbk2wkTr1VOMW5l/6dNmOeMuZB74HM5kfddyqgAVVruzA1PdZHXL+gT/pACIhS ahasEDmR3iDZmges47KRqiyG8nO4n50WBcPMpgVE/opa1PbkuRjFgfBoiBjaeduZc+I7 o2TgNBInpZsw6FQ/9q5MKriad6XTWZUo0/K8T/PMfZLNtWU+5zf6ZJ/YdG0rMXn0k17G l+d2ROaA3cRyOocmf+J7Lt/6BYbhtSahjmInFEFHeLsCsvOjOUZQ/qeXvYmW+ctbi3qx IJ4c58la/jHWX8ENCYPp0RyT1egkUd5qfykEOzs91DfupJEKHXlKc7Lp6Uk0j7aKU9be WIIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708020062; x=1708624862; 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=K9qIQKhs5a0rBnt1RjYr8e6nFgX9Qz3kgk9xy5OfTBw=; b=niz4yZYRRBSg3igITjZlvrpv1GiW1jzO3mJeeT6h1Qq4YaLUyhlHx18mrg4aj0AmtN LJ7d8RP7jc0ICEOvfttRKe7eMiZSy2RoKOqHSHBg7L0k78W9n0sYRb11NwKQlT8wxuGf mFfI8tnln9T8lTPibe4lfCx4P4MvYQqXo2dSJmob+3IE7Z364Da040q6nFsKYqVAL84R rj8vYaToBC17l6hUtuUznnqqirPTr6qydr1mEZJyrc/cd1eJrkqe4v2F+5tTrUr9xXga JxveLvNwEjZiSm99EYDyTIHAP47XHvJQr7uZRGr1JR5dy4TGJr288jT0tLJcwOrOMvwx TXhA== X-Gm-Message-State: AOJu0YyTIHf1+aledvYhOCEBfM4mEVeUdSfEZFb45DbylgIBRYPc2COj 1Wimc9fUOR2lRpj3WcnP5/R9nzREechigZu0nM2v0dBoUJ+uC+4rNdQAr/8UHkfcaESgxAfFqpt ko+o= X-Received: by 2002:a17:906:7d86:b0:a3d:e9c:6d3a with SMTP id v6-20020a1709067d8600b00a3d0e9c6d3amr1800135ejo.49.1708020062128; Thu, 15 Feb 2024 10:01:02 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id s12-20020a17090699cc00b00a3d943558b8sm744210ejn.134.2024.02.15.10.01.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 10:01:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Mark Cave-Ayland , Damien Hedde , Richard Henderson , Artyom Tarasenko Subject: [PULL 28/56] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices Date: Thu, 15 Feb 2024 18:57:22 +0100 Message-ID: <20240215175752.82828-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215175752.82828-1-philmd@linaro.org> References: <20240215175752.82828-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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=unavailable 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 Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland Reviewed-by: Damien Hedde Reviewed-by: Richard Henderson Message-Id: <20240213130341.1793-13-philmd@linaro.org> --- hw/sparc64/sparc64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 72f0849f50..3091cde586 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "hw/boards.h" #include "hw/sparc/sparc64.h" @@ -271,9 +272,10 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_type, uint64_t prom_addr) uint32_t stick_frequency = 100 * 1000000; uint32_t hstick_frequency = 100 * 1000000; - cpu = SPARC_CPU(cpu_create(cpu_type)); + cpu = SPARC_CPU(object_new(cpu_type)); qdev_init_gpio_in_named(DEVICE(cpu), sparc64_cpu_set_ivec_irq, "ivec-irq", IVEC_MAX); + qdev_realize(DEVICE(cpu), NULL, &error_fatal); env = &cpu->env; env->tick = cpu_timer_create("tick", cpu, tick_irq,