* [PATCH v2 0/2] nvme: apple: add t8132 (M4) ANS2 NVMe support
@ 2026-09-06 20:15 Yureka Lilian
2026-09-06 20:15 ` [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible Yureka Lilian
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Yureka Lilian @ 2026-09-06 20:15 UTC (permalink / raw)
To: Sven Peter, Janne Grunau, Neal Gompa, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Keith Busch, Jens Axboe,
Christoph Hellwig, Sagi Grimberg
Cc: asahi, linux-arm-kernel, devicetree, linux-kernel, linux-nvme,
Yureka Lilian
This patch series adds dt-bindings and driver support for ANS2 NVMe on
the Apple t8132 (M4) SoC.
This variant requires the IO queues to be registered using additional
MMIO writes. Otherwise it is largerly the same as the ANS2 NVMe variants
present on Apple M1-M3 SoCs.
Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
---
Changes in v2:
- Reverted the separate_nvmmu_base part, since reg[9] from the Apple
device tree works for both nvme and nvmmu regs.
- Differentiate the meaning of mmio_nvme+0x1210 between t8103 and t8132
resolves an ANS crash caused by the IO completion queue size mismatching
between our data structures (64) and the ANS (65).
- Link to v1: https://patch.msgid.link/20260811-apple-nvme-t8132-v1-0-865be32e42c3@cyberchaos.dev
To: Sven Peter <sven@kernel.org>
To: Janne Grunau <j@jannau.net>
To: Neal Gompa <neal@gompa.dev>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Keith Busch <kbusch@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@lst.de>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: asahi@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
models: On t8132 this now sets the IO queue sizes and is 0-based. This
---
Yureka Lilian (2):
dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible
nvme: apple: add t8132 (M4) ANS2 NVMe support
.../devicetree/bindings/nvme/apple,nvme-ans.yaml | 1 +
drivers/nvme/host/apple.c | 39 +++++++++++++++++++---
2 files changed, 36 insertions(+), 4 deletions(-)
---
base-commit: e5e04726cdd043e309677071ab1b65a4b18f422b
change-id: 20260811-apple-nvme-t8132-31399d6f81aa
Best regards,
--
Yureka Lilian <yureka@cyberchaos.dev>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible
2026-09-06 20:15 [PATCH v2 0/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
@ 2026-09-06 20:15 ` Yureka Lilian
2026-09-07 17:20 ` Conor Dooley
2026-09-06 20:15 ` [PATCH v2 2/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
2026-09-11 15:22 ` [PATCH v2 0/2] " Keith Busch
2 siblings, 1 reply; 6+ messages in thread
From: Yureka Lilian @ 2026-09-06 20:15 UTC (permalink / raw)
To: Sven Peter, Janne Grunau, Neal Gompa, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Keith Busch, Jens Axboe,
Christoph Hellwig, Sagi Grimberg
Cc: asahi, linux-arm-kernel, devicetree, linux-kernel, linux-nvme,
Yureka Lilian
Add a new base compatible for the ANS2 NVMe on the Apple t8132 (M4) SoC,
which requires the IO queues to be registered using additional MMIO writes.
Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
---
Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml b/Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
index 4c0b1f90aff8..a1e5b1831468 100644
--- a/Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
+++ b/Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
@@ -16,6 +16,7 @@ properties:
- items:
- const: apple,t6020-nvme-ans2
- const: apple,t8103-nvme-ans2
+ - const: apple,t8132-nvme-ans2
- items:
- enum:
# Do not add additional SoC to this list.
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] nvme: apple: add t8132 (M4) ANS2 NVMe support
2026-09-06 20:15 [PATCH v2 0/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
2026-09-06 20:15 ` [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible Yureka Lilian
@ 2026-09-06 20:15 ` Yureka Lilian
2026-09-07 17:23 ` Sven Peter
2026-09-11 15:22 ` [PATCH v2 0/2] " Keith Busch
2 siblings, 1 reply; 6+ messages in thread
From: Yureka Lilian @ 2026-09-06 20:15 UTC (permalink / raw)
To: Sven Peter, Janne Grunau, Neal Gompa, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Keith Busch, Jens Axboe,
Christoph Hellwig, Sagi Grimberg
Cc: asahi, linux-arm-kernel, devicetree, linux-kernel, linux-nvme,
Yureka Lilian
Add support for ANS2 NVMe on the Apple t8132 (M4) SoC.
This variant requires the IO queues to be registered using additional
MMIO writes. The qsize of the create_{cq,sq} command is now ignored, and
instead a write to mmio_nvme+0x1210 (which was previously known as
APPLE_ANS_MAX_PEND_CMDS_CTRL) sets the IO queue sizes.
Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
---
drivers/nvme/host/apple.c | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
index c63e28c75766..4621584b1b6f 100644
--- a/drivers/nvme/host/apple.c
+++ b/drivers/nvme/host/apple.c
@@ -42,7 +42,11 @@
#define APPLE_ANS_ACQ_DB 0x1004
#define APPLE_ANS_IOCQ_DB 0x100c
-#define APPLE_ANS_MAX_PEND_CMDS_CTRL 0x1210
+#define APPLE_ANS_T8132_IOQ_CMDS 0x1200
+#define APPLE_ANS_T8132_IOQ_CQES 0x1208
+#define APPLE_ANS_T8132_IOQ_SIZE 0x1210
+
+#define APPLE_ANS_T8103_MAX_PEND_CMDS_CTRL 0x1210
#define APPLE_ANS_BOOT_STATUS 0x1300
#define APPLE_ANS_BOOT_STATUS_OK 0xde71ce55
@@ -184,6 +188,7 @@ struct apple_nvme_iod {
struct apple_nvme_hw {
bool has_lsq_nvmmu;
+ bool needs_ioq_register;
u32 max_queue_depth;
};
@@ -1133,9 +1138,16 @@ static void apple_nvme_reset_work(struct work_struct *work)
anv->mmio_nvme + APPLE_ANS_LINEAR_SQ_CTRL);
/* Allow as many pending command as possible for both queues */
- writel(anv->hw->max_queue_depth
- | (anv->hw->max_queue_depth << 16), anv->mmio_nvme
- + APPLE_ANS_MAX_PEND_CMDS_CTRL);
+ if (!anv->hw->needs_ioq_register) {
+ /*
+ * Since T8132, this is replaced by IOQ_SIZE which is
+ * located at the same offset and is handled with the
+ * IO queue setup further below.
+ */
+ writel(anv->hw->max_queue_depth
+ | (anv->hw->max_queue_depth << 16), anv->mmio_nvme
+ + APPLE_ANS_T8103_MAX_PEND_CMDS_CTRL);
+ }
/* Setup the NVMMU for the maximum admin and IO queue depth */
writel(anv->hw->max_queue_depth - 1,
@@ -1190,6 +1202,16 @@ static void apple_nvme_reset_work(struct work_struct *work)
if (ret)
goto out_remove_cq;
+ if (anv->hw->needs_ioq_register) {
+ writeq(anv->ioq.cq_dma_addr,
+ anv->mmio_nvme + APPLE_ANS_T8132_IOQ_CQES);
+ writeq(anv->ioq.sq_dma_addr,
+ anv->mmio_nvme + APPLE_ANS_T8132_IOQ_CMDS);
+ writel((anv->hw->max_queue_depth - 1)
+ | ((anv->hw->max_queue_depth - 1) << 16), anv->mmio_nvme
+ + APPLE_ANS_T8132_IOQ_SIZE);
+ }
+
apple_nvme_init_queue(&anv->ioq);
nr_io_queues = 1;
ret = nvme_set_queue_count(&anv->ctrl, &nr_io_queues);
@@ -1699,17 +1721,26 @@ static DEFINE_SIMPLE_DEV_PM_OPS(apple_nvme_pm_ops, apple_nvme_suspend,
static const struct apple_nvme_hw apple_nvme_t8015_hw = {
.has_lsq_nvmmu = false,
+ .needs_ioq_register = false,
.max_queue_depth = 16,
};
static const struct apple_nvme_hw apple_nvme_t8103_hw = {
.has_lsq_nvmmu = true,
+ .needs_ioq_register = false,
+ .max_queue_depth = 64,
+};
+
+static const struct apple_nvme_hw apple_nvme_t8132_hw = {
+ .has_lsq_nvmmu = true,
+ .needs_ioq_register = true,
.max_queue_depth = 64,
};
static const struct of_device_id apple_nvme_of_match[] = {
{ .compatible = "apple,t8015-nvme-ans2", .data = &apple_nvme_t8015_hw },
{ .compatible = "apple,t8103-nvme-ans2", .data = &apple_nvme_t8103_hw },
+ { .compatible = "apple,t8132-nvme-ans2", .data = &apple_nvme_t8132_hw },
{ .compatible = "apple,nvme-ans2", .data = &apple_nvme_t8103_hw },
{},
};
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible
2026-09-06 20:15 ` [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible Yureka Lilian
@ 2026-09-07 17:20 ` Conor Dooley
0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2026-09-07 17:20 UTC (permalink / raw)
To: Yureka Lilian
Cc: Sven Peter, Janne Grunau, Neal Gompa, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Keith Busch, Jens Axboe,
Christoph Hellwig, Sagi Grimberg, asahi, linux-arm-kernel,
devicetree, linux-kernel, linux-nvme
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] nvme: apple: add t8132 (M4) ANS2 NVMe support
2026-09-06 20:15 ` [PATCH v2 2/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
@ 2026-09-07 17:23 ` Sven Peter
0 siblings, 0 replies; 6+ messages in thread
From: Sven Peter @ 2026-09-07 17:23 UTC (permalink / raw)
To: Yureka Lilian, Janne Grunau, Neal Gompa, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Keith Busch, Jens Axboe,
Christoph Hellwig, Sagi Grimberg
Cc: asahi, linux-arm-kernel, devicetree, linux-kernel, linux-nvme
On 9/6/26 22:15, Yureka Lilian wrote:
> Add support for ANS2 NVMe on the Apple t8132 (M4) SoC.
>
> This variant requires the IO queues to be registered using additional
> MMIO writes. The qsize of the create_{cq,sq} command is now ignored, and
> instead a write to mmio_nvme+0x1210 (which was previously known as
> APPLE_ANS_MAX_PEND_CMDS_CTRL) sets the IO queue sizes.
>
> Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
> ---
Reviewed-by: Sven Peter <sven@kernel.org>
Best,
Sven
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 0/2] nvme: apple: add t8132 (M4) ANS2 NVMe support
2026-09-06 20:15 [PATCH v2 0/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
2026-09-06 20:15 ` [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible Yureka Lilian
2026-09-06 20:15 ` [PATCH v2 2/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
@ 2026-09-11 15:22 ` Keith Busch
2 siblings, 0 replies; 6+ messages in thread
From: Keith Busch @ 2026-09-11 15:22 UTC (permalink / raw)
To: Yureka Lilian
Cc: Sven Peter, Janne Grunau, Neal Gompa, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Jens Axboe, Christoph Hellwig,
Sagi Grimberg, asahi, linux-arm-kernel, devicetree, linux-kernel,
linux-nvme
On Sun, Sep 06, 2026 at 10:15:28PM +0200, Yureka Lilian wrote:
> This patch series adds dt-bindings and driver support for ANS2 NVMe on
> the Apple t8132 (M4) SoC.
>
> This variant requires the IO queues to be registered using additional
> MMIO writes. Otherwise it is largerly the same as the ANS2 NVMe variants
> present on Apple M1-M3 SoCs.
Thanks, applied to nvme-7.3.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-11 15:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 20:15 [PATCH v2 0/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
2026-09-06 20:15 ` [PATCH v2 1/2] dt-bindings: nvme: Add apple,t8132-nvme-ans2 compatible Yureka Lilian
2026-09-07 17:20 ` Conor Dooley
2026-09-06 20:15 ` [PATCH v2 2/2] nvme: apple: add t8132 (M4) ANS2 NVMe support Yureka Lilian
2026-09-07 17:23 ` Sven Peter
2026-09-11 15:22 ` [PATCH v2 0/2] " Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox