diff mbox

[14/18] ARM: mvebu: add support for the Armada 395 SoC family

Message ID 1469105055-25181-16-git-send-email-jaz@semihalf.com (mailing list archive)
State New, archived
Headers show

Commit Message

Grzegorz Jaszczyk July 21, 2016, 12:44 p.m. UTC
Beside interfaces described in the armada-39x.dtsi, the Armada 395 SoC
family supports: 2 x SATA3 (2 ports in one unit) and the USB3.0

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
---
 .../devicetree/bindings/arm/marvell/armada-39x.txt |  2 +-
 arch/arm/boot/dts/armada-395.dtsi                  | 76 ++++++++++++++++++++++
 2 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/armada-395.dtsi

Comments

Rob Herring July 21, 2016, 10:16 p.m. UTC | #1
On Thu, Jul 21, 2016 at 02:44:11PM +0200, Grzegorz Jaszczyk wrote:
> Beside interfaces described in the armada-39x.dtsi, the Armada 395 SoC
> family supports: 2 x SATA3 (2 ports in one unit) and the USB3.0
> 
> Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> ---
>  .../devicetree/bindings/arm/marvell/armada-39x.txt |  2 +-
>  arch/arm/boot/dts/armada-395.dtsi                  | 76 ++++++++++++++++++++++
>  2 files changed, 77 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/dts/armada-395.dtsi
> 
> diff --git a/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt b/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt
> index 53d4ff9..f066801 100644
> --- a/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt
> +++ b/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt
> @@ -17,4 +17,4 @@ compatible: must contain "marvell,armada398"
>  
>  Example:
>  
> -compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada390";
> +compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada395", "marvell,armada390";

If 395 came after 398, then it should come first in the order. This 
implies that marvell,armada398 is a better match than marvell,armada395. 
Or perhaps you shouldn't have both?

Rob
Grzegorz Jaszczyk July 22, 2016, 9:10 a.m. UTC | #2
Hi Rob,

2016-07-22 0:16 GMT+02:00 Rob Herring <robh@kernel.org>:
> On Thu, Jul 21, 2016 at 02:44:11PM +0200, Grzegorz Jaszczyk wrote:
>> -compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada390";
>> +compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada395", "marvell,armada390";
>
> If 395 came after 398, then it should come first in the order. This
> implies that marvell,armada398 is a better match than marvell,armada395.
> Or perhaps you shouldn't have both?
>
> Rob

