tools/hotplug: set mtu from bridge for tap interface

With changeset 22885 support was added for setting the MTU in the vif-bridge
script for when a vif interface was set to 'online'.  The was not done for the
'add' operation.  The 'add' operation was added to the script for when tap
devices were specified (c/s 21944). With the setting of the MTU for the
'online' case was there a reason for omitting the 'add'?

This patch sets the MTU for both 'online' and 'add' in the vif-bridge script.

Signed-off-by: Charles Arnold <carnold@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Constify device_tree_flattened

The Flat Device Tree is given by the bootloader. Xen doesn't need to modify it.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Prefix device tree macro by dt_

There is 2 macros: for_each_device_node and for_each_property_of_node
with a too generic name.

Also replace all call-site with the new function names.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Don't add a fake property "name" in the device tree

On new Flat Device Tree version, the property "name" may not exist.
The property is never used in Xen code except to set the field "name" of
dt_device_node.

For convenience, remove the fake property. It will save space during the
creation of the dom0 FDT.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Add new helpers to use the device tree

List of new helpers taken from linux (commit 74b9272):
    - dt_property_read_string
    - dt_match_node
    - dt_find_maching_node
    - dt_device_is_available
    - dt_prop_cmp

Other new helpers:
    - dt_set_cell
    - dt_for_each_child
    - dt_set_range
    - dt_cells_to_size
    - dt_next_cell
    - dt_get_range
    - dt_node_name_is_equal
    - dt_node_path_is_equal
    - dt_property_name_is_equal

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen: Use the right string comparison function in device tree

When of_node_cmp and of_compat_cmp was introduced in commit fb97eb6
"xen/arm: Create a hierarchical device tree", they were copied from the wrong
Linux header.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Remove device_get_reg call in process_cpu_node

The "reg" property is only composed of one uint32. device_get_reg can be
replaced by dt_read_number.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Check "reg" property length in process_multiboot_node

The device tree compiler (dtc) will only warn if the "reg" property doesn't
match #address-cells and #size-cells size. It won't update the different
property. Therefore, Xen needs to check if the size match both properties,
otherwise Xen can retrieve a wrong range.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: Check the CPU ID is not greater than NR_CPUS

On some board CPU IDs are not contiguous (for instance the Versatile Express
with big.LITTLE supports). If the CPU ID is greater than NR_CPUS Xen will hang
without any message. This is because console driver is not yet initialized and
hypervisor data abort uses printk.

For the moment check the CPU ID and print an warning if an error occured.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/video: hdlcd: Convert the driver to the new device tree API

Avoid to use FDT API which will be removed soon

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian campbell <ian.campbell@citrix.com>
xen/video: hdlcd: Use early_printk instead of printk

The video driver is initialized before the console is correctly set up.
Therefore, printk will never output if there is no serial configured.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Use dt_device_match to avoid multiple if conditions

There is some place in Xen ARM code where multiple if conditions is used
check the presence of a node or find a node.
These pieces of code can be replace by an array and using proper device tree
helpers.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/dts: dt_find_interrupt_controller: accept multiple compatible strings

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Build DOM0 FDT by browsing the device tree structure

Remove the usage of the FDT in benefit of the device tree structure.
The latter is easier to use and can embedded meta-data for Xen (ie: is the
device is used by Xen...).

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Don't map disabled device in DOM0

Linux should cope with 'status = "disabled"' in the Device Tree.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Create a fake PSCI node in dom0 device tree

Xen uses PSCI to bring up secondary cpus for the guest.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Create a fake cpus node in dom0 device tree

The number of cpus in dom0 can be different compare to the real number of
physical cpus.

For the moment, Xen assumes that the cpus are identical.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Create a fake GIC node in dom0 device tree

Recreate the GIC node and remove hypervisor specific ranges (vgic and hypervisor
controls).

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Create a fake timer node in dom0 device tree

Recreate the timer node and remove hypervisor specific interrupt.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Add new platform specific callback device_is_blacklist

Each platform code will list the device that must not pass-through to a guest.
Theses devices are used for: power management, timer,...

When theses devices are given to DOM0, it can controls the hardware and then
break the whole platform.

This callback is enough until we will start to care about power performance.
For this purpose, we may need to extend this interface to implement per-device
MMIO filtering to allow dom0 to continue to control devices which it owns which
happen to share e.g. a clock controller with Xen.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>