summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2019-10-15 18:24:40 +0530
committerTom Rini <trini@konsulko.com>2019-10-23 20:47:12 -0400
commita539c8bd7dffa144bdc4826d5858a515f626856f (patch)
tree801680501fda2dadefd15b0d1b24ed872b8f4cfe /cmd
parent991e8a5ab8a372dfdf872437cafc9c0b44bdc046 (diff)
downloadu-boot-a539c8bd7dffa144bdc4826d5858a515f626856f.tar.gz
u-boot-a539c8bd7dffa144bdc4826d5858a515f626856f.tar.bz2
u-boot-a539c8bd7dffa144bdc4826d5858a515f626856f.zip
cmd: Add Support for UFS commands
Add Support for commands to initialize and configure UFS devices. TODO: Add Support for commands to resize and reconfigure LUNs Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig7
-rw-r--r--cmd/Makefile2
-rw-r--r--cmd/ufs.c37
3 files changed, 45 insertions, 1 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 07060c63a7..82b5d300d2 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1205,6 +1205,13 @@ config CMD_TSI148
This provides various sub-commands to initialise and configure the
Turndra tsi148 device. See the command help for full details.
+config CMD_UFS
+ bool "Enable UFS - Universal Flash Subsystem commands"
+ depends on UFS
+ help
+ "This provides commands to initialise and configure universal flash
+ subsystem devices"
+
config CMD_UNIVERSE
bool "universe - Command to set up the Turndra Universe controller"
help
diff --git a/cmd/Makefile b/cmd/Makefile
index ac843b4b16..2d723ea0f0 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -144,7 +144,7 @@ obj-$(CONFIG_CMD_UNZIP) += unzip.o
obj-$(CONFIG_CMD_VIRTIO) += virtio.o
obj-$(CONFIG_CMD_WDT) += wdt.o
obj-$(CONFIG_CMD_LZMADEC) += lzmadec.o
-
+obj-$(CONFIG_CMD_UFS) += ufs.o
obj-$(CONFIG_CMD_USB) += usb.o disk.o
obj-$(CONFIG_CMD_FASTBOOT) += fastboot.o
obj-$(CONFIG_CMD_FS_UUID) += fs_uuid.o
diff --git a/cmd/ufs.c b/cmd/ufs.c
new file mode 100644
index 0000000000..5b25788656
--- /dev/null
+++ b/cmd/ufs.c
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0+
+/**
+ * ufs.c - UFS specific U-boot commands
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
+ *
+ */
+#include <common.h>
+#include <command.h>
+#include <ufs.h>
+
+static int do_ufs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ int dev, ret;
+
+ if (argc >= 2) {
+ if (!strcmp(argv[1], "init")) {
+ if (argc == 3) {
+ dev = simple_strtoul(argv[2], NULL, 10);
+ ret = ufs_probe_dev(dev);
+ if (ret)
+ return CMD_RET_FAILURE;
+ } else {
+ ufs_probe();
+ }
+
+ return CMD_RET_SUCCESS;
+ }
+ }
+
+ return CMD_RET_USAGE;
+}
+
+U_BOOT_CMD(ufs, 3, 1, do_ufs,
+ "UFS sub system",
+ "init [dev] - init UFS subsystem\n"
+);