blob: b7082bc63adcda0c77c4955f558edbf3157b539e [file] [log] [blame]
// SPDX-License-Identifier: GPL-2.0+
* Copyright (C) 2018, Tuomas Tynkkynen <>
* Copyright (C) 2018, Bin Meng <>
#include <common.h>
#include <command.h>
#include <dm.h>
#include <virtio_types.h>
#include <virtio.h>
static int virtio_curr_dev;
static int do_virtio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc == 2 && !strcmp(argv[1], "scan")) {
/* make sure all virtio devices are enumerated */
return blk_common_cmd(argc, argv, IF_TYPE_VIRTIO, &virtio_curr_dev);
virtio, 8, 1, do_virtio,
"virtio block devices sub-system",
"scan - initialize virtio bus\n"
"virtio info - show all available virtio block devices\n"
"virtio device [dev] - show or set current virtio block device\n"
"virtio part [dev] - print partition table of one or all virtio block devices\n"
"virtio read addr blk# cnt - read `cnt' blocks starting at block\n"
" `blk#' to memory address `addr'\n"
"virtio write addr blk# cnt - write `cnt' blocks starting at block\n"
" `blk#' from memory address `addr'"