From patchwork Thu Nov 2 01:30:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740376 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595283wrv; Wed, 1 Nov 2023 18:38:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnttrDpeBpZ3+4Megv/qBNen+/HWmLQzW3ii1opsJ0uXn7kUY/0gX095rCrGsd4A5m6XnB X-Received: by 2002:a05:6214:27cf:b0:65d:4840:6eb4 with SMTP id ge15-20020a05621427cf00b0065d48406eb4mr21108317qvb.6.1698889105407; Wed, 01 Nov 2023 18:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889105; cv=none; d=google.com; s=arc-20160816; b=TCgg7bqvfMi5Ht/zZMaagqvz4b7rbWo+TyNiWiECEG/SUhIbMhBxtc3YqdGvxp8vqz whL28GuhvWHfsajJEBXa1r6TDrdqrNPj8MtTAW85biSAItGO/snM7NnhMWZn71nun/1n dF8lkAsUvHvKEyX/Hh7qTr4Veu7xOe4fmm4VgmOH2V1Z6p6r2cupmqr/ugvcg5j8u09e vqCRkbLc9CaS3qDZ3xJK2JFmlfC1Uh2cwgGPK/OLzkwidN71kSA5itE5djt1aUZu7i1L L/FkQX2cU70/ZlROgbY9qbREu33oI3Wh9Gpr13nzFhDsXnJuX0OPTbhzzR/NIiLRYdTP qORQ== 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=jCD7MGoBGBvFUMEqCraVMyK1zfse2SsJ+vuTkGcLU/A=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=HuJ0ZMCzPOuNPlSa1HHU8QVEB05EI9QF0hpbumUV1P3neqYkrurRGI3/WXY67SIfiJ mVcWH1aS9BznGiP6VxM4SS5Rd2eOGMa0EJe6GzCU8AZux4/Uqy/Pxxplc0hs+tKAy5Br Y2+tT/5/GLC//cuC2TrwYDJfqTtaU4VMjT4NiDHyDzvk6LMOE8X1UbzfPnbnJzUx1E4O 20RJ3wH1SQahHWbt482QmbMK0JZI4yQ/08ho3fKcao6LgJ9qqkKx9kvBZM23ftT9Z/CH uF6sUFUSQyDkMlSLWjj44ymWH46ZBtsVOjLDpKuLE7RPMs+qnqrEtJIuCzgqoC11BUq7 Xggg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pXbvUGGe; 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 h6-20020a05620a284600b0077736eb9fc4si3597256qkp.4.2023.11.01.18.38.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:25 -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=pXbvUGGe; 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 1qyMeT-0006zf-4w; Wed, 01 Nov 2023 21:37:41 -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 1qyMeM-0006Js-Fl for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:35 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeI-0004Iv-An for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:33 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3b565722c0eso256826b6e.2 for ; Wed, 01 Nov 2023 18:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889048; x=1699493848; 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=jCD7MGoBGBvFUMEqCraVMyK1zfse2SsJ+vuTkGcLU/A=; b=pXbvUGGeg02hjluVnLmUvDp630W9vnY7IqPmSawJzk+RKjr+W12p+O2RfsDMmgSdFB VTpLAPQ0rHdQb8ljo1QnAGupaPrLH/YoP7LkbD4mYME9QW82rkMUMbqaSGZnf6hs5IHA 5p5AOIOjIbhPk2sxytaBS7JcfW/zQmQPNjK7OUfXEzV6o1hIoJ4nkVD0BubpDVRV6dhd zHOW3J4SmOcWxbB9T8VRVSm0nUV1LQ0gPbKRSQFTwAPVKrOxp9ob72oiwkSbUXAz56lx sz0688foefsze5ARitC4DoK/Tg9LHloxOqhmS7jlep5lcukyFiff7yDJ84+9K3PWgksg DVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889048; x=1699493848; 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=jCD7MGoBGBvFUMEqCraVMyK1zfse2SsJ+vuTkGcLU/A=; b=ITlw+cZlaka+eMTH5YSaS49zwvhASukiwIpUccZPhyhMmBxQGSngIhAeuRalzuMv/y j6r3r4NgRcJpl5EmUWhqm2wSOHzw6rfpdlDr44TrueHEvj53LWoIZ5ZowfrZKUmPyT/7 ePxLyp6qLd6nZSVZ9fB25xzY4vrFQFtwmhVYzkaXlM1gms8AoLE4ENGR9wO0c/OEBz40 xU3CyZEBjCIeYpZmQBPn8ChbvfMXyGa5XwEeudadsURsKVlFhfZ9eeKg9w4SeJUXwz4B /F22mtsaeDulDMdYIB3tCZbRczkI4B1d5UyMy/NV9e4b3mjZfQiXA+HLZx4yqxead3mk xgnQ== X-Gm-Message-State: AOJu0YxV6TrpTaxRcUc7WTuRVgHPgkabAmieAUPskYxeaKXAKuiEqvtg m+9M8LDwXGYxWkrL70tNNCopTGBMxdKSL7F+qa8= X-Received: by 2002:a05:6808:19a5:b0:3a8:f3e7:d691 with SMTP id bj37-20020a05680819a500b003a8f3e7d691mr22622485oib.37.1698889048782; Wed, 01 Nov 2023 18:37:28 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 84/88] hw/pci-host/astro: Map Astro chip into 64-bit I/O memory region Date: Wed, 1 Nov 2023 18:30:12 -0700 Message-Id: <20231102013016.369010-85-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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=ham 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: Helge Deller Map Astro into high F-region and add alias for 32-bit OS in low region. Signed-off-by: Helge Deller --- hw/pci-host/astro.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c index 4b2d7caf2d..df61386bd9 100644 --- a/hw/pci-host/astro.c +++ b/hw/pci-host/astro.c @@ -19,6 +19,8 @@ #define TYPE_ASTRO_IOMMU_MEMORY_REGION "astro-iommu-memory-region" +#define F_EXTEND(addr) ((addr) | MAKE_64BIT_MASK(32, 32)) + #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/units.h" @@ -821,15 +823,16 @@ static void astro_realize(DeviceState *obj, Error **errp) /* map elroys mmio */ map_size = LMMIO_DIST_BASE_SIZE / ROPES_PER_IOC; - map_addr = (uint32_t) (LMMIO_DIST_BASE_ADDR + rope * map_size); + map_addr = F_EXTEND(LMMIO_DIST_BASE_ADDR + rope * map_size); memory_region_init_alias(&elroy->pci_mmio_alias, OBJECT(elroy), "pci-mmio-alias", - &elroy->pci_mmio, map_addr, map_size); + &elroy->pci_mmio, (uint32_t) map_addr, map_size); memory_region_add_subregion(get_system_memory(), map_addr, &elroy->pci_mmio_alias); + /* map elroys io */ map_size = IOS_DIST_BASE_SIZE / ROPES_PER_IOC; - map_addr = (uint32_t) (IOS_DIST_BASE_ADDR + rope * map_size); + map_addr = F_EXTEND(IOS_DIST_BASE_ADDR + rope * map_size); memory_region_add_subregion(get_system_memory(), map_addr, &elroy->pci_io);