2014-10-01 21:31:28

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 0/6] ARM: add machine and dts files for Amlogic Meson8

Hi,

this patchset introduces a machine definition and dts files for
Amlogic Meson8, which is a family of quad-core Cortex-A9 SoCs used in
tablets and set-top boxes.

Beniamino Galvani (6):
ARM: meson: add meson8 machine definition
ARM: dts: add dtsi for Amlogic Meson8 SoCs
ARM: dts: add dts for Tronsmart S89 Elite TV box
of: add vendor prefix for Tronsmart
ARM: document Tronsmart compatible properties
ARM: meson: document meson8 compatible properties

Documentation/devicetree/bindings/arm/amlogic.txt | 8 +-
.../devicetree/bindings/arm/tronsmart.txt | 7 ++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/arm/boot/dts/meson8-vega-s89e.dts | 65 ++++++++++++++++
arch/arm/boot/dts/meson8.dtsi | 90 ++++++++++++++++++++++
arch/arm/mach-meson/Kconfig | 5 ++
arch/arm/mach-meson/meson.c | 8 ++
7 files changed, 181 insertions(+), 3 deletions(-)
create mode 100644 Documentation/devicetree/bindings/arm/tronsmart.txt
create mode 100644 arch/arm/boot/dts/meson8-vega-s89e.dts
create mode 100644 arch/arm/boot/dts/meson8.dtsi

--
1.9.1


2014-10-01 21:31:34

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 2/6] ARM: dts: add dtsi for Amlogic Meson8 SoCs

Add a dtsi for the Amlogic Meson8 SoCs. It differs from the Meson6
dtsi for the number of Cortex-A9 cores (4 vs 2) and for the
frequency of clk81.

Signed-off-by: Beniamino Galvani <[email protected]>
---
arch/arm/boot/dts/meson8.dtsi | 90 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
create mode 100644 arch/arm/boot/dts/meson8.dtsi

diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
new file mode 100644
index 0000000..7b3fc1e
--- /dev/null
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2014 Carlo Caione <[email protected]>
+ *
+ * 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 library 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 library 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.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ *
+ * 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 "AS IS", 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/ "meson.dtsi"
+
+/ {
+ model = "Amlogic Meson8 SoC";
+ compatible = "amlogic,meson8";
+
+ interrupt-parent = <&gic>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@200 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ reg = <0x200>;
+ };
+
+ cpu@201 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ reg = <0x201>;
+ };
+
+ cpu@202 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ reg = <0x202>;
+ };
+
+ cpu@203 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a9";
+ reg = <0x203>;
+ };
+ };
+
+ clk81: clk@0 {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <141666666>;
+ };
+}; /* end of / */
--
1.9.1

2014-10-01 21:31:37

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 4/6] of: add vendor prefix for Tronsmart

This adds Tronsmart to the list of device tree vendor prefixes.

Signed-off-by: Beniamino Galvani <[email protected]>
---
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index c681434..92a1798 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -141,6 +141,7 @@ tlm Trusted Logic Mobility
toradex Toradex AG
toshiba Toshiba Corporation
toumaz Toumaz
+tronsmart Tronsmart
usi Universal Scientifc Industrial Co., Ltd.
v3 V3 Semiconductor
variscite Variscite Ltd.
--
1.9.1

2014-10-01 21:31:42

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 5/6] ARM: document Tronsmart compatible properties

Document device tree bindings for Tronsmart devices.

Signed-off-by: Beniamino Galvani <[email protected]>
---
Documentation/devicetree/bindings/arm/tronsmart.txt | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/tronsmart.txt

diff --git a/Documentation/devicetree/bindings/arm/tronsmart.txt b/Documentation/devicetree/bindings/arm/tronsmart.txt
new file mode 100644
index 0000000..bd29d60
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/tronsmart.txt
@@ -0,0 +1,7 @@
+Tronsmart Platforms Device Tree Bindings
+---------------------------------------
+
+Vega S89 Elite TV box
+
+Required root node properties:
+ - compatible = "tronsmart,vega-s89e";
--
1.9.1

2014-10-01 21:32:13

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 6/6] ARM: meson: document meson8 compatible properties

