summaryrefslogtreecommitdiffstats
path: root/drivers/soc/renesas/rcar-sysc.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'renesas-rcar-sysc-for-v4.13' of ↵Olof Johansson2017-06-181-24/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/drivers Renesas ARM Based SoC R-Car SYSC Updates for v4.13 Use GENPD_FLAG_ALWAYS_ON in R-Car SYSC driver * tag 'renesas-rcar-sysc-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ON Signed-off-by: Olof Johansson <olof@lixom.net>
| * soc: renesas: rcar-sysc: Use GENPD_FLAG_ALWAYS_ONGeert Uytterhoeven2017-06-151-24/+4
| | | | | | | | | | | | | | | | | | | | Improve handling of always-on PM domains by using the GENPD_FLAG_ALWAYS_ON flag introduced in commit ffaa42e8a40b7f10 ("PM / Domains: Enable users of genpd to specify always on PM domains"). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* | Merge tag 'renesas-drivers-for-v4.13' of ↵Olof Johansson2017-06-181-13/+11
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/drivers Renesas ARM Based SoC Drivers Updates for v4.13 * Rework Kconfig and Makefile logic * tag 'renesas-drivers-for-v4.13' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: soc: renesas: Rework Kconfig and Makefile logic Signed-off-by: Olof Johansson <olof@lixom.net>
| * soc: renesas: Rework Kconfig and Makefile logicGeert Uytterhoeven2017-06-121-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goals are to: - Allow precise control over and automatic selection of which (sub)drivers are used for which SoC, - Allow adding support for new SoCs easily, - Allow compile-testing of all (sub)drivers, - Keep driver selection logic in the subsystem-specific Kconfig, independent from the architecture-specific Kconfig (i.e. no "select" from arch/arm64/Kconfig.platforms), to avoid dependencies. This is implemented by: - Introducing Kconfig symbols for all drivers and sub-drivers, - Introducing the Kconfig symbol SOC_RENESAS, which is enabled automatically when building for a Renesas ARM platform, and which enables all required drivers without interaction of the user, based on SoC-specific ARCH_* symbols, - Allowing the user to enable any Kconfig symbol manually if COMPILE_TEST is enabled, - Using the new Kconfig symbols instead of the ARCH_* symbols to control compilation in the Makefile, - Always entering drivers/soc/renesas/ during the build. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* | soc: renesas: rcar-sysc: Add support for fixing up power area tablesGeert Uytterhoeven2017-04-071-1/+24
|/ | | | | | | | | | | | | | | | The same SoC may have different power areas, depending on SoC revision. One option is to use different sets of power area tables for each SoC revision. However, if the differences are small, it is much more space-efficient to have a single set of tables, and fix those up at runtime instead. Hence provide a helper to NULLify power areas that do not exist on some revisions (NULLified power areas are skipped during the registration phase), and support for an optional initialization callback to e.g. fix up power area tables. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* Merge tag 'renesas-r8a7745-sysc-for-v4.10' of ↵Arnd Bergmann2016-11-301-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/drivers Pull "Renesas ARM Based SoC r8a7745 SYSC Driver Updates for v4.10" from Simon Horman: * Add support for the r8a7745 SoC to rcar-sysc * tag 'renesas-r8a7745-sysc-for-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: soc: renesas: rcar-sysc: add R8A7745 support ARM: shmobile: r8a7745: add power domain index macros Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * soc: renesas: rcar-sysc: add R8A7745 supportSergei Shtylyov2016-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add support for RZ/G1E (R8A7745) SoC power areas to the R-Car SYSC driver. Based on the original (and large) patch by Dmitry Shifrin <dmitry.shifrin@cogentembedded.com>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* | soc: renesas: rcar-sysc: add R8A7743 supportSergei Shtylyov2016-10-171-0/+3
|/ | | | | | | | | | | Add support for RZ/G1M (R8A7743) SoC power areas to the R-Car SYSC driver. Based on the original (and large) patch by Dmitry Shifrin <dmitry.shifrin@cogentembedded.com>. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Improve SYSC interrupt config in legacy wrapperGeert Uytterhoeven2016-06-291-2/+15
| | | | | | | | | | | | Align SYSC interrupt configuration in the legacy wrapper with the DT version: - Mask SYSC interrupt sources before enabling them (doesn't matter much as they're disabled at the GIC level anyway), - Make sure not to clear reserved SYSCIMR bits that were set before. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Move SYSC interrupt config to rcar-sysc driverGeert Uytterhoeven2016-06-291-4/+8
| | | | | | | | | | | | | | | | | | | | On R-Car H1 and Gen2, the SYSC interrupt registers are always configured using hardcoded values in platform code. For R-Car Gen2, values are provided for H2 and M2-W only, other SoCs are not yet supported, and never will be. Move this configuration from SoC-specific platform code to the rcar_sysc_init() wrapper, so it can be skipped if the SYSC is configured from DT. This would be the case not only for H1, H2, and M2-W using a modern DTS, but also for other R-Car Gen2 SoCs not supported by the platform code, relying purely on DT. There is no longer a need to return the mapped register block, hence make the function return void. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Make rcar_sysc_init() init the PM domainsGeert Uytterhoeven2016-06-291-9/+11
| | | | | | | | | | Let rcar_sysc_init() trigger initialization of the SYSC PM domains from DT if called before the early_initcall. On failure, it falls back to mapping the passed register block, as before. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Fix uninitialized error code in rcar_sysc_pd_init()Geert Uytterhoeven2016-06-291-1/+1
| | | | | | | | | | | On success, rcar_sysc_pd_init() returns an uninitialized error code. Use the return value of of_genpd_add_provider_onecell() to fix this. This went unnoticed, as early_initcall() doesn't care about the return value. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: add R8A7792 supportSergei Shtylyov2016-06-161-0/+3
| | | | | | | | Add support for R-Car V2H (R8A7792) SoC power areas to the SYSC driver. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car M3-W power areasGeert Uytterhoeven2016-06-061-0/+3
| | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car H3 power areasGeert Uytterhoeven2016-04-261-0/+3
| | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car E2 power areasGeert Uytterhoeven2016-04-261-0/+3
| | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car M2-N power areasGeert Uytterhoeven2016-04-261-0/+4
| | | | | | | | | R-Car M2-N is identical to R-Car M2-W w.r.t. power domains, so reuse the definitions from the latter. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car M2-W power areasGeert Uytterhoeven2016-04-261-0/+3
| | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car H2 power areasGeert Uytterhoeven2016-04-261-0/+3
| | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add support for R-Car H1 power areasGeert Uytterhoeven2016-04-261-0/+3
| | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Enable Clock Domain for I/O devicesGeert Uytterhoeven2016-04-261-0/+18
| | | | | | | | | | | | | | | | | | | On R-Car H3, some power areas (e.g. A3VP) contain I/O devices, which are also part of the CPG/MSSR Clock Domain. On all R-Car SoCs, devices in the "always-on" PM Domain are part of the Clock Domain served by the CPG/MSSR or CPG/MSTP driver. Hook up the CPG/MSTP or CPG/MSSR Clock Domain attach/detach callbacks to enable power management using module clocks. Which callback to hook up depends on the presence of device nodes compatible with "renesas,cpg-mstp-clocks". This clears the path for a future migration from the CPG/MSTP to the CPG/MSSR driver on R-Car H1 and Gen2. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Make rcar_sysc_power_is_off() staticGeert Uytterhoeven2016-04-221-1/+1
| | | | | | | | | | As of commit b12ff41658171f53 ("ARM: shmobile: r8a7779: Remove legacy PM Domain remainings"), rcar_sysc_power_is_off() is no longer used from SoC-specific code. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Add DT support for SYSC PM domainsGeert Uytterhoeven2016-04-221-1/+201
| | | | | | | | | | | | | | | | | | Populate the SYSC PM domains from DT, based on the presence of a device node for the System Controller. The actual power area hiearchy, and features of specific areas are obtained from tables in the C code. The SYSCIER and SYSCIMR register values are derived from the power areas present, which will help to get rid of the hardcoded values in R-Car H1 and R-Car Gen2 platform code later. Initialization is done from an early_initcall(), to make sure the PM Domains are initialized before secondary CPU bringup. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: rcar-sysc: Improve rcar_sysc_power() debug infoGeert Uytterhoeven2016-04-221-1/+1
| | | | | | | | Print requested power domain state. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
* soc: renesas: Move pm-rcar to drivers/soc/renesas/rcar-syscGeert Uytterhoeven2016-04-221-0/+164
Move the pm-rcar driver from arch/arm/mach-shmobile/ to drivers/soc/renesas/, and its header file to include/linux/soc/renesas/, so it can be shared between arm32 (R-Car H1 and Gen2) and arm64 (R-Car Gen3). Rename it to rcar-sysc as it's really a driver for the R-Car System Controller (SYSC). Kill the intermediate PM_RCAR config symbol, as it's not user configurable anymore, and to prepare for SoC-specific make rules. Add the missing #include <linux/types.h> to rcar-sysc.h, which was exposed by different include order. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
OpenPOWER on IntegriCloud