From patchwork Tue Jun 12 10:44:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 928238 X-Patchwork-Delegate: boris.brezillon@free-electrons.com 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="Z9/Puuxd"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ALiIcAU1"; 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 414mlm30dbz9s0w for ; Tue, 12 Jun 2018 20:46:44 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=TrdsF8PkOlZ1jTkXzLCjHeqA07zEt920QqfEN0sVJoQ=; b=Z9/PuuxdJ46sVK 44Bpvw7UolzLDPx+nbLqUeIhV99iMCmaSMJuVi7mYWqkOSCQIRhdqTtL1N8KxvukLd/2FwWtlrPXb GULeLl9uZpshimgGjT+Ukdpj3eo6BCryTy9BMIpV121txF5b8FvoFhTjD4rDOKEuIDKZVIZZtUQWl EpYEjAiOadkn6rpJ4W6U+iBYsDWUSsDppMRUkm7IEiXUngWpDlUXB/kpfAkhqInbesrYUMflcAaFl FzsqyRaI4CHFr+yNVdxkSBOHX7MuTKwAr1QuI/DPV/0rhrbU1jhsj/9q7GJtBSdhHbZovzEnKh4gp 1bCFAc4hPKe4fPOH1puA==; 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 1fSgot-0002w5-A6; Tue, 12 Jun 2018 10:46:35 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSgop-0002aA-AW for linux-mtd@lists.infradead.org; Tue, 12 Jun 2018 10:46:33 +0000 Received: by mail-lf0-x243.google.com with SMTP id o9-v6so35264782lfk.1 for ; Tue, 12 Jun 2018 03:46:20 -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:mime-version :content-transfer-encoding; bh=DkS2vIv6zy5q4XJZoJ/JlfgJNu9ILkmm/z/3qXhsdQo=; b=ALiIcAU1aVveN9Qo0PinL8i+ViLa7v2krQTNkMe5HdgU3UnfShe6lDjAHPs9bse+Vf B/jHLP3/oN2qPtojxmU7b2FGbgbp8F86Zjz+BhODmAia1wL6vXJw0i2RXSgvGdI1VgwK Z21enAe8E0BgasAJEbGU1gw9/0cE3Ithl92vJf28sPKShKZC402DtucYvNzDXGDh8m8a 9zI7vAnZt7AX11mXGdADTUacNwdsblJUNFfDRESh/KqkolVMvXtcgCuOpM7noV93+2dd yu7rYqVmehi+YgbAMtuTTIfCuDv29HU/yBCff0hRGq6vxhCBA0TlDl/HroJfWU5BRwjH RWng== 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:mime-version :content-transfer-encoding; bh=DkS2vIv6zy5q4XJZoJ/JlfgJNu9ILkmm/z/3qXhsdQo=; b=KMkNg/Xea2XRl8sJcyCsLY2OmNJnqMVz6V0Vcd7EVUaIwpiQSGJiZ30yF5Vah1M2KL G0wiI8gBDMw0MLLUJPE2AX+Y6hwKGLPjizIdY270ydpHYpvpxk1H7Llhas46xF55MZ5r 5bk3ObCMMV4o3jglYyhybAfbYlBRfrNep8CEY7sgKID4MF1TSrFjxPvcXmAffb6ldS9v 4/EGxGcuBJW7LmTb9BMltiO31TGr/8QZl22XibcEYXkAPQVtWBNjrt28ElRf9afML/L+ 2MLXdSym+jjDS+vpE8uW776BFcaKjdxGX9YsAC4uHQ4nviwW+vDXH04j1DaEqy27n6k3 uURA== X-Gm-Message-State: APt69E06QFNMA3fcwhfl/FGWd2eFYDIXUPQI+NKd2awNiNDwEGVDfwYh FGNqKH7T/JwTBdJqZgWlxI4= X-Google-Smtp-Source: ADUXVKLEryg77BIQt+MtwapEvBujjgiRrn02BVVsZWIh1FUNQAsW+gM0IziwYbGf88Wy7nlHtCUbcg== X-Received: by 2002:a19:9101:: with SMTP id t1-v6mr1751623lfd.29.1528800379197; Tue, 12 Jun 2018 03:46:19 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o26-v6sm155208ljg.39.2018.06.12.03.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jun 2018 03:46:18 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Brian Norris , David Woodhouse , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , Rob Herring Subject: [PATCH 1/2] dt-bindings: mtd: document Broadcom's TRX firmware format binding Date: Tue, 12 Jun 2018 12:44:33 +0200 Message-Id: <20180612104434.15232-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180612_034631_385038_2B50E72F X-CRM114-Status: GOOD ( 16.34 ) 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:4010:c07:0:0:0:243 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 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 , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Jonas Gorski Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Rafał Miłecki Broadcom based home router devices use TRX firmware format. It's a container that can hold few partitions. If operating system is expected to access them it has to understand that format and parse flash data accordingly. Signed-off-by: Rafał Miłecki --- .../bindings/mtd/partitions/brcm,trx.txt | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/brcm,trx.txt diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,trx.txt b/Documentation/devicetree/bindings/mtd/partitions/brcm,trx.txt new file mode 100644 index 000000000000..e590b884e5ac --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,trx.txt @@ -0,0 +1,35 @@ +Broadcom TRX Container Partition +================================ + +TRX is Broadcom's official firmware format for the BCM947xx boards. It's used by +most of the vendors building devices based on Broadcom's BCM47xx SoCs and is +supported by the CFE bootloader. + +Design of the TRX format is very minimalistic. Its header contains +identification fields, CRC32 checksum and the locations of embedded partitions. +Its purpose is to store a few partitions in a format that can be distributed as +a standalone file and written in a flash memory. + +Container can hold up to 4 partitions. The first partition has to contain a +device executable binary (e.g. a kernel) as it's what the CFE bootloader starts +executing. Other partitions can be used for operating system purposes. This is +useful for systems that keep kernel and rootfs separated. + +TRX doesn't enforce any strict partition boundaries or size limits. All +partitions have to be less than the 4GiB max size limit. + +There are two existing/known TRX variants: +1) v1 which contains 3 partitions +2) v2 which contains 4 partitions + +Required properties: +- compatible : (required) must be either: "brcm,trx-v1" or "brcm,trx-v2" + followed by "brcm,trx" + +Example: + +flash@0 { + partitions { + compatible = "brcm,trx-v1", "brcm,trx"; + }; +}; From patchwork Tue Jun 12 10:44:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 928239 X-Patchwork-Delegate: boris.brezillon@free-electrons.com 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="cQoI7LpZ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MZBHv8Hg"; 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 414mmn3Nyfz9s0w for ; Tue, 12 Jun 2018 20:47:37 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=En+8NWvjHbHfZL9Le3OsT8AT1QdCcFFuHVbUFgDOLMI=; b=cQoI7LpZLcssVf ZgAOPuw1QhxGbQlWJe3/4eRZu/jnk8jKKom739ra4+QIbG9X1E/3tB8VfOSyWABN2rpmXzXrs3/Di bT8WkTWQSRTLNvW535q99B0sud2B+sZMdKCyxXCF0LW+ehTuy9vpGrNRITv5KSmbN/4/xoWz99w07 91vJb2JkdjfaLiW4Y2SY5IShle6UN+UapGJPEI+UQ+K9aK/1WZAyHtevoF47isthm5+MgFdD0nmsX qLqPV1pMdmadu3FfxVDWbQtQY7B/1XcsjyDX//vNCz8txht6eXaX0eTNF76Dieo90KPqDYxcU9XqH WHeSuRLlX/uaFuhSIY7w==; 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 1fSgpf-0003Gc-LI; Tue, 12 Jun 2018 10:47:23 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSgos-0002hE-GG for linux-mtd@lists.infradead.org; Tue, 12 Jun 2018 10:46:38 +0000 Received: by mail-lf0-x244.google.com with SMTP id i83-v6so35254435lfh.5 for ; Tue, 12 Jun 2018 03:46:24 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=RACKOx3eI5a1VnnL1+bq1Qzc+KogPmVlIw2BAiY+YBw=; b=MZBHv8HghPfD636wiboSm34uxivgKV22WEiqsFKBeMeeb4eNwkIKV98CwFRp+AVabi plXUWcq3fqCpGbEOL/XDC9A7oAxHeB31yJhLcG3n85imNkV30cvQI4jMYPw5ty/q9Qf1 BWUHgZ81QxJ4JzGVMWePlvcSsqD0TDby9F6yaMIALTDKYIGglNpjluJ55rzHC0tk6P6L 4s3cNeXFW7hrlBGROglQnuCDzFfTlGuDVW6fRX/+kWadvhzHk+FgShz96aoy1nqbNZY/ 1P6+Ei+3p1nJB+pKVSQ2DM/1SHd5XJoQ1ONgjiaCXlMHMuwudVmlHONTQSMA89REOVif DEFw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=RACKOx3eI5a1VnnL1+bq1Qzc+KogPmVlIw2BAiY+YBw=; b=O5X/2d+ecPwDm8GJLIMR2eL/uvJjbf8US5gPLVxs6pQeXQ1xfvojZlJ52iaY2Z0aIh pGtAJLXtHGEzBukCeT5IhaV8JtdZSLikhqdPtuIjNMlXPeDFh2Lahv62VuA6cd8y/RJP WnbDRLS5ojwc+0nITG012cy5XCOzynyeOuIRnVZHnU6qGbttxcPX4+7NfUQLbJGKnUIJ W22aPvLEu+jFN0B8kKUfEggPY+jB0I+2yzuFcdJJoc5chIw3KH6619aC6PlGfQx+g+3+ a8/1Eg5LM9yQFKmqRN8CB453awhOL7grXx7Wj7iclZYFI+2IyFMlEL6GkVTmqXwAITgO g4nQ== X-Gm-Message-State: APt69E0Xpz/FnQt43aeE9VZwxGi0Lx4bheV2bUDMDsAUpFcXz9qXshiq SVEe2XV66HTMSc+C1n9DykQ= X-Google-Smtp-Source: ADUXVKJL12C9k1TmucTkrsQRxWP+IeTecMcrJmDH7SbpKHOcrvbY276QRt2bw8cN5yMYcANBwy++ng== X-Received: by 2002:a19:3bc5:: with SMTP id d66-v6mr1565935lfl.113.1528800382540; Tue, 12 Jun 2018 03:46:22 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o26-v6sm155208ljg.39.2018.06.12.03.46.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jun 2018 03:46:21 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Brian Norris , David Woodhouse , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , Rob Herring Subject: [PATCH 2/2] mtd: parsers: trx: add of_match_table with the new DT binding Date: Tue, 12 Jun 2018 12:44:34 +0200 Message-Id: <20180612104434.15232-2-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20180612104434.15232-1-zajec5@gmail.com> References: <20180612104434.15232-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180612_034634_584846_2AFF7967 X-CRM114-Status: GOOD ( 16.63 ) 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:4010:c07:0:0:0:244 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 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 , devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Jonas Gorski Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Rafał Miłecki This allows using TRX parser to find TRX partitions on flash device described in DT using a proper binding. It's useful for devices storing firmware on a separated flash and having rootfs partition in it. Signed-off-by: Rafał Miłecki --- drivers/mtd/parsers/parser_trx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/parsers/parser_trx.c b/drivers/mtd/parsers/parser_trx.c index df360a75e1eb..e4fc3611110a 100644 --- a/drivers/mtd/parsers/parser_trx.c +++ b/drivers/mtd/parsers/parser_trx.c @@ -116,9 +116,17 @@ static int parser_trx_parse(struct mtd_info *mtd, return i; }; +static const struct of_device_id mtd_parser_trx_of_match_table[] = { + { .compatible = "brcm,trx" }, + { .compatible = "brcm,trx-v1" }, + {}, +}; +MODULE_DEVICE_TABLE(of, mtd_parser_trx_of_match_table); + static struct mtd_part_parser mtd_parser_trx = { .parse_fn = parser_trx_parse, .name = "trx", + .of_match_table = mtd_parser_trx_of_match_table, }; module_mtd_part_parser(mtd_parser_trx);