[U-Boot] [PATCH 09/10] cmd: Add Support for UFS commands

Faiz Abbas faiz_abbas at ti.com
Mon Sep 9 08:19:58 UTC 2019


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 at ti.com>
---
 cmd/Kconfig  |  7 +++++++
 cmd/Makefile |  2 +-
 cmd/ufs.c    | 28 ++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 cmd/ufs.c

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 0badcb3fe0..e0c78c6b52 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1070,6 +1070,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 commands"
+
 config CMD_UNIVERSE
 	bool "universe - Command to set up the Turndra Universe controller"
 	help
diff --git a/cmd/Makefile b/cmd/Makefile
index f982564ab9..dc7869a35a 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -143,7 +143,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..7e5bbf97d9
--- /dev/null
+++ b/cmd/ufs.c
@@ -0,0 +1,28 @@
+// 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[])
+{
+	if (argc >= 2) {
+		if (!strcmp(argv[1], "init")) {
+			ufs_probe();
+
+			return CMD_RET_SUCCESS;
+		}
+	}
+
+	return CMD_RET_USAGE;
+}
+
+U_BOOT_CMD(ufs, 2, 1, do_ufs,
+	   "UFS  sub system",
+	   "init - init UFS subsystem\n"
+);
-- 
2.19.2



More information about the U-Boot mailing list