[RFC PATCH 06/10] arm64: dts: apple: Add initial t6000/t6001/t6002 DTs

Rob Herring robh at kernel.org
Thu Sep 15 05:48:13 PDT 2022


On Wed, Sep 14, 2022 at 6:04 AM Janne Grunau <j at jannau.net> wrote:
>
> On 2022-09-13 08:32:07 -0500, Rob Herring wrote:
> > On Fri, Sep 09, 2022 at 03:50:59PM +0200, Janne Grunau wrote:
> > > From: Hector Martin <marcan at marcan.st>
> > >
> > > These SoCs are found in Apple devices with M1 Pro (t6000), M1 Max
> > > (t6001) and M1 Ultra (t6002).
> > >
> > > t6000 is a cut-down version of t6001, so the former just includes the
> > > latter and disables the missing bits (This is currently just one PMGR
> > > node and all of its domains.
> > >
> > > t6002 is two connected t6001 dies. The implementation seems to use
> > > t6001 with blocks disabled (mostly on the second die). MMIO addresses on
> > > the second die have a constant offset. The interrupt controller is
> > > multi-die aware. This setup can be represented in the device tree with
> > > two top level "soc" nodes. The MMIO offset is applied via "ranges" and
> > > devices are included with preproceesor macros to make the node labels
> > > unique and to specify the die number for the interrupt definition.
> > >
> > > Device nodes are distributed over dtsi files based on whether they are
> > > present on both dies or just on the first die. The only execption is the
> > > NVMe controller which resides on the second die. Its nodes are in a
> > > separate file.
> > >
> > > Signed-off-by: Hector Martin <marcan at marcan.st>
> > > Co-developed-by: Janne Grunau <j at jannau.net>
> > > Signed-off-by: Janne Grunau <j at jannau.net>
> > >
> > > ---
> > >
> > >
> > > ---
> > >  arch/arm64/boot/dts/apple/multi-die-cpp.h     |   23 +
> > >  arch/arm64/boot/dts/apple/t6000.dtsi          |   18 +
> > >  arch/arm64/boot/dts/apple/t6001.dtsi          |   63 +
> > >  arch/arm64/boot/dts/apple/t6002.dtsi          |  173 ++
> > >  arch/arm64/boot/dts/apple/t600x-common.dtsi   |  128 ++
> > >  arch/arm64/boot/dts/apple/t600x-die0.dtsi     |  298 +++
> > >  arch/arm64/boot/dts/apple/t600x-dieX.dtsi     |  103 +
> > >  .../arm64/boot/dts/apple/t600x-gpio-pins.dtsi |   45 +
> > >  arch/arm64/boot/dts/apple/t600x-nvme.dtsi     |   42 +
> > >  arch/arm64/boot/dts/apple/t600x-pmgr.dtsi     | 2012 +++++++++++++++++
> > >  10 files changed, 2905 insertions(+)
> > >  create mode 100644 arch/arm64/boot/dts/apple/multi-die-cpp.h
> > >  create mode 100644 arch/arm64/boot/dts/apple/t6000.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t6001.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t6002.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t600x-common.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t600x-die0.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t600x-dieX.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t600x-gpio-pins.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t600x-nvme.dtsi
> > >  create mode 100644 arch/arm64/boot/dts/apple/t600x-pmgr.dtsi
> > >
> > > diff --git a/arch/arm64/boot/dts/apple/multi-die-cpp.h b/arch/arm64/boot/dts/apple/multi-die-cpp.h
> > > new file mode 100644
> > > index 000000000000..153d89dd0ae1
> > > --- /dev/null
> > > +++ b/arch/arm64/boot/dts/apple/multi-die-cpp.h
> > > @@ -0,0 +1,23 @@
> > > +/* SPDX-License-Identifier: GPL-2.0+ OR MIT
> > > + *
> > > + * C preprocessor macros for t600x multi die support.
> > > + */
> > > +
> > > +#ifndef __DTS_APPLE_MULTI_DIE_CPP_H
> > > +#define __DTS_APPLE_MULTI_DIE_CPP_H
> > > +
> > > +#ifndef __stringify
> > > +/* copied from include/linux/stringify.h */
> >
> > Which is dual licensed? Arguably, not big enough to matter.
>
> include/linux/stringify.h has no license header at all. If that's
> acceptable I will drop it from this file as well.
> I started from scratch with the SPDX header from other apple dts files.
> I should have paid more attention after replacing it with kernel
> __stringify (I probably would have updated it if stringify.h had a SPDX
> header).

I'd leave the license and just drop the comment. The construct is not
copyrightable IMO.

> > > +#define __stringify_1(x...)     #x
> > > +#define __stringify(x...)       __stringify_1(x)
> > > +#endif
> > > +
> > > +#ifndef __concat
> > > +#define __concat_1(x, y...)     x ## y
> > > +#define __concat(x, y...)       __concat_1(x, y)
> > > +#endif
> > > +
> > > +#define DIE_NODE(a) __concat(a, DIE)
> > > +#define DIE_LABEL(a) __stringify(__concat(a, DIE))
> >
> > Not a pattern we encourage in DT, but seems necessary here.
>
> That is probably an arguments for keeping __concat/__stringify local
> instead of adding it to include/dt-bindings

Yes.

> > > +
> > > +#endif /* !__LINUX_STRINGIFY_H */

Stale comment.

Rob



More information about the linux-arm-kernel mailing list