summaryrefslogtreecommitdiffstats
path: root/drivers/of
Commit message (Collapse)AuthorAgeFilesLines
* Add missing dependency ENV_HANDLING for OF_BAREBOX_DRIVER optionDmitry Smagin2013-09-181-0/+1
| | | | | | | | | | This patch fixes linker error: barebox.c:(.text.environment_probe+0x48): undefined reference to `default_environment_path` Which appears when compiling env-less boards with enabled devicetree. Signed-off-by: Dmitry Smagin <dmitry.s.smagin@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/boardinfo'Sascha Hauer2013-09-051-0/+3
|\ | | | | | | | | | | | | Conflicts: arch/mips/boards/qemu-malta/init.c commands/bootm.c drivers/of/base.c
| * introduce barebox_set_modelSascha Hauer2013-08-161-0/+3
| | | | | | | | | | | | | | | | Instead of calling of_get_model() in barebox_get_model() add a barebox_set_model() and use it to set the boardinfo once it's available from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of'Sascha Hauer2013-09-052-19/+141
|\ \ | |/ |/|
| * of: base: import of_find_node_by_typeRenaud Barbier2013-09-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | Import of_find_node_by_type from Linux drivers/of/base.c - commit id d8dfad3. This function retrieves a node pointer based on the "device_type" property of the node. This is used by device tree update functions in PPC support. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: introduce some new helpersSascha Hauer2013-08-141-0/+101
| | | | | | | | | | | | | | | | | | | | | | of_get_tree_max_phandle - get the maximum phandle of a tree. Needed for creating new phandles without conflicts. of_node_create_phandle - create a phandle for a node which doesn't have one. of_find_node_by_alias - find a node by alias name of_find_node_by_path_or_alias - find a node by full path or alias name of_find_root_node - find the root node for a given device node Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: default to internal tree in of_find_node_by_path_fromSascha Hauer2013-08-141-0/+3
| | | | | | | | | | | | So that of_find_node_by_path_from can be used easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: parse phandles during unflattenSascha Hauer2013-08-142-19/+7
| | | | | | | | | | | | | | With this node->phandle becomes valid after unflattening a tree and not during of_probe later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: fix merge mode in of_unflatten_dtbSascha Hauer2013-08-141-0/+1
| | | | | | | | | | | | | | In merge mode a property may be overwritte with new values. When this happens the length has to be adjusted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: base.c: Use correct device-tree in of_add_initrd()David Jander2013-08-141-1/+1
|/ | | | | | | | Otherwise only the internal DT is modified, not necessarily the one passed to the kernel. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: Fix endless loop in of_add_memorySascha Hauer2013-08-141-1/+4
| | | | | | | of_add_memory is stuck in an endless loop when a memory bank with zero size is passed. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of'Sascha Hauer2013-08-056-25/+368
|\ | | | | | | | | | | Conflicts: arch/arm/boards/freescale-mx53-loco/board.c drivers/of/Makefile
| * Add configurability via devicetreeSascha Hauer2013-07-184-0/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the possibility to configure the place for the environment from the devicetree and to partition devices from the devicetree. Configuration has the general form of devices with a regular compatible property. This allows to later add additional drivers or drivers with different behaviour (for example to add support for redundant environment). The configuration is all in the /chosen/barebox/ hierarchy of the devicetree. This separates the configuration from the hardware description. Also it makes it possible to store the configuration in a completely separate devicetree (or devicetree overlay). For the same reason all configuration is done using nodepathes rather than phandles. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: Add convenience functions to en/disable devicenodesSascha Hauer2013-07-181-0/+65
| | | | | | | | | | | | | | These functions allow to manipulate the "status" property of devicenodes effectively enabling/disabling devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: partition: check for valid nodeSascha Hauer2013-07-181-0/+6
| | | | | | | | | | | | | | So that users can call the of partition parsers without checking if they are probed from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: partitions: factor out function to parse a single partitionSascha Hauer2013-07-151-25/+33
| | | | | | | | | | | | To make it usable for other code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2013-08-052-0/+83
|\ \
| * | of: add mtd of helpersSascha Hauer2013-07-162-0/+83
| | | | | | | | | | | | | | | | | | Directly taken from the kernel Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/marvell'Sascha Hauer2013-08-057-322/+859
|\ \ \ | | |/ | |/| | | | | | | | | | Conflicts: arch/arm/boards/Makefile arch/arm/dts/Makefile
| * | OF: base: rename of_free to of_delete_nodeSebastian Hesselbarth2013-07-052-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | of_free is misleading about the actual purpose of the function. There is already a of_create_node counterpart, so rename of_free to of_create_node and update all users accordingly. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: base: convert of_add_memory to OF APISebastian Hesselbarth2013-07-051-49/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convert of_add_memory parsing to make use of of_address_to_resource instead of parsing memory ranges itself. This makes some functions dead code which are also removed. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: remove device and resource pointer from struct device_nodeSebastian Hesselbarth2013-07-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | struct device_node has its own resources and a pointer to associated device_d. With recent platform related OF code, we can convert the only user of it and remove those pointers from struct device_node. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: base: remove dead device related functionsSebastian Hesselbarth2013-07-051-183/+0
| | | | | | | | | | | | | | | | | | | | | | | | With recent conversion to of_platfrom_populate_some functions are now dead code and can be removed. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: base: use of_platform_populate for probingSebastian Hesselbarth2013-07-051-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | With recent bus/device related functions in OF API, we can now convert to use of_platform_populate. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: gpio: convert DT based gpio handling to new OF APISebastian Hesselbarth2013-07-053-27/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This creates a Linux OF API compatible counterpart of of_get_named_gpio_flags. Existing of_get_named_gpio is converted to a static inline function, which is in the corresponding of_gpio.h include. While at it, drivers/of/gpio.c is also renamed to drivers/of/of_gpio.c to follow the of_ prefix naming scheme. The new include is also added to existing users of of_get_named_gpio. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: import bus/device related functions from Linux OF APISebastian Hesselbarth2013-07-052-1/+322
| | | | | | | | | | | | | | | | | | | | | | | | This imports some bus and device related functions from Linux OF API with some modifcations for Barebox. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: base: move OF_ROOT_NODE_ defines to local OF codeSebastian Hesselbarth2013-07-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | OF_ROOT_NODE_* defines should not be used outside of base.c. Move them to drivers/of/base.c to ensure they will not be used elsewhere. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: convert of_translate_address to new APISebastian Hesselbarth2013-07-052-25/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts existing of_translate_address to recently added API. In contrast to existing behavior, the new function honors ranges properties properly. It now allows reg properties to be set as offset with respect to the correspoding parent node. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: import address related functions from Linux OF APISebastian Hesselbarth2013-07-052-1/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This imports drivers/of/address.c from Linux with some minor modifications. of_translate_address is not yet enabled and PCI and ISA related bus translations have not been imported. Also, a corresponding include header is created with prototypes and non-OF function stubs. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | of: Use dts syntax when printing devicetreesSascha Hauer2013-07-271-3/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | Our devicetree printing is close to correct dts syntax, so fix some remaining differences: - Use an equal sign instead of a colon to separate a poperty name and a value - Add a semicolon at the end of properties - Make sure we do not print a separator for empty properties Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | OF: base: initalize from node in of_find_node_with_propertySebastian Hesselbarth2013-07-091-0/+3
| | | | | | | | | | | | | | | | This adds initialization of from device node with root_node if NULL is passed. This corresponds to the behavior of all other node iterators. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | OF: base: fix iterator in of_get_next_available_childSebastian Hesselbarth2013-07-051-1/+2
| | | | | | | | | | | | | | | | | | | | of_get_next_available_child does not iterate but always tries the same node over and over again. This first prepares the entry and then uses list_for_each_entry_continue, instead of for_each_child_of_node before. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | OF: base: fix inifinite looping in node iteratorsSascha Hauer2013-07-051-6/+15
|/ | | | | | | | | | | | | of_find_node_by_name suffers from infinite looping, because it does not check for root node of the tree iterated over. This fixes this by checking for node->parent to determine whether the last node has been reached. Since of_tree_for_each_node does not iterate over the whole tree, but only over the remaining nodes, rename it to of_tree_for_each_node_from. Reported-by: NISHIMOTO Hiroki <hiroki.nishimoto.if@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-025-252/+973
|\
| * OF: base: use of_delete_property where applicableSebastian Hesselbarth2013-06-241-56/+25
| | | | | | | | | | | | | | | | This patch makes OF API use of_delete_property where applicable instead of freeing allocated data in different places. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * OF: base: add sanity checks to of_new/delete_propertySebastian Hesselbarth2013-06-241-4/+11
| | | | | | | | | | | | | | | | | | | | This adds some sanity checks to of_new_property and of_delete_property. Also, value pointer is always allocated even with zero length to allow empty properties to be distinguished from non-existing properties. Finally, data passed to of_new_property is only copied if non-NULL. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * OF: base: convert and remove device_node_for_nach_childSebastian Hesselbarth2013-06-201-1/+1
| | | | | | | | | | | | | | | | Remove device_node_for_nach_child and convert users to corresponding imported OF API functions. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * OF: base: remove of_find_child_by_nameSebastian Hesselbarth2013-06-202-17/+7
| | | | | | | | | | | | | | With of_get_child_by_name from Linux API, we can now convert and remove of_find_child_by_name. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: remove of_tree_for_each_node from public APISebastian Hesselbarth2013-06-201-0/+8
| | | | | | | | | | | | | | | | This patch converts users of of_tree_for_each_node to recently added for_eacg_compatible_node helper. Also of_tree_for_each_node is removed from public OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import property iterators from Linux OF APISebastian Hesselbarth2013-06-201-0/+41
| | | | | | | | | | | | | | This imports of_prop_next_u32, of_prop_next_string, and the corresponding for_property_for_each_ helpers from Linux OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: introduce property write for bool, u8, u16, and u64Sebastian Hesselbarth2013-06-201-0/+156
| | | | | | | | | | | | | | This adds functions to set an array of or a single value for bool, u8, u16, and u64 properties. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import parse phandle functions from Linux OF APISebastian Hesselbarth2013-06-202-76/+121
| | | | | | | | | | | | | | | | This imports of_parse_phandle_with_args and of_count_phandle_with_args from Linux OF API. The slightly different of_parse_phandles_with_args is removed and all users are converted to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import of_parse_phandle from Linux OF APISebastian Hesselbarth2013-06-201-0/+23
| | | | | | | | | | | | This imports of_parse_phandle from Linux OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import of_property_read_* helpers from Linux OF APISebastian Hesselbarth2013-06-201-84/+303
| | | | | | | | | | | | | | This imports of_property_read_* helpers from Linux OF API to allow to read all kinds of properties. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import parent/child functions from Linux OF APISebastian Hesselbarth2013-06-201-0/+97
| | | | | | | | | | | | | | | | | | | | This imports of_get_parent, of_get_next_available_child, and of_get_child_by_name and corresponding helpers from Linux OF API. of_get_next_child is not imported but implemented as list iterator instead. Also, of_get_child_count and of_get_available_child_count are introduced. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import of_find_node_with_property from Linux OF APISebastian Hesselbarth2013-06-201-0/+26
| | | | | | | | | | | | | | This imports of_find_node_with_property and corresponding helpers from Linux OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import of_find_matching_node_and_match from Linux OF APISebastian Hesselbarth2013-06-201-0/+37
| | | | | | | | | | | | | | This imports of_find_matching_node_and_match and corresponding helpers from Linux OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import of_find_compatible_node from Linux OF APISebastian Hesselbarth2013-06-201-0/+30
| | | | | | | | | | | | | | This imports of_find_compatible_node and corresponding for_each_compatible_node helper from Linux OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: import of_find_node_by_name from Linux OF APISebastian Hesselbarth2013-06-201-0/+26
| | | | | | | | | | | | | | This imports of_find_node_by_name and corresponding for_each_node_by_name helper from Linux OF API. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
| * OF: base: rename of_node_disabled to of_device_is_availableSebastian Hesselbarth2013-06-201-6/+20
| | | | | | | | | | | | | | | | | | | | | | According to ePAPR 1.1 spec, device tree nodes status can be either "okay", "disabled", "fail", or "fail-sss". Barebox already has a function to check for "disabled" nodes, while Linux checks for "okay" or "ok". To synchronize Barebox and Linux OF APIs, rename of_node_disabled to of_device_is_available and check for "okay" instead of "disabled" as it also makes "fail"ed devices unavailable. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>