u-boot/lib/libfdt
Pantelis Antoniou f00c36a01e fdt: Allow stacked overlays phandle references
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 = <&foo>;
			__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 = <&bar>;
			__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 = <0x00000001>;
                phandle = <0x00000001>;
                barnode {
                    overlay-2-property;
                    phandle = <0x00000002>;
                    linux,phandle = <0x00000002>;
                    bar-property;
                    baznode {
                        phandle = <0x00000003>;
                        linux,phandle = <0x00000003>;
                        baz-property;
                    };
                };
            };
            __symbols__ {
                baz = "/foonode/barnode/baznode";
                bar = "/foonode/barnode";
                foo = "/foonode";
            };
	};

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Simon Glass <sjg@chromium.org>
2017-09-15 05:27:48 -06:00
..
pylibfdt fdt: Sync libfdt up to upstream 2017-09-15 05:24:39 -06:00
fdt.c libfdt: Fix undefined behaviour in fdt_offset_ptr() 2016-10-13 13:54:10 -06:00
fdt.h fdt: Move header files into lib/libfdt 2017-06-02 10:16:46 -06:00
fdt_addresses.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_empty_tree.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_overlay.c fdt: Allow stacked overlays phandle references 2017-09-15 05:27:48 -06:00
fdt_region.c libfdt: Drop -FDT_ERR_TOODEEP 2017-07-10 08:39:24 -04:00
fdt_ro.c libfdt: fix fdt_stringlist_search() 2016-10-24 08:04:40 -04:00
fdt_rw.c fdt: Sync libfdt up to upstream 2017-09-15 05:24:39 -06:00
fdt_strerror.c fdt: Bring in changes from v1.4.4 2017-04-10 13:25:19 -06:00
fdt_sw.c lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
fdt_wip.c libfdt: Initialize the stack variable 2017-09-15 05:27:48 -06:00
libfdt.h fdt: Sync libfdt up to upstream 2017-09-15 05:24:39 -06:00
libfdt_internal.h fdt: Sync up with libfdt 2014-08-09 11:17:04 -04:00
Makefile libfdt: Add overlay application function 2016-08-20 11:35:04 -04:00
README lib/libfdt/: General aesthetic/style fixes. 2016-06-19 17:05:55 -06:00
test_libfdt.py dm: Add a more efficient libfdt library 2016-07-14 20:40:24 -06:00

The libfdt functionality was written by David Gibson.  The original
source came from the Git repository:

URL:		git://ozlabs.org/home/dgibson/git/libfdt.git

author		David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
committer	David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
commit		857f54e79f74429af20c2b5ecc00ee98af6a3b8b
tree		2f648f0f88225a51ded452968d28b4402df8ade0
parent		07a12a08005f3b5cd9337900a6551e450c07b515

To adapt for U-Boot usage, only the applicable files were copied and
imported into the U-Boot Git repository.

Omitted:

  * GPL - U-Boot comes with a copy of the GPL license
  * test subdirectory - not directly useful for U-Boot

After importing, other customizations were performed.  See the
"git log" for details.

Jerry Van Baren