From patchwork Tue Dec 22 14:09:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 346642 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5359092jai; Tue, 22 Dec 2020 06:11:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxABsMLKPGUt+TA2eX9R9OBtIAxx454XSFxHq3JCPb9AYdXgSbZEm4Asr69uogmypms6mDL X-Received: by 2002:a50:8004:: with SMTP id 4mr20349471eda.329.1608646279787; Tue, 22 Dec 2020 06:11:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608646279; cv=none; d=google.com; s=arc-20160816; b=C9lnDMGYSEafHopMXsHsP1bsF/te7uvn5XCqSSKv/KAdI3PW8tgGPdy8IDLWHXdVTz F1hzDWOkT8vFzBrJBFOQIyL43OmPg96uxkusn2CHRdNM7U2nLLG7iqPURR6+6U7Hj5cz eRqVdvx7W7cCH+4YpXv8V31RQw06ADteoUksKvvefA78qAGLIzNSeCMI32S9z4li0LIu cNMLR8ZinWNqcn79HhD5Zr/QXCfGWI8Z6r+OKoQJKHNf82tUjEkUSvmn3MnHdl07kV25 vPHNOfo2dyHzoi5mkbXn67HKO0ivrkWLbvXkFmxCFW8pmWIr6g5nnSsWZCe/6rwlq/9A wIYQ== 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=lUiZjsjvGxoYPqA+cQopRUzprLYKitBpb5Y/f+v16fc=; b=s+3M1W4w5GCQgqizjuzuAvXuVIyT9pt9U5lQYTmIp98uHhci13eKk4qFLgKgBTMPpi gQn8PyQFQ99xqMqVtMm3Z48fe/12Ho0qHeccBEIjQfObOP+KFzvHPRJQlGD4mChgNleZ e+/wifh5pVPzWrVevJwvz9TbhLAtPPoNMffQtwDBnWAXNiQtKMDc7uyu3/BA90liV2hQ LbAn1H5QIBvreWDQbaasaBRicnHJ/wndhQsSdy/KR++ey9LnuKWedXKJp+0k7ZqdoAiR 0rc40TvX2jCD3KxCPT7yuRDzhIbU62kBuh4l5HvWFph9D1LxeBxayQ1MhNkDWDtkTYAV /5sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=nOx9EM6+; 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 h18si11012664ejg.486.2020.12.22.06.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 06:11:19 -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=nOx9EM6+; 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 AB04C82AE4; Tue, 22 Dec 2020 15:10: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=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="nOx9EM6+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E043682AD4; Tue, 22 Dec 2020 15:10:03 +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 5C7D882AC8 for ; Tue, 22 Dec 2020 15:09:50 +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 eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201222140948euoutp021715059e9f3435235f0b85e00a8afddb~TDy96pNE61769117691euoutp02W for ; Tue, 22 Dec 2020 14:09:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201222140948euoutp021715059e9f3435235f0b85e00a8afddb~TDy96pNE61769117691euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608646188; bh=lUiZjsjvGxoYPqA+cQopRUzprLYKitBpb5Y/f+v16fc=; h=From:To:Cc:Subject:Date:References:From; b=nOx9EM6+ueuIF5OqVNZQwRrvqdKjxAofX+9ud1mh3s6hNr1PNatLHQeRm23BGj+lK HCrhIY8+0Nm8Iztczfm16pAypbF7KSt2mzfCQhZiBYFC/Ma8ZIBD4dPUfrp/HWvKpB GyQlj4/WYDFFJuzi983ne7wRY/OEljtLFWkHlx/k= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201222140948eucas1p2eb8993fc647aff0547d53d958fa66eee~TDy9haGO-3190731907eucas1p24; Tue, 22 Dec 2020 14:09:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B8.8D.45488.B2EF1EF5; Tue, 22 Dec 2020 14:09:48 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201222140947eucas1p2283093cc1a06e5d0d9ba5c24b883f0fa~TDy9Jlv5f1214412144eucas1p2e; Tue, 22 Dec 2020 14:09:47 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201222140947eusmtrp16ff081999ee3967506be22d09dca17b4~TDy9I4NXC0827608276eusmtrp1d; Tue, 22 Dec 2020 14:09:47 +0000 (GMT) X-AuditID: cbfec7f5-c77ff7000000b1b0-f0-5fe1fe2bc54f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7D.5A.21957.B2EF1EF5; Tue, 22 Dec 2020 14:09:47 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201222140947eusmtip19d8ef8e06cc4ecb5f3a41470fe0932aa~TDy8vhIGA0857608576eusmtip1E; Tue, 22 Dec 2020 14:09:47 +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 v2 0/6] Add MBR partition table creation and verify command Date: Tue, 22 Dec 2020 15:09:08 +0100 Message-Id: <20201222140914.9933-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.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: CA X-RootMTR: 20201222140947eucas1p2283093cc1a06e5d0d9ba5c24b883f0fa X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201222140947eucas1p2283093cc1a06e5d0d9ba5c24b883f0fa 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 Changelog: v2: - 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