04 Nov, 2014
1 commit
-
The device tree structure is composed of two lists; the 'allnodes' list
which is a singly linked list containing every node in the tree, and the
child->parent structure where each parent node has a singly linked list
of children. All of the data in the allnodes list can be easily
reproduced with the parent-child lists, so of_allnodes is actually
unnecessary. Remove it entirely which saves a bit of memory and
simplifies the data structure quite a lot.Signed-off-by: Grant Likely
Cc: Rob Herring
Cc: Gaurav Minocha
Cc: Pantelis Antoniou
19 Mar, 2014
1 commit
-
After the move to having device nodes be proper kobjects the lifecycle
of the node needs to be controlled better.At first convert of_add_node() in the unflattened functions to
of_init_node() which initializes the kobject so that of_node_get/put
work correctly even before of_init is called.Afterwards introduce of_node_is_initialized & of_node_is_attached that
query the underlying kobject about the state (attached means kobj
is visible in sysfs)Using that make sure the lifecycle of the tree is correct at all
times.Signed-off-by: Pantelis Antoniou
[grant.likely: moved of_node_init() calls, fixed up locking, and
dropped __of_populate() hunks]
Signed-off-by: Grant Likely
12 Mar, 2014
1 commit
-
Device tree nodes are already treated as objects, and we already want to
expose them to userspace which is done using the /proc filesystem today.
Right now the kernel has to do a lot of work to keep the /proc view in
sync with the in-kernel representation. If device_nodes are switched to
be kobjects then the device tree code can be a whole lot simpler. It
also turns out that switching to using /sysfs from /proc results in
smaller code and data size, and the userspace ABI won't change if
/proc/device-tree symlinks to /sys/firmware/devicetree/base.v7: Add missing sysfs_bin_attr_init()
v6: Add __of_add_property() early init fixes from Pantelis
v5: Rename firmware/ofw to firmware/devicetree
Fix updating property values in sysfs
v4: Fixed build error on Powerpc
Fixed handling of dynamic nodes on powerpc
v3: Fixed handling of duplicate attribute and child node names
v2: switch to using sysfs bin_attributes which solve the problem of
reporting incorrect property size.Signed-off-by: Grant Likely
Tested-by: Sascha Hauer
Cc: Rob Herring
Cc: Benjamin Herrenschmidt
Cc: David S. Miller
Cc: Nathan Fontenot
Cc: Pantelis Antoniou
10 Oct, 2013
1 commit
-
Remove unnecessary prom.h includes in preparation to make prom.h optional.
Signed-off-by: Rob Herring
Acked-by: Grant Likely
18 Jun, 2013
1 commit
-
Fix "/aliasas" typo in comments, no functional change.
Signed-off-by: Robert P. J. Day
Signed-off-by: Jiri Kosina
30 Nov, 2012
1 commit
-
ERROR: "allnodes" [drivers/w1/masters/w1-gpio.ko] undefined!
Signed-off-by: Randy Dunlap
[grant.likely: allnodes is too generic; rename to of_allnodes]
Signed-off-by: Grant Likely
Cc: Ville Syrjala
28 Dec, 2011
1 commit
-
Fix the following section mismatch warning - seen when building sparc32:
WARNING: vmlinux.o(.text+0x1ff9c0): Section mismatch in reference from the function kernel_tree_alloc() to the function .init.text:prom_early_alloc()
The function kernel_tree_alloc() references
the function __init prom_early_alloc().
This is often because kernel_tree_alloc lacks a __init
annotation or the annotation of prom_early_alloc is wrong.prom_early_alloc() is annotated __init, and users of
kernel_tree_alloc() is also annotated __init.
So simply match the annoation of these to fix the warning.Signed-off-by: Sam Ravnborg
Cc: Grant Likely
Acked-by: David S. Miller
Signed-off-by: Rob Herring
23 Sep, 2011
1 commit
-
The patch adds function of_alias_scan to populate a global lookup
table with the properties of 'aliases' node and function
of_alias_get_id for drivers to find alias id from the lookup table.v3: Split out automatic addition of aliases on id lookup so that it can be
debated separately from the core functionality.
v2: - Add of_chosen/of_aliases populating and of_alias_scan() invocation
for OF_PROMTREE.
- Add locking
- rework parse loopSigned-off-by: Shawn Guo
Acked-by: David S. Miller
Signed-off-by: Grant Likely
03 Mar, 2011
1 commit
-
Commit e2f2a93b, "of/promtree: add package-to-path support to pdt"
changed dp->name from using the 'name' property to using
package-to-path. This fixed /proc/device-tree creation by eliminating
conflicts between names (the 'name' property provides names like
'battery', whereas package-to-path provides names like
'/foo/bar/battery@0', which we stripped to 'battery@0'). However, it
also breaks of_device_id table matching.The fix that we _really_ wanted was to keep dp->name based upon
the name property ('battery'), but based dp->full_name upon
package-to-path ('battery@0'). This patch does just that.This changes all users (except SPARC) of promtree to use the full
result from package-to-path for full_name, rather than stripping the
directory out. In practice, the strings end up being exactly the
same; this change saves time, code, and memory.SPARC continues to use the existing build_path_component() code.
v2: combine two patches and revert of_pdt_node_name to original version
v3: use dp->phandle instead of passing around node
v4: warn/bail out for non-sparc archs if pkg2path is not set
v5: split of_pdt_build_full_name into sparc & non-sparc versions
v6: Pass NULL to pkg2path before buf gets assigned.
Drop check for pkg2path hook on each and every node.
v7: Don't BUG() when unable to get the full_path; create a
known-unique name instead.Signed-off-by: Andres Salomon
Signed-off-by: Grant Likely
13 Oct, 2010
3 commits
-
package-to-path is a PROM function which tells us the real (full) name of the
node. This provides a hook for that in the prom ops struct, and makes use
of it in the pdt code when attempting to determine a node's name. If the
hook is available, try using it (falling back to looking at the "name"
property if it fails).Signed-off-by: Andres Salomon
Signed-off-by: Grant Likely -
For symbols still lacking namespace qualifiers, add an of_pdt_ prefix.
Signed-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely -
Rather than assuming an architecture defines prom_getchild and friends,
define an ops struct with hooks for the various prom functions that
pdt.c needs. This ops struct is filled in by the
arch-(and sometimes firmware-)specific code, and passed to
of_pdt_build_devicetree.Update sparc code to define the ops struct as well.
Signed-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely
11 Oct, 2010
1 commit
-
Clean up pdt.c:
- make build dependent upon config OF_PROMTREE
- #ifdef out the sparc-specific stuff
- create pdt-specific headerSigned-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely
09 Oct, 2010
1 commit
-
Transitioning into making this useful for architectures other than sparc.
This is a verbatim copy of all functions/variables that've been moved.Signed-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely