1. 21 Jul, 2015 8 commits
    • Masahiro Yamada's avatar
      dm: change dm_warn() message into debug() in uclass_add() · 643e6902
      Masahiro Yamada authored
      The command "dm uclass" tries to display all the UClasses, but
      some of them might be disabled by Kconfig.
      The function do_dm_dump_uclass() iterates over all the UClass IDs
      and calls uclass_get() for each of them.  Then, it displays annoying
      message "Cannot find uclass for id ..." every time it fails to get
      the UClass.
      As a result, we get much noisier log for the "dm uclass" command.
        => dm uclass
        uclass 0: root
        - * root_driver @ bfb54028, seq 0, (req -1)
        Cannot find uclass for id 1: please add the UCLASS_DRIVER() ...
        Cannot find uclass for id 2: please add the UCLASS_DRIVER() ...
        Cannot find uclass for id 3: please add the UCLASS_DRIVER() ...
        Cannot find uclass for id 4: please add the UCLASS_DRIVER() ...
        Cannot find uclass for id 5: please add the UCLASS_DRIVER() ...
        Cannot find uclass for id 6: please add the UCLASS_DRIVER() ...
      This commit suppresses these warnings.
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: core: Add device checking to syscon_get_regmap() · 9f4629be
      Simon Glass authored
      This function can only handle a syscon device. It is possible that someone
      will make a mistake, so add a check for this.
      Also we should return -ENODEV when a device cannot be found, so update the
      syscon_get_regmap_by_driver_data() to follow this convention.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: Add support for generic system controllers (syscon) · 57251285
      Simon Glass authored
      Many SoCs have a number of system controllers which are dealt with as a
      group by a single driver. It is a pain to have to add lots of compatible
      strings and/or separate drivers for each. Instead we can identify the
      controllers by a number and request the address of the one we want.
      Add a simple implementation of this which can be used by SoC driver code.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: Add support for register maps (regmap) · 6f98b750
      Simon Glass authored
      Add a simple implementaton of register maps, supporting only direct I/O
      for now. This can be enhanced later to support buses which have registers,
      such as I2C, SPI and PCI.
      It allows drivers which can operate with multiple buses to avoid dealing
      with the particulars of register access on that bus.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: core: Correct device_get_child_by_of_offset() parameter · 132f9bfc
      Simon Glass authored
      This parameter is named 'seq' but should be named 'of_offset'.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: core: Add a function to find any device from device tree · 2693047a
      Simon Glass authored
      In some rare cases it is useful to be able to locate a device given a device
      tree node offset. An example is when you have an alias that points to a node
      and you want to find the associated device. The device may be SPI, MMC or
      something else, but you don't need to know the uclass to find it.
      Add a function to do a global search for a device, given its device tree
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: core: Use debug() instead of printf() for failures · 3039811e
      Simon Glass authored
      To avoid bloating SPL code, use debug() where possible in the driver model
      core code. The error code is already returned, and can be investigated as
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: Move the tree/uclass dump code into its own file · 304fbef1
      Simon Glass authored
      In SPL it is sometimes useful to be able to obtain a dump of the current
      driver model state. Since commands are not available, provide a way to
      directly call the functions to output this information.
      Adjust the existing commands to use these functions.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
  2. 11 Jun, 2015 1 commit
  3. 30 Apr, 2015 1 commit
  4. 28 Apr, 2015 2 commits
  5. 23 Apr, 2015 4 commits
  6. 22 Apr, 2015 8 commits
  7. 18 Apr, 2015 5 commits
  8. 17 Apr, 2015 3 commits
    • Simon Glass's avatar
      dm: core: Add a uclass pre_probe() method for devices · 02c07b37
      Simon Glass authored
      Some uclasses want to set up a device before it is probed. Add a method
      for this.
      An example is with PCI, where a PCI uclass wants to set up its private
      data for later use. This allows the device's uclass() method to make calls
      whcih use that data (for example, read PCI memory regions from device
      tree, set up bus numbers).
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: core: Mark device as active before calling its probe() method · 02eeb1bb
      Simon Glass authored
      At present the device is not active when the probe() method is called. But
      some probe() methods want to set up the device and this can involve
      accessing it through normal methods. For example a PCI bus may wish to
      set up its PCI parameters using calls to pci_hose_write_config_dword() and
      At present this does not work because every such call within the probe()
      method sees that the device is not active and attempts to probe it.
      Already we mark the device as probed before calling the uclass post_probe()
      method. This is a subtle change but I believe the new approach is better.
      Since the scope of the change is only the probe() method and all its callees
      it should still be within the control of the board author.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dm: core: Add dev_get_uclass_priv() to access uclass private data · e564f054
      Simon Glass authored
      Add a convenience function to access the private data that a uclass stores
      for each of its devices. Convert over most existing uses for consistency
      and to provide an example for others.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
  9. 24 Feb, 2015 1 commit
  10. 12 Feb, 2015 4 commits
  11. 30 Jan, 2015 3 commits