[PATCH v2] docs: dt-bindings: add DTS Coding Style document
Dmitry Baryshkov
dmitry.baryshkov at linaro.org
Tue Nov 21 02:13:13 PST 2023
On Tue, 21 Nov 2023 at 10:09, Geert Uytterhoeven <geert at linux-m68k.org> wrote:
>
> Hi Krzysztof,
>
> On Tue, Nov 21, 2023 at 8:47 AM Krzysztof Kozlowski
> <krzysztof.kozlowski at linaro.org> wrote:
> > On 21/11/2023 08:33, Michal Simek wrote:
> > > On 11/20/23 20:31, Krzysztof Kozlowski wrote:
> > >> On 20/11/2023 20:18, Geert Uytterhoeven wrote:
> > >>> On Mon, Nov 20, 2023 at 3:53 PM Krzysztof Kozlowski
> > >>> <krzysztof.kozlowski at linaro.org> wrote:
> > >>>> On 20/11/2023 15:01, Michal Simek wrote:> >
> > >>>>> On 11/20/23 09:40, Krzysztof Kozlowski wrote:
> > >>>>>> Document preferred coding style for Devicetree sources (DTS and DTSI),
> > >>>>>> to bring consistency among all (sub)architectures and ease in reviews.
> > >>>
> > >>>>>> +Organizing DTSI and DTS
> > >>>>>> +-----------------------
> > >>>>>> +
> > >>>>>> +The DTSI and DTS files should be organized in a way representing the common
> > >>>>>> +(and re-usable) parts of the hardware. Typically this means organizing DTSI
> > >>>>>> +and DTS files into several files:
> > >>>>>> +
> > >>>>>> +1. DTSI with contents of the entire SoC (without nodes for hardware not present
> > >>>>>> + on the SoC).
> > >>>>>> +2. If applicable: DTSI with common or re-usable parts of the hardware (e.g.
> > >>>>>> + entire System-on-Module).
> > >>>>>
> > >>>>> DTS/DTSI - SOMs can actually run as they are that's why it is fair to say that
> > >>>>> there doesn't need to be DTS representing the board.
> > >>>>
> > >>>> I have never seen a SoM which can run without elaborate hardware-hacking
> > >>>> (e.g. connecting multiple wires to the SoM pins). The definition of the
> > >>>> SoM is that it is a module. Module can be re-used, just like SoC.
> > >>>
> > >>> /me looks at his board farm...
>
> > >>> I guess there are (many) other examples...
> > >>
> > >> OK, I never had such in my hands. Anyway, the SoM which can run
> > >> standalone has a meaning of a board, so how exactly you want to
> > >> rephrase the paragraph?
> > >
> > > What about?
> > >
> > > 2. If applicable: DTSI with common or re-usable parts of the hardware (e.g.
> > > entire System-on-Module). DTS if runs standalone.
> >
> > OK, but then it's duplicating the option 3. It also suggests that SoM
> > should be a DTS, which is not what we want for such case. Such SoMs must
> > have DTSI+DTS.
>
> So you want us to have a one-line <SoM>.dts, which just includes <SoM>.dtsi?
Well, I think it is impossible to run SoM directly. There is a carrier
board anyway, which includes at least regulators. So, I guess, the
SoM.dts will not be a oneline file.
> IMHO that adds more files for no much gain.
> Users of a SoM can easily include <SoM>.dts.
> 'git grep "#include .*dts\>"' tells you we have plenty of users of that scheme.
--
With best wishes
Dmitry
More information about the Linux-rockchip
mailing list