I am not sure if I get your point. The Armada-398 extends the
Armada-395 about 2 additional SATA ports (as you can see in commit
"[PATCH 15/18] ARM: mvebu: a398: update the dtsi about missing
interfaces"). In this example the a398-db board contains the Armada398
SoC, so it is a better match and goes first.

Quite the same is for existing armada-388-db.dts, in which compatible
looks like this:
compatible = "marvell,a385-db", "marvell,armada388",
"marvell,armada385", "marvell,armada380";

In above, Armada-388 also extends the Armada-385 and the order of the
compatible is similar to one from my example.

Thank you,
Grzegorz
Rob Herring July 25, 2016, 1:47 p.m. UTC | #3
On Fri, Jul 22, 2016 at 4:10 AM, Grzegorz Jaszczyk <jaz@semihalf.com> wrote:
> Hi Rob,
>
> 2016-07-22 0:16 GMT+02:00 Rob Herring <robh@kernel.org>:
>> On Thu, Jul 21, 2016 at 02:44:11PM +0200, Grzegorz Jaszczyk wrote:
>>> -compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada390";
>>> +compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada395", "marvell,armada390";
>>
>> If 395 came after 398, then it should come first in the order. This
>> implies that marvell,armada398 is a better match than marvell,armada395.
>> Or perhaps you shouldn't have both?
>>
>> Rob
>
> I am not sure if I get your point. The Armada-398 extends the
> Armada-395 about 2 additional SATA ports (as you can see in commit
> "[PATCH 15/18] ARM: mvebu: a398: update the dtsi about missing
> interfaces"). In this example the a398-db board contains the Armada398
> SoC, so it is a better match and goes first.

But your patch title is adding 395 support, but you are adding the
string to a 398 based board. It would make sense to have 395 here if
the OS already had support for 395 and you want to support the 398
without updating the OS. That doesn't seem to apply here.

> Quite the same is for existing armada-388-db.dts, in which compatible
> looks like this:
> compatible = "marvell,a385-db", "marvell,armada388",
> "marvell,armada385", "marvell,armada380";

Maybe so, but IMO this looks a bit excessive.

The problem is what if you need to apply a fix for only 395 (or 385),
but not 398? If you put both strings in, you can't distinguish you are
running on a 395 or 398 SoC. You would have to check for !398 and any
other SoCs you've claimed are 395 compatible. Maybe you have ID
registers you can read to distinguish SoCs, but then you don't need
the strings in that case either. The flip side is if you need a fix
for both, then the OS can easily check for either string.

Rob
Thomas Petazzoni July 25, 2016, 1:50 p.m. UTC | #4
Hello,

On Mon, 25 Jul 2016 08:47:23 -0500, Rob Herring wrote:

> > I am not sure if I get your point. The Armada-398 extends the
> > Armada-395 about 2 additional SATA ports (as you can see in commit
> > "[PATCH 15/18] ARM: mvebu: a398: update the dtsi about missing
> > interfaces"). In this example the a398-db board contains the Armada398
> > SoC, so it is a better match and goes first.  
> 
> But your patch title is adding 395 support, but you are adding the
> string to a 398 based board. It would make sense to have 395 here if
> the OS already had support for 395 and you want to support the 398
> without updating the OS. That doesn't seem to apply here.

I think the argument of Grzegorz is that the 398 is functionally a
strict superset of the 395, so that anything that applies to the 395
will also apply to 398.

Now, whether it is a good idea to consider them "compatible" in the DT
sense, I'm not sure.

Thomas
Rob Herring July 25, 2016, 3:12 p.m. UTC | #5
On Mon, Jul 25, 2016 at 8:50 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Mon, 25 Jul 2016 08:47:23 -0500, Rob Herring wrote:
>
>> > I am not sure if I get your point. The Armada-398 extends the
>> > Armada-395 about 2 additional SATA ports (as you can see in commit
>> > "[PATCH 15/18] ARM: mvebu: a398: update the dtsi about missing
>> > interfaces"). In this example the a398-db board contains the Armada398
>> > SoC, so it is a better match and goes first.
>>
>> But your patch title is adding 395 support, but you are adding the
>> string to a 398 based board. It would make sense to have 395 here if
>> the OS already had support for 395 and you want to support the 398
>> without updating the OS. That doesn't seem to apply here.
>
> I think the argument of Grzegorz is that the 398 is functionally a
> strict superset of the 395, so that anything that applies to the 395
> will also apply to 398.

Yes, I get that, but that is only meaningful if you want to run an OS
that is only aware of 395 on a 398 SoC/board (though I'd guess the 390
compat is enough for that). Otherwise, that property is not really
meaningful as the additional nodes are enough to handle what is the
superset.

I would agree both are fine if both chips are in fact the same die,
just fused or packaged differently. I've seen a lot of chips that are
supposed to be sub/supersets of each other, but have different errata
lists because they are different die.

Rob
Thomas Petazzoni July 25, 2016, 6:22 p.m. UTC | #6
Hello,

On Mon, 25 Jul 2016 10:12:43 -0500, Rob Herring wrote:

> Yes, I get that, but that is only meaningful if you want to run an OS
> that is only aware of 395 on a 398 SoC/board (though I'd guess the 390
> compat is enough for that). Otherwise, that property is not really
> meaningful as the additional nodes are enough to handle what is the
> superset.
> 
> I would agree both are fine if both chips are in fact the same die,
> just fused or packaged differently. I've seen a lot of chips that are
> supposed to be sub/supersets of each other, but have different errata
> lists because they are different die.

Unfortunately HW vendors are rarely willing to publicly indicate whether
the different chips in their families are actually the same die fused
differently, or really different dies.

Thomas
Gregory CLEMENT July 28, 2016, 11:19 a.m. UTC | #7
Hi Rob,
 
 On lun., juil. 25 2016, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:

> Hello,
>
> On Mon, 25 Jul 2016 10:12:43 -0500, Rob Herring wrote:
>
>> Yes, I get that, but that is only meaningful if you want to run an OS
>> that is only aware of 395 on a 398 SoC/board (though I'd guess the 390
>> compat is enough for that). Otherwise, that property is not really
>> meaningful as the additional nodes are enough to handle what is the
>> superset.
>> 
>> I would agree both are fine if both chips are in fact the same die,
>> just fused or packaged differently. I've seen a lot of chips that are
>> supposed to be sub/supersets of each other, but have different errata
>> lists because they are different die.
>
> Unfortunately HW vendors are rarely willing to publicly indicate whether
> the different chips in their families are actually the same die fused
> differently, or really different dies.

So do you want that we keep both "marvell,armada398" and
"marvell,armada395" or do you xant we use only "marvell,armada398" ?

Thanks,

Gregory


>
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
Rob Herring July 28, 2016, 3:59 p.m. UTC | #8
On Thu, Jul 28, 2016 at 6:19 AM, Gregory CLEMENT
<gregory.clement@free-electrons.com> wrote:
> Hi Rob,
>
>  On lun., juil. 25 2016, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
>
>> Hello,
>>
>> On Mon, 25 Jul 2016 10:12:43 -0500, Rob Herring wrote:
>>
>>> Yes, I get that, but that is only meaningful if you want to run an OS
>>> that is only aware of 395 on a 398 SoC/board (though I'd guess the 390
>>> compat is enough for that). Otherwise, that property is not really
>>> meaningful as the additional nodes are enough to handle what is the
>>> superset.
>>>
>>> I would agree both are fine if both chips are in fact the same die,
>>> just fused or packaged differently. I've seen a lot of chips that are
>>> supposed to be sub/supersets of each other, but have different errata
>>> lists because they are different die.
>>
>> Unfortunately HW vendors are rarely willing to publicly indicate whether
>> the different chips in their families are actually the same die fused
>> differently, or really different dies.

Then it is safest to assume they are different.

> So do you want that we keep both "marvell,armada398" and
> "marvell,armada395" or do you xant we use only "marvell,armada398" ?

For the 398 based boards, I think it should only have
"marvell,armada398" and don't add "marvell,armada395".

Rob
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt b/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt
index 53d4ff9..f066801 100644
--- a/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt
+++ b/Documentation/devicetree/bindings/arm/marvell/armada-39x.txt
@@ -17,4 +17,4 @@  compatible: must contain "marvell,armada398"
 
 Example:
 
-compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada390";
+compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada395", "marvell,armada390";
diff --git a/arch/arm/boot/dts/armada-395.dtsi b/arch/arm/boot/dts/armada-395.dtsi
new file mode 100644
index 0000000..ab5dc49
--- /dev/null
+++ b/arch/arm/boot/dts/armada-395.dtsi
@@ -0,0 +1,76 @@ 
+/*
+ * Device Tree Include file for Marvell Armada 395 SoC.
+ *
+ * Copyright (C) 2016 Marvell
+ *
+ * Grzegorz Jaszczyk <jaz@semihalf.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "armada-39x.dtsi"
+
+/ {
+	compatible = "marvell,armada395", "marvell,armada390";
+
+	soc {
+		internal-regs {
+			pinctrl@18000 {
+				compatible = "marvell,mv88f6925-pinctrl";
+				reg = <0x18000 0x20>;
+			};
+
+			sata@a8000 {
+				compatible = "marvell,armada-380-ahci";
+				reg = <0xa8000 0x2000>;
+				interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&gateclk 15>;
+				status = "disabled";
+			};
+
+			usb3@f0000 {
+				compatible = "marvell,armada-380-xhci";
+				reg = <0xf0000 0x4000>,<0xf4000 0x4000>;
+				interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&gateclk 9>;
+				status = "disabled";
+			};
+		};
+	};
+};