linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mohit Kumar <mohit.kumar@st.com>
To: <jg1.han@samsung.com>
Cc: Mohit Kumar <mohit.kumar@st.com>,
	Ajay Khandelwal <ajay.khandelwal@st.com>,
	Bjorn Helgaas <bhelgass@google.com>, <spear-devel@list.st.com>,
	<linux-pci@vger.kernel.org>
Subject: [PATCH 2/2] PCI:designware:Fix iATU programming for cfg1, io and mem viewport
Date: Thu, 20 Feb 2014 10:52:54 +0530	[thread overview]
Message-ID: <1392873774-22249-2-git-send-email-mohit.kumar@st.com> (raw)
In-Reply-To: <1392873774-22249-1-git-send-email-mohit.kumar@st.com>

This patch correct iATU programming for cfg1, io and mem viewport.
Enable ATU only after configuring it.

Signed-off-by: Mohit Kumar <mohit.kumar@st.com>
Signed-off-by: Ajay Khandelwal <ajay.khandelwal@st.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Bjorn Helgaas <bhelgass@google.com>
Cc: spear-devel@list.st.com
Cc: linux-pci@vger.kernel.org
---
 drivers/pci/host/pcie-designware.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 391966f..46f4a19 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -522,13 +522,13 @@ static void dw_pcie_prog_viewport_cfg1(struct pcie_port *pp, u32 busdev)
 	dw_pcie_writel_rc(pp, PCIE_ATU_REGION_OUTBOUND | PCIE_ATU_REGION_INDEX1,
 			  PCIE_ATU_VIEWPORT);
 	dw_pcie_writel_rc(pp, PCIE_ATU_TYPE_CFG1, PCIE_ATU_CR1);
-	dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
 	dw_pcie_writel_rc(pp, pp->cfg1_base, PCIE_ATU_LOWER_BASE);
 	dw_pcie_writel_rc(pp, (pp->cfg1_base >> 32), PCIE_ATU_UPPER_BASE);
 	dw_pcie_writel_rc(pp, pp->cfg1_base + pp->config.cfg1_size - 1,
 			  PCIE_ATU_LIMIT);
 	dw_pcie_writel_rc(pp, busdev, PCIE_ATU_LOWER_TARGET);
 	dw_pcie_writel_rc(pp, 0, PCIE_ATU_UPPER_TARGET);
+	dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
 }
 
 static void dw_pcie_prog_viewport_mem_outbound(struct pcie_port *pp)
@@ -537,7 +537,6 @@ static void dw_pcie_prog_viewport_mem_outbound(struct pcie_port *pp)
 	dw_pcie_writel_rc(pp, PCIE_ATU_REGION_OUTBOUND | PCIE_ATU_REGION_INDEX0,
 			  PCIE_ATU_VIEWPORT);
 	dw_pcie_writel_rc(pp, PCIE_ATU_TYPE_MEM, PCIE_ATU_CR1);
-	dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
 	dw_pcie_writel_rc(pp, pp->mem_base, PCIE_ATU_LOWER_BASE);
 	dw_pcie_writel_rc(pp, (pp->mem_base >> 32), PCIE_ATU_UPPER_BASE);
 	dw_pcie_writel_rc(pp, pp->mem_base + pp->config.mem_size - 1,
@@ -545,6 +544,7 @@ static void dw_pcie_prog_viewport_mem_outbound(struct pcie_port *pp)
 	dw_pcie_writel_rc(pp, pp->config.mem_bus_addr, PCIE_ATU_LOWER_TARGET);
 	dw_pcie_writel_rc(pp, upper_32_bits(pp->config.mem_bus_addr),
 			  PCIE_ATU_UPPER_TARGET);
+	dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
 }
 
 static void dw_pcie_prog_viewport_io_outbound(struct pcie_port *pp)
@@ -553,7 +553,6 @@ static void dw_pcie_prog_viewport_io_outbound(struct pcie_port *pp)
 	dw_pcie_writel_rc(pp, PCIE_ATU_REGION_OUTBOUND | PCIE_ATU_REGION_INDEX1,
 			  PCIE_ATU_VIEWPORT);
 	dw_pcie_writel_rc(pp, PCIE_ATU_TYPE_IO, PCIE_ATU_CR1);
-	dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
 	dw_pcie_writel_rc(pp, pp->io_base, PCIE_ATU_LOWER_BASE);
 	dw_pcie_writel_rc(pp, (pp->io_base >> 32), PCIE_ATU_UPPER_BASE);
 	dw_pcie_writel_rc(pp, pp->io_base + pp->config.io_size - 1,
@@ -561,6 +560,7 @@ static void dw_pcie_prog_viewport_io_outbound(struct pcie_port *pp)
 	dw_pcie_writel_rc(pp, pp->config.io_bus_addr, PCIE_ATU_LOWER_TARGET);
 	dw_pcie_writel_rc(pp, upper_32_bits(pp->config.io_bus_addr),
 			  PCIE_ATU_UPPER_TARGET);
+	dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
 }
 
 static int dw_pcie_rd_other_conf(struct pcie_port *pp, struct pci_bus *bus,
-- 
1.7.0.1


  reply	other threads:[~2014-02-20  5:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20  5:22 [PATCH 1/2] PCI:designware:Fix comment for setting number of lanes Mohit Kumar
2014-02-20  5:22 ` Mohit Kumar [this message]
2014-02-20  6:45   ` [PATCH 2/2] PCI:designware:Fix iATU programming for cfg1, io and mem viewport Mohit KUMAR DCG
2014-02-20 11:38   ` Kishon Vijay Abraham I
2014-02-20 11:58     ` Mohit KUMAR DCG
2014-02-20 12:13       ` Kishon Vijay Abraham I
2014-02-20 13:33         ` Mohit KUMAR DCG
2014-02-21  3:54         ` Pratyush Anand
2014-02-20  6:56 ` [PATCH 1/2] PCI:designware:Fix comment for setting number of lanes Rajeev kumar
2014-02-20  8:29   ` Mohit KUMAR DCG
  -- strict thread matches above, loose matches on Subject: below --
2014-02-21  1:31 [PATCH 2/2] PCI:designware:Fix iATU programming for cfg1, io and mem viewport Jingoo Han
2014-02-21  5:28 ` Kishon Vijay Abraham I
2014-02-26  6:31   ` Ajay Khandelwal
2014-02-26  7:47     ` Kishon Vijay Abraham I
2014-02-26 10:52       ` Pratyush Anand
2014-02-27  1:18         ` Jingoo Han
2014-02-27  1:37           ` Jingoo Han
2014-02-27  4:10             ` Pratyush Anand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392873774-22249-2-git-send-email-mohit.kumar@st.com \
    --to=mohit.kumar@st.com \
    --cc=ajay.khandelwal@st.com \
    --cc=bhelgass@google.com \
    --cc=jg1.han@samsung.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=spear-devel@list.st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).