devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Daniel Palmer <daniel@0x0f.com>
Cc: k@japko.eu, tim.bird@sony.com, devicetree@vger.kernel.org,
	Daniel Palmer <daniel@thingy.jp>,
	Rob Herring <robh+dt@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Sam Ravnborg <sam@ravnborg.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Heiko Stuebner <heiko.stuebner@theobroma-systems.com>,
	Maxime Ripard <mripard@kernel.org>,
	Lubomir Rintel <lkundrak@v3.sk>,
	Stephan Gerhold <stephan@gerhold.net>,
	Mark Brown <broonie@kernel.org>, allen <allen.chen@ite.com.tw>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>, Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Doug Anderson <armlinux@m.disordat.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Gregory Fong <gregory.0xf0@gmail.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Will Deacon <will@kernel.org>,
	Nathan Huckleberry <nhuck15@gmail.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Marc Zyngier <maz@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/5] ARM: mstar: Add infinity/mercury series dtsi
Date: Thu, 11 Jun 2020 15:39:28 +0200	[thread overview]
Message-ID: <bf26822d-acb0-ae40-df7f-80978bd26cfb@suse.de> (raw)
In-Reply-To: <20200610090421.3428945-4-daniel@0x0f.com>

Hi,

Am 10.06.20 um 11:04 schrieb Daniel Palmer:
> Adds initial dtsi for the base MStar ARMv7 SoCs, family dtsis for infinity
> and mercury families, and then some chip level dtsis for chips in those
> families.
> 
> Signed-off-by: Daniel Palmer <daniel@0x0f.com>
> ---
>   MAINTAINERS                              |  3 +
>   arch/arm/boot/dts/infinity-msc313.dtsi   | 14 +++++
>   arch/arm/boot/dts/infinity.dtsi          | 10 ++++
>   arch/arm/boot/dts/infinity3-msc313e.dtsi | 14 +++++
>   arch/arm/boot/dts/infinity3.dtsi         | 10 ++++
>   arch/arm/boot/dts/mercury5-ssc8336n.dtsi | 14 +++++
>   arch/arm/boot/dts/mercury5.dtsi          | 10 ++++
>   arch/arm/boot/dts/mstar-v7.dtsi          | 71 ++++++++++++++++++++++++
>   8 files changed, 146 insertions(+)

Can you split this up into three parts for easier review?

>   create mode 100644 arch/arm/boot/dts/infinity-msc313.dtsi
>   create mode 100644 arch/arm/boot/dts/infinity.dtsi
>   create mode 100644 arch/arm/boot/dts/infinity3-msc313e.dtsi
>   create mode 100644 arch/arm/boot/dts/infinity3.dtsi
>   create mode 100644 arch/arm/boot/dts/mercury5-ssc8336n.dtsi
>   create mode 100644 arch/arm/boot/dts/mercury5.dtsi
>   create mode 100644 arch/arm/boot/dts/mstar-v7.dtsi
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 754521938303..839ae0250d3d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2114,6 +2114,9 @@ ARM/MStar/Sigmastar ARMv7 SoC support
>   M:	Daniel Palmer <daniel@thingy.jp>
>   L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
>   S:	Maintained
> +F:	arch/arm/boot/dts/infinity*.dtsi
> +F:	arch/arm/boot/dts/mercury*.dtsi
> +F:	arch/arm/boot/dts/mstar-v7.dtsi

Sort order wrt D.

>   F:	arch/arm/mach-mstar/
>   F:	Documentation/devicetree/bindings/arm/mstar.yaml
>   
> diff --git a/arch/arm/boot/dts/infinity-msc313.dtsi b/arch/arm/boot/dts/infinity-msc313.dtsi
> new file mode 100644
> index 000000000000..4eb522e6a75d
> --- /dev/null
> +++ b/arch/arm/boot/dts/infinity-msc313.dtsi
> @@ -0,0 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0

DTs as hardware description should be dual-licensed as either MIT or 
BSD-2-Clause, similar to the schema.

Also, elsewhere, for any code that might get reused for OpenOCD (e.g., 
clk drivers and low-level init like machine - 2/5) or other non-kernel 
projects potentially incompatible with GPL-2.0-only, it would be useful 
to use the -or-later version of the GPL for code sharing - if the 
sources you used permit that.

