From patchwork Sat Sep 14 05:17:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 828709 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CF32188934; Sat, 14 Sep 2024 05:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726291584; cv=none; b=fDvJwiLJaXEehriIzA5/FZIM2zsTKo57pGA5kXFengMT44EKikUvbJfEz9ArP47CPkS+XH3PgboRYFiZXHzNQKrA0+rIyzrMHlwXOTbJfdsePm5k1tmOviMvcyGCINnFiJDTBFRMuHsDl9QaaaBk1//C+DvKqXgTj0K3nJYyNQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726291584; c=relaxed/simple; bh=72JwKxsOiQ9ATwBxQc5idMxg+wu2dRcm5FUheKCg9zY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cCAJBDLTQWYBjYB99UHx5Bc6jULc6pQgLY6OSHFHRg2SZrm4ojfnt8vicjt2CI/OM9sXAsuAocZvSDc662kU3WWPT0iLxRpcVDOkwmQeW2KeALrjv538LY3ykKp2wnA8KjXg2WqxTKwLY0P50GulNm0bPQ0vUJ2jTN15NCZRXFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Hhn4gthJ; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hhn4gthJ" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-718d962ad64so2383699b3a.0; Fri, 13 Sep 2024 22:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726291582; x=1726896382; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0VwGFb5jnroPV5oNGC7ai+uUg9dX6Uu4B+zhzmxSREk=; b=Hhn4gthJ8/bGQNDL934tiSn7ViG36wD+yDRcCYTkBsMG1qiOuRafzyheKf91FBbS4A qIB9yOWngMRACvvAbCg2k5OxZJJDX4/pFPMrXk6xzDkb3MKhbgLCG8m920O0QtKDNrgC k81Urrl8lvmMFyIFAWfMD7oFLC2QiNMD+qImNoduevEhR8WXjsDU/tyNk7HMa7KM0KKg wMvfnnsVaZd2C+z9WTSykIFcq3GDCFcVJiwqhO3gio0rk17jNTS6gbeS8IEWY7fsjhBA iCvxL9D7FcQgyrWJ8U+YyAKbXNzqJ1qG/N99CIBi5idfFl6DM0fFH97Lnt/xZ27+6d0g 2S1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726291582; x=1726896382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0VwGFb5jnroPV5oNGC7ai+uUg9dX6Uu4B+zhzmxSREk=; b=u7AN72VdCgnmY11eyYJHwS2Ul/s0KZb8YRfWhacf8AlC2jZzu1cNlsqaxlvr8EBVBL 0QXnnQVwVl3mT4vamFv8HXB4k7AP9rscTSm4HZ9pbGS9vLP8muDeBaM9tBqyIZjCDegi Cm5PwWELsbadjK7RUWbsQsKvqDzjmyNyXpPG4D/Fx+1j4h5TyceEqy6sSZCd60QQo5ks HUdrNpoiFQqhRJ8+pNmK3ClqEJWmYaja37gY3jIUxOpM20IQbv199clWGHLbJrt7xu6V NhEH8Vz7aSP7mbj/MwVeFjJ6GytzmoAh09KpmGWj65rlA+m7fXRF04fWmqlalb1E2f6T L2rg== X-Forwarded-Encrypted: i=1; AJvYcCUOIkKgrN90x8EPr7mbhr3YaG7ngsukkvom0yJwIucEbWFyQj5kGEM8EUiniefkQG051Bv4NP7zSgx4@vger.kernel.org, AJvYcCUqbaPnoZv80pajCSOTLYOfGP+gevlt6Zd1OIXU1nl8EjMRIlm5UuWvXsEXH9vNcoCel8DhMYUzieCsq9wbjeA=@vger.kernel.org, AJvYcCVbmqlZu5x9phSHXRP88Zk5XmjYoStbimZXhsmLQTVxmP50Hc3rVX1bsn24nS5yeCrChflLg9ILh0c=@vger.kernel.org, AJvYcCVp2oi2MCqVmxM9/DO36Bgu2NJKMA3M4mCh5O/WS3FqDkeO3mlqfIbfO2ll6Q5KGJnhryfYBk0lEVDEhMZW@vger.kernel.org, AJvYcCWCcOM7KW9ieNc4RIj05RUgfTtxMxXDhaxmhP1lr2ZaCEhb/4IsQ7djJ9kWYA/KpzjyjmorFGMnILduvw==@vger.kernel.org X-Gm-Message-State: AOJu0YwxF0iyFUexTTvjm8Ky1AWTlFGm20EQIoaoPSWOnur9lufK4BC9 MXun/SzPP68TSMJB5bNop8RENVVmwm4b9y+/K6AhT8GLVepMyn1p X-Google-Smtp-Source: AGHT+IHd9rUwx1vPgvau2mRCMsPu7jFuom4TlKP3Iryw6hYBdaK/Ga2xceDhsm6Lvgbdk60eJznQIQ== X-Received: by 2002:a05:6300:6681:b0:1cf:22d4:382e with SMTP id adf61e73a8af0-1cf7624b255mr13716445637.37.1726291581862; Fri, 13 Sep 2024 22:26:21 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-71944b7b749sm391223b3a.113.2024.09.13.22.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 22:26:21 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Rafael J . Wysocki" , Viresh Kumar , Linus Walleij , Wim Van Sebroeck , Guenter Roeck , Catalin Marinas , Will Deacon , Lorenzo Pieralisi , Mark Kettenis , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-watchdog@vger.kernel.org Cc: Nick Chan , Ivaylo Ivanov , Konrad Dybcio Subject: [PATCH v2 15/22] arm64: dts: apple: Add A8X devices Date: Sat, 14 Sep 2024 13:17:24 +0800 Message-ID: <20240914052413.68177-19-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240914052413.68177-1-towinchenmi@gmail.com> References: <20240914052413.68177-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Konrad Dybcio Add DTS files for the A8X SoC and the only device based on it, the iPad Air 2. Signed-off-by: Konrad Dybcio [Ivalyo: system memory bits] Co-developed-by: Ivaylo Ivanov Signed-off-by: Ivaylo Ivanov [Nick: SMP, m1n1 and gpio-keys support, pinctrl fixes] Co-developed-by: Nick Chan Signed-off-by: Nick Chan --- arch/arm64/boot/dts/apple/Makefile | 2 + arch/arm64/boot/dts/apple/t7001-air2.dtsi | 46 +++++++ arch/arm64/boot/dts/apple/t7001-j81.dts | 14 ++ arch/arm64/boot/dts/apple/t7001-j82.dts | 14 ++ arch/arm64/boot/dts/apple/t7001.dtsi | 154 ++++++++++++++++++++++ 5 files changed, 230 insertions(+) create mode 100644 arch/arm64/boot/dts/apple/t7001-air2.dtsi create mode 100644 arch/arm64/boot/dts/apple/t7001-j81.dts create mode 100644 arch/arm64/boot/dts/apple/t7001-j82.dts create mode 100644 arch/arm64/boot/dts/apple/t7001.dtsi diff --git a/arch/arm64/boot/dts/apple/Makefile b/arch/arm64/boot/dts/apple/Makefile index d5dd1e2e4f4c..adda522ea490 100644 --- a/arch/arm64/boot/dts/apple/Makefile +++ b/arch/arm64/boot/dts/apple/Makefile @@ -16,6 +16,8 @@ dtb-$(CONFIG_ARCH_APPLE) += t7000-j97.dtb dtb-$(CONFIG_ARCH_APPLE) += t7000-n102.dtb dtb-$(CONFIG_ARCH_APPLE) += t7000-n56.dtb dtb-$(CONFIG_ARCH_APPLE) += t7000-n61.dtb +dtb-$(CONFIG_ARCH_APPLE) += t7001-j81.dtb +dtb-$(CONFIG_ARCH_APPLE) += t7001-j82.dtb dtb-$(CONFIG_ARCH_APPLE) += t8103-j274.dtb dtb-$(CONFIG_ARCH_APPLE) += t8103-j293.dtb dtb-$(CONFIG_ARCH_APPLE) += t8103-j313.dtb diff --git a/arch/arm64/boot/dts/apple/t7001-air2.dtsi b/arch/arm64/boot/dts/apple/t7001-air2.dtsi new file mode 100644 index 000000000000..8ecf2842e8e5 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t7001-air2.dtsi @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Air 2 common device tree + * Copyright (c) 2022, Konrad Dybcio + */ + +#include "t7001.dtsi" +#include + +/ { + chassis-type = "tablet"; + + gpio-keys { + compatible = "gpio-keys"; + + button-home { + label = "Home Button"; + gpios = <&pinctrl 0 GPIO_ACTIVE_LOW>; + linux,code = ; + wakeup-source; + }; + + button-power { + label = "Power Button"; + gpios = <&pinctrl 1 GPIO_ACTIVE_LOW>; + linux,code = ; + wakeup-source; + }; + + button-volup { + label = "Volume Up"; + gpios = <&pinctrl 92 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-voldown { + label = "Volume Down"; + gpios = <&pinctrl 93 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&serial0 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t7001-j81.dts b/arch/arm64/boot/dts/apple/t7001-j81.dts new file mode 100644 index 000000000000..ca90dc0c872c --- /dev/null +++ b/arch/arm64/boot/dts/apple/t7001-j81.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Air 2 (Wi-Fi), J81, iPad5,3 (A1566) + * Copyright (c) 2022, Konrad Dybcio + */ + +/dts-v1/; + +#include "t7001-air2.dtsi" + +/ { + compatible = "apple,j81", "apple,t7001", "apple,arm-platform"; + model = "Apple iPad Air 2 (Wi-Fi)"; +}; diff --git a/arch/arm64/boot/dts/apple/t7001-j82.dts b/arch/arm64/boot/dts/apple/t7001-j82.dts new file mode 100644 index 000000000000..d9fd16f48db7 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t7001-j82.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Air 2 (Cellular), J82, iPad5,4 (A1567) + * Copyright (c) 2022, Konrad Dybcio + */ + +/dts-v1/; + +#include "t7001-air2.dtsi" + +/ { + compatible = "apple,j82", "apple,t7001", "apple,arm-platform"; + model = "Apple iPad Air 2 (Cellular)"; +}; diff --git a/arch/arm64/boot/dts/apple/t7001.dtsi b/arch/arm64/boot/dts/apple/t7001.dtsi new file mode 100644 index 000000000000..9a5f0a4bde52 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t7001.dtsi @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple T7001 "A8X" SoC + * + * Copyright (c) 2022, Konrad Dybcio + * Based on Asahi Linux's M1 (t8103.dtsi) and Corellium's A10 efforts. + */ + +#include +#include +#include +#include + +/ { + interrupt-parent = <&aic>; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + serial0 = &serial0; + }; + + 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"; + }; + }; + + clkref: clock-ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-output-names = "clkref"; + }; + + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu0: cpu@0 { + compatible = "apple,typhoon"; + reg = <0x0 0x0>; + cpu-release-addr = <0 0>; /* To be filled in by loader */ + enable-method = "spin-table"; + device_type = "cpu"; + }; + + cpu1: cpu@1 { + compatible = "apple,typhoon"; + reg = <0x0 0x1>; + cpu-release-addr = <0 0>; /* To be filled in by loader */ + enable-method = "spin-table"; + device_type = "cpu"; + }; + + cpu2: cpu@2 { + compatible = "apple,typhoon"; + reg = <0x0 0x2>; + cpu-release-addr = <0 0>; /* To be filled by loader */ + enable-method = "spin-table"; + device_type = "cpu"; + }; + }; + + memory@800000000 { + device_type = "memory"; + reg = <0x8 0 0 0>; /* To be filled in by loader */ + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* + * The bootloader reserves a region for the (varying-address, depending + * on what FW your device runs AND model) framebuffer under this node. + */ + }; + + soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + nonposted-mmio; + ranges; + + serial0: serial@20a0c0000 { + compatible = "apple,s5l-uart"; + reg = <0x2 0x0a0c0000 0x0 0x4000>; + reg-io-width = <4>; + interrupt-parent = <&aic>; + interrupts = ; + /* Use the bootloader-enabled clocks for now. */ + clocks = <&clkref>, <&clkref>; + clock-names = "uart", "clk_uart_baud0"; + status = "disabled"; + }; + + wdt: watchdog@20e027000 { + compatible = "apple,t7000-wdt", "apple,wdt"; + reg = <0x2 0x0e027000 0x0 0x1000>; + clocks = <&clkref>; + interrupt-parent = <&aic>; + interrupts = ; + }; + + aic: interrupt-controller@20e100000 { + compatible = "apple,t7000-aic", "apple,aic"; + reg = <0x2 0x0e100000 0x0 0x100000>; + #interrupt-cells = <3>; + interrupt-controller; + }; + + pinctrl: pinctrl@20e300000 { + compatible = "apple,t7000-pinctrl", "apple,pinctrl"; + reg = <0x2 0x0e300000 0x0 0x100000>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 0 184>; + apple,npins = <184>; + + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&aic>; + interrupts = , + , + , + , + , + , + ; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&aic>; + interrupt-names = "phys", "virt"; + /* Note that A8X doesn't actually have a hypervisor (EL2 is not implemented). */ + interrupts = , + ; + }; +};