blob: c8774d67ecf132ae7bf81c9d5cacea47995a5be4 [file] [log] [blame]
Mayuresh Chitale02d9c0b2023-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
8#include <common.h>
9#include <spl.h>
Mayuresh Chitale02d9c0b2023-06-03 19:32:56 +053010#include <nvme.h>
11
12static int spl_nvme_load_image(struct spl_image_info *spl_image,
13 struct spl_boot_device *bootdev)
14{
15 int ret;
16
Mayuresh Chitale02d9c0b2023-06-03 19:32:56 +053017 ret = nvme_scan_namespace();
18 if (ret < 0)
19 return ret;
20
21 ret = spl_blk_load_image(spl_image, bootdev, UCLASS_NVME,
22 CONFIG_SPL_NVME_BOOT_DEVICE,
23 CONFIG_SYS_NVME_BOOT_PARTITION);
24 return ret;
25}
26
27SPL_LOAD_IMAGE_METHOD("NVME", 0, BOOT_DEVICE_NVME, spl_nvme_load_image);