summaryrefslogtreecommitdiff
path: root/cmd/pvblock.c
diff options
context:
space:
mode:
authorAnastasiia Lukianenko <anastasiia_lukianenko@epam.com>2020-08-06 12:42:55 +0300
committerTom Rini <trini@konsulko.com>2020-08-14 15:18:30 -0400
commit722bc5b5d901eafb96e8530cc7cf3036bff398a4 (patch)
treedd7518078a82e91b14944d9136147e688e064992 /cmd/pvblock.c
parentc850674ff74b1625c17a77a454acec0e9cc6ec36 (diff)
xen: pvblock: Add initial support for para-virtualized block driver
Add initial infrastructure for Xen para-virtualized block device. This includes compile-time configuration and the skeleton for the future driver implementation. Add new class UCLASS_PVBLOCK which is going to be a parent for virtual block devices. Add new interface type IF_TYPE_PVBLOCK. Implement basic driver setup by reading XenStore configuration. Signed-off-by: Andrii Anisov <andrii_anisov@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Diffstat (limited to 'cmd/pvblock.c')
-rw-r--r--cmd/pvblock.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/pvblock.c b/cmd/pvblock.c
new file mode 100644
index 0000000000..4e99b06122
--- /dev/null
+++ b/cmd/pvblock.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2020 EPAM Systems Inc.
+ *
+ * XEN para-virtualized block device support
+ */
+
+#include <blk.h>
+#include <common.h>
+#include <command.h>
+
+/* Current I/O Device */
+static int pvblock_curr_device;
+
+int do_pvblock(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
+{
+ return blk_common_cmd(argc, argv, IF_TYPE_PVBLOCK,
+ &pvblock_curr_device);
+}
+
+U_BOOT_CMD(pvblock, 5, 1, do_pvblock,
+ "Xen para-virtualized block device",
+ "info - show available block devices\n"
+ "pvblock device [dev] - show or set current device\n"
+ "pvblock part [dev] - print partition table of one or all devices\n"
+ "pvblock read addr blk# cnt\n"
+ "pvblock write addr blk# cnt - read/write `cnt'"
+ " blocks starting at block `blk#'\n"
+ " to/from memory address `addr'");
+