From patchwork Wed Dec 23 12:55:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 351451 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp6172732jai; Wed, 23 Dec 2020 04:56:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIQQor6jh4m4vhkLXykRqNQWYZ6qmu5Cncpe77E47PaPJ2NXQuD1Lhe4I9CrrbcMFgYSV5 X-Received: by 2002:a05:6402:13d1:: with SMTP id a17mr24397873edx.202.1608728208502; Wed, 23 Dec 2020 04:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608728208; cv=none; d=google.com; s=arc-20160816; b=PoZu/xzuxIlgLhUS2qp8yHUaHaPKhK9Mb2t+UWkWffCOWNBPNkLJ6DMJflAWLEpq/u M4m3a9j1d6RpSMey7RFy9iwujpcaDJvuJyRar/3O7LnYIfNYo/H3q8VkUJpLCclfZ3Ho YxqvlGf7OkUpVpjeRDK4sJ6ac9IJhLbwT51QP9HhcUEGcsuvHnFKoXaIznqegF3IlGZq BX9shkqOv/7yC6Rqz+iK9LxYXO3vwY5RnVqSviEqOcQ1EC7FQicCfslaEusumFkvm+18 T+W11i3n7P+TNdg7Us7/suzQe4O9NbtE2uxr0CZHi4Povx8jAhy2iANGugw7zlUxMb4v BF1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=FnyZFr9L844xlxfdo/z8KG4ZzL6l1WYYmd1xG+k2lIg=; b=r7XzonbWYoy182qo4eFF0eiwFLK9Bpe+d2C0LgWfrwxrflyCTQE5/ZyCPf3LGLxN60 OUKcw5jgraNSL92AIARl5yWpSwtJcQwpYBuc8grCi91JjlyITMTsGfe+CB9lkedXvqd+ eLXsXzf74Rrf3lvYt8YL/m/KXtiHbBVdqpTfEfaGR7dkQGpHcjigvYSphmEm6c4O+i/r LodN0w++ZMvIXZlPHYTyR5qtI9pfDc+myy4I9ZoyCri1z2oGOBFlxP9cf+758JeoKehI dVWs/dXSdp8x5eViqbnsQxcroata97sNrQKMe52u6UQqN72mlc4hoKs87qaRjor3lP8T +Ibg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=pCmIN0IN; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id b26si11987928ejz.630.2020.12.23.04.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 04:56:48 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=pCmIN0IN; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46CCD827BD; Wed, 23 Dec 2020 13:55:58 +0100 (CET) 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="pCmIN0IN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C691F8273C; Wed, 23 Dec 2020 13:55:44 +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=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3DA0A826D4 for ; Wed, 23 Dec 2020 13:55:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201223125534euoutp01edf701afc95d2ada1509cee49b198ee2~TWbbw0hna0125401254euoutp01v for ; Wed, 23 Dec 2020 12:55:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201223125534euoutp01edf701afc95d2ada1509cee49b198ee2~TWbbw0hna0125401254euoutp01v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608728134; bh=FnyZFr9L844xlxfdo/z8KG4ZzL6l1WYYmd1xG+k2lIg=; h=From:To:Cc:Subject:Date:References:From; b=pCmIN0INnAe94fKCjX95Q+JlhZR2xlfq8Ctexv2cR9X2KuhwqQNtY0pHXGF3ASqMo ph6Nt+zklOb0DvA7VJ7QjtmCd9Bam3iWp5Jg1tkq8aZCv3Hei7vRw9ypATzahmmroo N8m4+7V2HR9U6tiHHWBv7NrTA++IyzzvwNpMZd8I= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201223125533eucas1p1645b52f103ab8e44143a474a000fedd9~TWbbfpUV71934119341eucas1p18; Wed, 23 Dec 2020 12:55:33 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A5.D4.44805.54E33EF5; Wed, 23 Dec 2020 12:55:33 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201223125533eucas1p26a3a9fdce43c0902e8ee3c033cb510b0~TWbbD_lQK0881908819eucas1p2B; Wed, 23 Dec 2020 12:55:33 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201223125533eusmtrp28d15a6f35f335c31a53da703c2f009b0~TWbbCk2JF0404504045eusmtrp2n; Wed, 23 Dec 2020 12:55:33 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-06-5fe33e45da04 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 87.BC.21957.54E33EF5; Wed, 23 Dec 2020 12:55:33 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201223125532eusmtip2a0ffcc9d35d19136c8df831c93dfdb15~TWbapMWTp2735227352eusmtip2v; Wed, 23 Dec 2020 12:55:32 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de Cc: Marek Szyprowski , Lukasz Majewski , Simon Glass , Heinrich Schuchardt , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 0/6] Add MBR partition table creation and verify command Date: Wed, 23 Dec 2020 13:55:09 +0100 Message-Id: <20201223125515.28865-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA0VSeUhTcRzn997b3nO0ek3Lb3cZCmptGQavNCnsGAzssIso18rXXOk2t7QD Ka2Qtg4ru1ylhh0yM1PnXZqrtCiXzg4jC0VFnGmJFrpCcz2t/z4nn+8PfhQuaiOmUyr1AVan VkR78QVEcc2QbeHqkDb5IsOlhUz+tTwe0+RM5jGdvY0Yk/vsM8n8tBQjpuexgWSeXv6OVpDS 64kNhDTd9IKQfu+LkNY1lyLpOYsZredtFwRHstGqeFYnCdkliLLe6OZrb084lFfTgSWiu25G 5EYBHQj2X9WkEQkoEZ2NwPC6C+fIAIK0kpEx0o+goqiOHK90tb/hc8Y9BNmtSeS/irO9kHCl +HQAGHuMfBf2oAGcKe+QK4TTwwiqnX08l+FOy8CS93jUoCiC9oabgztcspBeDmdsjRi3Ngdy Hj75ewbQSRR8LR83VkFa90vEYXdw1FrGzpsJI2UZGFc4gaDVlkty5AyCxuPXxhpB0Gxz8l3L OO0LeeUSTl4JVxyFmEsGeiI09Ux2yfgovFh8FedkIZxKFnFpHzDVPvg3W11vxzkshbPWt3+f KKJ3QtkbA+88mm36v5WJkBl5snH6GCWrX6xmD4r1ihh9nFop3qOJKUCj/+DVcO1AKbrn6BNb EUYhKwIK9/IQ2ie1yUXCSMXhI6xOI9fFRbN6K5pBEV6ewt2W+3IRrVQcYPezrJbVjbsY5TY9 EVM5tl5AqlPa5BLGMe3O0QpxyrzYqcvWDHV7wn7vTu1J/7ua4CZfwQS6KFXtKUvwbcmqNw8E F6fk+wzm51afXvnctCRqXVkA8x60sduGK8Jmxd1Pn2TcF/Q7o9KRoGkVsT++VAp67+BKs50M kpXcSmtfEbFp89nCUC22N6vGvEFeF26H+ZkNRYHxmi8DnTmpG6VYvE3WEfahZdEc78BlmbKk mpP+80pt8G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WzRjZgsSAH3nX2r9wv9NX YinOSDTUYi4qTgQAZbDhjMoCAAA= X-CMS-MailID: 20201223125533eucas1p26a3a9fdce43c0902e8ee3c033cb510b0 X-Msg-Generator: CA X-RootMTR: 20201223125533eucas1p26a3a9fdce43c0902e8ee3c033cb510b0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201223125533eucas1p26a3a9fdce43c0902e8ee3c033cb510b0 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.3 at phobos.denx.de X-Virus-Status: Clean Hi All, This patchset adds 'mbr' command to let one to create or verify MBR (Master Boot Record) partition layout based on the provided text description. This can be used in scripts to help system flashing tools/scripts to ensure proper partition layout. It has been inspired by the 'gpt' command already present in u-boot. Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v3: - fixed minor issues in the docs v2: https://lists.denx.de/pipermail/u-boot/2020-December/435689.html - added docs and minor fixes in the code style v1: https://lists.denx.de/pipermail/u-boot/2020-December/435208.html - initial version Patch summary: Marek Szyprowski (6): disk: dos: rename write_mbr_partition to write_mbr_sector disk: dos: add some defines for the hardcoded numbers disk: dos: use generic macro for unaligned le32 access disk: dos: make some functions static disk: dos: add code for creating MBR partition layout cmd: Add MBR partition layout control utility cmd/Kconfig | 8 + cmd/Makefile | 1 + cmd/mbr.c | 314 ++++++++++++++++++++++++++++++++++++++ disk/part_dos.c | 207 ++++++++++++++++++++++--- disk/part_dos.h | 5 + doc/usage/index.rst | 1 + doc/usage/mbr.rst | 93 +++++++++++ drivers/fastboot/fb_mmc.c | 2 +- include/part.h | 9 +- 9 files changed, 612 insertions(+), 28 deletions(-) create mode 100644 cmd/mbr.c create mode 100644 doc/usage/mbr.rst -- 2.17.1