From patchwork Sat Oct 15 09:29:49 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: 615226 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp803058pvb; Sat, 15 Oct 2022 02:30:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Y5Mc8VCG1AW8KxfUSGMqEnK9SflaXG6nVRVethWTI9aCdF5rwgEoAcoTy6tLY4DBM4Ase X-Received: by 2002:a17:903:41c3:b0:17f:8def:dc92 with SMTP id u3-20020a17090341c300b0017f8defdc92mr2037458ple.7.1665826241327; Sat, 15 Oct 2022 02:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665826241; cv=none; d=google.com; s=arc-20160816; b=jogM7XaA2gDJx+dCyuiTb44GwftmVwTv/M73KJJ+YSgDel6BmrZHIN/QQ1tbpZv0oh bp89qyyCrYlb4IqkrlsWELk98/YutkyGd0cChXEbEa8wfFztcxcVONYNHHpsr/YGBnps 4KjsvcdNtGnKN0h2zO6hajn5js/GdNX8xoLAoL2Lv53aLJrFDKRLQ/iYKKB8PxSBopYD Erk/jyexzbr8Kf1ZEyorZnsMnRxKcuUvILHNiU0zstkUENeMzpkZ5PJ0759t1G/xATkd L64aNcwCu/kWY+RfR79CExLcWp/rzEmGOfsQ1/20HGEnfLtq0VmmFLuE/pPPCdBJvFcZ nKcw== 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=nqEDSFFBsLS/xsdy5cOHWl6DWp53sRb4D2iaPJy380Y=; b=ozJntcWVIIycr+ax/15zC9ChzGCOpLVriZld7y+pV/h/dCA2kparGW3XQkOwmezTcJ kcc4y8lAYgsDsEJlT5mX/QTg1WhqfamDPzrRRVD0Y6uM4C+9LnQYzeYcZa3FOWno4PTU 1Rz88zxSN8hTa/HK9zFlpZGrrIHaDtjVbNndLhWxf7G5uCubW6K1iGLxrPcyMRw9d/MT mVLWGnBvNXnN5R+h/zRbkKrVKr1qThRQnNegdildFew69KBsWYMi5M6aDyoA1rY1ghF4 wisGHpk53gIrSEK/tYrOutViRqagNPs7v6safqWSahcVnB5KU88SxLYfOg+sXu2K3xvW Ha4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=jIxoSuqM; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ScPcjlSc; 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 b1-20020a056a000a8100b0052ee88f59c4si5952175pfl.372.2022.10.15.02.30.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 02:30:41 -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=jIxoSuqM; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=ScPcjlSc; 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=nqEDSFFBsLS/xsdy5cOHWl6DWp53sRb4D2iaPJy380Y=; b=jIxoSuqMEAcbER XWD11WU4dYiLSPKVObajha5xuueaEpjn160004kIGupNX5u5YmT+MXjsHXgTaFzJWBKw7eI9xzx8o DtQ5908wDMhLLPE/H5MgN/eN6Hsf9/fmUZmhqeK7tNyzwDgLZ1PoiLtKfgo24FC0Z1/osmWWk9d2a g0ezqYC+cM+x9F1InW6w1FKfmoxI9+choKpiSr/FVb8GuwMryKchlhW+N0XYJM3lmnDawllCwEt4F YSWaFsapYeFmJq6PzrcY4+iVDaS2n6SoXu3cxyWHmbBmJiNQO9wWnK7hLw0+wUDzsroppwLKFnz90 Fdzo3CBGkoVESGBs4GPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojdUV-00Ghc1-JX; Sat, 15 Oct 2022 09:29:59 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojdUT-00GhbV-27; Sat, 15 Oct 2022 09:29:58 +0000 Received: by mail-ed1-x52b.google.com with SMTP id l22so9769565edj.5; Sat, 15 Oct 2022 02:29:56 -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=YdzYzQPczOob4IO3pFuC56rrjAxpW/32RTAW6DZMbmw=; b=ScPcjlScG/12Dzm1gMutsJyhlbXrRHcQe5LoFTVzEPNAlIgbKfw9jTLOOJjsoXYvxt cPdraLACd90IvK/7cIXd1ehw6DDI9lqLttV27FM/coh5tUDubXuvdft3QygshnghsPJk NVmk56mAzQr5l4+f58oxFwggXQ0xeRI0Bo72u9UZqNjJ4J+ClZWT6t1SW89xKXm8wiLm IatFqAJvlBq2UiVl0pBZwvdJ9h7m0Xlgs7YYIlbKPlrv36WyK1uHFO06fRt0pl94zZ8Y AxtdlX0heYM5nbTOQvRzd0Z8PcDYY+LZCwtuPz7wGwiwJUw3xmc4tWQM8tPLCaXApzkQ nEAQ== 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=YdzYzQPczOob4IO3pFuC56rrjAxpW/32RTAW6DZMbmw=; b=Mn1epLEDpogz2bUgrFvTENb4wgByhekxb5h4b4HALa1k7TY4nnzgDhAI3lt5+u9GPn nDB8a5GNEb2mhj5xFL+F/FJKq1adxRhQAlM7II5UBJR37Y+3Uw2VNKrVrdN9T0jaCRp0 AZY+UDUvxVAtZzyHZP4kLHhDM4Ywy1mugtPTIicGZruktWg8iJy35kwXj9+3lkc6NXhX aiMcqze2xsv7O/LTZpmX2KY/ALe24r0kwPSqdXlvFRU4RWi/6MnpL/gKBoyxNKqoa34T k30gzknAp6grp/jenc6rg0+hiDznkW2gbqc5sHpWCsGk2frOS0kty15vIKFe33rB7Xr+ A1AA== X-Gm-Message-State: ACrzQf2lNK4lS2Ez8dpZuyZcjLhqJPcavOWhX2KckhqUu7+AORbtMx7I B8IT3bsOS2t3pUk0WDaiVOQ= X-Received: by 2002:aa7:c40b:0:b0:45d:4492:a8cb with SMTP id j11-20020aa7c40b000000b0045d4492a8cbmr1575750edq.217.1665826195174; Sat, 15 Oct 2022 02:29:55 -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 v5-20020a1709060b4500b0073d6093ac93sm2919033ejg.16.2022.10.15.02.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 02:29:54 -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 V3 1/2] dt-bindings: mtd: partitions: add TP-Link SafeLoader layout Date: Sat, 15 Oct 2022 11:29:49 +0200 Message-Id: <20221015092950.27467-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-20221015_022957_145407_7C1B93EE X-CRM114-Status: GOOD ( 15.07 ) 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?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MmIgbGlzdGVkIGluXQ==?= =?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 Reviewed-by: Rob Herring --- V2: Fix typo in commit: s/same/name/ V3: Drop quotes from $ref Describe flash space coverage & partitions types in the binding See commit body of PATCH 2/2 for real life example --- .../tplink,safeloader-partitions.yaml | 49 +++++++++++++++++++ 1 file changed, 49 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..63e596aa0ca3 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/tplink,safeloader-partitions.yaml @@ -0,0 +1,49 @@ +# 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. + + Partitions specified in partitions table cover whole flash space. Some + contain static data that shouldn't get modified (device's MAC or WiFi + calibration data). Others are semi-static (like kernel). Finally some + partitions contain fully changeable content (like rootfs). + + 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>; + };