Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3173075ybi; Fri, 5 Jul 2019 03:08:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKP/UwvnimmVahCndaFMhxU8HcOnsd6TzaLooIBB7KkUeNRryRpN8zdJU9OzmQfcxBsFt+ X-Received: by 2002:a63:460c:: with SMTP id t12mr4454264pga.69.1562321331153; Fri, 05 Jul 2019 03:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562321331; cv=none; d=google.com; s=arc-20160816; b=MNOYJ3oyFwVXMlJf3nVos6rzoyXrG9Q9Lal+OULeqQUJVThL6V6CJpAK+OJBHRz1ru uGTGuQCNp6Eo1f65cWsz90khjyb+NIdtHVk+lw96QdaaqOaiBB6BPBciCKohWv2N9zxo FJDsLqeJi7/okjDaG7uAFR6NKVDl6LH9tr7uuUrdWYf7gchoMLfHK+Y7iBy1BB9Prl+J 0tphLjGmhq+orfXPOvX6orJysYOeF9TeJsntHWZ6AjR4Q89BYHDu1bHTZWxXCk4Xx/uU Lb26gCSzfroSteTddCl5Ja0/I+rSvV0kaDc8LR6twWbHlVHjVafSK1F0X+GmdQ9Vl8vY LQOg== 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=ZQo3Fqy4Jbi9ieCicIMc3WEMcEK088b3muG06855GAE=; b=WU7Hh97D1uBiEc6giwaUYb0ZqOqZiasZd9vbvbhDk8wdZXObLT1I3OhpaYKOBHcD9n VtVRY8qMoFXqiL+NphLwcVesvuWuyJbwQRVHkcVYsXQUo5PdsL9K9zkSE2aEvV2bGTyq ij6CcK4UhOk6PvWQrixbCjYRRfTf40H4YhMLc0/hATabwmBggMI9fWfgWkGfO8u/4uQq iAXNvp05R/XzxnHwz7j/Upj8lbu6imSuQHOf8hTa0EakKrsgWIPUc3uU0eGBfWVDIhYL +aR/VfBfzvrvd1tbx9xYEF7qg1WJyJ+IRXaYN/3fHf0zmZC2EMDjeLWzhhjaYKSHhIzY rTpg== 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 j33si8440555pgi.89.2019.07.05.03.08.35; Fri, 05 Jul 2019 03:08:51 -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 S1728466AbfGEKHu (ORCPT + 99 others); Fri, 5 Jul 2019 06:07:50 -0400 Received: from inva020.nxp.com ([92.121.34.13]:33340 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728424AbfGEKHr (ORCPT ); Fri, 5 Jul 2019 06:07:47 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D93951A077C; Fri, 5 Jul 2019 12:07:44 +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 5A03B1A0775; Fri, 5 Jul 2019 12:07:36 +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 0F846402E1; Fri, 5 Jul 2019 18:07:25 +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 26/28] PCI: mobiveil: Move PCIe PIO enablement out of inbound window routine Date: Fri, 5 Jul 2019 17:56:54 +0800 Message-Id: <20190705095656.19191-27-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 Move the PCIe PIO master enablement to function mobiveil_host_init(). 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 | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index aeba37c..f35d14b 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -469,10 +469,6 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, return; } - value = csr_readl(pcie, PAB_PEX_PIO_CTRL); - value |= 1 << PIO_ENABLE_SHIFT; - csr_writel(pcie, value, PAB_PEX_PIO_CTRL); - 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 | @@ -610,6 +606,11 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) value |= APIO_EN_MASK; csr_writel(pcie, value, PAB_AXI_PIO_CTRL); + /* Enable PCIe PIO master */ + value = csr_readl(pcie, PAB_PEX_PIO_CTRL); + value |= 1 << PIO_ENABLE_SHIFT; + csr_writel(pcie, value, PAB_PEX_PIO_CTRL); + /* * we'll program one outbound window for config reads and * another default inbound window for all the upstream traffic -- 1.7.1