From patchwork Fri Feb 5 14:39:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1436691 X-Patchwork-Delegate: lukma@denx.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=secospa.onmicrosoft.com header.i=@secospa.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-secospa-onmicrosoft-com header.b=qyGtuLtm; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DXJ5M4XP1z9sRR for ; Sat, 6 Feb 2021 01:41:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E43B782ADE; Fri, 5 Feb 2021 15:40:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=seco.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=secospa.onmicrosoft.com header.i=@secospa.onmicrosoft.com header.b="qyGtuLtm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05F9882A97; Fri, 5 Feb 2021 15:39:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0608.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::608]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 544DA82A8B for ; Fri, 5 Feb 2021 15:39:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sean.anderson@seco.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C5kWJb52s7jRzhMTsergTGwdxPROTWGkjYvTyb1q9QeIxZWgA5vkPoItN/WkCuFFxtTFvGuYbyeopJQ/bAY8/kfPO1dkZhAct4RYVosWKIs6zQD6nNScmupSBHRbkrulfRYcqK1zkzEvgTqluryuIJcd+u8ECVaQ4sAdS+GpI+BweFaG+pzxy+BQ2J9ndL4flxPuqq4D7B+7XjB+n0tEN6ivjQKNwHeEE6e5TpCd8+EeAArMr452wNa51QsVN74b/UB3O990++0tUnyKQpWQ1m5qF3Jd/r3gjmaxiELAFelg79AxKhw7hxgMgQeJZjkFOHWs+XMzv1e+8odnC9b1aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AUIxSVKnzz8GAHwGgoI9eyL9oZdvMQA1tPQkaoxuBSM=; b=B81HBeiKiLPKFeVnnwI/Hs8zf4xfLUtMsZfP8sj/momRjeM5x77EGLkc0oD2LDFfEbSiFYJnQMpNLrqTdNulP1df1tdVBWBjMsLFGdUkuomC5qB0uAyJRJ69qAQvY+fTduHw5Y3Vh45gYqb3TNJnXEJ4Yo9IA+BcjxQ6LVjxt+NF9GqAgfpu7lIItZcoATDIK7HNyJJ8yTwhszxJ1ZxP2PdfYT6HNVEJ4hEvavp85Dbi4BAxQOykrUU0H6ZxeJHSqENezb5G+k0as4KMJj7qQhYb4jX9+vTyBb5b3nyfQzTF0g90irNAGa288ESutCqbx/fePZElwFAQQRI7Dl4OOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AUIxSVKnzz8GAHwGgoI9eyL9oZdvMQA1tPQkaoxuBSM=; b=qyGtuLtm+akxw46ctKC33T4Jr4oqPjnlV/e/+oIFaYqKElgtw9qBQYDTwj8ZvXWyK5lbih4Lf9QeJmMnijaWjNRc1S69tc5MtpeHZWtj/MJHZJpjfD4kBDBPHr36crMBEL59lxJ+yw87K0baS+DJwyZcR2qej7EJl9F6AZzZ4po= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=seco.com; Received: from AM9PR03MB7251.eurprd03.prod.outlook.com (2603:10a6:20b:26e::16) by AM4PR0302MB2787.eurprd03.prod.outlook.com (2603:10a6:200:8e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.23; Fri, 5 Feb 2021 14:39:31 +0000 Received: from AM9PR03MB7251.eurprd03.prod.outlook.com ([fe80::a8f2:7dd:46e5:8526]) by AM9PR03MB7251.eurprd03.prod.outlook.com ([fe80::a8f2:7dd:46e5:8526%6]) with mapi id 15.20.3825.019; Fri, 5 Feb 2021 14:39:31 +0000 From: Sean Anderson To: u-boot@lists.denx.de Cc: Simon Glass , Lukasz Majewski , Sean Anderson , Filip Brozovic , Heinrich Schuchardt , Marek Szyprowski , =?utf-8?q?Pali_Roh=C3=A1r?= , Patrick Delaunay Subject: [PATCH v5 10/10] doc: Document partition specifications Date: Fri, 5 Feb 2021 09:39:02 -0500 Message-Id: <20210205143902.1819189-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210205143902.1819189-1-sean.anderson@seco.com> References: <20210205143902.1819189-1-sean.anderson@seco.com> X-Originating-IP: [50.195.82.171] X-ClientProxiedBy: BL1PR13CA0001.namprd13.prod.outlook.com (2603:10b6:208:256::6) To AM9PR03MB7251.eurprd03.prod.outlook.com (2603:10a6:20b:26e::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BL1PR13CA0001.namprd13.prod.outlook.com (2603:10b6:208:256::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.15 via Frontend Transport; Fri, 5 Feb 2021 14:39:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1caa887-2d0a-4bc3-4b5a-08d8c9e3d8fd X-MS-TrafficTypeDiagnostic: AM4PR0302MB2787: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3ra9pheJQzpbzGMsNkcQSFdtwE0k0Tb5H21h529u5HndJ/D5KNjlc1Jd5xRj3H4uYewYLz/PSG6erGXpiy0GapM7qLiWYSiZ6zeyA0SkHBpcjiHHQvMtHn/h5YJK8iMS89XD4aUg3n73g6ww1JA9m3LjrLqeLnGytmh/EJsuKak+REwZdicQPAZg5xdH1pcca+iBkXh14xt15PmY4YXv1U30CI8ktgix3zQeOzw3SQh0OYnJhkzVaFcJ6DlbhbQ3rwsR7NU84dM7d9pCNa3z/bfbFUQqfnK6BD66LP7xwUkVid8ZiZPaYqKTMBFZ1vAbKNmRDJNdP659sC7Ne1isEZxRC5LKP2VmA2Jv8upENOvM/KrBDirwAwOHrIprKz4BINLaDH+xrJY61zk7r7L5rX6+YCI3fIeRbBeXu72XauS8WISIWuGK0Ws/1bmTxjLnBqZ9+Ja1d2OXGumFs8zFiEfBVAK9H+PujVNNOM5HhZz1r6WAI42poQEO9z9xZuV5TxfjEYrLCJBJEtMpixlKCw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR03MB7251.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39840400004)(136003)(346002)(376002)(366004)(956004)(6666004)(16526019)(6512007)(1076003)(478600001)(316002)(6506007)(26005)(54906003)(66946007)(52116002)(5660300002)(66476007)(86362001)(8936002)(2906002)(186003)(36756003)(8676002)(6486002)(83380400001)(6916009)(2616005)(4326008)(66556008)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: j5EQN5GNdDql4R7VoROEg9XDHpLBx4aln+ZGdch98Yh4fk8FwanbBwd4XQG99FEMB8nIbZVMBbZ6HM4GKCYSqZOr6xJmJ/rlMBRQbnD8GmVyM7Ae2gRZ5K7lDdKX+KyFROQj3Ua99ghnrWFA3b5NBzNMeL80cbL/ewNTL3N6NlHHhyf1dRqO3l3q+lNq1gmzhfZoy7v4KWe/fDF3ijm2xNUq83lBU1Eb8gY7DUWxmr0K/AZ9lFnkU02hJs/wXGv2ZJk19vTXn+7iAPSTpGOxWZwhfcEIQoQZoEC13HNoDGc6AXP9lXsI5YlEZL4+wA1EHvlw5c1m4CXGT7Gb6sjYnzwbNcpSif402YfmUJ9jED1cL6Y98RHpux8Tw/lW21UH9fHe3+jit2tbZ1gcdU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com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2021 14:39:30.9905 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VWP7ef1aiG7UxrlKUGmGYBFvmvFaCiz28/Ki+GzpHB0z4wp0cOrQRfF5mUKelwPtFAjCD9/R6KzuJiSXqMPF5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0302MB2787 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.3 at phobos.denx.de X-Virus-Status: Clean This documents the way U-Boot understands partitions specifications. This also updates the fastboot documentation for the changes in the previous commit. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- Changes in v5: - Fix incorrect heading name Changes in v4: - Expand documentation, making it more man-page-like Changes in v2: - Move partition documentation under doc/usage doc/android/fastboot.rst | 4 ++ doc/usage/index.rst | 1 + doc/usage/partitions.rst | 80 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 doc/usage/partitions.rst diff --git a/doc/android/fastboot.rst b/doc/android/fastboot.rst index 16b11399b3..ce513a2a0f 100644 --- a/doc/android/fastboot.rst +++ b/doc/android/fastboot.rst @@ -154,6 +154,10 @@ The device index starts from ``a`` and refers to the interface (e.g. USB controller, SD/MMC controller) or disk index. The partition index starts from ``1`` and describes the partition number on the particular device. +Alternatively, partition types may be specified using :ref:`U-Boot's partition +syntax `. This allows specifying partitions like ``0.1``, +``0#boot``, or ``:3``. The interface is always ``mmc``. + Writing Partition Table ----------------------- diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 83cfbafd90..d45467caf2 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -6,6 +6,7 @@ Use U-Boot fdt_overlays netconsole + partitions Shell commands -------------- diff --git a/doc/usage/partitions.rst b/doc/usage/partitions.rst new file mode 100644 index 0000000000..2c1a12b6bf --- /dev/null +++ b/doc/usage/partitions.rst @@ -0,0 +1,80 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. _partitions: + +Partitions +========== + +Synopsis +-------- + +:: + + [devnum][.hwpartnum][:partnum|#partname] + +Description +----------- + +Many U-Boot commands allow specifying partitions (or whole disks) using a +generic syntax. + +interface + The interface used to access the partition's device, like ``mmc`` or + ``scsi``. For a full list of supported interfaces, consult the + ``if_typename_str`` array in ``drivers/block/blk-uclass.c`` + +devnum + The device number. This defaults to 0. + +hwpartnum + The hardware partition number. All devices have at least one hardware + partition. On most devices, hardware partition 0 specifies the whole + device. On eMMC devices, hardware partition 0 is the user partition, + hardware partitions 1 and 2 are the boot partitions, hardware partition + 3 is the RPMB partition, and further partitions are general-purpose + user-created partitions. The default hardware partition number is 0. + +partnum + The partition number, starting from 1. The partition number 0 specifies + that the whole device is to be used as one "partition." + +partname + The partition name. This is the partition label for GPT partitions. For + MBR partitions, the following syntax is used:: + + + + devtype + A device type like ``mmcsd`` or ``hd``. See the + ``part_set_generic_name`` function in ``disk/part.c`` for a + complete list. + + devletter + The device number as an offset from ``a``. For example, device + number 2 would have a device letter of ``c``. + + partnum + The partition number. This is the same as above. + +If neither ``partname`` nor ``partnum`` is specified and there is a partition +table, then partition 1 is used. If there is no partition table, then the whole +device is used as one "partition." If none of ``devnum``, ``hwpartnum``, +``partnum``, or ``partname`` is specified, or only ``-`` is specified, then +``devnum`` defaults to the value of the ``bootdevice`` environmental variable. + +Examples +-------- + +List the root directory contents on MMC device 2, hardware partition 1, +and partition number 3:: + + ls mmc 2.1:3 / + +Load ``/kernel.itb`` to address ``0x80000000`` from SCSI device 0, hardware partition +0, and the partition labeled ``boot``:: + + load scsi #boot 0x80000000 /kernel.itb + +Print the partition UUID of the SATA device ``$bootdevice``, hardware partition +0, and partition number 0:: + + part uuid sata -