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>
11 #include <virtio_types.h>
14 static int virtio_curr_dev;
16 static int do_virtio(struct cmd_tbl *cmdtp, int flag, int argc,
19 if (argc == 2 && !strcmp(argv[1], "scan")) {
20 /* make sure all virtio devices are enumerated */
23 return CMD_RET_SUCCESS;
26 return blk_common_cmd(argc, argv, IF_TYPE_VIRTIO, &virtio_curr_dev);
30 virtio, 8, 1, do_virtio,
31 "virtio block devices sub-system",
32 "scan - initialize virtio bus\n"
33 "virtio info - show all available virtio block devices\n"
34 "virtio device [dev] - show or set current virtio block device\n"
35 "virtio part [dev] - print partition table of one or all virtio block devices\n"
36 "virtio read addr blk# cnt - read `cnt' blocks starting at block\n"
37 " `blk#' to memory address `addr'\n"
38 "virtio write addr blk# cnt - write `cnt' blocks starting at block\n"
39 " `blk#' from memory address `addr'"