linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pratyush Anand <pratyush.anand@st.com>
To: Jingoo Han <jg1.han@samsung.com>
Cc: 'Kishon Vijay Abraham I' <kishon@ti.com>,
	'Bjorn Helgaas' <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	'Kukjin Kim' <kgene.kim@samsung.com>,
	Mohit KUMAR DCG <Mohit.KUMAR@st.com>,
	'Arnd Bergmann' <arnd@arndb.de>, 'Sean Cross' <xobs@kosagi.com>,
	'Thierry Reding' <thierry.reding@gmail.com>,
	'SRIKANTH TUMKUR SHIVANAND' <ts.srikanth@samsung.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH V3] pci: exynos: split into two parts such as Synopsys part and Exynos part
Date: Thu, 12 Sep 2013 15:00:18 +0530	[thread overview]
Message-ID: <20130912093018.GA2124@pratyush-vbox> (raw)
In-Reply-To: <003501ceaf87$cda45db0$68ed1910$%han@samsung.com>

Hi Jingoo,


On Thu, Sep 12, 2013 at 03:15:04PM +0800, Jingoo Han wrote:
> On Tuesday 23 July 2013 12:30 PM, Kishon Vijay Abraham I wrote:
> > >> .
> > >> .
> > >>>>> +			of_pci_range_to_resource(&range, np, &pp->cfg);
> > >>>>> +			pp->config.cfg0_size = resource_size(&pp->cfg)/2;
> > >>>>> +			pp->config.cfg1_size = resource_size(&pp->cfg)/2;
> > >>>>> +		}
> > >>>>> +	}
> > >>>>> +
> > >>>>> +	pp->dbi_base = devm_ioremap(pp->dev, pp->cfg.start,
> > >>>>> +				resource_size(&pp->cfg));
> > >>>>
> > >>>> Why is configuraion space divided into two?
> > >>>
> > >>> Sorry, I don't know the exact reason. :(
> > >>> Pratyush Anand may know about this.
> > >>> Pratyush Anand, could you answer the question?
> > >>>
> > >>> Also, if you find some problems, please let me know.
> > 
> > One more query..
> > 
> > Where is inbound translation configuration done in your driver? how should it
> > be done?
> 

Yes, Kishon is right. Inbound translation configuration is missing in
your code and I think it should be implemented.

> Hi Kishon,
> 
> Sorry, I cannot understand your question exactly.
> However, the following thread would be helpful.
> 
> http://www.spinics.net/lists/arm-kernel/msg252078.html
> https://lkml.org/lkml/2013/6/17/890

>From this conversation, It seems that you
have tested this driver and it works fine without inbound translation
function. I am sure that you would have tested a PCIe card with DMA
capability such as PCIe2USB or PCIe2Ethernet. Since it worked, it
means that by default your controller is supporting one to one mapping
in case of inbound transaction even when address translation is enabled.

In my opinion you should call a function like as follows from
dw_pcie_host_init in pcie-designware.c.  It will insure one to one
mapping for any inbound request in memory range 0 to (in_mem_size -
1) for all dw implementation.

static void dw_pcie_prog_viewport_mem_inbound(struct pcie_port *pp)
{        
	u32 val;
	void __iomem *dbi_base = pp->dbi_base;

	/* Program viewport 0 : INBOUND : MEMORY*/
	val = PCIE_ATU_REGION_INBOUND | (0 & 0xF);
	dw_pcie_writel_rc(pp, val, dbi_base + PCIE_ATU_VIEWPORT));
	dw_pcie_writel_rc(pp, PCIE_ATU_TYPE_MEM, dbi_base + PCIE_ATU_CR1));
	val = PCIE_ATU_ENABLE | PCIE_ATU_BAR_MODE_ENABLE;
	dw_pcie_writel_rc(pp, val, dbi_base + PCIE_ATU_CR2));
	dw_pcie_writel_rc(pp, 0, dbi_base + PCIE_ATU_LOWER_BASE));
	dw_pcie_writel_rc(pp, 0, dbi_base + PCIE_ATU_UPPER_BASE));
	/* in_mem_size must be in power of 2 */
	dw_pcie_writel_rc(pp, pp->config.in_mem_size - 1, dbi_base + PCIE_ATU_LIMIT));
	dw_pcie_writel_rc(pp, 0, dbi_base + PCIE_ATU_LOWER_TARGET));
	dw_pcie_writel_rc(pp, 0, dbi_base + PCIE_ATU_UPPER_TARGET));
}

Regards
Pratyush

> 
> Best regards.
> Jingoo Han

  reply	other threads:[~2013-09-12  9:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18  5:21 [PATCH V3] pci: exynos: split into two parts such as Synopsys part and Exynos part Jingoo Han
2013-07-22 15:03 ` Kishon Vijay Abraham I
2013-07-23  1:14   ` Jingoo Han
2013-07-23  4:49     ` Pratyush Anand
2013-07-23  6:29     ` Kishon Vijay Abraham I
2013-07-23  7:00       ` Jingoo Han
2013-07-24 21:02         ` Arnd Bergmann
2013-09-12  6:34         ` Kishon Vijay Abraham I
2013-09-12  7:15           ` Jingoo Han
2013-09-12  9:30             ` Pratyush Anand [this message]
2013-09-12  9:43               ` Kishon Vijay Abraham I
2013-09-12  9:52                 ` Pratyush Anand
2013-09-12 10:07                   ` Kishon Vijay Abraham I
2013-09-12 10:18                     ` Pratyush Anand
2013-09-12 10:46                       ` Pratyush Anand
2013-09-12 11:14                         ` Kishon Vijay Abraham I
2013-09-21 14:56                         ` Kishon Vijay Abraham I
2013-09-21 22:03                           ` Arnd Bergmann
2013-09-22 11:16                             ` Kishon Vijay Abraham I
2013-09-23  4:14                               ` Pratyush Anand
2013-09-23  5:32                                 ` Kishon Vijay Abraham I
2013-09-23  6:50                                   ` Pratyush Anand
2013-09-24 21:23                                   ` Arnd Bergmann
2013-09-26  5:06                                     ` Kishon Vijay Abraham I
2013-09-26  9:51                                       ` Arnd Bergmann
2013-09-26 10:12                                         ` Kishon Vijay Abraham I
2013-09-12 10:25                 ` Jingoo Han
2013-07-23  8:42       ` Jingoo Han

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=20130912093018.GA2124@pratyush-vbox \
    --to=pratyush.anand@st.com \
    --cc=Mohit.KUMAR@st.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jg1.han@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ts.srikanth@samsung.com \
    --cc=xobs@kosagi.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).