From nobody Thu Nov 28 02:45:53 2024 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 4F02D18E04E; Mon, 7 Oct 2024 07:09:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728284983; cv=none; b=VgY8ssNNu7DlUv3sayt4RBBHfqSaxeYuL4N1w3cUIKGmKbQ+UakxK6uCpzAbRXY5n/AJAJi0GnrLe+Wo0Af0BX+cCpxX23PeQV+o4GJS+mZlqSFH8TmI96a3jDB/NRHpu/L8xWl1O2jDZwaBbtLAl9T0a6j3RmTp7DZ/E1h50oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728284983; c=relaxed/simple; bh=+RUvOPkjgcjfIN75OreWiHjpj6Zdwv8CkkB2fD1x/oA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fnqoDtgUwUzBZwJxigcSBrfyw0mze5LPHycbe6vTYJzkSxuDjAB1jirwSr3Qtl7dd6qPq4FuMq/u+3WeJbPRdluSRNer+DzvvlyrKWfqQNoAOPqfrhS4QtohNrc23CpJxC/LM9xpPDi0SCZ8rXJtbRReABm2/fcCrw3sfBilzHo= 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=Arbs09kT; arc=none smtp.client-ip=209.85.210.170 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="Arbs09kT" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-71def18fe1cso1322172b3a.0; Mon, 07 Oct 2024 00:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728284980; x=1728889780; 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=zisfdb/3waVeifO1xko/z2MSzeUCREcHVCTpD42vZP4=; b=Arbs09kTRU9v7KqoQUzamuVwtq2jhFiYTJ8s09sMXgDPEv/W7vCDLjHdeM620BYxzu 3XspjoPpWdiEOc7Yb8vLAHrpe1MDY822eNb0O9X5UmjHkd4OaG2INU+z1XwlnOoXEGaP hrQ+Pa/AY8mPuk52oQ3M3m8qciaKvIgG79dP5hO1zSmvqnCrhg5Ves/nRwN8ENSZUmFh rTBV2qsr+kWroDzi7zn5K+MNMamHFRhudOtj/GE3CZYWJek012zonZHIcPGXDVVD3rVp VNeyxOX2CEQN82bS1D/b4vRT1p08HtVeAiLA3j6FdMXL6i2rqLNUlvtH7efyFPBCCcPX cXkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728284980; x=1728889780; 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=zisfdb/3waVeifO1xko/z2MSzeUCREcHVCTpD42vZP4=; b=ZCUrtMnTM0TBRAdv+mscx7hTvkIvZEEntUdM7sHcvO1ToCifDeu6TXO1VP95OT9+DW P7v66B3j2AGvNACJC5uHHoOJhQcqnDd7mV3liN3VNyk61ASKBl5i53NK4JC1PV+X3Uj7 U4iggwddbJmhjjElX7+OhzPFwMFCmskviwPm+Hp+IQVV9oE2w1zn/3UOppH3t6EHQSf3 RsDs2gHUv2CAHDPUNGlyn+/Fgkis4vhKuFMJAgP2wkiTAJHJqMbj3XSJbWUVCV+C3y+F HC3VAfKlsB0wqW+2I+6L5bc2TYo0Iuyxhy+J51Zzx9qFmMeR1MIP/J9EikSAz9/QMzbB kwLg== X-Forwarded-Encrypted: i=1; AJvYcCVaZOrrjRznx3g1OiVLLzpbqD585RAzOROR+C85ZVGX8u8T4V/tdzmiAWXvu1VzJZQSOoopkFSslkgNTA3l@vger.kernel.org, AJvYcCWsGa76DXxgoCj/mZTPMU9oa0pJU7aYfx8K10gGROZVY+7enTM/m9vaRAINQM7JprEE4xgBHM4A+oAa@vger.kernel.org, AJvYcCWzbJo2sNKVUTvzwjR73AFAp+QFYcjzgkA4Xe2W35+9Oa5W7U5eCObRky/SOd70rkHOIW9Yl+2a6940l6yxcBE=@vger.kernel.org, AJvYcCXUYJzetkN+AsfkcLDB0XO5gkH3JEFm/jAb+53F0ZSNpmLvqJT7BbAZwBTbPN7krRADEGJmA9vD1T6e2w==@vger.kernel.org X-Gm-Message-State: AOJu0YzLtGzVPBIzfmlsIeiRXZ3kJdj6TmfyIeneIV4tnf7W2HRkvDox zTvdGeTOb1xpzK7LrxCN0guAjfc75uWPjT+LcTttTsa8KHNl32xq X-Google-Smtp-Source: AGHT+IEelDJRijSH92KSCYhUbRxpcBD3pTNKr2x0nvVK7AhHvr7HpGSL3yBhySdlsFC7y+4uzvm3Tw== X-Received: by 2002:a05:6a00:9284:b0:71e:659:f2e7 with SMTP id d2e1a72fcca58-71e0659f589mr2178564b3a.8.1728284980492; Mon, 07 Oct 2024 00:09:40 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-71df0ccd1a3sm3764147b3a.66.2024.10.07.00.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 00:09:40 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Conor Dooley , 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-gpio@vger.kernel.org, linux-watchdog@vger.kernel.org Cc: Konrad Dybcio , Nick Chan Subject: [PATCH v6 16/20] arm64: dts: apple: Add A9X devices Date: Mon, 7 Oct 2024 15:05:41 +0800 Message-ID: <20241007070758.9961-17-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241007070758.9961-1-towinchenmi@gmail.com> References: <20241007070758.9961-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Konrad Dybcio Add the device tree for the A9X SoC and the devices based on it: - iPad Pro (9.7 Inch) - iPad Pro (12.9 Inch) (1st generation) Signed-off-by: Konrad Dybcio [Nick: SMP and m1n1 support, uart interrupt and pinctrl fixes] Co-developed-by: Nick Chan Signed-off-by: Nick Chan --- arch/arm64/boot/dts/apple/Makefile | 4 + arch/arm64/boot/dts/apple/s8001-common.dtsi | 48 +++++++ arch/arm64/boot/dts/apple/s8001-j127.dts | 14 +++ arch/arm64/boot/dts/apple/s8001-j128.dts | 14 +++ arch/arm64/boot/dts/apple/s8001-j98a.dts | 14 +++ arch/arm64/boot/dts/apple/s8001-j99a.dts | 14 +++ arch/arm64/boot/dts/apple/s8001-pro.dtsi | 44 +++++++ arch/arm64/boot/dts/apple/s8001.dtsi | 133 ++++++++++++++++++++ 8 files changed, 285 insertions(+) create mode 100644 arch/arm64/boot/dts/apple/s8001-common.dtsi create mode 100644 arch/arm64/boot/dts/apple/s8001-j127.dts create mode 100644 arch/arm64/boot/dts/apple/s8001-j128.dts create mode 100644 arch/arm64/boot/dts/apple/s8001-j98a.dts create mode 100644 arch/arm64/boot/dts/apple/s8001-j99a.dts create mode 100644 arch/arm64/boot/dts/apple/s8001-pro.dtsi create mode 100644 arch/arm64/boot/dts/apple/s8001.dtsi diff --git a/arch/arm64/boot/dts/apple/Makefile b/arch/arm64/boot/dts/apple= /Makefile index cbb7e409b7e3..f8cd10889d9f 100644 --- a/arch/arm64/boot/dts/apple/Makefile +++ b/arch/arm64/boot/dts/apple/Makefile @@ -28,6 +28,10 @@ dtb-$(CONFIG_ARCH_APPLE) +=3D s8003-j72t.dtb dtb-$(CONFIG_ARCH_APPLE) +=3D s8003-n66m.dtb dtb-$(CONFIG_ARCH_APPLE) +=3D s8003-n69.dtb dtb-$(CONFIG_ARCH_APPLE) +=3D s8003-n71m.dtb +dtb-$(CONFIG_ARCH_APPLE) +=3D s8001-j127.dtb +dtb-$(CONFIG_ARCH_APPLE) +=3D s8001-j128.dtb +dtb-$(CONFIG_ARCH_APPLE) +=3D s8001-j98a.dtb +dtb-$(CONFIG_ARCH_APPLE) +=3D s8001-j99a.dtb dtb-$(CONFIG_ARCH_APPLE) +=3D t8103-j274.dtb dtb-$(CONFIG_ARCH_APPLE) +=3D t8103-j293.dtb dtb-$(CONFIG_ARCH_APPLE) +=3D t8103-j313.dtb diff --git a/arch/arm64/boot/dts/apple/s8001-common.dtsi b/arch/arm64/boot/= dts/apple/s8001-common.dtsi new file mode 100644 index 000000000000..e94d0e77653a --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001-common.dtsi @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Pro (9.7-inch), iPad Pro (12.9-inch) + * + * This file contains parts common to all Apple A9X devices. + * + * target-type: J127, J128, J98a, J99a + * + * Copyright (c) 2024, Nick Chan + */ + +/ { + aliases { + serial0 =3D &serial0; + }; + + chosen { + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + + stdout-path =3D "serial0"; + + framebuffer0: framebuffer@0 { + compatible =3D "apple,simple-framebuffer", "simple-framebuffer"; + reg =3D <0 0 0 0>; /* To be filled by loader */ + /* Format properties will be added by loader */ + status =3D "disabled"; + }; + }; + + memory@800000000 { + device_type =3D "memory"; + reg =3D <0x8 0 0 0>; /* To be filled by loader */ + }; + + reserved-memory { + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + + /* To be filled by loader */ + }; +}; + +&serial0 { + status =3D "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/s8001-j127.dts b/arch/arm64/boot/dts= /apple/s8001-j127.dts new file mode 100644 index 000000000000..8b522085cb3e --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001-j127.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Pro (9.7-inch) (Wi-Fi), J127, iPad6,3 (A1673) + * Copyright (c) 2022, Konrad Dybcio + */ + +/dts-v1/; + +#include "s8001-pro.dtsi" + +/ { + compatible =3D "apple,j127", "apple,s8001", "apple,arm-platform"; + model =3D "Apple iPad Pro (9.7-inch) (Wi-Fi)"; +}; diff --git a/arch/arm64/boot/dts/apple/s8001-j128.dts b/arch/arm64/boot/dts= /apple/s8001-j128.dts new file mode 100644 index 000000000000..cdd3d06dcbf1 --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001-j128.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Pro (9.7-inch) (Cellular), J128, iPad6,4 (A1674/A1675) + * Copyright (c) 2022, Konrad Dybcio + */ + +/dts-v1/; + +#include "s8001-pro.dtsi" + +/ { + compatible =3D "apple,j128", "apple,s8001", "apple,arm-platform"; + model =3D "Apple iPad Pro (9.7-inch) (Cellular)"; +}; diff --git a/arch/arm64/boot/dts/apple/s8001-j98a.dts b/arch/arm64/boot/dts= /apple/s8001-j98a.dts new file mode 100644 index 000000000000..6d6b841e7ab0 --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001-j98a.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Pro (12.9-inch) (Wi-Fi), J98a, iPad6,7 (A1584) + * Copyright (c) 2022, Konrad Dybcio + */ + +/dts-v1/; + +#include "s8001-pro.dtsi" + +/ { + compatible =3D "apple,j98a", "apple,s8001", "apple,arm-platform"; + model =3D "Apple iPad Pro (12.9-inch) (Wi-Fi)"; +}; diff --git a/arch/arm64/boot/dts/apple/s8001-j99a.dts b/arch/arm64/boot/dts= /apple/s8001-j99a.dts new file mode 100644 index 000000000000..d20194b1cae7 --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001-j99a.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Pro (12.9-inch) (Cellular), J99a, iPad6,8 (A1652) + * Copyright (c) 2022, Konrad Dybcio + */ + +/dts-v1/; + +#include "s8001-pro.dtsi" + +/ { + compatible =3D "apple,j99a", "apple,s8001", "apple,arm-platform"; + model =3D "Apple iPad Pro (12.9-inch) (Cellular)"; +}; diff --git a/arch/arm64/boot/dts/apple/s8001-pro.dtsi b/arch/arm64/boot/dts= /apple/s8001-pro.dtsi new file mode 100644 index 000000000000..1fce5a7c4200 --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001-pro.dtsi @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple iPad Pro (1st generation) common device tree + * + * Copyright (c) 2022, Konrad Dybcio + */ + +#include "s8001.dtsi" +#include "s8001-common.dtsi" +#include + +/ { + chassis-type =3D "tablet"; + + gpio-keys { + compatible =3D "gpio-keys"; + + button-home { + label =3D "Home Button"; + gpios =3D <&pinctrl_ap 122 GPIO_ACTIVE_LOW>; + linux,code =3D ; + wakeup-source; + }; + + button-power { + label =3D "Power Button"; + gpios =3D <&pinctrl_ap 123 GPIO_ACTIVE_LOW>; + linux,code =3D ; + wakeup-source; + }; + + button-voldown { + label =3D "Volume Down"; + gpios =3D <&pinctrl_ap 15 GPIO_ACTIVE_LOW>; + linux,code =3D ; + }; + + button-volup { + label =3D "Volume Up"; + gpios =3D <&pinctrl_ap 12 GPIO_ACTIVE_LOW>; + linux,code =3D ; + }; + }; +}; diff --git a/arch/arm64/boot/dts/apple/s8001.dtsi b/arch/arm64/boot/dts/app= le/s8001.dtsi new file mode 100644 index 000000000000..23ee3238844d --- /dev/null +++ b/arch/arm64/boot/dts/apple/s8001.dtsi @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple S8001 "A9X" SoC + * + * Other names: H8G, "Elba" + * + * Copyright (c) 2022, Konrad Dybcio + */ + +#include +#include +#include +#include + +/ { + interrupt-parent =3D <&aic>; + #address-cells =3D <2>; + #size-cells =3D <2>; + + clkref: clock-ref { + compatible =3D "fixed-clock"; + #clock-cells =3D <0>; + clock-frequency =3D <24000000>; + clock-output-names =3D "clkref"; + }; + + cpus { + #address-cells =3D <2>; + #size-cells =3D <0>; + + cpu0: cpu@0 { + compatible =3D "apple,twister"; + reg =3D <0x0 0x0>; + cpu-release-addr =3D <0 0>; /* To be filled in by loader */ + enable-method =3D "spin-table"; + device_type =3D "cpu"; + }; + + cpu1: cpu@1 { + compatible =3D "apple,twister"; + reg =3D <0x0 0x1>; + cpu-release-addr =3D <0 0>; /* To be filled in by loader */ + enable-method =3D "spin-table"; + device_type =3D "cpu"; + }; + }; + + soc { + compatible =3D "simple-bus"; + #address-cells =3D <2>; + #size-cells =3D <2>; + nonposted-mmio; + ranges; + + serial0: serial@20a0c0000 { + compatible =3D "apple,s5l-uart"; + reg =3D <0x2 0x0a0c0000 0x0 0x4000>; + reg-io-width =3D <4>; + interrupt-parent =3D <&aic>; + interrupts =3D ; + /* Use the bootloader-enabled clocks for now. */ + clocks =3D <&clkref>, <&clkref>; + clock-names =3D "uart", "clk_uart_baud0"; + status =3D "disabled"; + }; + + aic: interrupt-controller@20e100000 { + compatible =3D "apple,s8000-aic", "apple,aic"; + reg =3D <0x2 0x0e100000 0x0 0x100000>; + #interrupt-cells =3D <3>; + interrupt-controller; + }; + + pinctrl_ap: pinctrl@20f100000 { + compatible =3D "apple,s8000-pinctrl", "apple,pinctrl"; + reg =3D <0x2 0x0f100000 0x0 0x100000>; + + gpio-controller; + #gpio-cells =3D <2>; + gpio-ranges =3D <&pinctrl_ap 0 0 219>; + apple,npins =3D <219>; + + interrupt-controller; + #interrupt-cells =3D <2>; + interrupt-parent =3D <&aic>; + interrupts =3D , + , + , + , + , + , + ; + }; + + pinctrl_aop: pinctrl@2100f0000 { + compatible =3D "apple,s8000-pinctrl", "apple,pinctrl"; + reg =3D <0x2 0x100f0000 0x0 0x100000>; + + gpio-controller; + #gpio-cells =3D <2>; + gpio-ranges =3D <&pinctrl_aop 0 0 28>; + apple,npins =3D <28>; + + interrupt-controller; + #interrupt-cells =3D <2>; + interrupt-parent =3D <&aic>; + interrupts =3D , + , + , + , + , + , + ; + }; + + wdt: watchdog@2102b0000 { + compatible =3D "apple,s8000-wdt", "apple,wdt"; + reg =3D <0x2 0x102b0000 0x0 0x4000>; + clocks =3D <&clkref>; + interrupt-parent =3D <&aic>; + interrupts =3D ; + }; + }; + + timer { + compatible =3D "arm,armv8-timer"; + interrupt-parent =3D <&aic>; + interrupt-names =3D "phys", "virt"; + /* Note that A9X doesn't actually have a hypervisor (EL2 is not implemen= ted). */ + interrupts =3D , + ; + }; +}; --=20 2.46.2