Commit Graph

110 Commits

Author SHA1 Message Date
Jerome Brunet e5a1dadec3 reset: fix shared reset triggered_count decrement on error
For a shared reset, when the reset is successful, the triggered_count is
incremented when trying to call the reset callback, so that another device
sharing the same reset line won't trigger it again. If the reset has not
been triggered successfully, the trigger_count should be decremented.

The code does the opposite, and decrements the trigger_count on success.
As a consequence, another device sharing the reset will be able to trigger
it again.

Fixed be removing negation in from of the error code of the reset function.

Fixes: 7da33a37b4 ("reset: allow using reset_control_reset with shared reset")

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2017-02-17 08:11:47 +01:00
Linus Torvalds 991688bfc6 ARM: SoC driver updates for v4.10
Driver updates for ARM SoCs, including a couple of newly added drivers:
 
 - A new driver for the power management controller on TI Keystone
 - Support for the prerelease "SCPI" firmware protocol that ended up
   being shipped by Amlogic in their GXBB SoC.
 - A soc_device can now be matched using a glob from inside the
   kernel, when another driver wants to know the specific chip
   it is running on and cannot find out from DT, firmware or hardware.
 - Renesas SoCs now support identification through the soc_device
   interface, both in user space and kernel.
 - Renesas r8a7743 and r8a7745 gain support for their system controller
 - A new checking module for the ARM "PSCI" (not to be confused
   with "SCPI" mentioned above) firmware interface.
 - A new driver for the Tegra GMI memory interface
 - Support for the Tegra firmware interfaces with their
   power management controllers
 
 As usual, the updates for the reset controller framework are merged
 here, as they tend to touch multiple SoCs as well, including a new
 driver for the Oxford (now Broadcom) OX820 chip and the Tegra
 bpmp interface.
 
 The existing drivers for Atmel, Qualcomm, NVIDIA, TI Davinci, and
 Rockchips SoCs see some further updates.
 
 Conflicts:
 - ARCH_RENESAS now selects SOC_BUS, but no longer needs GPIOLIB
 - drivers/soc/renesas/Makefile: multiple files got added, keep
   all in logical sorting
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIVAwUAWFMaGWCrR//JCVInAQLs5RAA3I1I8/R+pd5jfMaAB8Od3S4g8YSqIDjC
 EIOoDPx9GDV70+cGs4ea+L9bfGs3ePGivCtcbftNsLDAueQ2jKMa3ShqxA/MMbJE
 rWQi/ARaDFY0nHL8VPWq7XyYwwrah+/gKBr8UhkaKI0vy6DBqxyCknrS2kgF88rv
 DVs2wnRvDM7GVUax0JDzuySR7BXJIuUfS78jPMESASbTQktsZTFUyH+osiqHtptD
 M5bPC8rxOeZXljt3DOvXSdK9rVnji/A3nznY4r3tlt805eaOA7CzjVSsY27WQel0
 63uj+FgE+eM0sECIxpkNbH/HHq2V4QkUoy3fk0xPkzRbllBBpS+UieGamTnPJup8
 wf5uiH1IqLLLV9F/504S92fp0pgFPpOGYWZnBDlIbh3aGq4tMjIRqRYMTyCT02hN
 +b54v0SuImFiN6p8HMS1ugYQ+1m9TU40b5pZkzkTJbSQOMm6oi3j0A0orXU/TPKd
 FVMrlUyfh+yu+vs1hGWLs1+mBjFnxXzSc8yJeaCdX4MvCY5/aVJZ+cwq4Bk+1YU5
 9Qhkeo5JV/l9FlrjxomnEq3l/WV/pFmj7JRZsb1BM88m+5LYUf2lv11b5B4FvrTd
 yx8SSpe3+ofIijdNbJ8IywF6y0OXF6UnrlouOVdSIp+wPs+pibdU/5gQep16pvqd
 WW6sVWn6quA=
 =6dP8
 -----END PGP SIGNATURE-----

Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC driver updates from Arnd Bergmann:
 "Driver updates for ARM SoCs, including a couple of newly added
  drivers:

   - A new driver for the power management controller on TI Keystone

   - Support for the prerelease "SCPI" firmware protocol that ended up
     being shipped by Amlogic in their GXBB SoC.

   - A soc_device can now be matched using a glob from inside the
     kernel, when another driver wants to know the specific chip it is
     running on and cannot find out from DT, firmware or hardware.

   - Renesas SoCs now support identification through the soc_device
     interface, both in user space and kernel.

   - Renesas r8a7743 and r8a7745 gain support for their system
     controller

   - A new checking module for the ARM "PSCI" (not to be confused with
     "SCPI" mentioned above) firmware interface.

   - A new driver for the Tegra GMI memory interface

   - Support for the Tegra firmware interfaces with their power
     management controllers

  As usual, the updates for the reset controller framework are merged
  here, as they tend to touch multiple SoCs as well, including a new
  driver for the Oxford (now Broadcom) OX820 chip and the Tegra bpmp
  interface.

  The existing drivers for Atmel, Qualcomm, NVIDIA, TI Davinci, and
  Rockchips SoCs see some further updates"

* tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (76 commits)
  misc: sram: remove useless #ifdef
  drivers: psci: Allow PSCI node to be disabled
  drivers: psci: PSCI checker module
  soc: renesas: Identify SoC and register with the SoC bus
  firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails
  firmware: qcom: scm: Remove core, iface and bus clocks dependency
  dt-bindings: firmware: scm: Add MSM8996 DT bindings
  memory: da8xx-ddrctl: drop the call to of_flat_dt_get_machine_name()
  bus: da8xx-mstpri: drop the call to of_flat_dt_get_machine_name()
  ARM: shmobile: Document DT bindings for Product Register
  soc: renesas: rcar-sysc: add R8A7745 support
  reset: Add Tegra BPMP reset driver
  dt-bindings: firmware: Allow child nodes inside the Tegra BPMP
  dt-bindings: Add power domains to Tegra BPMP firmware
  firmware: tegra: Add BPMP support
  firmware: tegra: Add IVC library
  dt-bindings: firmware: Add bindings for Tegra BPMP
  mailbox: tegra-hsp: Use after free in tegra_hsp_remove_doorbells()
  mailbox: Add Tegra HSP driver
  firmware: arm_scpi: add support for pre-v1.0 SCPI compatible
  ...
2016-12-15 16:03:25 -08:00
Olof Johansson 857ff3fddc reset: Add Tegra BPMP reset driver
This contains a patch which implements a reset driver using the services
 provided by the BPMP firmware (via the MRQ_RESET request).
 -----BEGIN PGP SIGNATURE-----
 
 iQIwBAABCAAaBQJYLyWXExx0cmVkaW5nQG52aWRpYS5jb20ACgkQ3SOs138+s6Gd
 cBAAqPY+xhbFwTKID/tWuR0bJ1gPG3gN3rjz2ZhY6aEvaGdyjMC9b5TTfvUKjj72
 Az7ewYrEWJwNdQ5D1zNY5hF+NTexLggskGzynnjufGJNcc+pVTq25tbitA9//aUr
 DK/1JIvgph9K40JG8kXLjbdh8bAX9Zfq46R/ymkxIla70Wedf0GJQ7c7+EPCCt6q
 E3yA4n5FA84hO/Z9h28fCSJ2tiusWSEh6q6rqc+nXcSaneQu+To8Ve2NB6tz7Bov
 fRuc1c+FCmlMO67vQWLuY9LkpNfUPy7ohNKWBsMAN+xCAKvMc+C7LDqofxo8JRQ7
 wmpj9DPY1wr1J12uA/gcgB39LC1ZcaUEna8MvvE4+jJ4teoWy5x47BbE4FJ7anyB
 vHHyDFOF5Gye7TjNeQIIpRrD2Hvqv5uvVJO4YIf2tGSJh+fgNjvWVh1XMYfpBguF
 hHjZCwAE+Pyket6e2gG/O3xieFXMuOkANvaT2w5MTAFHEulyMAYiEDika2SMK2je
 zuSgLVU8rS6G2EXdIJMf46nzRrHc46+LCXes8yJkqD3B9ZraRsQFu8hIhKzKIEg/
 iBuM/Ajc7bn+jfqqhRD4kAr+SkXnQmUbfgaAgpfiu0LwYFdQGi5k2s8zLHQxnILt
 CIIS7qcwdWqkRYbohF/Mc+7pcEbEDtq4622OmJC03KhIZ3E=
 =t06j
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-4.10-reset' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers

