From patchwork Tue Oct 24 16:24:19 2023 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: 737542 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp2124589wrl; Tue, 24 Oct 2023 09:25:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAHQRZAA2taHWzljfRM2OFdO9D+E7/N2g2/gAWIRYrHOBUL7BrNfPMrvYZD59h5w0WMms2 X-Received: by 2002:a05:620a:19a7:b0:76f:f0b:a1ba with SMTP id bm39-20020a05620a19a700b0076f0f0ba1bamr13937899qkb.30.1698164742523; Tue, 24 Oct 2023 09:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698164742; cv=none; d=google.com; s=arc-20160816; b=PryGAe2gvqEAhP+WdD7L8zUUVO60SMGKG7MVDSdEexA3bEYvf6Cfi8But1cAlgRjtJ Cdztv18BdULwF22bqpqZvSuWmswvNbK/Ic22XVpwxo0Jpz4fqX7Sx2/bKn22YuoTyqq6 /4XZgYc7SAOhKRKoxf2SmK1317ZzXri3vPByoCnjHaYnUlCoc0gF4Cn/tOgDN4xgyQJ9 Aa/mJvStGszDPo+PLHAXFrawf9RINF2HxeKfSY0GxTpvAFaMwf1uORVOuCUcWA7xEd20 Cv3zhb6YS7mqGeLqP3HuS11LyEOc9VpzrjrrKjCCxFJE2fKDuOdVw2EUrCY3OrFkdsgU N5+w== 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=xBLyy7Cf+oXVlWV7APmJwsDD8O0kUea2KuFgfmlS14s=; fh=WVEKgOIyTrr8n58k2pegoTwEDRNm1XlZWphDTwgTwzs=; b=SNzjfNn5yyj3o0SFo4+A0291mYpxhU2kCvYvxhfWg4jyKht0uB9qds0LYJljHhXu3f SUK0/95jihuP7IzK3mjthkzF5HcWhxlL53QmzK45jllmrouemKpFDQvHmdhcS3jD3Zyy mSwnHR42Le6NO1uCtM80m3AwIf9IJybDFTPjsJ8D+vZpEsgbPyWvRM/3qcltj5Pe01Ws Yxmioz261xYB9daQVyFcWyKsNwZwu1A74XKhM3iG7e3tgscvOuADLBpnaiKwXCC+hNjh lAW/CE3sWK4phjo37j5Oc6tpQeC0zKjluLlQ2QB1rFU9OliWPcKPVTr11eiM0f38MonL /tDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iX41Fdk1; 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 m12-20020a05620a290c00b007752bd6a25bsi7082711qkp.320.2023.10.24.09.25.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 09:25:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=iX41Fdk1; 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 1qvKDj-0002F1-VO; Tue, 24 Oct 2023 12:25:32 -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 1qvKDW-0001hq-9d for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:25:21 -0400 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 1qvKDT-0001Eo-0j for qemu-devel@nongnu.org; Tue, 24 Oct 2023 12:25:18 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-408425c7c10so38874505e9.0 for ; Tue, 24 Oct 2023 09:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698164713; x=1698769513; 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=xBLyy7Cf+oXVlWV7APmJwsDD8O0kUea2KuFgfmlS14s=; b=iX41Fdk18oWV3fz6hHWrpH6sNMs1QXAOxgBcnYz2+4DgHWq9jDzKx+j1ziNnXtLGKi ON0KYKt/LH4mRdgqkt3WAe7SJTFC1GAzdXJ+ZgIu7e0MV4yWyXgmrITD2oYyCs0P2JuK Yaf3Q6geTsgMWk9y8JWPTp6QsMugUN0hT8jLjy/zcKsx4eUbrTgmefslvXeesQq/HutX oAKEBAAt/sNsNKbjTinKZiWgNF8zvuSfVWXv8QOKuJghj3ydEUXo4DJejY2hveLta+K1 iROVrXXmqP36paJ1CyeGgf9DlIAsyzHnQYkCzaQx+T2DfUdfRZRxGtDWH2vIYZK1VCvB RJuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698164713; x=1698769513; 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=xBLyy7Cf+oXVlWV7APmJwsDD8O0kUea2KuFgfmlS14s=; b=J+y2pcmiovwO1svljZIVRZKgRC4pzdmu3tsYg86ycgy5sDBYLdu94ryD2CEnOwO5tt SaPYs/hgE+4i+22JUzFmxrRgDxTYTFo62w/NMYSNnP/1x3wcdEOogxk2orUnvz/o/4dE TNWWsfITlShopidrdmigxJHH//GQW0MUuL8rfOnpOQGfxMBv33DLHkLItk2DLz+vNVGB wJSAdRH1I73bUk4VJHVaPMnDta0FhhibBSEEHVnuoVl4b44YWimw6L0iKSfvpIxSziqo SWkXnv/NYki+UbmVXMJh5kt50mvJD1Cp4NaDakTRJ+i3jrvCk5DDOT23PxD9HK500cOe HgQQ== X-Gm-Message-State: AOJu0Yzz4zo3qrZcWRdhwFyYzXjW5k3TeLp3Z29E6ZnDWG3ufvIaW0Xp tMlQthNVSkkYqTWZIo6m81YUCJ8jLUatYxxIJf4= X-Received: by 2002:a05:600c:a07:b0:405:3251:47a1 with SMTP id z7-20020a05600c0a0700b00405325147a1mr9354995wmp.40.1698164713328; Tue, 24 Oct 2023 09:25:13 -0700 (PDT) Received: from m1x-phil.lan (sem44-h01-176-172-55-165.dsl.sta.abo.bbox.fr. [176.172.55.165]) by smtp.gmail.com with ESMTPSA id g14-20020a05600c310e00b0040813e14b49sm17205378wmo.30.2023.10.24.09.25.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 09:25:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Joel Stanley , Peter Maydell , Andrew Jeffery , qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dri?= =?utf-8?q?c_Le_Goater?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 08/11] hw/arm/aspeed: Check 'memory' link is set in common aspeed_soc_realize Date: Tue, 24 Oct 2023 18:24:19 +0200 Message-ID: <20231024162423.40206-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024162423.40206-1-philmd@linaro.org> References: <20231024162423.40206-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 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-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 b66f769d18..828f61093b 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); }