> +/*
> + * Copyright (c) 2019 thingy.jp.

2019-2020? Check elsewhere.

> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include "infinity.dtsi"
> +
> +/ {
> +	memory {
> +		device_type = "memory";
> +		reg = <0x20000000 0x4000000>;

The memory node needs to become memory@20000000 then.

> +	};

I take it, this RAM is integrated? Maybe add some explanation of what 
this file is

> +};
> diff --git a/arch/arm/boot/dts/infinity.dtsi b/arch/arm/boot/dts/infinity.dtsi
> new file mode 100644
> index 000000000000..25d379028689
> --- /dev/null
> +++ b/arch/arm/boot/dts/infinity.dtsi
> @@ -0,0 +1,10 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 thingy.jp.
> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include "mstar-v7.dtsi"
> +
> +/ {
> +};

What do you intend to add here? Is it really needed? (same below)

Pre-DT-Schema I used to add a compatible property in the .dtsi, to make 
sure we have at least the SoC's, in case someone neglects to add one in 
their board's .dts. With DT schema that's no longer valid (if enum/const 
is required), but Linux would still work better with than without.

> diff --git a/arch/arm/boot/dts/infinity3-msc313e.dtsi b/arch/arm/boot/dts/infinity3-msc313e.dtsi
> new file mode 100644
> index 000000000000..d0c53153faad
> --- /dev/null
> +++ b/arch/arm/boot/dts/infinity3-msc313e.dtsi
> @@ -0,0 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 thingy.jp.
> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include "infinity3.dtsi"
> +
> +/ {
> +	memory {

Ditto, unit address missing.

> +		device_type = "memory";
> +		reg = <0x20000000 0x4000000>;
> +	};
> +};
> diff --git a/arch/arm/boot/dts/infinity3.dtsi b/arch/arm/boot/dts/infinity3.dtsi
> new file mode 100644
> index 000000000000..cf5f18a07835
> --- /dev/null
> +++ b/arch/arm/boot/dts/infinity3.dtsi
> @@ -0,0 +1,10 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 thingy.jp.
> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include "infinity.dtsi"
> +
> +/ {
> +};

Don't you anticipate incompatibilities between infinity and infinity3, 
i.e., things you don't want to inherit? Seems a bit optimistic. You can 
of course overwrite properties, but deleting is more difficult.

> diff --git a/arch/arm/boot/dts/mercury5-ssc8336n.dtsi b/arch/arm/boot/dts/mercury5-ssc8336n.dtsi
> new file mode 100644
> index 000000000000..7513f903c838
> --- /dev/null
> +++ b/arch/arm/boot/dts/mercury5-ssc8336n.dtsi
> @@ -0,0 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 thingy.jp.
> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include "mercury5.dtsi"
> +
> +/ {
> +	memory {

Unit address.

> +		device_type = "memory";
> +		reg = <0x20000000 0x4000000>;
> +	};
> +};
> diff --git a/arch/arm/boot/dts/mercury5.dtsi b/arch/arm/boot/dts/mercury5.dtsi
> new file mode 100644
> index 000000000000..25d379028689
> --- /dev/null
> +++ b/arch/arm/boot/dts/mercury5.dtsi
> @@ -0,0 +1,10 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 thingy.jp.
> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include "mstar-v7.dtsi"
> +
> +/ {
> +};
> diff --git a/arch/arm/boot/dts/mstar-v7.dtsi b/arch/arm/boot/dts/mstar-v7.dtsi
> new file mode 100644
> index 000000000000..0fccc4ca52a4
> --- /dev/null
> +++ b/arch/arm/boot/dts/mstar-v7.dtsi

So this is the only file starting with mstar. Have you thought about 
prefixing infinity/mercury, so that they're grouped together?

> @@ -0,0 +1,71 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 thingy.jp.
> + * Author: Daniel Palmer <daniel@thingy.jp>
> + */
> +
> +#include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;> 
> +	interrupt-parent = <&gic>;
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		cpu0: cpu@0 {
> +			device_type = "cpu";
> +			compatible = "arm,cortex-a7";
> +			reg = <0x0>;
> +		};
> +	};
> +
> +	arch_timer {
> +		compatible = "arm,armv7-timer";
> +		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2)
> +				| IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2)
> +				| IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2)
> +				| IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2)
> +				| IRQ_TYPE_LEVEL_LOW)>;
> +		clock-frequency = <6000000>;
> +	};
> +
> +	pmu {
> +		compatible = "arm,cortex-a7-pmu";
> +		interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
> +			     <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;

Lacking interrupt-affinity.

"This property should be present when there is more than a single SPI."

To deal with single- vs. dual-core models, you should give the pmu node 
a label, e.g., arm_pmu used elsewhere, I think. Depending on your 
preferences you could set it here in common code (less work) or in the 
SoC-specific .dtsi where you know the number of CPUs for sure (safer to 
not forget later).

> +	};
> +
> +	soc: soc {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;

I had been instructed not to use full identity ranges but to exclude RAM 
ranges for safety reasons.

> +
> +		gic: interrupt-controller@16001000 {
> +			compatible = "arm,cortex-a7-gic";
> +			#interrupt-cells = <3>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			interrupt-controller;
> +			reg = <0x16001000 0x1000>,
> +			      <0x16002000 0x1000>;

In addition to Marc's comments, please reorder reg to below compatible 
for consistency. Suggest to also reorder interrupt-controller before the 
-cells properties, after reg.

> +		};
> +
> +		pm_uart: uart@1f221000 {
> +			compatible = "ns16550a";
> +			reg = <0x1f221000 0x100>;
> +			reg-shift = <3>;
> +			clock-frequency = <172000000>;
> +			status = "disabled";
> +		};

If you have any decent manuals for these SoCs, I suggest to check 
whether there are any internal buses that you may want to model as 
simple-bus for grouping. In-tree examples include meson and recently 
merged rtd1195 - it affects the reg addresses and unit addresses via 
suitable ranges mappings.

> +	};
> +};

