All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@openbsd.org>
To: u-boot@lists.denx.de
Cc: sjg@chromium.org, jh80.chung@samsung.com, trini@konsulko.com,
	sven@svenpeter.dev, marcan@marcan.st, bmeng.cn@gmail.com,
	Mark Kettenis <kettenis@openbsd.org>
Subject: [PATCH 0/8] Apple M1 NVMe storage support
Date: Fri, 14 Jan 2022 12:04:30 +0100	[thread overview]
Message-ID: <20220114110438.58452-1-kettenis@openbsd.org> (raw)

This adds support for the (rather quirky) NVMe storage controller
integrated on Apple SoCs.  This makes it possible to boot from the
NVMe storage that is present on all the M1 machines that Apple has
released so far.

The series has been designed to have as little impact on the existing
NVMe support as possible.  It splits out the PCIe-specific bits in its
own file/driver and adds a platform driver for the Apple controller.
This platform driver handles all the quirkiness through driver ops.
The existing logic is retained when the driver ops aren't set.  I've
tested this on a firefly-rk3399 board with:

nvme0 at pci1 dev 0 function 0 "Silicon Motion SM2260 NVMe" rev 0x03: msix, NVMe 1.2
nvme0: ADATA SX8000NP, firmware C2.2.1, serial 2H1220011170

(for those not familliar with OpenBSD, that's an ADATA SX8000NP NVMe
M.2 SSD with a Silicon Motion controller)

This patch series depends on the Apple M1 power management controller
support series:

https://patchwork.ozlabs.org/project/uboot/list/?series=280359


