From patchwork Thu Mar 28 14:19:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 1068248 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="dTl+ukZV"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZcL9IbHx"; 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 44VRnk6DnVz9sRG for ; Fri, 29 Mar 2019 01:19:22 +1100 (AEDT) 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=o+xhnxza/XiJtnBwsXYOWUodN9ZCW6MKIYCxAwWHI30=; b=dTl +ukZVvDUcZLal2PsTwXnw2cIG1BM92MAu0L9BFbjSEngjMhnqBuK1yfK4rBrwSRyVJwhaFwGNp38E wq6IbswQT3j5/aROoVWEhDWfPpBzAzjvCkMro9KAeBD81+EYtGOmRJKrX52ZKjasMw/+KttYj/Pg9 4mPU2d5ISnOxLPx7nhCWfXfug1IsHJK9VPNRDz0AxSLOzfN2qAXi8qhs/7Ag9TLz6b6rsLRSDJBfk WqohL/jviwKyuhm9UVpj6a2hgJMtxFcIdT3ZBA+ZcGENHUMh3R4XdeY+eekxJJ1O/4QeMPMgXzwl9 iD9tD2yiIjvpWagwv2RyXpvMrU+w1Vg==; 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 1h9VsC-0001tl-PZ; Thu, 28 Mar 2019 14:19:16 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9VsA-0001si-9q for linux-mtd@lists.infradead.org; Thu, 28 Mar 2019 14:19:15 +0000 Received: by mail-wm1-x343.google.com with SMTP id y197so1526550wmd.0 for ; Thu, 28 Mar 2019 07:19:12 -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=kxi9Xw0rPP9E+6rF5Q2Up/hUyZzAdi6u3y6OfYt/pFE=; b=ZcL9IbHxWTKpH4iBWcXifyLWGngLEXBIJBpMHQpfTrbV+ux22Fh/FSQK03PTXhtgNR Wh36u7zA79B+CFma8aWq3OgHcRVDRV3waDne/n47SXujRhPKJLzvXKgDMsuYw9zhamn3 1g84ptwmxd9cRibhSQF+sulUXi1ofmMdPkt6ys3S4J7z0AnaTt8ysk36OXpFQtD9i7hk xMRiMmHRmQVIKQrGuo1WvMlEvpnKomt2EyDgu5QtqueMMlJMG+yh7+JmtU6H544nS1g3 SN8pAtemmgh6fvt+ZXadeDrA41uRVyM9TTWevxFjfA67IvUt6GfhzTO4L0+SNYb7YYoM o+rQ== 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=kxi9Xw0rPP9E+6rF5Q2Up/hUyZzAdi6u3y6OfYt/pFE=; b=BVeS7vCyQesi24NUtwcvH36CWjh3jFzrUzTdOCuOjk7TI5C+vLYCsds1tGopZavahc H+Ch6dW8twC2weZYyhUTb45jpR/uV6YkIl085AzYEAxz+s0bB3MWaG80WEcqkGv1yuAy kLa9UeyS4Sc5vxW8wJPVqlQUCM6oFCv0O/9C9GtGahlEXkdsAvKkDZ/nyJ2XpayZpt+I KMTQu4L6yMgeuyZYPW+rUptjIQefM8b5aSo4xOWs9AdS2RzqXQXQ9qq1O+Q/oWXexEwG FTegjPViwWtWqZphF4t9zJUk9rGTMwsyK8Q5n616nypVemKCxxEAWepDh1KkjTdIzYSp Wi9g== X-Gm-Message-State: APjAAAX3sIQuqHla1jt6zgcdeyDbE6bfhLNXuhJyK8HK2ByiiWsleOjC HqmQ0eJ7LAitnnZ8LCPmMRA= X-Google-Smtp-Source: APXvYqzIvoq0AsB1NwJuqv3ddxHk7iF+FoX+SAYHKTUrvjxkdNfgaDvkeLoAC0sxx/+AwqqHm2n6KA== X-Received: by 2002:a7b:c382:: with SMTP id s2mr176966wmj.56.1553782751578; Thu, 28 Mar 2019 07:19:11 -0700 (PDT) Received: from localhost.localdomain ([2001:470:9e39::64]) by smtp.gmail.com with ESMTPSA id t2sm51802879wra.9.2019.03.28.07.19.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 07:19:10 -0700 (PDT) From: Jonas Gorski To: devicetree@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH V2 0/5] mtd: bcm63xxpart: add device tree support Date: Thu, 28 Mar 2019 15:19:05 +0100 Message-Id: <20190328141910.5723-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-20190328_071914_345751_3535FEFC X-CRM114-Status: GOOD ( 19.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 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_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 , Boris Brezillon , Richard Weinberger , Marek Vasut , Rob Herring , bcm-kernel-feedback-list@broadcom.com, 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. Changes V1 -> V2: * dropped the second example from brcm,bcm963xx-imagetag.txt * added reviewed bys from Rob Herring 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 | 45 +++++ 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, 320 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