Anastasiia Lukianenko | 722bc5b | 2020-08-06 12:42:55 +0300 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * (C) Copyright 2020 EPAM Systems Inc. |
| 4 | * |
| 5 | * XEN para-virtualized block device support |
| 6 | */ |
| 7 | |
| 8 | #include <blk.h> |
| 9 | #include <common.h> |
| 10 | #include <command.h> |
| 11 | |
| 12 | /* Current I/O Device */ |
| 13 | static int pvblock_curr_device; |
| 14 | |
| 15 | int do_pvblock(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
| 16 | { |
Simon Glass | e33a5c6 | 2022-08-11 19:34:59 -0600 | [diff] [blame] | 17 | return blk_common_cmd(argc, argv, UCLASS_PVBLOCK, |
Anastasiia Lukianenko | 722bc5b | 2020-08-06 12:42:55 +0300 | [diff] [blame] | 18 | &pvblock_curr_device); |
| 19 | } |
| 20 | |
| 21 | U_BOOT_CMD(pvblock, 5, 1, do_pvblock, |
| 22 | "Xen para-virtualized block device", |
| 23 | "info - show available block devices\n" |
| 24 | "pvblock device [dev] - show or set current device\n" |
| 25 | "pvblock part [dev] - print partition table of one or all devices\n" |
| 26 | "pvblock read addr blk# cnt\n" |
| 27 | "pvblock write addr blk# cnt - read/write `cnt'" |
| 28 | " blocks starting at block `blk#'\n" |
| 29 | " to/from memory address `addr'"); |