From: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
To: Pratyush Anand <pratyush.anand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Mohit KUMAR DCG <mohit.kumar-qxv4g6HH51o@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Pratyush ANAND <pratyush.anand-qxv4g6HH51o@public.gmane.org>
Subject: Re: [PATCH 2/3] PCI: designware: use untranslated address while programming ATU
Date: Thu, 26 Jun 2014 11:40:02 +0530 [thread overview]
Message-ID: <53ABB93A.8070301@ti.com> (raw)
In-Reply-To: <CAHM4w1mMT5een4pAFb9s1JENm=j1W2yMPYdO+OdBhAy0wcRdjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Pratyush,
On Thursday 26 June 2014 11:07 AM, Pratyush Anand wrote:
> Hi Kishon,
>
> Few things, if you can help me to understand:
>
> On Wed, Jun 25, 2014 at 11:26 PM, Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org> wrote:
>> In DRA7, the cpu sees 32bit address, but the pcie controller can see only 28bit
>> address. So whenever the cpu issues a read/write request, the 4 most
>> significant bits are used by L3 to determine the target controller.
>> For example, the cpu reserves 0x2000_0000 - 0x2FFF_FFFF for PCIe controller but
>> the PCIe controller will see only (0x000_0000 - 0xFFF_FFF). So for programming
>> the outbound translation window the *base* should be programmed as 0x000_0000.
>> Whenever we try to write to say 0x2000_0000, it will be translated to whatever
>> we have programmed in the translation window with base as 0x000_0000.
>>
>> This is needed when the dt node is modelled something like below
>> axi {
>> compatible = "simple-bus";
>> #size-cells = <1>;
>> #address-cells = <1>;
>> ranges = <0x0 0x20000000 0x10000000 // 28-bit bus
>> 0x51000000 0x51000000 0x3000>;
>> pcie@51000000 {
>> reg = <0x1000 0x2000>, <0x51002000 0x14c>, <0x51000000 0x2000>;
>> reg-names = "config", "ti_conf", "rc_dbics";
>
> So for DRA7, config base which will be coming from reg property should
> be 0x1000 and size 0x2000, no?
right. The first element in 'reg' and 'reg-names' specify exactly that.
>
>> #address-cells = <3>;
>> #size-cells = <2>;
>> ranges = <0x81000000 0 0 0x03000 0 0x00010000
>
> range type 0x81000000 tells that it is IO
>
>> 0x82000000 0 0x20013000 0x13000 0 0xffed000>;
>
> range type 0x81000000 tells that it is mem
>
>
>> };
>> };
>>
>> Here the CPU address for configuration space is 0x20013000 and the controller
>> address for configuration space is 0x13000. The controller address should
> be
>
> If above understanding is correct then:
>
> Aren't these addresses(0x20013000 and 0x13000) from mem space
> instead of configuration space.
Sorry. I didn't get you. Configuration space is different from mem space and IO
space. We specify only the configuration space in "reg", the IO space and
memory space should be specified in ranges.
In my case
configuration space range: 0x20001000 - 0x20002fff
IO space range: 0x20003000 - 0x20012fff
Mem space range: 0x20013000 - 0x2fffffff
Here only the configuration space is obtained from 'reg' and 'IO' and 'MEM'
space is obtained from ranges.
>
> If yes, then how can you get two addresses (CPU and Controller address)
> from reg property for configuration space?
I used platform_get_resource_byname() to get CPU address and of_get_address()
to get the untranslated controller address.
Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-06-26 6:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 17:56 [PATCH 0/3] dra7: Add PCIe support Kishon Vijay Abraham I
2014-06-25 17:56 ` [PATCH 1/3] PCI: designware: Configuration space should be specified in 'reg' Kishon Vijay Abraham I
[not found] ` <1403719007-9352-2-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2014-06-26 5:55 ` Mohit KUMAR DCG
2014-07-08 12:50 ` Jingoo Han
2014-06-25 17:56 ` [PATCH 2/3] PCI: designware: use untranslated address while programming ATU Kishon Vijay Abraham I
[not found] ` <1403719007-9352-3-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2014-06-26 5:37 ` Pratyush Anand
[not found] ` <CAHM4w1mMT5een4pAFb9s1JENm=j1W2yMPYdO+OdBhAy0wcRdjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-26 6:10 ` Kishon Vijay Abraham I [this message]
2014-06-26 6:33 ` Pratyush Anand
2014-06-26 8:24 ` Kishon Vijay Abraham I
2014-07-08 12:31 ` Kishon Vijay Abraham I
2014-07-08 13:17 ` Jingoo Han
2014-07-09 9:38 ` Kishon Vijay Abraham I
2014-07-09 3:40 ` Mohit KUMAR DCG
2014-06-25 17:56 ` [PATCH 3/3] PCI: host: pcie-dra7xx: add support for pcie-dra7xx controller Kishon Vijay Abraham I
2014-07-08 12:34 ` Kishon Vijay Abraham I
2014-07-09 10:28 ` Kishon Vijay Abraham I
2014-07-05 17:32 ` [PATCH 0/3] dra7: Add PCIe support Bjorn Helgaas
2014-07-08 3:47 ` 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=53ABB93A.8070301@ti.com \
--to=kishon-l0cymroini0@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@public.gmane.org \
--cc=mohit.kumar-qxv4g6HH51o@public.gmane.org \
--cc=pratyush.anand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=pratyush.anand-qxv4g6HH51o@public.gmane.org \
/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).