summaryrefslogtreecommitdiffstats
path: root/include/device.h
Commit message (Collapse)AuthorAgeFilesLines
* fast-reboot: parallel memory clearingStewart Smith2018-07-161-1/+4
| | | | | | | | | | | | Arbitrarily pick 16GB as the unit of parallelism, and split up clearing memory into jobs and schedule them node-local to the memory (or on node 0 if we can't work that out because it's the memory up to SKIBOOT_BASE) This seems to cut at least ~40% time from memory zeroing on fast-reboot on a 256GB Boston system. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* dt: add /cpus/ibm, powerpc-cpu-features device tree bindingsNicholas Piggin2018-02-211-0/+1
| | | | | | | | | | | | This is a new CPU feature advertising interface that is fine-grained, extensible, aware of privilege levels, and gives control of features to all levels of the stack (firmware, hypervisor, and OS). The design and binding specification is described in detail in doc/. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix maybe-uninitialized warning from older GCC, doc cleanup] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* dt: Add phandle fixup helpersMadhavan Srinivasan2017-06-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When there is a new device tree that needs to be added to the main dt of the opal (ex, IMC catalog dtb loaded from pnor partition), we need to check for the phandle values in the new incoming device tree before attaching it. Reason is that, incoming device tree could already have phandle values initialized for its nodes. Now, if we attach this new device tree to the main opal DT, we could potentially hit phandle duplicate error (since the phandles value usually start with 1). To avoid this, a new helper function dt_adjust_subtree_phandle() is added to scan the incoming device tree and update node "phandle" accordingly based on the opal "last_phandle" value. Add to this, helper function also supports updates of "properties" with in a node which may refer the "phandle" value in the incoming device tree. Helper function will also fix the "properties" field accordingly. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* dt: Add helper function for last_phandle updatesMadhavan Srinivasan2017-06-271-0/+16
| | | | | | | | | Add helper functions for "last_phandle" access/update and modify functions to use helper functions. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* device: add dt_find_by_name_addrOliver O'Halloran2017-04-071-0/+5
| | | | | | | | | | | | Adds two helper functions that allow device nodes to be found via their name and unit address. One will take an integer address and format it to a hex string while the other looks up the unit based a user supplied string. This is handy in a few places inside the HDAT parser. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* dt: add dt_new_check()Oliver O'Halloran2017-01-151-0/+1
| | | | | | | | | | | | This is similar to dt_new(), but if the node already exists it will return the existing node. This is useful because some init code depends on the presence of certain nodes, but where the node is actually created is unimportant. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* device: Add helper to delete a property by name if it existsBenjamin Herrenschmidt2016-10-141-0/+2
| | | | | | | | This will be useful for fast reboot which needs to clean a few things up. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* devicetree: Add dt_node_is_enabled()Benjamin Herrenschmidt2016-07-061-0/+2
| | | | | | | | | | This accessor tests the "status" property allowing us to represent disabled devices in the device-tree. It will be used by PHB4 initially but its usage could be made more widespread. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* DT sorting testOliver O'Halloran2016-01-211-0/+5
| | | | | | | | | | | | Moved the dt_dump() into test/dt_common.c so that it can be shared between hdata/test/hdata_to_dt.c and core/test/run-device.c run-device.c contains two tests, one basic sorting test and a generate-and-sort test. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: remove trailing whitespace] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Add dt_copyJeremy Kerr2015-08-171-0/+3
| | | | | | | | This change adds a new function to copy a device tree node to a new parent. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/device: Function to return child node using nameNeelesh Gupta2015-02-111-0/+3
| | | | | | | | Add a function dt_find_by_name() that returns the child node if matches the given name, otherwise NULL. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add attribute warn_unused_result to compiler.h and dt_expand_nodeStewart Smith2014-11-261-1/+2
| | | | | | | This would have thrown a compiler warning for cf8def9 rather than failing at runtime. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+233
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud