Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3174244ybi; Fri, 5 Jul 2019 03:09:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIGAsP3R6g58RTIeWYqYUcAOPwZh2dtW3Fl1CtnJuSx9eU18l7LkRDUQudo9QzDD+2mPhh X-Received: by 2002:a63:5212:: with SMTP id g18mr4288183pgb.387.1562321393947; Fri, 05 Jul 2019 03:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562321393; cv=none; d=google.com; s=arc-20160816; b=rfCpuQxp/+92wWzgaeqSaXJXSJJQrOmVTgTwkq+Eet2t61ZUvOufAqNV1p5TOaAX7I HblmF4uvyjlpg40+US0ise17AjsddIJ+R62uKRUB9OlMGWHf4BgNl+kwpA01vj4rnOUr SKtQDjxFX4cNxCof8iw9XiZQTPz2KpvE1ZEyNzGsiW0ahwHjvmpPfjL6Z0XUJN0b/XzQ sXlXg0gq1vxK1fBT21amPdcm+8goC9BQpRxii8csoda2ApSB2eTXoX4YYvJ8w0wrXPBI WbUGcR76zf5kws9znu+hgY18m1KaCsRyZEMYtXmtNTkoj3+jTuhlEjRC5fUab9xC4V59 5TcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=xcws14ALyfbixABgft8gTHL1DrP7bw4klLG8z8WXaqA=; b=EzMiRwqzW4OS+IQ8husTtEgCbHpDWDdd67vs+VLv2IMxrklwsF0qkJHXvUC0p+0iBe N9xCZfzF/94P01PTdW3rOKHFLkCLZVqb2elANHbWj48issXhQ0aNxh8I8TYbMaIecMnc hIvYI6XW41S5q2QhfzPt/u1sXI3HwMgQ6FoN3IFhAp+XQMMfOc449cz0ujQeC43EBVjm C4Yvtxqtj8Sxe3pZyaKS9MIy4FytdNgQ4DlcFrLh5ascQR79KwNhi745que4gIsrUyID 243WpOd427sp6qNggDeAez0DizcHkD9ju9Zal8YuxqpDEebgOryo2Y/Qx67fvh6ENV+e gUDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b41si8276600pla.409.2019.07.05.03.09.39; Fri, 05 Jul 2019 03:09:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728394AbfGEKHm (ORCPT + 99 others); Fri, 5 Jul 2019 06:07:42 -0400 Received: from inva020.nxp.com ([92.121.34.13]:33230 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728281AbfGEKHj (ORCPT ); Fri, 5 Jul 2019 06:07:39 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2A1A11A0EAC; Fri, 5 Jul 2019 12:07:38 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A14B21A0EB9; Fri, 5 Jul 2019 12:07:29 +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 4D0B54032A; Fri, 5 Jul 2019 18:07:19 +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 Cc: Mingkai.Hu@nxp.com, Minghuan.Lian@nxp.com, Xiaowei.Bao@nxp.com, Hou Zhiqiang Subject: [PATCHv6 22/28] PCI: mobiveil: Mask out the lower 10-bit hardcode window size Date: Fri, 5 Jul 2019 17:56:50 +0800 Message-Id: <20190705095656.19191-23-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lower 10-bit of window size field is hardcode to zero, and then the lower 10-bit of PAB_AXI_AMAP_CTRL register are used to control fields, so mask out the lower 10-bit of window size in case override the control bits. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V6: - Splited from #9 of v5 patches, no functional change. drivers/pci/controller/pcie-mobiveil.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 7d18e59..4f50fe6 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -474,7 +474,7 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, value = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); value &= ~(AMAP_CTRL_TYPE_MASK << AMAP_CTRL_TYPE_SHIFT | WIN_SIZE_MASK); value |= type << AMAP_CTRL_TYPE_SHIFT | 1 << AMAP_CTRL_EN_SHIFT | - lower_32_bits(size64); + (lower_32_bits(size64) & WIN_SIZE_MASK); csr_writel(pcie, value, PAB_PEX_AMAP_CTRL(win_num)); csr_writel(pcie, upper_32_bits(size64), @@ -509,7 +509,7 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, value = csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); value &= ~(WIN_TYPE_MASK << WIN_TYPE_SHIFT | WIN_SIZE_MASK); value |= 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | - lower_32_bits(size64); + (lower_32_bits(size64) & WIN_SIZE_MASK); csr_writel(pcie, value, PAB_AXI_AMAP_CTRL(win_num)); csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); -- 1.7.1