devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: tj@kernel.org, hdegoede@redhat.com, david.daney@cavium.com,
	aleksey.makarov@caviumnetworks.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform
Date: Wed, 3 Feb 2016 16:02:05 +0000	[thread overview]
Message-ID: <56B2247D.5040501@imgtec.com> (raw)
In-Reply-To: <1725737.t6I7PsvPbL@wuerfel>

Hi,

On 03/02/16 15:31, Arnd Bergmann wrote:
> On Wednesday 03 February 2016 14:44:32 Zubair Lutfullah Kakakhel wrote:
>>
>> Possible in the example.
>>
>> I'll update the example to
>>
>>          uctl@118006c000000 {
>>                  compatible = "cavium,octeon-7130-sata-uctl";
>>                  reg = <0x11800 0x6c000000 0x0 0x100>;
>>                  ranges; /* Direct mapping */
>>                  dma-ranges;
>>                  #address-cells = <1>;
>>                  #size-cells = <2>;
>>
>>                  sata: sata@0 {
>>                          compatible = "cavium,octeon-7130-ahci";
>>                          reg = <0x16c00 0x00000000 0x0 0x200>;
>>                          interrupt-parent = <&cibsata>;
>>                          interrupts = <2 4>; /* Bit: 2, level */
>>                  };
>>          };
>
> Sorry, I should have been clearer. What I meant is
>
>
>           uctl@118006c000000 {
>                  compatible = "cavium,octeon-7130-sata-uctl";
>                  reg = <0x11800 0x6c000000 0x0 0x100>;
>                  ranges = <0   0x16c00 0x00000000   0xffffffff>;
>                  dma-ranges;
>                  #address-cells = <1>;
>                  #size-cells = <1>;
>
>                  sata: sata@0 {
>                          compatible = "cavium,octeon-7130-ahci";
>                          reg = <0x00000000 0x200>;
>                          interrupt-parent = <&cibsata>;
>                          interrupts = <2 4>; /* Bit: 2, level */
>                  };
>          };
>
>
> However, I realized that this would break the dma-ranges, if the
> child device is indeed 64-bit DMA capable. When #address-cells and/or
> #size-cells don't match between parent and child, you have to provide
> non-empty ranges as well as dma-ranges, and the dma-ranges for
> #address-cells=<1> would imply only supporting 32-bit DMA.
>
>
> It could still be
>
>           uctl@118006c000000 {
>                  compatible = "cavium,octeon-7130-sata-uctl";
>                  reg = <0x11800 0x6c000000 0x0 0x100>;
>                  ranges = <0 0  0x16c00 0x00000000   1 0>;
>                  dma-ranges;
>                  #address-cells = <1>;
>                  #size-cells = <1>;
>
>                  sata: sata@0 {
>                          compatible = "cavium,octeon-7130-ahci";
>                          reg = <0 0  0x200>;
>                          interrupt-parent = <&cibsata>;
>                          interrupts = <2 4>; /* Bit: 2, level */
>                  };
>          };
>
> to have a ranges property that shows we are only translating one 4GB
> segment of MMIO addresses into the child, but that the child has DMA
> access to the entire CPU address space (including 64-bit wide RAM
> as well as all MMIO).
>

The above might seem simple to the learned eye.

But it really convolutes my head.

The original binding from Cavium indicates direct mapping.

Given the restricted child device register range, your restricted ranges might make sense.

But I can't make sense of the mappings in the manual I have.

Perhaps David Daney can give more insight on what the hardware implements.

¯\_(ツ)_/¯
    |__|
    /  \

Keep in mind. this sata-uctl might seem like a bus driver

But it is only sitting in front of a sata ahci block.

There is little need for over-engineering address ranges.

Hence, I find the original binding simpler and easier to understand when looking at the hardware manual

+	uctl@118006c000000 {
+		compatible = "cavium,octeon-7130-sata-uctl";
+		reg = <0x11800 0x6c000000 0x0 0x100>;
+		ranges; /* Direct mapping */
+		dma-ranges;
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		sata: sata@16c0000000000 {
+			compatible = "cavium,octeon-7130-ahci";
+			reg = <0x16c00 0x00000000 0x0 0x200>;
+			interrupt-parent = <&cibsata>;
+			interrupts = <2 4>; /* Bit: 2, level */
+		};
+	};

Is it possible to let this example go in as is?

Regards,
ZubairLK

> 	Arnd
>

  reply	other threads:[~2016-02-03 16:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 18:24 [PATCH v6] SATA: OCTEON: support SATA on OCTEON platform Zubair Lutfullah Kakakhel
2016-02-02 18:37 ` David Daney
2016-02-02 20:48 ` Arnd Bergmann
2016-02-03 13:24   ` Zubair Lutfullah Kakakhel
2016-02-03 13:41     ` Arnd Bergmann
2016-02-03 14:44       ` Zubair Lutfullah Kakakhel
2016-02-03 13:47     ` Arnd Bergmann
2016-02-03 14:44       ` Zubair Lutfullah Kakakhel
2016-02-03 15:31         ` Arnd Bergmann
2016-02-03 16:02           ` Zubair Lutfullah Kakakhel [this message]
2016-02-03 16:23             ` Arnd Bergmann

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=56B2247D.5040501@imgtec.com \
    --to=zubair.kakakhel@imgtec.com \
    --cc=aleksey.makarov@caviumnetworks.com \
    --cc=arnd@arndb.de \
    --cc=david.daney@cavium.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.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).