linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 1/2] dt-bindings: mtd: partitions: add TP-Link SafeLoader layout
@ 2022-10-15  9:29 Rafał Miłecki
  2022-10-15  9:29 ` [PATCH V3 2/2] mtd: parsers: add TP-Link SafeLoader partitions table parser Rafał Miłecki
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rafał Miłecki @ 2022-10-15  9:29 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski
  Cc: linux-mtd, devicetree, Florian Fainelli, Hauke Mehrtens,
	bcm-kernel-feedback-list, John Crispin,
	Arınç ÜNAL, Sergio Paracuellos, linux-arm-kernel,
	linux-mips, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

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 <rafal@milecki.pl>
---
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 <rafal@milecki.pl>
+
+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>;
+    };
-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-18  9:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-15  9:29 [PATCH V3 1/2] dt-bindings: mtd: partitions: add TP-Link SafeLoader layout Rafał Miłecki
2022-10-15  9:29 ` [PATCH V3 2/2] mtd: parsers: add TP-Link SafeLoader partitions table parser Rafał Miłecki
2022-10-18  9:55   ` Miquel Raynal
2022-10-17 18:32 ` [PATCH V3 1/2] dt-bindings: mtd: partitions: add TP-Link SafeLoader layout Rob Herring
2022-10-18  9:56 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).