34c38896 | 27-Sep-2016 |
Paul Burton <paul.burton@imgtec.com> |
dtoc: Make integer division python 3.x safe
If we use the '/' operator then python 3.x will produce a float, and refuse to multiply the string sequence in Conv_name_to_c by it with:
TypeError:
dtoc: Make integer division python 3.x safe
If we use the '/' operator then python 3.x will produce a float, and refuse to multiply the string sequence in Conv_name_to_c by it with:
TypeError: can't multiply sequence by non-int of type 'float'
Use the '//' operator instead to enforce that we want integer rather than floating point division.
Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
c4c5f9ee | 27-Sep-2016 |
Paul Burton <paul.burton@imgtec.com> |
dtoc: Decode strings for struct.unpack on python 3.x
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
dtoc: Decode strings for struct.unpack on python 3.x
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>
show more ...
|
3cb44ba8 | 25-Sep-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Add a way for tests to request the fallback library
We need to test both the normal (Python libfdt module) and fallback (fdtget) implementations of the Fdt class. Add a way to select which imp
dtoc: Add a way for tests to request the fallback library
We need to test both the normal (Python libfdt module) and fallback (fdtget) implementations of the Fdt class. Add a way to select which implementation to use.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
8828254c | 25-Sep-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Adjust GetProps() in fdt_normal to use the node path
There is no need to pass a node path separately. Instead we should use the path for the node provided. Correct this.
Signed-off-by: Simon
dtoc: Adjust GetProps() in fdt_normal to use the node path
There is no need to pass a node path separately. Instead we should use the path for the node provided. Correct this.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
babdbde6 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Support finding the offset of a property
Add a way to find the byte offset of a property within the device tree. This is only supported with the normal libfdt implementation since fdtget does
dtoc: Support finding the offset of a property
Add a way to find the byte offset of a property within the device tree. This is only supported with the normal libfdt implementation since fdtget does not provide this information.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
da5f7499 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Support packing the device tree
After any node/property deletion the device tree can be packed to remove spare space. Add a way to perform this operation.
Note that for fdt_fallback, fdtput a
dtoc: Support packing the device tree
After any node/property deletion the device tree can be packed to remove spare space. Add a way to perform this operation.
Note that for fdt_fallback, fdtput automatically packs the device tree after deletion, so no action is required here.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
0170804f | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Move to using bytearray
Since we want to be able to change the in-memory device tree using libfdt, use a bytearray instead of a string. This makes interfacing from Python easier.
Signed-off-b
dtoc: Move to using bytearray
Since we want to be able to change the in-memory device tree using libfdt, use a bytearray instead of a string. This makes interfacing from Python easier.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
346179f0 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Prepare for supporting changing of device trees
For binman we need to support deleting properties in the device tree. This will change the offsets of nodes after the deletion. In preparation,
dtoc: Prepare for supporting changing of device trees
For binman we need to support deleting properties in the device tree. This will change the offsets of nodes after the deletion. In preparation, add code to keep track of when the offsets are invalid, and regenerate them.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
355c67c3 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Allow the device tree to be compiled from source
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 pa
dtoc: Allow the device tree to be compiled from source
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>
show more ...
|
f7a2aeee | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Move a few more common functions into fdt.py
Some functions have the same code in the subclasses. Move these into the superclass to avoid duplication.
Signed-off-by: Simon Glass <sjg@chromium
dtoc: Move a few more common functions into fdt.py
Some functions have the same code in the subclasses. Move these into the superclass to avoid duplication.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
c322a850 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Move Widen() and GetPhandle() into the base class
These functions are identical in both subclasses. Move them into the base class.
Note: In fact there is a bug in one version, which was fixed
dtoc: Move Widen() and GetPhandle() into the base class
These functions are identical in both subclasses. Move them into the base class.
Note: In fact there is a bug in one version, which was fixed by this patch:
https://patchwork.ozlabs.org/patch/651697/
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
bc1dea36 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Move BytesToValue() and GetEmpty() into PropBase
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
dtoc: Move BytesToValue() and GetEmpty() into PropBase
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>
show more ...
|
a06a34b2 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Create a base class for Fdt
At present we have two separate implementations of the Fdt library, one which uses fdtget/fdtput and one which uses libfdt (via swig).
Before adding more functiona
dtoc: Create a base class for Fdt
At present we have two separate implementations of the Fdt library, one which uses fdtget/fdtput and one which uses libfdt (via swig).
Before adding more functionality it makes sense to create a base class for these. This will allow common functions to be shared, and make the Fdt API a little clearer.
Create a new fdt.py file with the base class, and adjust fdt_normal.py and fdt_fallback.py to use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
ba482585 | 25-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dtoc: Move the fdt library selection into fdt_select
Rather than have dtc worry about which fdt library to use, move this into a helper file. Add a function which creates a new Fdt object and scans
dtoc: Move the fdt library selection into fdt_select
Rather than have dtc worry about which fdt library to use, move this into a helper file. Add a function which creates a new Fdt object and scans it, regardless of the implementation.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
9fa28190 | 04-Jul-2016 |
Simon Glass <sjg@chromium.org> |
dm: core: Expand platdata for of-platdata devices
Devices which use of-platdata have their own platdata. However, in many cases the driver will have its own auto-alloced platdata, for use with the d
dm: core: Expand platdata for of-platdata devices
Devices which use of-platdata have their own platdata. However, in many cases the driver will have its own auto-alloced platdata, for use with the device tree. The ofdata_to_platdata() method converts the device tree settings to platdata.
With of-platdata we would not normally allocate the platdata since it is provided by the U_BOOT_DEVICE() declaration. However this is inconvenient since the of-platdata struct is closely tied to the device tree properties. It is unlikely to exactly match the platdata needed by the driver.
In fact a useful approach is to declare platdata in the driver like this:
struct r3288_mmc_platdata { struct dtd_rockchip_rk3288_dw_mshc of_platdata; /* the 'normal' fields go here */ };
In this case we have dt_platadata available, but the normal fields are not present, since ofdata_to_platdata() is never called. In fact driver model doesn't allocate any space for the 'normal' fields, since it sees that there is already platform data attached to the device.
To make this easier, adjust driver model to allocate the full size of the struct (i.e. platdata_auto_alloc_size from the driver) and copy in the of-platdata. This means that when the driver's bind() method is called, the of-platdata will be present, followed by zero bytes for the empty 'normal field' portion.
A new DM_FLAG_OF_PLATDATA flag is available that indicates that the platdata came from of-platdata. When the allocation/copy happens, the DM_FLAG_ALLOC_PDATA flag will be set as well. The dtoc tool is updated to output the platdata_size field, since U-Boot has no other way of knowing the size of the of-platdata struct.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|