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: 859689 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; 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 vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zHyHx2jqxz9t3w for ; Fri, 12 Jan 2018 20:34:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754430AbeALJeT (ORCPT ); Fri, 12 Jan 2018 04:34:19 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:46173 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754320AbeALJeR (ORCPT ); Fri, 12 Jan 2018 04:34:17 -0500 Received: by mail-lf0-f67.google.com with SMTP id a12so5207809lfe.13 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=L+gC5e82vTRdix7P68OmbTa1RHYaVwkEjlvaVlBOliRhGnHhwzM44Vvu4HR8Aq/JuR ntqZA7UTcWm5RZtXalyRB28enCuel7teRV6Vht1TyGRi6cKAl9kLpciWVl2EadjEtWQq ZqpBOWcMx6jH0qG55JVEOeqrycsChqUDII3GUN/REwIgnM1whAzLErw1Z/l4r2vmRUsP rdoXsT5b5mkExTTQRBcgfh3hSt/jsa1ryreyYvuteUdRUOvcrzOCK0fduG358wO1HUz/ B17xbousSum8z81qn+DLjhz0bruQKbL1mwX7PzaZLqJygQYzUNbriLnIEkWL6tJOw/kS Od3Q== X-Gm-Message-State: AKGB3mKejcwHfL8R40/J1Hhj3U2PDuRQmwQJN4fFolj/OiKvAEN7m9mB xjE2vaizmX9d3OH38bVAmsY= 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 Cc: Mark Rutland , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, Jonas Gorski , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= 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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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"; + }; +};