Regards,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

  parent reply	other threads:[~2020-06-11 13:39 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  6:15 [PATCH 1/4] dt-bindings: arm: Initial MStar vendor prefixes and compatible strings Daniel Palmer
2019-10-14  6:15 ` [PATCH 2/4] ARM: mstar: Add machine for MStar infinity family SoCs Daniel Palmer
2019-10-14 11:19   ` Arnd Bergmann
2020-06-10  9:03   ` [PATCH v2 0/5] Initial MStar/Sigmastar ARMv7 SoC support Daniel Palmer
2020-06-12 13:00     ` [PATCH v3 00/12] Initial MStar/Sigmastar Armv7 " Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 01/12] dt-bindings: vendor-prefixes: Add mstar vendor prefix Daniel Palmer
2020-06-16 12:15         ` [PATCH v4 00/12] Initial MStar/Sigmastar ARMv7 SoC support Daniel Palmer
2020-06-16 12:15           ` [PATCH v4 01/12] dt-bindings: vendor-prefixes: Add mstar vendor prefix Daniel Palmer
2020-07-09 23:04             ` Rob Herring
2020-06-16 12:15           ` [PATCH v4 02/12] dt-bindings: vendor-prefixes: Add sstar " Daniel Palmer
2020-07-09 23:04             ` Rob Herring
2020-06-16 12:15           ` [PATCH v4 03/12] dt-bindings: vendor-prefixes: Add 70mai " Daniel Palmer
2020-07-09 23:05             ` Rob Herring
2020-06-16 12:15           ` [PATCH v4 04/12] dt-bindings: vendor-prefixes: Add thingy.jp prefix Daniel Palmer
2020-07-09 23:05             ` Rob Herring
2020-06-16 12:15           ` [PATCH v4 05/12] dt-bindings: arm: Add mstar YAML schema Daniel Palmer
2020-07-09 23:04             ` Rob Herring
2020-06-16 12:15           ` [PATCH v4 06/12] ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs Daniel Palmer
2020-06-16 12:15           ` [PATCH v4 07/12] ARM: mstar: Add binding details for mstar,l3bridge Daniel Palmer
2020-07-09 23:06             ` Rob Herring
2020-06-16 12:15           ` [PATCH v4 08/12] ARM: mstar: Add Armv7 base dtsi Daniel Palmer
2020-06-16 12:15           ` [PATCH v4 09/12] ARM: mstar: Add infinity/infinity3 family dtsis Daniel Palmer
2020-06-16 12:15           ` [PATCH v4 10/12] ARM: mstar: Add mercury5 series dtsis Daniel Palmer
2020-06-16 12:15           ` [PATCH v4 11/12] ARM: mstar: Add dts for msc313(e) based BreadBee boards Daniel Palmer
2020-06-16 12:15           ` [PATCH v4 12/12] ARM: mstar: Add dts for 70mai midrive d08 Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 02/12] dt-bindings: vendor-prefixes: Add sstar vendor prefix Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 03/12] dt-bindings: vendor-prefixes: Add 70mai " Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 04/12] dt-bindings: vendor-prefixes: Add thingy.jp prefix Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 05/12] dt-bindings: dt-bindings: arm: Add mstar YAML schema Daniel Palmer
2020-06-12 22:07         ` Rob Herring
2020-06-12 13:00       ` [PATCH v3 06/12] ARM: mstar: Add machine for MStar/Sigmastar Armv7 SoCs Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 07/12] ARM: mstar: Add binding details for mstar,l3bridge Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 08/12] ARM: mstar: Add Armv7 base dtsi Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 09/12] ARM: mstar: Add infinity/infinity3 family dtsis Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 10/12] ARM: mstar: Add mercury5 series dtsis Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 11/12] ARM: mstar: Add dts for msc313(e) based BreadBee boards Daniel Palmer
2020-06-12 13:00       ` [PATCH v3 12/12] ARM: mstar: Add dts for 70mai midrive d08 Daniel Palmer
2020-06-10  9:03   ` [PATCH v2 1/5] dt-bindings: arm: Initial MStar vendor prefixes and compatible strings Daniel Palmer
2020-06-10  9:35     ` Andreas Färber
2020-06-10 10:29       ` Daniel Palmer
2020-06-11 15:00     ` Andreas Färber
2020-06-10  9:04   ` [PATCH v2 2/5] ARM: mstar: Add machine for MStar/Sigmastar infinity/mercury family ARMv7 SoCs Daniel Palmer
2020-06-10  9:43     ` Arnd Bergmann
2020-06-11 12:49     ` Andreas Färber
2020-06-11 13:01       ` Daniel Palmer
2020-06-11 14:27         ` Andreas Färber
2020-06-11 14:58           ` Daniel Palmer
2020-06-11 12:58     ` Andreas Färber
2020-06-11 13:18       ` Daniel Palmer
2020-06-10  9:04   ` [PATCH v2 3/5] ARM: mstar: Add infinity/mercury series dtsi Daniel Palmer
2020-06-10  9:35     ` Marc Zyngier
2020-06-11 13:39     ` Andreas Färber [this message]
2020-06-11 14:19       ` Daniel Palmer
2020-06-11 14:39         ` Andreas Färber
2020-06-11 15:07           ` Daniel Palmer
2020-06-10  9:04   ` [PATCH v2 4/5] ARM: mstar: Add dts for msc313(e) based BreadBee boards Daniel Palmer
2020-06-11 13:45     ` Andreas Färber
2020-06-11 14:26       ` Daniel Palmer
2020-06-10  9:04   ` [PATCH v2 5/5] ARM: mstar: Add dts for 70mai midrive d08 Daniel Palmer
2020-06-11 13:54     ` Andreas Färber
2020-06-11 14:38       ` Daniel Palmer
2019-10-14  6:15 ` [PATCH 3/4] ARM: mstar: Add infinity series dtsi Daniel Palmer
2019-10-14  6:15 ` [PATCH 4/4] ARM: mstar: Add dts for msc313e based BreadBee board Daniel Palmer
2019-10-23 20:02 ` [PATCH 1/4] dt-bindings: arm: Initial MStar vendor prefixes and compatible strings Rob Herring
2019-10-23 22:43   ` Daniel Palmer
2019-10-23 23:45     ` Rob Herring
2019-10-24  1:47       ` Daniel Palmer

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=bf26822d-acb0-ae40-df7f-80978bd26cfb@suse.de \
    --to=afaerber@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=allen.chen@ite.com.tw \
    --cc=ardb@kernel.org \
    --cc=armlinux@m.disordat.com \
    --cc=arnd@arndb.de \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@0x0f.com \
    --cc=daniel@thingy.jp \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.0xf0@gmail.com \
    --cc=heiko.stuebner@theobroma-systems.com \
    --cc=k@japko.eu \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkundrak@v3.sk \
    --cc=maz@kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mripard@kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=nhuck15@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=stephan@gerhold.net \
    --cc=tim.bird@sony.com \
    --cc=will@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /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).