File: opal-get-device-tree-118.rst

package info (click to toggle)
skiboot 7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 35,624 kB
  • sloc: ansic: 221,198; sh: 11,580; cpp: 5,767; python: 3,421; makefile: 1,773; asm: 1,503; perl: 1,479; tcl: 1,188; pascal: 107
file content (41 lines) | stat: -rw-r--r-- 986 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.. _OPAL_GET_DEVICE_TREE:

OPAL_GET_DEVICE_TREE
====================

.. code-block:: c

   #define OPAL_GET_DEVICE_TREE			118

   int64_t opal_get_device_tree(uint32_t phandle, uint64_t buf, uint64_t len);

Get device sub-tree.

``uint32_t phandle``
  root device node phandle of the device sub-tree
``uint64_t buf``
  FDT blob buffer or NULL
``uint64_t len``
  length of the FDT blob buffer


Retrieve device sub-tree. The root node's phandle is identified by @phandle.
The typical use is for the kernel to update its device tree following a change
in hardware (e.g. PCI hotplug).

Return Codes
^^^^^^^^^^^^

FDT blob size
  returned FDT blob buffer size when ``buf`` is NULL

:ref:`OPAL_SUCCESS`
  FDT blob is created successfully
:ref:`OPAL_PARAMETER`
  invalid argument @phandle or @len
:ref:`OPAL_INTERNAL_ERROR`
  failure creating FDT blob when calculating its size
:ref:`OPAL_NO_MEM`
  not enough room in buffer for device sub-tree
:ref:`OPAL_EMPTY`
  failure creating FDT blob