- Sep 15, 2017
-
-
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
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>
-
- Aug 20, 2017
-
-
Anatolij Gustschin authored
s/notes/nodes Signed-off-by:
Anatolij Gustschin <agust@denx.de>
-
- Jul 11, 2017
-
-
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>
-
- 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>
-
- 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
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>
-
- Sep 19, 2016
-
-
Simon Glass authored
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>
-
Simon Glass authored
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>
-
Simon Glass authored
This should be in with the other system includes. Move it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jul 15, 2016
-
-
Simon Glass authored
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>
-
Simon Glass authored
This property is not useful for of-platdata, so omit it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This tool can produce C struct definitions and C platform data tables. This is used to support the of-platdata feature. Signed-off-by:
Simon Glass <sjg@chromium.org>
-