1. 12 7月, 2016 1 次提交
    • A
      ARM: ux500: move soc_id driver to drivers/soc · 18a99278
      Arnd Bergmann 提交于
      As the ux500 id code is basically a standalone driver, we can move it
      out of the arch code into drivers/soc/ux500.
      
      This is a user-visible change, as it moves all the devices in sysfs
      from /sys/devices/soc0/ to /sys/devices/ and leaves the soc0 node as a
      separate device.
      
      Originally the idea was to put all on-chip devices under the soc node,
      and ux500 was the first platform to have this device, but later platforms
      almost all didn't follow that pattern, so this makes the platform do
      the same thing as everyone else.
      
      Since the platform is really obsolete now, I am optimistic that nothing
      will break after moving the devices around.
      
      As the SoC driver no longer has access to the private header files,
      I'm changing the code to instead look up the address of the backupram
      from devicetree, which is a good idea anyway.
      
      Finally, having a separate Kconfig symbol means the driver is now
      optional and could even be a loadable module rather than always being
      built-in if we allowed that for soc_device.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      [Fixup mising Makefile, fixup BB_UID_BASE to fc0]
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      18a99278
  2. 07 7月, 2016 1 次提交
  3. 06 7月, 2016 1 次提交
  4. 30 6月, 2016 11 次提交
    • J
      soc/tegra: pmc: Enable XUSB partitions on boot · 8df12745
      Jon Hunter 提交于
      The Tegra XHCI driver does not currently manage the Tegra XUSB power
      partitions and so it these partitions have not been enabled by the
      bootloader then the system will crash when probing the XHCI device.
      
      While proper support for managing the power partitions is being
      developed to the XHCI driver for Tegra, for now power on all the XUSB
      partitions for USB host and super-speed on boot if the XHCI driver is
      enabled.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      8df12745
    • J
      soc/tegra: pmc: Initialise power partitions early · e2d17960
      Jon Hunter 提交于
      If CONFIG_PM_GENERIC_DOMAINS is not enabled, then power partitions
      associated with a device will not be enabled automatically by the PM
      core when the device is in use. To avoid situations where a device in
      a power partition is to be used but the partition is not enabled,
      initialise the power partitions for Tegra early in the boot process and
      if CONFIG_PM_GENERIC_DOMAINS is not enabled, then power on all
      partitions defined in the device-tree blob.
      
      Note that if CONFIG_PM_GENERIC_DOMAINS is not enabled, after the
      partitions are turned on, the clocks and resets used as part of the
      sequence for turning on the partition are released again as they are no
      longer needed by the PMC driver. Another benefit of this is that this
      avoids any issues of sharing resets between the PMC driver and other
      device drivers that may wish to independently control a particular
      reset.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      e2d17960
    • J
      soc/tegra: pmc: Add specific error messages · c2710ac9
      Jon Hunter 提交于
      When initialising a powergate, only a single error message is shown if
      the initialisation fails. Add more error messages to give specific
      details of what failed if the initialisation failed and remove the
      generic failure message.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      c2710ac9
    • T
      soc/tegra: pmc: Use whitespace more consistently · da8f4b45
      Thierry Reding 提交于
      Use blank lines after blocks and before labels for consistency with the
      existing code in the file.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      da8f4b45
    • J
      soc/tegra: pmc: Don't probe PMC if early initialisation fails · a83f1fc3
      Jon Hunter 提交于
      Commit 0259f522 ('soc/tegra: pmc: Restore base address on probe
      failure') fixes an issue where the PMC base address pointer is not
      restored on probe failure. However, this fix creates another problem
      where if early initialisation of the PMC driver fails and an initial
      mapping for the PMC address space is not created, then when the PMC
      device is probed, the PMC base address pointer will not be valid and
      this will cause a crash when tegra_pmc_init() is called and attempts
      to access a register.
      
      Although the PMC address space is mapped a 2nd time during the probe
      and so this could be fixed by populating the base address pointer
      earlier during the probe, this adds more complexity to the code.
      Moreover, the PMC probe also assumes the the soc data pointer is also
      initialised when the device is probed and if not will also lead to a
      crash when calling tegra_pmc_init_tsense_reset(). Given that if the
      early initialisation does fail then something bad has happen, it seems
      acceptable to allow the PMC device probe to fail as well. Therefore, if
      the PMC base address pointer or soc data pointer are not valid when
      probing the PMC device, WARN and return an error.
      
      Fixes: 0259f522 ('soc/tegra: pmc: Restore base address on probe failure')
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      a83f1fc3
    • J
      soc/tegra: pmc: Add missing of_node_put() · b69a6258
      Jon Hunter 提交于
      Add missing of_node_put() in PMC early initialisation function to avoid
      leaking the device nodes.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      [treding@nvidia.com: squash in a couple more of_node_put() calls]
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      b69a6258
    • J
      soc/tegra: pmc: Ensure mutex is always initialised · 61fd284b
      Jon Hunter 提交于
      The mutex used by the PMC driver may not be initialised if early
      initialisation of the driver fails. If this does happen, then it could
      be possible for callers of the public PMC functions to still attempt to
      acquire the mutex. Fix this by initialising the mutex as soon as
      possible to ensure it will always be initialised.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      61fd284b
    • J
      soc/tegra: pmc: Don't populate SoC data until register space is mapped · 718a2426
      Jon Hunter 提交于
      The public functions exported by the PMC driver use the presence of the
      SoC data pointer to determine if the PMC device is configured and the
      registers can be accessed. However, the SoC data is populated before the
      PMC register space is mapped and this opens a window where the SoC data
      pointer is valid but the register space has not yet been mapped which
      could lead to a crash. Furthermore, if the mapping of the PMC register
      space fails, then the SoC data pointer is not cleared and so would
      expose a larger window where a crash could occur.
      
      Fix this by initialising the SoC data pointer after the PMC register
      space has been mapped.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      718a2426
    • J
      soc/tegra: pmc: Fix early initialisation of PMC · 11131895
      Jon Hunter 提交于
      During early initialisation, the available power partitions for a given
      device is configured as well as the polarity of the PMC interrupt. Both
      of which should only be configured if there is a valid device node for
      the PMC device. This is because the soc data used for configuring the
      power partitions is only available if a device node for the PMC is found
      and the code to configure the interrupt polarity uses the device node
      pointer directly.
      
      Some early device-tree images may not have this device node and so fix
      this by ensuring the device node pointer is valid when configuring these
      items.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      11131895
    • J
      soc/tegra: pmc: Ensure powergate is available when powering on · 403db2d2
      Jon Hunter 提交于
      The function tegra_power_sequence_power_up() is a public function used
      to power on a partition. When this function is called, we do not check
      to see if the partition being powered up is valid/available. Fix this
      by checking to see that the partition is valid/available.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      403db2d2
    • J
      soc/tegra: pmc: Initialise resets associated with a power partition · 05cfb988
      Jon Hunter 提交于
      When registering the Tegra power partitions with the generic PM domain
      framework, the current state of the each partition is checked and used
      as the default state for the partition. However, the state of each reset
      associated with the partition is not initialised and so it is possible
      that the state of the resets are not in the expected state. For example,
      if a partition is on, then the resets should be de-asserted and if the
      partition is off, the resets should be asserted.
      
      There have been cases where the bootloader has powered on a partition
      and only de-asserted some of the resets to some of the devices in the
      partition. This can cause accesses to these devices to hang the system
      when the kernel boots and attempts to probe these devices.
      
      Ideally, the driver for the device should ensure the reset has been
      de-asserted when probing, but the resets cannot be shared between the
      PMC driver (that needs to de-assert/assert the reset when turning the
      partition on or off) and another driver because we cannot ensure the
      reset is in the correct state.
      
      To ensure the resets are in the correct state, when using the generic
      PM domain framework, put each reset associated with the partition in
      the correct state (based upon the partition's current state) when
      obtaining the resets for a partition.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      05cfb988
  5. 29 6月, 2016 4 次提交
  6. 25 6月, 2016 4 次提交
  7. 16 6月, 2016 1 次提交
  8. 10 6月, 2016 1 次提交
  9. 08 6月, 2016 4 次提交
  10. 06 6月, 2016 1 次提交
  11. 01 6月, 2016 1 次提交
  12. 30 5月, 2016 3 次提交
  13. 19 5月, 2016 1 次提交
    • A
      soc: mtk-pmic-wrap: avoid integer overflow warning · 7f058c0a
      Arnd Bergmann 提交于
      On ARM64, the mtk-pmic-wrap driver causes a harmless warning:
      
      mtk-pmic-wrap.c:1062:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
      mtk-pmic-wrap.c:1074:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
      mtk-pmic-wrap.c:1086:16: warning: large integer implicitly truncated to unsigned type [-Woverflow]
        .int_en_all = ~(BIT(31) | BIT(1)),
      
      The problem is that the result of the BIT() macro is an 'unsigned long',
      so taking the bitwise NOT operation of that results in an integer
      with the upper 32 bits all set and that cannot be assigned to a
      'u32' variable without loss of information.
      
      This is harmless because we were never interested in the upper bits
      here anyway, so we can shut up the warning by adding a simple cast
      to 'u32'.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      7f058c0a
  14. 29 4月, 2016 1 次提交
    • J
      soc/tegra: pmc: Add generic PM domain support · a3804512
      Jon Hunter 提交于
      Adds generic PM domain support to the PMC driver where the PM domains
      are populated from device-tree and the PM domain consumer devices are
      bound to their relevant PM domains via device-tree as well.
      
      Update the tegra_powergate_sequence_power_up() API so that internally
      it calls the same tegra_powergate_xxx functions that are used by the
      Tegra generic PM domain code for consistency.
      
      To ensure that the Tegra power domains (a.k.a. powergates) cannot be
      controlled via both the legacy tegra_powergate_xxx functions as well
      as the generic PM domain framework, add a bit map for available
      powergates that can be controlled via the legacy powergate functions.
      
      Move the majority of the tegra_powergate_remove_clamping() function
      to a sub-function, so that this can be used by both the legacy and
      generic power domain code.
      
      This is based upon work by Thierry Reding <treding@nvidia.com>
      and Vince Hsu <vinceh@nvidia.com>.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      a3804512
  15. 26 4月, 2016 5 次提交