From patchwork Wed Oct 25 08:59:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 737863 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp178841wrq; Wed, 25 Oct 2023 02:02:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvsTwbG9j4xsx04WQsWfrZ18KV/ZzvFL6Rmxy8rtYpHdh5fjEwipgFQcwW6sEtby3aWygO X-Received: by 2002:a05:651c:204:b0:2c5:22c0:582c with SMTP id y4-20020a05651c020400b002c522c0582cmr10042110ljn.11.1698224539215; Wed, 25 Oct 2023 02:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698224539; cv=none; d=google.com; s=arc-20160816; b=l+cVC1ibq9gIzBXTZBDSCKKiRZXElS16XK8/yHzTq512rTwB0BWUujwjqcbFz2QNjF W1xCC2V+7SFLccgk4pNJRMWA8Csgls8XzfrZ46cefdtKFFiOhfihJVv+Let0NgE6wFsO KIZDhw59JqRQUdjt8Eo4BwXJLMXMTjDMtMi4I1C1F0l0Glx+/ITxpcnf0Dtns+OrHax8 ETwLbv/dDx2w4l7xr+arblx7SslhoSb0bXW+qn3JSjEdce8oEVQSkIlhZrvSuXiKlp5q jLNo3qIJQUQCDB2PSU8UxY2FKDuyBBRnQVLeg3py6mUtDe+yzEgIvNLUSNCp4qU9nK9s 8snQ== 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; bh=0uD0KVJq+dJcbbQ8RmRBgAFk1waL97XSi4IS4aQx+HE=; fh=2AKgK1B3EYiX6882ovZW+CwIStVbar5zReCRX1lYnfY=; b=NbT+dZ9lZupCI3mkWd5JL3+YCppZ5+73QxRiIx1odOqNx6ClfGVB/I95A9pG1C7Tep 1Q2m7XRv4rOBMr6/T2fxwvQgDrmON3YoHO5Mj1b9dc/dzKWZThMSihRKTqYir8nTfslw 2Z0uVofwqEWvnA5Bqft+oV+YkBw9nS+bPOV+agAr/E3fcGuYvYvXqLRF2pIimCHPNJNb hcHsrz/17FBtMoaCYbZ5m6iHJPkZs8XYhAnL4u/Fvj3YCuhqNjQKkbQPJkBJ7PNsy+y2 f0674UD3IHN7L5iVUpOcWJKKsDvUEHonLhEkHtIhxsAWJesuoe79ooNOYn36fYgS2Len khPw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t13-20020a05600c450d00b004052f798ae8si11005295wmo.151.2023.10.25.02.02.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 02:02:19 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvZkT-00007r-Co; Wed, 25 Oct 2023 05:00:21 -0400 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 1qvZk9-0008Eg-83; Wed, 25 Oct 2023 05:00:05 -0400 Received: from gandalf.ozlabs.org ([150.107.74.76]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvZjv-0004U0-AQ; Wed, 25 Oct 2023 05:00:00 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4SFjYG2Vjzz4wd0; Wed, 25 Oct 2023 19:59:46 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4SFjYD5j1cz4wnw; Wed, 25 Oct 2023 19:59:44 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Subject: [PULL 09/12] hw/arm/aspeed: Check 'memory' link is set in common aspeed_soc_realize Date: Wed, 25 Oct 2023 10:59:18 +0200 Message-ID: <20231025085921.733686-10-clg@kaod.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231025085921.733686-1-clg@kaod.org> References: <20231025085921.733686-1-clg@kaod.org> MIME-Version: 1.0 Received-SPF: pass client-ip=150.107.74.76; envelope-from=SRS0=4l40=GH=kaod.org=clg@ozlabs.org; helo=gandalf.ozlabs.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- hw/arm/aspeed_soc_common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/arm/aspeed_soc_common.c b/hw/arm/aspeed_soc_common.c index b66f769d1807..828f61093bfa 100644 --- a/hw/arm/aspeed_soc_common.c +++ b/hw/arm/aspeed_soc_common.c @@ -114,6 +114,16 @@ void aspeed_mmio_map_unimplemented(AspeedSoCState *s, SysBusDevice *dev, sysbus_mmio_get_region(dev, 0), -1000); } +static void aspeed_soc_realize(DeviceState *dev, Error **errp) +{ + AspeedSoCState *s = ASPEED_SOC(dev); + + if (!s->memory) { + error_setg(errp, "'memory' link is not set"); + return; + } +} + static Property aspeed_soc_properties[] = { DEFINE_PROP_LINK("dram", AspeedSoCState, dram_mr, TYPE_MEMORY_REGION, MemoryRegion *), @@ -126,6 +136,7 @@ static void aspeed_soc_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); + dc->realize = aspeed_soc_realize; device_class_set_props(dc, aspeed_soc_properties); }