From patchwork Thu Dec 17 11:27:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344925 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1077274jai; Thu, 17 Dec 2020 03:29:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/IgHD6bdKWDt7Lg4opejyIUlhQs+aUVs/aN2oRTbjhaTefA7t6o/ogWjlHLZiui7cxRiV X-Received: by 2002:a50:fc13:: with SMTP id i19mr39082512edr.281.1608204541586; Thu, 17 Dec 2020 03:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608204541; cv=none; d=google.com; s=arc-20160816; b=Wz5vFEGz2dApJr/AC7PMk2SPeuFcdFkpHJBT/yqbTXD+Z3gjkd1YxYaCvYwofKC1BH W2BIO9mk6dsdOI5kVErk2zGip5HOeP6Zd1973l9PJbK5ErFLTQwNgOhbAURYKzLNsmzE GT2FakGABxZo2pkoE9cdYz637UrrOC/xxqEA66Tp6B+jQ3H9fnDtHrwMv3X2+jLU2POr 6bTlIkooCN5rgRLbRItn/9/TdEZRWHsZwEmYCjW4Xma3+uaRERuCQmbj7P43AfJzcLVg bfOzhv/um5sq+3bxPHsZOEv6k906KPvoi5U3B+WFigAZjgA+e7Am6pXQ/PhQzD4l9UfX mnkg== 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=X6mkSqBusnHv9DBWWFyJJlU8zLlf8IWZhkhQeGUTN1o=; b=MOKU3G+hxIMra154zDpZdQTM4VQ56/VJGBnN/t539j6a/rAqUykWO84EhcBtXYu3OO Qq9goENg9KFyaEj3vivGVhqzruqjObMahpV+B6Y7qR7/Quiwl0rPVIy0Wo1xKtV+ctjE Rtd5w0SiOb6YrusZJkHnJm5Sh8GrIP/Bua9c/4W5AdwB+0RXdptUp9uxK/58jePedNU6 gyQQt0G2AJRm7/ClXcqMJONpWncBdAe5WMVvYTUxD15fm8s+f6MyN51TTVqsCUrFO/cz qYWIZTiluYSerq5ph0Vh1XCt+71a9l/pIl2+PxhSNkXvDThGcdETL3wJ8gExWMm2/9Iv J8Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NPeVMjKu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id i7si4256856eds.423.2020.12.17.03.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 03:29:01 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NPeVMjKu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 F22DA82BBF; Thu, 17 Dec 2020 12:28:21 +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="NPeVMjKu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 51D8A82BB2; Thu, 17 Dec 2020 12:28:11 +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 mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3AB4C82BA0 for ; Thu, 17 Dec 2020 12:28:06 +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 mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201217112755euoutp027fca454b989a5c9d4cbaeae9312b0736~RfXM_QdWA2523925239euoutp02e for ; Thu, 17 Dec 2020 11:27:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201217112755euoutp027fca454b989a5c9d4cbaeae9312b0736~RfXM_QdWA2523925239euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608204475; bh=X6mkSqBusnHv9DBWWFyJJlU8zLlf8IWZhkhQeGUTN1o=; h=From:To:Cc:Subject:Date:References:From; b=NPeVMjKuthYsQTX7EUgaqLPBe7MN6abdRY5bRai4LQh5pKSUAazwXik2Z4eA6TQQR LfTRhjc2Zex5C2tdeqMuwAe4B4dEgRVrwsA+qR7+NXRKvwCnpARQkuL3/mKvzwxqhB pLhp4+SFmuTcfEa0Sjhgfxpr06PKqsizmdPHSrPA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201217112745eucas1p14976da6d14c465c54e075fe97e7a92c5~RfXDih-zy1082810828eucas1p1s; Thu, 17 Dec 2020 11:27:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A4.2B.44805.1B04BDF5; Thu, 17 Dec 2020 11:27:45 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201217112745eucas1p17cb0b470512d1426efb9d6dce997612f~RfXDIKkNl1201512015eucas1p1y; Thu, 17 Dec 2020 11:27:45 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201217112745eusmtrp1c012eaf41098af8e1679f46918dc1461~RfXDHdXJ_0498804988eusmtrp1b; Thu, 17 Dec 2020 11:27:45 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-9d-5fdb40b11289 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BB.73.21957.1B04BDF5; Thu, 17 Dec 2020 11:27:45 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201217112744eusmtip259d13fb127001528b0b9a7f952a38190~RfXCtVJO03162131621eusmtip2O; Thu, 17 Dec 2020 11:27:44 +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 0/6] Add MBR partition table creation and verify command Date: Thu, 17 Dec 2020 12:27:33 +0100 Message-Id: <20201217112739.5045-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1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: 20201217112745eucas1p17cb0b470512d1426efb9d6dce997612f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201217112745eucas1p17cb0b470512d1426efb9d6dce997612f 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 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 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 | 308 ++++++++++++++++++++++++++++++++++++++ disk/part_dos.c | 207 +++++++++++++++++++++---- disk/part_dos.h | 5 + drivers/fastboot/fb_mmc.c | 2 +- include/part.h | 9 +- 7 files changed, 512 insertions(+), 28 deletions(-) create mode 100644 cmd/mbr.c -- 2.17.1