Mayuresh Chitale | bd05090 | 2023-06-03 19:32:56 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2023 |
| 4 | * Ventana Micro Systems Inc. |
| 5 | * |
| 6 | */ |
| 7 | |
Mayuresh Chitale | bd05090 | 2023-06-03 19:32:56 +0530 | [diff] [blame] | 8 | #include <spl.h> |
Mayuresh Chitale | bd05090 | 2023-06-03 19:32:56 +0530 | [diff] [blame] | 9 | #include <nvme.h> |
| 10 | |
| 11 | static int spl_nvme_load_image(struct spl_image_info *spl_image, |
| 12 | struct spl_boot_device *bootdev) |
| 13 | { |
| 14 | int ret; |
| 15 | |
Mayuresh Chitale | bd05090 | 2023-06-03 19:32:56 +0530 | [diff] [blame] | 16 | ret = nvme_scan_namespace(); |
| 17 | if (ret < 0) |
| 18 | return ret; |
| 19 | |
| 20 | ret = spl_blk_load_image(spl_image, bootdev, UCLASS_NVME, |
| 21 | CONFIG_SPL_NVME_BOOT_DEVICE, |
| 22 | CONFIG_SYS_NVME_BOOT_PARTITION); |
| 23 | return ret; |
| 24 | } |
| 25 | |
| 26 | SPL_LOAD_IMAGE_METHOD("NVME", 0, BOOT_DEVICE_NVME, spl_nvme_load_image); |