From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 04/18] PCI: designware: use untranslated address while programming ATU
Date: Fri, 20 Jun 2014 20:54:39 +0200 [thread overview]
Message-ID: <4516730.Mn8ZI8EqE1@wuerfel> (raw)
In-Reply-To: <CAL_JsqJxppWOOWoX1MYF26OWXW7BdMZP1BQpq8cSgJ3n1QF5PA@mail.gmail.com>
On Friday 20 June 2014 12:45:46 Rob Herring wrote:
> On Thu, May 29, 2014 at 1:38 AM, Kishon Vijay Abraham I <kishon@ti.com> 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 at 51000000 {
> > reg = <0x1000 0x2000>, <0x51002000 0x14c>, <0x51000000 0x2000>;
> > reg-names = "config", "ti_conf", "rc_dbics";
> > #address-cells = >;
> > #size-cells = <2>;
> > ranges = <0x81000000 0 0 0x03000 0 0x00010000
> > 0x82000000 0 0x20013000 0x13000 0 0xffed000>;
> > };
> > };
> >
> > Here the CPU address for configuration space is 0x20013000 and the controller
> > address for configuration space is 0x13000. The controller address should be
> > used while programming the ATU (in order for translation to happen properly in
> > DRA7xx).
>
> This talks about config space, but the ranges field is PCI memory
> space. Also, does this actually work because I though Linux expects
> memory BARs to be 1MB aligned.
Good point about the alignment.
Actually both the config space and memory space are set up through the
intermediate ranges of the parent bus.
> Getting the controller offset should work whether you specify the
> address as 0x13000 with translation or the absolute address
> 0x20013000. In other words, the driver should know how many bits to
> mask off to get the offset.
That's what the first version of the patch did, and I didn't like that
because the masking is not actually a property of the controller, but
it's based on how the controller is connected to the parent bus, in this
case by using a narrower connection. We can describe the connection just
fine using standard DT properties and I think we should.
Arnd
next prev parent reply other threads:[~2014-06-20 18:54 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 6:38 [PATCH v2 00/18] PCIe support for DRA7xx Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 01/18] phy: phy-omap-pipe3: Add support for PCIe PHY Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 02/18] phy: pipe3: insert delay to enumerate in GEN2 mode Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 03/18] PCI: designware: Configuration space should be specified in 'reg' Kishon Vijay Abraham I
2014-05-29 7:11 ` Mohit KUMAR DCG
2014-05-29 13:16 ` Kishon Vijay Abraham I
2014-05-29 15:03 ` Kumar Gala
2014-05-29 15:18 ` Liviu Dudau
2014-05-29 16:03 ` Kumar Gala
2014-05-29 16:30 ` Jason Gunthorpe
2014-05-29 16:51 ` Kumar Gala
2014-05-29 16:32 ` Murali Karicheri
2014-05-30 5:30 ` Kishon Vijay Abraham I
2014-05-30 14:15 ` Karicheri, Muralidharan
2014-06-18 9:14 ` Kishon Vijay Abraham I
2014-06-18 9:27 ` Jingoo Han
2014-05-29 6:38 ` [PATCH v2 04/18] PCI: designware: use untranslated address while programming ATU Kishon Vijay Abraham I
2014-06-18 9:08 ` Kishon Vijay Abraham I
2014-06-20 16:18 ` Arnd Bergmann
2014-06-20 17:45 ` Rob Herring
2014-06-20 18:54 ` Arnd Bergmann [this message]
2014-05-29 6:38 ` [PATCH v2 05/18] PCI: host: pcie-dra7xx: add support for pcie-dra7xx controller Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 06/18] ARM: dts: DRA7: Add divider table to optfclk_pciephy_div clock Kishon Vijay Abraham I
2014-06-19 11:10 ` Tero Kristo
2014-06-19 12:45 ` Kishon Vijay Abraham I
2014-06-19 13:27 ` Tero Kristo
2014-05-29 6:38 ` [PATCH v2 07/18] ARM: dts: DRA7: Change the parent of apll_pcie_in_clk_mux to dpll_pcie_ref_m2ldo_ck Kishon Vijay Abraham I
2014-06-19 11:12 ` Tero Kristo
2014-06-19 13:00 ` Kishon Vijay Abraham I
2014-06-19 13:24 ` Tero Kristo
2014-05-29 6:38 ` [PATCH v2 08/18] arm: dra7xx: Add hwmod data for pcie1 phy and pcie2 phy Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 09/18] arm: dra7xx: Add hwmod data for pcie1 and pcie2 subsystems Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 10/18] ARM: dts: dra7xx-clocks: Add missing 32khz clocks used for PHY Kishon Vijay Abraham I
2014-06-19 11:16 ` Tero Kristo
2014-06-19 13:23 ` Kishon Vijay Abraham I
2014-06-19 13:26 ` Tero Kristo
2014-05-29 6:38 ` [PATCH v2 11/18] ARM: dts: dra7: Add dt data for PCIe PHY control module Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 12/18] ARM: dts: dra7xx-clocks: rename pcie clocks to accommodate second PHY instance Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 13/18] ARM: dts: dra7xx-clocks: Add missing clocks for second PCIe " Kishon Vijay Abraham I
2014-06-19 11:20 ` Tero Kristo
2014-06-19 13:25 ` Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 14/18] ARM: dts: dra7: Add dt data for PCIe PHY Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 15/18] ARM: dts: dra7: Add dt data for PCIe controller Kishon Vijay Abraham I
2014-05-29 6:38 ` [PATCH v2 16/18] ARM: OMAP: Enable PCI for DRA7 Kishon Vijay Abraham I
2014-05-29 6:48 ` Jingoo Han
2014-05-29 13:17 ` Kishon Vijay Abraham I
2014-05-29 17:52 ` Rob Herring
2014-05-29 17:54 ` Will Deacon
2014-05-29 6:38 ` [TEMP PATCH v2 17/18] PCI: host: pcie-dra7xx: use reset framework APIs to reset PCIe Kishon Vijay Abraham I
2014-05-29 6:38 ` [TEMP PATCH v2 18/18] ARM: dts: dra7: Add *resets* property for PCIe dt node Kishon Vijay Abraham I
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=4516730.Mn8ZI8EqE1@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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