aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* dm: gpio: power: Convert pm8916 drivers to livetreeSimon Glass2017-06-012-6/+4
| | | | | | | This PMIC driver (power and GPIO) is used by the sandbox SPMI tests. Update the drivers to support a live device tree so that the tests pass. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: sysreset: Convert driver to livetreeSimon Glass2017-06-011-1/+1
| | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: spi: Convert driver to support livetreeSimon Glass2017-06-011-4/+2
| | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: spi-flash: Convert uclass to livetreeSimon Glass2017-06-011-4/+3
| | | | | | Update the SPI flash uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: i2c_rtc: Drop fdtdec.h headerSimon Glass2017-06-011-1/+0
| | | | | | This is not needed in this driver. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: i2c: Drop fdtdec.h headerSimon Glass2017-06-011-1/+0
| | | | | | This is not needed in this driver. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: spi: Convert uclass to livetreeSimon Glass2017-06-011-17/+14
| | | | | | | | Update the SPI uclass to support a live device tree. Also adjust spi_slave_ofdata_to_platdata() to accept a device instead of a blob and offset. Signed-off-by: Simon Glass <sjg@chromium.org>
* cros_ec: Update the cros_ec keyboard driver to livetreeSimon Glass2017-06-013-24/+22
| | | | | | Update this driver and key_matrix to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Update the I2C eeprom driver for livetreeSimon Glass2017-06-011-5/+2
| | | | | | Update this driver so that it works with livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: pci: Update uclass to support livetreeSimon Glass2017-06-011-14/+12
| | | | | | | Update the PCI uclass to support livetree. This mostly involves fixing the address decoding from the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: reset: Update uclass to support livetreeSimon Glass2017-06-011-11/+10
| | | | | | | Update the reset domain uclass to support livetree. Fix the xlate() method which has no callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: power-domain: Update uclass to support livetreeSimon Glass2017-06-011-11/+8
| | | | | | | Update the power domain uclass to support livetree. Fix the xlate() method which has no callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: phy: Update driver for livetreeSimon Glass2017-06-011-2/+1
| | | | | | Update the sandbox phy driver to support livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: phy: Update uclass to support livetreeSimon Glass2017-06-011-12/+9
| | | | | | | Update the phy uclass to support livetree. Fix the xlate() method which has no callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mailbox: Update uclass to support livetreeSimon Glass2017-06-012-13/+9
| | | | | | | Update the mailbox uclass to support livetree. Fix the xlate() method in all callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: clk: fixed: Update to support livetreeSimon Glass2017-06-011-3/+2
| | | | | | Update the fixed-rate clock driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: clk: Update uclass to support livetreeSimon Glass2017-06-012-11/+8
| | | | | | Update the clk uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* clk: Modify xlate() method for livetreeSimon Glass2017-06-014-7/+7
| | | | | | | Update the xlate() method to use ofnode_phandle_args instead of the fdtdec variant. This will allow drivers to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: usb: Convert emulators to livetreeSimon Glass2017-06-012-5/+2
| | | | | | | Update the sandbox flash and hub USB emulators to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: usb: Convert uclass to livetreeSimon Glass2017-06-011-5/+3
| | | | | | Update the usb uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: adc: Convert uclass to livetreeSimon Glass2017-06-011-8/+6
| | | | | | Update the adc uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: Convert uclass to livetreeSimon Glass2017-06-011-1/+2
| | | | | | Update the mmc uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: regulator: Update fixed regulator to support livetree.Simon Glass2017-06-011-8/+9
| | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: regulator: Convert regulator uclass to support livetreeSimon Glass2017-06-011-23/+16
| | | | | | Update the regulator uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: pmic: Convert pmic emulator to support livetreeSimon Glass2017-06-011-4/+2
| | | | | | Update this driver to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: pmic: Convert uclass to livetreeSimon Glass2017-06-0110-58/+41
| | | | | | Update the pmic uclass and all pmics to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: i2c: Convert uclass to livetreeSimon Glass2017-06-011-15/+13
| | | | | | Update the i2c uclass to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add more livetree helpers and definitionsSimon Glass2017-06-011-2/+2
| | | | | | | | | | | Add some definitions and helpers for livetree in the main of.h header file. These include: - reading multi-cell integers - default number of address/size cells - functions for comparing names Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Rename a few functions in fdt_supportSimon Glass2017-06-015-6/+6
| | | | | | | | | | These two functions have an of_ prefix which conflicts with naming used in of_addr. Rename them: fdt_read_number fdt_support_bus_default_count_cells Signed-off-by: Simon Glass <sjg@chromium.org>
* cros_ec: Convert to support live treeSimon Glass2017-06-012-31/+25
| | | | | | | | | 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>
* cros_ec: Fix debug() statement in ec_command_inptr()Simon Glass2017-06-011-2/+1
| | | | | | This prints out the wrong pointers. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: Add live tree supportSimon Glass2017-06-0112-53/+51
| | | | | | | | | | | 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>
* dm: gpio: sandbox: Use dev_read...() functions to access DTSimon Glass2017-06-011-6/+3
| | | | | | | 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>
* dm: gpio: Refactor to prepare for live tree supportSimon Glass2017-06-017-27/+37
| | | | | | | | | | 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>
* dm: core: Update uclass_find_device_by_phandle() for livetreeSimon Glass2017-06-011-3/+2
| | | | | | Adjust this function to work with livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: simple-bus: Add support for livetreeSimon Glass2017-06-011-2/+1
| | | | | | Modify simple-bus to support livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: regmap: Add support for livetreeSimon Glass2017-06-011-15/+22
| | | | | | Modify regmap to support livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add a way to find a device by ofnodeSimon Glass2017-06-011-0/+37
| | | | | | | 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>
* dm: core: Scan the live tree when setting up driver modelSimon Glass2017-06-011-4/+54
| | | | | | | 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>
* dm: core: Update device_bind_driver_to_node() to use ofnodeSimon Glass2017-06-0112-48/+36
| | | | | | | 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>
* dm: core: Update lists_bind_fdt() to use ofnodeSimon Glass2017-06-014-9/+11
| | | | | | | 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>
* dm: core: Allow binding a device from a live treeSimon Glass2017-06-012-11/+9
| | | | | | | 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>
* dm: core: Implement live tree 'read' functionsSimon Glass2017-06-012-0/+143
| | | | | | | 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>
* dm: core: Add device-based 'read' functions to access DTSimon Glass2017-06-011-0/+4
| | | | | | | | | | | | | | 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>
* dm: core: Add a place to put extra device-tree reading functionsSimon Glass2017-06-012-1/+38
| | | | | | | | 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>
* dm: core: Add address operations on device tree referencesSimon Glass2017-06-011-0/+27
| | | | | | Add functions to add addresses in the device tree using ofnode references. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add livetree address functionsSimon Glass2017-06-012-1/+360
| | | | | | | | | 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>
* dm: core: Add operations on device tree referencesSimon Glass2017-06-012-0/+553
| | | | | | | | | | | | | | | | | | | | | | | 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>
* dm: core: Rename of_device_is_compatible()Simon Glass2017-06-018-11/+11
| | | | | | | 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>
* dm: core: Add livetree access functionsSimon Glass2017-06-012-0/+736
| | | | | | | | | 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>