reset: Add Tegra BPMP reset driver

This contains a patch which implements a reset driver using the services
provided by the BPMP firmware (via the MRQ_RESET request).

* tag 'tegra-for-4.10-reset' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  reset: Add Tegra BPMP reset driver

Signed-off-by: Olof Johansson <olof@lixom.net>
2016-11-18 18:31:56 -08:00
Thierry Reding dc606c5205 reset: Add Tegra BPMP reset driver
This driver uses the services provided by the BPMP firmware driver to
implement a reset driver based on the MRQ_RESET request.

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2016-11-18 14:34:56 +01:00
Martin Blumenstingl 7da33a37b4 reset: allow using reset_control_reset with shared reset
Some SoCs (for example Amlogic GXBB) implement a reset controller which
only supports a reset pulse (triggered via reset_control_reset). At the
same time multiple devices (in case of the Amlogic GXBB SoC both USB
PHYs) are sharing the same reset line.

This patch allows using reset_control_reset also for shared resets.
There are limitations though:
reset_control_reset can only be used if reset_control_assert was not
used yet.
reset_control_assert can only be used if reset_control_reset was not
used yet.
For shared resets the reset is only triggered once for the lifetime of
the reset_control instance (the reset can be triggered again if all
consumers of that specific reset_control are gone, as the reset
framework will free the reset_control instance in that case).

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-11-14 09:58:28 +01:00
Paul Gortmaker cdd24f76fe reset: lpc18xx: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_LPC18XX
drivers/reset/Kconfig:  bool "LPC18xx/43xx Reset Driver" if COMPILE_TEST
drivers/reset/Kconfig:  default ARCH_LPC18XX

or

arch/arm/Kconfig:config ARCH_LPC18XX
arch/arm/Kconfig:       bool "NXP LPC18xx/LPC43xx"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-24 10:45:38 +02:00
Paul Gortmaker fadb03cd46 reset: zynq: make it explicitly non-modular
The Makefile/Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_ZYNQ
drivers/reset/Kconfig:  bool "ZYNQ Reset Driver" if COMPILE_TEST
drivers/reset/Kconfig:  default ARCH_ZYNQ

or

drivers/reset/Makefile:obj-$(CONFIG_ARCH_ZYNQ) += reset-zynq.o
arch/arm/mach-zynq/Kconfig:config ARCH_ZYNQ
arch/arm/mach-zynq/Kconfig:     bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the few remaining traces of modular macro usage, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-24 10:45:32 +02:00
Paul Gortmaker c4742ed32b reset: sunxi: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_SUNXI
drivers/reset/Kconfig:  bool "Allwinner SoCs Reset Driver" if COMPILE_TEST && !ARCH_SUNXI
drivers/reset/Kconfig:  default ARCH_SUNXI

or

arch/arm/mach-sunxi/Kconfig:menuconfig ARCH_SUNXI
arch/arm/mach-sunxi/Kconfig:    bool "Allwinner SoCs" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the few remaining traces of modular macro usage, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-24 10:45:31 +02:00
Paul Gortmaker 02163199be reset: socfpga: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_SOCFPGA
drivers/reset/Kconfig:  bool "SoCFPGA Reset Driver" if COMPILE_TEST
drivers/reset/Kconfig:  default ARCH_SOCFPGA

