From patchwork Fri Jul 5 09:56:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 11032759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53FD214F6 for ; Fri, 5 Jul 2019 14:36:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D96E28AB1 for ; Fri, 5 Jul 2019 14:36:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 311E928AB9; Fri, 5 Jul 2019 14:36:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C58E628AB1 for ; Fri, 5 Jul 2019 14:36:15 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rKr9+Omh9erfLC6PF8CpWT9bQxNeQ1VPhbSYUK/OQqE=; b=ZdPC5p3z8ECjj3O+lONg7sscGQ 2bMrzFES6JeVHuD3G0xyYO6eZxgf7Rx9bOsJXBd6swbV69ARW1YmEuk3g7rUf4Y4VId8WvJCu3W70 mY+JfSaQOLSZoVnaaRxIeXXnAj9voTckVqse4jrKfx0pXVNQWeJPpNQlRy8DPYdW+8BSXlI8qobpI PUtIhcOTRmPT7kcNMBAJnL3HpZr+cW8gLyVvZiTlxiWIqgNlpjJuRlu55SGE1mxE1oHMjq85re39x dh5YDbbBg5Cpl+gKvEEhnMLzt+JA0mmNMOGQAR0PzO+0FDnUMIsuv3HDaCybvxYHspkMOlm6x334z zHhsT9Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hjPJv-00060Y-C7; Fri, 05 Jul 2019 14:36:15 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjPJt-00060P-Lr for linux-arm-kernel@bombadil.infradead.org; Fri, 05 Jul 2019 14:36:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=O8V50QXHPf+EjaFRCPThxPab/CiXjNQ1aww2AUNWfUA=; b=Kvu0YhI2yr/G01baMKAbN6Qgp HuQAm+HE7uUXmcM/jdnmzWT/OHgbnlKvugmQ9u3ZXCvrlHuICPhTrJfrNRoU9opLh6MGqjwGzPLlU 2ZEn+yZKu+qAVByDOQGvcb/x5rMqbwqwINEq8mS/s6RyAtuuDbVLKLFZ0HHxBZHVS59WB0hmH7osZ 1Rpe1EH9316nNtnjUDmnDty5C7Mk0RcZ3pY8tm97cGXwvvFUvf2nw3ti73KllmCGI/rcraInDggam AwIm+secr046a5weYzmrYi+inOyZPKhugAX4kjp8uEryeGgbR50HN6JTrCp5XFgrYyD6VUV6GbgMY hAxFN1kXQ==; Received: from inva021.nxp.com ([92.121.34.21]) by casper.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hjL84-00024I-Gc for linux-arm-kernel@lists.infradead.org; Fri, 05 Jul 2019 10:07:46 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 50AFF200E8B; Fri, 5 Jul 2019 12:07:08 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C73FF2001B2; Fri, 5 Jul 2019 12:06:59 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id E29EB402EB; Fri, 5 Jul 2019 18:06:48 +0800 (SGT) From: Hou Zhiqiang To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, robh+dt@kernel.org, mark.rutland@arm.com, l.subrahmanya@mobiveil.co.in, shawnguo@kernel.org, leoyang.li@nxp.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCHv6 03/28] PCI: mobiveil: Fix PCI base address in MEM/IO outbound windows Date: Fri, 5 Jul 2019 17:56:31 +0800 Message-Id: <20190705095656.19191-4-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> References: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190705_110744_597593_DB79D2FF X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Minghuan.Lian@nxp.com, Hou Zhiqiang , Xiaowei.Bao@nxp.com, Mingkai.Hu@nxp.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The outbound memory windows PCI base addresses should be taken from the 'ranges' property of DT node to setup MEM/IO outbound windows decoding correctly instead of being hardcoded to zero. Update the code to retrieve the PCI base address for each range and use it to program the outbound windows address decoders Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V6: - Rebased the patch, no functional change. drivers/pci/controller/pcie-mobiveil.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index e581902..53df317 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -621,8 +621,9 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) if (type) { /* configure outbound translation window */ program_ob_windows(pcie, pcie->ob_wins_configured, - win->res->start, 0, type, - resource_size(win->res)); + win->res->start, + win->res->start - win->offset, + type, resource_size(win->res)); } }