From patchwork Tue Nov 7 03:04:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741831 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1421708wrr; Mon, 6 Nov 2023 19:14:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFb0K17IeF3uMUzWK3rkmIIOjCMDrxmhnIpyS+cqAHdqywu/3cPV2JoBU+8ifZLX+MkyWwU X-Received: by 2002:ac8:7d8e:0:b0:41e:1d15:69a6 with SMTP id c14-20020ac87d8e000000b0041e1d1569a6mr39571706qtd.31.1699326848954; Mon, 06 Nov 2023 19:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699326848; cv=none; d=google.com; s=arc-20160816; b=HiG9ffHTGWAOPFYx5UxKkhq84xj8Z04ocRwBfP83tdh1HWscWsBhu2cQF3DeYKkAaO E9RQ5N9rFAgHd1cCaZRenXLmStV/i7iUY2SBbjdmwzy6d6o7vy4oLMc+TW6BeO+jfGIU Yalg7di8PhlFjcOHLsYDyiKSsywcomgHv6WneMgTITIY3T2ynLAnEFsK1BYseMGI5Ji2 Ux3iBcTExRtPKC3Y3ddh817epXU9hAHh4JlGsjHRrpXMy2rimvfMYiaUo7idPK9HCotK sn9b+gRTuABg4RaE7ftgvWnsZNU4WktPjw/Ai6xNZX1MOv4FXbWy2qtmzvW//GgPDMB9 So3A== 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=wDljmxUHXfz9MGj2//jPHYRc53BMWF157v8rVKELrf4=; b=BCCaOxAUT2nQdiKXOFKEa32DkPoL6O38QL4sL0mJ9oOs3PEY8885NvmvFrz40grM2Q L92fz/xR+y8YJUwITX81z9+Sh+NnoA07fYaeAwIC3nSqUCu7MrI36qc7nVKFZvJ0a6L3 O4ZCeNcPJJgvlOTQ09sKTasGJDxs2Qb81V8PBEkOKK+D17X8GWkUBcS9/UD54iZtrtaI Etm8pxgIKxX035uVMsBZtL7pEZ10A0VbSfTiu+tSq6evw1ZhxGnHpv4vMysVu2ILjk4j 4Gm3OnqhfuPhRvKH5pFz5ag2Eoul+jJ7WxfpMy7uCI9xJwI2HLSQ9RZezXTnfcIhKX0h Vkzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aQZuV2JN; 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 q20-20020a05622a04d400b00418058ecc68si6280736qtx.280.2023.11.06.19.14.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 19:14:08 -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=aQZuV2JN; 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 1r0CUk-00064Y-HF; Mon, 06 Nov 2023 22:11:14 -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 1r0CUj-0005y1-3f for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:11:13 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0CUh-00025E-DK for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:11:12 -0500 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5b9a7357553so4043096a12.0 for ; Mon, 06 Nov 2023 19:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699326670; x=1699931470; 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=aQZuV2JNvVTvJVCz5CKy+yPJBlDVAX7d6Ko9Gp4YLhk6eX0aH17/4OwHK8D6uHk1aY nQOWrqazJqlxQ+/AD7Y4M/Ld/88mwSeIrmgypi9WxTzWlO5fN6fPCYmfKsX8JdU5T4Ct OIgBwAn1vLVUNW3A/mPrfb7aniZ4iwWZ68XgA9+LwLKqWZMtPXh/4feQvR26YIynwJXD TuRY/S6o34DdIqVcsVoPZgjtOQX3emToImuiPGL5xFKHUYa9h4PBA2I866bKf25LPL79 bffZNk2dGbABUEaR3dz6i8tmKVfGByD7+UplWOdTxQR12lBcT0Pbz/YTLZ1KSrlmXyuV FFcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326670; x=1699931470; 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=tZJe1er7iXGgViSjeBVSgOlszjCd4zYHfKGb6qjrMLLiI23MP8EKBX1u5AkmjW525u Oy7c8phFQXfC9r/AJ1uqbUeMnTb84lpBJMwfyviXnoGEtOgYH7ThKvILgeXoughkJ6tw ibH2nICuJRS+oNdlBz8CVAR7K88B7AvC+alartExMPG6OQs/Ylstf4KprGfKAfkSfnu9 dxMmdVvZu0oCp+3nlQ2qPCok1kcTyjOHO65vEatgDELIbJNhnD/yXWiS+69alJ8yybs5 kf+JO6i9DQtysuxo+mZRK9i7dxBcFJAbecSsGo0PZyufnSEInlQztgl57EudmtQ2UIOU xiLQ== X-Gm-Message-State: AOJu0Yy94WE5TtTolbrGXzL4ehFNrzhN8GjxYnOuNcnY9tIIzG8/XgKJ UIc1W+BjE/nXec1CdvBSgVpHF7BLsmYNsdOypOY= X-Received: by 2002:a05:6a20:12c4:b0:181:275f:3b4f with SMTP id v4-20020a056a2012c400b00181275f3b4fmr18542685pzg.11.1699326669931; Mon, 06 Nov 2023 19:11:09 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id gw13-20020a17090b0a4d00b0026f4bb8b2casm6246253pjb.6.2023.11.06.19.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:11:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller Subject: [PULL 82/85] hw/pci-host/astro: Map Astro chip into 64-bit I/O memory region Date: Mon, 6 Nov 2023 19:04:04 -0800 Message-Id: <20231107030407.8979-83-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231107030407.8979-1-richard.henderson@linaro.org> References: <20231107030407.8979-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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);