or

arch/arm/mach-socfpga/Kconfig:menuconfig ARCH_SOCFPGA
arch/arm/mach-socfpga/Kconfig:  bool "Altera SOCFPGA family" if ARCH_MULTI_V7

...meaning that it currently is not being built as a module by anyone.

Lets remove the small amount of modular evidence that remains, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-24 10:45:27 +02:00
Paul Gortmaker ed4dba99ca reset: berlin: make it explicitly non-modular
The Kconfig currently controlling compilation of this code is:

drivers/reset/Kconfig:config RESET_BERLIN
drivers/reset/Kconfig:  bool "Berlin Reset Driver" if COMPILE_TEST
drivers/reset/Kconfig:  default ARCH_BERLIN

or

arch/arm/mach-berlin/Kconfig:menuconfig ARCH_BERLIN
arch/arm/mach-berlin/Kconfig:   bool "Marvell Berlin SoCs" if ARCH_MULTI_V7

or

arch/arm64/Kconfig.platforms:config ARCH_BERLIN
arch/arm64/Kconfig.platforms:   bool "Marvell Berlin SoC Family"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Antoine Tenart <antoine.tenart@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-24 10:43:40 +02:00
Masahiro Yamada 19eb4a4722 reset: uniphier: rename MIO reset to SD reset for Pro5, PXs2, LD20 SoCs
I made a mistake as for naming for this block.  The MIO block is not
implemented for these 3 SoCs in the first place.  The current naming
will be a trouble if an SoC with both MIO and SD-ctrl blocks appear
in the future.

This driver has just been merged in the previous merge window.
Rename it before the release.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-22 18:31:42 +09:00
Neil Armstrong a68262bb1e reset: oxnas: Add OX820 support
In order to support the Oxford Semiconductor OX820 SoC, add a new
compatible string.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-20 11:54:55 +02:00
Peter Griffin 64933513e4 reset: sti: Remove STiH415/6 reset support
Support for STiH415/6 SoCs is being removed from the
kernel because the platforms are obsolete. This patch removes
the reset drivers for these SoC's.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-10-20 11:52:08 +02:00
Philipp Zabel cddb480016 reset: hi6220: allow to compile test driver on other architectures
Also remove the RESET_CONTROLLER dependency, this Kconfig file is
included inside the menuconfig already.

Cc: Chen Feng <puck.chen@hisilicon.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-30 17:09:14 +02:00
Philipp Zabel 6f51b86007 reset: zynq: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Cc: Moritz Fischer <moritz.fischer@ettus.com>
Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-30 17:08:51 +02:00
Philipp Zabel 0ae084195b reset: sunxi: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-30 09:38:46 +02:00
Philipp Zabel 7e0e901d41 reset: stm32: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Gabriel Fernandez <gabriel.fernandez@st.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-30 09:38:45 +02:00
Philipp Zabel 5c91407ed3 reset: socfpga: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Acked-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-30 09:38:44 +02:00
Philipp Zabel fab3f73098 reset: pistachio: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Cc: Damien Horsley <Damien.Horsley@imgtec.com>
Acked-by: James Hartley <james.hartley@imgtec.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-30 09:38:10 +02:00
Philipp Zabel 44336c24a9 reset: meson: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-25 13:27:44 +02:00
Philipp Zabel cd7f4b81cf reset: lpc18xx: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Acked-by: Joachim Eastwood <manabian@gmail.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-25 13:27:43 +02:00
Philipp Zabel 70d467ea16 reset: berlin: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Cc: Antoine Tenart <antoine.tenart@free-electrons.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-25 13:27:42 +02:00
Philipp Zabel e27b4a6e63 reset: ath79: add driver Kconfig option
Visible only if COMPILE_TEST is enabled, this allows to include the
driver in build tests.

