Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1313143ybg; Thu, 11 Jun 2020 06:45:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhrKYVs8BylC5hIKirM/IfOh5YZ+y/L/Hg1//dyYJxvcqdoIRs4ffNT1AFunqAbnxaMu7/ X-Received: by 2002:a17:906:93f7:: with SMTP id yl23mr1237830ejb.366.1591883116070; Thu, 11 Jun 2020 06:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591883116; cv=none; d=google.com; s=arc-20160816; b=l71q+sngW7zts0PNTPUM7lRE3MAw086WBQGHVG25l721kIgLDMOKVKEem4QUA6tiYs TsvWWKnbpLnLh7AF+sL0mxXjdg5XAv/wPnm809xzINIOzjjilw3YaneVC4LeU5F1aUcp Muw5qSPvLfPTaL3QnTeEmrMo3E8p1B6M/He7A8JjZp/E3ZIYQwqHlKMCgkybgqWtWMRK IqbnMBOvlN2ySHlOznyPlrUuXfy2thW3ph1lzQ76VHNs7AZTZoGKya1GsODFzdkHcEfM OTeSuXS2JIU1XcdodqyZw8q/bGj9rwsYGhOe6a/H0GEXQtPKjZqbg4JlegkIIzNnZ4tb KXEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=Ga1lsqzyoz/oqeVw/oI5pFLAXnI3JXO6ec/SYmoqDnU=; b=CT1cHg7wNuoPalYbIThRjv8U8i8T4iahj3vfLaThtH9Hju/1YOFZGO+IjsGPOkLAJc CX5DwzqDjcqDPL7LN8pyRoXFXJcJs42L2wD276fAmXXWN0cxdhDTlt4yMk5W1ZXzzrYs fzO9nbTJinQYrAa/bN0TSoLK4vDMwCPiB9a1i1JragGO3TFCTFYwwHElr2o3fZmKhLjy ewwEy3FnVvegpB89YOOs/5ev/WejN3yTPcSni+C3GbSZkvKO9P9DXw/vlbKc1pmr2QWG 4vAf6vfaPIMOyp8pVEcfuXE7XT/pitiQhdr6VDQ3Y5Zn4fD9djaapxNzcjpetxVb9ZoS JuHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 89si1619488edo.209.2020.06.11.06.44.52; Thu, 11 Jun 2020 06:45:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728298AbgFKNjf (ORCPT + 99 others); Thu, 11 Jun 2020 09:39:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:49168 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbgFKNjf (ORCPT ); Thu, 11 Jun 2020 09:39:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0D165AF7C; Thu, 11 Jun 2020 13:39:34 +0000 (UTC) Subject: Re: [PATCH v2 3/5] ARM: mstar: Add infinity/mercury series dtsi To: Daniel Palmer Cc: k@japko.eu, tim.bird@sony.com, devicetree@vger.kernel.org, Daniel Palmer , Rob Herring , Russell King , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Maxime Ripard , Lubomir Rintel , Stephan Gerhold , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Corbet , Arnd Bergmann , Andrew Morton , Doug Anderson , Benjamin Gaignard , Gregory Fong , Bartosz Golaszewski , Masahiro Yamada , Nick Desaulniers , Will Deacon , Nathan Huckleberry , Nathan Chancellor , Marc Zyngier , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20191014061617.10296-2-daniel@0x0f.com> <20200610090421.3428945-4-daniel@0x0f.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Organization: SUSE Software Solutions Germany GmbH Message-ID: Date: Thu, 11 Jun 2020 15:39:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200610090421.3428945-4-daniel@0x0f.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > 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 > + */ > + > +#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 > + */ > + > +#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 > + */ > + > +#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 > + */ > + > +#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 > + */ > + > +#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 > + */ > + > +#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 > + */ > + > +#include > +#include > + > +/ { > + #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 = + | IRQ_TYPE_LEVEL_LOW)>, > + + | IRQ_TYPE_LEVEL_LOW)>, > + + | IRQ_TYPE_LEVEL_LOW)>, > + + | IRQ_TYPE_LEVEL_LOW)>; > + clock-frequency = <6000000>; > + }; > + > + pmu { > + compatible = "arm,cortex-a7-pmu"; > + interrupts = , > + , > + , > + ; 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)