17 Nov, 2017

1 commit

  • lib/libfdt/ and scripts/dtc/libfdt have the same copies for the
    followings 6 files:
    fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c
    fdt_sw.c

    Make them a wrapper of scripts/dtc/libfdt/*. This is exactly what
    Linux does to sync libfdt. In order to make is possible, import
    and from Linux 4.14-rc5.

    Unfortunately, U-Boot locally modified the following 3 files:
    fdt_ro.c fdt_wip.c fdt_rw.c

    The fdt_region.c is U-Boot own file.

    I did not touch them in order to avoid unpredictable impact.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

15 Sep, 2017

1 commit

  • This patch enables an overlay to refer to a previous overlay's
    labels by performing a merge of symbol information at application
    time.

    In a nutshell it allows an overlay to refer to a symbol that a previous
    overlay has defined. It requires both the base and all the overlays
    to be compiled with the -@ command line switch so that symbol
    information is included.

    base.dts
    --------

    /dts-v1/;
    / {
    foo: foonode {
    foo-property;
    };
    };

    $ dtc -@ -I dts -O dtb -o base.dtb base.dts

    bar.dts
    -------

    /dts-v1/;
    /plugin/;
    / {
    fragment@1 {
    target = ;
    __overlay__ {
    overlay-1-property;
    bar: barnode {
    bar-property;
    };
    };
    };
    };

    $ dtc -@ -I dts -O dtb -o bar.dtb bar.dts

    baz.dts
    -------

    /dts-v1/;
    /plugin/;
    / {
    fragment@1 {
    target = ;
    __overlay__ {
    overlay-2-property;
    baz: baznode {
    baz-property;
    };
    };
    };
    };

    $ dtc -@ -I dts -O dtb -o baz.dtb baz.dts

    Applying the overlays:

    $ fdtoverlay -i base.dtb -o target.dtb bar.dtb baz.dtb

    Dumping:

    $ fdtdump target.dtb
    / {
    foonode {
    overlay-1-property;
    foo-property;
    linux,phandle = ;
    phandle = ;
    barnode {
    overlay-2-property;
    phandle = ;
    linux,phandle = ;
    bar-property;
    baznode {
    phandle = ;
    linux,phandle = ;
    baz-property;
    };
    };
    };
    __symbols__ {
    baz = "/foonode/barnode/baznode";
    bar = "/foonode/barnode";
    foo = "/foonode";
    };
    };

    Signed-off-by: Pantelis Antoniou
    Signed-off-by: David Gibson
    Acked-by: Simon Glass

    Pantelis Antoniou
     

11 Apr, 2017

1 commit


14 Jan, 2017

1 commit

  • The fdt_overlay_apply() function purports to support the edge cases where
    an overlay has no fixups to be applied, or a base tree which has no
    symbols (the latter can only work if the former is also true). However it
    gets it wrong in a couple of small ways:

    * In the no fixups case, it doesn't fail immediately, but will attempt
    fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node
    offset, which will fail. Instead it should succeed immediately, since
    there's nothing to do.
    * In the case of no symbols, it again doesn't fail immediately. However
    if there is an actual fixup it will fail with an unexpected error,
    because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to
    look up the symbols. We should instead return -FDT_ERR_NOTFOUND
    directly.

    Both of these errors lead to the code returning misleading error codes in
    failing cases.

    [ DTC commit: 7d8ef6e1db9794f72805a0855f4f7f12fadd03d3 ]

    Signed-off-by: David Gibson
    Signed-off-by: Stefan Agner
    Acked-by: Simon Glass

    David Gibson
     

24 Oct, 2016

1 commit


14 Oct, 2016

1 commit


20 Aug, 2016

3 commits

  • This adds a bunch of unit tests for the "fdt apply" command.

    They've all been run successfully in the sandbox. However, as you still
    require an out-of-tree dtc with overlay support, this is disabled by
    default.

    Acked-by: Simon Glass
    Acked-by: Pantelis Antoniou
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • The device tree overlays are a good way to deal with user-modifyable
    boards or boards with some kind of an expansion mechanism where we can
    easily plug new board in (like the BBB or the raspberry pi).

    However, so far, the usual mechanism to deal with it was to have in Linux
    some driver detecting the expansion boards plugged in and then request
    these overlays using the firmware interface.

    That works in most cases, but in some cases, you might want to have the
    overlays applied before the userspace comes in. Either because the new
    board requires some kind of an early initialization, or because your root
    filesystem is accessed through that expansion board.

    The easiest solution in such a case is to simply have the component before
    Linux applying that overlay, removing all these drawbacks.

    Reviewed-by: Stefan Agner
    Acked-by: Pantelis Antoniou
    Acked-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • The device tree overlays are a good way to deal with user-modifyable
    boards or boards with some kind of an expansion mechanism where we can
    easily plug new board in (like the BBB, the Raspberry Pi or the CHIP).

    Add a new function to merge overlays with a base device tree.

    Signed-off-by: Maxime Ripard

    Maxime Ripard