of: Transactional DT support.

Introducing DT transactional support.

A DT transaction is a method which allows one to apply changes
in the live tree, in such a way that either the full set of changes
take effect, or the state of the tree can be rolled-back to the
state it was before it was attempted. An applied transaction
can be rolled-back at any time.

If any transaction results in the change of a state of a device
node, a notifier for that node will be fired which allows a bus
to create/destroy devices as directed.

Documentation is in
	Documentation/devicetree/transactions.txt

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: Introduce Device Tree resolve support.

Introduce support for dynamic device tree resolution.
Using it, it is possible to prepare a device tree that's
been loaded on runtime to be modified and inserted at the kernel
live tree.

Export of of_resolve and bug fix of double free by
	Guenter Roeck <groeck@juniper.net>

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: Introduce DT overlay support.

Introduce DT overlay support.

Makes it possible to dynamically overlay a part of the kernel's
tree with another tree that's been dynamically loaded.
Removal of nodes and properties is also possible.

The hard part of applying and reverting the overlay is done
using transactions.

Documentation about internal and APIs is provided in
	Documentation/devicetree/overlay-notes.txt

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: selftest: Add overlay self-test support.

This patch adds overlay tests to the OF selftest.

It tests overlay device addition/removal and whether
the apply revert sequence is correct.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: DT-Overlay configfs interface

Add a runtime interface to using configfs for generic device tree overlay
usage.

A device-tree configfs entry is created in /config/device-tree/overlays

* To create an overlay you mkdir the directory:

	# mkdir /config/device-tree/overlays/foo

* Either you echo the overlay firmware file to the path property file.

	# echo foo.dtbo >/config/device-tree/overlays/foo/path

* Or you cat the contents of the overlay to the dtbo file

	# cat foo.dtbo >/config/device-tree/overlays/foo/dtbo

The overlay file will be applied.

To remove it simply rmdir the directory.

	# rmdir /config/device-tree/overlays/foo

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: platform: Add OF notifier handler

Add OF notifier handler needed for creating/destroying platform devices
according to dynamic runtime changes in the DT live tree.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
of: i2c: Export single device registration method

Dynamically inserting i2c client device nodes requires the use
of a single device registration method. Rework and export it.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: i2c: Add OF notifier handler

Add OF notifier handler needed for creating/destroying i2c devices
according to dynamic runtime changes in the DT live tree.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
of: spi: Export single device registration method and accessors

Dynamically inserting spi device nodes requires the use of a single
device registration method. Rework and export it.

Methods to lookup a device/master using a device node are added
as well, of_find_spi_master_by_node() & of_find_spi_device_by_node().

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
OF: spi: Add OF notifier handler

Add OF notifier handler needed for creating/destroying spi devices
according to dynamic runtime changes in the DT live tree.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
gitignore: Ignore DTB files

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
add PM firmware

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
ARM: CUSTOM: Build a uImage with dtb already appended

Do not commit to mainline; this is a useful hack only for now.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
pdev: Fix platform device resource linking

Platform device removal uncovered a number of problems with
the way resources are handled in the core platform code.

Resources now form child/parent linkages and this requires
proper linking of the resources. On top of that the OF core
directly creates it's own platform devices. Simplify things
by providing helper functions that manage the linking properly.

Two functions are provided:

platform_device_link_resources(), which links all the
linkable resources (if not already linked).

and platform_device_unlink_resources(), which unlinks all the
resources.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
of: Link platform device resources properly.

The resources of the platform devices created by the OF core were
not properly linked. Make sure that they are, so that we don't get
any crashes when trying to remove the device.

This commit is based on the previous commit of
"pdev: Fix platform device resource linking"

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
omap: Properly handle resources for omap_devices

omap_device relies on the platform notifier callbacks managing resources
behind the scenes. The resources were not properly linked causing crashes
when removing the device.

Rework the resource modification code so that linking is performed properly,
and make sure that no resources that have no parent (which can happen for DMA
& IRQ resources) are ever left for cleanup by the core resource layer.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
arm: omap: Proper cleanups for omap_device

Removing any omap device always resulted in a crash; turns out
BUS_NOTIFY_DEL_DEVICE is not the last notifier event sent in the
course of removing the device, the correct event is
BUS_NOTIFY_UNBOUND_DRIVER, which still is not the right place to
perform the cleanup.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
tty: omap-serial: Fix up platform data alloc

When using DT the driver devm_kalloc's platform data and assigns them
directly to the pdev->dev.platform variable.

This is wrong since device de-registration expects the data to be
kmalloc'ed instead, resulting in a crash.

Fix by copying the platform data to a kmalloc buffer.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
dts: boneblack: Add DT selftests
boneblack defconfig