From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable 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 802C4C43381 for ; Thu, 28 Feb 2019 17:43:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 53698218CD for ; Thu, 28 Feb 2019 17:43:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="axdyRxsf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53698218CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UgfvgXHjHOZ9YuHKsNePHlZeels4hFBVYBWT2TigHR4=; b=axdyRxsfU38LAs 2DuyQTolZ1Ide+cAWJg2bijirCKek9NjyogDUgWHvDgwa9qnimHdArS2fxVQmuG32xQSQ+O8g+sfZ 9JHKOhu/aDEFdpTpYigi9YI2h6uXvDgY95jKRdAQFxOptaNvuZFeYT/7CJ1oZnYaae3FSi5uZsqRJ 8IhCFTwDBnMAGfLnk2vZd+BFXo5S91UzZH//FoCPONdcOBFpdF5KC91t7106QaXaX3oB5ltj44wt4 Vr89f8kKhTHB9XNQny0am6AOA7EROft0KYaQgb2iIEnpns4QHgGVW8YDN17Q5Tqr66kUpWN8YgtM3 BSO1ghfSWxUON5Dh6PBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzPiA-0002od-1c; Thu, 28 Feb 2019 17:43:10 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzPi6-0002mJ-TV; Thu, 28 Feb 2019 17:43:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E1A55EBD; Thu, 28 Feb 2019 09:43:04 -0800 (PST) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.197.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CD9713F720; Thu, 28 Feb 2019 09:43:02 -0800 (PST) Date: Thu, 28 Feb 2019 17:42:57 +0000 From: Lorenzo Pieralisi To: honghui.zhang@mediatek.com Subject: Re: [PATCH v3 2/2] PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM Message-ID: <20190228174257.GA26501@e107981-ln.cambridge.arm.com> References: <1548999367-11733-1-git-send-email-honghui.zhang@mediatek.com> <1548999367-11733-3-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1548999367-11733-3-git-send-email-honghui.zhang@mediatek.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_094306_959244_AE719792 X-CRM114-Status: GOOD ( 16.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, ryder.lee@mediatek.com, poza@codeaurora.org, fred@fredlawl.com, linux-pci@vger.kernel.org, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, jianjun.wang@mediatek.com, linux-mediatek@lists.infradead.org, bhelgaas@google.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 01, 2019 at 01:36:07PM +0800, honghui.zhang@mediatek.com wrote: > From: Honghui Zhang > > The PCIE_AXI_WINDOW0 defines the translate window size for the request > from EP side. Request outside of this window will be treated as > unsupported request. > > Enlarge this window size from fls(0xffffffff) to 2^33 to support 8GB > translate address range then EP DMA is capable of fully access 4GB > DRAM range(physical DRAM is start from 0x40000000). I have rewritten both patches logs with the aim of merging them even if it is quite late in the cycle, first you have to explain something to me. fls(0xffffffff) = 0x1f, which by your logic -> 2^31 What does it mean given what you say above ? That PCI devices can't do _any_ DMA in the current setting (given the DRAM start address) ? Lorenzo > Reported-by: Bjorn Helgaas > Signed-off-by: Honghui Zhang > --- > drivers/pci/controller/pcie-mediatek.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c > index c42fe5c..0b6c728 100644 > --- a/drivers/pci/controller/pcie-mediatek.c > +++ b/drivers/pci/controller/pcie-mediatek.c > @@ -90,6 +90,12 @@ > #define AHB2PCIE_SIZE(x) ((x) & GENMASK(4, 0)) > #define PCIE_AXI_WINDOW0 0x448 > #define WIN_ENABLE BIT(7) > +/* > + * Define PCIe to AHB window size as 2^33 to support max 8GB address space > + * translate, support least 4GB DRAM size access from EP DMA(physical DRAM > + * start from 0x40000000). > + */ > +#define PCIE2AHB_SIZE 0x21 > > /* PCIe V2 configuration transaction header */ > #define PCIE_CFG_HEADER0 0x460 > @@ -713,7 +719,7 @@ static int mtk_pcie_startup_port_v2(struct mtk_pcie_port *port) > writel(val, port->base + PCIE_AHB_TRANS_BASE0_H); > > /* Set PCIe to AXI translation memory space.*/ > - val = fls(0xffffffff) | WIN_ENABLE; > + val = PCIE2AHB_SIZE | WIN_ENABLE; > writel(val, port->base + PCIE_AXI_WINDOW0); > > return 0; > -- > 2.6.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel