blob: 0e15a3c7545a3d7104de8ddb6a03abb72068fcf1 [file] [log] [blame]
Mayuresh Chitalebd050902023-06-03 19:32:56 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2023
4 * Ventana Micro Systems Inc.
5 *
6 */
7
Mayuresh Chitalebd050902023-06-03 19:32:56 +05308#include <spl.h>
Mayuresh Chitalebd050902023-06-03 19:32:56 +05309#include <nvme.h>
10
11static int spl_nvme_load_image(struct spl_image_info *spl_image,
12 struct spl_boot_device *bootdev)
13{
14 int ret;
15
Mayuresh Chitalebd050902023-06-03 19:32:56 +053016 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
26SPL_LOAD_IMAGE_METHOD("NVME", 0, BOOT_DEVICE_NVME, spl_nvme_load_image);