From patchwork Wed Oct 12 05:04:41 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: 614557 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3064308pvb; Tue, 11 Oct 2022 22:05:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5i2xnr6XsXMaNcARLejRsJySNI4EjmwxTOWoKn/ZuFtqXGRvT6409BwMkDnV9CX68X9GBr X-Received: by 2002:a17:90b:3ec1:b0:202:f490:e508 with SMTP id rm1-20020a17090b3ec100b00202f490e508mr3077333pjb.156.1665551140264; Tue, 11 Oct 2022 22:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665551140; cv=none; d=google.com; s=arc-20160816; b=lGJL9D2qKXn2/+HAV7siIZ/RN7QT9lIwGQ+KC+KM4eNe90O1Ww81/NGimWJpjTZguq y15hTEeC5iwR2SS+C7aSt2NdsNWpKf23MnT1WnWp+deaNRrwLVOiaMf8hDKqtcqOsdRf n3b1tUBpEFjXH3wn86zs8D5Ydi4I9i99AvDXHvygdyjMLerrd5mUlJvxr2kaUMel4fNw UyaiRwx6VPj2NijwhdMMkegBzTAS8zR+RwKAU+Kyou9vbQB3uaqz0oCwWdN1/hV8nyKk XJpoCOivS3xfcwPc91HgQkr8MT8FL1Hl/QlI3ZvD2bGaBL0sFdTPvV1T1fh1ToZ94Me+ 0eWQ== 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=DNfH6VgJImyhjN5cFuQ9f/4zrQZIl/fPvTV8Bs4/88Y=; b=czOCPXcSIfjB5nQGsfPF+8vKiT7ojXXsAycflP2uB3/Oviz0fKrbBPOlBw7tCtpqyM WDji/QWOS0aK9AIL+GReDc4n7pHtS2xf2NixAO6Sb9RdDl9yK8yAxGcvjUDYXn8aUStO iWlogDjuKTwZKLlKyvMZCx+DdAUlaafpbFtnPxGZboKvCWL+a0xMlPyuVnAxchzzFHAc NuqsfYbDEJ9ivDhv8UMTRw3L0abVeuUrJ8LTazPkJncaye+IGePz+Euyk3yowAg78Nb+ unO8lKDuCQxjXZfIeMgzZEvAUf0ODLK4hVmf39ng4bzHbjdkFk0LoQRzxPRDuk6bLnxK jCog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=POFKejF4; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=cJUhVLaw; 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 204-20020a6302d5000000b0044f07a986f4si15649550pgc.779.2022.10.11.22.05.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 22:05:40 -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=POFKejF4; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=cJUhVLaw; 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=DNfH6VgJImyhjN5cFuQ9f/4zrQZIl/fPvTV8Bs4/88Y=; b=POFKejF4KsYo9H BaoHBP6Lqok4T6LVtKitqKpl5NKW0ZzNOi846xHnuM6qahaDUkcrEREVNA9F+lnQfDBWpazZEZSxd DFrChcNhN8Z4k9kplZ8mOGySU9TipjiERoKiGuF6f5E/vCRQcvchTCAOznfT4p629R86rImingkLt zMUC6VcAuut15G6Cp9j4qdVi1KoqOSKSOlm0hQDQ/QuzO9LSxoMJ42kVze7Y+nZh7+mfepJFZStAA 07W37Tq55Xb93KM6mis6F8SxdKioMcgYlYvzuYWQM04f5WXzk+ARpXm4wsZogpbX3t6romgsC8zuF QQct3B18y5Um+2NgE5mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiTvO-006qf0-1e; Wed, 12 Oct 2022 05:04:58 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oiTvJ-006qdi-PZ; Wed, 12 Oct 2022 05:04:57 +0000 Received: by mail-ej1-x631.google.com with SMTP id d26so28498702eje.10; Tue, 11 Oct 2022 22:04:51 -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=b4gqOMlbs92RCL0Ysa0hqvx+eg7bHJri4dGP4mEDs80=; b=cJUhVLawvPYnZ9EBQKO2ZunzswCUf0WgRMNrdFYyJSDxGMvjCa/g8En72Mpfq9/NLJ 43+7hdQs2dYfAoY6UVpPNe6B88XhsXdl3+MfRmv63MbgMv9Db3CnfYdot3NItEt7QIgr jlRUbWsGVsFJqWySvdK7RsvxeCobwKrsOp79o+meRag767brfRUjYSGLPFA+Xk7JE2tv 4n8ZutrzXMjR4NPqoVVUSfBYaH/Iz7zHIgKQmKw+W0u7GO4HkuMDqTCwc7OlccFljX39 Ju2S0+fy9trH/lcATN8gznvLBX4eDkt4CmMU3taHDqxrgP9jmXJx0VmfC9p2FdJYSip6 9l0g== 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=b4gqOMlbs92RCL0Ysa0hqvx+eg7bHJri4dGP4mEDs80=; b=sqkRLjkxxLdgjLHtcCjZbPLshx7s9GJi9ecVxq8tJjFaq+tXcysJSnFV13PkV12OkJ oW/H16PufaQF3I3JH5I7lEVFTyVPolnGpy48T675HxEJNenJ8VyaLLkj+ARqe+A+VFDV CGCb5jJby08PGRIrI1TWkMPp54mV7CVwluNHC2I7Os2qAZIwUc1gsJu2sjGuPZwuCjMb NkWAcZs7ri951gk8cpn/bb5ELso3kJS+oD0cHD8cdK+aST3itv8gAKIij4gJ2PuNHtSH GlYQPb0kEPC3h8gO6XA6zTQPQLn8kWOUiLO/z+ratuYu9P3IKP2cj+/2EkSc6BaVJow9 n7GQ== X-Gm-Message-State: ACrzQf2xtsocWEL86I+l9cJItu4gZPZVWYv31rCerQmILxEmT9XTxjRX n/8A3MPS72itAorpK1xXv2I= X-Received: by 2002:a17:907:3d9f:b0:787:8706:6885 with SMTP id he31-20020a1709073d9f00b0078787066885mr21163698ejc.280.1665551090072; Tue, 11 Oct 2022 22:04:50 -0700 (PDT) Received: from localhost.lan ([194.187.74.233]) by smtp.gmail.com with ESMTPSA id e11-20020a170906314b00b0073ddb2eff27sm573916eje.167.2022.10.11.22.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 22:04:49 -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 V2 1/2] dt-bindings: mtd: partitions: add TP-Link SafeLoader layout Date: Wed, 12 Oct 2022 07:04:41 +0200 Message-Id: <20221012050442.6815-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_220453_857362_F4A6D905 X-CRM114-Status: GOOD ( 14.70 ) 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?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo2MzEgbGlzdGVkIGluXQ==?= =?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 name 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 --- V2: Fix typo in commit: s/same/name/ --- .../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>; + };