[{"id":3685278,"web_url":"http://patchwork.ozlabs.org/comment/3685278/","msgid":"<87zf2ic9iw.fsf@bloch.sibelius.xs4all.nl>","list_archive_url":null,"date":"2026-05-02T11:53:43","subject":"Re: [PATCH] arm: apple: Add Apple M3 (t8122) support","submitter":{"id":8281,"url":"http://patchwork.ozlabs.org/api/people/8281/","name":"Mark Kettenis","email":"mark.kettenis@xs4all.nl"},"content":"> From: Janne Grunau <j@jannau.net>\n> Date: Fri, 01 May 2026 16:07:16 +0200\n\nHi Janne,\n\n> Apple's M3 SoC is similar to M1 and M2 but uses a different memory map.\n> The main difference is that RAM starts at 0x100_0000_0000 like on t600x\n> and t602x (M1 and M2 Pro/Max/Ultra). Otherwise IO blocks have been\n> rearranged.\n> U-boot's existing drivers are compatible with the hardware and M3 device\n> trees will carry \"apple,t8103-*\" compatible strings. Only\n> apple-atcphy-reset might need a new compatible due to USB4 / DisplayPort\n> changes the Linux driver has to deal with.\n> \n> Signed-off-by: Janne Grunau <j@jannau.net>\n> ---\n>  arch/arm/mach-apple/board.c | 71 +++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 71 insertions(+)\n> \n> diff --git a/arch/arm/mach-apple/board.c b/arch/arm/mach-apple/board.c\n> index 4cd8979bdc2..914b4581e7d 100644\n> --- a/arch/arm/mach-apple/board.c\n> +++ b/arch/arm/mach-apple/board.c\n> @@ -85,6 +85,75 @@ static struct mm_region t8103_mem_map[] = {\n>  \t}\n>  };\n>  \n> +/* Apple M3 */\n\nI think it makes more sense to keep things sorted based on the name\nand put M3 after M2 Ultra?  M2 is the odd one out here since it is\nidentical to M1.\n\n> +\n> +static struct mm_region t8122_mem_map[] = {\n> +\t{\n> +\t\t/* I/O */\n> +\t\t.virt = 0x210000000,\n> +\t\t.phys = 0x210000000,\n> +\t\t.size = 4UL * SZ_1G,\n\nWe should try to keep the regions aligned on 1G boundaries with sizes\nthat are multiples of 1G as that allows for more efficient page\ntables.\n\nI haven't looked at Apple's device tree for the t8122 (I don't think I\nhave ever seen one).  But based on the t8122.dtsi from the asahi-wip\nbranch, I'd suggest using two regions\n\n0x200000000: 4UL * SZ_1G\n0x300000000: 1UL * SZ_1G\n\nYou could tag the region at 0x300000000 as /* NVME */ if the Apple dts\ndoesn't suggest there are non-NVMe things in there.\n\n\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |\n> +\t\t\t PTE_BLOCK_NON_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* I/O */\n> +\t\t.virt = 0x700000000,\n> +\t\t.phys = 0x700000000,\n> +\t\t.size = SZ_1G,\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |\n> +\t\t\t PTE_BLOCK_NON_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* I/O */\n> +\t\t.virt = 0xb00000000,\n> +\t\t.phys = 0xb00000000,\n> +\t\t.size = SZ_1G,\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |\n> +\t\t\t PTE_BLOCK_NON_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* I/O */\n> +\t\t.virt = 0x580000000,\n> +\t\t.phys = 0x580000000,\n> +\t\t.size = SZ_512M,\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |\n> +\t\t\t PTE_BLOCK_NON_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* PCIE */\n> +\t\t.virt = 0x5a0000000,\n> +\t\t.phys = 0x5a0000000,\n> +\t\t.size = SZ_512M,\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRE) |\n> +\t\t\t PTE_BLOCK_INNER_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* PCIE */\n> +\t\t.virt = 0x5c0000000,\n> +\t\t.phys = 0x5c0000000,\n> +\t\t.size = SZ_1G,\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRE) |\n> +\t\t\t PTE_BLOCK_INNER_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* RAM */\n> +\t\t.virt = 0x10000000000,\n> +\t\t.phys = 0x10000000000,\n> +\t\t.size = 8UL * SZ_1G,\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |\n> +\t\t\t PTE_BLOCK_INNER_SHARE\n> +\t}, {\n> +\t\t/* Framebuffer */\n> +\t\t.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL_NC) |\n> +\t\t\t PTE_BLOCK_INNER_SHARE |\n> +\t\t\t PTE_BLOCK_PXN | PTE_BLOCK_UXN\n> +\t}, {\n> +\t\t/* List terminator */\n> +\t\t0,\n> +\t}\n> +};\n> +\n>  /* Apple M1 Pro/Max */\n>  \n>  static struct mm_region t6000_mem_map[] = {\n> @@ -710,6 +779,8 @@ void build_mem_map(void)\n>  \tif (of_machine_is_compatible(\"apple,t8103\") ||\n>  \t    of_machine_is_compatible(\"apple,t8112\"))\n>  \t\tmem_map = t8103_mem_map;\n> +\telse if (of_machine_is_compatible(\"apple,t8122\"))\n> +\t\tmem_map = t8122_mem_map;\n\nI'd probably move this down as well.\n\n>  \telse if (of_machine_is_compatible(\"apple,t6000\") ||\n>  \t\t of_machine_is_compatible(\"apple,t6001\"))\n>  \t\tmem_map = t6000_mem_map;\n> \n> ---\n> base-commit: 4433253ecf2041f9362a763bb6cb79960921ac7e\n> change-id: 20260501-apple-m3-support-9fc25ab793d4\n> \n> Best regards,\n> -- \n> Janne Grunau <j@jannau.net>\n> \n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=xs4all.nl header.i=@xs4all.nl header.a=rsa-sha256\n header.s=xs4all01 header.b=YAlQzw7k;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=xs4all.nl","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=xs4all.nl header.i=@xs4all.nl header.b=\"YAlQzw7k\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=xs4all.nl","phobos.denx.de;\n spf=pass smtp.mailfrom=mark.kettenis@xs4all.nl"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g75sc1Vb4z1y04\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 02 May 2026 21:53:56 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 5E13483642;\n\tSat,  2 May 2026 13:53:51 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id A329F83642; Sat,  2 May 2026 13:53:49 +0200 (CEST)","from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl\n [195.121.94.183])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 689E680F0E\n for <u-boot@lists.denx.de>; Sat,  2 May 2026 13:53:44 +0200 (CEST)","from smtp.kpnmail.nl (unknown [10.31.155.7])\n by ewsoutbound.so.kpn.org (Halon) with ESMTPS\n id 91c9c7a3-461d-11f1-bea8-005056992ed3;\n Sat, 02 May 2026 13:53:43 +0200 (CEST)","from bloch.sibelius.xs4all.nl (80-61-163-207.fixed.kpn.net\n [80.61.163.207]) by smtp.xs4all.nl (Halon) with ESMTPSA\n id 9150aca5-461d-11f1-86d8-005056998788;\n Sat, 02 May 2026 13:53:43 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS\n autolearn=ham autolearn_force=no version=3.4.2","X-KPN-MessageId":"91c9c7a3-461d-11f1-bea8-005056992ed3","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01;\n h=subject:to:from:message-id:date;\n bh=NndJWdC2XdHsgSMDPHLy5j0UmQGMya3mxxlaUEaFIVA=;\n b=YAlQzw7ksRQ3I2FVU39A8qmUXeDcgpE/BCyQSEQK7U/NS+L6pnbN/xN7zC0NGi1RBfa7tofHQ5IV7\n mB8UDalylfaS69UrfqUW6f6IdmNkCb4KGVo+RylbDax144qDsmYzMre0ruqbCB7rC1jeqIcbslgY+3\n 0Wocqn/+YVYRTfUPokZ5ev015b+9nOt8PILA1A+jjilONW/juhldM73kNDk2JPBH09rkyreHVBof/6\n JtZ9xj5KLcA2D/2qHpKJRGaPz3ZuIFpXUG9nw7p7/f/maWuSS+kKVHvHkEiXCdL6xOyd6MCX5poGix\n xKZq1F6PT2r5rTJc66/PdKgoG1EepRQ==","X-KPN-MID":"33|Bw0f43nOdSbxyj4kJgouwp/Pf5OP3yuJslcAhZqINEo9+9P6MVoJSOY60RjaxFg\n hjrURGRf8WxCPky/VbUCv2WmbSWPswGFooNTUYSRgZpA=","X-KPN-VerifiedSender":"Yes","X-CMASSUN":"33|Q45zx/JzG6TGyD3fchD7VCTJ0+bE/3Pt6I4Lt/EwHp4GxfDkQaN9PNdTex/IKZX\n baf8VjPUboJIXCx9IKYuTGA==","X-Originating-IP":"80.61.163.207","Date":"Sat, 02 May 2026 13:53:43 +0200","Message-Id":"<87zf2ic9iw.fsf@bloch.sibelius.xs4all.nl>","From":"Mark Kettenis <mark.kettenis@xs4all.nl>","To":"Janne Grunau <j@jannau.net>","Cc":"u-boot@lists.denx.de, kettenis@openbsd.org, trini@konsulko.com,\n sughosh.ganu@arm.com, ilias.apalodimas@linaro.org,\n mkorpershoek@kernel.org, jerome.forissier@arm.com, j@jannau.net","In-Reply-To":"<20260501-apple-m3-support-v1-1-4165bc2a73f4@jannau.net> (message\n from Janne Grunau on Fri, 01 May 2026 16:07:16 +0200)","Subject":"Re: [PATCH] arm: apple: Add Apple M3 (t8122) support","References":"<20260501-apple-m3-support-v1-1-4165bc2a73f4@jannau.net>","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]