Mark Kettenis (8):
  nvme: Split out PCI support
  mailbox: apple: Add driver for Apple IOP mailbox
  arm: apple: Add RTKit support
  nvme: Introduce driver ops
  nvme: Add shutdown function
  power: domain: apple: Add reset support
  nvme: apple: Add driver for Apple NVMe storage controller
  configs: apple: Add NVMe boot target

 arch/arm/Kconfig                              |   2 +
 arch/arm/include/asm/arch-apple/rtkit.h       |  11 +
 arch/arm/mach-apple/Makefile                  |   1 +
 arch/arm/mach-apple/rtkit.c                   | 231 +++++++++++++++++
 configs/apple_m1_defconfig                    |   1 +
 configs/clearfog_gt_8k_defconfig              |   2 +-
 configs/firefly-rk3399_defconfig              |   2 +-
 configs/khadas-vim3_android_ab_defconfig      |   2 +-
 configs/khadas-vim3_android_defconfig         |   2 +-
 configs/khadas-vim3_defconfig                 |   2 +-
 configs/khadas-vim3l_android_ab_defconfig     |   2 +-
 configs/khadas-vim3l_android_defconfig        |   2 +-
 configs/khadas-vim3l_defconfig                |   2 +-
 configs/kontron_sl28_defconfig                |   2 +-
 configs/ls1012afrdm_qspi_defconfig            |   2 +-
 configs/ls1012afrdm_tfa_defconfig             |   2 +-
 .../ls1012afrwy_qspi_SECURE_BOOT_defconfig    |   2 +-
 configs/ls1012afrwy_qspi_defconfig            |   2 +-
 configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig |   2 +-
 configs/ls1012afrwy_tfa_defconfig             |   2 +-
 configs/ls1012aqds_qspi_defconfig             |   2 +-
 configs/ls1012aqds_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1012aqds_tfa_defconfig              |   2 +-
 configs/ls1012ardb_qspi_SECURE_BOOT_defconfig |   2 +-
 configs/ls1012ardb_qspi_defconfig             |   2 +-
 configs/ls1012ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1012ardb_tfa_defconfig              |   2 +-
 configs/ls1021aiot_qspi_defconfig             |   2 +-
 configs/ls1021aiot_sdcard_defconfig           |   2 +-
 configs/ls1021aqds_ddr4_nor_defconfig         |   2 +-
 configs/ls1021aqds_ddr4_nor_lpuart_defconfig  |   2 +-
 configs/ls1021aqds_nand_defconfig             |   2 +-
 configs/ls1021aqds_nor_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1021aqds_nor_defconfig              |   2 +-
 configs/ls1021aqds_nor_lpuart_defconfig       |   2 +-
 configs/ls1021aqds_qspi_defconfig             |   2 +-
 configs/ls1021aqds_sdcard_ifc_defconfig       |   2 +-
 configs/ls1021aqds_sdcard_qspi_defconfig      |   2 +-
 configs/ls1021atsn_qspi_defconfig             |   2 +-
 configs/ls1021atsn_sdcard_defconfig           |   2 +-
 configs/ls1021atwr_nor_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1021atwr_nor_defconfig              |   2 +-
 configs/ls1021atwr_nor_lpuart_defconfig       |   2 +-
 configs/ls1021atwr_qspi_defconfig             |   2 +-
 configs/ls1021atwr_sdcard_ifc_defconfig       |   2 +-
 configs/ls1021atwr_sdcard_qspi_defconfig      |   2 +-
 configs/ls1028aqds_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1028aqds_tfa_defconfig              |   2 +-
 configs/ls1028aqds_tfa_lpuart_defconfig       |   2 +-
 configs/ls1028ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1028ardb_tfa_defconfig              |   2 +-
 configs/ls1043aqds_defconfig                  |   2 +-
 configs/ls1043aqds_lpuart_defconfig           |   2 +-
 configs/ls1043aqds_nand_defconfig             |   2 +-
 configs/ls1043aqds_nor_ddr3_defconfig         |   2 +-
 configs/ls1043aqds_qspi_defconfig             |   2 +-
 configs/ls1043aqds_sdcard_ifc_defconfig       |   2 +-
 configs/ls1043aqds_sdcard_qspi_defconfig      |   2 +-
 configs/ls1043aqds_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1043aqds_tfa_defconfig              |   2 +-
 configs/ls1043ardb_SECURE_BOOT_defconfig      |   2 +-
 configs/ls1043ardb_defconfig                  |   2 +-
 configs/ls1043ardb_nand_SECURE_BOOT_defconfig |   2 +-
 configs/ls1043ardb_nand_defconfig             |   2 +-
 configs/ls1043ardb_sdcard_defconfig           |   2 +-
 configs/ls1043ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1043ardb_tfa_defconfig              |   2 +-
 configs/ls1046afrwy_tfa_defconfig             |   2 +-
 configs/ls1046aqds_SECURE_BOOT_defconfig      |   2 +-
 configs/ls1046aqds_defconfig                  |   2 +-
 configs/ls1046aqds_lpuart_defconfig           |   2 +-
 configs/ls1046aqds_nand_defconfig             |   2 +-
 configs/ls1046aqds_qspi_defconfig             |   2 +-
 configs/ls1046aqds_sdcard_ifc_defconfig       |   2 +-
 configs/ls1046aqds_sdcard_qspi_defconfig      |   2 +-
 configs/ls1046aqds_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1046aqds_tfa_defconfig              |   2 +-
 configs/ls1046ardb_emmc_defconfig             |   2 +-
 configs/ls1046ardb_qspi_SECURE_BOOT_defconfig |   2 +-
 configs/ls1046ardb_qspi_defconfig             |   2 +-
 configs/ls1046ardb_qspi_spl_defconfig         |   2 +-
 configs/ls1046ardb_sdcard_defconfig           |   2 +-
 configs/ls1046ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1046ardb_tfa_defconfig              |   2 +-
 configs/ls1088aqds_defconfig                  |   2 +-
 configs/ls1088aqds_qspi_SECURE_BOOT_defconfig |   2 +-
 configs/ls1088aqds_qspi_defconfig             |   2 +-
 configs/ls1088aqds_sdcard_ifc_defconfig       |   2 +-
 configs/ls1088aqds_sdcard_qspi_defconfig      |   2 +-
 configs/ls1088aqds_tfa_defconfig              |   2 +-
 configs/ls1088ardb_qspi_SECURE_BOOT_defconfig |   2 +-
 configs/ls1088ardb_qspi_defconfig             |   2 +-
 configs/ls1088ardb_sdcard_qspi_defconfig      |   2 +-
 configs/ls1088ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls1088ardb_tfa_defconfig              |   2 +-
 configs/ls2080aqds_SECURE_BOOT_defconfig      |   2 +-
 configs/ls2080aqds_defconfig                  |   2 +-
 configs/ls2080aqds_nand_defconfig             |   2 +-
 configs/ls2080aqds_qspi_defconfig             |   2 +-
 configs/ls2080aqds_sdcard_defconfig           |   2 +-
 configs/ls2080ardb_SECURE_BOOT_defconfig      |   2 +-
 configs/ls2080ardb_defconfig                  |   2 +-
 configs/ls2080ardb_nand_defconfig             |   2 +-
 configs/ls2081ardb_defconfig                  |   2 +-
 configs/ls2088aqds_tfa_defconfig              |   2 +-
 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig |   2 +-
 configs/ls2088ardb_qspi_defconfig             |   2 +-
 configs/ls2088ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/ls2088ardb_tfa_defconfig              |   2 +-
 configs/lx2160aqds_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/lx2160aqds_tfa_defconfig              |   2 +-
 configs/lx2160ardb_tfa_SECURE_BOOT_defconfig  |   2 +-
 configs/lx2160ardb_tfa_defconfig              |   2 +-
 configs/lx2160ardb_tfa_stmm_defconfig         |   2 +-
 configs/mvebu_crb_cn9130_defconfig            |   2 +-
 configs/mvebu_db_armada8k_defconfig           |   2 +-
 configs/mvebu_db_cn9130_defconfig             |   2 +-
 configs/mvebu_espressobin-88f3720_defconfig   |   2 +-
 configs/mvebu_mcbin-88f8040_defconfig         |   2 +-
 configs/mvebu_puzzle-m801-88f8040_defconfig   |   2 +-
 configs/nanopc-t4-rk3399_defconfig            |   2 +-
 configs/octeontx2_96xx_defconfig              |   2 +-
 configs/octeontx_81xx_defconfig               |   2 +-
 configs/octeontx_83xx_defconfig               |   2 +-
 configs/p3450-0000_defconfig                  |   2 +-
 configs/pinebook-pro-rk3399_defconfig         |   2 +-
 configs/qemu-x86_64_defconfig                 |   2 +-
 configs/qemu-x86_defconfig                    |   2 +-
 configs/qemu_arm64_defconfig                  |   2 +-
 configs/qemu_arm_defconfig                    |   2 +-
 configs/rcar3_salvator-x_defconfig            |   2 +-
 configs/roc-pc-mezzanine-rk3399_defconfig     |   2 +-
 configs/rock-pi-4-rk3399_defconfig            |   2 +-
 configs/rock-pi-4c-rk3399_defconfig           |   2 +-
 configs/rock-pi-n10-rk3399pro_defconfig       |   2 +-
 configs/rock960-rk3399_defconfig              |   2 +-
 configs/rockpro64-rk3399_defconfig            |   2 +-
 configs/sandbox64_defconfig                   |   2 +-
 configs/sandbox_defconfig                     |   2 +-
 configs/sandbox_flattree_defconfig            |   2 +-
 configs/sandbox_noinst_defconfig              |   2 +-
 configs/sandbox_spl_defconfig                 |   2 +-
 configs/sifive_unmatched_defconfig            |   2 +-
 configs/synquacer_developerbox_defconfig      |   2 +-
 configs/turris_mox_defconfig                  |   2 +-
 configs/turris_omnia_defconfig                |   2 +-
 doc/develop/driver-model/nvme.rst             |   1 +
 drivers/mailbox/Kconfig                       |  11 +
 drivers/mailbox/Makefile                      |   1 +
 drivers/mailbox/apple-mbox.c                  |  92 +++++++
 drivers/nvme/Kconfig                          |  21 +-
 drivers/nvme/Makefile                         |   2 +
 drivers/nvme/nvme.c                           |  86 ++-----
 drivers/nvme/nvme.h                           |  37 +++
 drivers/nvme/nvme_apple.c                     | 233 ++++++++++++++++++
 drivers/nvme/nvme_pci.c                       |  49 ++++
 drivers/power/domain/apple-pmgr.c             |  73 +++++-
 include/configs/apple.h                       |   7 +
 include/linux/apple-mailbox.h                 |  19 ++
 159 files changed, 957 insertions(+), 203 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-apple/rtkit.h
 create mode 100644 arch/arm/mach-apple/rtkit.c
 create mode 100644 drivers/mailbox/apple-mbox.c
 create mode 100644 drivers/nvme/nvme_apple.c
 create mode 100644 drivers/nvme/nvme_pci.c
 create mode 100644 include/linux/apple-mailbox.h

