Commit 7b0b0191 authored by Hector Martin's avatar Hector Martin
Browse files

arm64: dts: apple: Add initial t6000/t6001/t6002 DTs



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.

Co-developed-by: default avatarJanne Grunau <j@jannau.net>
Signed-off-by: default avatarJanne Grunau <j@jannau.net>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarHector Martin <marcan@marcan.st>
parent 6053bb2c
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
/* 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
#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))

#endif /* !__DTS_APPLE_MULTI_DIE_CPP_H */
+18 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
 * Apple T6000 "M1 Pro" SoC
 *
 * Other names: H13J, "Jade Chop"
 *
 * Copyright The Asahi Linux Contributors
 */

/* This chip is just a cut down version of t6001, so include it and disable the missing parts */

#include "t6001.dtsi"

/ {
	compatible = "apple,t6000", "apple,arm-platform";
};

/delete-node/ &pmgr_south;
+63 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
 * Apple T6001 "M1 Max" SoC
 *
 * Other names: H13J, "Jade"
 *
 * Copyright The Asahi Linux Contributors
 */

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/apple.h>

#include "multi-die-cpp.h"

#include "t600x-common.dtsi"

/ {
	compatible = "apple,t6001", "apple,arm-platform";

	soc {
		compatible = "simple-bus";
		#address-cells = <2>;
		#size-cells = <2>;

		ranges;
		nonposted-mmio;

		// filled via templated includes at the end of the file
	};
};

#define DIE
#define DIE_NO 0

&{/soc} {
	#include "t600x-die0.dtsi"
	#include "t600x-dieX.dtsi"
	#include "t600x-nvme.dtsi"
};

#include "t600x-gpio-pins.dtsi"
#include "t600x-pmgr.dtsi"

#undef DIE
#undef DIE_NO


&aic {
	affinities {
		e-core-pmu-affinity {
			apple,fiq-index = <AIC_CPU_PMU_E>;
			cpus = <&cpu_e00 &cpu_e01>;
		};

		p-core-pmu-affinity {
			apple,fiq-index = <AIC_CPU_PMU_P>;
			cpus = <&cpu_p00 &cpu_p01 &cpu_p02 &cpu_p03
				&cpu_p10 &cpu_p11 &cpu_p12 &cpu_p13>;
		};
	};
};
+175 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
 * Apple T6002 "M1 Ultra" SoC
 *
 * Other names: H13J, "Jade 2C"
 *
 * Copyright The Asahi Linux Contributors
 */

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/apple.h>

#include "multi-die-cpp.h"

#include "t600x-common.dtsi"

