aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-23 18:57:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-23 18:57:04 -0500
commitb2e3c4319d40c9055c3c587cdb82ba69b50e919d (patch)
tree223bc161e96a5d39752dc056fed8d412c291e72a
parentc61c15e08abb4365f100e411604b57a03ee5ae90 (diff)
parentdb27dd05b1da6e658494a2570680f8d0ddbc578c (diff)
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. A handful of driver changes this time around. The larger changes are: - Reset drivers for hi3660 and zx2967 - AHCI driver for Davinci, acked by Tejun and brought in here due to platform dependencies - Cleanups of atmel-ebi (External Bus Interface) - Tweaks for Rockchip GRF (General Register File) usage (kitchensink misc register range on the SoCs) - PM domains changes for support of two new ZTE SoCs (zx296718 and zx2967)" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (53 commits) soc: samsung: pmu: Add register defines for pad retention control reset: make zx2967 explicitly non-modular reset: core: fix reset_control_put soc: samsung: pm_domains: Read domain name from the new label property soc: samsung: pm_domains: Remove message about failed memory allocation soc: samsung: pm_domains: Remove unused name field soc: samsung: pm_domains: Use full names in subdomains registration log sata: ahci-da850: un-hardcode the MPY bits sata: ahci-da850: add a workaround for controller instability sata: ahci: export ahci_do_hardreset() locally sata: ahci-da850: implement a workaround for the softreset quirk sata: ahci-da850: add device tree match table sata: ahci-da850: get the sata clock using a connection id soc: samsung: pmu: Remove duplicated define for ARM_L2_OPTION register memory: atmel-ebi: Enable the SMC clock if specified soc: samsung: pmu: Remove unused and duplicated defines memory: atmel-ebi: Properly handle multiple reference to the same CS memory: atmel-ebi: Fix the test to enable generic SMC logic soc: samsung: pm_domains: Add new Exynos5433 compatible soc: samsung: pmu: Add dummy support for Exynos5433 SoC ...
-rw-r--r--Documentation/devicetree/bindings/power/pd-samsung.txt5
-rw-r--r--Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt43
-rw-r--r--Documentation/devicetree/bindings/reset/ti-syscon-reset.txt8
-rw-r--r--Documentation/devicetree/bindings/reset/uniphier-reset.txt47
-rw-r--r--Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt20
-rw-r--r--Documentation/devicetree/bindings/soc/rockchip/grf.txt4
-rw-r--r--Documentation/devicetree/bindings/soc/rockchip/power_domain.txt3
-rw-r--r--Documentation/devicetree/bindings/soc/zte/pd-2967xx.txt19
-rw-r--r--MAINTAINERS7
-rw-r--r--arch/arm/mach-exynos/suspend.c6
-rw-r--r--arch/arm/mach-rockchip/rockchip.c12
-rw-r--r--drivers/ata/ahci.h3
-rw-r--r--drivers/ata/ahci_da850.c175
-rw-r--r--drivers/ata/libahci.c18
-rw-r--r--drivers/bus/Kconfig1
-rw-r--r--drivers/firmware/qcom_scm-32.c18
-rw-r--r--drivers/firmware/qcom_scm-64.c16
-rw-r--r--drivers/firmware/qcom_scm.c8
-rw-r--r--drivers/firmware/qcom_scm.h2
-rw-r--r--drivers/memory/atmel-ebi.c126
-rw-r--r--drivers/memory/tegra/tegra124-emc.c5
-rw-r--r--drivers/reset/Kconfig6
-rw-r--r--drivers/reset/Makefile1
-rw-r--r--drivers/reset/core.c55
-rw-r--r--drivers/reset/hisilicon/Kconfig7
-rw-r--r--drivers/reset/hisilicon/Makefile1
-rw-r--r--drivers/reset/hisilicon/reset-hi3660.c126
-rw-r--r--drivers/reset/reset-ti-syscon.c6
-rw-r--r--drivers/reset/reset-uniphier.c4
-rw-r--r--drivers/reset/reset-zx2967.c99
-rw-r--r--drivers/soc/Kconfig1
-rw-r--r--drivers/soc/Makefile1
-rw-r--r--drivers/soc/rockchip/Kconfig10
-rw-r--r--drivers/soc/rockchip/Makefile1
-rw-r--r--drivers/soc/rockchip/grf.c134
-rw-r--r--drivers/soc/rockchip/pm_domains.c63
-rw-r--r--drivers/soc/samsung/exynos-pmu.c6
-rw-r--r--drivers/soc/samsung/exynos5250-pmu.c2
-rw-r--r--drivers/soc/samsung/exynos5420-pmu.c4
-rw-r--r--drivers/soc/samsung/pm_domains.c31
-rw-r--r--drivers/soc/ti/knav_dma.c4
-rw-r--r--drivers/soc/ti/knav_qmss_acc.c15
-rw-r--r--drivers/soc/ti/knav_qmss_queue.c25
-rw-r--r--drivers/soc/ti/wkup_m3_ipc.c2
-rw-r--r--drivers/soc/zte/Kconfig13
-rw-r--r--drivers/soc/zte/Makefile5
-rw-r--r--drivers/soc/zte/zx296718_pm_domains.c182
-rw-r--r--drivers/soc/zte/zx2967_pm_domains.c143
-rw-r--r--drivers/soc/zte/zx2967_pm_domains.h44
-rw-r--r--include/dt-bindings/power/rk3328-power.h18
-rw-r--r--include/dt-bindings/soc/zte,pm_domains.h24
-rw-r--r--include/linux/qcom_scm.h54
-rw-r--r--include/linux/reset.h45
-rw-r--r--include/linux/soc/samsung/exynos-regs-pmu.h91
54 files changed, 1481 insertions, 288 deletions
diff --git a/Documentation/devicetree/bindings/power/pd-samsung.txt b/Documentation/devicetree/bindings/power/pd-samsung.txt
index 4e947372a693..7eb9674e9687 100644
--- a/Documentation/devicetree/bindings/power/pd-samsung.txt
+++ b/Documentation/devicetree/bindings/power/pd-samsung.txt
@@ -6,12 +6,15 @@ to gate power to one or more peripherals on the processor.
6Required Properties: 6Required Properties:
7- compatible: should be one of the following. 7- compatible: should be one of the following.
8 * samsung,exynos4210-pd - for exynos4210 type power domain. 8 * samsung,exynos4210-pd - for exynos4210 type power domain.
9 * samsung,exynos5433-pd - for exynos5433 type power domain.
9- reg: physical base address of the controller and length of memory mapped 10- reg: physical base address of the controller and length of memory mapped
10 region. 11 region.
11- #power-domain-cells: number of cells in power domain specifier; 12- #power-domain-cells: number of cells in power domain specifier;
12 must be 0. 13 must be 0.
13 14
14Optional Properties: 15Optional Properties:
16- label: Human readable string with domain name. Will be visible in userspace
17 to let user to distinguish between multiple domains in SoC.
15- clocks: List of clock handles. The parent clocks of the input clocks to the 18- clocks: List of clock handles. The parent clocks of the input clocks to the
16 devices in this power domain are set to oscclk before power gating 19 devices in this power domain are set to oscclk before power gating
17 and restored back after powering on a domain. This is required for 20 and restored back after powering on a domain. This is required for
@@ -38,6 +41,7 @@ Example:
38 compatible = "samsung,exynos4210-pd"; 41 compatible = "samsung,exynos4210-pd";
39 reg = <0x10023C00 0x10>; 42 reg = <0x10023C00 0x10>;
40 #power-domain-cells = <0>; 43 #power-domain-cells = <0>;
44 label = "LCD0";
41 }; 45 };
42 46
43 mfc_pd: power-domain@10044060 { 47 mfc_pd: power-domain@10044060 {
@@ -46,6 +50,7 @@ Example:
46 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; 50 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>;
47 clock-names = "oscclk", "clk0"; 51 clock-names = "oscclk", "clk0";
48 #power-domain-cells = <0>; 52 #power-domain-cells = <0>;
53 label = "MFC";
49 }; 54 };
50 55
51See Documentation/devicetree/bindings/power/power_domain.txt for description 56See Documentation/devicetree/bindings/power/power_domain.txt for description
diff --git a/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt b/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt
new file mode 100644
index 000000000000..2bf3344b2a02
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt
@@ -0,0 +1,43 @@
1Hisilicon System Reset Controller
2======================================
3
4Please also refer to reset.txt in this directory for common reset
5controller binding usage.
6
7The reset controller registers are part of the system-ctl block on
8hi3660 SoC.
9
10Required properties:
11- compatible: should be
12 "hisilicon,hi3660-reset"
13- hisi,rst-syscon: phandle of the reset's syscon.
14- #reset-cells : Specifies the number of cells needed to encode a
15 reset source. The type shall be a <u32> and the value shall be 2.
16
17 Cell #1 : offset of the reset assert control
18 register from the syscon register base
19 offset + 4: deassert control register
20 offset + 8: status control register
21 Cell #2 : bit position of the reset in the reset control register
22
23Example:
24 iomcu: iomcu@ffd7e000 {
25 compatible = "hisilicon,hi3660-iomcu", "syscon";
26 reg = <0x0 0xffd7e000 0x0 0x1000>;
27 };
28
29 iomcu_rst: iomcu_rst_controller {
30 compatible = "hisilicon,hi3660-reset";
31 hisi,rst-syscon = <&iomcu>;
32 #reset-cells = <2>;
33 };
34
35Specifying reset lines connected to IP modules
36==============================================
37example:
38
39 i2c0: i2c@..... {
40 ...
41 resets = <&iomcu_rst 0x20 3>; /* offset: 0x20; bit: 3 */
42 ...
43 };
diff --git a/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt b/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt
index 164c7f34c451..c516d24959f2 100644
--- a/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt
+++ b/Documentation/devicetree/bindings/reset/ti-syscon-reset.txt
@@ -63,7 +63,7 @@ Example:
63-------- 63--------
64The following example demonstrates a syscon node, the reset controller node 64The following example demonstrates a syscon node, the reset controller node
65using the syscon node, and a consumer (a DSP device) on the TI Keystone 2 65using the syscon node, and a consumer (a DSP device) on the TI Keystone 2
66Edison SoC. 6666AK2E SoC.
67 67
68/ { 68/ {
69 soc { 69 soc {
@@ -71,13 +71,13 @@ Edison SoC.
71 compatible = "syscon", "simple-mfd"; 71 compatible = "syscon", "simple-mfd";
72 reg = <0x02350000 0x1000>; 72 reg = <0x02350000 0x1000>;
73 73
74 pscrst: psc-reset { 74 pscrst: reset-controller {
75 compatible = "ti,k2e-pscrst", "ti,syscon-reset"; 75 compatible = "ti,k2e-pscrst", "ti,syscon-reset";
76 #reset-cells = <1>; 76 #reset-cells = <1>;
77 77
78 ti,reset-bits = < 78 ti,reset-bits = <
79 0xa3c 8 0xa3c 8 0x83c 8 (ASSERT_SET|DEASSERT_CLEAR|STATUS_SET) /* 0: pcrst-dsp0 */ 79 0xa3c 8 0xa3c 8 0x83c 8 (ASSERT_CLEAR | DEASSERT_SET | STATUS_CLEAR) /* 0: dsp0 */
80 0xa40 5 0xa44 3 0 0 (ASSERT_SET|DEASSERT_CLEAR|STATUS_NONE) /* 1: pcrst-example */ 80 0xa40 5 0xa44 3 0 0 (ASSERT_SET | DEASSERT_CLEAR | STATUS_NONE) /* 1: example */
81 >; 81 >;
82 }; 82 };
83 }; 83 };
diff --git a/Documentation/devicetree/bindings/reset/uniphier-reset.txt b/Documentation/devicetree/bindings/reset/uniphier-reset.txt
index 5020524cddeb..83ab0f599c40 100644
--- a/Documentation/devicetree/bindings/reset/uniphier-reset.txt
+++ b/Documentation/devicetree/bindings/reset/uniphier-reset.txt
@@ -6,14 +6,14 @@ System reset
6 6
7Required properties: 7Required properties:
8- compatible: should be one of the following: 8- compatible: should be one of the following:
9 "socionext,uniphier-sld3-reset" - for sLD3 SoC. 9 "socionext,uniphier-sld3-reset" - for sLD3 SoC
10 "socionext,uniphier-ld4-reset" - for LD4 SoC. 10 "socionext,uniphier-ld4-reset" - for LD4 SoC
11 "socionext,uniphier-pro4-reset" - for Pro4 SoC. 11 "socionext,uniphier-pro4-reset" - for Pro4 SoC
12 "socionext,uniphier-sld8-reset" - for sLD8 SoC. 12 "socionext,uniphier-sld8-reset" - for sLD8 SoC
13 "socionext,uniphier-pro5-reset" - for Pro5 SoC. 13 "socionext,uniphier-pro5-reset" - for Pro5 SoC
14 "socionext,uniphier-pxs2-reset" - for PXs2/LD6b SoC. 14 "socionext,uniphier-pxs2-reset" - for PXs2/LD6b SoC
15 "socionext,uniphier-ld11-reset" - for LD11 SoC. 15 "socionext,uniphier-ld11-reset" - for LD11 SoC
16 "socionext,uniphier-ld20-reset" - for LD20 SoC. 16 "socionext,uniphier-ld20-reset" - for LD20 SoC
17- #reset-cells: should be 1. 17- #reset-cells: should be 1.
18 18
19Example: 19Example:
@@ -37,14 +37,15 @@ Media I/O (MIO) reset, SD reset
37 37
38Required properties: 38Required properties:
39- compatible: should be one of the following: 39- compatible: should be one of the following:
40 "socionext,uniphier-sld3-mio-reset" - for sLD3 SoC. 40 "socionext,uniphier-sld3-mio-reset" - for sLD3 SoC
41 "socionext,uniphier-ld4-mio-reset" - for LD4 SoC. 41 "socionext,uniphier-ld4-mio-reset" - for LD4 SoC
42 "socionext,uniphier-pro4-mio-reset" - for Pro4 SoC. 42 "socionext,uniphier-pro4-mio-reset" - for Pro4 SoC
43 "socionext,uniphier-sld8-mio-reset" - for sLD8 SoC. 43 "socionext,uniphier-sld8-mio-reset" - for sLD8 SoC
44 "socionext,uniphier-pro5-sd-reset" - for Pro5 SoC. 44 "socionext,uniphier-pro5-sd-reset" - for Pro5 SoC
45 "socionext,uniphier-pxs2-sd-reset" - for PXs2/LD6b SoC. 45 "socionext,uniphier-pxs2-sd-reset" - for PXs2/LD6b SoC
46 "socionext,uniphier-ld11-mio-reset" - for LD11 SoC. 46 "socionext,uniphier-ld11-mio-reset" - for LD11 SoC (MIO)
47 "socionext,uniphier-ld20-sd-reset" - for LD20 SoC. 47 "socionext,uniphier-ld11-sd-reset" - for LD11 SoC (SD)
48 "socionext,uniphier-ld20-sd-reset" - for LD20 SoC
48- #reset-cells: should be 1. 49- #reset-cells: should be 1.
49 50
50Example: 51Example:
@@ -68,13 +69,13 @@ Peripheral reset
68 69
69Required properties: 70Required properties:
70- compatible: should be one of the following: 71- compatible: should be one of the following:
71 "socionext,uniphier-ld4-peri-reset" - for LD4 SoC. 72 "socionext,uniphier-ld4-peri-reset" - for LD4 SoC
72 "socionext,uniphier-pro4-peri-reset" - for Pro4 SoC. 73 "socionext,uniphier-pro4-peri-reset" - for Pro4 SoC
73 "socionext,uniphier-sld8-peri-reset" - for sLD8 SoC. 74 "socionext,uniphier-sld8-peri-reset" - for sLD8 SoC
74 "socionext,uniphier-pro5-peri-reset" - for Pro5 SoC. 75 "socionext,uniphier-pro5-peri-reset" - for Pro5 SoC
75 "socionext,uniphier-pxs2-peri-reset" - for PXs2/LD6b SoC. 76 "socionext,uniphier-pxs2-peri-reset" - for PXs2/LD6b SoC
76 "socionext,uniphier-ld11-peri-reset" - for LD11 SoC. 77 "socionext,uniphier-ld11-peri-reset" - for LD11 SoC
77 "socionext,uniphier-ld20-peri-reset" - for LD20 SoC. 78 "socionext,uniphier-ld20-peri-reset" - for LD20 SoC
78- #reset-cells: should be 1. 79- #reset-cells: should be 1.
79 80
80Example: 81Example:
diff --git a/Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt b/Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt
new file mode 100644
index 000000000000..b015508f9780
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt
@@ -0,0 +1,20 @@
1ZTE zx2967 SoCs Reset Controller
2=======================================
3
4Please also refer to reset.txt in this directory for common reset
5controller binding usage.
6
7Required properties:
8- compatible: should be one of the following.
9 * zte,zx296718-reset
10- reg: physical base address of the controller and length of memory mapped
11 region.
12- #reset-cells: must be 1.
13
14example:
15
16 reset: reset-controller@1461060 {
17 compatible = "zte,zx296718-reset";
18 reg = <0x01461060 0x8>;
19 #reset-cells = <1>;
20 };
diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.txt b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
index 013e71a2cdc7..c6e62cb30712 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/grf.txt
+++ b/Documentation/devicetree/bindings/soc/rockchip/grf.txt
@@ -5,11 +5,13 @@ is composed of many registers for system control.
5 5
6From RK3368 SoCs, the GRF is divided into two sections, 6From RK3368 SoCs, the GRF is divided into two sections,
7- GRF, used for general non-secure system, 7- GRF, used for general non-secure system,
8- SGRF, used for general secure system,
8- PMUGRF, used for always on system 9- PMUGRF, used for always on system
9 10
10Required Properties: 11Required Properties:
11 12
12- compatible: GRF should be one of the followings 13- compatible: GRF should be one of the followings
14 - "rockchip,rk3036-grf", "syscon": for rk3036
13 - "rockchip,rk3066-grf", "syscon": for rk3066 15 - "rockchip,rk3066-grf", "syscon": for rk3066
14 - "rockchip,rk3188-grf", "syscon": for rk3188 16 - "rockchip,rk3188-grf", "syscon": for rk3188
15 - "rockchip,rk3228-grf", "syscon": for rk3228 17 - "rockchip,rk3228-grf", "syscon": for rk3228
@@ -19,6 +21,8 @@ Required Properties:
19- compatible: PMUGRF should be one of the followings 21- compatible: PMUGRF should be one of the followings
20 - "rockchip,rk3368-pmugrf", "syscon": for rk3368 22 - "rockchip,rk3368-pmugrf", "syscon": for rk3368
21 - "rockchip,rk3399-pmugrf", "syscon": for rk3399 23 - "rockchip,rk3399-pmugrf", "syscon": for rk3399
24- compatible: SGRF should be one of the following
25 - "rockchip,rk3288-sgrf", "syscon": for rk3288
22- reg: physical base address of the controller and length of memory mapped 26- reg: physical base address of the controller and length of memory mapped
23 region. 27 region.
24 28
diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
index f909ce06afc4..01bfb6745fbd 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
+++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
@@ -6,6 +6,7 @@ powered up/down by software based on different application scenes to save power.
6Required properties for power domain controller: 6Required properties for power domain controller:
7- compatible: Should be one of the following. 7- compatible: Should be one of the following.
8 "rockchip,rk3288-power-controller" - for RK3288 SoCs. 8 "rockchip,rk3288-power-controller" - for RK3288 SoCs.
9 "rockchip,rk3328-power-controller" - for RK3328 SoCs.
9 "rockchip,rk3368-power-controller" - for RK3368 SoCs. 10 "rockchip,rk3368-power-controller" - for RK3368 SoCs.
10 "rockchip,rk3399-power-controller" - for RK3399 SoCs. 11 "rockchip,rk3399-power-controller" - for RK3399 SoCs.
11- #power-domain-cells: Number of cells in a power-domain specifier. 12- #power-domain-cells: Number of cells in a power-domain specifier.
@@ -16,6 +17,7 @@ Required properties for power domain controller:
16Required properties for power domain sub nodes: 17Required properties for power domain sub nodes:
17- reg: index of the power domain, should use macros in: 18- reg: index of the power domain, should use macros in:
18 "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. 19 "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain.
20 "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain.
19 "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. 21 "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain.
20 "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. 22 "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain.
21- clocks (optional): phandles to clocks which need to be enabled while power domain 23- clocks (optional): phandles to clocks which need to be enabled while power domain
@@ -90,6 +92,7 @@ containing a phandle to the power device node and an index specifying which
90power domain to use. 92power domain to use.
91The index should use macros in: 93The index should use macros in:
92 "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. 94 "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain.
95 "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain.
93 "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. 96 "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain.
94 "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. 97 "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain.
95 98
diff --git a/Documentation/devicetree/bindings/soc/zte/pd-2967xx.txt b/Documentation/devicetree/bindings/soc/zte/pd-2967xx.txt
new file mode 100644
index 000000000000..7629de1c2c72
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/zte/pd-2967xx.txt
@@ -0,0 +1,19 @@
1* ZTE zx2967 family Power Domains
2
3zx2967 family includes support for multiple power domains which are used
4to gate power to one or more peripherals on the processor.
5
6Required Properties:
7 - compatible: should be one of the following.
8 * zte,zx296718-pcu - for zx296718 power domain.
9 - reg: physical base address of the controller and length of memory mapped
10 region.
11 - #power-domain-cells: Must be 1.
12
13Example:
14
15 pcu_domain: pcu@117000 {
16 compatible = "zte,zx296718-pcu";
17 reg = <0x00117000 0x1000>;
18 #power-domain-cells = <1>;
19 };
diff --git a/MAINTAINERS b/MAINTAINERS
index 3ac9346cf6a8..1b3a9cb8d7f1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1633,6 +1633,7 @@ F: arch/arm64/boot/dts/qcom/*
1633F: drivers/i2c/busses/i2c-qup.c 1633F: drivers/i2c/busses/i2c-qup.c
1634F: drivers/clk/qcom/ 1634F: drivers/clk/qcom/
1635F: drivers/pinctrl/qcom/ 1635F: drivers/pinctrl/qcom/
1636F: drivers/dma/qcom/
1636F: drivers/soc/qcom/ 1637F: drivers/soc/qcom/
1637F: drivers/spi/spi-qup.c 1638F: drivers/spi/spi-qup.c
1638F: drivers/tty/serial/msm_serial.h 1639F: drivers/tty/serial/msm_serial.h
@@ -1987,12 +1988,18 @@ F: arch/arm/mach-pxa/include/mach/z2.h
1987 1988
1988ARM/ZTE ARCHITECTURE 1989ARM/ZTE ARCHITECTURE
1989M: Jun Nie <jun.nie@linaro.org> 1990M: Jun Nie <jun.nie@linaro.org>
1991M: Baoyou Xie <baoyou.xie@linaro.org>
1990L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1992L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1991S: Maintained 1993S: Maintained
1992F: arch/arm/mach-zx/ 1994F: arch/arm/mach-zx/
1993F: drivers/clk/zte/ 1995F: drivers/clk/zte/
1996F: drivers/reset/reset-zx2967.c
1997F: drivers/soc/zte/
1994F: Documentation/devicetree/bindings/arm/zte.txt 1998F: Documentation/devicetree/bindings/arm/zte.txt
1995F: Documentation/devicetree/bindings/clock/zx296702-clk.txt 1999F: Documentation/devicetree/bindings/clock/zx296702-clk.txt
2000F: Documentation/devicetree/bindings/reset/zte,zx2967-reset.txt
2001F: Documentation/devicetree/bindings/soc/zte/
2002F: include/dt-bindings/soc/zx*.h
1996 2003
1997ARM/ZYNQ ARCHITECTURE 2004ARM/ZYNQ ARCHITECTURE
1998M: Michal Simek <michal.simek@xilinx.com> 2005M: Michal Simek <michal.simek@xilinx.com>
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index 312d3a886e92..adf4e8f182bd 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -345,9 +345,9 @@ static void exynos5420_pm_prepare(void)
345 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 345 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
346 pmu_raw_writel(virt_to_phys(mcpm_entry_point), S5P_INFORM0); 346 pmu_raw_writel(virt_to_phys(mcpm_entry_point), S5P_INFORM0);
347 347
348 tmp = pmu_raw_readl(EXYNOS5_ARM_L2_OPTION); 348 tmp = pmu_raw_readl(EXYNOS_L2_OPTION(0));
349 tmp &= ~EXYNOS5_USE_RETENTION; 349 tmp &= ~EXYNOS_L2_USE_RETENTION;
350 pmu_raw_writel(tmp, EXYNOS5_ARM_L2_OPTION); 350 pmu_raw_writel(tmp, EXYNOS_L2_OPTION(0));
351 351
352 tmp = pmu_raw_readl(EXYNOS5420_SFR_AXI_CGDIS1); 352 tmp = pmu_raw_readl(EXYNOS5420_SFR_AXI_CGDIS1);
353 tmp |= EXYNOS5420_UFS; 353 tmp |= EXYNOS5420_UFS;
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index a7ab9ec141f8..ef0500a4c8ad 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -29,13 +29,11 @@
29#include "core.h" 29#include "core.h"
30#include "pm.h" 30#include "pm.h"
31 31
32#define RK3288_GRF_SOC_CON0 0x244
33#define RK3288_TIMER6_7_PHYS 0xff810000 32#define RK3288_TIMER6_7_PHYS 0xff810000
34 33
35static void __init rockchip_timer_init(void) 34static void __init rockchip_timer_init(void)
36{ 35{
37 if (of_machine_is_compatible("rockchip,rk3288")) { 36 if (of_machine_is_compatible("rockchip,rk3288")) {
38 struct regmap *grf;
39 void __iomem *reg_base; 37 void __iomem *reg_base;
40 38
41 /* 39 /*
@@ -54,16 +52,6 @@ static void __init rockchip_timer_init(void)
54 } else { 52 } else {
55 pr_err("rockchip: could not map timer7 registers\n"); 53 pr_err("rockchip: could not map timer7 registers\n");
56 } 54 }
57
58 /*
59 * Disable auto jtag/sdmmc switching that causes issues
60 * with the mmc controllers making them unreliable
61 */
62 grf = syscon_regmap_lookup_by_compatible("rockchip,rk3288-grf");
63 if (!IS_ERR(grf))
64 regmap_write(grf, RK3288_GRF_SOC_CON0, 0x10000000);
65 else
66 pr_err("rockchip: could not get grf syscon\n");
67 } 55 }
68 56
69 of_clk_init(NULL); 57 of_clk_init(NULL);
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 0cc08f892fea..5db6ab261643 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -398,6 +398,9 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
398 int pmp, unsigned long deadline, 398 int pmp, unsigned long deadline,
399 int (*check_ready)(struct ata_link *link)); 399 int (*check_ready)(struct ata_link *link));
400 400
401int ahci_do_hardreset(struct ata_link *link, unsigned int *class,
402 unsigned long deadline, bool *online);
403
401unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); 404unsigned int ahci_qc_issue(struct ata_queued_cmd *qc);
402int ahci_stop_engine(struct ata_port *ap); 405int ahci_stop_engine(struct ata_port *ap);
403void ahci_start_fis_rx(struct ata_port *ap); 406void ahci_start_fis_rx(struct ata_port *ap);
diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
index 267a3d3e79f4..1a50cd3b4233 100644
--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -16,7 +16,8 @@
16#include <linux/ahci_platform.h> 16#include <linux/ahci_platform.h>
17#include "ahci.h" 17#include "ahci.h"
18 18
19#define DRV_NAME "ahci_da850" 19#define DRV_NAME "ahci_da850"
20#define HARDRESET_RETRIES 5
20 21
21/* SATA PHY Control Register offset from AHCI base */ 22/* SATA PHY Control Register offset from AHCI base */
22#define SATA_P0PHYCR_REG 0x178 23#define SATA_P0PHYCR_REG 0x178
@@ -28,17 +29,8 @@
28#define SATA_PHY_TXSWING(x) ((x) << 19) 29#define SATA_PHY_TXSWING(x) ((x) << 19)
29#define SATA_PHY_ENPLL(x) ((x) << 31) 30#define SATA_PHY_ENPLL(x) ((x) << 31)
30 31
31/*
32 * The multiplier needed for 1.5GHz PLL output.
33 *
34 * NOTE: This is currently hardcoded to be suitable for 100MHz crystal
35 * frequency (which is used by DA850 EVM board) and may need to be changed
36 * if you would like to use this driver on some other board.
37 */
38#define DA850_SATA_CLK_MULTIPLIER 7
39
40static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg, 32static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg,
41 void __iomem *ahci_base) 33 void __iomem *ahci_base, u32 mpy)
42{ 34{
43 unsigned int val; 35 unsigned int val;
44 36
@@ -47,18 +39,122 @@ static void da850_sata_init(struct device *dev, void __iomem *pwrdn_reg,
47 val &= ~BIT(0); 39 val &= ~BIT(0);
48 writel(val, pwrdn_reg); 40 writel(val, pwrdn_reg);
49 41
50 val = SATA_PHY_MPY(DA850_SATA_CLK_MULTIPLIER + 1) | SATA_PHY_LOS(1) | 42 val = SATA_PHY_MPY(mpy) | SATA_PHY_LOS(1) | SATA_PHY_RXCDR(4) |
51 SATA_PHY_RXCDR(4) | SATA_PHY_RXEQ(1) | SATA_PHY_TXSWING(3) | 43 SATA_PHY_RXEQ(1) | SATA_PHY_TXSWING(3) | SATA_PHY_ENPLL(1);
52 SATA_PHY_ENPLL(1);
53 44
54 writel(val, ahci_base + SATA_P0PHYCR_REG); 45 writel(val, ahci_base + SATA_P0PHYCR_REG);
55} 46}
56 47
48static u32 ahci_da850_calculate_mpy(unsigned long refclk_rate)
49{
50 u32 pll_output = 1500000000, needed;
51
52 /*
53 * We need to determine the value of the multiplier (MPY) bits.
54 * In order to include the 12.5 multiplier we need to first divide
55 * the refclk rate by ten.
56 *
57 * __div64_32() turned out to be unreliable, sometimes returning
58 * false results.
59 */
60 WARN((refclk_rate % 10) != 0, "refclk must be divisible by 10");
61 needed = pll_output / (refclk_rate / 10);
62
63 /*
64 * What we have now is (multiplier * 10).
65 *
66 * Let's determine the actual register value we need to write.
67 */
68
69 switch (needed) {
70 case 50:
71 return 0x1;
72 case 60:
73 return 0x2;
74 case 80:
75 return 0x4;
76 case 100:
77 return 0x5;
78 case 120:
79 return 0x6;
80 case 125:
81 return 0x7;
82 case 150:
83 return 0x8;
84 case 200:
85 return 0x9;
86 case 250:
87 return 0xa;
88 default:
89 /*
90 * We should have divided evenly - if not, return an invalid
91 * value.
92 */
93 return 0;
94 }
95}
96
97static int ahci_da850_softreset(struct ata_link *link,
98 unsigned int *class, unsigned long deadline)
99{
100 int pmp, ret;
101
102 pmp = sata_srst_pmp(link);
103
104 /*
105 * There's an issue with the SATA controller on da850 SoCs: if we
106 * enable Port Multiplier support, but the drive is connected directly
107 * to the board, it can't be detected. As a workaround: if PMP is
108 * enabled, we first call ahci_do_softreset() and pass it the result of
109 * sata_srst_pmp(). If this call fails, we retry with pmp = 0.
110 */
111 ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
112 if (pmp && ret == -EBUSY)
113 return ahci_do_softreset(link, class, 0,
114 deadline, ahci_check_ready);
115
116 return ret;
117}
118
119static int ahci_da850_hardreset(struct ata_link *link,
120 unsigned int *class, unsigned long deadline)
121{
122 int ret, retry = HARDRESET_RETRIES;
123 bool online;
124
125 /*
126 * In order to correctly service the LCD controller of the da850 SoC,
127 * we increased the PLL0 frequency to 456MHz from the default 300MHz.
128 *
129 * This made the SATA controller unstable and the hardreset operation
130 * does not always succeed the first time. Before really giving up to
131 * bring up the link, retry the reset a couple times.
132 */
133 do {
134 ret = ahci_do_hardreset(link, class, deadline, &online);
135 if (online)
136 return ret;
137 } while (retry--);
138
139 return ret;
140}
141
142static struct ata_port_operations ahci_da850_port_ops = {
143 .inherits = &ahci_platform_ops,
144 .softreset = ahci_da850_softreset,
145 /*
146 * No need to override .pmp_softreset - it's only used for actual
147 * PMP-enabled ports.
148 */
149 .hardreset = ahci_da850_hardreset,
150 .pmp_hardreset = ahci_da850_hardreset,
151};
152
57static const struct ata_port_info ahci_da850_port_info = { 153static const struct ata_port_info ahci_da850_port_info = {
58 .flags = AHCI_FLAG_COMMON, 154 .flags = AHCI_FLAG_COMMON,
59 .pio_mask = ATA_PIO4, 155 .pio_mask = ATA_PIO4,
60 .udma_mask = ATA_UDMA6, 156 .udma_mask = ATA_UDMA6,
61 .port_ops = &ahci_platform_ops, 157 .port_ops = &ahci_da850_port_ops,
62}; 158};
63 159
64static struct scsi_host_template ahci_platform_sht = { 160static struct scsi_host_template ahci_platform_sht = {
@@ -69,14 +165,52 @@ static int ahci_da850_probe(struct platform_device *pdev)
69{ 165{
70 struct device *dev = &pdev->dev; 166 struct device *dev = &pdev->dev;
71 struct ahci_host_priv *hpriv; 167 struct ahci_host_priv *hpriv;
72 struct resource *res;
73 void __iomem *pwrdn_reg; 168 void __iomem *pwrdn_reg;
169 struct resource *res;
170 struct clk *clk;
171 u32 mpy;
74 int rc; 172 int rc;
75 173
76 hpriv = ahci_platform_get_resources(pdev); 174 hpriv = ahci_platform_get_resources(pdev);
77 if (IS_ERR(hpriv)) 175 if (IS_ERR(hpriv))
78 return PTR_ERR(hpriv); 176 return PTR_ERR(hpriv);
79 177
178 /*
179 * Internally ahci_platform_get_resources() calls clk_get(dev, NULL)
180 * when trying to obtain the functional clock. This SATA controller
181 * uses two clocks for which we specify two connection ids. If we don't
182 * have the functional clock at this point - call clk_get() again with
183 * con_id = "fck".
184 */
185 if (!hpriv->clks[0]) {
186 clk = clk_get(dev, "fck");
187 if (IS_ERR(clk))
188 return PTR_ERR(clk);
189
190 hpriv->clks[0] = clk;
191 }
192
193 /*
194 * The second clock used by ahci-da850 is the external REFCLK. If we
195 * didn't get it from ahci_platform_get_resources(), let's try to
196 * specify the con_id in clk_get().
197 */
198 if (!hpriv->clks[1]) {
199 clk = clk_get(dev, "refclk");
200 if (IS_ERR(clk)) {
201 dev_err(dev, "unable to obtain the reference clock");
202 return -ENODEV;
203 }
204
205 hpriv->clks[1] = clk;
206 }
207
208 mpy = ahci_da850_calculate_mpy(clk_get_rate(hpriv->clks[1]));
209 if (mpy == 0) {
210 dev_err(dev, "invalid REFCLK multiplier value: 0x%x", mpy);
211 return -EINVAL;
212 }
213
80 rc = ahci_platform_enable_resources(hpriv); 214 rc = ahci_platform_enable_resources(hpriv);
81 if (rc) 215 if (rc)
82 return rc; 216 return rc;
@@ -89,7 +223,7 @@ static int ahci_da850_probe(struct platform_device *pdev)
89 if (!pwrdn_reg) 223 if (!pwrdn_reg)
90 goto disable_resources; 224 goto disable_resources;
91 225
92 da850_sata_init(dev, pwrdn_reg, hpriv->mmio); 226 da850_sata_init(dev, pwrdn_reg, hpriv->mmio, mpy);
93 227
94 rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info, 228 rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info,
95 &ahci_platform_sht); 229 &ahci_platform_sht);
@@ -105,11 +239,18 @@ disable_resources:
105static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, 239static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
106 ahci_platform_resume); 240 ahci_platform_resume);
107 241
242static const struct of_device_id ahci_da850_of_match[] = {
243 { .compatible = "ti,da850-ahci", },
244 { },
245};
246MODULE_DEVICE_TABLE(of, ahci_da850_of_match);
247
108static struct platform_driver ahci_da850_driver = { 248static struct platform_driver ahci_da850_driver = {
109 .probe = ahci_da850_probe, 249 .probe = ahci_da850_probe,
110 .remove = ata_platform_remove_one, 250 .remove = ata_platform_remove_one,
111 .driver = { 251 .driver = {
112 .name = DRV_NAME, 252 .name = DRV_NAME,
253 .of_match_table = ahci_da850_of_match,
113 .pm = &ahci_da850_pm_ops, 254 .pm = &ahci_da850_pm_ops,
114 }, 255 },
115}; 256};
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index ee7db3119b18..3159f9e66d8f 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -1519,8 +1519,8 @@ static int ahci_pmp_retry_softreset(struct ata_link *link, unsigned int *class,
1519 return rc; 1519 return rc;
1520} 1520}
1521 1521
1522static int ahci_hardreset(struct ata_link *link, unsigned int *class, 1522int ahci_do_hardreset(struct ata_link *link, unsigned int *class,
1523 unsigned long deadline) 1523 unsigned long deadline, bool *online)
1524{ 1524{
1525 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context); 1525 const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
1526 struct ata_port *ap = link->ap; 1526 struct ata_port *ap = link->ap;
@@ -1528,7 +1528,6 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
1528 struct ahci_host_priv *hpriv = ap->host->private_data; 1528 struct ahci_host_priv *hpriv = ap->host->private_data;
1529 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; 1529 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
1530 struct ata_taskfile tf; 1530 struct ata_taskfile tf;
1531 bool online;
1532 int rc; 1531 int rc;
1533 1532
1534 DPRINTK("ENTER\n"); 1533 DPRINTK("ENTER\n");
@@ -1540,17 +1539,26 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
1540 tf.command = ATA_BUSY; 1539 tf.command = ATA_BUSY;
1541 ata_tf_to_fis(&tf, 0, 0, d2h_fis); 1540 ata_tf_to_fis(&tf, 0, 0, d2h_fis);
1542 1541
1543 rc = sata_link_hardreset(link, timing, deadline, &online, 1542 rc = sata_link_hardreset(link, timing, deadline, online,
1544 ahci_check_ready); 1543 ahci_check_ready);
1545 1544
1546 hpriv->start_engine(ap); 1545 hpriv->start_engine(ap);
1547 1546
1548 if (online) 1547 if (*online)
1549 *class = ahci_dev_classify(ap); 1548 *class = ahci_dev_classify(ap);
1550 1549
1551 DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class); 1550 DPRINTK("EXIT, rc=%d, class=%u\n", rc, *class);
1552 return rc; 1551 return rc;
1553} 1552}
1553EXPORT_SYMBOL_GPL(ahci_do_hardreset);
1554
1555static int ahci_hardreset(struct ata_link *link, unsigned int *class,
1556 unsigned long deadline)
1557{
1558 bool online;
1559
1560 return ahci_do_hardreset(link, class, deadline, &online);
1561}
1554 1562
1555static void ahci_postreset(struct ata_link *link, unsigned int *class) 1563static void ahci_postreset(struct ata_link *link, unsigned int *class)
1556{ 1564{
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index b9e8cfc93c7e..0a52da439abf 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -112,6 +112,7 @@ config QCOM_EBI2
112 bool "Qualcomm External Bus Interface 2 (EBI2)" 112 bool "Qualcomm External Bus Interface 2 (EBI2)"
113 depends on HAS_IOMEM 113 depends on HAS_IOMEM
114 depends on ARCH_QCOM || COMPILE_TEST 114 depends on ARCH_QCOM || COMPILE_TEST
115 default ARCH_QCOM
115 help 116 help
116 Say y here to enable support for the Qualcomm External Bus 117 Say y here to enable support for the Qualcomm External Bus
117 Interface 2, which can be used to connect things like NAND Flash, 118 Interface 2, which can be used to connect things like NAND Flash,
diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c
index c6aeedbdcbb0..8ad226c60374 100644
--- a/drivers/firmware/qcom_scm-32.c
+++ b/drivers/firmware/qcom_scm-32.c
@@ -560,3 +560,21 @@ int __qcom_scm_pas_mss_reset(struct device *dev, bool reset)
560 560
561 return ret ? : le32_to_cpu(out); 561 return ret ? : le32_to_cpu(out);
562} 562}
563
564int __qcom_scm_set_remote_state(struct device *dev, u32 state, u32 id)
565{
566 struct {
567 __le32 state;
568 __le32 id;
569 } req;
570 __le32 scm_ret = 0;
571 int ret;
572
573 req.state = cpu_to_le32(state);
574 req.id = cpu_to_le32(id);
575
576 ret = qcom_scm_call(dev, QCOM_SCM_SVC_BOOT, QCOM_SCM_SET_REMOTE_STATE,
577 &req, sizeof(req), &scm_ret, sizeof(scm_ret));
578
579 return ret ? : le32_to_cpu(scm_ret);
580}
diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c
index 1e2e5198db53..c9332590e8c6 100644
--- a/drivers/firmware/qcom_scm-64.c
+++ b/drivers/firmware/qcom_scm-64.c
@@ -365,3 +365,19 @@ int __qcom_scm_pas_mss_reset(struct device *dev, bool reset)
365 365
366 return ret ? : res.a1; 366 return ret ? : res.a1;
367} 367}
368
369int __qcom_scm_set_remote_state(struct device *dev, u32 state, u32 id)
370{
371 struct qcom_scm_desc desc = {0};
372 struct arm_smccc_res res;
373 int ret;
374
375 desc.args[0] = state;
376 desc.args[1] = id;
377 desc.arginfo = QCOM_SCM_ARGS(2);
378
379 ret = qcom_scm_call(dev, QCOM_SCM_SVC_BOOT, QCOM_SCM_SET_REMOTE_STATE,
380 &desc, &res);
381
382 return ret ? : res.a1;
383}
diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index 893f953eaccf..d987bcc7489d 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -324,6 +324,12 @@ bool qcom_scm_is_available(void)
324} 324}
325EXPORT_SYMBOL(qcom_scm_is_available); 325EXPORT_SYMBOL(qcom_scm_is_available);
326 326
327int qcom_scm_set_remote_state(u32 state, u32 id)
328{
329 return __qcom_scm_set_remote_state(__scm->dev, state, id);
330}
331EXPORT_SYMBOL(qcom_scm_set_remote_state);
332
327static int qcom_scm_probe(struct platform_device *pdev) 333static int qcom_scm_probe(struct platform_device *pdev)
328{ 334{
329 struct qcom_scm *scm; 335 struct qcom_scm *scm;
@@ -387,7 +393,7 @@ static int qcom_scm_probe(struct platform_device *pdev)
387 393
388static const struct of_device_id qcom_scm_dt_match[] = { 394static const struct of_device_id qcom_scm_dt_match[] = {
389 { .compatible = "qcom,scm-apq8064", 395 { .compatible = "qcom,scm-apq8064",
390 .data = (void *) SCM_HAS_CORE_CLK, 396 /* FIXME: This should have .data = (void *) SCM_HAS_CORE_CLK */
391 }, 397 },
392 { .compatible = "qcom,scm-msm8660", 398 { .compatible = "qcom,scm-msm8660",
393 .data = (void *) SCM_HAS_CORE_CLK, 399 .data = (void *) SCM_HAS_CORE_CLK,
diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h
index 3584b00fe7e6..6a0f15469344 100644
--- a/drivers/firmware/qcom_scm.h
+++ b/drivers/firmware/qcom_scm.h
@@ -15,6 +15,8 @@
15#define QCOM_SCM_SVC_BOOT 0x1 15#define QCOM_SCM_SVC_BOOT 0x1
16#define QCOM_SCM_BOOT_ADDR 0x1 16#define QCOM_SCM_BOOT_ADDR 0x1
17#define QCOM_SCM_BOOT_ADDR_MC 0x11 17#define QCOM_SCM_BOOT_ADDR_MC 0x11
18#define QCOM_SCM_SET_REMOTE_STATE 0xa
19extern int __qcom_scm_set_remote_state(struct device *dev, u32 state, u32 id);
18 20
19#define QCOM_SCM_FLAG_HLOS 0x01 21#define QCOM_SCM_FLAG_HLOS 0x01
20#define QCOM_SCM_FLAG_COLDBOOT_MC 0x02 22#define QCOM_SCM_FLAG_COLDBOOT_MC 0x02
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index 047d6fcdcec2..4e83a8b92665 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -76,9 +76,11 @@ struct at91_ebi_caps {
76 76
77struct at91_ebi { 77struct at91_ebi {
78 struct clk *clk; 78 struct clk *clk;
79 struct regmap *smc;
80 struct regmap *matrix; 79 struct regmap *matrix;
81 80 struct {
81 struct regmap *regmap;
82 struct clk *clk;
83 } smc;
82 struct regmap_field *ebi_csa; 84 struct regmap_field *ebi_csa;
83 85
84 struct device *dev; 86 struct device *dev;
@@ -93,7 +95,7 @@ static void at91sam9_ebi_get_config(struct at91_ebi_dev *ebid,
93 struct at91_ebi_dev_config *conf) 95 struct at91_ebi_dev_config *conf)
94{ 96{
95 struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9; 97 struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9;
96 unsigned int clk_rate = clk_get_rate(ebid->ebi->clk); 98 unsigned int clk_period = NSEC_PER_SEC / clk_get_rate(ebid->ebi->clk);
97 struct at91sam9_ebi_dev_config *config = &conf->sam9; 99 struct at91sam9_ebi_dev_config *config = &conf->sam9;
98 struct at91sam9_smc_timings *timings = &config->timings; 100 struct at91sam9_smc_timings *timings = &config->timings;
99 unsigned int val; 101 unsigned int val;
@@ -102,43 +104,43 @@ static void at91sam9_ebi_get_config(struct at91_ebi_dev *ebid,
102 config->mode = val & ~AT91_SMC_TDF; 104 config->mode = val & ~AT91_SMC_TDF;
103 105
104 val = (val & AT91_SMC_TDF) >> 16; 106 val = (val & AT91_SMC_TDF) >> 16;
105 timings->tdf_ns = clk_rate * val; 107 timings->tdf_ns = clk_period * val;
106 108
107 regmap_fields_read(fields->setup, conf->cs, &val); 109 regmap_fields_read(fields->setup, conf->cs, &val);
108 timings->ncs_rd_setup_ns = (val >> 24) & 0x1f; 110 timings->ncs_rd_setup_ns = (val >> 24) & 0x1f;
109 timings->ncs_rd_setup_ns += ((val >> 29) & 0x1) * 128; 111 timings->ncs_rd_setup_ns += ((val >> 29) & 0x1) * 128;
110 timings->ncs_rd_setup_ns *= clk_rate; 112 timings->ncs_rd_setup_ns *= clk_period;
111 timings->nrd_setup_ns = (val >> 16) & 0x1f; 113 timings->nrd_setup_ns = (val >> 16) & 0x1f;
112 timings->nrd_setup_ns += ((val >> 21) & 0x1) * 128; 114 timings->nrd_setup_ns += ((val >> 21) & 0x1) * 128;
113 timings->nrd_setup_ns *= clk_rate; 115 timings->nrd_setup_ns *= clk_period;
114 timings->ncs_wr_setup_ns = (val >> 8) & 0x1f; 116 timings->ncs_wr_setup_ns = (val >> 8) & 0x1f;
115 timings->ncs_wr_setup_ns += ((val >> 13) & 0x1) * 128; 117 timings->ncs_wr_setup_ns += ((val >> 13) & 0x1) * 128;
116 timings->ncs_wr_setup_ns *= clk_rate; 118 timings->ncs_wr_setup_ns *= clk_period;
117 timings->nwe_setup_ns = val & 0x1f; 119 timings->nwe_setup_ns = val & 0x1f;
118 timings->nwe_setup_ns += ((val >> 5) & 0x1) * 128; 120 timings->nwe_setup_ns += ((val >> 5) & 0x1) * 128;
119 timings->nwe_setup_ns *= clk_rate; 121 timings->nwe_setup_ns *= clk_period;
120 122
121 regmap_fields_read(fields->pulse, conf->cs, &val); 123 regmap_fields_read(fields->pulse, conf->cs, &val);
122 timings->ncs_rd_pulse_ns = (val >> 24) & 0x3f; 124 timings->ncs_rd_pulse_ns = (val >> 24) & 0x3f;
123 timings->ncs_rd_pulse_ns += ((val >> 30) & 0x1) * 256; 125 timings->ncs_rd_pulse_ns += ((val >> 30) & 0x1) * 256;
124 timings->ncs_rd_pulse_ns *= clk_rate; 126 timings->ncs_rd_pulse_ns *= clk_period;
125 timings->nrd_pulse_ns = (val >> 16) & 0x3f; 127 timings->nrd_pulse_ns = (val >> 16) & 0x3f;
126 timings->nrd_pulse_ns += ((val >> 22) & 0x1) * 256; 128 timings->nrd_pulse_ns += ((val >> 22) & 0x1) * 256;
127 timings->nrd_pulse_ns *= clk_rate; 129 timings->nrd_pulse_ns *= clk_period;
128 timings->ncs_wr_pulse_ns = (val >> 8) & 0x3f; 130 timings->ncs_wr_pulse_ns = (val >> 8) & 0x3f;
129 timings->ncs_wr_pulse_ns += ((val >> 14) & 0x1) * 256; 131 timings->ncs_wr_pulse_ns += ((val >> 14) & 0x1) * 256;
130 timings->ncs_wr_pulse_ns *= clk_rate; 132 timings->ncs_wr_pulse_ns *= clk_period;
131 timings->nwe_pulse_ns = val & 0x3f; 133 timings->nwe_pulse_ns = val & 0x3f;
132 timings->nwe_pulse_ns += ((val >> 6) & 0x1) * 256; 134 timings->nwe_pulse_ns += ((val >> 6) & 0x1) * 256;
133 timings->nwe_pulse_ns *= clk_rate; 135 timings->nwe_pulse_ns *= clk_period;
134 136
135 regmap_fields_read(fields->cycle, conf->cs, &val); 137 regmap_fields_read(fields->cycle, conf->cs, &val);
136 timings->nrd_cycle_ns = (val >> 16) & 0x7f; 138 timings->nrd_cycle_ns = (val >> 16) & 0x7f;
137 timings->nrd_cycle_ns += ((val >> 23) & 0x3) * 256; 139 timings->nrd_cycle_ns += ((val >> 23) & 0x3) * 256;
138 timings->nrd_cycle_ns *= clk_rate; 140 timings->nrd_cycle_ns *= clk_period;
139 timings->nwe_cycle_ns = val & 0x7f; 141 timings->nwe_cycle_ns = val & 0x7f;
140 timings->nwe_cycle_ns += ((val >> 7) & 0x3) * 256; 142 timings->nwe_cycle_ns += ((val >> 7) & 0x3) * 256;
141 timings->nwe_cycle_ns *= clk_rate; 143 timings->nwe_cycle_ns *= clk_period;
142} 144}
143 145
144static int at91_xlate_timing(struct device_node *np, const char *prop, 146static int at91_xlate_timing(struct device_node *np, const char *prop,
@@ -334,6 +336,7 @@ static int at91sam9_ebi_apply_config(struct at91_ebi_dev *ebid,
334 struct at91_ebi_dev_config *conf) 336 struct at91_ebi_dev_config *conf)
335{ 337{
336 unsigned int clk_rate = clk_get_rate(ebid->ebi->clk); 338 unsigned int clk_rate = clk_get_rate(ebid->ebi->clk);
339 unsigned int clk_period = NSEC_PER_SEC / clk_rate;
337 struct at91sam9_ebi_dev_config *config = &conf->sam9; 340 struct at91sam9_ebi_dev_config *config = &conf->sam9;
338 struct at91sam9_smc_timings *timings = &config->timings; 341 struct at91sam9_smc_timings *timings = &config->timings;
339 struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9; 342 struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9;
@@ -376,7 +379,7 @@ static int at91sam9_ebi_apply_config(struct at91_ebi_dev *ebid,
376 val |= AT91SAM9_SMC_NWECYCLE(coded_val); 379 val |= AT91SAM9_SMC_NWECYCLE(coded_val);
377 regmap_fields_write(fields->cycle, conf->cs, val); 380 regmap_fields_write(fields->cycle, conf->cs, val);
378 381
379 val = DIV_ROUND_UP(timings->tdf_ns, clk_rate); 382 val = DIV_ROUND_UP(timings->tdf_ns, clk_period);
380 if (val > AT91_SMC_TDF_MAX) 383 if (val > AT91_SMC_TDF_MAX)
381 val = AT91_SMC_TDF_MAX; 384 val = AT91_SMC_TDF_MAX;
382 regmap_fields_write(fields->mode, conf->cs, 385 regmap_fields_write(fields->mode, conf->cs,
@@ -394,22 +397,26 @@ static int at91sam9_ebi_init(struct at91_ebi *ebi)
394 field.id_offset = AT91SAM9_SMC_GENERIC_BLK_SZ; 397 field.id_offset = AT91SAM9_SMC_GENERIC_BLK_SZ;
395 398
396 field.reg = AT91SAM9_SMC_SETUP(AT91SAM9_SMC_GENERIC); 399 field.reg = AT91SAM9_SMC_SETUP(AT91SAM9_SMC_GENERIC);
397 fields->setup = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 400 fields->setup = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
401 field);
398 if (IS_ERR(fields->setup)) 402 if (IS_ERR(fields->setup))
399 return PTR_ERR(fields->setup); 403 return PTR_ERR(fields->setup);
400 404
401 field.reg = AT91SAM9_SMC_PULSE(AT91SAM9_SMC_GENERIC); 405 field.reg = AT91SAM9_SMC_PULSE(AT91SAM9_SMC_GENERIC);
402 fields->pulse = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 406 fields->pulse = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
407 field);
403 if (IS_ERR(fields->pulse)) 408 if (IS_ERR(fields->pulse))
404 return PTR_ERR(fields->pulse); 409 return PTR_ERR(fields->pulse);
405 410
406 field.reg = AT91SAM9_SMC_CYCLE(AT91SAM9_SMC_GENERIC); 411 field.reg = AT91SAM9_SMC_CYCLE(AT91SAM9_SMC_GENERIC);
407 fields->cycle = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 412 fields->cycle = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
413 field);
408 if (IS_ERR(fields->cycle)) 414 if (IS_ERR(fields->cycle))
409 return PTR_ERR(fields->cycle); 415 return PTR_ERR(fields->cycle);
410 416
411 field.reg = AT91SAM9_SMC_MODE(AT91SAM9_SMC_GENERIC); 417 field.reg = AT91SAM9_SMC_MODE(AT91SAM9_SMC_GENERIC);
412 fields->mode = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 418 fields->mode = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
419 field);
413 return PTR_ERR_OR_ZERO(fields->mode); 420 return PTR_ERR_OR_ZERO(fields->mode);
414} 421}
415 422
@@ -422,22 +429,26 @@ static int sama5d3_ebi_init(struct at91_ebi *ebi)
422 field.id_offset = SAMA5_SMC_GENERIC_BLK_SZ; 429 field.id_offset = SAMA5_SMC_GENERIC_BLK_SZ;
423 430
424 field.reg = AT91SAM9_SMC_SETUP(SAMA5_SMC_GENERIC); 431 field.reg = AT91SAM9_SMC_SETUP(SAMA5_SMC_GENERIC);
425 fields->setup = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 432 fields->setup = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
433 field);
426 if (IS_ERR(fields->setup)) 434 if (IS_ERR(fields->setup))
427 return PTR_ERR(fields->setup); 435 return PTR_ERR(fields->setup);
428 436
429 field.reg = AT91SAM9_SMC_PULSE(SAMA5_SMC_GENERIC); 437 field.reg = AT91SAM9_SMC_PULSE(SAMA5_SMC_GENERIC);
430 fields->pulse = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 438 fields->pulse = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
439 field);
431 if (IS_ERR(fields->pulse)) 440 if (IS_ERR(fields->pulse))
432 return PTR_ERR(fields->pulse); 441 return PTR_ERR(fields->pulse);
433 442
434 field.reg = AT91SAM9_SMC_CYCLE(SAMA5_SMC_GENERIC); 443 field.reg = AT91SAM9_SMC_CYCLE(SAMA5_SMC_GENERIC);
435 fields->cycle = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 444 fields->cycle = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
445 field);
436 if (IS_ERR(fields->cycle)) 446 if (IS_ERR(fields->cycle))
437 return PTR_ERR(fields->cycle); 447 return PTR_ERR(fields->cycle);
438 448
439 field.reg = SAMA5_SMC_MODE(SAMA5_SMC_GENERIC); 449 field.reg = SAMA5_SMC_MODE(SAMA5_SMC_GENERIC);
440 fields->mode = devm_regmap_field_alloc(ebi->dev, ebi->smc, field); 450 fields->mode = devm_regmap_field_alloc(ebi->dev, ebi->smc.regmap,
451 field);
441 return PTR_ERR_OR_ZERO(fields->mode); 452 return PTR_ERR_OR_ZERO(fields->mode);
442} 453}
443 454
@@ -448,12 +459,31 @@ static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np,
448 struct at91_ebi_dev_config conf = { }; 459 struct at91_ebi_dev_config conf = { };
449 struct device *dev = ebi->dev; 460 struct device *dev = ebi->dev;
450 struct at91_ebi_dev *ebid; 461 struct at91_ebi_dev *ebid;
451 int ret, numcs = 0, i; 462 unsigned long cslines = 0;
463 int ret, numcs = 0, nentries, i;
452 bool apply = false; 464 bool apply = false;
465 u32 cs;
453 466
454 numcs = of_property_count_elems_of_size(np, "reg", 467 nentries = of_property_count_elems_of_size(np, "reg",
455 reg_cells * sizeof(u32)); 468 reg_cells * sizeof(u32));
456 if (numcs <= 0) { 469 for (i = 0; i < nentries; i++) {
470 ret = of_property_read_u32_index(np, "reg", i * reg_cells,
471 &cs);
472 if (ret)
473 return ret;
474
475 if (cs >= AT91_MATRIX_EBI_NUM_CS ||
476 !(ebi->caps->available_cs & BIT(cs))) {
477 dev_err(dev, "invalid reg property in %s\n",
478 np->full_name);
479 return -EINVAL;
480 }
481
482 if (!test_and_set_bit(cs, &cslines))
483 numcs++;
484 }
485
486 if (!numcs) {
457 dev_err(dev, "invalid reg property in %s\n", np->full_name); 487 dev_err(dev, "invalid reg property in %s\n", np->full_name);
458 return -EINVAL; 488 return -EINVAL;
459 } 489 }
@@ -472,21 +502,8 @@ static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np,
472 else if (ret) 502 else if (ret)
473 apply = true; 503 apply = true;
474 504
475 for (i = 0; i < numcs; i++) { 505 i = 0;
476 u32 cs; 506 for_each_set_bit(cs, &cslines, AT91_MATRIX_EBI_NUM_CS) {
477
478 ret = of_property_read_u32_index(np, "reg", i * reg_cells,
479 &cs);
480 if (ret)
481 return ret;
482
483 if (cs > AT91_MATRIX_EBI_NUM_CS ||
484 !(ebi->caps->available_cs & BIT(cs))) {
485 dev_err(dev, "invalid reg property in %s\n",
486 np->full_name);
487 return -EINVAL;
488 }
489
490 ebid->configs[i].cs = cs; 507 ebid->configs[i].cs = cs;
491 508
492 if (apply) { 509 if (apply) {
@@ -502,9 +519,11 @@ static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np,
502 * Attach the EBI device to the generic SMC logic if at least 519 * Attach the EBI device to the generic SMC logic if at least
503 * one "atmel,smc-" property is present. 520 * one "atmel,smc-" property is present.
504 */ 521 */
505 if (ebi->ebi_csa && ret) 522 if (ebi->ebi_csa && apply)
506 regmap_field_update_bits(ebi->ebi_csa, 523 regmap_field_update_bits(ebi->ebi_csa,
507 BIT(cs), 0); 524 BIT(cs), 0);
525
526 i++;
508 } 527 }
509 528
510 list_add_tail(&ebid->node, &ebi->devs); 529 list_add_tail(&ebid->node, &ebi->devs);
@@ -668,7 +687,7 @@ static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np)
668static int at91_ebi_probe(struct platform_device *pdev) 687static int at91_ebi_probe(struct platform_device *pdev)
669{ 688{
670 struct device *dev = &pdev->dev; 689 struct device *dev = &pdev->dev;
671 struct device_node *child, *np = dev->of_node; 690 struct device_node *child, *np = dev->of_node, *smc_np;
672 const struct of_device_id *match; 691 const struct of_device_id *match;
673 struct at91_ebi *ebi; 692 struct at91_ebi *ebi;
674 int ret, reg_cells; 693 int ret, reg_cells;
@@ -693,9 +712,22 @@ static int at91_ebi_probe(struct platform_device *pdev)
693 712
694 ebi->clk = clk; 713 ebi->clk = clk;
695 714
696 ebi->smc = syscon_regmap_lookup_by_phandle(np, "atmel,smc"); 715 smc_np = of_parse_phandle(dev->of_node, "atmel,smc", 0);
697 if (IS_ERR(ebi->smc)) 716
698 return PTR_ERR(ebi->smc); 717 ebi->smc.regmap = syscon_node_to_regmap(smc_np);
718 if (IS_ERR(ebi->smc.regmap))
719 return PTR_ERR(ebi->smc.regmap);
720
721 ebi->smc.clk = of_clk_get(smc_np, 0);
722 if (IS_ERR(ebi->smc.clk)) {
723 if (PTR_ERR(ebi->smc.clk) != -ENOENT)
724 return PTR_ERR(ebi->smc.clk);
725
726 ebi->smc.clk = NULL;
727 }
728 ret = clk_prepare_enable(ebi->smc.clk);
729 if (ret)
730 return ret;
699 731
700 /* 732 /*
701 * The sama5d3 does not provide an EBICSA register and thus does need 733 * The sama5d3 does not provide an EBICSA register and thus does need
diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c
index 06cc781ebac1..392dc8dd481f 100644
--- a/drivers/memory/tegra/tegra124-emc.c
+++ b/drivers/memory/tegra/tegra124-emc.c
@@ -1115,11 +1115,10 @@ static int tegra_emc_probe(struct platform_device *pdev)
1115 } 1115 }
1116 1116
1117 mc = of_find_device_by_node(np); 1117 mc = of_find_device_by_node(np);
1118 of_node_put(np);
1118 if (!mc) 1119 if (!mc)
1119 return -ENOENT; 1120 return -ENOENT;
1120 1121
1121 of_node_put(np);
1122
1123 emc->mc = platform_get_drvdata(mc); 1122 emc->mc = platform_get_drvdata(mc);
1124 if (!emc->mc) 1123 if (!emc->mc)
1125 return -EPROBE_DEFER; 1124 return -EPROBE_DEFER;
@@ -1135,9 +1134,7 @@ static int tegra_emc_probe(struct platform_device *pdev)
1135 } 1134 }
1136 1135
1137 err = tegra_emc_load_timings_from_dt(emc, np); 1136 err = tegra_emc_load_timings_from_dt(emc, np);
1138
1139 of_node_put(np); 1137 of_node_put(np);
1140
1141 if (err) 1138 if (err)
1142 return err; 1139 return err;
1143 1140
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
index 172dc966a01f..f4cdfe94b9ec 100644
--- a/drivers/reset/Kconfig
+++ b/drivers/reset/Kconfig
@@ -86,6 +86,12 @@ config RESET_UNIPHIER
86 Say Y if you want to control reset signals provided by System Control 86 Say Y if you want to control reset signals provided by System Control
87 block, Media I/O block, Peripheral Block. 87 block, Media I/O block, Peripheral Block.
88 88
89config RESET_ZX2967
90 bool "ZTE ZX2967 Reset Driver"
91 depends on ARCH_ZX || COMPILE_TEST
92 help
93 This enables the reset controller driver for ZTE's zx2967 family.
94
89config RESET_ZYNQ 95config RESET_ZYNQ
90 bool "ZYNQ Reset Driver" if COMPILE_TEST 96 bool "ZYNQ Reset Driver" if COMPILE_TEST
91 default ARCH_ZYNQ 97 default ARCH_ZYNQ
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
index 13b346e03d84..2cd3f6c45165 100644
--- a/drivers/reset/Makefile
+++ b/drivers/reset/Makefile
@@ -13,4 +13,5 @@ obj-$(CONFIG_RESET_STM32) += reset-stm32.o
13obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o 13obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
14obj-$(CONFIG_TI_SYSCON_RESET) += reset-ti-syscon.o 14obj-$(CONFIG_TI_SYSCON_RESET) += reset-ti-syscon.o
15obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o 15obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o
16obj-$(CONFIG_RESET_ZX2967) += reset-zx2967.o
16obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o 17obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index b6f5f1e1826c..f1e5e65388bb 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -41,7 +41,7 @@ struct reset_control {
41 struct list_head list; 41 struct list_head list;
42 unsigned int id; 42 unsigned int id;
43 unsigned int refcnt; 43 unsigned int refcnt;
44 int shared; 44 bool shared;
45 atomic_t deassert_count; 45 atomic_t deassert_count;
46 atomic_t triggered_count; 46 atomic_t triggered_count;
47}; 47};
@@ -143,12 +143,18 @@ EXPORT_SYMBOL_GPL(devm_reset_controller_register);
143 * a no-op. 143 * a no-op.
144 * Consumers must not use reset_control_(de)assert on shared reset lines when 144 * Consumers must not use reset_control_(de)assert on shared reset lines when
145 * reset_control_reset has been used. 145 * reset_control_reset has been used.
146 *
147 * If rstc is NULL it is an optional reset and the function will just
148 * return 0.
146 */ 149 */
147int reset_control_reset(struct reset_control *rstc) 150int reset_control_reset(struct reset_control *rstc)
148{ 151{
149 int ret; 152 int ret;
150 153
151 if (WARN_ON(IS_ERR_OR_NULL(rstc))) 154 if (!rstc)
155 return 0;
156
157 if (WARN_ON(IS_ERR(rstc)))
152 return -EINVAL; 158 return -EINVAL;
153 159
154 if (!rstc->rcdev->ops->reset) 160 if (!rstc->rcdev->ops->reset)
@@ -182,10 +188,17 @@ EXPORT_SYMBOL_GPL(reset_control_reset);
182 * internal state to be reset, but must be prepared for this to happen. 188 * internal state to be reset, but must be prepared for this to happen.
183 * Consumers must not use reset_control_reset on shared reset lines when 189 * Consumers must not use reset_control_reset on shared reset lines when
184 * reset_control_(de)assert has been used. 190 * reset_control_(de)assert has been used.
191 * return 0.
192 *
193 * If rstc is NULL it is an optional reset and the function will just
194 * return 0.
185 */ 195 */
186int reset_control_assert(struct reset_control *rstc) 196int reset_control_assert(struct reset_control *rstc)
187{ 197{
188 if (WARN_ON(IS_ERR_OR_NULL(rstc))) 198 if (!rstc)
199 return 0;
200
201 if (WARN_ON(IS_ERR(rstc)))
189 return -EINVAL; 202 return -EINVAL;
190 203
191 if (!rstc->rcdev->ops->assert) 204 if (!rstc->rcdev->ops->assert)
@@ -213,10 +226,17 @@ EXPORT_SYMBOL_GPL(reset_control_assert);
213 * After calling this function, the reset is guaranteed to be deasserted. 226 * After calling this function, the reset is guaranteed to be deasserted.
214 * Consumers must not use reset_control_reset on shared reset lines when 227 * Consumers must not use reset_control_reset on shared reset lines when
215 * reset_control_(de)assert has been used. 228 * reset_control_(de)assert has been used.
229 * return 0.
230 *
231 * If rstc is NULL it is an optional reset and the function will just
232 * return 0.
216 */ 233 */
217int reset_control_deassert(struct reset_control *rstc) 234int reset_control_deassert(struct reset_control *rstc)
218{ 235{
219 if (WARN_ON(IS_ERR_OR_NULL(rstc))) 236 if (!rstc)
237 return 0;
238
239 if (WARN_ON(IS_ERR(rstc)))
220 return -EINVAL; 240 return -EINVAL;
221 241
222 if (!rstc->rcdev->ops->deassert) 242 if (!rstc->rcdev->ops->deassert)
@@ -237,12 +257,15 @@ EXPORT_SYMBOL_GPL(reset_control_deassert);
237/** 257/**
238 * reset_control_status - returns a negative errno if not supported, a 258 * reset_control_status - returns a negative errno if not supported, a
239 * positive value if the reset line is asserted, or zero if the reset 259 * positive value if the reset line is asserted, or zero if the reset
240 * line is not asserted. 260 * line is not asserted or if the desc is NULL (optional reset).
241 * @rstc: reset controller 261 * @rstc: reset controller
242 */ 262 */
243int reset_control_status(struct reset_control *rstc) 263int reset_control_status(struct reset_control *rstc)
244{ 264{
245 if (WARN_ON(IS_ERR_OR_NULL(rstc))) 265 if (!rstc)
266 return 0;
267
268 if (WARN_ON(IS_ERR(rstc)))
246 return -EINVAL; 269 return -EINVAL;
247 270
248 if (rstc->rcdev->ops->status) 271 if (rstc->rcdev->ops->status)
@@ -254,7 +277,7 @@ EXPORT_SYMBOL_GPL(reset_control_status);
254 277
255static struct reset_control *__reset_control_get( 278static struct reset_control *__reset_control_get(
256 struct reset_controller_dev *rcdev, 279 struct reset_controller_dev *rcdev,
257 unsigned int index, int shared) 280 unsigned int index, bool shared)
258{ 281{
259 struct reset_control *rstc; 282 struct reset_control *rstc;
260 283
@@ -299,7 +322,8 @@ static void __reset_control_put(struct reset_control *rstc)
299} 322}
300 323
301struct reset_control *__of_reset_control_get(struct device_node *node, 324struct reset_control *__of_reset_control_get(struct device_node *node,
302 const char *id, int index, int shared) 325 const char *id, int index, bool shared,
326 bool optional)
303{ 327{
304 struct reset_control *rstc; 328 struct reset_control *rstc;
305 struct reset_controller_dev *r, *rcdev; 329 struct reset_controller_dev *r, *rcdev;
@@ -313,14 +337,18 @@ struct reset_control *__of_reset_control_get(struct device_node *node,
313 if (id) { 337 if (id) {
314 index = of_property_match_string(node, 338 index = of_property_match_string(node,
315 "reset-names", id); 339 "reset-names", id);
340 if (index == -EILSEQ)
341 return ERR_PTR(index);
316 if (index < 0) 342 if (index < 0)
317 return ERR_PTR(-ENOENT); 343 return optional ? NULL : ERR_PTR(-ENOENT);
318 } 344 }
319 345
320 ret = of_parse_phandle_with_args(node, "resets", "#reset-cells", 346 ret = of_parse_phandle_with_args(node, "resets", "#reset-cells",
321 index, &args); 347 index, &args);
322 if (ret) 348 if (ret == -EINVAL)
323 return ERR_PTR(ret); 349 return ERR_PTR(ret);
350 if (ret)
351 return optional ? NULL : ERR_PTR(ret);
324 352
325 mutex_lock(&reset_list_mutex); 353 mutex_lock(&reset_list_mutex);
326 rcdev = NULL; 354 rcdev = NULL;
@@ -364,7 +392,7 @@ EXPORT_SYMBOL_GPL(__of_reset_control_get);
364 392
365void reset_control_put(struct reset_control *rstc) 393void reset_control_put(struct reset_control *rstc)
366{ 394{
367 if (IS_ERR(rstc)) 395 if (IS_ERR_OR_NULL(rstc))
368 return; 396 return;
369 397
370 mutex_lock(&reset_list_mutex); 398 mutex_lock(&reset_list_mutex);
@@ -379,7 +407,8 @@ static void devm_reset_control_release(struct device *dev, void *res)
379} 407}
380 408
381struct reset_control *__devm_reset_control_get(struct device *dev, 409struct reset_control *__devm_reset_control_get(struct device *dev,
382 const char *id, int index, int shared) 410 const char *id, int index, bool shared,
411 bool optional)
383{ 412{
384 struct reset_control **ptr, *rstc; 413 struct reset_control **ptr, *rstc;
385 414
@@ -389,7 +418,7 @@ struct reset_control *__devm_reset_control_get(struct device *dev,
389 return ERR_PTR(-ENOMEM); 418 return ERR_PTR(-ENOMEM);
390 419
391 rstc = __of_reset_control_get(dev ? dev->of_node : NULL, 420 rstc = __of_reset_control_get(dev ? dev->of_node : NULL,
392 id, index, shared); 421 id, index, shared, optional);
393 if (!IS_ERR(rstc)) { 422 if (!IS_ERR(rstc)) {
394 *ptr = rstc; 423 *ptr = rstc;
395 devres_add(dev, ptr); 424 devres_add(dev, ptr);
diff --git a/drivers/reset/hisilicon/Kconfig b/drivers/reset/hisilicon/Kconfig
index 1ff8b0c80980..10134dc03fe0 100644
--- a/drivers/reset/hisilicon/Kconfig
+++ b/drivers/reset/hisilicon/Kconfig
@@ -1,3 +1,10 @@
1config COMMON_RESET_HI3660
2 tristate "Hi3660 Reset Driver"
3 depends on ARCH_HISI || COMPILE_TEST
4 default ARCH_HISI
5 help
6 Build the Hisilicon Hi3660 reset driver.
7
1config COMMON_RESET_HI6220 8config COMMON_RESET_HI6220
2 tristate "Hi6220 Reset Driver" 9 tristate "Hi6220 Reset Driver"
3 depends on ARCH_HISI || COMPILE_TEST 10 depends on ARCH_HISI || COMPILE_TEST
diff --git a/drivers/reset/hisilicon/Makefile b/drivers/reset/hisilicon/Makefile
index c932f86e2f10..ab8a7bfcbd8d 100644
--- a/drivers/reset/hisilicon/Makefile
+++ b/drivers/reset/hisilicon/Makefile
@@ -1 +1,2 @@
1obj-$(CONFIG_COMMON_RESET_HI6220) += hi6220_reset.o 1obj-$(CONFIG_COMMON_RESET_HI6220) += hi6220_reset.o
2obj-$(CONFIG_COMMON_RESET_HI3660) += reset-hi3660.o
diff --git a/drivers/reset/hisilicon/reset-hi3660.c b/drivers/reset/hisilicon/reset-hi3660.c
new file mode 100644
index 000000000000..17d8bb128e6e
--- /dev/null
+++ b/drivers/reset/hisilicon/reset-hi3660.c
@@ -0,0 +1,126 @@
1/*
2 * Copyright (c) 2016-2017 Linaro Ltd.
3 * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10#include <linux/kernel.h>
11#include <linux/mfd/syscon.h>
12#include <linux/module.h>
13#include <linux/of_device.h>
14#include <linux/platform_device.h>
15#include <linux/regmap.h>
16#include <linux/reset-controller.h>
17
18struct hi3660_reset_controller {
19 struct reset_controller_dev rst;
20 struct regmap *map;
21};
22
23#define to_hi3660_reset_controller(_rst) \
24 container_of(_rst, struct hi3660_reset_controller, rst)
25
26static int hi3660_reset_program_hw(struct reset_controller_dev *rcdev,
27 unsigned long idx, bool assert)
28{
29 struct hi3660_reset_controller *rc = to_hi3660_reset_controller(rcdev);
30 unsigned int offset = idx >> 8;
31 unsigned int mask = BIT(idx & 0x1f);
32
33 if (assert)
34 return regmap_write(rc->map, offset, mask);
35 else
36 return regmap_write(rc->map, offset + 4, mask);
37}
38
39static int hi3660_reset_assert(struct reset_controller_dev *rcdev,
40 unsigned long idx)
41{
42 return hi3660_reset_program_hw(rcdev, idx, true);
43}
44
45static int hi3660_reset_deassert(struct reset_controller_dev *rcdev,
46 unsigned long idx)
47{
48 return hi3660_reset_program_hw(rcdev, idx, false);
49}
50
51static int hi3660_reset_dev(struct reset_controller_dev *rcdev,
52 unsigned long idx)
53{
54 int err;
55
56 err = hi3660_reset_assert(rcdev, idx);
57 if (err)
58 return err;
59
60 return hi3660_reset_deassert(rcdev, idx);
61}
62
63static struct reset_control_ops hi3660_reset_ops = {
64 .reset = hi3660_reset_dev,
65 .assert = hi3660_reset_assert,
66 .deassert = hi3660_reset_deassert,
67};
68
69static int hi3660_reset_xlate(struct reset_controller_dev *rcdev,
70 const struct of_phandle_args *reset_spec)
71{
72 unsigned int offset, bit;
73
74 offset = reset_spec->args[0];
75 bit = reset_spec->args[1];
76
77 return (offset << 8) | bit;
78}
79
80static int hi3660_reset_probe(struct platform_device *pdev)
81{
82 struct hi3660_reset_controller *rc;
83 struct device_node *np = pdev->dev.of_node;
84 struct device *dev = &pdev->dev;
85
86 rc = devm_kzalloc(dev, sizeof(*rc), GFP_KERNEL);
87 if (!rc)
88 return -ENOMEM;
89
90 rc->map = syscon_regmap_lookup_by_phandle(np, "hisi,rst-syscon");
91 if (IS_ERR(rc->map)) {
92 dev_err(dev, "failed to get hi3660,rst-syscon\n");
93 return PTR_ERR(rc->map);
94 }
95
96 rc->rst.ops = &hi3660_reset_ops,
97 rc->rst.of_node = np;
98 rc->rst.of_reset_n_cells = 2;
99 rc->rst.of_xlate = hi3660_reset_xlate;
100
101 return reset_controller_register(&rc->rst);
102}
103
104static const struct of_device_id hi3660_reset_match[] = {
105 { .compatible = "hisilicon,hi3660-reset", },
106 {},
107};
108MODULE_DEVICE_TABLE(of, hi3660_reset_match);
109
110static struct platform_driver hi3660_reset_driver = {
111 .probe = hi3660_reset_probe,
112 .driver = {
113 .name = "hi3660-reset",
114 .of_match_table = hi3660_reset_match,
115 },
116};
117
118static int __init hi3660_reset_init(void)
119{
120 return platform_driver_register(&hi3660_reset_driver);
121}
122arch_initcall(hi3660_reset_init);
123
124MODULE_LICENSE("GPL");
125MODULE_ALIAS("platform:hi3660-reset");
126MODULE_DESCRIPTION("HiSilicon Hi3660 Reset Driver");
diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c
index 47f0ffd3b013..99520b0a1329 100644
--- a/drivers/reset/reset-ti-syscon.c
+++ b/drivers/reset/reset-ti-syscon.c
@@ -154,11 +154,11 @@ static int ti_syscon_reset_status(struct reset_controller_dev *rcdev,
154 if (ret) 154 if (ret)
155 return ret; 155 return ret;
156 156
157 return (reset_state & BIT(control->status_bit)) && 157 return !(reset_state & BIT(control->status_bit)) ==
158 (control->flags & STATUS_SET); 158 !(control->flags & STATUS_SET);
159} 159}
160 160
161static struct reset_control_ops ti_syscon_reset_ops = { 161static const struct reset_control_ops ti_syscon_reset_ops = {
162 .assert = ti_syscon_reset_assert, 162 .assert = ti_syscon_reset_assert,
163 .deassert = ti_syscon_reset_deassert, 163 .deassert = ti_syscon_reset_deassert,
164 .status = ti_syscon_reset_status, 164 .status = ti_syscon_reset_status,
diff --git a/drivers/reset/reset-uniphier.c b/drivers/reset/reset-uniphier.c
index 968c3ae4535c..9c11be3d3450 100644
--- a/drivers/reset/reset-uniphier.c
+++ b/drivers/reset/reset-uniphier.c
@@ -390,6 +390,10 @@ static const struct of_device_id uniphier_reset_match[] = {
390 .data = uniphier_sld3_mio_reset_data, 390 .data = uniphier_sld3_mio_reset_data,
391 }, 391 },
392 { 392 {
393 .compatible = "socionext,uniphier-ld11-sd-reset",
394 .data = uniphier_pro5_sd_reset_data,
395 },
396 {
393 .compatible = "socionext,uniphier-ld20-sd-reset", 397 .compatible = "socionext,uniphier-ld20-sd-reset",
394 .data = uniphier_pro5_sd_reset_data, 398 .data = uniphier_pro5_sd_reset_data,
395 }, 399 },
diff --git a/drivers/reset/reset-zx2967.c b/drivers/reset/reset-zx2967.c
new file mode 100644
index 000000000000..4dabb9ec4841
--- /dev/null
+++ b/drivers/reset/reset-zx2967.c
@@ -0,0 +1,99 @@
1/*
2 * ZTE's zx2967 family reset controller driver
3 *
4 * Copyright (C) 2017 ZTE Ltd.
5 *
6 * Author: Baoyou Xie <baoyou.xie@linaro.org>
7 *
8 * License terms: GNU General Public License (GPL) version 2
9 */
10
11#include <linux/of_address.h>
12#include <linux/platform_device.h>
13#include <linux/reset-controller.h>
14
15struct zx2967_reset {
16 void __iomem *reg_base;
17 spinlock_t lock;
18 struct reset_controller_dev rcdev;
19};
20
21static int zx2967_reset_act(struct reset_controller_dev *rcdev,
22 unsigned long id, bool assert)
23{
24 struct zx2967_reset *reset = NULL;
25 int bank = id / 32;
26 int offset = id % 32;
27 u32 reg;
28 unsigned long flags;
29
30 reset = container_of(rcdev, struct zx2967_reset, rcdev);
31
32 spin_lock_irqsave(&reset->lock, flags);
33
34 reg = readl_relaxed(reset->reg_base + (bank * 4));
35 if (assert)
36 reg &= ~BIT(offset);
37 else
38 reg |= BIT(offset);
39 writel_relaxed(reg, reset->reg_base + (bank * 4));
40
41 spin_unlock_irqrestore(&reset->lock, flags);
42
43 return 0;
44}
45
46static int zx2967_reset_assert(struct reset_controller_dev *rcdev,
47 unsigned long id)
48{
49 return zx2967_reset_act(rcdev, id, true);
50}
51
52static int zx2967_reset_deassert(struct reset_controller_dev *rcdev,
53 unsigned long id)
54{
55 return zx2967_reset_act(rcdev, id, false);
56}
57
58static struct reset_control_ops zx2967_reset_ops = {
59 .assert = zx2967_reset_assert,
60 .deassert = zx2967_reset_deassert,
61};
62
63static int zx2967_reset_probe(struct platform_device *pdev)
64{
65 struct zx2967_reset *reset;
66 struct resource *res;
67
68 reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
69 if (!reset)
70 return -ENOMEM;
71
72 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
73 reset->reg_base = devm_ioremap_resource(&pdev->dev, res);
74 if (IS_ERR(reset->reg_base))
75 return PTR_ERR(reset->reg_base);
76
77 spin_lock_init(&reset->lock);
78
79 reset->rcdev.owner = THIS_MODULE;
80 reset->rcdev.nr_resets = resource_size(res) * 8;
81 reset->rcdev.ops = &zx2967_reset_ops;
82 reset->rcdev.of_node = pdev->dev.of_node;
83
84 return devm_reset_controller_register(&pdev->dev, &reset->rcdev);
85}
86
87static const struct of_device_id zx2967_reset_dt_ids[] = {
88 { .compatible = "zte,zx296718-reset", },
89 {},
90};
91
92static struct platform_driver zx2967_reset_driver = {
93 .probe = zx2967_reset_probe,
94 .driver = {
95 .name = "zx2967-reset",
96 .of_match_table = zx2967_reset_dt_ids,
97 },
98};
99builtin_platform_driver(zx2967_reset_driver);
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index f31bceb69c0d..f09023f7ab11 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -11,5 +11,6 @@ source "drivers/soc/tegra/Kconfig"
11source "drivers/soc/ti/Kconfig" 11source "drivers/soc/ti/Kconfig"
12source "drivers/soc/ux500/Kconfig" 12source "drivers/soc/ux500/Kconfig"
13source "drivers/soc/versatile/Kconfig" 13source "drivers/soc/versatile/Kconfig"
14source "drivers/soc/zte/Kconfig"
14 15
15endmenu 16endmenu
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 50c23d0bd457..05eae52a30b4 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -16,3 +16,4 @@ obj-$(CONFIG_ARCH_TEGRA) += tegra/
16obj-$(CONFIG_SOC_TI) += ti/ 16obj-$(CONFIG_SOC_TI) += ti/
17obj-$(CONFIG_ARCH_U8500) += ux500/ 17obj-$(CONFIG_ARCH_U8500) += ux500/
18obj-$(CONFIG_PLAT_VERSATILE) += versatile/ 18obj-$(CONFIG_PLAT_VERSATILE) += versatile/
19obj-$(CONFIG_ARCH_ZX) += zte/
diff --git a/drivers/soc/rockchip/Kconfig b/drivers/soc/rockchip/Kconfig
index 7140ff825598..20da55d9cbb1 100644
--- a/drivers/soc/rockchip/Kconfig
+++ b/drivers/soc/rockchip/Kconfig
@@ -3,6 +3,16 @@ if ARCH_ROCKCHIP || COMPILE_TEST
3# 3#
4# Rockchip Soc drivers 4# Rockchip Soc drivers
5# 5#
6
7config ROCKCHIP_GRF
8 bool
9 default y
10 help
11 The General Register Files are a central component providing
12 special additional settings registers for a lot of soc-components.
13 In a lot of cases there also need to be default settings initialized
14 to make some of them conform to expectations of the kernel.
15
6config ROCKCHIP_PM_DOMAINS 16config ROCKCHIP_PM_DOMAINS
7 bool "Rockchip generic power domain" 17 bool "Rockchip generic power domain"
8 depends on PM 18 depends on PM
diff --git a/drivers/soc/rockchip/Makefile b/drivers/soc/rockchip/Makefile
index 3d73d0672d22..c851fa0056d0 100644
--- a/drivers/soc/rockchip/Makefile
+++ b/drivers/soc/rockchip/Makefile
@@ -1,4 +1,5 @@
1# 1#
2# Rockchip Soc drivers 2# Rockchip Soc drivers
3# 3#
4obj-$(CONFIG_ROCKCHIP_GRF) += grf.o
4obj-$(CONFIG_ROCKCHIP_PM_DOMAINS) += pm_domains.o 5obj-$(CONFIG_ROCKCHIP_PM_DOMAINS) += pm_domains.o
diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
new file mode 100644
index 000000000000..d61db34ad6dd
--- /dev/null
+++ b/drivers/soc/rockchip/grf.c
@@ -0,0 +1,134 @@
1/*
2 * Rockchip Generic Register Files setup
3 *
4 * Copyright (c) 2016 Heiko Stuebner <heiko@sntech.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/err.h>
12#include <linux/mfd/syscon.h>
13#include <linux/of_device.h>
14#include <linux/platform_device.h>
15#include <linux/regmap.h>
16
17#define HIWORD_UPDATE(val, mask, shift) \
18 ((val) << (shift) | (mask) << ((shift) + 16))
19
20struct rockchip_grf_value {
21 const char *desc;
22 u32 reg;
23 u32 val;
24};
25
26struct rockchip_grf_info {
27 const struct rockchip_grf_value *values;
28 int num_values;
29};
30
31#define RK3036_GRF_SOC_CON0 0x140
32
33static const struct rockchip_grf_value rk3036_defaults[] __initconst = {
34 /*
35 * Disable auto jtag/sdmmc switching that causes issues with the
36 * clock-framework and the mmc controllers making them unreliable.
37 */
38 { "jtag switching", RK3036_GRF_SOC_CON0, HIWORD_UPDATE(0, 1, 11) },
39};
40
41static const struct rockchip_grf_info rk3036_grf __initconst = {
42 .values = rk3036_defaults,
43 .num_values = ARRAY_SIZE(rk3036_defaults),
44};
45
46#define RK3288_GRF_SOC_CON0 0x244
47
48static const struct rockchip_grf_value rk3288_defaults[] __initconst = {
49 { "jtag switching", RK3288_GRF_SOC_CON0, HIWORD_UPDATE(0, 1, 12) },
50};
51
52static const struct rockchip_grf_info rk3288_grf __initconst = {
53 .values = rk3288_defaults,
54 .num_values = ARRAY_SIZE(rk3288_defaults),
55};
56
57#define RK3368_GRF_SOC_CON15 0x43c
58
59static const struct rockchip_grf_value rk3368_defaults[] __initconst = {
60 { "jtag switching", RK3368_GRF_SOC_CON15, HIWORD_UPDATE(0, 1, 13) },
61};
62
63static const struct rockchip_grf_info rk3368_grf __initconst = {
64 .values = rk3368_defaults,
65 .num_values = ARRAY_SIZE(rk3368_defaults),
66};
67
68#define RK3399_GRF_SOC_CON7 0xe21c
69
70static const struct rockchip_grf_value rk3399_defaults[] __initconst = {
71 { "jtag switching", RK3399_GRF_SOC_CON7, HIWORD_UPDATE(0, 1, 12) },
72};
73
74static const struct rockchip_grf_info rk3399_grf __initconst = {
75 .values = rk3399_defaults,
76 .num_values = ARRAY_SIZE(rk3399_defaults),
77};
78
79static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
80 {
81 .compatible = "rockchip,rk3036-grf",
82 .data = (void *)&rk3036_grf,
83 }, {
84 .compatible = "rockchip,rk3288-grf",
85 .data = (void *)&rk3288_grf,
86 }, {
87 .compatible = "rockchip,rk3368-grf",
88 .data = (void *)&rk3368_grf,
89 }, {
90 .compatible = "rockchip,rk3399-grf",
91 .data = (void *)&rk3399_grf,
92 },
93 { /* sentinel */ },
94};
95
96static int __init rockchip_grf_init(void)
97{
98 const struct rockchip_grf_info *grf_info;
99 const struct of_device_id *match;
100 struct device_node *np;
101 struct regmap *grf;
102 int ret, i;
103
104 np = of_find_matching_node_and_match(NULL, rockchip_grf_dt_match,
105 &match);
106 if (!np)
107 return -ENODEV;
108 if (!match || !match->data) {
109 pr_err("%s: missing grf data\n", __func__);
110 return -EINVAL;
111 }
112
113 grf_info = match->data;
114
115 grf = syscon_node_to_regmap(np);
116 if (IS_ERR(grf)) {
117 pr_err("%s: could not get grf syscon\n", __func__);
118 return PTR_ERR(grf);
119 }
120
121 for (i = 0; i < grf_info->num_values; i++) {
122 const struct rockchip_grf_value *val = &grf_info->values[i];
123
124 pr_debug("%s: adjusting %s in %#6x to %#10x\n", __func__,
125 val->desc, val->reg, val->val);
126 ret = regmap_write(grf, val->reg, val->val);
127 if (ret < 0)
128 pr_err("%s: write to %#6x failed with %d\n",
129 __func__, val->reg, ret);
130 }
131
132 return 0;
133}
134postcore_initcall(rockchip_grf_init);
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 1c78c42416c6..796c46a6cbe7 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -19,6 +19,7 @@
19#include <linux/regmap.h> 19#include <linux/regmap.h>
20#include <linux/mfd/syscon.h> 20#include <linux/mfd/syscon.h>
21#include <dt-bindings/power/rk3288-power.h> 21#include <dt-bindings/power/rk3288-power.h>
22#include <dt-bindings/power/rk3328-power.h>
22#include <dt-bindings/power/rk3368-power.h> 23#include <dt-bindings/power/rk3368-power.h>
23#include <dt-bindings/power/rk3399-power.h> 24#include <dt-bindings/power/rk3399-power.h>
24 25
@@ -29,6 +30,8 @@ struct rockchip_domain_info {
29 int idle_mask; 30 int idle_mask;
30 int ack_mask; 31 int ack_mask;
31 bool active_wakeup; 32 bool active_wakeup;
33 int pwr_w_mask;
34 int req_w_mask;
32}; 35};
33 36
34struct rockchip_pmu_info { 37struct rockchip_pmu_info {
@@ -87,9 +90,24 @@ struct rockchip_pmu {
87 .active_wakeup = wakeup, \ 90 .active_wakeup = wakeup, \
88} 91}
89 92
93#define DOMAIN_M(pwr, status, req, idle, ack, wakeup) \
94{ \
95 .pwr_w_mask = (pwr >= 0) ? BIT(pwr + 16) : 0, \
96 .pwr_mask = (pwr >= 0) ? BIT(pwr) : 0, \
97 .status_mask = (status >= 0) ? BIT(status) : 0, \
98 .req_w_mask = (req >= 0) ? BIT(req + 16) : 0, \
99 .req_mask = (req >= 0) ? BIT(req) : 0, \
100 .idle_mask = (idle >= 0) ? BIT(idle) : 0, \
101 .ack_mask = (ack >= 0) ? BIT(ack) : 0, \
102 .active_wakeup = wakeup, \
103}
104
90#define DOMAIN_RK3288(pwr, status, req, wakeup) \ 105#define DOMAIN_RK3288(pwr, status, req, wakeup) \
91 DOMAIN(pwr, status, req, req, (req) + 16, wakeup) 106 DOMAIN(pwr, status, req, req, (req) + 16, wakeup)
92 107
108#define DOMAIN_RK3328(pwr, status, req, wakeup) \
109 DOMAIN_M(pwr, pwr, req, (req) + 10, req, wakeup)
110
93#define DOMAIN_RK3368(pwr, status, req, wakeup) \ 111#define DOMAIN_RK3368(pwr, status, req, wakeup) \
94 DOMAIN(pwr, status, req, (req) + 16, req, wakeup) 112 DOMAIN(pwr, status, req, (req) + 16, req, wakeup)
95 113
@@ -127,9 +145,13 @@ static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd,
127 145
128 if (pd_info->req_mask == 0) 146 if (pd_info->req_mask == 0)
129 return 0; 147 return 0;
130 148 else if (pd_info->req_w_mask)
131 regmap_update_bits(pmu->regmap, pmu->info->req_offset, 149 regmap_write(pmu->regmap, pmu->info->req_offset,
132 pd_info->req_mask, idle ? -1U : 0); 150 idle ? (pd_info->req_mask | pd_info->req_w_mask) :
151 pd_info->req_w_mask);
152 else
153 regmap_update_bits(pmu->regmap, pmu->info->req_offset,
154 pd_info->req_mask, idle ? -1U : 0);
133 155
134 dsb(sy); 156 dsb(sy);
135 157
@@ -230,9 +252,13 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
230 252
231 if (pd->info->pwr_mask == 0) 253 if (pd->info->pwr_mask == 0)
232 return; 254 return;
233 255 else if (pd->info->pwr_w_mask)
234 regmap_update_bits(pmu->regmap, pmu->info->pwr_offset, 256 regmap_write(pmu->regmap, pmu->info->pwr_offset,
235 pd->info->pwr_mask, on ? 0 : -1U); 257 on ? pd->info->pwr_mask :
258 (pd->info->pwr_mask | pd->info->pwr_w_mask));
259 else
260 regmap_update_bits(pmu->regmap, pmu->info->pwr_offset,
261 pd->info->pwr_mask, on ? 0 : -1U);
236 262
237 dsb(sy); 263 dsb(sy);
238 264
@@ -692,6 +718,18 @@ static const struct rockchip_domain_info rk3288_pm_domains[] = {
692 [RK3288_PD_GPU] = DOMAIN_RK3288(9, 9, 2, false), 718 [RK3288_PD_GPU] = DOMAIN_RK3288(9, 9, 2, false),
693}; 719};
694 720
721static const struct rockchip_domain_info rk3328_pm_domains[] = {
722 [RK3328_PD_CORE] = DOMAIN_RK3328(-1, 0, 0, false),
723 [RK3328_PD_GPU] = DOMAIN_RK3328(-1, 1, 1, false),
724 [RK3328_PD_BUS] = DOMAIN_RK3328(-1, 2, 2, true),
725 [RK3328_PD_MSCH] = DOMAIN_RK3328(-1, 3, 3, true),
726 [RK3328_PD_PERI] = DOMAIN_RK3328(-1, 4, 4, true),
727 [RK3328_PD_VIDEO] = DOMAIN_RK3328(-1, 5, 5, false),
728 [RK3328_PD_HEVC] = DOMAIN_RK3328(-1, 6, 6, false),
729 [RK3328_PD_VIO] = DOMAIN_RK3328(-1, 8, 8, false),
730 [RK3328_PD_VPU] = DOMAIN_RK3328(-1, 9, 9, false),
731};
732
695static const struct rockchip_domain_info rk3368_pm_domains[] = { 733static const struct rockchip_domain_info rk3368_pm_domains[] = {
696 [RK3368_PD_PERI] = DOMAIN_RK3368(13, 12, 6, true), 734 [RK3368_PD_PERI] = DOMAIN_RK3368(13, 12, 6, true),
697 [RK3368_PD_VIO] = DOMAIN_RK3368(15, 14, 8, false), 735 [RK3368_PD_VIO] = DOMAIN_RK3368(15, 14, 8, false),
@@ -747,6 +785,15 @@ static const struct rockchip_pmu_info rk3288_pmu = {
747 .domain_info = rk3288_pm_domains, 785 .domain_info = rk3288_pm_domains,
748}; 786};
749 787
788static const struct rockchip_pmu_info rk3328_pmu = {
789 .req_offset = 0x414,
790 .idle_offset = 0x484,
791 .ack_offset = 0x484,
792
793 .num_domains = ARRAY_SIZE(rk3328_pm_domains),
794 .domain_info = rk3328_pm_domains,
795};
796
750static const struct rockchip_pmu_info rk3368_pmu = { 797static const struct rockchip_pmu_info rk3368_pmu = {
751 .pwr_offset = 0x0c, 798 .pwr_offset = 0x0c,
752 .status_offset = 0x10, 799 .status_offset = 0x10,
@@ -783,6 +830,10 @@ static const struct of_device_id rockchip_pm_domain_dt_match[] = {
783 .data = (void *)&rk3288_pmu, 830 .data = (void *)&rk3288_pmu,
784 }, 831 },
785 { 832 {
833 .compatible = "rockchip,rk3328-power-controller",
834 .data = (void *)&rk3328_pmu,
835 },
836 {
786 .compatible = "rockchip,rk3368-power-controller", 837 .compatible = "rockchip,rk3368-power-controller",
787 .data = (void *)&rk3368_pmu, 838 .data = (void *)&rk3368_pmu,
788 }, 839 },
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index 813df6e7292d..56d9244ff981 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -44,7 +44,7 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
44 unsigned int i; 44 unsigned int i;
45 const struct exynos_pmu_data *pmu_data; 45 const struct exynos_pmu_data *pmu_data;
46 46
47 if (!pmu_context) 47 if (!pmu_context || !pmu_context->pmu_data)
48 return; 48 return;
49 49
50 pmu_data = pmu_context->pmu_data; 50 pmu_data = pmu_context->pmu_data;
@@ -90,6 +90,8 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
90 }, { 90 }, {
91 .compatible = "samsung,exynos5420-pmu", 91 .compatible = "samsung,exynos5420-pmu",
92 .data = &exynos5420_pmu_data, 92 .data = &exynos5420_pmu_data,
93 }, {
94 .compatible = "samsung,exynos5433-pmu",
93 }, 95 },
94 { /*sentinel*/ }, 96 { /*sentinel*/ },
95}; 97};
@@ -122,7 +124,7 @@ static int exynos_pmu_probe(struct platform_device *pdev)
122 pmu_context->dev = dev; 124 pmu_context->dev = dev;
123 pmu_context->pmu_data = of_device_get_match_data(dev); 125 pmu_context->pmu_data = of_device_get_match_data(dev);
124 126
125 if (pmu_context->pmu_data->pmu_init) 127 if (pmu_context->pmu_data && pmu_context->pmu_data->pmu_init)
126 pmu_context->pmu_data->pmu_init(); 128 pmu_context->pmu_data->pmu_init();
127 129
128 platform_set_drvdata(pdev, pmu_context); 130 platform_set_drvdata(pdev, pmu_context);
diff --git a/drivers/soc/samsung/exynos5250-pmu.c b/drivers/soc/samsung/exynos5250-pmu.c
index 3fac42561964..8d94f0819f32 100644
--- a/drivers/soc/samsung/exynos5250-pmu.c
+++ b/drivers/soc/samsung/exynos5250-pmu.c
@@ -29,7 +29,7 @@ static const struct exynos_pmu_conf exynos5250_pmu_config[] = {
29 { EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, 29 { EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
30 { EXYNOS5_ARM_COMMON_SYS_PWR_REG, { 0x0, 0x0, 0x2} }, 30 { EXYNOS5_ARM_COMMON_SYS_PWR_REG, { 0x0, 0x0, 0x2} },
31 { EXYNOS5_ARM_L2_SYS_PWR_REG, { 0x3, 0x3, 0x3} }, 31 { EXYNOS5_ARM_L2_SYS_PWR_REG, { 0x3, 0x3, 0x3} },
32 { EXYNOS5_ARM_L2_OPTION, { 0x10, 0x10, 0x0 } }, 32 { EXYNOS_L2_OPTION(0), { 0x10, 0x10, 0x0 } },
33 { EXYNOS5_CMU_ACLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, 33 { EXYNOS5_CMU_ACLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} },
34 { EXYNOS5_CMU_SCLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, 34 { EXYNOS5_CMU_SCLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} },
35 { EXYNOS5_CMU_RESET_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, 35 { EXYNOS5_CMU_RESET_SYS_PWR_REG, { 0x1, 0x1, 0x0} },
diff --git a/drivers/soc/samsung/exynos5420-pmu.c b/drivers/soc/samsung/exynos5420-pmu.c
index 3f2c64180ef8..0a89fa79c678 100644
--- a/drivers/soc/samsung/exynos5420-pmu.c
+++ b/drivers/soc/samsung/exynos5420-pmu.c
@@ -230,11 +230,11 @@ static void exynos5420_pmu_init(void)
230 pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION); 230 pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION);
231 231
232 value = pmu_raw_readl(EXYNOS_L2_OPTION(0)); 232 value = pmu_raw_readl(EXYNOS_L2_OPTION(0));
233 value &= ~EXYNOS5_USE_RETENTION; 233 value &= ~EXYNOS_L2_USE_RETENTION;
234 pmu_raw_writel(value, EXYNOS_L2_OPTION(0)); 234 pmu_raw_writel(value, EXYNOS_L2_OPTION(0));
235 235
236 value = pmu_raw_readl(EXYNOS_L2_OPTION(1)); 236 value = pmu_raw_readl(EXYNOS_L2_OPTION(1));
237 value &= ~EXYNOS5_USE_RETENTION; 237 value &= ~EXYNOS_L2_USE_RETENTION;
238 pmu_raw_writel(value, EXYNOS_L2_OPTION(1)); 238 pmu_raw_writel(value, EXYNOS_L2_OPTION(1));
239 239
240 /* 240 /*
diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c
index 7112004b8032..a6a5d807cc2b 100644
--- a/drivers/soc/samsung/pm_domains.c
+++ b/drivers/soc/samsung/pm_domains.c
@@ -35,7 +35,6 @@ struct exynos_pm_domain_config {
35 */ 35 */
36struct exynos_pm_domain { 36struct exynos_pm_domain {
37 void __iomem *base; 37 void __iomem *base;
38 char const *name;
39 bool is_off; 38 bool is_off;
40 struct generic_pm_domain pd; 39 struct generic_pm_domain pd;
41 struct clk *oscclk; 40 struct clk *oscclk;
@@ -70,7 +69,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
70 pd->pclk[i] = clk_get_parent(pd->clk[i]); 69 pd->pclk[i] = clk_get_parent(pd->clk[i]);
71 if (clk_set_parent(pd->clk[i], pd->oscclk)) 70 if (clk_set_parent(pd->clk[i], pd->oscclk))
72 pr_err("%s: error setting oscclk as parent to clock %d\n", 71 pr_err("%s: error setting oscclk as parent to clock %d\n",
73 pd->name, i); 72 domain->name, i);
74 } 73 }
75 } 74 }
76 75
@@ -101,7 +100,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
101 continue; /* Skip on first power up */ 100 continue; /* Skip on first power up */
102 if (clk_set_parent(pd->clk[i], pd->pclk[i])) 101 if (clk_set_parent(pd->clk[i], pd->pclk[i]))
103 pr_err("%s: error setting parent to clock%d\n", 102 pr_err("%s: error setting parent to clock%d\n",
104 pd->name, i); 103 domain->name, i);
105 } 104 }
106 } 105 }
107 106
@@ -128,14 +127,30 @@ static const struct exynos_pm_domain_config exynos4210_cfg __initconst = {
128 .local_pwr_cfg = 0x7, 127 .local_pwr_cfg = 0x7,
129}; 128};
130 129
130static const struct exynos_pm_domain_config exynos5433_cfg __initconst = {
131 .local_pwr_cfg = 0xf,
132};
133
131static const struct of_device_id exynos_pm_domain_of_match[] __initconst = { 134static const struct of_device_id exynos_pm_domain_of_match[] __initconst = {
132 { 135 {
133 .compatible = "samsung,exynos4210-pd", 136 .compatible = "samsung,exynos4210-pd",
134 .data = &exynos4210_cfg, 137 .data = &exynos4210_cfg,
138 }, {
139 .compatible = "samsung,exynos5433-pd",
140 .data = &exynos5433_cfg,
135 }, 141 },
136 { }, 142 { },
137}; 143};
138 144
145static __init const char *exynos_get_domain_name(struct device_node *node)
146{
147 const char *name;
148
149 if (of_property_read_string(node, "label", &name) < 0)
150 name = strrchr(node->full_name, '/') + 1;
151 return kstrdup_const(name, GFP_KERNEL);
152}
153
139static __init int exynos4_pm_init_power_domain(void) 154static __init int exynos4_pm_init_power_domain(void)
140{ 155{
141 struct device_node *np; 156 struct device_node *np;
@@ -150,20 +165,16 @@ static __init int exynos4_pm_init_power_domain(void)
150 165
151 pd = kzalloc(sizeof(*pd), GFP_KERNEL); 166 pd = kzalloc(sizeof(*pd), GFP_KERNEL);
152 if (!pd) { 167 if (!pd) {
153 pr_err("%s: failed to allocate memory for domain\n",
154 __func__);
155 of_node_put(np); 168 of_node_put(np);
156 return -ENOMEM; 169 return -ENOMEM;
157 } 170 }
158 pd->pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1, 171 pd->pd.name = exynos_get_domain_name(np);
159 GFP_KERNEL);
160 if (!pd->pd.name) { 172 if (!pd->pd.name) {
161 kfree(pd); 173 kfree(pd);
162 of_node_put(np); 174 of_node_put(np);
163 return -ENOMEM; 175 return -ENOMEM;
164 } 176 }
165 177
166 pd->name = pd->pd.name;
167 pd->base = of_iomap(np, 0); 178 pd->base = of_iomap(np, 0);
168 if (!pd->base) { 179 if (!pd->base) {
169 pr_warn("%s: failed to map memory\n", __func__); 180 pr_warn("%s: failed to map memory\n", __func__);
@@ -227,10 +238,10 @@ no_clk:
227 238
228 if (of_genpd_add_subdomain(&parent, &child)) 239 if (of_genpd_add_subdomain(&parent, &child))
229 pr_warn("%s failed to add subdomain: %s\n", 240 pr_warn("%s failed to add subdomain: %s\n",
230 parent.np->name, child.np->name); 241 parent.np->full_name, child.np->full_name);
231 else 242 else
232 pr_info("%s has as child subdomain: %s.\n", 243 pr_info("%s has as child subdomain: %s.\n",
233 parent.np->name, child.np->name); 244 parent.np->full_name, child.np->full_name);
234 } 245 }
235 246
236 return 0; 247 return 0;
diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index 1a7b5caa127b..ecebe2eecc3a 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -395,7 +395,7 @@ static int of_channel_match_helper(struct device_node *np, const char *name,
395 395
396 if (of_parse_phandle_with_fixed_args(np, "ti,navigator-dmas", 396 if (of_parse_phandle_with_fixed_args(np, "ti,navigator-dmas",
397 1, index, &args)) { 397 1, index, &args)) {
398 dev_err(kdev->dev, "Missing the pahndle args name %s\n", name); 398 dev_err(kdev->dev, "Missing the phandle args name %s\n", name);
399 return -ENODEV; 399 return -ENODEV;
400 } 400 }
401 401
@@ -436,7 +436,7 @@ void *knav_dma_open_channel(struct device *dev, const char *name,
436 } 436 }
437 437
438 dev_dbg(kdev->dev, "initializing %s channel %d from DMA %s\n", 438 dev_dbg(kdev->dev, "initializing %s channel %d from DMA %s\n",
439 config->direction == DMA_MEM_TO_DEV ? "transmit" : 439 config->direction == DMA_MEM_TO_DEV ? "transmit" :
440 config->direction == DMA_DEV_TO_MEM ? "receive" : 440 config->direction == DMA_DEV_TO_MEM ? "receive" :
441 "unknown", chan_num, instance); 441 "unknown", chan_num, instance);
442 442
diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c
index 0612ebae0a09..3d7225f4e77f 100644
--- a/drivers/soc/ti/knav_qmss_acc.c
+++ b/drivers/soc/ti/knav_qmss_acc.c
@@ -16,21 +16,12 @@
16 * General Public License for more details. 16 * General Public License for more details.
17 */ 17 */
18 18
19#include <linux/kernel.h> 19#include <linux/dma-mapping.h>
20#include <linux/module.h>
21#include <linux/device.h>
22#include <linux/io.h> 20#include <linux/io.h>
23#include <linux/interrupt.h> 21#include <linux/interrupt.h>
24#include <linux/bitops.h> 22#include <linux/module.h>
25#include <linux/slab.h>
26#include <linux/spinlock.h>
27#include <linux/soc/ti/knav_qmss.h>
28#include <linux/platform_device.h>
29#include <linux/dma-mapping.h>
30#include <linux/of.h>
31#include <linux/of_device.h>
32#include <linux/of_address.h> 23#include <linux/of_address.h>
33#include <linux/firmware.h> 24#include <linux/soc/ti/knav_qmss.h>
34 25
35#include "knav_qmss.h" 26#include "knav_qmss.h"
36 27
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index eacad57f2977..279e7c5551dd 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -16,26 +16,17 @@
16 * General Public License for more details. 16 * General Public License for more details.
17 */ 17 */
18 18
19#include <linux/kernel.h> 19#include <linux/debugfs.h>
20#include <linux/module.h>
21#include <linux/device.h>
22#include <linux/clk.h>
23#include <linux/io.h>
24#include <linux/interrupt.h>
25#include <linux/bitops.h>
26#include <linux/slab.h>
27#include <linux/spinlock.h>
28#include <linux/platform_device.h>
29#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
30#include <linux/of.h> 21#include <linux/firmware.h>
31#include <linux/of_irq.h> 22#include <linux/interrupt.h>
32#include <linux/of_device.h> 23#include <linux/io.h>
24#include <linux/module.h>
33#include <linux/of_address.h> 25#include <linux/of_address.h>
26#include <linux/of_device.h>
27#include <linux/of_irq.h>
34#include <linux/pm_runtime.h> 28#include <linux/pm_runtime.h>
35#include <linux/firmware.h> 29#include <linux/slab.h>
36#include <linux/debugfs.h>
37#include <linux/seq_file.h>
38#include <linux/string.h>
39#include <linux/soc/ti/knav_qmss.h> 30#include <linux/soc/ti/knav_qmss.h>
40 31
41#include "knav_qmss.h" 32#include "knav_qmss.h"
diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 5bb376009d98..369aef5e7228 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -370,8 +370,6 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc)
370 struct device *dev = m3_ipc->dev; 370 struct device *dev = m3_ipc->dev;
371 int ret; 371 int ret;
372 372
373 wait_for_completion(&m3_ipc->rproc->firmware_loading_complete);
374
375 init_completion(&m3_ipc->sync_complete); 373 init_completion(&m3_ipc->sync_complete);
376 374
377 ret = rproc_boot(m3_ipc->rproc); 375 ret = rproc_boot(m3_ipc->rproc);
diff --git a/drivers/soc/zte/Kconfig b/drivers/soc/zte/Kconfig
new file mode 100644
index 000000000000..20bde38ce2f9
--- /dev/null
+++ b/drivers/soc/zte/Kconfig
@@ -0,0 +1,13 @@
1#
2# ZTE SoC drivers
3#
4menuconfig SOC_ZTE
5 bool "ZTE SoC driver support"
6
7if SOC_ZTE
8
9config ZX2967_PM_DOMAINS
10 bool "ZX2967 PM domains"
11 depends on PM_GENERIC_DOMAINS
12
13endif
diff --git a/drivers/soc/zte/Makefile b/drivers/soc/zte/Makefile
new file mode 100644
index 000000000000..96b7cd4c9629
--- /dev/null
+++ b/drivers/soc/zte/Makefile
@@ -0,0 +1,5 @@
1#
2# ZTE SOC drivers
3#
4obj-$(CONFIG_ZX2967_PM_DOMAINS) += zx2967_pm_domains.o
5obj-$(CONFIG_ZX2967_PM_DOMAINS) += zx296718_pm_domains.o
diff --git a/drivers/soc/zte/zx296718_pm_domains.c b/drivers/soc/zte/zx296718_pm_domains.c
new file mode 100644
index 000000000000..5ed924fee855
--- /dev/null
+++ b/drivers/soc/zte/zx296718_pm_domains.c
@@ -0,0 +1,182 @@
1/*
2 * Copyright (C) 2017 ZTE Ltd.
3 *
4 * Author: Baoyou Xie <baoyou.xie@linaro.org>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <dt-bindings/soc/zte,pm_domains.h>
9#include "zx2967_pm_domains.h"
10
11static u16 zx296718_offsets[REG_ARRAY_SIZE] = {
12 [REG_CLKEN] = 0x18,
13 [REG_ISOEN] = 0x1c,
14 [REG_RSTEN] = 0x20,
15 [REG_PWREN] = 0x24,
16 [REG_ACK_SYNC] = 0x28,
17};
18
19enum {
20 PCU_DM_VOU = 0,
21 PCU_DM_SAPPU,
22 PCU_DM_VDE,
23 PCU_DM_VCE,
24 PCU_DM_HDE,
25 PCU_DM_VIU,
26 PCU_DM_USB20,
27 PCU_DM_USB21,
28 PCU_DM_USB30,
29 PCU_DM_HSIC,
30 PCU_DM_GMAC,
31 PCU_DM_TS,
32};
33
34static struct zx2967_pm_domain vou_domain = {
35 .dm = {
36 .name = "vou_domain",
37 },
38 .bit = PCU_DM_VOU,
39 .polarity = PWREN,
40 .reg_offset = zx296718_offsets,
41};
42
43static struct zx2967_pm_domain sappu_domain = {
44 .dm = {
45 .name = "sappu_domain",
46 },
47 .bit = PCU_DM_SAPPU,
48 .polarity = PWREN,
49 .reg_offset = zx296718_offsets,
50};
51
52static struct zx2967_pm_domain vde_domain = {
53 .dm = {
54 .name = "vde_domain",
55 },
56 .bit = PCU_DM_VDE,
57 .polarity = PWREN,
58 .reg_offset = zx296718_offsets,
59};
60
61static struct zx2967_pm_domain vce_domain = {
62 .dm = {
63 .name = "vce_domain",
64 },
65 .bit = PCU_DM_VCE,
66 .polarity = PWREN,
67 .reg_offset = zx296718_offsets,
68};
69
70static struct zx2967_pm_domain hde_domain = {
71 .dm = {
72 .name = "hde_domain",
73 },
74 .bit = PCU_DM_HDE,
75 .polarity = PWREN,
76 .reg_offset = zx296718_offsets,
77};
78
79static struct zx2967_pm_domain viu_domain = {
80 .dm = {
81 .name = "viu_domain",
82 },
83 .bit = PCU_DM_VIU,
84 .polarity = PWREN,
85 .reg_offset = zx296718_offsets,
86};
87
88static struct zx2967_pm_domain usb20_domain = {
89 .dm = {
90 .name = "usb20_domain",
91 },
92 .bit = PCU_DM_USB20,
93 .polarity = PWREN,
94 .reg_offset = zx296718_offsets,
95};
96
97static struct zx2967_pm_domain usb21_domain = {
98 .dm = {
99 .name = "usb21_domain",
100 },
101 .bit = PCU_DM_USB21,
102 .polarity = PWREN,
103 .reg_offset = zx296718_offsets,
104};
105
106static struct zx2967_pm_domain usb30_domain = {
107 .dm = {
108 .name = "usb30_domain",
109 },
110 .bit = PCU_DM_USB30,
111 .polarity = PWREN,
112 .reg_offset = zx296718_offsets,
113};
114
115static struct zx2967_pm_domain hsic_domain = {
116 .dm = {
117 .name = "hsic_domain",
118 },
119 .bit = PCU_DM_HSIC,
120 .polarity = PWREN,
121 .reg_offset = zx296718_offsets,
122};
123
124static struct zx2967_pm_domain gmac_domain = {
125 .dm = {
126 .name = "gmac_domain",
127 },
128 .bit = PCU_DM_GMAC,
129 .polarity = PWREN,
130 .reg_offset = zx296718_offsets,
131};
132
133static struct zx2967_pm_domain ts_domain = {
134 .dm = {
135 .name = "ts_domain",
136 },
137 .bit = PCU_DM_TS,
138 .polarity = PWREN,
139 .reg_offset = zx296718_offsets,
140};
141
142static struct generic_pm_domain *zx296718_pm_domains[] = {
143 [DM_ZX296718_VOU] = &vou_domain.dm,
144 [DM_ZX296718_SAPPU] = &sappu_domain.dm,
145 [DM_ZX296718_VDE] = &vde_domain.dm,
146 [DM_ZX296718_VCE] = &vce_domain.dm,
147 [DM_ZX296718_HDE] = &hde_domain.dm,
148 [DM_ZX296718_VIU] = &viu_domain.dm,
149 [DM_ZX296718_USB20] = &usb20_domain.dm,
150 [DM_ZX296718_USB21] = &usb21_domain.dm,
151 [DM_ZX296718_USB30] = &usb30_domain.dm,
152 [DM_ZX296718_HSIC] = &hsic_domain.dm,
153 [DM_ZX296718_GMAC] = &gmac_domain.dm,
154 [DM_ZX296718_TS] = &ts_domain.dm,
155};
156
157static int zx296718_pd_probe(struct platform_device *pdev)
158{
159 return zx2967_pd_probe(pdev,
160 zx296718_pm_domains,
161 ARRAY_SIZE(zx296718_pm_domains));
162}
163
164static const struct of_device_id zx296718_pm_domain_matches[] = {
165 { .compatible = "zte,zx296718-pcu", },
166 { },
167};
168
169static struct platform_driver zx296718_pd_driver = {
170 .driver = {
171 .name = "zx296718-powerdomain",
172 .owner = THIS_MODULE,
173 .of_match_table = zx296718_pm_domain_matches,
174 },
175 .probe = zx296718_pd_probe,
176};
177
178static int __init zx296718_pd_init(void)
179{
180 return platform_driver_register(&zx296718_pd_driver);
181}
182subsys_initcall(zx296718_pd_init);
diff --git a/drivers/soc/zte/zx2967_pm_domains.c b/drivers/soc/zte/zx2967_pm_domains.c
new file mode 100644
index 000000000000..61c8d84bf315
--- /dev/null
+++ b/drivers/soc/zte/zx2967_pm_domains.c
@@ -0,0 +1,143 @@
1/*
2 * Copyright (C) 2017 ZTE Ltd.
3 *
4 * Author: Baoyou Xie <baoyou.xie@linaro.org>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/delay.h>
9#include <linux/err.h>
10#include <linux/io.h>
11#include <linux/of.h>
12
13#include "zx2967_pm_domains.h"
14
15#define PCU_DM_CLKEN(zpd) ((zpd)->reg_offset[REG_CLKEN])
16#define PCU_DM_ISOEN(zpd) ((zpd)->reg_offset[REG_ISOEN])
17#define PCU_DM_RSTEN(zpd) ((zpd)->reg_offset[REG_RSTEN])
18#define PCU_DM_PWREN(zpd) ((zpd)->reg_offset[REG_PWREN])
19#define PCU_DM_ACK_SYNC(zpd) ((zpd)->reg_offset[REG_ACK_SYNC])
20
21static void __iomem *pcubase;
22
23static int zx2967_power_on(struct generic_pm_domain *domain)
24{
25 struct zx2967_pm_domain *zpd = (struct zx2967_pm_domain *)domain;
26 unsigned long loop = 1000;
27 u32 val;
28
29 val = readl_relaxed(pcubase + PCU_DM_PWREN(zpd));
30 if (zpd->polarity == PWREN)
31 val |= BIT(zpd->bit);
32 else
33 val &= ~BIT(zpd->bit);
34 writel_relaxed(val, pcubase + PCU_DM_PWREN(zpd));
35
36 do {
37 udelay(1);
38 val = readl_relaxed(pcubase + PCU_DM_ACK_SYNC(zpd))
39 & BIT(zpd->bit);
40 } while (--loop && !val);
41
42 if (!loop) {
43 pr_err("Error: %s %s fail\n", __func__, domain->name);
44 return -EIO;
45 }
46
47 val = readl_relaxed(pcubase + PCU_DM_RSTEN(zpd));
48 val |= BIT(zpd->bit);
49 writel_relaxed(val, pcubase + PCU_DM_RSTEN(zpd));
50 udelay(5);
51
52 val = readl_relaxed(pcubase + PCU_DM_ISOEN(zpd));
53 val &= ~BIT(zpd->bit);
54 writel_relaxed(val, pcubase + PCU_DM_ISOEN(zpd));
55 udelay(5);
56
57 val = readl_relaxed(pcubase + PCU_DM_CLKEN(zpd));
58 val |= BIT(zpd->bit);
59 writel_relaxed(val, pcubase + PCU_DM_CLKEN(zpd));
60 udelay(5);
61
62 pr_debug("poweron %s\n", domain->name);
63
64 return 0;
65}
66
67static int zx2967_power_off(struct generic_pm_domain *domain)
68{
69 struct zx2967_pm_domain *zpd = (struct zx2967_pm_domain *)domain;
70 unsigned long loop = 1000;
71 u32 val;
72
73 val = readl_relaxed(pcubase + PCU_DM_CLKEN(zpd));
74 val &= ~BIT(zpd->bit);
75 writel_relaxed(val, pcubase + PCU_DM_CLKEN(zpd));
76 udelay(5);
77
78 val = readl_relaxed(pcubase + PCU_DM_ISOEN(zpd));
79 val |= BIT(zpd->bit);
80 writel_relaxed(val, pcubase + PCU_DM_ISOEN(zpd));
81 udelay(5);
82
83 val = readl_relaxed(pcubase + PCU_DM_RSTEN(zpd));
84 val &= ~BIT(zpd->bit);
85 writel_relaxed(val, pcubase + PCU_DM_RSTEN(zpd));
86 udelay(5);
87
88 val = readl_relaxed(pcubase + PCU_DM_PWREN(zpd));
89 if (zpd->polarity == PWREN)
90 val &= ~BIT(zpd->bit);
91 else
92 val |= BIT(zpd->bit);
93 writel_relaxed(val, pcubase + PCU_DM_PWREN(zpd));
94
95 do {
96 udelay(1);
97 val = readl_relaxed(pcubase + PCU_DM_ACK_SYNC(zpd))
98 & BIT(zpd->bit);
99 } while (--loop && val);
100
101 if (!loop) {
102 pr_err("Error: %s %s fail\n", __func__, domain->name);
103 return -EIO;
104 }
105
106 pr_debug("poweroff %s\n", domain->name);
107
108 return 0;
109}
110
111int zx2967_pd_probe(struct platform_device *pdev,
112 struct generic_pm_domain **zx_pm_domains,
113 int domain_num)
114{
115 struct genpd_onecell_data *genpd_data;
116 struct resource *res;
117 int i;
118
119 genpd_data = devm_kzalloc(&pdev->dev, sizeof(*genpd_data), GFP_KERNEL);
120 if (!genpd_data)
121 return -ENOMEM;
122
123 genpd_data->domains = zx_pm_domains;
124 genpd_data->num_domains = domain_num;
125
126 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
127 pcubase = devm_ioremap_resource(&pdev->dev, res);
128 if (IS_ERR(pcubase)) {
129 dev_err(&pdev->dev, "ioremap fail.\n");
130 return PTR_ERR(pcubase);
131 }
132
133 for (i = 0; i < domain_num; ++i) {
134 zx_pm_domains[i]->power_on = zx2967_power_on;
135 zx_pm_domains[i]->power_off = zx2967_power_off;
136
137 pm_genpd_init(zx_pm_domains[i], NULL, false);
138 }
139
140 of_genpd_add_provider_onecell(pdev->dev.of_node, genpd_data);
141 dev_info(&pdev->dev, "powerdomain init ok\n");
142 return 0;
143}
diff --git a/drivers/soc/zte/zx2967_pm_domains.h b/drivers/soc/zte/zx2967_pm_domains.h
new file mode 100644
index 000000000000..cb46595a7ff3
--- /dev/null
+++ b/drivers/soc/zte/zx2967_pm_domains.h
@@ -0,0 +1,44 @@
1/*
2 * Header for ZTE's Power Domain Driver support
3 *
4 * Copyright (C) 2017 ZTE Ltd.
5 *
6 * Author: Baoyou Xie <baoyou.xie@linaro.org>
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#ifndef __ZTE_ZX2967_PM_DOMAIN_H
11#define __ZTE_ZX2967_PM_DOMAIN_H
12
13#include <linux/platform_device.h>
14#include <linux/pm_domain.h>
15
16enum {
17 REG_CLKEN,
18 REG_ISOEN,
19 REG_RSTEN,
20 REG_PWREN,
21 REG_PWRDN,
22 REG_ACK_SYNC,
23
24 /* The size of the array - must be last */
25 REG_ARRAY_SIZE,
26};
27
28enum zx2967_power_polarity {
29 PWREN,
30 PWRDN,
31};
32
33struct zx2967_pm_domain {
34 struct generic_pm_domain dm;
35 const u16 bit;
36 const enum zx2967_power_polarity polarity;
37 const u16 *reg_offset;
38};
39
40int zx2967_pd_probe(struct platform_device *pdev,
41 struct generic_pm_domain **zx_pm_domains,
42 int domain_num);
43
44#endif /* __ZTE_ZX2967_PM_DOMAIN_H */
diff --git a/include/dt-bindings/power/rk3328-power.h b/include/dt-bindings/power/rk3328-power.h
new file mode 100644
index 000000000000..10c3c3715334
--- /dev/null
+++ b/include/dt-bindings/power/rk3328-power.h
@@ -0,0 +1,18 @@
1#ifndef __DT_BINDINGS_POWER_RK3328_POWER_H__
2#define __DT_BINDINGS_POWER_RK3328_POWER_H__
3
4/**
5 * RK3328 idle id Summary.
6 */
7#define RK3328_PD_CORE 0
8#define RK3328_PD_GPU 1
9#define RK3328_PD_BUS 2
10#define RK3328_PD_MSCH 3
11#define RK3328_PD_PERI 4
12#define RK3328_PD_VIDEO 5
13#define RK3328_PD_HEVC 6
14#define RK3328_PD_SYS 7
15#define RK3328_PD_VPU 8
16#define RK3328_PD_VIO 9
17
18#endif
diff --git a/include/dt-bindings/soc/zte,pm_domains.h b/include/dt-bindings/soc/zte,pm_domains.h
new file mode 100644
index 000000000000..a0b4019c8e01
--- /dev/null
+++ b/include/dt-bindings/soc/zte,pm_domains.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2017 Linaro Ltd.
3 *
4 * Author: Baoyou Xie <baoyou.xie@linaro.org>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef _DT_BINDINGS_SOC_ZTE_PM_DOMAINS_H
9#define _DT_BINDINGS_SOC_ZTE_PM_DOMAINS_H
10
11#define DM_ZX296718_SAPPU 0
12#define DM_ZX296718_VDE 1 /* g1v6 */
13#define DM_ZX296718_VCE 2 /* h1v6 */
14#define DM_ZX296718_HDE 3 /* g2v2 */
15#define DM_ZX296718_VIU 4
16#define DM_ZX296718_USB20 5
17#define DM_ZX296718_USB21 6
18#define DM_ZX296718_USB30 7
19#define DM_ZX296718_HSIC 8
20#define DM_ZX296718_GMAC 9
21#define DM_ZX296718_TS 10
22#define DM_ZX296718_VOU 11
23
24#endif /* _DT_BINDINGS_SOC_ZTE_PM_DOMAINS_H */
diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h
index cc32ab852fbc..d32f6f1a5225 100644
--- a/include/linux/qcom_scm.h
+++ b/include/linux/qcom_scm.h
@@ -13,9 +13,9 @@
13#ifndef __QCOM_SCM_H 13#ifndef __QCOM_SCM_H
14#define __QCOM_SCM_H 14#define __QCOM_SCM_H
15 15
16extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus); 16#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
17extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus); 17#define QCOM_SCM_CPU_PWR_DOWN_L2_ON 0x0
18 18#define QCOM_SCM_CPU_PWR_DOWN_L2_OFF 0x1
19#define QCOM_SCM_HDCP_MAX_REQ_CNT 5 19#define QCOM_SCM_HDCP_MAX_REQ_CNT 5
20 20
21struct qcom_scm_hdcp_req { 21struct qcom_scm_hdcp_req {
@@ -23,27 +23,49 @@ struct qcom_scm_hdcp_req {
23 u32 val; 23 u32 val;
24}; 24};
25 25
26#if IS_ENABLED(CONFIG_QCOM_SCM)
27extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus);
28extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus);
26extern bool qcom_scm_is_available(void); 29extern bool qcom_scm_is_available(void);
27
28extern bool qcom_scm_hdcp_available(void); 30extern bool qcom_scm_hdcp_available(void);
29extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, 31extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
30 u32 *resp); 32 u32 *resp);
31
32extern bool qcom_scm_pas_supported(u32 peripheral); 33extern bool qcom_scm_pas_supported(u32 peripheral);
33extern int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, 34extern int qcom_scm_pas_init_image(u32 peripheral, const void *metadata,
34 size_t size); 35 size_t size);
35extern int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, 36extern int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr,
36 phys_addr_t size); 37 phys_addr_t size);
37extern int qcom_scm_pas_auth_and_reset(u32 peripheral); 38extern int qcom_scm_pas_auth_and_reset(u32 peripheral);
38extern int qcom_scm_pas_shutdown(u32 peripheral); 39extern int qcom_scm_pas_shutdown(u32 peripheral);
39
40#define QCOM_SCM_CPU_PWR_DOWN_L2_ON 0x0
41#define QCOM_SCM_CPU_PWR_DOWN_L2_OFF 0x1
42
43extern void qcom_scm_cpu_power_down(u32 flags); 40extern void qcom_scm_cpu_power_down(u32 flags);
44
45#define QCOM_SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF))
46
47extern u32 qcom_scm_get_version(void); 41extern u32 qcom_scm_get_version(void);
48 42extern int qcom_scm_set_remote_state(u32 state, u32 id);
43#else
44static inline
45int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
46{
47 return -ENODEV;
48}
49static inline
50int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
51{
52 return -ENODEV;
53}
54static inline bool qcom_scm_is_available(void) { return false; }
55static inline bool qcom_scm_hdcp_available(void) { return false; }
56static inline int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
57 u32 *resp) { return -ENODEV; }
58static inline bool qcom_scm_pas_supported(u32 peripheral) { return false; }
59static inline int qcom_scm_pas_init_image(u32 peripheral, const void *metadata,
60 size_t size) { return -ENODEV; }
61static inline int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr,
62 phys_addr_t size) { return -ENODEV; }
63static inline int
64qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; }
65static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }
66static inline void qcom_scm_cpu_power_down(u32 flags) {}
67static inline u32 qcom_scm_get_version(void) { return 0; }
68static inline u32
69qcom_scm_set_remote_state(u32 state,u32 id) { return -ENODEV; }
70#endif
49#endif 71#endif
diff --git a/include/linux/reset.h b/include/linux/reset.h
index 5daff15722d3..86b4ed75359e 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -13,10 +13,12 @@ int reset_control_deassert(struct reset_control *rstc);
13int reset_control_status(struct reset_control *rstc); 13int reset_control_status(struct reset_control *rstc);
14 14
15struct reset_control *__of_reset_control_get(struct device_node *node, 15struct reset_control *__of_reset_control_get(struct device_node *node,
16 const char *id, int index, int shared); 16 const char *id, int index, bool shared,
17 bool optional);
17void reset_control_put(struct reset_control *rstc); 18void reset_control_put(struct reset_control *rstc);
18struct reset_control *__devm_reset_control_get(struct device *dev, 19struct reset_control *__devm_reset_control_get(struct device *dev,
19 const char *id, int index, int shared); 20 const char *id, int index, bool shared,
21 bool optional);
20 22
21int __must_check device_reset(struct device *dev); 23int __must_check device_reset(struct device *dev);
22 24
@@ -69,14 +71,15 @@ static inline int device_reset_optional(struct device *dev)
69 71
70static inline struct reset_control *__of_reset_control_get( 72static inline struct reset_control *__of_reset_control_get(
71 struct device_node *node, 73 struct device_node *node,
72 const char *id, int index, int shared) 74 const char *id, int index, bool shared,
75 bool optional)
73{ 76{
74 return ERR_PTR(-ENOTSUPP); 77 return ERR_PTR(-ENOTSUPP);
75} 78}
76 79
77static inline struct reset_control *__devm_reset_control_get( 80static inline struct reset_control *__devm_reset_control_get(
78 struct device *dev, 81 struct device *dev, const char *id,
79 const char *id, int index, int shared) 82 int index, bool shared, bool optional)
80{ 83{
81 return ERR_PTR(-ENOTSUPP); 84 return ERR_PTR(-ENOTSUPP);
82} 85}
@@ -104,7 +107,8 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id)
104#ifndef CONFIG_RESET_CONTROLLER 107#ifndef CONFIG_RESET_CONTROLLER
105 WARN_ON(1); 108 WARN_ON(1);
106#endif 109#endif
107 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); 110 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false,
111 false);
108} 112}
109 113
110/** 114/**
@@ -132,19 +136,22 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id)
132static inline struct reset_control *reset_control_get_shared( 136static inline struct reset_control *reset_control_get_shared(
133 struct device *dev, const char *id) 137 struct device *dev, const char *id)
134{ 138{
135 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); 139 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true,
140 false);
136} 141}
137 142
138static inline struct reset_control *reset_control_get_optional_exclusive( 143static inline struct reset_control *reset_control_get_optional_exclusive(
139 struct device *dev, const char *id) 144 struct device *dev, const char *id)
140{ 145{
141 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 0); 146 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, false,
147 true);
142} 148}
143 149
144static inline struct reset_control *reset_control_get_optional_shared( 150static inline struct reset_control *reset_control_get_optional_shared(
145 struct device *dev, const char *id) 151 struct device *dev, const char *id)
146{ 152{
147 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1); 153 return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, true,
154 true);
148} 155}
149 156
150/** 157/**
@@ -160,7 +167,7 @@ static inline struct reset_control *reset_control_get_optional_shared(
160static inline struct reset_control *of_reset_control_get_exclusive( 167static inline struct reset_control *of_reset_control_get_exclusive(
161 struct device_node *node, const char *id) 168 struct device_node *node, const char *id)
162{ 169{
163 return __of_reset_control_get(node, id, 0, 0); 170 return __of_reset_control_get(node, id, 0, false, false);
164} 171}
165 172
166/** 173/**
@@ -185,7 +192,7 @@ static inline struct reset_control *of_reset_control_get_exclusive(
185static inline struct reset_control *of_reset_control_get_shared( 192static inline struct reset_control *of_reset_control_get_shared(
186 struct device_node *node, const char *id) 193 struct device_node *node, const char *id)
187{ 194{
188 return __of_reset_control_get(node, id, 0, 1); 195 return __of_reset_control_get(node, id, 0, true, false);
189} 196}
190 197
191/** 198/**
@@ -202,7 +209,7 @@ static inline struct reset_control *of_reset_control_get_shared(
202static inline struct reset_control *of_reset_control_get_exclusive_by_index( 209static inline struct reset_control *of_reset_control_get_exclusive_by_index(
203 struct device_node *node, int index) 210 struct device_node *node, int index)
204{ 211{
205 return __of_reset_control_get(node, NULL, index, 0); 212 return __of_reset_control_get(node, NULL, index, false, false);
206} 213}
207 214
208/** 215/**
@@ -230,7 +237,7 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
230static inline struct reset_control *of_reset_control_get_shared_by_index( 237static inline struct reset_control *of_reset_control_get_shared_by_index(
231 struct device_node *node, int index) 238 struct device_node *node, int index)
232{ 239{
233 return __of_reset_control_get(node, NULL, index, 1); 240 return __of_reset_control_get(node, NULL, index, true, false);
234} 241}
235 242
236/** 243/**
@@ -252,7 +259,7 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
252#ifndef CONFIG_RESET_CONTROLLER 259#ifndef CONFIG_RESET_CONTROLLER
253 WARN_ON(1); 260 WARN_ON(1);
254#endif 261#endif
255 return __devm_reset_control_get(dev, id, 0, 0); 262 return __devm_reset_control_get(dev, id, 0, false, false);
256} 263}
257 264
258/** 265/**
@@ -267,19 +274,19 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
267static inline struct reset_control *devm_reset_control_get_shared( 274static inline struct reset_control *devm_reset_control_get_shared(
268 struct device *dev, const char *id) 275 struct device *dev, const char *id)
269{ 276{
270 return __devm_reset_control_get(dev, id, 0, 1); 277 return __devm_reset_control_get(dev, id, 0, true, false);
271} 278}
272 279
273static inline struct reset_control *devm_reset_control_get_optional_exclusive( 280static inline struct reset_control *devm_reset_control_get_optional_exclusive(
274 struct device *dev, const char *id) 281 struct device *dev, const char *id)
275{ 282{
276 return __devm_reset_control_get(dev, id, 0, 0); 283 return __devm_reset_control_get(dev, id, 0, false, true);
277} 284}
278 285
279static inline struct reset_control *devm_reset_control_get_optional_shared( 286static inline struct reset_control *devm_reset_control_get_optional_shared(
280 struct device *dev, const char *id) 287 struct device *dev, const char *id)
281{ 288{
282 return __devm_reset_control_get(dev, id, 0, 1); 289 return __devm_reset_control_get(dev, id, 0, true, true);
283} 290}
284 291
285/** 292/**
@@ -297,7 +304,7 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
297static inline struct reset_control * 304static inline struct reset_control *
298devm_reset_control_get_exclusive_by_index(struct device *dev, int index) 305devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
299{ 306{
300 return __devm_reset_control_get(dev, NULL, index, 0); 307 return __devm_reset_control_get(dev, NULL, index, false, false);
301} 308}
302 309
303/** 310/**
@@ -313,7 +320,7 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
313static inline struct reset_control * 320static inline struct reset_control *
314devm_reset_control_get_shared_by_index(struct device *dev, int index) 321devm_reset_control_get_shared_by_index(struct device *dev, int index)
315{ 322{
316 return __devm_reset_control_get(dev, NULL, index, 1); 323 return __devm_reset_control_get(dev, NULL, index, true, false);
317} 324}
318 325
319/* 326/*
diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h
index d30186e2b609..49df0a01a2cc 100644
--- a/include/linux/soc/samsung/exynos-regs-pmu.h
+++ b/include/linux/soc/samsung/exynos-regs-pmu.h
@@ -7,7 +7,13 @@
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10*/ 10 *
11 *
12 * Notice:
13 * This is not a list of all Exynos Power Management Unit SFRs.
14 * There are too many of them, not mentioning subtle differences
15 * between SoCs. For now, put here only the used registers.
16 */
11 17
12#ifndef __LINUX_SOC_EXYNOS_REGS_PMU_H 18#ifndef __LINUX_SOC_EXYNOS_REGS_PMU_H
13#define __LINUX_SOC_EXYNOS_REGS_PMU_H __FILE__ 19#define __LINUX_SOC_EXYNOS_REGS_PMU_H __FILE__
@@ -38,7 +44,6 @@
38#define EXYNOS_CORE_PO_RESET(n) ((1 << 4) << n) 44#define EXYNOS_CORE_PO_RESET(n) ((1 << 4) << n)
39#define EXYNOS_WAKEUP_FROM_LOWPWR (1 << 28) 45#define EXYNOS_WAKEUP_FROM_LOWPWR (1 << 28)
40#define EXYNOS_SWRESET 0x0400 46#define EXYNOS_SWRESET 0x0400
41#define EXYNOS5440_SWRESET 0x00C4
42 47
43#define S5P_WAKEUP_STAT 0x0600 48#define S5P_WAKEUP_STAT 0x0600
44#define S5P_EINT_WAKEUP_MASK 0x0604 49#define S5P_EINT_WAKEUP_MASK 0x0604
@@ -136,12 +141,6 @@
136#define EXYNOS_COMMON_OPTION(_nr) \ 141#define EXYNOS_COMMON_OPTION(_nr) \
137 (EXYNOS_COMMON_CONFIGURATION(_nr) + 0x8) 142 (EXYNOS_COMMON_CONFIGURATION(_nr) + 0x8)
138 143
139#define EXYNOS_CORE_LOCAL_PWR_EN 0x3
140
141#define EXYNOS_ARM_COMMON_STATUS 0x2504
142#define EXYNOS_COMMON_OPTION(_nr) \
143 (EXYNOS_COMMON_CONFIGURATION(_nr) + 0x8)
144
145#define EXYNOS_ARM_L2_CONFIGURATION 0x2600 144#define EXYNOS_ARM_L2_CONFIGURATION 0x2600
146#define EXYNOS_L2_CONFIGURATION(_nr) \ 145#define EXYNOS_L2_CONFIGURATION(_nr) \
147 (EXYNOS_ARM_L2_CONFIGURATION + ((_nr) * 0x80)) 146 (EXYNOS_ARM_L2_CONFIGURATION + ((_nr) * 0x80))
@@ -149,17 +148,8 @@
149 (EXYNOS_L2_CONFIGURATION(_nr) + 0x4) 148 (EXYNOS_L2_CONFIGURATION(_nr) + 0x4)
150#define EXYNOS_L2_OPTION(_nr) \ 149#define EXYNOS_L2_OPTION(_nr) \
151 (EXYNOS_L2_CONFIGURATION(_nr) + 0x8) 150 (EXYNOS_L2_CONFIGURATION(_nr) + 0x8)
152#define EXYNOS_L2_COMMON_PWR_EN 0x3
153 151
154#define EXYNOS_ARM_CORE_X_STATUS_OFFSET 0x4 152#define EXYNOS_L2_USE_RETENTION BIT(4)
155
156#define EXYNOS5_APLL_SYSCLK_CONFIGURATION 0x2A00
157#define EXYNOS5_APLL_SYSCLK_STATUS 0x2A04
158
159#define EXYNOS5_ARM_L2_OPTION 0x2608
160#define EXYNOS5_USE_RETENTION BIT(4)
161
162#define EXYNOS5_L2RSTDISABLE_VALUE BIT(3)
163 153
164#define S5P_PAD_RET_MAUDIO_OPTION 0x3028 154#define S5P_PAD_RET_MAUDIO_OPTION 0x3028
165#define S5P_PAD_RET_MMC2_OPTION 0x30c8 155#define S5P_PAD_RET_MMC2_OPTION 0x30c8
@@ -411,7 +401,6 @@
411#define EXYNOS5_SATA_MEM_SYS_PWR_REG 0x11FC 401#define EXYNOS5_SATA_MEM_SYS_PWR_REG 0x11FC
412#define EXYNOS5_PAD_RETENTION_DRAM_SYS_PWR_REG 0x1200 402#define EXYNOS5_PAD_RETENTION_DRAM_SYS_PWR_REG 0x1200
413#define EXYNOS5_PAD_RETENTION_MAU_SYS_PWR_REG 0x1204 403#define EXYNOS5_PAD_RETENTION_MAU_SYS_PWR_REG 0x1204
414#define EXYNOS5_PAD_RETENTION_EFNAND_SYS_PWR_REG 0x1208
415#define EXYNOS5_PAD_RETENTION_GPIO_SYS_PWR_REG 0x1220 404#define EXYNOS5_PAD_RETENTION_GPIO_SYS_PWR_REG 0x1220
416#define EXYNOS5_PAD_RETENTION_UART_SYS_PWR_REG 0x1224 405#define EXYNOS5_PAD_RETENTION_UART_SYS_PWR_REG 0x1224
417#define EXYNOS5_PAD_RETENTION_MMCA_SYS_PWR_REG 0x1228 406#define EXYNOS5_PAD_RETENTION_MMCA_SYS_PWR_REG 0x1228
@@ -485,7 +474,6 @@
485#define EXYNOS5420_SWRESET_KFC_SEL 0x3 474#define EXYNOS5420_SWRESET_KFC_SEL 0x3
486 475
487/* Only for EXYNOS5420 */ 476/* Only for EXYNOS5420 */
488#define EXYNOS5420_ISP_ARM_OPTION 0x2488
489#define EXYNOS5420_L2RSTDISABLE_VALUE BIT(3) 477#define EXYNOS5420_L2RSTDISABLE_VALUE BIT(3)
490 478
491#define EXYNOS5420_LPI_MASK 0x0004 479#define EXYNOS5420_LPI_MASK 0x0004
@@ -494,9 +482,6 @@
494#define EXYNOS5420_ATB_KFC BIT(13) 482#define EXYNOS5420_ATB_KFC BIT(13)
495#define EXYNOS5420_ATB_ISP_ARM BIT(19) 483#define EXYNOS5420_ATB_ISP_ARM BIT(19)
496#define EXYNOS5420_EMULATION BIT(31) 484#define EXYNOS5420_EMULATION BIT(31)
497#define ATB_ISP_ARM BIT(12)
498#define ATB_KFC BIT(13)
499#define ATB_NOC BIT(14)
500 485
501#define EXYNOS5420_ARM_INTR_SPREAD_ENABLE 0x0100 486#define EXYNOS5420_ARM_INTR_SPREAD_ENABLE 0x0100
502#define EXYNOS5420_ARM_INTR_SPREAD_USE_STANDBYWFI 0x0104 487#define EXYNOS5420_ARM_INTR_SPREAD_USE_STANDBYWFI 0x0104
@@ -510,11 +495,6 @@
510#define EXYNOS5420_KFC_CORE_RESET(_nr) \ 495#define EXYNOS5420_KFC_CORE_RESET(_nr) \
511 ((EXYNOS5420_KFC_CORE_RESET0 | EXYNOS5420_KFC_ETM_RESET0) << (_nr)) 496 ((EXYNOS5420_KFC_CORE_RESET0 | EXYNOS5420_KFC_ETM_RESET0) << (_nr))
512 497
513#define EXYNOS5420_BB_CON1 0x0784
514#define EXYNOS5420_BB_SEL_EN BIT(31)
515#define EXYNOS5420_BB_PMOS_EN BIT(7)
516#define EXYNOS5420_BB_1300X 0XF
517
518#define EXYNOS5420_ARM_CORE2_SYS_PWR_REG 0x1020 498#define EXYNOS5420_ARM_CORE2_SYS_PWR_REG 0x1020
519#define EXYNOS5420_DIS_IRQ_ARM_CORE2_LOCAL_SYS_PWR_REG 0x1024 499#define EXYNOS5420_DIS_IRQ_ARM_CORE2_LOCAL_SYS_PWR_REG 0x1024
520#define EXYNOS5420_DIS_IRQ_ARM_CORE2_CENTRAL_SYS_PWR_REG 0x1028 500#define EXYNOS5420_DIS_IRQ_ARM_CORE2_CENTRAL_SYS_PWR_REG 0x1028
@@ -546,15 +526,6 @@
546#define EXYNOS5420_SPLL_SYSCLK_SYS_PWR_REG 0x1178 526#define EXYNOS5420_SPLL_SYSCLK_SYS_PWR_REG 0x1178
547#define EXYNOS5420_INTRAM_MEM_SYS_PWR_REG 0x11B8 527#define EXYNOS5420_INTRAM_MEM_SYS_PWR_REG 0x11B8
548#define EXYNOS5420_INTROM_MEM_SYS_PWR_REG 0x11BC 528#define EXYNOS5420_INTROM_MEM_SYS_PWR_REG 0x11BC
549#define EXYNOS5420_ONENANDXL_MEM_SYS_PWR 0x11C0
550#define EXYNOS5420_USBDEV_MEM_SYS_PWR 0x11CC
551#define EXYNOS5420_USBDEV1_MEM_SYS_PWR 0x11D0
552#define EXYNOS5420_SDMMC_MEM_SYS_PWR 0x11D4
553#define EXYNOS5420_CSSYS_MEM_SYS_PWR 0x11D8
554#define EXYNOS5420_SECSS_MEM_SYS_PWR 0x11DC
555#define EXYNOS5420_ROTATOR_MEM_SYS_PWR 0x11E0
556#define EXYNOS5420_INTRAM_MEM_SYS_PWR 0x11E4
557#define EXYNOS5420_INTROM_MEM_SYS_PWR 0x11E8
558#define EXYNOS5420_PAD_RETENTION_JTAG_SYS_PWR_REG 0x1208 529#define EXYNOS5420_PAD_RETENTION_JTAG_SYS_PWR_REG 0x1208
559#define EXYNOS5420_PAD_RETENTION_DRAM_SYS_PWR_REG 0x1210 530#define EXYNOS5420_PAD_RETENTION_DRAM_SYS_PWR_REG 0x1210
560#define EXYNOS5420_PAD_RETENTION_UART_SYS_PWR_REG 0x1214 531#define EXYNOS5420_PAD_RETENTION_UART_SYS_PWR_REG 0x1214
@@ -605,13 +576,7 @@
605#define EXYNOS5420_CMU_RESET_MSC_SYS_PWR_REG 0x159C 576#define EXYNOS5420_CMU_RESET_MSC_SYS_PWR_REG 0x159C
606#define EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG 0x15A0 577#define EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG 0x15A0
607#define EXYNOS5420_SFR_AXI_CGDIS1 0x15E4 578#define EXYNOS5420_SFR_AXI_CGDIS1 0x15E4
608#define EXYNOS_ARM_CORE2_CONFIGURATION 0x2100
609#define EXYNOS5420_ARM_CORE2_OPTION 0x2108
610#define EXYNOS_ARM_CORE3_CONFIGURATION 0x2180
611#define EXYNOS5420_ARM_CORE3_OPTION 0x2188
612#define EXYNOS5420_ARM_COMMON_STATUS 0x2504
613#define EXYNOS5420_ARM_COMMON_OPTION 0x2508 579#define EXYNOS5420_ARM_COMMON_OPTION 0x2508
614#define EXYNOS5420_KFC_COMMON_STATUS 0x2584
615#define EXYNOS5420_KFC_COMMON_OPTION 0x2588 580#define EXYNOS5420_KFC_COMMON_OPTION 0x2588
616#define EXYNOS5420_LOGIC_RESET_DURATION3 0x2D1C 581#define EXYNOS5420_LOGIC_RESET_DURATION3 0x2D1C
617 582
@@ -626,33 +591,9 @@
626#define EXYNOS_PAD_RET_DRAM_OPTION 0x3008 591#define EXYNOS_PAD_RET_DRAM_OPTION 0x3008
627#define EXYNOS_PAD_RET_MAUDIO_OPTION 0x3028 592#define EXYNOS_PAD_RET_MAUDIO_OPTION 0x3028
628#define EXYNOS_PAD_RET_JTAG_OPTION 0x3048 593#define EXYNOS_PAD_RET_JTAG_OPTION 0x3048
629#define EXYNOS_PAD_RET_GPIO_OPTION 0x3108
630#define EXYNOS_PAD_RET_UART_OPTION 0x3128
631#define EXYNOS_PAD_RET_MMCA_OPTION 0x3148
632#define EXYNOS_PAD_RET_MMCB_OPTION 0x3168
633#define EXYNOS_PAD_RET_EBIA_OPTION 0x3188 594#define EXYNOS_PAD_RET_EBIA_OPTION 0x3188
634#define EXYNOS_PAD_RET_EBIB_OPTION 0x31A8 595#define EXYNOS_PAD_RET_EBIB_OPTION 0x31A8
635 596
636#define EXYNOS_PS_HOLD_CONTROL 0x330C
637
638/* For SYS_PWR_REG */
639#define EXYNOS_SYS_PWR_CFG BIT(0)
640
641#define EXYNOS5420_MFC_CONFIGURATION 0x4060
642#define EXYNOS5420_MFC_STATUS 0x4064
643#define EXYNOS5420_MFC_OPTION 0x4068
644#define EXYNOS5420_G3D_CONFIGURATION 0x4080
645#define EXYNOS5420_G3D_STATUS 0x4084
646#define EXYNOS5420_G3D_OPTION 0x4088
647#define EXYNOS5420_DISP0_CONFIGURATION 0x40A0
648#define EXYNOS5420_DISP0_STATUS 0x40A4
649#define EXYNOS5420_DISP0_OPTION 0x40A8
650#define EXYNOS5420_DISP1_CONFIGURATION 0x40C0
651#define EXYNOS5420_DISP1_STATUS 0x40C4
652#define EXYNOS5420_DISP1_OPTION 0x40C8
653#define EXYNOS5420_MAU_CONFIGURATION 0x40E0
654#define EXYNOS5420_MAU_STATUS 0x40E4
655#define EXYNOS5420_MAU_OPTION 0x40E8
656#define EXYNOS5420_FSYS2_OPTION 0x4168 597#define EXYNOS5420_FSYS2_OPTION 0x4168
657#define EXYNOS5420_PSGEN_OPTION 0x4188 598#define EXYNOS5420_PSGEN_OPTION 0x4188
658 599
@@ -690,4 +631,20 @@
690 | EXYNOS5420_KFC_USE_STANDBY_WFI2 \ 631 | EXYNOS5420_KFC_USE_STANDBY_WFI2 \
691 | EXYNOS5420_KFC_USE_STANDBY_WFI3) 632 | EXYNOS5420_KFC_USE_STANDBY_WFI3)
692 633
634/* For EXYNOS5433 */
635#define EXYNOS5433_PAD_RETENTION_AUD_OPTION (0x3028)
636#define EXYNOS5433_PAD_RETENTION_MMC2_OPTION (0x30C8)
637#define EXYNOS5433_PAD_RETENTION_TOP_OPTION (0x3108)
638#define EXYNOS5433_PAD_RETENTION_UART_OPTION (0x3128)
639#define EXYNOS5433_PAD_RETENTION_MMC0_OPTION (0x3148)
640#define EXYNOS5433_PAD_RETENTION_MMC1_OPTION (0x3168)
641#define EXYNOS5433_PAD_RETENTION_EBIA_OPTION (0x3188)
642#define EXYNOS5433_PAD_RETENTION_EBIB_OPTION (0x31A8)
643#define EXYNOS5433_PAD_RETENTION_SPI_OPTION (0x31C8)
644#define EXYNOS5433_PAD_RETENTION_MIF_OPTION (0x31E8)
645#define EXYNOS5433_PAD_RETENTION_USBXTI_OPTION (0x3228)
646#define EXYNOS5433_PAD_RETENTION_BOOTLDO_OPTION (0x3248)
647#define EXYNOS5433_PAD_RETENTION_UFS_OPTION (0x3268)
648#define EXYNOS5433_PAD_RETENTION_FSYSGENIO_OPTION (0x32A8)
649
693#endif /* __LINUX_SOC_EXYNOS_REGS_PMU_H */ 650#endif /* __LINUX_SOC_EXYNOS_REGS_PMU_H */