devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Bintian Wang <bintian.wang@huawei.com>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	Pawel Moll <Pawel.Moll@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"khilman@linaro.org" <khilman@linaro.org>,
	"mturquette@linaro.org" <mturquette@linaro.org>,
	"rob.herring@linaro.org" <rob.herring@linaro.org>,
	"zhangfei.gao@linaro.org" <zhangfei.gao@linaro.org>,
	"haojian.zhuang@linaro.org" <haojian.zhuang@linaro.org>,
	"xuwei5@hisilicon.com" <xuwei5@hisilicon.com>,
	"jh80.chung@samsung.com" <jh80.chung@samsung.com>,
	"olof@lixom.net" <olof@lixom.net>
Subject: Re: [PATCH 3/3] arm64: dts: Add dts files for Hisilicon Hi6220 SoC
Date: Thu, 5 Feb 2015 19:30:17 +0000	[thread overview]
Message-ID: <20150205193017.GF20735@leverpostej> (raw)
In-Reply-To: <1423128277-10297-4-git-send-email-bintian.wang@huawei.com>

On Thu, Feb 05, 2015 at 09:24:37AM +0000, Bintian Wang wrote:
> Add initial dtsi file to support Hisilicon Hi6220 SoC with
> support of Octal core CPUs in two clusters and each cluster
> has quard Cortex-A53.
> 
> We now use the "spin-table" method for SMP, and it will be
> changed to PSCI later.

If that's the case, please don't place the enable-method and related
properties in this file. Get your bootloader to add the appropriate
properties for its boot protocol.

When is PSCI likely to appear?

Are we certain of the split between components the PSCI implementation
must touch and those the kernel must touch?

> Also add dts file to support HiKey development board which
> based on Hi6220 SoC and document the devicetree bindings.
> 
> These dts files will be changed later and more nodes will be
> added to describe other devices.

How is this going to be changed other than the addition of nodes?

Will this DTB continue to work in future? Or do you intend to make
changes that will break support?

> Signed-off-by: Bintian Wang <bintian.wang@huawei.com>
> Reviewed-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> Reviewed-by: Yiping Xu <xuyiping@hisilicon.com>
> ---
>  .../bindings/arm/hisilicon/hisilicon.txt           |   33 ++++
>  arch/arm64/boot/dts/Makefile                       |    1 +
>  arch/arm64/boot/dts/hisilicon/Makefile             |    5 +
>  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts     |   31 +++
>  arch/arm64/boot/dts/hisilicon/hi6220.dtsi          |  204 ++++++++++++++++++++
>  5 files changed, 274 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/hisilicon/Makefile
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> 
> diff --git a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> index f717c7b..5eb6b41 100644
> --- a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> +++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> @@ -9,6 +9,9 @@ HiP04 D01 Board
>  Required root node properties:
>  	- compatible = "hisilicon,hip04-d01";
>  
> +HiKey Board
> +Required root node properties:
> +	- compatible = "hisilicon,hi6220-hikey";
>  
>  Hisilicon system controller
>  
> @@ -62,6 +65,36 @@ Example:
>  	};
>  
>  -----------------------------------------------------------------------
> +Hisilicon Power Always ON domain controller
> +
> +Required properties:
> +- compatible : "hisilicon,aoctrl"
> +- reg : Register address and size
> +
> +Some clock registers are defined in power always on system controller,
> +especially in Hi6220 SoC which is used for mobile platform.
> +
> +-----------------------------------------------------------------------
> +Hisilicon Media domain controller
> +
> +Required properties:
> +- compatible : "hisilicon,mediactrl"
> +- reg : Register address and size
> +
> +Some clock registers of media module are defined in media system
> +controller, especially in Hi6220 SoC which is used for mobile platform.
> +
> +-----------------------------------------------------------------------
> +Hisilicon Power Management domain controller
> +
> +Required properties:
> +- compatible : "hisilicon,pmctrl"
> +- reg : Register address and size
> +
> +Some clock registers and PMU registers are defined in power management
> +controller, especially in Hin6220 SoC which is used for mobile platform.
> +
> +-----------------------------------------------------------------------

Looking at the dts below, none of these binding docs are sufficient.

Define _all_ the properties and what they mean.

Please also split documentation into earlier patches.

>  Fabric:
>  
>  Required Properties:
> diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
> index c62b0f4..bffd6b7 100644
> --- a/arch/arm64/boot/dts/Makefile
> +++ b/arch/arm64/boot/dts/Makefile
> @@ -2,5 +2,6 @@ dts-dirs += amd
>  dts-dirs += apm
>  dts-dirs += arm
>  dts-dirs += cavium
> +dts-dirs += hisilicon
>  
>  subdir-y	:= $(dts-dirs)
> diff --git a/arch/arm64/boot/dts/hisilicon/Makefile b/arch/arm64/boot/dts/hisilicon/Makefile
> new file mode 100644
> index 0000000..fa81a6e
> --- /dev/null
> +++ b/arch/arm64/boot/dts/hisilicon/Makefile
> @@ -0,0 +1,5 @@
> +dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb
> +
> +always		:= $(dtb-y)
> +subdir-y	:= $(dts-dirs)
> +clean-files	:= *.dtb
> diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> new file mode 100644
> index 0000000..a94da84
> --- /dev/null
> +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> @@ -0,0 +1,31 @@
> +/*
> + * dts file for Hisilicon HiKey Development Board
> + *
> + * Copyright (C) 2015, Hisilicon Ltd.
> + *
> + */
> +
> +/dts-v1/;
> +
> +/memreserve/ 0x0740f000 0x1000;

