summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt_util.py
Commit message (Collapse)AuthorAgeLines
* dtoc: Decode strings for struct.unpack on python 3.xPaul Burton2016-10-09-0/+3
| | | | | | | | | | On python 3.x struct.unpack will complain if we provide it with a string since it expects to operate on a bytes object. In order to satisfy this requirement, encode the string to a bytes object when running on python 3.x. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
* dtoc: Add methods for reading data from propertiesSimon Glass2016-09-18-0/+25
| | | | | | | Provide easy helpers for reading integer, string and boolean values from device-tree properties. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Correct quotes in fdt_utilSimon Glass2016-09-18-1/+1
| | | | | | | The style is to use single quotes for strings where possible. Adjust this function. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Allow the device tree to be compiled from sourceSimon Glass2016-09-18-0/+41
| | | | | | | | If a source device tree is provide to the Fdt() constructors, compile it automatically. This will be used in tests, where we want to build a particular test .dts file and check that it works correctly in binman. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Move BytesToValue() and GetEmpty() into PropBaseSimon Glass2016-09-18-66/+0
| | | | | | | | | | These functions are currently in a separate fdt_util file. Since they are only used from PropBase and subclasses, it makes sense for them to be in the PropBase class. Move these functions into fdt.py along with the list of types. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add a library to provide simple device-tree accessSimon Glass2016-07-14-0/+86
This Python library provides a way to access the contents of the device tree. It uses fdtget, so is inefficient for larger device tree files. Signed-off-by: Simon Glass <sjg@chromium.org>