Acked-by: Aban Bedel <albeu@free.fr>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-25 13:27:35 +02:00
Philipp Zabel 9e9ba091aa reset: ath79: add missing include
The driver uses readl/writel, so it should include linux/io.h.

Acked-by: Aban Bedel <albeu@free.fr>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-25 13:27:23 +02:00
Philipp Zabel a3774e146a reset: warn on invalid input to reset_control_reset/assert/deassert/status
Instead of potentially crashing, dump a backtrace and return -EINVAL if
rstc is NULL or an error code.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-24 15:21:36 +02:00
Masahiro Yamada 54e991b566 reset: uniphier: add reset controller driver for UniPhier SoCs
This is the initial commit for UniPhier reset controller driver.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-24 15:21:35 +02:00
Maxime Coquelin b70b009b24 drivers: reset: Add STM32 reset driver
The STM32 MCUs family IPs can be reset by accessing some registers
from the RCC block.

The list of available reset lines is documented in the DT bindings.

Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-08-24 15:21:28 +02:00
Philipp Zabel 6b37d3e956 reset: socfpga: no need to store modrst_offset
Since we can just add it to membase once, there is no need to store
modrst_offset separately, and to repeat the addition with every access.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
2016-08-08 19:23:32 +02:00
Andrew F. Davis cc7c2bb149 reset: add TI SYSCON based reset driver
Add a reset-controller driver for performing reset management of
various devices present on the SoC, with the reset registers shared
between devices in a common register memory space. This driver uses
the syscon/regmap frameworks to actually implement the various reset
functionalities needed by the reset consumer devices.

Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: add documentation, syscon name change]
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-06-29 23:39:10 +02:00
Xinliang Liu ab52b599c1 reset: hisilicon: Add hi6220 media subsystem reset support
Add hi6220 media subsystem reset controller.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Xia Qing <saberlily.xia@hisilicon.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-06-29 23:39:09 +02:00
Chen Feng 8768a26cea reset: hisilicon: Change to syscon register access
There are two reset controllers in hi6220 SoC:
The peripheral reset controller bits are part of sysctrl registers.
The media reset controller bits are part of mediactrl registers.

So change register access to syscon way.
And rename current reset controller to peripheral one.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Xia Qing <saberlily.xia@hisilicon.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-06-29 23:39:09 +02:00
Neil Armstrong c7224dc343 reset: Add support for the Amlogic Meson SoC Reset Controller
This patch adds the platform driver for the Amlogic Meson SoC Reset
Controller.

The Meson8b and GXBB SoCs are supported.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-06-01 08:21:10 +02:00
Neil Armstrong 42fa905bd9 reset: oxnas: Use devm register API and get rid of platform remove
Use the brand new devm_reset_controller_register() API to get rid of
the platform driver remove callback.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada 998cd4637f reset: fix Kconfig menu to include reset drivers in sub-menu
In "make menuconfig", reset drivers are currently lined up together
with the reset sub-system menu, like this:

    -*- Reset Controller Support  ----
    < > Hi6220 Reset Driver

(It also means, the menu "Reset Controller Support" is always empty.)

"Hi6220 Reset Driver" should go into the sub-menu of the
"Reset Controller Support".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada da1fda2a23 reset: zynq: use devm_reset_controller_register()
Use devm_reset_controller_register() for the reset controller
registration and drop the .remove callback.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada dc22e08ef7 reset: socfpga: use devm_reset_controller_register()
Use devm_reset_controller_register() for the reset controller
registration and drop the .remove callback.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada 2f38a88c7c reset: sunxi: use devm_reset_controller_register()
Use devm_reset_controller_register() for the reset controller
registration and drop the .remove callback.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada 1b1447f493 reset: pistachio: use devm_reset_controller_register()
Use devm_reset_controller_register() for the reset controller
registration and drop the .remove callback.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada 56865f452a reset: ath79: use devm_reset_controller_register()
Use devm_reset_controller_register() for the reset controller
registration and remove the unregister call from the .remove callback.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Masahiro Yamada 8d5b5d5ce5 reset: add devm_reset_controller_register API
Add a device managed API for reset_controller_register().