If you're going to use /memreserve/, please add a comment regarding what
it is intended to protect, and why that's in memory given to the kernel
to begin with.

> +
> +#include "hi6220.dtsi"
> +
> +/ {
> +	model = "HiKey Development Board";
> +	compatible = "hisilicon,hi6220-hikey";
> +	#address-cells = <2>;
> +	#size-cells = <2>;
> +	interrupt-parent = <&gic>;
> +
> +	aliases {
> +		serial0 = &uart0;
> +	};
> +
> +	chosen { };

You should use stdout-path here, ideally with the full UART
configuration.

> +
> +	memory@7400000 {
> +		device_type = "memory";
> +		reg = <0x0 0x07400000 0x0 0x38c00000>;
> +	};
> +};
> diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> new file mode 100644
> index 0000000..53ba9cf
> --- /dev/null
> +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> @@ -0,0 +1,204 @@
> +/*
> + * dts file for Hisilicon Hi6220 SoC
> + *
> + * Copyright (C) 2015, Hisilicon Ltd.
> + */
> +
> +#include <dt-bindings/clock/hi6220-clock.h>
> +
> +/ {
> +	cpu-map {

Per the binding, this must live under /cpus. 

Move this within the /cpus node.

> +		cluster0 {
> +			core0 {
> +				cpu = <&cpu0>;
> +			};
> +			core1 {
> +				cpu = <&cpu1>;
> +			};
> +			core2 {
> +				cpu = <&cpu2>;
> +			};
> +			core3 {
> +				cpu = <&cpu3>;
> +			};
> +		};
> +		cluster1 {
> +			core0 {
> +				cpu = <&cpu4>;
> +			};
> +			core1 {
> +				cpu = <&cpu5>;
> +			};
> +			core2 {
> +				cpu = <&cpu6>;
> +			};
> +			core3 {
> +				cpu = <&cpu7>;
> +			};
> +		};
> +	};
> +
> +	cpus {
> +		#address-cells = <2>;
> +		#size-cells = <0>;
> +
> +		cpu0: cpu@000 {
> +			compatible = "arm,cortex-a53", "arm,armv8";
> +			device_type = "cpu";
> +			reg = <0x0 0x0>;
> +			enable-method = "spin-table";
> +			cpu-release-addr = <0x0 0x740fff8>;

If you _must_ use spin-table, please give each CPU a unique release
address. Using a shared address was a mistake, and we should learn from
it.

Which CPU does the system boot on?

> +			clock-latency = <0>;

Why is this here?

There is no reason for this to be on any CPU node.

> +		};

[...]

> +	gic: interrupt-controller@f6800000 {
> +		compatible = "arm,gic-400", "arm,cortex-a15-gic";

Surely there's no need for the "arm,cortex-a15-gic" fallback entry? What
am I missing?

> +		reg = <0x0 0xf6801000 0x0 0x1000>, /* GICD */

This doesn't match the unit-address.

> +		      <0x0 0xf6802000 0x0 0x2000>, /* GICC */
> +		      <0x0 0xf6804000 0x0 0x2000>, /* GICH */
> +		      <0x0 0xf6806000 0x0 0x2000>; /* GICV */

I guess no-one's bothered to consider 64k pages?

Given GICH and GICV, I hope that this platform is booted at EL2?

> +		#interrupt-cells = <3>;
> +		#address-cells = <0>;
> +		interrupt-controller;
> +	};
> +
> +
> +	timer {
> +		compatible = "arm,armv8-timer";
> +		interrupt-parent = <&gic>;
> +		interrupts = <1 13 0xff08>,
> +			     <1 14 0xff08>,
> +			     <1 11 0xff08>,
> +			     <1 10 0xff08>;
> +		clock-frequency = <1200000>;
> +	};

NAK. Fix your firmware to configure CNTFRQ, on all CPUs.

That frequency also looks a bit low; timekeeping isn't going to be very
precise.

> +	soc {
> +		compatible = "simple-bus";
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		interrupt-parent = <&gic>;
> +		ranges;
> +
> +		ao_ctrl: ao_ctrl {
> +			compatible = "hisilicon,aoctrl", "syscon";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			reg = <0x0 0xf7800000 0x0 0x2000>;
> +			ranges = <0 0x0 0xf7800000 0x2000>;
> +
> +			clock_ao: clock0@0 {
> +				compatible = "hisilicon,hi6220-clock-ao";
> +				reg = <0 0x1000>;
> +				#clock-cells = <1>;
> +			};
> +		};
> +
> +		sys_ctrl: sys_ctrl {
> +			compatible = "hisilicon,sysctrl", "syscon";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			reg = <0x0 0xf7030000 0x0 0x2000>;
> +			ranges = <0 0x0 0xf7030000 0x2000>;
> +
> +			clock_sys: clock1@0 {
> +				compatible = "hisilicon,hi6220-clock-sys";
> +				reg = <0 0x1000>;
> +				#clock-cells = <1>;
> +			};
> +		};
> +
> +		media_ctrl: media_ctrl {
> +			compatible = "hisilicon,mediactrl", "syscon";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			reg = <0x0 0xf4410000 0x0 0x1000>;
> +			ranges = <0 0x0 0xf4410000 0x1000>;
> +
> +			clock_media: clock2@0 {
> +				compatible = "hisilicon,hi6220-clock-media";
> +				reg = <0 0x1000>;
> +				#clock-cells = <1>;
> +			};
> +		};
> +
> +		pm_ctrl: pm_ctrl {
> +			compatible = "hisilicon,pmctrl", "syscon";
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			reg = <0x0 0xf7032000 0x0 0x1000>;
> +			ranges = <0 0x0 0xf7032000 0x1000>;
> +
> +			clock_power: clock3@0 {
> +				compatible = "hisilicon,hi6220-clock-power";
> +				reg = <0 0x1000>;
> +				#clock-cells = <1>;
> +			};
> +		};

I really doesn't see the point in having a sub-device that covers the
entirely of the register space of the containing node, and that being
the case I am extremely concerned that the containers are marked as
syscon compatible.

Why are these marked as being syscon devices? Per the dts _all_ their
registers are clearly owned by their child nodes, and shouldn't be poked
by anything else.

Thanks,
Mark.

  reply	other threads:[~2015-02-05 19:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05  9:24 [PATCH 0/3] arm64,hi6220: Enable Hisilicon Hi6220 SoC Bintian Wang
2015-02-05  9:24 ` [PATCH 1/3] arm64: Enable Hisilicon ARMv8 SoC family in Kconfig and defconfig Bintian Wang
2015-02-05  9:24 ` [PATCH 2/3] clk: hi6220: Clock driver support for Hisilicon hi6220 SoC Bintian Wang
2015-02-05 19:25   ` Mark Rutland
2015-02-06  7:32     ` Brent Wang
     [not found]   ` <1423128277-10297-3-git-send-email-bintian.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-02-06 18:10     ` Tyler Baker
     [not found]       ` <CANMBJr4Jnuooogi7rhn2MRNKuRP9=9fr5NFUtEMg_1JNCg3sig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-07  2:05         ` Brent Wang
2015-02-07 22:05           ` Tyler Baker
     [not found] ` <1423128277-10297-1-git-send-email-bintian.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-02-05  9:24   ` [PATCH 3/3] arm64: dts: Add dts files for Hisilicon Hi6220 SoC Bintian Wang
2015-02-05 19:30     ` Mark Rutland [this message]
2015-02-06  8:42       ` Brent Wang
2015-02-06  9:07         ` Marc Zyngier
2015-02-06 10:31           ` Mark Rutland
2015-02-09  3:26           ` Brent Wang
2015-02-06 10:44         ` Mark Rutland
2015-02-06 15:37           ` Brent Wang
     [not found]             ` <CAAS=xmhcfeQjfyizJa38k+08pbY5WFOZH0a1wEx+gwqgVe0MXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-10 13:37               ` Mark Rutland
2015-02-10 14:20                 ` Brent Wang
2015-02-10 15:27                   ` Mark Rutland
2015-02-11  1:49                     ` Brent Wang
2015-04-12  6:40         ` Brent Wang
2015-04-12 10:57           ` Marc Zyngier
2015-04-12 13:07             ` Brent Wang
2015-02-05 18:46   ` [PATCH 0/3] arm64,hi6220: Enable " Tyler Baker
     [not found]     ` <CANMBJr685FzZzQ660Z1aNJX+Kzkw1OqM6RJAviARbL+5a=MJ2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-05 19:02       ` Olof Johansson
     [not found]         ` <CAOesGMgjv9iLnLmpLADQYoAw=oUkJDAJs72Q5q=DQ75paQ+A-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-05 23:52           ` Tyler Baker
2015-02-06  4:21             ` Brent Wang
     [not found]               ` <CAAS=xmhj8UMwooYrXQBqzR=J5ernj+EWGV1AqEtHHoWiBgw8gA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-06  6:18                 ` Olof Johansson
     [not found]                   ` <CAOesGMhKRtcGwE-5ZKsZC42ZCBYtLV9A0RT0mEySwsU2uk5cSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-06  6:35                     ` Brent Wang

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=20150205193017.GF20735@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=Pawel.Moll@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=bintian.wang@huawei.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jh80.chung@samsung.com \
    --cc=khilman@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=olof@lixom.net \
    --cc=rob.herring@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=xuwei5@hisilicon.com \
    --cc=zhangfei.gao@linaro.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).