aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/device_tree.h
Commit message (Collapse)AuthorAgeFilesLines
* xen: arm: add two new device tree helpersIan Campbell2013-09-271-0/+17
| | | | | | | | - dt_property_read_u64 - dt_find_node_by_type Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen/arm: Reserve FDT via early module mechanismIan Campbell2013-09-261-6/+7
| | | | | | | | | | This will stop us putting any heaps or relocating Xen itself over the FDT. The devicetree will be copied to allocated memory in setup_mm and the original copy will be freed by discard_initial_modules. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
* xen/dts: Clean up the exported API for device treeJulien Grall2013-09-171-15/+0
| | | | | | | | | | | All Xen code has been converted to the new device tree API that uses a tree structure to describe the DTS. The Flat Device tree is still used by Xen during early boot stage, but only in internal. Remove entirely unneeded functions or move to a static function. 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 stringsJulien Grall2013-09-171-1/+2
| | | | | 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 treeJulien Grall2013-09-171-2/+2
| | | | | | | | | 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: Add new helpers to use the device treeJulien Grall2013-09-171-1/+150
| | | | | | | | | | | | | | | | | | | | | | | 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/dts: Prefix device tree macro by dt_Julien Grall2013-09-171-2/+2
| | | | | | | | | | 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: Constify device_tree_flattenedJulien Grall2013-09-171-1/+1
| | | | | | | 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: fix DT_ROOT_NODE_ADDR_CELLS_DEFAULTJulien Grall2013-09-091-1/+1
| | | | | | | | | | | | The commit dbd1243 "xen/arm: Add helpers to use the device tree" introduced DT_ROOT_NODE_ADDR_CELLS_DEFAULT with is used for default value when bad copy from Linux code. The ePAR (section 2.3.5) says: "If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells." Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: use defines for boot module indexes instead of open coded numbersIan Campbell2013-08-271-2/+8
| | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Julien Grall <julien.grall@linaro.org>
* xen: Introduce a helper to read a u32 property in device tree.Chen Baozi2013-08-221-0/+11
| | | | | Signed-off-by: Chen Baozi <baozich@gmail.com> Acked-by: Julien Grall <julien.grall@linaro.org>
* xen/arm: Use hierarchical device tree to retrieve GIC informationJulien Grall2013-05-131-8/+0
| | | | | | | | - Remove early parsing for GIC addresses - Remove hard coded maintenance IRQ number Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Add helpers to retrieve an interrupt description from the device treeJulien Grall2013-05-131-0/+130
| | | | | Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Add helpers to retrieve an address from the device treeJulien Grall2013-05-131-0/+22
| | | | | Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Add helpers to use the device treeJulien Grall2013-05-131-16/+139
| | | | | Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: Create a hierarchical device treeJulien Grall2013-05-131-0/+89
| | | | | | | | | Add function to parse the device tree and create a hierarchical tree. This code is based on drivers/of/base.c in linux source. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* dtb: correct handling of #address-cells and #size-cells.Ian Campbell2013-03-131-1/+2
| | | | | | | | If a node does not have #*-cells then the parent's value should be used. Currently we were asssuming zero which is useless. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xen/device_tree: introduce find_compatible_nodeStefano Stabellini2013-02-151-0/+3
| | | | | | | | | | | | | | | | | Introduce a find_compatible_node function that can be used by device drivers to find the node corresponding to their device in the device tree. Initialize device_tree_flattened early in start_xen, so that it is available before setup_mm. Get rid of fdt in the process. Also add device_tree_node_compatible to device_tree.h, that is currently missing. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc - s/atag_paddr/fdt_paddr ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: introduce concept of modules which can be in RAM at start of dayIan Campbell2013-01-211-0/+14
| | | | | | | | | | | | | The intention is that these will eventually be filled in with information from the bootloader, perhaps via a DTB binding. Allow for 2 modules (kernel and initrd), plus a third pseudo-module which is the hypervisor itself. Currently we neither parse nor do anything with them. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: get GIC addresses from DTStefano Stabellini2012-12-131-0/+8
| | | | | | | | | | | | | | Get the address of the GIC distributor, cpu, virtual and virtual cpu interfaces registers from device tree. Note: I couldn't completely get rid of GIC_BASE_ADDRESS, GIC_DR_OFFSET and friends because we are using them from mode_switch.S, that is executed before device tree has been parsed. But at least mode_switch.S is known to contain vexpress specific code anyway. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: move get_paddr_function to arch setup.c from device_tree.cIan Campbell2012-10-111-1/+0
| | | | | | | | | | | | It's not realy got any DT functionality in it and its only caller is setup_pagetables. Put it here because future patches want to incorporate of the module layout in memory and I'd like to confine that to setup.c Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: use bootargs for the command lineDavid Vrabel2012-04-021-0/+1
| | | | | | | | | Use the /chosen node's bootargs parameter for the Xen command line. Parse it early on before the serial console is setup. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* device tree,arm: supply a flat device tree to dom0David Vrabel2012-04-021-0/+8
| | | | | | | | | | | | | | | | | | | Build a flat device tree for dom0 based on the one supplied to Xen. The following changes are made: * In the /chosen node, the xen,dom0-bootargs parameter is renamed to bootargs. * In all memory nodes, the reg parameters are adjusted to reflect the amount of memory dom0 can use. The p2m is updated using this info. Support for passing ATAGS to dom0 is removed. Signed-off-by: David Vrabel <david.vrabel@citrix.com> [ removed device_tree_dump call -- ijc ] Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* device tree: add device_tree_dump() to print a flat device treeDavid Vrabel2012-03-221-0/+1
| | | | | | | | | | | | | Add a device_tree_dump() function which prints to main structure and properties names of a flat device tree (but not the properties values yet). This will be useful for debugging problems with the device tree generated for dom0. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* device tree: add device_tree_for_each_node()David Vrabel2012-03-221-0/+8
| | | | | | | | Add device_tree_for_each_node() to iterate over all nodes in a flat device tree. Use this in device_tree_early_init(). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm: setup MM using information from the device treeDavid Vrabel2012-02-131-1/+2
| | | | | | | | | | | Setup memory management, heaps etc. using the location and size of the first memory bank given in the device tree. The DTB is also copied so it can be used afterwards. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* arm, device tree: parse the DTB for RAM location and sizeDavid Vrabel2012-02-131-0/+36
Prior to setting up the page tables, parse the DTB for the location and size of RAM. Use this information to get the physical address to relocate Xen to in setup_pagetables(). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>