Received: by 2002:a19:5205:0:0:0:0:0 with SMTP id m5csp4449360lfb; Tue, 7 Sep 2021 00:04:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTfF7xKX/zNVGuxilfg1YV4PELQUhJ3bcsRLHcE3Xz0zpsE7vF/lvWR20gCmKrPBVWuuVs X-Received: by 2002:a92:d3c1:: with SMTP id c1mr11361269ilh.194.1630998269819; Tue, 07 Sep 2021 00:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630998269; cv=none; d=google.com; s=arc-20160816; b=UiMtCY8YnQP0hiRLZy/M/LULKzG0ckLodbw1l5ASbi0IEzyPIK+GO25gkHtk6DQmMb 5nJWxsBDnNumoE3FE2mjClwcJ1qcIkMpzP6I453Xgmzg8mhBPOnBHFB1prS1lzJjSGhd MQGSshBMa025mNRUxcXsD2YFmEppxbd/QywsX0zDVk6eYm9hxxNesphkoAphIcTCqsmG HMM2mWbNYFV2H0jb9fkTdyASVLWdQH/74ZH+/WXx+K/dLCJn/iRMT4bLzEiy9ZEeit1s yIIwirATwkB5UH77PKGwediF8LLRaS35CUZd6tQ+9+imF5b+AJYeWqF8OqH7eFLz74Kk Zn6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from; bh=03NJVDielnfy82EuBCk/kc9b6La+1DpRFOXyZ0T7ulA=; b=uqEc4b5BYHIqIUu8B7PIDnGtunDE0YAkhXy+rdO61zcRnGkYlbIW2Cc3G+VK13ZXJW a2a3B8676vqFnvyeGW9sQL9YqNOhV1zhnyHgQq3KY9HLqlsIstfUa0BlA9vdN+shrEAb xwzcvR+ex4MtjZoMSvy6UZ3kDQ4bYZv++uW9t1rAeaGi8fPw5NRTYTDeuls7HGuoffQQ LAnuQbkP+EfbYHDipQBi5YBM+sIn0xSYwB2tkOgMXYUAWS4KXt7pUVpTPXmJWXdXidx2 nXfsPj1RfSM96GwuzRI2BieQWxv7c64SCGe/T7qrD5cOy0h4jadLnbeND2GJczDz2xNx tROg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 j11si9181591ile.34.2021.09.07.00.04.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Sep 2021 00:04:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:37876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNV9h-0001p8-6z for alex.bennee@linaro.org; Tue, 07 Sep 2021 03:04:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNV41-0001Sp-G0; Tue, 07 Sep 2021 02:58:37 -0400 Received: from smtpout1.mo529.mail-out.ovh.net ([178.32.125.2]:45489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNV3z-0001J7-9E; Tue, 07 Sep 2021 02:58:37 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.1.114]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id 778EBBCB54E1; Tue, 7 Sep 2021 08:58:25 +0200 (CEST) Received: from kaod.org (37.59.142.97) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Tue, 7 Sep 2021 08:58:24 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-97G002152b913f-b4a7-4c63-b6dd-0efa343e6ce8, 984F41D2D9692A95DAA6D5E609006558D983FB00) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell , Andrew Jeffery , Joel Stanley Subject: [PATCH 03/10] aspeed/smc: Stop using the model name for the memory regions Date: Tue, 7 Sep 2021 08:58:15 +0200 Message-ID: <20210907065822.1152443-4-clg@kaod.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907065822.1152443-1-clg@kaod.org> References: <20210907065822.1152443-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.97] X-ClientProxiedBy: DAG8EX1.mxp5.local (172.16.2.71) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 7c00a608-9615-430b-b240-ce39fb9c8630 X-Ovh-Tracer-Id: 977562594908670825 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrudefgedgudduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhggtgfgihesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeehheefgeejiedtffefteejudevjeeufeeugfdtfeeuleeuteevleeihffhgfdtleenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopegtlhhgsehkrghougdrohhrgh Received-SPF: pass client-ip=178.32.125.2; envelope-from=clg@kaod.org; helo=smtpout1.mo529.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , qemu-devel@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: eOgeVgQNlCD0 There is no real reason to use this name. It's simply nice to have in the monitor output but it's a burden for the following patch which removes the AspeedSMCController structure describing the controller. Signed-off-by: Cédric Le Goater --- hw/ssi/aspeed_smc.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index b4d92d75a694..b6684d6f38d0 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -1391,20 +1391,15 @@ static const MemoryRegionOps aspeed_smc_ops = { */ static void aspeed_smc_dma_setup(AspeedSMCState *s, Error **errp) { - char *name; - if (!s->dram_mr) { error_setg(errp, TYPE_ASPEED_SMC ": 'dram' link not set"); return; } - name = g_strdup_printf("%s-dma-flash", s->ctrl->name); - address_space_init(&s->flash_as, &s->mmio_flash, name); - g_free(name); - - name = g_strdup_printf("%s-dma-dram", s->ctrl->name); - address_space_init(&s->dram_as, s->dram_mr, name); - g_free(name); + address_space_init(&s->flash_as, &s->mmio_flash, + TYPE_ASPEED_SMC ".dma-flash"); + address_space_init(&s->dram_as, s->dram_mr, + TYPE_ASPEED_SMC ".dma-dram"); } static void aspeed_smc_realize(DeviceState *dev, Error **errp) @@ -1445,7 +1440,7 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp) /* The memory region for the controller registers */ memory_region_init_io(&s->mmio, OBJECT(s), &aspeed_smc_ops, s, - s->ctrl->name, s->ctrl->nregs * 4); + TYPE_ASPEED_SMC, s->ctrl->nregs * 4); sysbus_init_mmio(sbd, &s->mmio); /* @@ -1453,12 +1448,12 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp) * window in which the flash modules are mapped. The size and * address depends on the SoC model and controller type. */ - snprintf(name, sizeof(name), "%s.flash", s->ctrl->name); - memory_region_init_io(&s->mmio_flash, OBJECT(s), - &aspeed_smc_flash_default_ops, s, name, + &aspeed_smc_flash_default_ops, s, + TYPE_ASPEED_SMC ".flash", s->ctrl->flash_window_size); - memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s), name, + memory_region_init_alias(&s->mmio_flash_alias, OBJECT(s), + TYPE_ASPEED_SMC ".flash", &s->mmio_flash, 0, s->ctrl->flash_window_size); sysbus_init_mmio(sbd, &s->mmio_flash_alias); @@ -1474,7 +1469,7 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp) for (i = 0; i < s->ctrl->max_peripherals; ++i) { AspeedSMCFlash *fl = &s->flashes[i]; - snprintf(name, sizeof(name), "%s.%d", s->ctrl->name, i); + snprintf(name, sizeof(name), TYPE_ASPEED_SMC ".flash.%d", i); fl->id = i; fl->controller = s; -- 2.31.1