summaryrefslogtreecommitdiffstats
path: root/drivers/of
Commit message (Collapse)AuthorAgeFilesLines
* of: Use %pa to print resource_size_t typeSascha Hauer2017-01-101-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: base: add chosen node if it does not exist when adding initrdPhilipp Zabel2017-01-091-2/+2
| | | | | | | | | If the chosen node does not exist, of_add_initrd fails to pass the initrd to the kernel. Instead it should create the chosen node, just like of_fixup_bootargs does. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2016-11-141-0/+3
|\
| * of_path: handle no driver for deviceSascha Hauer2016-10-201-0/+3
| | | | | | | | | | | | | | | | | | in __of_find_path it can happen that there is a device, but there is no driver for this device because it hasn't been probed yet. Return -ENODEV in this case to let the caller know that it has to try later again. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-11-142-2/+2
|\ \
| * | of: fix typosAntony Pavlov2016-10-182-2/+2
| |/ | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: of_find_path: Add support for new partition bindingSascha Hauer2016-11-111-1/+6
| | | | | | | | | | | | | | The partitions now may be in a subnode of the actual device node. Eventually go another step up in the hierarchy if required. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: partitions: Support new bindingSascha Hauer2016-11-111-0/+7
|/ | | | | | | The new binding recommends to put the partitions into a subnode with compatible "fixed-partitions". Add support for this binding. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: base: import of_get_cpu_node() from linux-v4.7-rc2Antony Pavlov2016-07-071-0/+86
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-06-141-0/+2
|\
| * of: base: Match simple-mfd devicesSascha Hauer2016-05-231-0/+2
| | | | | | | | | | | | | | Some simple-buses are now considered to be simple-mfd devices. Match them aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: Add missing includeSascha Hauer2016-05-241-1/+1
|/ | | | | | | drivers/of/device.c has the implementation for of_match_device(), so also include the header which has the prototype. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pci'Sascha Hauer2016-05-092-1/+34
|\
| * OF: Port of_match_device() and of_device_get_match_data()Andrey Smirnov2016-04-282-1/+34
| | | | | | | | | | | | | | | | | | Port of_match_device() and of_device_get_match_data() from Linux kernel code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2016-05-093-40/+108
|\ \
| * | of: fix of_tree_for_each_node_from() macroBoris Brezillon2016-04-281-32/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_tree_for_each_node_from() is supposed to iterate over all DT nodes after the one pointed by the from parameter, but with the current of_next_node() implementation we cannot access the root node. Patch of_next_node() to point to root_node when from is NULL. Doing that also simplifies users of of_tree_for_each_node_from() which were duplicating the logic to point to the root_node when from is NULL. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | drivers/of: Always compile of_path.c with OF supportSascha Hauer2016-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | of_find_path() is a OF specific library function, so always compile it when OF support is enabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: preserve /memreserve/ entriesSascha Hauer2016-04-251-6/+100
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Some dts files for the Kernel specify a reserved memory area using the /memreserve/ dtc directive. These entries get lost during unflattening/flattening the device tree and are never passed to the Kernel. This patch fixes this behaviour. This is done by copying the entries into a /memreserve node in the unflattened tree and moving them back during flattening the tree. The entries added by barebox dynamically are appended to the static entries from the original dtb. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / string: Fix (v)asprintf prototypesSascha Hauer2016-04-154-4/+5
|/ | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Convert users of PRINTF_CONVERSION_RESOURCE to %paSascha Hauer2016-01-151-2/+5
| | | | | | | | printf now supports printing resource_size_t directly, convert all users of the previously used PRINTF_CONVERSION_RESOURCE over to %pa. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_path: Drop possible further extensions of device-path propertySascha Hauer2016-01-081-95/+28
| | | | | | | | | | Originally it was intended to further extend the multi string property device-path further with more elements, like for example a filename. It turned out though that this is too complex and instead of further extending the property we should instead create additional properties, so this mechanism is removed with this patch to make the code simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: Support env from file in a file-system via device treeTrent Piepho2016-01-082-2/+52
| | | | | | | | | | | | | | | Current barebox,environment node only allows specifying a raw device or partition to load an environment from. Some boards, like OMAP and SoCFPGA, instead want to use a file located in a FAT filesystem. Extend the device tree bindings with a new property 'file-path' that will trigger this behavior. This allows any board using this driver to get the env from a file or from a raw device, instead of each machine type being either raw device only or file only. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_path: Fix bug with partitions, simply codeTrent Piepho2016-01-081-18/+29
| | | | | | | | | | | | | | | | | | | | | | In commit 75b682795eafb2385556a9642f09e0af96a1264a using a path that has a partition description broke. Fix this and simpfy the code some. There is no need to loop over each string in the path property: it's defined to have at most one parition description, no extant dts has more than one, and how it would handle more than one didn't make sense anyway. Once not looping, __of_find_path() just needs the partition description text, not both the original node and property name to look it up from. When using a partition description, don't lookup the cdev of the node just to replace it with the partition's cdev. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2015-12-081-37/+59
|\
| * of_path: add of_find_path_by_node()Marc Kleine-Budde2015-11-271-1/+16
| | | | | | | | | | | | | | | | | | This patch adds the function of_find_path_by_node(), which is similar to of_find_path(), but it translates a device tree node into a barebox device path directly. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of_path: of_find_path() factor out device detection logic into separate functionMarc Kleine-Budde2015-11-271-37/+44
| | | | | | | | | | | | | | | | This patch factors out the device detection logic into separate function, so that it can be used from another function. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: mtd: Import of_get_nand_ecc_{step_size, strength} from LinuxSebastian Hesselbarth2015-11-231-0/+34
|/ | | | | | | | This imports DT helpers for MTD ECC step size and strength from Linux kernel. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of_path: Allow pointing directly to the partitionSascha Hauer2015-09-011-5/+9
| | | | | | | | We could only point to partitions in the device tree by using &norflash, "partname:barebox-environment". Allow to point to the partition directly without having to parse the partition labels. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: Add function to find cdev by device_nodeSascha Hauer2015-09-011-2/+2
| | | | | | | | | | This adds a device_node member to struct cdev and a function to find a cdev by device_node. This also removes the setting of cdev->dev->device_node in the of partition parser. We must not set the device since it may not refer to a partition but to a whole device with partitions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/vpl'Sascha Hauer2015-08-071-0/+206
|\
| * of_graph: add of_graph_port_is_availableSascha Hauer2015-07-131-0/+22
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: import of_graph functionsSascha Hauer2015-07-131-0/+167
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: base: implement of_get_next_childSascha Hauer2015-07-131-0/+17
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of/base: fix typoJan Luebbe2015-07-091-1/+1
|/ | | | | Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: export of_platform_device_createSascha Hauer2015-07-021-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fdt: of_unflatten_dtb(): remove left over "root" argument from inline docMarc Kleine-Budde2015-05-151-1/+0
| | | | | | | | | | | | | In commit d384b5639fc1 of: Drop devicetree merge support the signature of of_unflatten_dtb() was changed, but the inline documentation was forgotten to adjust. This patch removes the left over "root" argument from the doc. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-05-062-30/+11
|\
| * of_path: of_find_path(): add possibility to return .bb deviceMarc Kleine-Budde2015-04-232-21/+11
| | | | | | | | | | | | | | | | | | This patch adds a flags argument to the of_find_path() function. The only flag defined for now is OF_FIND_PATH_FLAGS_BB. When used on NAND devices, the function returns the bad block aware device (the ".bb" device). Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * environment: remove unused codeMarc Kleine-Budde2015-04-171-9/+0
| | | | | | | | | | | | | | | | This patch removes the LIST_HEAD of_partition_list and a struct definition from the code. This was present but unused, since the file was added to barebox. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | OF: gpio: Silence error message on -EPROBE_DEFERSebastian Hesselbarth2015-04-171-3/+5
|/ | | | | | | With deferred probing, -EPROBE_DEFER is not worth spilling an error. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2015-03-091-4/+4
|\
| * of: make of_alias_get work on all types of DT pathsLucas Stach2015-03-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | of_alias_get assumed that a DT path is always the full node path, whic is not necessarily the case, as there are other valid path descriptions. All of them are handled by of_find_node_by_path. As there is already a preparsed list with all DT aliases that handles this case properly we can simply reuse that one. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of/base: fix sparse warning, don't use integer 0 as NULL pointerMarc Kleine-Budde2015-03-031-2/+2
| | | | | | | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of_path: of_find_path(): remove unused variable lenMarc Kleine-Budde2015-03-031-2/+2
|/ | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2015-02-041-2/+2
|\
| * of: Create platform_device when creating AMBA device failedSascha Hauer2015-01-281-2/+2
| | | | | | | | | | | | | | If creating an AMBA device failed, maybe because AMBA support is not compiled in, register the device as regular platform device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Fix spelling: pathes -> pathsWadim Egorov2015-01-281-1/+1
|/ | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-082-2/+2
| | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fdt: don't strip const qualifierLucas Stach2014-12-111-1/+1
| | | | | | | | Fixes: warning: assignment discards 'const' qualifier from pointer target type Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fdt: of_unflatten_dtb can work on const dataJan Luebbe2014-12-041-2/+2
| | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>