From patchwork Thu Dec 17 12:10:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344928 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1109520jai; Thu, 17 Dec 2020 04:11:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTWz9RVToLUjFuFXpooGWIys4ci1ZiVUrfOeR1ucapKTwwzC6Rg2PKCoGEArjikm7Dsttr X-Received: by 2002:a50:d5d5:: with SMTP id g21mr39449409edj.41.1608207082074; Thu, 17 Dec 2020 04:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608207082; cv=none; d=google.com; s=arc-20160816; b=vFOOdc2nC7sYNBN0hvUayvKAdx0atToHzI4G4VYvsv+QurjhUrQp5nx8Va4iP0wS7X pL5M1Idd++VTSwn70q50qQJiw/edxcDXd5qhiVPXxfkzt2KuIMW/UcsxsaN9ZbDXYnM+ nf5x3HSQGQiCnknt/EGv11gxLVS5IXGKnBVMDtYKdBzr/hiinNMy9gybFDztvb3odCVR 4yGuB3cSHDV8m0QQcDBL6+/WWEtYStiyvrohxaebpbuJvgXOAruNeuc30Z4F87hrPVix 2ne2qITaCPEIqiyBuWYPPKCxp5HIPhMumCkv8PLfa93hhyUIGDqpV9qxzQCrLwMM7xQX urVA== 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:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=086M726nyAb2MrF5+TGEfb2tViW2CvpY0SX5xYjAzk8=; b=xMId6SLhmVhmo/wBB3gTlbGM+mCWwpSkfEM/I9Q0klJ9TWkY2omYqmAeGfQEcZh/Bq xFLpsqYa4ZWoHB/0Hv1ZuLitOL3btMM5xGhLKjCWfqL6zEWMKj4Mfep366/Op2JxBzqb s0i1pmfcD8DBRE5y+n5P8usbJNpjtNF+SMxXh20JLQAIKNhqC3lx4BA9VwViVJjLBQMo Xxxk4NLSHMNZWxI9K4BSrISxBFlCsJuyXWs/6pfVnRjOhWbkv3AaPu+YgmKGneXpvwit WOwtqLqoqI/YsNUMM6D5oHF+HGinG3nryP6dtQN9YTt+6QHmq5nftLEHEFg0Z2hRgcRP pbRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=RwydQCd6; 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 gw24si2346367ejb.715.2020.12.17.04.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 04:11:22 -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=RwydQCd6; 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 7FA6D82BC7; Thu, 17 Dec 2020 13:11:02 +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="RwydQCd6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD85B82BAE; Thu, 17 Dec 2020 13:10:56 +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 56E9C82BA0 for ; Thu, 17 Dec 2020 13:10:53 +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 20201217121042euoutp02cf1460a6fd5804a9519a1d19ffd5971a~Rf8jbpKsw2038020380euoutp02L for ; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201217121042euoutp02cf1460a6fd5804a9519a1d19ffd5971a~Rf8jbpKsw2038020380euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608207042; bh=086M726nyAb2MrF5+TGEfb2tViW2CvpY0SX5xYjAzk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RwydQCd6v2fsuBHe6JPtRoKYWv3odzROdaAWFhTwhvzMkjTrP4Vi9Zyd+FKfBrpiA yt0bpguqM1acHK2HrnjNYwvF84eNklapYkrdxJlOCLGTHHDkRLt8XbdZ1av7AuJMTK 0H2o7zTxcKgYm65o+Ch5csMJ6X6qwaLNMXMe+uuk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201217121042eucas1p13dcc9b9e156dff9029d9f761774de32c~Rf8i_7NIT1918619186eucas1p1O; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 29.A0.45488.2CA4BDF5; Thu, 17 Dec 2020 12:10:42 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201217121041eucas1p19f05a4303a79c69b2f5fc3d12245bdb3~Rf8ipb3qe1507615076eucas1p1n; Thu, 17 Dec 2020 12:10:41 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201217121041eusmtrp1bfb598d6c9a88d80c23b11f2164a8ea1~Rf8io2uQa3076830768eusmtrp12; Thu, 17 Dec 2020 12:10:41 +0000 (GMT) X-AuditID: cbfec7f5-c5fff7000000b1b0-39-5fdb4ac23762 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AF.6A.21957.1CA4BDF5; Thu, 17 Dec 2020 12:10:41 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201217121041eusmtip1c1c269dd9815967df2f2b6b463f4c662~Rf8iQkO2w3274832748eusmtip1E; Thu, 17 Dec 2020 12:10:41 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de Cc: Marek Szyprowski , Lukasz Majewski , Marek Vasut , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH 2/5] dfu: add 'SKIP' entity Date: Thu, 17 Dec 2020 13:10:27 +0100 Message-Id: <20201217121030.6352-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201217121030.6352-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEIsWRmVeSWpSXmKPExsWy7djPc7qHvG7HG2yczmyxccZ6Vosbv9pY LZ6/u8xksfbIXXaLN22NjBZv93ayO7B5zJt1gsXj7J0djB59W1YxBjBHcdmkpOZklqUW6dsl cGVcWHqfveCNaMX/R/1MDYz7BbsYOTkkBEwk1s94yNTFyMUhJLCCUeLgxVlsEM4XIOfeeWYI 5zOjxKKH/5lhWha/mccCkVjOKHF1Qi9Cy55N21hAqtgEDCW63naxgdgiAhISv/qvMoLYzAIX GSV+/zcGsYUFtCV+XvkMNpVFQFVi/tQzYL28AjYSfecOM0Jsk5dYveEAWA2ngK1Ex8l3YMsk BFo5JFZ/O84GUeQiMWn7aajzhCVeHd/CDmHLSJye3MMC0dDMKPHw3Fp2CKeHUeJy0wyoFdYS d879AprEAXSepsT6XfoQYUeJZ5/ngoUlBPgkbrwVhHiAT2LStunMEGFeiY42IYhqNYlZx9fB rT144RLUOR4SP1a/gQbjBEaJRxtOsUxglJ+FsGwBI+MqRvHU0uLc9NRi47zUcr3ixNzi0rx0 veT83E2MwGRw+t/xrzsYV7z6qHeIkYmD8RCjBAezkghvwoGb8UK8KYmVValF+fFFpTmpxYcY pTlYlMR5d21dEy8kkJ5YkpqdmlqQWgSTZeLglGpgiuS4/n1Ri7i8s8PqEE42o+zqlGSuqvIL p+6fk1G1sbi2iDnukmd8bk/n/12u3941mQhZP+Rj2Vj5/2vu7jDF2Yyznm+QjhB++uWoppvQ rDmNnGIVwt/l+v7PPyF/oT8wi/nrZ+c9ffF6Ph9Uctd63A0PVM/uLZxXFvGOX26zxHbTdx5/ J/69Pqeav2mDsEb8z6s9feKJT3eIzNCd6d5uKj7/xcmC1KVNP6dvt1STrf40s0Pcl1+6/YeJ d9z16fV7Dt12tOMOuVWyd/elf3PiOZeZzL33uEFnlv2a3ZM2Gl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S-MailID: 20201217121041eucas1p19f05a4303a79c69b2f5fc3d12245bdb3 X-Msg-Generator: CA X-RootMTR: 20201217121041eucas1p19f05a4303a79c69b2f5fc3d12245bdb3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201217121041eucas1p19f05a4303a79c69b2f5fc3d12245bdb3 References: <20201217121030.6352-1-m.szyprowski@samsung.com> 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 From: Jaehoon Chung Define a new 'SKIP' type for DFU entities. The flashed data are simply ignored without returning any error values. This allows to have the same board flashing procedure and images for the different board types or variants, where each board uses only the images relevant to it and skips the rest. Signed-off-by: Jaehoon Chung [mszyprow: rephrased commit message and subject] Signed-off-by: Marek Szyprowski --- drivers/dfu/dfu.c | 2 +- drivers/dfu/dfu_mmc.c | 9 +++++++++ include/dfu.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 501a60b344..fc32a53323 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -614,7 +614,7 @@ const char *dfu_get_dev_type(enum dfu_device_type t) const char *dfu_get_layout(enum dfu_layout l) { const char *const dfu_layout[] = {NULL, "RAW_ADDR", "FAT", "EXT2", - "EXT3", "EXT4", "RAM_ADDR" }; + "EXT3", "EXT4", "RAM_ADDR", "SKIP" }; return dfu_layout[l]; } diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index 784d0ec76b..d1af11d94c 100644 --- a/drivers/dfu/dfu_mmc.c +++ b/drivers/dfu/dfu_mmc.c @@ -108,6 +108,8 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu, case DFU_FS_EXT4: fstype = FS_TYPE_EXT; break; + case DFU_SKIP: + return 0; default: printf("%s: Layout (%s) not (yet) supported!\n", __func__, dfu_get_layout(dfu->layout)); @@ -204,6 +206,9 @@ int dfu_write_medium_mmc(struct dfu_entity *dfu, case DFU_FS_EXT4: ret = mmc_file_buf_write(dfu, offset, buf, len); break; + case DFU_SKIP: + ret = 0; + break; default: printf("%s: Layout (%s) not (yet) supported!\n", __func__, dfu_get_layout(dfu->layout)); @@ -238,6 +243,8 @@ int dfu_get_medium_size_mmc(struct dfu_entity *dfu, u64 *size) if (ret < 0) return ret; return 0; + case DFU_SKIP: + return 0; default: printf("%s: Layout (%s) not (yet) supported!\n", __func__, dfu_get_layout(dfu->layout)); @@ -399,6 +406,8 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) dfu->layout = DFU_FS_FAT; } else if (!strcmp(entity_type, "ext4")) { dfu->layout = DFU_FS_EXT4; + } else if (!strcmp(entity_type, "skip")) { + dfu->layout = DFU_SKIP; } else { pr_err("Memory layout (%s) not supported!\n", entity_type); return -ENODEV; diff --git a/include/dfu.h b/include/dfu.h index a767adee41..0b1dae0b3b 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -33,6 +33,7 @@ enum dfu_layout { DFU_FS_EXT3, DFU_FS_EXT4, DFU_RAM_ADDR, + DFU_SKIP, }; enum dfu_op {