/ {
	compatible = "apple,t6002", "apple,arm-platform";

	#address-cells = <2>;
	#size-cells = <2>;

	cpus {
		cpu_e10: cpu@800 {
			compatible = "apple,icestorm";
			device_type = "cpu";
			reg = <0x0 0x800>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_e11: cpu@801 {
			compatible = "apple,icestorm";
			device_type = "cpu";
			reg = <0x0 0x801>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p20: cpu@10900 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10900>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p21: cpu@10901 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10901>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p22: cpu@10902 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10902>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p23: cpu@10903 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10903>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p30: cpu@10a00 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10a00>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p31: cpu@10a01 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10a01>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p32: cpu@10a02 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10a02>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p33: cpu@10a03 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10a03>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};
	};

	die0: soc@200000000 {
		compatible = "simple-bus";
		#address-cells = <2>;
		#size-cells = <2>;
		ranges = <0x2 0x0 0x2 0x0 0x4 0x0>,
			 <0x5 0x80000000 0x5 0x80000000 0x1 0x80000000>,
			 <0x7 0x0 0x7 0x0 0xf 0x80000000>;
		nonposted-mmio;

		// filled via templated includes at the end of the file
	};

	die1: soc@2200000000 {
		compatible = "simple-bus";
		#address-cells = <2>;
		#size-cells = <2>;
		ranges = <0x2 0x0 0x22 0x0 0x4 0x0>,
			 <0x7 0x0 0x27 0x0 0xf 0x80000000>;
		nonposted-mmio;

		// filled via templated includes at the end of the file
	};
};

#define DIE
#define DIE_NO 0

&die0 {
	#include "t600x-die0.dtsi"
	#include "t600x-dieX.dtsi"
};

#include "t600x-pmgr.dtsi"
#include "t600x-gpio-pins.dtsi"

#undef DIE
#undef DIE_NO

#define DIE _die1
#define DIE_NO 1

&die1 {
	#include "t600x-dieX.dtsi"
	#include "t600x-nvme.dtsi"
};

#include "t600x-pmgr.dtsi"

#undef DIE
#undef DIE_NO


&aic {
	affinities {
		e-core-pmu-affinity {
			apple,fiq-index = <AIC_CPU_PMU_E>;
			cpus = <&cpu_e00 &cpu_e01
				&cpu_e10 &cpu_e11>;
		};

		p-core-pmu-affinity {
			apple,fiq-index = <AIC_CPU_PMU_P>;
			cpus = <&cpu_p00 &cpu_p01 &cpu_p02 &cpu_p03
				&cpu_p10 &cpu_p11 &cpu_p12 &cpu_p13
				&cpu_p20 &cpu_p21 &cpu_p22 &cpu_p23
				&cpu_p30 &cpu_p31 &cpu_p32 &cpu_p33>;
		};
	};
};
+128 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
 * Common Apple T6000 / T6001 / T6002 "M1 Pro/Max/Ultra" SoC
 *
 * Other names: H13J, "Jade Chop", "Jade", "Jade 2C"
 *
 * Copyright The Asahi Linux Contributors
 */

/ {
	#address-cells = <2>;
	#size-cells = <2>;

	cpus {
		#address-cells = <2>;
		#size-cells = <0>;

		cpu_e00: cpu@0 {
			compatible = "apple,icestorm";
			device_type = "cpu";
			reg = <0x0 0x0>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_e01: cpu@1 {
			compatible = "apple,icestorm";
			device_type = "cpu";
			reg = <0x0 0x1>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p00: cpu@10100 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10100>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p01: cpu@10101 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10101>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p02: cpu@10102 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10102>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p03: cpu@10103 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10103>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p10: cpu@10200 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10200>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p11: cpu@10201 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10201>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p12: cpu@10202 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10202>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};

		cpu_p13: cpu@10203 {
			compatible = "apple,firestorm";
			device_type = "cpu";
			reg = <0x0 0x10203>;
			enable-method = "spin-table";
			cpu-release-addr = <0 0>; /* To be filled by loader */
		};
	};

	pmu-e {
		compatible = "apple,icestorm-pmu";
		interrupt-parent = <&aic>;
		interrupts = <AIC_FIQ 0 AIC_CPU_PMU_E IRQ_TYPE_LEVEL_HIGH>;
	};

	pmu-p {
		compatible = "apple,firestorm-pmu";
		interrupt-parent = <&aic>;
		interrupts = <AIC_FIQ 0 AIC_CPU_PMU_P IRQ_TYPE_LEVEL_HIGH>;
	};

	timer {
		compatible = "arm,armv8-timer";
		interrupt-parent = <&aic>;
		interrupt-names = "phys", "virt", "hyp-phys", "hyp-virt";
		interrupts = <AIC_FIQ 0 AIC_TMR_GUEST_PHYS IRQ_TYPE_LEVEL_HIGH>,
			     <AIC_FIQ 0 AIC_TMR_GUEST_VIRT IRQ_TYPE_LEVEL_HIGH>,
			     <AIC_FIQ 0 AIC_TMR_HV_PHYS IRQ_TYPE_LEVEL_HIGH>,
			     <AIC_FIQ 0 AIC_TMR_HV_VIRT IRQ_TYPE_LEVEL_HIGH>;
	};

	clkref: clock-ref {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <24000000>;
		clock-output-names = "clkref";
	};

};
Loading