- Jun 01, 2017
-
-
Simon Glass authored
Convert this driver to support the live device tree and remove the old fdtdec support. The keyboard is not yet converted. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This prints out the wrong pointers. Fix it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add support for requesting GPIOs with a live device tree. This involves adjusting the function signature for the legacy function gpio_request_by_name_nodev(), so fix up all callers. Signed-off-by:
Simon Glass <sjg@chromium.org> Fixes to stm32f746-disco.c: Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Simon Glass authored
Use the new dev_read...() functions to access the device tree, so that a live tree can be used. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This is not needed. Drop it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Move the main part of the GPIO request function into a separate function so that it can be used by the live tree function when added. Update the xlate method to use a node reference. Update all GPIO drivers to handle the modified xlate() method. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Some tests require either livetree or flat tree. Add flags to allow the tests to specify this. Adjust the test runner to run with livetree (if supported) and then flat tree. Some video tests are quite slow and running on flat tree adds little extra test value, so run these on livetree only. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
It is useful to run the driver model tests with both livetree and flat tree in case something is different between the two. Add this feature to the test runner. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Show the filename of the test being run. Skip the path and show just the base name. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
We want to run the same test on flat and live trees. In preparation for this, create a new function which handles running a test. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Running a new test should reset the sandbox state to avoid tests interferring with each other. Move the existing state-reset code into a function so it can be used from tests. Also update the code to reset the SPI devices and adjust the test code to call it. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Adjust this function to work with livetree. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Modify simple-bus to support livetree. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Modify regmap to support livetree. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add a function which looks up a device by its node (either in live tree or flat tree). Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
When starting up driver model with a live tree we need to scan the tree for devices. Add code to handle this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Adjust this function to us an ofnode instead of an offset, so it can be used with livetree. This involves updating all callers. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Adjust this function to use an ofnode instead of an offset, so it can be used with livetree. This involves updating all callers. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
When a live tree is being used we need to record the node that was used to create the device. Update device_bind_with_driver_data() to support this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
When the live tree is supported some functions need to change a little. Add an implementation which is used when not inlining these functions. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
It is common to read a device-tree property from the node associated with a device. Add convenience functions to do this so that drivers do not need to deal with accessing the ofnode from the device. These functions all start with 'dev_read_' to provide consistent naming for all functions which read information from a device's device tree node. These are inlined when using the flat DT to save code size. The live tree implementation is added in a later commit. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Some functions deal with structured data rather than simple data types. It makes sense to have these in their own file. For now this just has a function to read a flashmap entry. Move the data types also. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add functions to add addresses in the device tree using ofnode references. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function does not change the device tree so adjust it to use const for this parameter. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add functions to access addresses in the device tree. These are brought in from Linux 4.10. Also fix up the header guard for fdtaddr.h to avoid confusion. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Since U-Boot supports both a live tree and a flat tree, we need an easy way to access the tree without worrying about which is currently active. To support this, U-Boot has the concept of an ofnode, which can refer either to a live tree node or a flat tree node. For the live tree, the reference contains a pointer to the node (struct device_node *) or NULL if the node is invalid. For the flat tree, the reference contains the node offset or -1 if the node is invalid. Add a basic set of operations using ofnodes. These are implemented by using either libfdt functions (in the case of a flat DT reference) or the live-tree of_...() functions. Note that it is not possible to have both live and flat references active at the same time. As soon as the live tree is available, everything in U-Boot should switch to using that. This avoids confusion and allows us to assume that the type of a reference is simply based on whether we have a live tree yet, or not. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The of_ prefix conflicts with the livetree version of this function. Rename it to avoid problems when we add livetree support. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
If enabled, build a live device tree after relocation. This can then be used by driver model. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function converts the flat device tree into a hierarchical one with C structures and pointers. This is easier to access. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add a basic assortment of functions to access the live device tree. These come from Linux v4.9 and are modified for U-Boot to the minimum extent possible. While these functions are now very stable in Linux, it will be possible to merge in fixes if needed. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add a Kconfig option to enable a live device tree, built at run time from the flat tree. Also add structure definitions and a root node. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
In linux v4.9 this returns a value. This saves checking the warning condition twice in some code. Update the U-Boot version to do this also. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Adjust the order to make it clear that *devp is set to NULL by default. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Enable CONFIG_DM_MMC_OPS and CONFIG_BLK for all Tegra devices. This moves Tegra to use driver model fully for MMC. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This function is called when the MMC block device is being probed. There is a recursive call in this function since find_mmc_device() itself can cause the MMC device to be probed. Admittedly the MMC device should already be probed, since we would not be probing its child otherwise, but the current code is unnecessarily convoluted. Rewrite this to access the MMC structure directly. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
When binding a new MMC device, make sure that it has the required operations. Since for now we still support *not* having the operations (with CONFIG_DM_MMC_OPS not enabled) it makes sense to add this check. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The intention with block devices is that the device number (devnum field in its descriptor) matches the alias of its parent device. For example, with: aliases { mmc0 = "/sdhci@700b0600"; mmc1 = "/sdhci@700b0400"; } we expect that the block devices for mmc0 and mmc1 would have device numbers of 0 and 1 respectively. Unfortunately this does not currently always happen. If there is another MMC device earlier in the driver model data structures its block device will be created first. It will therefore get device number 0 and mmc0 will therefore miss out. In this case the MMC device will have sequence number 0 but its block device will not. To avoid this, allow a device to request a device number and bump any existing device number that is using it. This all happens during the binding phase so it is safe to change these numbers around. This allows device numbers to match the aliases in all circumstances. Add a test to verify the behaviour. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
At present this code is inline. Move it into a function to allow it to be used elsewhere. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Sometimes it is useful to be able to find a block device without also probing it. Add a function for this as well as the associated test. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
With driver model MMC is probed automatically when needed. We should not re-init MMC each time. Signed-off-by:
Simon Glass <sjg@chromium.org>
-