From patchwork Fri Apr 2 00:15:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 1461464 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=G5/tWulD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FBLDL749mz9sVq for ; Fri, 2 Apr 2021 11:15:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 717C780C6F; Fri, 2 Apr 2021 02:15:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="G5/tWulD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5FE5280C70; Fri, 2 Apr 2021 02:15:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B097D80C66 for ; Fri, 2 Apr 2021 02:14:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@samsung.com Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210402001451epoutp047092df231561b4535d9892e5e4bda420~x4jydVxz90780007800epoutp04s for ; Fri, 2 Apr 2021 00:14:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210402001451epoutp047092df231561b4535d9892e5e4bda420~x4jydVxz90780007800epoutp04s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1617322491; bh=6TuPWR2i1R2X6EaFyyN+boqvCGgCsIMC/oCwB/OO5Kk=; h=From:To:Cc:Subject:Date:References:From; b=G5/tWulDml7U82dlqvJIHtuNS6r6gqi7WDV3S+UMgrnLtu2zvW/lh51SfP0lRoPQb jeaUCuxkCZl5Xw1d6WDIsHvaXXSbzg8j/R2ACbXvBgZTbrefPoRNamjmMRy2zub6ZV Go/SqZt+nmjQCBfpUBeWLJnlytAL+/MDHvDmtZoc= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20210402001450epcas1p14784f5a62b8476ca55c859f151b96ea2~x4jx_KVKR1931719317epcas1p1D; Fri, 2 Apr 2021 00:14:50 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.155]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4FBLCX2B39z4x9Q0; Fri, 2 Apr 2021 00:14:48 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 77.97.10347.6F166606; Fri, 2 Apr 2021 09:14:46 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20210402001445epcas1p34ff674ffdecc902c0f08e0378a855035~x4jtWqM3c2672826728epcas1p3y; Fri, 2 Apr 2021 00:14:45 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210402001445epsmtrp1f016170a858d496643d923057bed7671~x4jtWAWNd0533105331epsmtrp1K; Fri, 2 Apr 2021 00:14:45 +0000 (GMT) X-AuditID: b6c32a39-147ff7000002286b-74-606661f6a4f3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 62.4B.08745.5F166606; Fri, 2 Apr 2021 09:14:45 +0900 (KST) Received: from jaehoon-DeskTop.10.32.193.11 (unknown [10.113.113.235]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210402001445epsmtip282c8715f25a21eb5242098495488f650~x4jtJVGaf1955119551epsmtip2h; Fri, 2 Apr 2021 00:14:45 +0000 (GMT) From: Jaehoon Chung To: u-boot@lists.denx.de Cc: xypron.glpk@gmx.de, trini@konsulko.com, sjg@chromium.org, Jaehoon Chung Subject: [PATCH V2] doc: mmc man-page Date: Fri, 2 Apr 2021 09:15:32 +0900 Message-Id: <20210402001532.19555-1-jh80.chung@samsung.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEKsWRmVeSWpSXmKPExsWy7bCmvu63xLQEgwvPOS1u/Gpjtfi2ZRuj xd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GaNYbH DpgZCwQpWurzngmbNOtg36f1Tyef1Fr52m6q4qp37//d3b31g+lBByWW4oxEQy3mouJEAKs4 22EFBAAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrALMWRmVeSWpSXmKPExsWy7bCSvO7XxLQEg79flC1u/Gpjtfi2ZRuj xdRJm9kt3u7tZLc4PPUDowOrx+yGiyweHz7Gebw6sIrd4+ydHYwefVtWMQawRnHZpKTmZJal FunbJXBl3Nvxgr1gs3nFhWPfmRoYP6h2MXJwSAiYSOyb5dXFyMUhJLCDUWL15A6mLkZOoLiU xOenU9kgaoQlDh8uhqj5yShxacY7VpAaNgEdie3fjoPViwhISPzqv8oIUs8skCXxpjEYxBQW UJW43aIMYrIAmd1vRUGKeQWsJe7ubIRaJC/x534PM0RcUOLkzCcsIDYzULx562zmCYx8s5Ck ZiFJLWBkWsUomVpQnJueW2xYYJSXWq5XnJhbXJqXrpecn7uJERyIWlo7GPes+qB3iJGJg/EQ owQHs5II740tqQlCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeS90nYwXEkhPLEnNTk0tSC2CyTJx cEo1MHF+CY3ivO7bOl/D7tb+25aXuIo43v1ZpaKwe8dK9sCElMhTPxhF//ypSH0q2lqwbKaa myqjt+2PTa3/qtfLbll55mvFCuHtJ3WXTlz/VrR5qULg9cN3f/m67ObQ/PCry3DX589JDnxR 4gtSVvFLdRzrZdKce1Xh8/y33BFe0jfnvv/uxfnAa2FinY3Tx7LXOySZLcIMv38RmxP88siP eU42i4JMVG/2PxPgfsOpbBFsfE/8XNZ75Xs7dNasNbEKXabFGfVE5LS5GoOBRe7HWOGW4JS7 zOskX81OPrbwR+NhMTXDI+vkm+db5C9wVJ/xfiVD+qcTc1aK6DcXfGJcpXbBcK3dkyvuZ336 3/5ST1diKc5INNRiLipOBABWN5enswIAAA== X-CMS-MailID: 20210402001445epcas1p34ff674ffdecc902c0f08e0378a855035 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210402001445epcas1p34ff674ffdecc902c0f08e0378a855035 References: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Provide a man-pages for the mmc command. Signed-off-by: Jaehoon Chung --- Changelog on V2 - Add missing empty line - Add bootbus's arguments descriptions --- doc/usage/index.rst | 1 + doc/usage/mmc.rst | 212 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 doc/usage/mmc.rst diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 6c59bbadab45..15c682ceface 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -30,6 +30,7 @@ Shell commands load loady mbr + mmc pstore qfw sbi diff --git a/doc/usage/mmc.rst b/doc/usage/mmc.rst new file mode 100644 index 000000000000..57284ed6741e --- /dev/null +++ b/doc/usage/mmc.rst @@ -0,0 +1,212 @@ +.. SPDX-License-Identifier: GPL-2.0+: + +mmc command +============ + +Synopsis +-------- + +:: + + mmc info + mmc read addr blk# cnt + mmc write addr blk# cnt + mmc erase blk# cnt + mmc rescan + mmc part + mmc dev [dev] [part] + mmc list + mmc wp + mmc bootbus + mmc bootpart-resize + mmc partconf [boot_ack boot_partition partition_access] + mmc rst-function + +Description +----------- + +The mmc command is used to control MMC(eMMC/SD) device. + +The 'mmc info' command displays information (Manufacturer ID, OEM, Name, Bus Speed, Mode, ...) of MMC device. + +The 'mmc read' command reads raw data to memory address from MMC device with block offset and count. + +The 'mmc write' command writes raw data to MMC device from memory address with block offset and count. + + addr + memory address + blk# + start block offset + cnt + block count + +The 'mmc erase' command erases MMC device from block offset until count. + + blk# + start block offset + cnt + block count + +The 'mmc rescan' command scans the available MMC device. + +The 'mmc part' command displays the list available partition on current mmc device. + +The 'mmc dev' command shows or set current mmc device. + + dev + device number to change + part + partition number to change + +The 'mmc list' command displays the list available devices. + +The 'mmc wp' command enables "power on write protect" function for boot partitions. + +The 'mmc bootbus' command sets the BOOT_BUS_WIDTH field. (*Refer to eMMC specification*) + + boot_bus_width + 0x0 + x1 (sdr) or x4(ddr) buswidth in boot operation mode (default) + 0x1 + x4 (sdr/ddr) buswidth in boot operation mode + 0x2 + x8 (sdr/ddr) buswidth in boot operation mode + 0x3 + Reserved + + reset_boot_bus_width + 0x0 + Reset buswidth to x1, Single data reate and backward compatible timing after boot operation (default) + 0x1 + Retain BOOT_BUS_WIDTH and BOOT_MODE value after boot operation. This is relevant to Push-pull mode operation only + + boot_mode + 0x0 + Use single data rate + backward compatible timing in boot operation (default) + 0x1 + Use single data rate + High Speed timing in boot operation mode + 0x2 + Use dual data rate in boot operation + 0x3 + Reserved + +The 'mmc partconf' command shows or changes PARTITION_CONFIG field. + + boot_ack + boot acknowledge value + boot_partition + boot partition to enable for boot + 0x0 + Device not boot enabled(default) + 0x1 + Boot partition1 enabled for boot + 0x2 + Boot partition2 enabled for boot + 0x7 + User area enabled for boot + others + Reserved + partition_access + partitions to access + +The 'mmc bootpart-resize' command changes sizes of boot and RPMB partitions. + dev + device number + boot part size MB + target size of boot partition + RPMB part size MB + target size of RPMB partition + +The 'mmc rst-function' command changes the RST_n_FUNCTION field. +**WARNING** : This is a write-once field. (*Refer to eMMC specification*) + + value + 0x0 + RST_n signal is temporarily disabled (default) + 0x1 + RST_n signal is permanently enabled + 0x2 + RST_n signal is permanently disabled + 0x3 + Reserved + + +Examples +-------- + +The 'mmc info' command displays device's capabilities: +:: + + => mmc info + Device: EXYNOS DWMMC + Manufacturer ID: 45 + OEM: 100 + Name: SDW16 + Bus Speed: 52000000 + Mode: MMC DDR52 (52MHz) + Rd Block Len: 512 + MMC version 5.0 + High Capacity: Yes + Capacity: 14.7 GiB + Bus Width: 8-bit DDR + Erase Group Size: 512 KiB + HC WP Group Size: 8 MiB + User Capacity: 14.7 GiB WRREL + Boot Capacity: 4 MiB ENH + RPMB Capacity: 4 MiB ENH + Boot area 0 is not write protected + Boot area 1 is not write protected + +The raw data can be read/written via 'mmc read/write' command: +:: + + => mmc read 0x40000000 0x5000 0x100 + MMC read: dev # 0, block # 20480, count 256 ... 256 blocks read: OK + + => mmc write 0x40000000 0x5000 0x10 + MMC write: dev # 0, block # 20480, count 256 ... 256 blocks written: OK + +The partition list can be shown via 'mmc part' command: +:: + + => mmc part + Partition Map for MMC device 0 -- Partition Type: DOS + + Part Start Sector Num Sectors UUID Type + 1 8192 131072 dff8751a-01 0e Boot + 2 139264 6291456 dff8751a-02 83 + 3 6430720 1048576 dff8751a-03 83 + 4 7479296 23298048 dff8751a-04 05 Extd + 5 7481344 307200 dff8751a-05 83 + 6 7790592 65536 dff8751a-06 83 + 7 7858176 16384 dff8751a-07 83 + 8 7876608 22900736 dff8751a-08 83 + +The current device can be shown or set via 'mmc dev' command: +:: + + => mmc dev + switch to partitions #0, OK + mmc0(part0) is current device + => mmc dev 2 0 + switch to partitions #0, OK + mmc2 is current device + +The list of available devices can be shown via 'mmc list' command: +:: + + => mmc list + mmc list + EXYNOS DWMMC: 0 (eMMC) + EXYNOS DWMMC: 2 (SD) + +Configuration +------------- + +The mmc command is only available if CONFIG_CMD_MMC=y. +Some commands need to enable more configuration. + +write, erase + CONFIG_MMC_WRITE +bootbus, bootpart-resize, partconf, rst-function + CONFIG_SUPPORT_EMMC_BOOT=y