-- 
2.34.1


             reply	other threads:[~2022-01-14 11:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 11:04 Mark Kettenis [this message]
2022-01-14 11:04 ` [PATCH 1/8] nvme: Split out PCI support Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-22 12:47     ` Mark Kettenis
2022-01-22 13:18       ` Simon Glass
2022-01-22 14:57         ` Mark Kettenis
2022-01-14 11:04 ` [PATCH 2/8] mailbox: apple: Add driver for Apple IOP mailbox Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-22 13:54     ` Mark Kettenis
2022-01-22 17:17       ` Simon Glass
2022-01-14 11:04 ` [PATCH 3/8] arm: apple: Add RTKit support Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-22 13:59     ` Mark Kettenis
2022-01-22 17:17       ` Simon Glass
2022-01-22 19:31         ` Mark Kettenis
2022-01-14 11:04 ` [PATCH 4/8] nvme: Introduce driver ops Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-22 13:33     ` Mark Kettenis
2022-01-22 17:17       ` Simon Glass
2022-01-14 11:04 ` [PATCH 5/8] nvme: Add shutdown function Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-14 11:04 ` [PATCH 6/8] power: domain: apple: Add reset support Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-22 14:11     ` Mark Kettenis
2022-01-22 17:17       ` Simon Glass
2022-01-22 19:35         ` Mark Kettenis
2022-01-14 11:04 ` [PATCH 7/8] nvme: apple: Add driver for Apple NVMe storage controller Mark Kettenis
2022-01-22  1:40   ` Simon Glass
2022-01-22 14:45     ` Mark Kettenis
2022-01-22 17:17       ` Simon Glass
2022-01-22 17:41         ` Mark Kettenis
2022-01-22 18:28           ` Simon Glass
2022-01-14 11:04 ` [PATCH 8/8] configs: apple: Add NVMe boot target Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220114110438.58452-1-kettenis@openbsd.org \
    --to=kettenis@openbsd.org \
    --cc=bmeng.cn@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=marcan@marcan.st \
    --cc=sjg@chromium.org \
    --cc=sven@svenpeter.dev \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.