From patchwork Thu Feb 8 18:12:44 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: 770861 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464725wre; Thu, 8 Feb 2024 10:14:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwmNZMOrjzfkqBZJBozli32krlrp7m9QdUV9ixyVYxfjfRSat0lbKR6BNvUz8G4y+3BaOL X-Received: by 2002:ac8:5f12:0:b0:42c:4257:5906 with SMTP id x18-20020ac85f12000000b0042c42575906mr5399108qta.26.1707416060844; Thu, 08 Feb 2024 10:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416060; cv=none; d=google.com; s=arc-20160816; b=xAp/dpXSstiOLJ0b/hqwgaDiYrmcfvvJgHrKwXc7ymiEzmJh/uGjYOQCFjU0aVVxVV cnZhA3FzD3qzagWeGRaRH/FsYg+MqBRwfR3QDhXaNg4c5c51ZZX4azTbbgnuMMM4PEXv naVJ6FUS6AW46K1zHtMEAFJwwD30/uTJm4heuvIdEiowoZ97/UFvkeD2OmUv4fq4DCMu iEYRUWmdL8BVPVIQFaRcNmbGyOAIanuViacCUDFre3LWRDYOFYW1C/YXx5hLIV4w6y4w 3glddht8UneEWYe1Dq7p8PZLhbofDEhNt6zaquzss/yXvA4vRhmDGHDUhBUPq9B8Sc6L IZvQ== 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=e0Ufl9fqBfA4JrpwEmiN6ER59zmqlqLsBKlzkxxHoFQ=; fh=M8L61ifGcqxmigHCxZG3RzHf81TsBQ0nVmg68TnLUyc=; b=P7ExWRT8KFwtZCHdAGaSE206SLCe5LgAu5WEIRLOlXgPp2pEmxZvHkwNogOhlxOKAT 8xyHWF9BHo4QBnJz8W8T5W0hsWGe6QbMDlmQKClKoD86tPg0BtHd4/fy83Xdy2otT5dq rW70nUQxo6VKKA5HhxvQJvBlYC0rILC0XnZQ1HizBMRoaW0dSRFiXNejrgUjvq0UZKzF cK+QNDpTXi2XnssYaNNEZ0cx/mt4guz3OUt/tyfmbZN5wPBEEnadOVj0yGA4A2xjppqe 2sM1rmTarNfsJj6jXMcEWw5mY1HOuBvYFM/sebq4iu0W7k7NmqxQBOZvNb++jqZ+uX06 gjHA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DRtKoL7E; 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; AJvYcCUEAUZwpIibXtYr8Q6xWA0cN8Y7qP4d3KfVAf8m3FI6yqv3ppDGbaFfSy1JGIqZ4XJLNHYeFrooKal3SLcnn3zl Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o10-20020ac85a4a000000b0042aa70b5cb1si548697qta.47.2024.02.08.10.14.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14:20 -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=DRtKoL7E; 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 1rY8uP-0006Hp-UW; Thu, 08 Feb 2024 13:14:01 -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 1rY8uO-00065A-9E for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:14:00 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8uL-0006t9-Ub for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:14:00 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so12022666b.0 for ; Thu, 08 Feb 2024 10:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416036; x=1708020836; 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=e0Ufl9fqBfA4JrpwEmiN6ER59zmqlqLsBKlzkxxHoFQ=; b=DRtKoL7EEoO49IUAU6sA7DmmTc7syfWoRA+317qbBESw2ezVfDpoOZ0a7Ko5MO0jjz pONop6zedD8lgkZTPNAMyiWUmRmUytkgUkgtrQmzMDz8wPgIV9oLYktajXKk1VBtviio lgjgvvokfd+Jw+Wq9C964pNgKTtNSUpLmI0U6g48QSkaKMM//4ElGQTCC37jE5jNNko/ KTiTR4R6GvnJ6upD9+P86+qk5VqkLqgf0JeoSKqMZSGpJs6FaiuRkwT6yAXiF6R9y/gz lgnNomn+hsdWVyI2zbj1gzuzzXjYg4ML8zgPUfBZZMBDgvF+PG/cEEimqXoKeBa5OWzj LWVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416036; x=1708020836; 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=e0Ufl9fqBfA4JrpwEmiN6ER59zmqlqLsBKlzkxxHoFQ=; b=Y8smPFC5ZH4RrPxEn6kJaUSpehTxPxZb8LJ+WkVoMMUXxE5uv3Okt6WA81lJY43sEs zEy+zzwQxNxPKDS95kHdYK5MDrjw3c7J7pdjP3maicut68bzpHdxE5I4QlFGNlOGqAH4 /pXSlrCitXYB3wn3ziFCFaJJa5xuEybuC/5Tk4eYFvAx2A3kCNONW2AfMlr104PVRQxd dgpnzsAfcQUjupoXnJYFN5X3VwzHoKkQxF1n96ZiIrTFJzXP+bBrTrRBiyZO5dPdZzMS QnI29AJifzz6qVAxDfY5bBPhE1milYeJNLhJderlYHkmVSlZSitq+LDRbqFlg+dNK/x8 aNwQ== X-Gm-Message-State: AOJu0Yzy35VDQESI0rdt+b80WBmxvQXVulL/NY1Yc9bbgo14JRaQlpHS VqEehv9musxmBVUAJm6AvqrbVEznILhMdeM0gbucFOXJnr5cIVaXm7yD9td4K/pFXs9LB/F1Ksw SEFE= X-Received: by 2002:a17:906:4808:b0:a37:aa3b:f56 with SMTP id w8-20020a170906480800b00a37aa3b0f56mr82482ejq.49.1707416036295; Thu, 08 Feb 2024 10:13:56 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXC+04nAVm0zyDOUEvv5ti6R/jvcT9j+VXkU7fy1k21yTDd5UCfYql7jILgh0hcpandaqeRv0O0R/1WVHUnsvAqmFlwvbcEE1uhoAjRyaeRgRiqFTzJ1WqJ3TUhyVcNCgyuSC9SkTIJDR/wJBAwRviEbeGHsI1rvoyl7bm0EVu+dlCKrjGrxS7s4+Gx8ZmemLTCVrJyGdDxPTrPwBQ+Fl+J9MAXoImiERssDSpUcRVvIIzWGG+euB+MBHPl4k5L8prV1rRAlLdi/9P1tSeN0YEv0JVWRINaoHWd5DQXOqdYTquUmlgnmCqNK/bweD+0KQkywwGLI15QFNq1IaYghDe+srVdmKydBEYP+w== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id lf4-20020a170907174400b00a3bbf725080sm303160ejc.55.2024.02.08.10.13.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:55 -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?= , Artyom Tarasenko Subject: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices Date: Thu, 8 Feb 2024 19:12:44 +0100 Message-ID: <20240208181245.96617-12-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::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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 --- 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,