- Sep 15, 2017
-
-
Simon Glass authored
Update this function to return more detail about a property that contains phandles. This will allow (in a future commit) more accurate handling of these properties. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
This function will need to have access to class members once we enhance it to support multiple phandle values. In preparation for that, move it into the class. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
Now that the Fdt class can map phandles to the associated nodes, use that instead of a separate implementation. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
Add a map from phandles to nodes. This can be used by clients of the the class instead of maintaining this themselves. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
At present dtoc assumes that all 'reg' properties have both an address and a size. For I2C devices we do not have this. Adjust dtoc to cope. Reported-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
When using 32-bit addresses dtoc works correctly. For 64-bit addresses it does not since it ignores the #address-cells and #size-cells properties. Update the tool to use fdt64_t as the element type for reg properties when either the address or size is larger than one cell. Use the correct value so that C code can obtain the information from the device tree easily. Alos create a new type, fdt_val_t, which is defined to either fdt32_t or fdt64_t depending on the word size of the machine. This type corresponds to fdt_addr_t and fdt_size_t. Unfortunately we cannot just use those types since they are defined to phys_addr_t and phys_size_t which use 'unsigned long' in the 32-bit case, rather than 'unsigned int'. Add tests for the four combinations of address and size values (32/32, 64/64, 32/64, 64/32). Also update existing uses for rk3399 and rk3368 which now need to use the new fdt_val_t type. Signed-off-by:
Simon Glass <sjg@chromium.org> Suggested-by:
Heiko Stuebner <heiko@sntech.de> Reported-by:
Kever Yang <kever.yang@rock-chips.com> Reviewed-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
Large arrays can result in lines with hundreds or thousands of characters which is not very editor-friendly. To avoid this, addjust the tool to group values 8 per line. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
When dealing with multi-cell values we need a type that can hold this value. Add this and a function to process it from a list of cell values. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
We need to be able to search back up the tree for #address-cells and #size-cells. Record the parent of each node to make this easier. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Aug 20, 2017
-
-
Anatolij Gustschin authored
s/notes/nodes Signed-off-by:
Anatolij Gustschin <agust@denx.de>
-
- Jul 11, 2017
-
-
Simon Glass authored
Add some tests of dtoc's functionality to make it easier to expand and enhance the tool. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function uses several separate string replaces where a regular expression might seem more reasonable. Add a comment justifying the way it is currently done. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Collect the main logic of dtoc into a function and put it into dtb_platdata. This will allow tests to use this function instead of duplicating the code themselves. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Rather than using static functions within the class, move them out of the class. This will make it slightly easier for tests to call them. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This option is the only one actually used by the dtb_platdata class. Pass it explicitly to avoid needing to pass the whole option object to the constructor. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This conversion appears to not be needed as it does not occur in practice. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Unfortunately I neglected to run pylint on this tool with its initial submission. Fix the warnings. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
To simplify running tests we should move this class into its own file. This allows the tests to import it without having to import dtoc.py, which runs the tests. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add a description of the dtoc tool at the top of the file. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This class should use the options object passed to it rather than finding the global one. Fix it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Sometimes a node will have multiple compatible strings. Drivers may use one or the other so the best approach seems to be to #define them to be equivalent. Update dtoc to support this. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Jun 02, 2017
-
-
Simon Glass authored
This file was used to select between the normal and fallback libfdt implementations. Now that we only have one, it is not needed. Drop it and fix up all users. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Since we only have one Fdt implementation now we don't need to have a base class. Merge the implementation and the base class together. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Drop this now-unused library and associated tests. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Now that this is no-longer available, stop looking for it. The new module will be used if available. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Use the new library if available, while retaining backwards compatibility with the old library for now. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Now that this module has been accepted upstream we should stop using the local U-Boot one. In preparation for this, rename it to indicate it is for legacy use. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- May 10, 2017
-
-
Simon Glass authored
At present dtoc assumes that nodes which are phandles do not themselves reference other phandle nodes. Unfortunately this is not necessarilly true. As a result we can currently output C code which does not compile because a node declaration can be referenced before it is declared. Adjust the code to explicitly output all phandle nodes needed by node before the node itself is output. This fixes building with the latest rk3399-firefly.dts from Linux, which has reordered the nodes. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
Simon Glass authored
The code to generate the tables is quite long. Move the node-output code into its own function. Signed-off-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Apr 13, 2017
-
-
George McCollister authored
With Python 3.5.2 encode will throw an exception if val is a byte array. Decode it to a string first. This assumes it's utf-8, if it's not valid utf-8 it will throw an exception. Signed-off-by:
George McCollister <george.mccollister@gmail.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
- Mar 29, 2017
-
-
Philipp Tomsich authored
Previously, dtoc could only process the top-level nodes which led to device nodes in hierarchical trees to be ignored. E.g. the mmc0 node in the following example would be ignored, as only the soc node was processed: / { soc { mmc0 { /* ... */ }; }; }; This introduces a recursive helper method ScanNode, which is used by ScanTree to recursively parse the entire tree hierarchy. Signed-off-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Mar 22, 2017
-
-
Philipp Tomsich authored
Previously, dtoc could only process the top-level nodes which led to device nodes in hierarchical trees to be ignored. E.g. the mmc0 node in the following example would be ignored, as only the soc node was processed: / { soc { mmc0 { /* ... */ }; }; }; This introduces a recursive helper method ScanNode, which is used by ScanTree to recursively parse the entire tree hierarchy. Signed-off-by:
Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Mar 16, 2017
-
-
Heiko Stübner authored
Right now the u-boot,dm-pre-reloc flag will make each marked node always appear in both spl and tpl. But systems needing an additional tpl might have special constraints for each, like the spl needing to be very tiny. So introduce two additional flags to mark nodes for only spl or tpl environments and introduce a function dm_fdt_pre_reloc to automate the necessary checks in code instances checking for pre-relocation flags. The behaviour of the original flag stays untouched and still marks a node for both spl and tpl. Signed-off-by:
Heiko Stuebner <heiko@sntech.de> Reviewed-by:
Simon Glass <sjg@chromium.org> Tested-by:
Kever Yang <kever.yang@rock-chips.com>
-
- Feb 08, 2017
-
-
Simon Glass authored
If there is a '.' in a compatible string, then dtoc will produce a struct with a name containing a '.'. This won't work, so replace it with '_'. Also add a suitable test to the sandbox device tree to catch this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Oct 09, 2016
-
-
Paul Burton authored
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>
-
Paul Burton authored
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>
-
Paul Burton authored
In python 3.x the iteritems() method has been removed from dictionaries, and the items() method does effectively the same thing. On python 2.x using items() is a little less efficient since it involves copying data, but as speed isn't a concern in the affected code switch to using items() anyway for simplicity. Signed-off-by:
Paul Burton <paul.burton@imgtec.com> Acked-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
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>
-
Simon Glass authored
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>
-
Simon Glass authored
This does not actually call fdtget correctly when requesting a particular type. Fix it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-