From patchwork Tue Oct 11 10:03:32 2022 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: 13003805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AA84C433FE for ; Tue, 11 Oct 2022 10:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=AVmerBD1QsG+OQGMb5M7ftqIXC5y/VxCzeUjzLRc74U=; b=yIct4610t7QvAd JTrQrUIjJeY3DjLbTfdhkxa/aNcGvMQgwX2pkHGFRAuw59rPP96kLJnxdALzsoMMUEt1AHiRFelnX 6+dqMgllOs+OQm9KfmHVDMR7ZR92ZZdqnvqpUJKo5BEAsG1omNZtxPmLUfigA6ParflTJEG0OwZzU u9vvIfarplQglKLiSAhZPiH8uT0kJzhTtlTAFUpbvEkH74QzzWKUn8L4fCaKsXjggWQzbtPSsbj7A ttDwOCYmNfAVqkY4WfSex0pMtvdLyeNfgsDD4fKM7KMqB0NcygOBwRqarG33JDc6/qGkvgL2XhZZ1 GXe3r0C0e/pJp0PT04bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiC7B-003wAz-HU; Tue, 11 Oct 2022 10:03:57 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiC74-003w93-Bw; Tue, 11 Oct 2022 10:03:52 +0000 Received: by mail-ed1-x535.google.com with SMTP id v12so1086924edc.6; Tue, 11 Oct 2022 03:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lBTq8juooIuTyFEgcmEOyFqiiRaMLuXlIjzIJ8KmLsg=; b=aO0GB03LHXSuLYJGS55fnpkD2vkTt9JCLtPGOIoCVfhsLwESgpJ8TF392ivbhl1UN+ ThHtE59bPTEM1CF8WTIjdMG/59+hWeoFpJlftp40fpQhKZc84ix5kiWAWLNY3UyXOKsW CHwh2C6PlDWk3xTLRQd+A0WIUwxiiVMoh4Ojg9qNMkxfYbBxdvWyFNNKYE6JtB+SGQKf 35091AOyYmVzYX2i3F/OIlYt30uLedwCbEKgZSHHVefZC7GF0WQ8omDb1YnqfUICED4y IHXfqnjhf+Dnbikgl2la4mqKdpiV/1yCpz5RVqiw707zZIIbk3swbMJEbSo9sVGHI+Vv pTng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lBTq8juooIuTyFEgcmEOyFqiiRaMLuXlIjzIJ8KmLsg=; b=nhvRB+grCkTxBKzrDyOlwHBm/Hu4dZGLKXS2uDQ+FCZS1wVx0kIevmAoPR/5XypQtI 339ITVD2jE17aRsDrO1tKaMnBnUOEwzL+vfMXNzgEZ+oO8Z9hbZsy3ZZdGRxxI5IBw1U 4Nf+GA6tOO+O2/MSA4BgHVpaJ5wUl5FnGK3Y/mbi4zrG6iMiZYxMIud2fNfi1Y2NQuln MiXat9eR+1tMgQZhrz3f3SQW0zn3XK7NScBhCfEqbltjmcULB7QSmHznoHj7xnbRsBkW qql4Xlj3vHz06py61RvQgB+tHJuEQhlE9enXFUrke9g99CL/j2pk0j7mfH9a+L4v/7rF mbBQ== X-Gm-Message-State: ACrzQf1GDsBpJWceQiSXXOVoYvI0RSSfWsi7TQSbbPUGZ0NI5qoAipd4 rnHna0pQfb5ogUmSTcnCrPY= X-Google-Smtp-Source: AMsMyM55d8xMOD3wN0672qkNZ4P9Yy7UfT7+bZky+xgDImbk2OZtM06DaBFO+uQYWYEX6NMLgQakVQ== X-Received: by 2002:a05:6402:2146:b0:458:15d7:b99a with SMTP id bq6-20020a056402214600b0045815d7b99amr22290831edb.24.1665482626964; Tue, 11 Oct 2022 03:03:46 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id o8-20020a170906768800b00780ab5a9116sm4597749ejm.211.2022.10.11.03.03.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 03:03:46 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, Florian Fainelli , Hauke Mehrtens , bcm-kernel-feedback-list@broadcom.com, John Crispin , =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= , Sergio Paracuellos , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/2] dt-bindings: mtd: partitions: add TP-Link SafeLoader layout Date: Tue, 11 Oct 2022 12:03:32 +0200 Message-Id: <20221011100333.32536-1-zajec5@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221011_030350_433179_922A6CF3 X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki Most TP-Link home routers use the same partitioning system based on a custom ASCII table. It doesn't seem to have any official name. GPL sources contain tool named simply "make_flash" and Makefile target "FlashMaker". This partitions table format was first found in devices with a custom SafeLoader bootloader so it was called SafeLoader by a community. Later it was ported to other bootloaders but it seems the same sticked. Add binding for describing flashes with SafeLoader partitions table. It allows operating systems to parse it properly and register proper flash layout. Signed-off-by: Rafał Miłecki --- .../tplink,safeloader-partitions.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/tplink,safeloader-partitions.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/tplink,safeloader-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/tplink,safeloader-partitions.yaml new file mode 100644 index 000000000000..e38aaea5aa11 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/tplink,safeloader-partitions.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/tplink,safeloader-partitions.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TP-Link SafeLoader partitions + +description: | + TP-Link home routers store various data on flash (e.g. bootloader, + flash layout, firmware, product info, configuration, calibration + data). That requires flash partitioning. + + Flash space layout of TP-Link devices is stored on flash itself using + a custom ASCII-based format. That format was first found in TP-Link + devices with a custom SafeLoader bootloader. Later it was adapted to + CFE and U-Boot bootloaders. + + This binding describes partitioning method and defines offset of ASCII + based partitions table. That offset is picked at manufacturing process + and doesn't change. + +maintainers: + - Rafał Miłecki + +properties: + compatible: + const: tplink,safeloader-partitions + + partitions-table-offset: + description: Flash offset of partitions table + $ref: "/schemas/types.yaml#/definitions/uint32" + +required: + - partitions-table-offset + +additionalProperties: false + +examples: + - | + partitions { + compatible = "tplink,safeloader-partitions"; + partitions-table-offset = <0x100000>; + };