From patchwork Tue Oct 15 12:54:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 1177008 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="BnF6uTFE"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46swST38fKz9sPJ for ; Tue, 15 Oct 2019 23:57:29 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 0C868C21EBB; Tue, 15 Oct 2019 12:55:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 04EB5C21E70; Tue, 15 Oct 2019 12:55:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E47BEC21E4F; Tue, 15 Oct 2019 12:54:19 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lists.denx.de (Postfix) with ESMTPS id 409ADC21E52 for ; Tue, 15 Oct 2019 12:54:16 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9FCsCSo086423; Tue, 15 Oct 2019 07:54:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571144052; bh=wavCzmS0Uf11+Pj1uQWtk9ufb7b8WS45Fi+4zWrSl6A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BnF6uTFEyU7T3DmEhWxadI1t6n0xjYOS2prw5qHCuawa65x/BhZMgq/9bcKkCersN d8UEpiEdQwlyh8qustEtEHsVHI+tyWfinVsMpgBqfN2wA/eUr4xzh5Kw6RLLvfXIwW /ORBI0e3Jf3az4ifJs78FB+0FG1DgDEBfOss7h0s= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9FCsCjV077746; Tue, 15 Oct 2019 07:54:12 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 15 Oct 2019 07:54:11 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 15 Oct 2019 07:54:11 -0500 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9FCrkKu051438; Tue, 15 Oct 2019 07:54:09 -0500 From: Faiz Abbas To: Date: Tue, 15 Oct 2019 18:24:40 +0530 Message-ID: <20191015125442.1786-10-faiz_abbas@ti.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20191015125442.1786-1-faiz_abbas@ti.com> References: <20191015125442.1786-1-faiz_abbas@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: albert.u.boot@aribaud.net, trini@konsulko.com Subject: [U-Boot] [PATCH v2 09/11] cmd: Add Support for UFS commands X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- cmd/Kconfig | 7 +++++++ cmd/Makefile | 2 +- cmd/ufs.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 cmd/ufs.c 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 +#include +#include + +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" +);