Add device tree bindings documentation for Amlogic Meson8 SoCs.

Signed-off-by: Beniamino Galvani <[email protected]>
---
Documentation/devicetree/bindings/arm/amlogic.txt | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/amlogic.txt b/Documentation/devicetree/bindings/arm/amlogic.txt
index 7eece72..8fe8150 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.txt
+++ b/Documentation/devicetree/bindings/arm/amlogic.txt
@@ -2,7 +2,9 @@ Amlogic MesonX device tree bindings
-------------------------------------------

Boards with the Amlogic Meson6 SoC shall have the following properties:
+ Required root node property:
+ compatible: "amlogic,meson6"

-Required root node property:
-
-compatible = "amlogic,meson6";
+Boards with the Amlogic Meson8 SoC shall have the following properties:
+ Required root node property:
+ compatible: "amlogic,meson8";
--
1.9.1

2014-10-01 21:33:00

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 3/6] ARM: dts: add dts for Tronsmart S89 Elite TV box

This adds a dts for the Tronsmart S89 Elite, a set-top box based on
the Amlogic S802 SoC with a 8GiB NAND flash, USB ports, 10/100 Mbps
Ethernet adapter, WiFi, HDMI and a micro SD slot.

Signed-off-by: Beniamino Galvani <[email protected]>
---
arch/arm/boot/dts/meson8-vega-s89e.dts | 65 ++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 arch/arm/boot/dts/meson8-vega-s89e.dts

diff --git a/arch/arm/boot/dts/meson8-vega-s89e.dts b/arch/arm/boot/dts/meson8-vega-s89e.dts
new file mode 100644
index 0000000..93c3dfd
--- /dev/null
+++ b/arch/arm/boot/dts/meson8-vega-s89e.dts
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2014 Beniamino Galvani <[email protected]>
+ *
+ * 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 library 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 library 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * 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 "AS IS", 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.
+ */
+
+
+/dts-v1/;
+/include/ "meson8.dtsi"
+
+/ {
+ model = "Tronsmart Vega S89 Elite";
+ compatible = "tronsmart,vega-s89e", "amlogic,meson8";
+
+ aliases {
+ serial0 = &uart_AO;
+ };
+
+ memory {
+ reg = <0x40000000 0x80000000>;
+ };
+};
+
+&uart_AO {
+ status = "okay";
+};
--
1.9.1

2014-10-01 21:31:31

by Beniamino Galvani

[permalink] [raw]
Subject: [PATCH 1/6] ARM: meson: add meson8 machine definition

This patch adds a machine definition for Amlogic Meson8 SoCs.

Signed-off-by: Beniamino Galvani <[email protected]>
---
arch/arm/mach-meson/Kconfig | 5 +++++
arch/arm/mach-meson/meson.c | 8 ++++++++
2 files changed, 13 insertions(+)

diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index 2c1154e..b289e8e 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -10,4 +10,9 @@ config MACH_MESON6
default ARCH_MESON
select MESON6_TIMER

+config MACH_MESON8
+ bool "Amlogic Meson8 SoCs support"
+ default ARCH_MESON
+ select MESON6_TIMER
+
endif
diff --git a/arch/arm/mach-meson/meson.c b/arch/arm/mach-meson/meson.c
index 5ee064f..e95d6ae 100644
--- a/arch/arm/mach-meson/meson.c
+++ b/arch/arm/mach-meson/meson.c
@@ -21,7 +21,15 @@ static const char * const m6_common_board_compat[] = {
NULL,
};

+static const char * const m8_common_board_compat[] = {
+ "amlogic,meson8",
+ NULL,
+};
+
DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
.dt_compat = m6_common_board_compat,
MACHINE_END

+DT_MACHINE_START(MESON8, "Amlogic Meson8 platform")
+ .dt_compat = m8_common_board_compat,
+MACHINE_END
--
1.9.1

2014-10-02 09:25:13

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: meson: add meson8 machine definition

