From patchwork Fri Jan 12 09:33:53 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: 859690 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=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HkCBQkKg"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lGKJIEtb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3zHyJG5ZnMz9ryk for ; Fri, 12 Jan 2018 20:34:38 +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: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=xB8hw3yQqX5UhvtiNF3L8aYNbTdBJgpnX3SlPZ1whjg=; b=HkCBQkKgvK6tZh wgZ1ad73FBlM39Px1jYJaBH90VoQqaYa1GXW8FOy+yrExRfIQxN+XsvsnJmnT0pJvOZhFcN67GIHH FUFpRomg6uRHgihrX2J1c/BCBeVH7bhy2t/M6lhjhV1gfV4rhDmI9xMUTiMwjxa+x2Jd6gv09NsSZ QWM3OOUWn3w1ctWsGP3p+xQ3VwmS5hpyhYdQ3uUnA0sdwVF4mJgnHCHP5SoQvwNnbLD3YN/57rEi4 amq2wGK8WLivRU83dpl4GlLDHw9Dv8CJkD/j/kEjnnhX0gNA8kBr+rLoPx0Xg60VHUeoNp1xMPgd2 XHjUUvmiz1AL6deLfYfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eZvjM-0006IN-GD; Fri, 12 Jan 2018 09:34:32 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZvjJ-00066K-3l for linux-mtd@lists.infradead.org; Fri, 12 Jan 2018 09:34:30 +0000 Received: by mail-lf0-x243.google.com with SMTP id j143so5255950lfg.0 for ; Fri, 12 Jan 2018 01:34:17 -0800 (PST) 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=Ay9xd7Wuy7nVXdrVoVIikU5Nw/ecIE4qBvkdyXI2F/8=; b=lGKJIEtbu2U4U512Caj7mg5zGu0RGZuMQ1Vv/a5Z/4/xvH1dhcwJxw0HhRx7S+5926 ef6P3Xn7R8uWOtYNNnQWiauwn7cWPsvEKpmbcTfKh+AcKLilUbBj81IFTss01f8kHncV ch3j9+KLDX+TzyyhqM0xXeiZUvDMOCY0HIC9XLZl9r0zcMtZ8UZZxYn75sPt8nQibH57 akKrLJSLuie+rMtUx5/D1mST2q4CDjeuXxE2VajDCm4LzaxqXncsjrgN3RrDcZ6OG2dB +/SqC6vg8dFSihtqKx75JowlRrtjdUuisJu6+QrRSGzZdWnMSkbg2v89xMQcVWOTPfCs 3wwg== 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=Ay9xd7Wuy7nVXdrVoVIikU5Nw/ecIE4qBvkdyXI2F/8=; b=gHHPPJdj1zjeqDHeHiEs9ylx45IbaIp2JZ1eaafYXk7uD75+fZZLXU9/G9P/j2lhPe eKuXtMtAj53MPuzJt1pL9fUdF0MjP2KOgOG/m7uYuLRXaZ6feNjNQcYtFOjtHWKr9f7F 1FNOFfvEz+9uIGfOaVlxpYY6rBPmY8vOykVB111Wg/2Xn3VkJO0xIadw13Ks33fiDy7M d3Dng460hp0jnGq9xhjICD9jjI+EafdlVDMlMUVhT6oN3pVeKUw+V2IRaOwG12B+SFBz dpRUvSojhvPBrzrWYN+ZmJaJpY7jbRj/q3UlOX1pkC3P01npkBMvDKeaLnRY9k174GMA WRXA== X-Gm-Message-State: AKGB3mJpUBr/gRZ7t/jKhu4Ye4A1sV5kVLN/e/gqsQuUGIU+k/rOA72d 6ThXMYY1N/sGVcNhWYXNOwM= X-Google-Smtp-Source: ACJfBotU8Wa7tjY4iPDtlNin08Vy0yQKKQywNe4BumRArf+CTVgRuxQJxQxoJa+RT2BvdMRZM5Cr0A== X-Received: by 10.46.27.27 with SMTP id b27mr15805975ljb.62.1515749655988; Fri, 12 Jan 2018 01:34:15 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id l12sm642113lje.72.2018.01.12.01.34.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 01:34:15 -0800 (PST) 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 BCM47xx partitions Date: Fri, 12 Jan 2018 10:33:53 +0100 Message-Id: <20180112093354.17593-1-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180112_013429_163340_DF08484A X-CRM114-Status: GOOD ( 12.97 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.8 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.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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 , 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 partitions which have to be discovered in a specific non-standard way. As there is no partition table this commit adds and describes a new custom binding. Signed-off-by: Rafał Miłecki --- .../devicetree/bindings/mtd/partition.txt | 46 +++++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/partition.txt b/Documentation/devicetree/bindings/mtd/partition.txt index 36f3b769a626..b201d497b618 100644 --- a/Documentation/devicetree/bindings/mtd/partition.txt +++ b/Documentation/devicetree/bindings/mtd/partition.txt @@ -14,8 +14,6 @@ method is used for a given flash device. To describe the method there should be a subnode of the flash device that is named 'partitions'. It must have a 'compatible' property, which is used to identify the method to use. -We currently only document a binding for fixed layouts. - Fixed Partitions ================ @@ -109,3 +107,47 @@ flash@2 { }; }; }; + + +Broadcom BCM47xx Partitions +=========================== + +Broadcom is one of hardware manufacturers providing SoCs (BCM47xx) used in +home routers. Their BCM947xx boards using CFE bootloader have several partitions +without any on-flash partition table. On some devices their sizes and/or +meanings can also vary so fixed partitioning can't be used. + +Discovering partitions on these devices is possible thanks to having a special +header and/or magic signature at the beginning of each of them. They are also +block aligned which is important for determinig a size. + +Most of partitions use ASCII text based magic for determining a type. More +complex partitions (like TRX with its HDR0 magic) may include extra header +containing some details, including a length. + +A list of supported partitions includes: +1) Bootloader with Broadcom's CFE (Common Firmware Environment) +2) NVRAM with configuration/calibration data +3) Device manufacturer's data with some default values (e.g. SSIDs) +4) TRX firmware container which can hold up to 4 subpartitions +5) Backup TRX firmware used after failed upgrade + +As mentioned earlier, role of some partitions may depend on extra configuration. +For example both: main firmware and backup firmware use the same TRX format with +the same header. To distinguish currently used firmware a CFE's environment +variable "bootpartition" is used. + + +Devices using Broadcom partitions described above should should have flash node +with a subnode named "partitions" using following properties: + +Required properties: +- compatible : (required) must be "brcm,bcm947xx-cfe-partitions" + +Example: + +flash@0 { + partitions { + compatible = "brcm,bcm947xx-cfe-partitions"; + }; +};