xref: /freebsd/sys/contrib/device-tree/Bindings/mtd/partitions/tplink,safeloader-partitions.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1*8bab661aSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*8bab661aSEmmanuel Vadot%YAML 1.2
3*8bab661aSEmmanuel Vadot---
4*8bab661aSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/partitions/tplink,safeloader-partitions.yaml#
5*8bab661aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*8bab661aSEmmanuel Vadot
7*8bab661aSEmmanuel Vadottitle: TP-Link SafeLoader partitions
8*8bab661aSEmmanuel Vadot
9*8bab661aSEmmanuel Vadotdescription: |
10*8bab661aSEmmanuel Vadot  TP-Link home routers store various data on flash (e.g. bootloader,
11*8bab661aSEmmanuel Vadot  flash layout, firmware, product info, configuration, calibration
12*8bab661aSEmmanuel Vadot  data). That requires flash partitioning.
13*8bab661aSEmmanuel Vadot
14*8bab661aSEmmanuel Vadot  Flash space layout of TP-Link devices is stored on flash itself using
15*8bab661aSEmmanuel Vadot  a custom ASCII-based format. That format was first found in TP-Link
16*8bab661aSEmmanuel Vadot  devices with a custom SafeLoader bootloader. Later it was adapted to
17*8bab661aSEmmanuel Vadot  CFE and U-Boot bootloaders.
18*8bab661aSEmmanuel Vadot
19*8bab661aSEmmanuel Vadot  Partitions specified in partitions table cover whole flash space. Some
20*8bab661aSEmmanuel Vadot  contain static data that shouldn't get modified (device's MAC or WiFi
21*8bab661aSEmmanuel Vadot  calibration data). Others are semi-static (like kernel). Finally some
22*8bab661aSEmmanuel Vadot  partitions contain fully changeable content (like rootfs).
23*8bab661aSEmmanuel Vadot
24*8bab661aSEmmanuel Vadot  This binding describes partitioning method and defines offset of ASCII
25*8bab661aSEmmanuel Vadot  based partitions table. That offset is picked at manufacturing process
26*8bab661aSEmmanuel Vadot  and doesn't change.
27*8bab661aSEmmanuel Vadot
28*8bab661aSEmmanuel Vadotmaintainers:
29*8bab661aSEmmanuel Vadot  - Rafał Miłecki <rafal@milecki.pl>
30*8bab661aSEmmanuel Vadot
31*8bab661aSEmmanuel Vadotproperties:
32*8bab661aSEmmanuel Vadot  compatible:
33*8bab661aSEmmanuel Vadot    const: tplink,safeloader-partitions
34*8bab661aSEmmanuel Vadot
35*8bab661aSEmmanuel Vadot  partitions-table-offset:
36*8bab661aSEmmanuel Vadot    description: Flash offset of partitions table
37*8bab661aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
38*8bab661aSEmmanuel Vadot
39*8bab661aSEmmanuel VadotpatternProperties:
40*8bab661aSEmmanuel Vadot  "^partition-.*$":
41*8bab661aSEmmanuel Vadot    $ref: partition.yaml#
42*8bab661aSEmmanuel Vadot
43*8bab661aSEmmanuel Vadotrequired:
44*8bab661aSEmmanuel Vadot  - partitions-table-offset
45*8bab661aSEmmanuel Vadot
46*8bab661aSEmmanuel VadotadditionalProperties: false
47*8bab661aSEmmanuel Vadot
48*8bab661aSEmmanuel Vadotexamples:
49*8bab661aSEmmanuel Vadot  - |
50*8bab661aSEmmanuel Vadot    partitions {
51*8bab661aSEmmanuel Vadot        compatible = "tplink,safeloader-partitions";
52*8bab661aSEmmanuel Vadot        partitions-table-offset = <0x100000>;
53*8bab661aSEmmanuel Vadot
54*8bab661aSEmmanuel Vadot        partition-file-system {
55*8bab661aSEmmanuel Vadot                linux,rootfs;
56*8bab661aSEmmanuel Vadot        };
57*8bab661aSEmmanuel Vadot    };
58