From patchwork Tue Feb 13 13:03:41 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: 772310 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp242666wre; Tue, 13 Feb 2024 05:07:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+zcXHy1o+bpQaOQGw7LZKDAmJYHnR7mK8snIpRongKiy3hBiGifreXeHnwaqNgZdmubrQ X-Received: by 2002:a05:6358:7429:b0:178:7540:999 with SMTP id s41-20020a056358742900b0017875400999mr11479552rwg.3.1707829630879; Tue, 13 Feb 2024 05:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829630; cv=none; d=google.com; s=arc-20160816; b=zmBDdc50PBu/thDF0xF/XrxhNGgc1pw3hPKLp/h3krKMtUkrKRw5tnw/xk8rl/AFCO HnwL+MORPYDXV5dR96OoQV+449aIGqR1B3fplKPTVRK4I1qOH+OCU81KzbLFMPCjypQR NGoHhp4iXtmaV7USIMZ8FXxWB9wua1/+U9ucgFYhQuTuqZVRS369I9F8V7KVqse8zNTN wvhA/8tQcU8zp7WynO8LcuMIS6Mu4S7Hy3YHDFTd7JFdU8ImPkUy/QraoooW9rtL2QHH uNwkaKUp1we+mvc1Cy963hgZwsHBckodVMuEP9RdULCSyZ9L0b2F5EzYG/eG7zQyWl/m KfMA== 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=f0fVvYEwFHKEuJye0m7tE2Ksg3XkzZ7A8P3KgL7X69E=; fh=+G4mpM7+va4a7NR5PWXRFtZ5wAYC9NNdygAClmQ1ErM=; b=x6tf/JaU3FnTGVOVvOsRPbhYk/zw58rXKSWQwQiK2MnWsY7Ko6BUxjBGgSHXeUvVQY axabga1AF3hlIprK7MM59/Tu9lz5g+Wg4MuMFNWFvl27I1z0/rXppUKvMB7w5V7sSBDp n2VLoHkEv7yMsRILbYR7pzrEpLwyMxS4bIC2oQka6ULB30PifeGh0I2JCOmivGVBFsuz zO4lHCsT++picv/YfjaN5jcunAkIxi8g1Os/qjKN1u5PUAfCUhlxAPpinP+iKTxp44ab eKBmHaRUrNS5FQVOZgtSNkB/SLW1LwI5zjbl/2iJQzF/gW8Y6fjN8mJuzojacpXgb4z3 zD1g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eCkjN2gw; 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; AJvYcCXYqz0IVffK7ZJAl6G2xX94/PBEd/WmkSIg82wLwMt1SDJxFTt+u3hrnEPdW17a5/utkiFQWp9O4hS5qIi2TZT9 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y10-20020ac8524a000000b0042c721831f6si2557421qtn.234.2024.02.13.05.07.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:07:10 -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=eCkjN2gw; 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 1rZsV1-0005nb-DR; Tue, 13 Feb 2024 08:06:59 -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 1rZsTP-0002a2-Gi for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:23 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsTE-0006Mx-5M for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:14 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-410db155e57so14028155e9.1 for ; Tue, 13 Feb 2024 05:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829505; x=1708434305; 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=f0fVvYEwFHKEuJye0m7tE2Ksg3XkzZ7A8P3KgL7X69E=; b=eCkjN2gwIKCunjzEI0DOiStsScxGgI5xc5/ShHoqDeAo96/s9sE6mvTrQ6HGf5V/b7 vaYtfUbeCLslHbxtjTx216PclXWSFlD3soT6Fs6EqcvE5acZRMJQ7rq9gi+o58xZ36PU eO/HqRf9sijzKATZz3M+pB7OQEFY1JZZEBEZJNrc5prLjQb+Fo9db7dAIgkLRi2wzIuE dqyKkXiGkV9PT8fQF1tQnoSEzLAlLFB29DqI93nzZGMXSpZiwA6Kea/w9+KF8LOJfDBS ZhONTIt3oUUjehp3EcNhiwIP0vjyB562LEV/84OApKDZa2XPJpfZc2bWlc/fC8ESWjq9 vD0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829505; x=1708434305; 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=f0fVvYEwFHKEuJye0m7tE2Ksg3XkzZ7A8P3KgL7X69E=; b=liDaBGQTQqNAdCBxaT4jba4pZ0lgZ/oVUl918jVxwP9KFz3cwSE9tAiKdAPQ/Ke0jK JqA4O3Fq1lH8sFOG4ypXKC8k8HC/tX1Z8tZftFrvR2q1eO6hjalNdQwUof0TWDLxKq4/ b/dkA4xyo9bDjdnYO8elWn35XJxETIil8qeeSAoJZzqzgQgL2cs1XV7+LK0dKbz2Q5he Jog1n5VDi1jJFQmHO1xvOE9lge6vqzhlv1ALY7ekMQaQcQAEUFIjOBejmnvmW0BlA+4c 3Kqlb7Gb5BzeRaiXsqJrQk1y/+/AvFKcdiWfPuTEAXoMaxvKgUg5O5ywQCebMIoF4U31 J8UQ== X-Gm-Message-State: AOJu0Ywa8Q1YUqTkAWXLnekv1k+KglsVc8pZVqaR9Nig+FOybShsDvaD z9jJGwE3CiE4bJyIe522sdkRaNER9QGxiqIGSiPeaB9h2LikzRDn+ZM7+GnN+c7VLXik2h3pwK8 e X-Received: by 2002:a05:600c:1f18:b0:40f:b691:d3c1 with SMTP id bd24-20020a05600c1f1800b0040fb691d3c1mr7989569wmb.30.1707829505301; Tue, 13 Feb 2024 05:05:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWewp6QbmZBRyB9ZP50Ix24ln72h+9o3GfoTchBmrSG9YYrtu8X7YwYKKzK8Nyarl0LNYjb4Mt6sy+1lTJdNsISoG/eymbDRTu/HPyBL5PsaG6LCK48VdK4aN2bVAR8wXF9PHC/oVRKG3N1Uvqcd6J8buvAIjoT9rKFnfQmupegs/xWMdGkA6k+XropZF2qtVIOamCf4s40TwawBRJgXuV1FOu76CkBou0dfeahUsoJiNQ/EemXCx+CAZO+w8Fnl4mb4Eh4izT1u468gDGngtIuJAuoLuS999ShBFUWpRW6rq44d8NeJAlGpoZ+6joJQG/z8S+gdHpeTMlJgOB8/MOlQxgbNMLHLmf6kdTh4k3EEKV9RexrYdxqBEvsBNOTSsoOFTQ2xQ== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id ck18-20020a5d5e92000000b0033b7a2136a4sm7254044wrb.97.2024.02.13.05.05.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:05:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Artyom Tarasenko Subject: [PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices Date: Tue, 13 Feb 2024 14:03:41 +0100 Message-ID: <20240213130341.1793-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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 --- 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,