This helps in reducing code in .remove callbacks and sometimes
dropping .remove callbacks entirely.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-05-30 09:37:47 +02:00
Neil Armstrong 6e667fac82 reset: Add Oxford Semiconductor Reset Controller driver
Add System reset controller driver for Oxford Semiconductor OXNAS SoC
Family.

CC: Ma Haijun <mahaijuns@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-04-01 16:31:09 +02:00
Joachim Eastwood 773fe72630 reset: lpc18xx: get rid of global variables for restart notifier
Moving the notifier_block into the drivers priv struct allows us
to retrive the priv struct with container_of and remove the
global variables.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-30 15:42:07 +02:00
Hans de Goede 0b52297f22 reset: Add support for shared reset controls
In some SoCs some hw-blocks share a reset control. Add support for this
setup by adding new:

reset_control_get_shared()
devm_reset_control_get_shared()
devm_reset_control_get_shared_by_index()

methods to get a reset_control. Note that this patch omits adding of_
variants, if these are needed later they can be easily added.

This patch also changes the behavior of the existing exclusive
reset_control_get() variants, if these are now called more then once
for the same reset_control they will return -EBUSY. To catch existing
drivers triggering this error (there should not be any) a WARN_ON(1)
is added in this path.

When a reset_control is shared, the behavior of reset_control_assert /
deassert is changed, for shared reset_controls these will work like the
clock-enable/disable and regulator-on/off functions. They will keep a
deassert_count, and only (re-)assert the reset after reset_control_assert
has been called as many times as reset_control_deassert was called.

Calling reset_control_assert without first calling reset_control_deassert
is not allowed on a shared reset control. Calling reset_control_reset is
also not allowed on a shared reset control.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-30 15:42:05 +02:00
Hans de Goede c15ddec2ca reset: Share struct reset_control between reset_control_get calls
Now that struct reset_control no longer stores the device pointer for
the device calling reset_control_get we can share a single struct
reset_control when multiple calls to reset_control_get are made for
the same reset line (same id / index).

This is a preparation patch for adding support for shared reset lines.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-30 15:42:03 +02:00
Hans de Goede 6c96f05c8b reset: Make [of_]reset_control_get[_foo] functions wrappers
With both the regular, _by_index and _optional variants we already have
quite a few variants of [of_]reset_control_get[_foo], the upcoming
addition of shared reset lines support makes this worse.

This commit changes all the variants into wrappers around common core
functions. For completeness sake this commit also adds a new
devm_get_reset_control_by_index wrapper.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-03-30 15:42:01 +02:00
Philipp Zabel f673ed4d5f reset: sti: Make reset_control_ops const
The syscfg_reset_ops structure is never modified. Make it const.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-02-10 10:53:38 +01:00
Philipp Zabel 356d108f87 reset: zynq: Make reset_control_ops const
The zynq_reset_ops structure is never modified. Make it const.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-02-10 10:53:37 +01:00
Philipp Zabel 387eb3f3d5 reset: socfpga: Make reset_control_ops const
The socfpga_reset_ops structure is never modified. Make it const.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-02-10 10:53:36 +01:00
Philipp Zabel 0e18e60e1b reset: hi6220: Make reset_control_ops const
The hi6220_reset_ops structure is never modified. Make it const.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2016-02-10 10:53:35 +01:00
Philipp Zabel d2f79f223f reset: ath79: Make reset_control_ops const
The ath79_reset_ops structure is never modified. Make it const.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Alban Bedel <albeu@free.fr>
2016-02-10 10:53:34 +01:00