distro_bootcmd: add NVME support
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 21 Dec 2018 01:18:16 +0000 (02:18 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2019 08:40:05 +0000 (09:40 +0100)
Some boards support NVME drives. We should be able to use them as boot
devices.

NVME access requires running 'nvme scan'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/config_distro_bootcmd.h

index 555efb7433fd228b4c23fb6c5ff885a7dc85a9bf..fa0e017b56ed70f41e72b74c099847dea50f0e77 100644 (file)
        BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_SATA
 #endif
 
+#ifdef CONFIG_NVME
+#define BOOTENV_RUN_NVME_INIT "run nvme_init; "
+#define BOOTENV_SET_NVME_NEED_INIT "setenv nvme_need_init; "
+#define BOOTENV_SHARED_NVME \
+       "nvme_init=" \
+               "if ${nvme_need_init}; then " \
+                       "setenv nvme_need_init false; " \
+                       "nvme scan; " \
+               "fi\0" \
+       \
+       "nvme_boot=" \
+               BOOTENV_RUN_NVME_INIT \
+               BOOTENV_SHARED_BLKDEV_BODY(nvme)
+#define BOOTENV_DEV_NVME       BOOTENV_DEV_BLKDEV
+#define BOOTENV_DEV_NAME_NVME  BOOTENV_DEV_NAME_BLKDEV
+#else
+#define BOOTENV_RUN_NVME_INIT
+#define BOOTENV_SET_NVME_NEED_INIT
+#define BOOTENV_SHARED_NVME
+#define BOOTENV_DEV_NVME \
+       BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME
+#define BOOTENV_DEV_NAME_NVME \
+       BOOT_TARGET_DEVICES_references_NVME_without_CONFIG_NVME
+#endif
+
 #ifdef CONFIG_SCSI
 #define BOOTENV_RUN_SCSI_INIT "run scsi_init; "
 #define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; "
        BOOTENV_SHARED_USB \
        BOOTENV_SHARED_SATA \
        BOOTENV_SHARED_SCSI \
+       BOOTENV_SHARED_NVME \
        BOOTENV_SHARED_IDE \
        BOOTENV_SHARED_UBIFS \
        BOOTENV_SHARED_EFI \
        BOOT_TARGET_DEVICES(BOOTENV_DEV)                                  \
        \
        "distro_bootcmd=" BOOTENV_SET_SCSI_NEED_INIT                      \
+               BOOTENV_SET_NVME_NEED_INIT                                \
                "for target in ${boot_targets}; do "                      \
                        "run bootcmd_${target}; "                         \
                "done\0"