On Wednesday 01 October 2014 23:29:41 Beniamino Galvani wrote:
>
> +static const char * const m8_common_board_compat[] = {
> + "amlogic,meson8",
> + NULL,
> +};
> +
> DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
> .dt_compat = m6_common_board_compat,
> MACHINE_END
>
> +DT_MACHINE_START(MESON8, "Amlogic Meson8 platform")
> + .dt_compat = m8_common_board_compat,
> +MACHINE_END
>

I'd just add the meson8 string to the m6_common_board_compat list and
rename it.

Arnd

2014-10-02 09:28:54

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: meson: add meson8 machine definition

On Wednesday 01 October 2014 23:29:41 Beniamino Galvani wrote:
> DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
> .dt_compat = m6_common_board_compat,
> MACHINE_END
>
> +DT_MACHINE_START(MESON8, "Amlogic Meson8 platform")
> + .dt_compat = m8_common_board_compat,
> +MACHINE_END

One more thing: since this is a cortex-a9, don't you have to enable
the l2x0 cache controller explicitly? I think you need a
".l2c_aux_mask = ~0," entry here.

Arnd

2014-10-02 17:06:40

by Beniamino Galvani

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: meson: add meson8 machine definition

On Thu, Oct 02, 2014 at 11:24:54AM +0200, Arnd Bergmann wrote:
> On Wednesday 01 October 2014 23:29:41 Beniamino Galvani wrote:
> >
> > +static const char * const m8_common_board_compat[] = {
> > + "amlogic,meson8",
> > + NULL,
> > +};
> > +
> > DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
> > .dt_compat = m6_common_board_compat,
> > MACHINE_END
> >
> > +DT_MACHINE_START(MESON8, "Amlogic Meson8 platform")
> > + .dt_compat = m8_common_board_compat,
> > +MACHINE_END
> >
>
> I'd just add the meson8 string to the m6_common_board_compat list and
> rename it.

>From what I've seen so far the two families are very similar and share
most of the IP cores, so a unique DT machine is a good idea.

Does the MACH_MESON8 Kconfig symbol still make sense or can I drop it
and rename MACH_MESON6 to MACH_MESON?

Beniamino

2014-10-02 17:10:09

by Beniamino Galvani

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: meson: add meson8 machine definition

On Thu, Oct 02, 2014 at 11:28:14AM +0200, Arnd Bergmann wrote:
> On Wednesday 01 October 2014 23:29:41 Beniamino Galvani wrote:
> > DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
> > .dt_compat = m6_common_board_compat,
> > MACHINE_END
> >
> > +DT_MACHINE_START(MESON8, "Amlogic Meson8 platform")
> > + .dt_compat = m8_common_board_compat,
> > +MACHINE_END
>
> One more thing: since this is a cortex-a9, don't you have to enable
> the l2x0 cache controller explicitly? I think you need a
> ".l2c_aux_mask = ~0," entry here.

Will do, thanks.

Beniamino

2014-10-02 18:30:18

by Carlo Caione

[permalink] [raw]
Subject: Re: [PATCH 1/6] ARM: meson: add meson8 machine definition

On gio, ott 02, 2014 at 07:05:19 +0200, Beniamino Galvani wrote:
> On Thu, Oct 02, 2014 at 11:24:54AM +0200, Arnd Bergmann wrote:
> > On Wednesday 01 October 2014 23:29:41 Beniamino Galvani wrote:
> > >
> > > +static const char * const m8_common_board_compat[] = {
> > > + "amlogic,meson8",
> > > + NULL,
> > > +};
> > > +
> > > DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
> > > .dt_compat = m6_common_board_compat,
> > > MACHINE_END
> > >
> > > +DT_MACHINE_START(MESON8, "Amlogic Meson8 platform")
> > > + .dt_compat = m8_common_board_compat,
> > > +MACHINE_END
> > >
> >
> > I'd just add the meson8 string to the m6_common_board_compat list and
> > rename it.
>
> From what I've seen so far the two families are very similar and share
> most of the IP cores, so a unique DT machine is a good idea.
>
> Does the MACH_MESON8 Kconfig symbol still make sense or can I drop it
> and rename MACH_MESON6 to MACH_MESON?

I would still leave two different MACH_ for meson6 and meson8 since the
two architectures aren't _so_ similar.

thanks,

--
Carlo Caione