Re: [PATCH v4 6/7] arm: dts: apple: Add preliminary device trees

2021-10-31 Thread Tom Rini
On Sat, Oct 23, 2021 at 04:58:06PM +0200, Mark Kettenis wrote:

> Add preliminary device trees for the Apple M1 mini (2020) and
> Apple M1 Macbook Pro 13" (2020).  Device tree bindings for
> the Apple M1 SoC are still being formalized and these device
> trees will be synchronized with the Linux kernel as needed.
> 
> The device trees in this commit are based on the initial Apple
> M1 device trees from Linux 5.13, nodes for dart, pcie, pinctrl,
> pmgr, usb based on bindings on track for inclusion in Linux
> 5.15 and 5.16 and nodes for i2c, mailbox, nvme, pmu, spmi and
> watchdog that don't have a proposed binding yet.
> 
> These device trees are provided as a reference only as U-Boot
> uses the device tree passed by the m1n1 bootloader.
> 
> Signed-off-by: Mark Kettenis 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v4 6/7] arm: dts: apple: Add preliminary device trees

2021-10-23 Thread Mark Kettenis
Add preliminary device trees for the Apple M1 mini (2020) and
Apple M1 Macbook Pro 13" (2020).  Device tree bindings for
the Apple M1 SoC are still being formalized and these device
trees will be synchronized with the Linux kernel as needed.

The device trees in this commit are based on the initial Apple
M1 device trees from Linux 5.13, nodes for dart, pcie, pinctrl,
pmgr, usb based on bindings on track for inclusion in Linux
5.15 and 5.16 and nodes for i2c, mailbox, nvme, pmu, spmi and
watchdog that don't have a proposed binding yet.

These device trees are provided as a reference only as U-Boot
uses the device tree passed by the m1n1 bootloader.

Signed-off-by: Mark Kettenis 
Reviewed-by: Simon Glass 
---

ChangeLog:

v4: - Indicate how device trees deviate from upstream


 arch/arm/dts/Makefile |   4 +
 arch/arm/dts/t8103-j274.dts   | 135 +
 arch/arm/dts/t8103-j293.dts   |  97 +++
 arch/arm/dts/t8103.dtsi   | 560 ++
 configs/apple_m1_defconfig|   1 +
 .../interrupt-controller/apple-aic.h  |  15 +
 include/dt-bindings/pinctrl/apple.h   |  13 +
 include/dt-bindings/spmi/spmi.h   |  10 +
 8 files changed, 835 insertions(+)
 create mode 100644 arch/arm/dts/t8103-j274.dts
 create mode 100644 arch/arm/dts/t8103-j293.dts
 create mode 100644 arch/arm/dts/t8103.dtsi
 create mode 100644 include/dt-bindings/interrupt-controller/apple-aic.h
 create mode 100644 include/dt-bindings/pinctrl/apple.h
 create mode 100644 include/dt-bindings/spmi/spmi.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index ed3d360bb1..ada67904fc 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -29,6 +29,10 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb
 
+dtb-$(CONFIG_ARCH_APPLE) += \
+   t8103-j274.dtb \
+   t8103-j293.dtb
+
 dtb-$(CONFIG_ARCH_DAVINCI) += \
da850-evm.dtb \
da850-lcdk.dtb \
diff --git a/arch/arm/dts/t8103-j274.dts b/arch/arm/dts/t8103-j274.dts
new file mode 100644
index 00..aef1ae29b6
--- /dev/null
+++ b/arch/arm/dts/t8103-j274.dts
@@ -0,0 +1,135 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Apple Mac mini (M1, 2020)
+ *
+ * target-type: J274
+ *
+ * Copyright The Asahi Linux Contributors
+ */
+
+/dts-v1/;
+
+#include "t8103.dtsi"
+
+/ {
+   compatible = "apple,j274", "apple,t8103", "apple,arm-platform";
+   model = "Apple Mac mini (M1, 2020)";
+
+   aliases {
+   serial0 = 
+   ethernet0 = 
+   wifi0 = 
+   };
+
+   chosen {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   stdout-path = "serial0";
+
+   framebuffer0: framebuffer@0 {
+   compatible = "apple,simple-framebuffer", 
"simple-framebuffer";
+   reg = <0 0 0 0>; /* To be filled by loader */
+   /* Format properties will be added by loader */
+   status = "disabled";
+   };
+   };
+
+   memory@8 {
+   device_type = "memory";
+   reg = <0x8 0 0x2 0>; /* To be filled by loader */
+   };
+};
+
+ {
+   status = "okay";
+};
+
+_dart_0 {
+   status = "okay";
+};
+
+_dart_1 {
+   status = "okay";
+};
+
+_dart_2 {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+
+   pci0: pci@0,0 {
+   device_type = "pci";
+   reg = <0x0 0x0 0x0 0x0 0x0>;
+   pwren-gpios = < 13 0>;
+   reset-gpios = <_ap 152 0>;
+   max-link-speed = <2>;
+
+   #address-cells = <3>;
+   #size-cells = <2>;
+   ranges;
+   };
+
+   pci1: pci@1,0 {
+   device_type = "pci";
+   reg = <0x800 0x0 0x0 0x0 0x0>;
+   reset-gpios = <_ap 153 0>;
+   max-link-speed = <2>;
+
+   #address-cells = <3>;
+   #size-cells = <2>;
+   ranges;
+   };
+
+   pci2: pci@2,0 {
+   device_type = "pci";
+   reg = <0x1000 0x0 0x0 0x0 0x0>;
+   reset-gpios = <_ap 33 0>;
+   max-link-speed = <1>;
+
+   #address-cells = <3>;
+   #size-cells = <2>;
+   ranges;
+   };
+};
+
+ {
+   wifi0: network@0,0 {
+   reg = <0x1 0x0 0x0 0x0 0x0>;
+   local-mac-address = [00 00 00 00 00 00];
+   };
+};
+
+ {
+   eth0: ethernet@0,0 {
+   reg = <0x3 0x0 0x0 0x0 0x0>;
+   local-mac-address = [00 00 00 00 00 00];
+   };
+};
+
+_0_dart_0 {
+   status = "okay";
+};
+
+_0_dart_1 {
+   status = "okay";
+};
+
+_0 {
+   status = "okay";
+};
+
+_1_dart_0 {
+   status = "okay";
+};
+
+_1_dart_1 {
+