[PATCH 2/2] ubi: open volumes define in device tree
Ezequiel Garcia
ezequiel at vanguardiasur.com.ar
Fri Jun 24 11:45:45 PDT 2016
On 18 June 2016 at 16:17, Hauke Mehrtens <hauke at hauke-m.de> wrote:
> This makes it possible to define a volume to open in device tree. This
> is helpful when a root file system is on a ubi layer. Without this
> patch it is only possible to device with with kernel command line
> parameters.
>
> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
> Documentation/devicetree/bindings/mtd/ubi.txt | 22 +++++++++++++++++
> drivers/mtd/ubi/build.c | 34 +++++++++++++++++++++++++++
> 2 files changed, 56 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mtd/ubi.txt b/Documentation/devicetree/bindings/mtd/ubi.txt
> index 5fcd47e..f87a7d8 100644
> --- a/Documentation/devicetree/bindings/mtd/ubi.txt
> +++ b/Documentation/devicetree/bindings/mtd/ubi.txt
> @@ -13,6 +13,16 @@ Describe of a UBI layer in device tree.
> which have to be assigned to the newly created UBI
> device (assigned automatically by default)
>
> +Partitions on a UBI layer can be defined:
> +
> + - compatible: "ubi,volume"
> + - name: name of the ubi volume to open
> + - ubi-mode: mode of the ubi volume to open value:
> + UBI_READONLY: 1
> + UBI_READWRITE: 2
> + UBI_EXCLUSIVE: 3
> + UBI_METAONLY: 4
> +
> Example:
>
> partitions {
> @@ -29,5 +39,17 @@ partitions {
> label = "system_sw";
> reg = <0x1c0000 0xc800000>;
> compatible = "ubi,device";
> +
> + rootfsA at 0 {
> + compatible = "ubi,volume";
> + name = "rootfsA";
> + ubi-mode = <1>;
> + };
> +
> + data_vol at 0 {
> + compatible = "ubi,volume";
> + name = "data_vol";
> + ubi-mode = <2>;
> + };
> };
> };
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index 16baeb5..1c22533 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) International Business Machines Corp., 2006
> * Copyright (c) Nokia Corporation, 2007
> + * Copyright (c) 2016 Hauke Mehrtens <hauke at hauke-m.de>
> *
A tangential comment for this and other patches.
There's no need to add your copyright when you are submitting
small contributions.
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
More information about the linux-mtd
mailing list