This function requires a bit of typemap effort to get the depth parameter
to work correctly. Add support for it, along with a test.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
The ordering of the Python functions loosely matches the corresponding
function in the C header file, but not exactly. As we add more functions
it is easier to track what is missing if they are in the same order.
Move some functions around to achieve this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
The return value is not actually mutable, so it seems more correct to
return bytes rather than a bytearray.
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
It is annoying to have to add .value when we want the value of a Property.
Make Property a subclass of bytearray so that it can be used directly when
the value is required.
Fix the Property class comment while we are here.
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
When calling libfdt functions which are not supported by the Fdt class it
is necessary to get direct access to the device tree data. At present this
requries using the internal _fdt member. Add a new method to provide
public access to this, without allowing the data to be changed.
Note that a bytearray type is returned rather than str, since the swig
types are set up for bytearray to map correctly to const void *.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Add this into the class to simplify use of this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Add this into the class to simplify use of this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Add this into the class to simplify use of this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Add this into the class to simplify use of this function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Some types used by libfdt.h are not understood the Python module since
they are defined outside it. An example is an attempt to do this:
import libfdt
result = libfdt.fdt_node_offset_by_phandle(fdt, phandle)
This results in:
TypeError: in method 'fdt_node_offset_by_phandle', argument 2 of
type 'uint32_t'
Include the standard integer header file to fix this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
The .i extension allows Python distutils to automatically handle the swig
file. Rename it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>