Update documentation for Generic Firmware loader to YAML schema, generalize it from FS specific and add new property and example for FIP loader.
Also add details on the usage of 'phandlepart', 'mtdpart' and 'ubivol' property. Signed-off-by: Christian Marangi <[email protected]> Reviewed-by: Simon Glass <[email protected]> --- doc/device-tree-bindings/misc/fs_loader.txt | 48 -------- doc/device-tree-bindings/misc/fw_loader.yaml | 112 +++++++++++++++++++ 2 files changed, 112 insertions(+), 48 deletions(-) delete mode 100644 doc/device-tree-bindings/misc/fs_loader.txt create mode 100644 doc/device-tree-bindings/misc/fw_loader.yaml diff --git a/doc/device-tree-bindings/misc/fs_loader.txt b/doc/device-tree-bindings/misc/fs_loader.txt deleted file mode 100644 index 542be4b25a0a..000000000000 --- a/doc/device-tree-bindings/misc/fs_loader.txt +++ /dev/null @@ -1,48 +0,0 @@ -* File system firmware loader - -Required properties: --------------------- - -- compatible: should contain "u-boot,fs-loader" -- phandlepart: which block storage device and partition the image loading from, - this property is required for mmc, usb and sata. This is unsigned - 32-bit array. For example phandlepart=<&mmc_0 1>, meaning use - that MMC0 node pointer, partition 1. -- mdtpart: which partition of ubi the image loading from, this property is - required for ubi and mounting. -- ubivol: which volume of ubi the image loading from, this property is required - for ubi and mounting. - -Example of storage device and partition search set for mmc, usb, sata and -ubi in device tree source as shown in below: - - Example of storage type and device partition search set for mmc, usb, - sata and ubi as shown in below: - Example for mmc: - fs_loader0: fs-loader@0 { - bootph-all; - compatible = "u-boot,fs-loader"; - phandlepart = <&mmc_0 1>; - }; - - Example for usb: - fs_loader1: fs-loader@1 { - bootph-all; - compatible = "u-boot,fs-loader"; - phandlepart = <&usb0 1>; - }; - - Example for sata: - fs_loader2: fs-loader@2 { - bootph-all; - compatible = "u-boot,fs-loader"; - phandlepart = <&sata0 1>; - }; - - Example for ubi: - fs_loader3: fs-loader@3 { - bootph-all; - compatible = "u-boot,fs-loader"; - mtdpart = "UBI", - ubivol = "ubi0"; - }; diff --git a/doc/device-tree-bindings/misc/fw_loader.yaml b/doc/device-tree-bindings/misc/fw_loader.yaml new file mode 100644 index 000000000000..9a767ff57469 --- /dev/null +++ b/doc/device-tree-bindings/misc/fw_loader.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: GPL-2.0+ +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/misc/fw_loader.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: U-Boot Generic Firmware Loader + +maintainers: + - Christian Marangi <[email protected]> + +description: | + Generic firmware loader for loading images from block storage devices + (MMC, USB, SATA) and UBI storage. + + The fs-loader loads firmware images, while the fip-loader locates a + Firmware Image Package (FIP), optionally at a specified byte offset + within the selected partition. + +properties: + compatible: + enum: + - u-boot,fs-loader + - u-boot,fip-loader + + phandlepart: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + Specifies the block storage device and partition from which the + image is loaded. Required for MMC, USB, and SATA devices. + + The first cell is a phandle to the storage device, and the second + cell is the partition number. + + mtdpart: + $ref: /schemas/types.yaml#/definitions/string + description: | + Specifies the MTD partition from which the image is loaded. + Required for UBI devices. + + ubivol: + $ref: /schemas/types.yaml#/definitions/string + description: | + Specifies the UBI volume from which the image is loaded. + Required when loading from a UBI device. + + partoffset: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Byte offset within the selected partition where the FIP header + is located. + +required: + - compatible + +oneOf: + - required: + - phandlepart + + properties: + mtdpart: false + ubivol: false + + - required: + - mtdpart + - ubivol + + properties: + phandlepart: false + +allOf: + - if: + properties: + compatible: + const: u-boot,fs-loader + then: + properties: + partoffset: false + +additionalProperties: false + +examples: + - | + fw_loader0: fs-loader@0 { + bootph-all; + compatible = "u-boot,fs-loader"; + phandlepart = <&mmc_0 1>; + }; + + - | + fw_loader3: fs-loader@3 { + bootph-all; + compatible = "u-boot,fs-loader"; + mtdpart = "UBI"; + ubivol = "ubi0"; + }; + + - | + fw_loader4: fip-loader@4 { + bootph-all; + compatible = "u-boot,fip-loader"; + phandlepart = <&mmc0 0>; + partoffset = <0x100>; + }; + + - | + fw_loader5: fip-loader@5 { + bootph-all; + compatible = "u-boot,fip-loader"; + mtdpart = "ubi"; + ubivol = "bl31"; + }; -- 2.55.0
