From: Florian Fainelli <f.fainelli@gmail.com>
To: Scott Branden <scott.branden@broadcom.com>,
Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>, Ray Jui <rjui@broadcom.com>,
BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
devicetree@vger.kernel.org,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arm64: dts: stingray: use NUM_SATA to configure number of sata ports
Date: Wed, 13 Jun 2018 17:46:32 -0700 [thread overview]
Message-ID: <0b235716-516f-c32c-f520-f0d9411ac01e@gmail.com> (raw)
In-Reply-To: <0bf3c57c-dac8-8ece-6b8a-3b4d024140fc@broadcom.com>
On 06/13/2018 01:18 PM, Scott Branden wrote:
> Hi Rob,
>
> Thanks for comment - reply inline.
>
>
> On 18-06-13 12:31 PM, Florian Fainelli wrote:
>> On 06/12/2018 03:54 PM, Rob Herring wrote:
>>> On Thu, Jun 7, 2018 at 12:53 PM, Scott Branden
>>> <scott.branden@broadcom.com> wrote:
>>>> Hi Rob,
>>>>
>>>> Could you please kindly comment on change below.
>>>>
>>>> It allows board variants to be added easily via a simple define for
>>>> different number of SATA ports.
>>>>
>>>>
>>>>
>>>> On 18-06-04 09:22 AM, Florian Fainelli wrote:
>>>>> On 05/18/2018 11:34 AM, Scott Branden wrote:
>>>>>> Move remaining sata configuration to stingray-sata.dtsi and enable
>>>>>> ports based on NUM_SATA defined.
>>>>>> Now, all that needs to be done is define NUM_SATA per board.
>>>>> Rob could you review this and let us know if this approach is okay or
>>>>> not? Thank you!
>>>>>
>>>>>> Signed-off-by: Scott Branden <scott.branden@broadcom.com>
>>>>>> ---
>>>>>> diff --git a/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi
>>>>>> b/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi
>>>>>> index 8c68e0c..7f6d176 100644
>>>>>> --- a/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi
>>>>>> +++ b/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi
>>>>>> @@ -43,7 +43,11 @@
>>>>>> interrupts = <GIC_SPI 321
>>>>>> IRQ_TYPE_LEVEL_HIGH>;
>>>>>> #address-cells = <1>;
>>>>>> #size-cells = <0>;
>>>>>> +#if (NUM_SATA > 0)
>>>>>> + status = "okay";
>>>>>> +#else
>>>>>> status = "disabled";
>>>>>> +#endif
>>> This only works if ports are contiguously enabled (0-N). You might not
>>> care, but it is not a pattern that works in general.
> Correct - all board designs that include this dtsi file follow such
> commonality (ie. design with SATA0 first, etc). By having common board
> designs it allows for commonality in dts files rather than duplicating
> information everywhere. If somebody designs a bizarro board they are
> free to create their own dts file of course.
>>> And I'm not a fan
>>> of C preprocessing in DT files in general beyond just defines for
>>> single numbers.
> The use of a define to specify the number of SATA ports in the board
> design meets our requirements of being able to maintain many boards. We
> need a method to specify the number of ports in the board design rather
> than copying and pasting the information in many dts files. If you have
> an alternative upstreamable mechanism to manage the configuration of
> many boards without copy and paste that would be ideal?
We had discussed this off-list, but I really think you should be having
some sort of higher level scripting engine which is able to generate
valid per-board DTS files and not have the kernel and its use of the C
pre-processor attempt to solve your problems because a) it's the wrong
place, and b) it is limited.
--
Florian
prev parent reply other threads:[~2018-06-14 0:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 18:34 [PATCH] arm64: dts: stingray: use NUM_SATA to configure number of sata ports Scott Branden
2018-06-04 16:22 ` Florian Fainelli
2018-06-07 18:53 ` Scott Branden
2018-06-12 22:54 ` Rob Herring
2018-06-13 19:31 ` Florian Fainelli
2018-06-13 20:18 ` Scott Branden
2018-06-13 22:06 ` Rob Herring
2018-06-14 18:53 ` Scott Branden
2018-06-14 0:46 ` Florian Fainelli [this message]
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=0b235716-516f-c32c-f520-f0d9411ac01e@gmail.com \
--to=f.fainelli@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=rjui@broadcom.com \
--cc=robh+dt@kernel.org \
--cc=scott.branden@broadcom.com \
--cc=will.deacon@arm.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).