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: 614167 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2517963pvb; Tue, 11 Oct 2022 03:04:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bOM8oaivaRzL3HITaokqX/l8K1WOYwq097cxXj4SZ0hqrIQZW8zqreu/Gcq2DBPMZga4A X-Received: by 2002:a05:6870:430d:b0:136:7f6a:9429 with SMTP id w13-20020a056870430d00b001367f6a9429mr6222299oah.271.1665482676740; Tue, 11 Oct 2022 03:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665482676; cv=none; d=google.com; s=arc-20160816; b=WFMK2PI74C5UAgFhRmncUPckBHn/Sd/cVZzGHkb12apeiYRzVgp3rvNXQzT8d0GeN3 Nac/v+RiMOtUHa0rMAER8+JRx2KUjwSxNzl7KMG6eCGkTZUmOJDAkWTYdCX50h5qXGee n+EHRgmiBaf4O7QkPvufjGniHc6cjAa9SXDFdrpRTwUciuL3QKywp2G02lkg2bDQ5ox/ M3M3xIyzvpG4xFzydu0YgRi0rqrU8tp2/76qT1DpZ45hjFRJBL0yWAsu3U5YmSSJSLoM b1vWxpFd3OIfmIN2spVsExFQT0i6ZjJv2e36uyK55NRu2czimwbFJmaFWD0KO1ee+qF1 wapg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=+pmw9Z5mcSk3FTExD2JR2WtSUsls1SbCV+EVeSn7AbE=; b=Rnr3/z25Cn0wxWHyNGPag9w3G/0GkCi+YRaJ8VCWnYE94XvHMJvlKolwxglduf9j3e hl+czUQpi6VL6chGRUjVK1cgpLpt0X2lkChYJH/0P+yiqb71yn/xeD+5SKd0K4j7YebQ evag2nmTLEO7nSDrKRIt+sWjRIJQ4z5i5yrIWahxSv+tBE2fjvX+7ZBINxHU6SKxyjou 7bXxkXHNVhv6LMxsrXW5yJVZn4rGL4/KgB0CWCxCEHEK5GL2ndIhHkrurvGGnd0I8RuI uQHeoJLHKr1QFxugYieHIJa7LgfrpxGbj2Iqb/ttjaZ9JHvKnHBXAIQYWLTsl/nRZer4 z/GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=NlQWkT42; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=aO0GB03L; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:3::133]) by mx.google.com with ESMTPS id r11-20020a056871088b00b00132480d3b9asi13234812oaq.291.2022.10.11.03.04.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 03:04:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) client-ip=2607:7c80:54:3::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=NlQWkT42; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=aO0GB03L; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:3::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=+pmw9Z5mcSk3FTExD2JR2WtSUsls1SbCV+EVeSn7AbE=; b=NlQWkT42Ye/+uk f/TjwgMqJP0MlUCg1A9Aztl8rJFxBiNJ7ZzFC8mUKh2Og9jCiPI8pkFTmHxmvr856w/TVXEwQQfzi 5+xPX1S7YRqw4J8CAW/iPd24gOrM7jfHrmx5yUNle6LeUTk5AyzDkx22eBmP1TqDtp39HergV2Mi0 v6M5paEfl49V4LqRIvtWY6gGsXaUPp4E5hJhRpVMoIWQ6brrSugAiY/lSPPVFmmWF/dy+MBYMvGBF ok51rxorhjKTTjmpKpzmzubOq7ZCgQrB8g+bowTzalY3Uje2Ral/++GI1FgluCXznlGsPJTdBi+f+ CvHbbLsKu2sPUvA+RNQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiC79-003wAa-AM; Tue, 11 Oct 2022 10:03:55 +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-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-Spam-Score: 0.1 (/) X-Spam-Report: =?utf-8?q?Spam_detection_software=2C_running_on_the_system_?= =?utf-8?q?=22bombadil=2Einfradead=2Eorg=22=2C?= =?utf-8?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_original?= =?utf-8?q?_message_has_been_attached_to_this_so_you_can_view_it_or_label?= =?utf-8?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?utf-8?q?_the_administrator_of_that_system_for_details=2E?= =?utf-8?q?_?= =?utf-8?q?_Content_preview=3A__From=3A_Rafa=C3=85=C2=82_Mi=C3=85=C2=82ecki_M?= =?utf-8?q?ost_TP-Link_home_routers_use_the_same?= =?utf-8?q?_partitioning_system_based_on_a_custom_ASCII_table=2E_It_doesn=27t?= =?utf-8?q?_seem_to_have?= =?utf-8?q?_any_official_name=2E_GPL_sources_contain_tool_named_simply_=22mak?= =?utf-8?q?e=5Fflash=22_and?= =?utf-8?q?_Makefile_target_=22FlashMaker=22=2E_?= =?utf-8?q?_?= =?utf-8?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_required?= =?utf-8?q?=29?= =?utf-8?q?_?= =?utf-8?q?_pts_rule_name______________description?= =?utf-8?q?_----_----------------------_-------------------------------------?= =?utf-8?q?-------------?= =?utf-8?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_at_https?= =?utf-8?q?=3A//www=2Ednswl=2Eorg/=2C?= =?utf-8?q?_no_trust?= =?utf-8?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MzUgbGlzdGVkIGluXQ==?= =?utf-8?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?utf-8?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_record?= =?utf-8?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publish_an_?= =?utf-8?q?SPF_Record?= =?utf-8?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_abused_en?= =?utf-8?q?duser_mail?= =?utf-8?q?_provider?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freemail_use?= =?utf-8?q?rname_ends?= =?utf-8?q?_in_digit?= =?utf-8?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_author=27s_domain?= =?utf-8?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_valid_DK?= =?utf-8?q?IM_or_DK_signature?= =?utf-8?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_signature?= =?utf-8?q?=2C_not_necessarily?= =?utf-8?q?_valid?= =?utf-8?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM_or_DK_?= =?utf-8?q?signature_from?= =?utf-8?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.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>; + };