]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - cmd/nvme.c
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 NXP Semiconductors
4 * Copyright (C) 2017 Bin Meng <bmeng.cn@gmail.com>
12 static int nvme_curr_dev
;
14 static int do_nvme(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
19 if (strncmp(argv
[1], "scan", 4) == 0) {
20 ret
= nvme_scan_namespace();
22 return CMD_RET_FAILURE
;
26 if (strncmp(argv
[1], "deta", 4) == 0) {
29 ret
= blk_get_device(IF_TYPE_NVME
, nvme_curr_dev
,
32 return CMD_RET_FAILURE
;
34 nvme_print_info(udev
);
40 return blk_common_cmd(argc
, argv
, IF_TYPE_NVME
, &nvme_curr_dev
);
45 "NVM Express sub-system",
46 "scan - scan NVMe devices\n"
47 "nvme detail - show details of current NVMe device\n"
48 "nvme info - show all available NVMe devices\n"
49 "nvme device [dev] - show or set current NVMe device\n"
50 "nvme part [dev] - print partition table of one or all NVMe devices\n"
51 "nvme read addr blk# cnt - read `cnt' blocks starting at block\n"
52 " `blk#' to memory address `addr'\n"
53 "nvme write addr blk# cnt - write `cnt' blocks starting at block\n"
54 " `blk#' from memory address `addr'"