From patchwork Tue Aug 28 11:19:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 962856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GJSwZ554"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pC3Dsuy1"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4205vS3zcfz9rvt for ; Tue, 28 Aug 2018 21:22:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=AIHWUuRhosNVan9bGOJmQVjRIyTd6injTWzkryEAZfI=; b=GJS wZ554eyONmWmFBi612/122yP44QrzTdIgoowl5vg5Us2KdyLeYpGN5/E4RZL1/lYmwGV0ZU2clCtb mOB9/ra+ybW1kW7CfSDhw5l9hMn8ynMC15wdnMDIpc7YJ5Fl0hPfuflsTDLDIbrsWeUnhqBwSgJsP dPXp/iqt1zTqx1ss9C+PSqAwKwGu6Y4tB/0UIMqJ4DwG42tQCN93gvOS4Grfw+QhsbTKvLvmw+C8n v7AmI6DZ8wvqYfTQcDXqTTOtppocdqkXc15XYDA+jRWXpofsJMyI32fNcXkOE7CqefBo8nIBa//Uv ZrmoeOKEXgi3Mb1bYJrgancl+LgORkg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuc4e-0005yX-2J; Tue, 28 Aug 2018 11:22:16 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuc2f-0003r8-HV for linux-mtd@lists.infradead.org; Tue, 28 Aug 2018 11:20:17 +0000 Received: by mail-wm0-x242.google.com with SMTP id i134-v6so1634019wmf.0 for ; Tue, 28 Aug 2018 04:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ibyIim7SQHQpkj1sI1+cA9JP5FVYZfBpi7oQ+wwd9uk=; b=pC3Dsuy12Vfl4iy9hKzhpweaDRD2nAIZtL0IBZmKTUFd1qQJxRETdN94QZV3WkM9zQ AbjoBTK0osm1ljPXTD8GZaPBTxWKkGoSkDVda4/Red+vGeUVIOhH70BIz+tNV89IYHHI 3rTDlP5ozrLBRSpw9SNjuUzbScTqwrKqWB2cjFvmIC/YYGZ9VtRfsGaTMQ+wj08NPxaO JeytrRjNydZNIg3H52aVVigU+281E1IozVYCSfJ9gVrBszGvJbv7yUsVtZNZnJh+WoJs TjOQiYJhHMnH+suNtwK0zjUoi1RdfHdl0dVAuGM4/rZD712QvYvBukUVJWawnMskdw/O W6ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ibyIim7SQHQpkj1sI1+cA9JP5FVYZfBpi7oQ+wwd9uk=; b=m/l3OOsBt54ZAaRjwJYIJANhpU0CgWMYxpQr4x1locmSl9EvpgpsYKYVxFeqoG5hK8 CP5wfNoTDFhF9/QXKjTz2jfQ421F9/vAVzCvA8MnnBgwiG6vi04RzJY1vOfwOAdb2BVl qvOlDBoNdCak3g+8BFfs/auw3cPNeRpw4Mca0j07ynF+8Jf0NFlI6KSawJWjvmSDiVJt Wn/Zdp5nlLWNkH3840tBm/5b6M+ZUanrX4u9jZPsDM7QbpjtpXZDtmLcqKjx1w+5SKw7 +BUZ0AZJKrfxXlKLYugSBKf9jVjtsiolWQDDCJ76wD4goJiNBTZrVGj9Ic9axu3h6yYG izLA== X-Gm-Message-State: APzg51B0287yH+CKrKy4H8LvOfzXde8Nq75suMIW6z0nRQvy/OeAgxlL MNADWGOCPG7QvDIKedJqTvaGdkou X-Google-Smtp-Source: ANB0Vda3ZY+2aEeZ/2f0MZHVldULQ/FR52lNU1nAVVmLZnGTqt4m1ZOhMgRZ5Y0l7eUTfeamV3D3Ng== X-Received: by 2002:a1c:48d:: with SMTP id 135-v6mr1129531wme.128.1535455199913; Tue, 28 Aug 2018 04:19:59 -0700 (PDT) Received: from localhost.localdomain ([2001:470:9e39::64]) by smtp.gmail.com with ESMTPSA id e141-v6sm1520282wmd.32.2018.08.28.04.19.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 04:19:58 -0700 (PDT) From: Jonas Gorski To: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 0/5] mtd: bcm63xxpart: add device tree support Date: Tue, 28 Aug 2018 13:19:39 +0200 Message-Id: <20180828111944.5956-1-jonas.gorski@gmail.com> X-Mailer: git-send-email 2.13.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180828_042013_604539_DF011E68 X-CRM114-Status: GOOD ( 18.65 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:242 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jonas.gorski[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Florian Fainelli , Marek Vasut , Richard Weinberger , Boris Brezillon , Rob Herring , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patchset adds appropriate bindings for parsing various bcm963xx NOR flash layouts found in the wild. The image header is quite limited, and only has fixed fields for the offsets and sizes of the kernel and rootfs partitions. If any additional partitions exist, they need to be described externally, e.g. through fixed partition layouts. The first two patches add the bindings for the full flash parser for the "common" case: first erase block bootloader, last erase block nvram, reminder available for firmware. The third patch splits out the image header parsing into its own parser. Then patches four and five add bindings for the split out parser, to support non-trivial cases with additional partitions, or a non-standard offset of the firmware partition. These patches have been in used since a while in OpenWrt. Jonas Gorski (5): dt-bindings: mtd: describe the simple BCM963XX NOR flash layout mtd: bcm63xxpart: add of_match_table support mtd: bcm63xxpart: move imagetag parsing to its own parser dt-bindings: mtd: describe BCM963XX ImageTag format and usage mtd: parser_imagetag: add of_match_table support .../brcm,bcm963xx-cfe-nor-partitions.txt | 24 +++ .../mtd/partitions/brcm,bcm963xx-imagetag.txt | 78 ++++++++ drivers/mtd/Kconfig | 1 + drivers/mtd/bcm63xxpart.c | 163 ++------------- drivers/mtd/parsers/Kconfig | 11 + drivers/mtd/parsers/Makefile | 1 + drivers/mtd/parsers/parser_imagetag.c | 222 +++++++++++++++++++++ 7 files changed, 353 insertions(+), 147 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-cfe-nor-partitions.txt create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,bcm963xx-imagetag.txt create mode 100644 drivers/mtd/parsers/parser_imagetag.c