Linux on Apple ARM platform development
 help / color / mirror / Atom feed
* [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support
@ 2026-09-04 19:22 Janne Grunau
  2026-09-04 19:22 ` [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer Janne Grunau
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Janne Grunau @ 2026-09-04 19:22 UTC (permalink / raw)
  To: u-boot
  Cc: asahi, Mark Kettenis, Sven Peter, Neil Armstrong, Bin Meng,
	Tom Rini, Francois Berder, Janne Grunau

Hej,

this series adapts Sven's Linux nvme-apple series of the same name to
u-boot. It fixes bugs which are worked around on M1/M2/M3 based devices
with NVMe firmware from macOS 14.x or earlier. Starting with the NVMe
controller firmware from macOS 15.x (required for M4 support) the
workaround is no longer available.

The quirk to require page-aligned buffers for the admin queue is not
necessary for u-boot. As far as I can see the buffers are always
page-aligned. Add noisy WARN_ON_ONCEs to ensure it's noticed if this
changes or I was mistaken to begin with.

Janne

Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org/

Signed-off-by: Janne Grunau <j@jannau.net>
---
Janne Grunau (4):
      nvme: apple: Don't set a DMA direction for commands without a data transfer
      nvme: apple: Never set the opcode in the NVMMU TCB
      nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
      nvme: apple: Drop the PRP null check chicken bit

 drivers/nvme/nvme_apple.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
---
base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc
change-id: 20260904-apple-nvme-fwabi-cf74f7cefac4

Best regards,
-- 
Janne Grunau <j@jannau.net>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer
  2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
@ 2026-09-04 19:22 ` Janne Grunau
  2026-09-07 21:21   ` Mark Kettenis
  2026-09-04 19:22 ` [PATCH 2/4] nvme: apple: Never set the opcode in the NVMMU TCB Janne Grunau
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Janne Grunau @ 2026-09-04 19:22 UTC (permalink / raw)
  To: u-boot
  Cc: asahi, Mark Kettenis, Sven Peter, Neil Armstrong, Bin Meng,
	Tom Rini, Francois Berder, Janne Grunau

Setting the DMA direction for commands that don't do any transfer likely
triggered the PRP NULL check for which we needed a chicken bit. That bit
has disappeared starting with macOS 15 so let's just do this correctly
instead.

Based on Linux kernel commit 94dd5804938d ("nvme-apple: Don't set a DMA
direction for commands without a data transfer").

Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-2-bde19ce8db04@kernel.org/
Fixes: 50333c94f2de ("nvme: apple: Add driver for Apple NVMe storage controller")
Signed-off-by: Janne Grunau <j@jannau.net>
---
 drivers/nvme/nvme_apple.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
index e674eda8344..dc94988e2ff 100644
--- a/drivers/nvme/nvme_apple.c
+++ b/drivers/nvme/nvme_apple.c
@@ -122,7 +122,10 @@ static void apple_nvme_submit_cmd(struct nvme_queue *nvmeq,
 	tcb = ((void *)priv->tcbs[nvmeq->qid]) + tail * ANS_NVMMU_TCB_PITCH;
 	memset(tcb, 0, sizeof(*tcb));
 	tcb->opcode = cmd->common.opcode;
-	tcb->flags = ANS_NVMMU_TCB_WRITE | ANS_NVMMU_TCB_READ;
+	if (cmd->common.prp1)
+		tcb->flags = ANS_NVMMU_TCB_WRITE | ANS_NVMMU_TCB_READ;
+	else
+		tcb->flags = 0;
 	tcb->slot = tail;
 	tcb->prpl_len = cmd->rw.length;
 	tcb->prp1 = cmd->common.prp1;

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] nvme: apple: Never set the opcode in the NVMMU TCB
  2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
  2026-09-04 19:22 ` [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer Janne Grunau
@ 2026-09-04 19:22 ` Janne Grunau
  2026-09-07 21:21   ` Mark Kettenis
  2026-09-04 19:22 ` [PATCH 3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers Janne Grunau
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Janne Grunau @ 2026-09-04 19:22 UTC (permalink / raw)
  To: u-boot
  Cc: asahi, Mark Kettenis, Sven Peter, Neil Armstrong, Bin Meng,
	Tom Rini, Francois Berder, Janne Grunau

macOS always sets this to zero and the firmware starting with macOS 15
has started to complain about what we're doing here.

Based on Linux kernel commit cc0fec9b42cf ("nvme-apple: Never set the
opcode in the NVMMU TCB").

Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-3-bde19ce8db04@kernel.org/
Fixes: 50333c94f2de ("nvme: apple: Add driver for Apple NVMe storage controller")
Signed-off-by: Janne Grunau <j@jannau.net>
---
 drivers/nvme/nvme_apple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
index dc94988e2ff..f615f8fac4a 100644
--- a/drivers/nvme/nvme_apple.c
+++ b/drivers/nvme/nvme_apple.c
@@ -121,7 +121,7 @@ static void apple_nvme_submit_cmd(struct nvme_queue *nvmeq,
 
 	tcb = ((void *)priv->tcbs[nvmeq->qid]) + tail * ANS_NVMMU_TCB_PITCH;
 	memset(tcb, 0, sizeof(*tcb));
-	tcb->opcode = cmd->common.opcode;
+	tcb->opcode = 0;
 	if (cmd->common.prp1)
 		tcb->flags = ANS_NVMMU_TCB_WRITE | ANS_NVMMU_TCB_READ;
 	else

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
  2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
  2026-09-04 19:22 ` [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer Janne Grunau
  2026-09-04 19:22 ` [PATCH 2/4] nvme: apple: Never set the opcode in the NVMMU TCB Janne Grunau
@ 2026-09-04 19:22 ` Janne Grunau
  2026-09-07 21:23   ` Mark Kettenis
  2026-09-04 19:22 ` [PATCH 4/4] nvme: apple: Drop the PRP null check chicken bit Janne Grunau
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Janne Grunau @ 2026-09-04 19:22 UTC (permalink / raw)
  To: u-boot
  Cc: asahi, Mark Kettenis, Sven Peter, Neil Armstrong, Bin Meng,
	Tom Rini, Francois Berder, Janne Grunau

Apple controllers seem to require any queue buffers on the admin queue
to be aligned to the NVMe controller page size. Weirdly, this constraint
does not apply to the i/o queue where any alignment is fine. This has
always been required on pre-M1 controllers and is required starting with
macOS 15 firmware or post-M4 controllers again. On M1/M2/M3 there was a
chicken bit to disable this requirement.

U-boot appears to always use page-aligned buffers for the admin queue.
Add WARN_ON_ONCE to make it very obvious if/when that changes or wasn't
true to begin with.

Signed-off-by: Janne Grunau <j@jannau.net>
---
 drivers/nvme/nvme_apple.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
index f615f8fac4a..54821f80c81 100644
--- a/drivers/nvme/nvme_apple.c
+++ b/drivers/nvme/nvme_apple.c
@@ -12,6 +12,7 @@
 #include <asm/io.h>
 #include <asm/arch/rtkit.h>
 #include <asm/arch/sart.h>
+#include <linux/bug.h>
 #include <linux/iopoll.h>
 #include <linux/sizes.h>
 
@@ -116,9 +117,15 @@ static void apple_nvme_submit_cmd(struct nvme_queue *nvmeq,
 {
 	struct apple_nvme_priv *priv =
 		container_of(nvmeq->dev, struct apple_nvme_priv, ndev);
+	u32 page_size = nvmeq->dev->page_size;
 	struct ans_nvmmu_tcb *tcb;
 	u16 tail = nvmeq->sq_tail;
 
+	if (nvmeq->qid == NVME_ADMIN_Q) {
+		WARN_ON_ONCE(!IS_ALIGNED(cmd->common.prp1, page_size));
+		WARN_ON_ONCE(!IS_ALIGNED(cmd->common.prp2, page_size));
+	}
+
 	tcb = ((void *)priv->tcbs[nvmeq->qid]) + tail * ANS_NVMMU_TCB_PITCH;
 	memset(tcb, 0, sizeof(*tcb));
 	tcb->opcode = 0;

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] nvme: apple: Drop the PRP null check chicken bit
  2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
                   ` (2 preceding siblings ...)
  2026-09-04 19:22 ` [PATCH 3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers Janne Grunau
@ 2026-09-04 19:22 ` Janne Grunau
  2026-09-07 21:24   ` Mark Kettenis
  2026-09-10 12:44 ` [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Neil Armstrong
  2026-09-10 13:14 ` Neil Armstrong
  5 siblings, 1 reply; 12+ messages in thread
From: Janne Grunau @ 2026-09-04 19:22 UTC (permalink / raw)
  To: u-boot
  Cc: asahi, Mark Kettenis, Sven Peter, Neil Armstrong, Bin Meng,
	Tom Rini, Francois Berder, Janne Grunau

Now that we program the DMA direction correctly the NULL check that used
to make commands fail passes. Another side effect of this bit was that
non-align buffers on the admin queue were silently allowed and that's
been fixed now as well and we this don't need this chicken bit anymore.
More importantly, starting with the firmware installed with macOS 15,
which is required for M4 but can also be installed on the previous SoCs,
the controller no longer exposes this control register and any access
SErrors instead. Just drop the write entirely.

Based on Linux kernel commit 8ce883fd068b ("nvme-apple: Drop the PRP
null check chicken bit").

Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-6-bde19ce8db04@kernel.org/
Fixes: 50333c94f2de ("nvme: apple: Add driver for Apple NVMe storage controller")
Signed-off-by: Janne Grunau <j@jannau.net>
---
 drivers/nvme/nvme_apple.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
index 54821f80c81..948a56e518b 100644
--- a/drivers/nvme/nvme_apple.c
+++ b/drivers/nvme/nvme_apple.c
@@ -26,8 +26,6 @@
 #define ANS_BOOT_STATUS		0x01300
 #define  ANS_BOOT_STATUS_OK	0xde71ce55
 #define ANS_MODESEL		0x01304
-#define ANS_UNKNOWN_CTRL	0x24008
-#define  ANS_PRP_NULL_CHECK	(1 << 11)
 #define ANS_LINEAR_SQ_CTRL	0x24908
 #define  ANS_LINEAR_SQ_CTRL_EN	(1 << 0)
 #define ANS_ASQ_DB		0x2490c
@@ -257,9 +255,6 @@ static int apple_nvme_probe(struct udevice *dev)
 	writel(((ANS_MAX_QUEUE_DEPTH << 16) | ANS_MAX_QUEUE_DEPTH),
 	       priv->base + ANS_MAX_PEND_CMDS_CTRL);
 
-	writel(readl(priv->base + ANS_UNKNOWN_CTRL) & ~ANS_PRP_NULL_CHECK,
-	       priv->base + ANS_UNKNOWN_CTRL);
-
 	strcpy(priv->ndev.vendor, "Apple");
 
 	writel((ANS_NVMMU_TCB_SIZE / ANS_NVMMU_TCB_PITCH) - 1,

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer
  2026-09-04 19:22 ` [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer Janne Grunau
@ 2026-09-07 21:21   ` Mark Kettenis
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Kettenis @ 2026-09-07 21:21 UTC (permalink / raw)
  To: Janne Grunau
  Cc: u-boot, asahi, kettenis, sven, neil.armstrong, bmeng.cn, trini,
	fberder, j

> From: Janne Grunau <j@jannau.net>
> Date: Fri, 04 Sep 2026 21:22:39 +0200
> 
> Setting the DMA direction for commands that don't do any transfer likely
> triggered the PRP NULL check for which we needed a chicken bit. That bit
> has disappeared starting with macOS 15 so let's just do this correctly
> instead.
> 
> Based on Linux kernel commit 94dd5804938d ("nvme-apple: Don't set a DMA
> direction for commands without a data transfer").

It is probably best to keep this aligned with Linux.  However, on
OpenBSD I set the bits based on the low two bits of the opcode.  Like:

        if (cmd->common.opcode & nvme_cmd_write)
                tcb->flags |= ANS_NVMMU_TCB_READ;
	if (cmd->common.opcode & nvme_cmd_read)
	        tcb->flags |= ANS_NVMMU_TCB_WRITE;

(the directions are reversed as the commands are memory -> device
whereas the NVMMU bits are device -> memory).

The NVMe commands are documented like this.  I believe, there aren't
actually any commands that do both a read and a write.  But this would
do the right thing if they ever show up.

Anyway:

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>


> Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-2-bde19ce8db04@kernel.org/
> Fixes: 50333c94f2de ("nvme: apple: Add driver for Apple NVMe storage controller")
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
>  drivers/nvme/nvme_apple.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
> index e674eda8344..dc94988e2ff 100644
> --- a/drivers/nvme/nvme_apple.c
> +++ b/drivers/nvme/nvme_apple.c
> @@ -122,7 +122,10 @@ static void apple_nvme_submit_cmd(struct nvme_queue *nvmeq,
>  	tcb = ((void *)priv->tcbs[nvmeq->qid]) + tail * ANS_NVMMU_TCB_PITCH;
>  	memset(tcb, 0, sizeof(*tcb));
>  	tcb->opcode = cmd->common.opcode;
> -	tcb->flags = ANS_NVMMU_TCB_WRITE | ANS_NVMMU_TCB_READ;
> +	if (cmd->common.prp1)
> +		tcb->flags = ANS_NVMMU_TCB_WRITE | ANS_NVMMU_TCB_READ;
> +	else
> +		tcb->flags = 0;
>  	tcb->slot = tail;
>  	tcb->prpl_len = cmd->rw.length;
>  	tcb->prp1 = cmd->common.prp1;
> 
> -- 
> 2.55.0
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] nvme: apple: Never set the opcode in the NVMMU TCB
  2026-09-04 19:22 ` [PATCH 2/4] nvme: apple: Never set the opcode in the NVMMU TCB Janne Grunau
@ 2026-09-07 21:21   ` Mark Kettenis
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Kettenis @ 2026-09-07 21:21 UTC (permalink / raw)
  To: Janne Grunau
  Cc: u-boot, asahi, kettenis, sven, neil.armstrong, bmeng.cn, trini,
	fberder, j

> From: Janne Grunau <j@jannau.net>
> Date: Fri, 04 Sep 2026 21:22:40 +0200
> 
> macOS always sets this to zero and the firmware starting with macOS 15
> has started to complain about what we're doing here.
> 
> Based on Linux kernel commit cc0fec9b42cf ("nvme-apple: Never set the
> opcode in the NVMMU TCB").

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

> Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-3-bde19ce8db04@kernel.org/
> Fixes: 50333c94f2de ("nvme: apple: Add driver for Apple NVMe storage controller")
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
>  drivers/nvme/nvme_apple.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
> index dc94988e2ff..f615f8fac4a 100644
> --- a/drivers/nvme/nvme_apple.c
> +++ b/drivers/nvme/nvme_apple.c
> @@ -121,7 +121,7 @@ static void apple_nvme_submit_cmd(struct nvme_queue *nvmeq,
>  
>  	tcb = ((void *)priv->tcbs[nvmeq->qid]) + tail * ANS_NVMMU_TCB_PITCH;
>  	memset(tcb, 0, sizeof(*tcb));
> -	tcb->opcode = cmd->common.opcode;
> +	tcb->opcode = 0;
>  	if (cmd->common.prp1)
>  		tcb->flags = ANS_NVMMU_TCB_WRITE | ANS_NVMMU_TCB_READ;
>  	else
> 
> -- 
> 2.55.0
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
  2026-09-04 19:22 ` [PATCH 3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers Janne Grunau
@ 2026-09-07 21:23   ` Mark Kettenis
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Kettenis @ 2026-09-07 21:23 UTC (permalink / raw)
  To: Janne Grunau
  Cc: u-boot, asahi, kettenis, sven, neil.armstrong, bmeng.cn, trini,
	fberder, j

> From: Janne Grunau <j@jannau.net>
> Date: Fri, 04 Sep 2026 21:22:41 +0200
> 
> Apple controllers seem to require any queue buffers on the admin queue
> to be aligned to the NVMe controller page size. Weirdly, this constraint
> does not apply to the i/o queue where any alignment is fine. This has
> always been required on pre-M1 controllers and is required starting with
> macOS 15 firmware or post-M4 controllers again. On M1/M2/M3 there was a
> chicken bit to disable this requirement.
> 
> U-boot appears to always use page-aligned buffers for the admin queue.
> Add WARN_ON_ONCE to make it very obvious if/when that changes or wasn't
> true to begin with.
> 
> Signed-off-by: Janne Grunau <j@jannau.net>

Probably a good idea.  We aren't really size constrained.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

> ---
>  drivers/nvme/nvme_apple.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
> index f615f8fac4a..54821f80c81 100644
> --- a/drivers/nvme/nvme_apple.c
> +++ b/drivers/nvme/nvme_apple.c
> @@ -12,6 +12,7 @@
>  #include <asm/io.h>
>  #include <asm/arch/rtkit.h>
>  #include <asm/arch/sart.h>
> +#include <linux/bug.h>
>  #include <linux/iopoll.h>
>  #include <linux/sizes.h>
>  
> @@ -116,9 +117,15 @@ static void apple_nvme_submit_cmd(struct nvme_queue *nvmeq,
>  {
>  	struct apple_nvme_priv *priv =
>  		container_of(nvmeq->dev, struct apple_nvme_priv, ndev);
> +	u32 page_size = nvmeq->dev->page_size;
>  	struct ans_nvmmu_tcb *tcb;
>  	u16 tail = nvmeq->sq_tail;
>  
> +	if (nvmeq->qid == NVME_ADMIN_Q) {
> +		WARN_ON_ONCE(!IS_ALIGNED(cmd->common.prp1, page_size));
> +		WARN_ON_ONCE(!IS_ALIGNED(cmd->common.prp2, page_size));
> +	}
> +
>  	tcb = ((void *)priv->tcbs[nvmeq->qid]) + tail * ANS_NVMMU_TCB_PITCH;
>  	memset(tcb, 0, sizeof(*tcb));
>  	tcb->opcode = 0;
> 
> -- 
> 2.55.0
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] nvme: apple: Drop the PRP null check chicken bit
  2026-09-04 19:22 ` [PATCH 4/4] nvme: apple: Drop the PRP null check chicken bit Janne Grunau
@ 2026-09-07 21:24   ` Mark Kettenis
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Kettenis @ 2026-09-07 21:24 UTC (permalink / raw)
  To: Janne Grunau
  Cc: u-boot, asahi, kettenis, sven, neil.armstrong, bmeng.cn, trini,
	fberder, j

> From: Janne Grunau <j@jannau.net>
> Date: Fri, 04 Sep 2026 21:22:42 +0200
> 
> Now that we program the DMA direction correctly the NULL check that used
> to make commands fail passes. Another side effect of this bit was that
> non-align buffers on the admin queue were silently allowed and that's
> been fixed now as well and we this don't need this chicken bit anymore.
> More importantly, starting with the firmware installed with macOS 15,
> which is required for M4 but can also be installed on the previous SoCs,
> the controller no longer exposes this control register and any access
> SErrors instead. Just drop the write entirely.
> 
> Based on Linux kernel commit 8ce883fd068b ("nvme-apple: Drop the PRP
> null check chicken bit").

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

> Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-6-bde19ce8db04@kernel.org/
> Fixes: 50333c94f2de ("nvme: apple: Add driver for Apple NVMe storage controller")
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
>  drivers/nvme/nvme_apple.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
> index 54821f80c81..948a56e518b 100644
> --- a/drivers/nvme/nvme_apple.c
> +++ b/drivers/nvme/nvme_apple.c
> @@ -26,8 +26,6 @@
>  #define ANS_BOOT_STATUS		0x01300
>  #define  ANS_BOOT_STATUS_OK	0xde71ce55
>  #define ANS_MODESEL		0x01304
> -#define ANS_UNKNOWN_CTRL	0x24008
> -#define  ANS_PRP_NULL_CHECK	(1 << 11)
>  #define ANS_LINEAR_SQ_CTRL	0x24908
>  #define  ANS_LINEAR_SQ_CTRL_EN	(1 << 0)
>  #define ANS_ASQ_DB		0x2490c
> @@ -257,9 +255,6 @@ static int apple_nvme_probe(struct udevice *dev)
>  	writel(((ANS_MAX_QUEUE_DEPTH << 16) | ANS_MAX_QUEUE_DEPTH),
>  	       priv->base + ANS_MAX_PEND_CMDS_CTRL);
>  
> -	writel(readl(priv->base + ANS_UNKNOWN_CTRL) & ~ANS_PRP_NULL_CHECK,
> -	       priv->base + ANS_UNKNOWN_CTRL);
> -
>  	strcpy(priv->ndev.vendor, "Apple");
>  
>  	writel((ANS_NVMMU_TCB_SIZE / ANS_NVMMU_TCB_PITCH) - 1,
> 
> -- 
> 2.55.0
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support
  2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
                   ` (3 preceding siblings ...)
  2026-09-04 19:22 ` [PATCH 4/4] nvme: apple: Drop the PRP null check chicken bit Janne Grunau
@ 2026-09-10 12:44 ` Neil Armstrong
  2026-09-10 13:11   ` Mark Kettenis
  2026-09-10 13:14 ` Neil Armstrong
  5 siblings, 1 reply; 12+ messages in thread
From: Neil Armstrong @ 2026-09-10 12:44 UTC (permalink / raw)
  To: Janne Grunau, u-boot
  Cc: asahi, Mark Kettenis, Sven Peter, Bin Meng, Tom Rini,
	Francois Berder

Hi Mark,

On 9/4/26 21:22, Janne Grunau wrote:
> Hej,
> 
> this series adapts Sven's Linux nvme-apple series of the same name to
> u-boot. It fixes bugs which are worked around on M1/M2/M3 based devices
> with NVMe firmware from macOS 14.x or earlier. Starting with the NVMe
> controller firmware from macOS 15.x (required for M4 support) the
> workaround is no longer available.
> 
> The quirk to require page-aligned buffers for the admin queue is not
> necessary for u-boot. As far as I can see the buffers are always
> page-aligned. Add noisy WARN_ON_ONCEs to ensure it's noticed if this
> changes or I was mistaken to begin with.

Do you want to pick those changes or should I route them via the NVMe custodian ?

Thanks,
Neil

> 
> Janne
> 
> Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org/
> 
> Signed-off-by: Janne Grunau <j@jannau.net>
> ---
> Janne Grunau (4):
>        nvme: apple: Don't set a DMA direction for commands without a data transfer
>        nvme: apple: Never set the opcode in the NVMMU TCB
>        nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
>        nvme: apple: Drop the PRP null check chicken bit
> 
>   drivers/nvme/nvme_apple.c | 19 ++++++++++++-------
>   1 file changed, 12 insertions(+), 7 deletions(-)
> ---
> base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc
> change-id: 20260904-apple-nvme-fwabi-cf74f7cefac4
> 
> Best regards,


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support
  2026-09-10 12:44 ` [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Neil Armstrong
@ 2026-09-10 13:11   ` Mark Kettenis
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Kettenis @ 2026-09-10 13:11 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: j, u-boot, asahi, kettenis, sven, bmeng.cn, trini, fberder

> Date: Thu, 10 Sep 2026 14:44:38 +0200
> From: Neil Armstrong <neil.armstrong@linaro.org>

Hi Neil,

> Hi Mark,
> 
> On 9/4/26 21:22, Janne Grunau wrote:
> > Hej,
> > 
> > this series adapts Sven's Linux nvme-apple series of the same name to
> > u-boot. It fixes bugs which are worked around on M1/M2/M3 based devices
> > with NVMe firmware from macOS 14.x or earlier. Starting with the NVMe
> > controller firmware from macOS 15.x (required for M4 support) the
> > workaround is no longer available.
> > 
> > The quirk to require page-aligned buffers for the admin queue is not
> > necessary for u-boot. As far as I can see the buffers are always
> > page-aligned. Add noisy WARN_ON_ONCEs to ensure it's noticed if this
> > changes or I was mistaken to begin with.
> 
> Do you want to pick those changes or should I route them via the
> NVMe custodian ?

I'm not setup to pick these up myself, so it would be great if you
could route them via the NVMe custodian.

Thanks,

Mark

> 
> Thanks,
> Neil
> 
> > 
> > Janne
> > 
> > Link: https://lore.kernel.org/asahi/20260806-b4-nvme-fwabi-v1-0-bde19ce8db04@kernel.org/
> > 
> > Signed-off-by: Janne Grunau <j@jannau.net>
> > ---
> > Janne Grunau (4):
> >        nvme: apple: Don't set a DMA direction for commands without a data transfer
> >        nvme: apple: Never set the opcode in the NVMMU TCB
> >        nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
> >        nvme: apple: Drop the PRP null check chicken bit
> > 
> >   drivers/nvme/nvme_apple.c | 19 ++++++++++++-------
> >   1 file changed, 12 insertions(+), 7 deletions(-)
> > ---
> > base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc
> > change-id: 20260904-apple-nvme-fwabi-cf74f7cefac4
> > 
> > Best regards,
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support
  2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
                   ` (4 preceding siblings ...)
  2026-09-10 12:44 ` [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Neil Armstrong
@ 2026-09-10 13:14 ` Neil Armstrong
  5 siblings, 0 replies; 12+ messages in thread
From: Neil Armstrong @ 2026-09-10 13:14 UTC (permalink / raw)
  To: u-boot, Janne Grunau
  Cc: asahi, Mark Kettenis, Sven Peter, Bin Meng, Tom Rini,
	Francois Berder

Hi,

On Fri, 04 Sep 2026 21:22:38 +0200, Janne Grunau wrote:
> Hej,
> 
> this series adapts Sven's Linux nvme-apple series of the same name to
> u-boot. It fixes bugs which are worked around on M1/M2/M3 based devices
> with NVMe firmware from macOS 14.x or earlier. Starting with the NVMe
> controller firmware from macOS 15.x (required for M4 support) the
> workaround is no longer available.
> 
> [...]

Thanks, Applied to https://git.u-boot-project.org/u-boot/custodians/neil.armstrong/u-boot-nvme (u-boot-nvme-fixes)

[1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer
      https://git.u-boot-project.org/u-boot/custodians/neil.armstrong/u-boot-nvme/-/commit/f31c5646ccac279d11e128b8c42e968847eb7df2
[2/4] nvme: apple: Never set the opcode in the NVMMU TCB
      https://git.u-boot-project.org/u-boot/custodians/neil.armstrong/u-boot-nvme/-/commit/bf7661a63cb9f2804cc8851f60686a490355a193
[3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers
      https://git.u-boot-project.org/u-boot/custodians/neil.armstrong/u-boot-nvme/-/commit/b63d271ae7c034033a06e771e06d5a72cd41269d
[4/4] nvme: apple: Drop the PRP null check chicken bit
      https://git.u-boot-project.org/u-boot/custodians/neil.armstrong/u-boot-nvme/-/commit/b3f756587082dac42a828ed74b58f64ac4f336e5

-- 
Neil


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-09-10 13:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 19:22 [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Janne Grunau
2026-09-04 19:22 ` [PATCH 1/4] nvme: apple: Don't set a DMA direction for commands without a data transfer Janne Grunau
2026-09-07 21:21   ` Mark Kettenis
2026-09-04 19:22 ` [PATCH 2/4] nvme: apple: Never set the opcode in the NVMMU TCB Janne Grunau
2026-09-07 21:21   ` Mark Kettenis
2026-09-04 19:22 ` [PATCH 3/4] nvme: apple: Add WARN_ON_ONCE for non page-aligned admin queue buffers Janne Grunau
2026-09-07 21:23   ` Mark Kettenis
2026-09-04 19:22 ` [PATCH 4/4] nvme: apple: Drop the PRP null check chicken bit Janne Grunau
2026-09-07 21:24   ` Mark Kettenis
2026-09-10 12:44 ` [PATCH 0/4] Apple NVMe fixes for macOS 15+ firmware / M4 support Neil Armstrong
2026-09-10 13:11   ` Mark Kettenis
2026-09-10 13:14 ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox