162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/mtd/partitions/tplink,safeloader-partitions.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: TP-Link SafeLoader partitions
862306a36Sopenharmony_ci
962306a36Sopenharmony_cidescription: |
1062306a36Sopenharmony_ci  TP-Link home routers store various data on flash (e.g. bootloader,
1162306a36Sopenharmony_ci  flash layout, firmware, product info, configuration, calibration
1262306a36Sopenharmony_ci  data). That requires flash partitioning.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci  Flash space layout of TP-Link devices is stored on flash itself using
1562306a36Sopenharmony_ci  a custom ASCII-based format. That format was first found in TP-Link
1662306a36Sopenharmony_ci  devices with a custom SafeLoader bootloader. Later it was adapted to
1762306a36Sopenharmony_ci  CFE and U-Boot bootloaders.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci  Partitions specified in partitions table cover whole flash space. Some
2062306a36Sopenharmony_ci  contain static data that shouldn't get modified (device's MAC or WiFi
2162306a36Sopenharmony_ci  calibration data). Others are semi-static (like kernel). Finally some
2262306a36Sopenharmony_ci  partitions contain fully changeable content (like rootfs).
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci  This binding describes partitioning method and defines offset of ASCII
2562306a36Sopenharmony_ci  based partitions table. That offset is picked at manufacturing process
2662306a36Sopenharmony_ci  and doesn't change.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_cimaintainers:
2962306a36Sopenharmony_ci  - Rafał Miłecki <rafal@milecki.pl>
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciproperties:
3262306a36Sopenharmony_ci  compatible:
3362306a36Sopenharmony_ci    const: tplink,safeloader-partitions
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci  partitions-table-offset:
3662306a36Sopenharmony_ci    description: Flash offset of partitions table
3762306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_cipatternProperties:
4062306a36Sopenharmony_ci  "^partition-.*$":
4162306a36Sopenharmony_ci    $ref: partition.yaml#
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_cirequired:
4462306a36Sopenharmony_ci  - partitions-table-offset
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ciadditionalProperties: false
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ciexamples:
4962306a36Sopenharmony_ci  - |
5062306a36Sopenharmony_ci    partitions {
5162306a36Sopenharmony_ci        compatible = "tplink,safeloader-partitions";
5262306a36Sopenharmony_ci        partitions-table-offset = <0x100000>;
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci        partition-file-system {
5562306a36Sopenharmony_ci                linux,rootfs;
5662306a36Sopenharmony_ci        };
5762306a36Sopenharmony_ci    };
58