1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018, Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
4 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
10 #include <virtio_types.h>
13 static int virtio_curr_dev;
15 static int do_virtio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
17 if (argc == 2 && !strcmp(argv[1], "scan")) {
18 /* make sure all virtio devices are enumerated */
21 return CMD_RET_SUCCESS;
24 return blk_common_cmd(argc, argv, IF_TYPE_VIRTIO, &virtio_curr_dev);
28 virtio, 8, 1, do_virtio,
29 "virtio block devices sub-system",
30 "scan - initialize virtio bus\n"
31 "virtio info - show all available virtio block devices\n"
32 "virtio device [dev] - show or set current virtio block device\n"
33 "virtio part [dev] - print partition table of one or all virtio block devices\n"
34 "virtio read addr blk# cnt - read `cnt' blocks starting at block\n"
35 " `blk#' to memory address `addr'\n"
36 "virtio write addr blk# cnt - write `cnt' blocks starting at block\n"
37 " `blk#' from memory address `addr'"