From patchwork Thu Dec 24 03:17:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 11989219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2DDCC433DB for ; Thu, 24 Dec 2020 03:26:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E791224B0 for ; Thu, 24 Dec 2020 03:26:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E791224B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=flygoat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ksHGZ-0000tv-6v for qemu-devel@archiver.kernel.org; Wed, 23 Dec 2020 22:26:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksH96-0001WY-Kd for qemu-devel@nongnu.org; Wed, 23 Dec 2020 22:18:32 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:56103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksH94-0003db-Vf for qemu-devel@nongnu.org; Wed, 23 Dec 2020 22:18:32 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 8089558037A; Wed, 23 Dec 2020 22:18:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 23 Dec 2020 22:18:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=qqFEscVG+bgxX D41y6VOa/Ihx+II+1KvEVbjUp3LV4E=; b=ylu/DWTp1xNp8FEwUWyCo6Ag2LX2z qXKoZhr7gXhjvA66heXHis2Q6nIuotB5cHWXWSjKCaCLhtWnMUgk/yfsxNT5+zE0 DD2w7dE97/ntI0QL40p/4zyU7A8royJ/R8RlBg5yCei9jUpVHpH6rIEwCC9dtF2J C8xs23qMGhprqHdPXKx1C/jZafPNu63zyWP/sEaj3dYE+KKKHV1di+u4MxNuXX1+ 8JX7FpkEVj71+24KLe/GEk2K2d/h8WX3TEk6npw/FMehGUKzfkoU7p3QL7PYhc7R GOHOK37hdue9aENyBlfuyD6O+Q8Oh72iAyjNBiCo3AjCqmupmnwyigiEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=qqFEscVG+bgxXD41y6VOa/Ihx+II+1KvEVbjUp3LV4E=; b=RWdPskv7 lnWghvYbek9srSlqwdmSXXtO22LGnrMLONSfwZ//o4dOEdQ4KMAt2kGSakOQcr87 78nGaarnjgKqXuQDrjPL6seF8OtU/nj0a9ziDWgcdH8WCypcrvxMvQ6BPgOgyPCa MACKiIrSVhYeyN39KzwQCXiRONAL9XMw5IkKGVOsX8D3gFBVfm2p58wmEoXdvP8I E7QqgrLltyvijnV2ONFoMThKShBe458HKnBvU+35zo8B/+cdyicb7jvMcH8kmQso 4uBRzAnyiRtF9n0bHvAS1egACSLpNpbGv/pLyC48S/xy/HAALSH+qLs05y2cdHfA FflPZCzdUt/dFw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtkedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeflihgrgihu nhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqnecugg ftrfgrthhtvghrnhepjeeihffgteelkeelffdukedtheevudejvdegkeekjeefhffhhfet udetgfdtffeunecukfhppedvvdefrddutdegrddvuddvrdehleenucevlhhushhtvghruf hiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhm X-ME-Proxy: Received: from localhost.localdomain (unknown [223.104.212.59]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E1E51080057; Wed, 23 Dec 2020 22:18:25 -0500 (EST) From: Jiaxun Yang To: qemu-devel@nongnu.org Subject: [PATCH v3 4/8] hw/pci-host/bonito: Fixup pci.lomem mapping Date: Thu, 24 Dec 2020 11:17:46 +0800 Message-Id: <20201224031750.52146-5-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201224031750.52146-1-jiaxun.yang@flygoat.com> References: <20201224031750.52146-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Received-SPF: permerror client-ip=66.111.4.229; envelope-from=jiaxun.yang@flygoat.com; helo=new3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-0.001, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Cleber Rosa , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The original mapping had wrong base address. Signed-off-by: Jiaxun Yang --- hw/pci-host/bonito.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 3fad470fc6..737ee131e1 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -85,9 +85,8 @@ #define BONITO_PCILO_BASE_VA 0xb0000000 #define BONITO_PCILO_SIZE 0x0c000000 #define BONITO_PCILO_TOP (BONITO_PCILO_BASE + BONITO_PCILO_SIZE - 1) -#define BONITO_PCILO0_BASE 0x10000000 -#define BONITO_PCILO1_BASE 0x14000000 -#define BONITO_PCILO2_BASE 0x18000000 +#define BONITO_PCILOx_BASE(x) (BONITO_PCILO_BASE + BONITO_PCILOx_SIZE * x) +#define BONITO_PCILOx_SIZE 0x04000000 #define BONITO_PCIHI_BASE 0x20000000 #define BONITO_PCIHI_SIZE 0x60000000 #define BONITO_PCIHI_TOP (BONITO_PCIHI_BASE + BONITO_PCIHI_SIZE - 1) @@ -610,7 +609,7 @@ static void bonito_pcihost_realize(DeviceState *dev, Error **errp) { PCIHostState *phb = PCI_HOST_BRIDGE(dev); BonitoState *bs = BONITO_PCI_HOST_BRIDGE(dev); - MemoryRegion *pcimem_lo_alias = g_new(MemoryRegion, 3); + MemoryRegion *pcimem_lo_alias = g_new(MemoryRegion, 1); memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem", BONITO_PCIHI_SIZE); phb->bus = pci_register_root_bus(dev, "pci", @@ -622,9 +621,10 @@ static void bonito_pcihost_realize(DeviceState *dev, Error **errp) char *name = g_strdup_printf("pci.lomem%zu", i); memory_region_init_alias(&pcimem_lo_alias[i], NULL, name, - &bs->pci_mem, i * 64 * MiB, 64 * MiB); + &bs->pci_mem, BONITO_PCILOx_BASE(i), + BONITO_PCILOx_SIZE); memory_region_add_subregion(get_system_memory(), - BONITO_PCILO_BASE + i * 64 * MiB, + BONITO_PCILOx_BASE(i), &pcimem_lo_alias[i]); g_free(name); }