diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-23 16:52:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-23 16:52:46 -0400 |
commit | f3ea496213819c80ce9c49a9b65f9261da713d11 (patch) | |
tree | 1c8fad9c5c609504c2916ad3844494093f89f8f1 | |
parent | 9e259f9352d52053058a234f7c062c4e4f56dc85 (diff) | |
parent | 29ed45fff05899f6f39d05fe1c32b1bc51f8926b (diff) |
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson:
"Some of the larger changes this merge window:
- Removal of drivers for Exynos5440, a Samsung SoC that never saw
widespread use.
- Uniphier support for USB3 and SPI reset handling
- Syste control and SRAM drivers and bindings for Allwinner platforms
- Qualcomm AOSS (Always-on subsystem) reset controller drivers
- Raspberry Pi hwmon driver for voltage
- Mediatek pwrap (pmic) support for MT6797 SoC"
* tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (52 commits)
drivers/firmware: psci_checker: stash and use topology_core_cpumask for hotplug tests
soc: fsl: cleanup Kconfig menu
soc: fsl: dpio: Convert DPIO documentation to .rst
staging: fsl-mc: Remove remaining files
staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl
staging: fsl-dpaa2: eth: move generic FD defines to DPIO
soc: fsl: qe: gpio: Add qe_gpio_set_multiple
usb: host: exynos: Remove support for Exynos5440
clk: samsung: Remove support for Exynos5440
soc: sunxi: Add the A13, A23 and H3 system control compatibles
reset: uniphier: add reset control support for SPI
cpufreq: exynos: Remove support for Exynos5440
ata: ahci-platform: Remove support for Exynos5440
soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata
soc: mediatek: pwrap: add mt6351 driver for mt6797 SoCs
soc: mediatek: pwrap: add pwrap driver for mt6797 SoCs
soc: mediatek: pwrap: fix cipher init setting error
dt-bindings: pwrap: mediatek: add pwrap support for MT6797
reset: uniphier: add USB3 core reset control
dt-bindings: reset: uniphier: add USB3 core reset support
...
82 files changed, 1360 insertions, 880 deletions
diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt index c052caad36e8..104cc9b41df4 100644 --- a/Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +++ b/Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt | |||
@@ -189,7 +189,11 @@ Power-Down (SRPD), among other things. | |||
189 | 189 | ||
190 | Required properties: | 190 | Required properties: |
191 | - compatible : should contain one of these | 191 | - compatible : should contain one of these |
192 | "brcm,brcmstb-memc-ddr-rev-b.2.1" | ||
192 | "brcm,brcmstb-memc-ddr-rev-b.2.2" | 193 | "brcm,brcmstb-memc-ddr-rev-b.2.2" |
194 | "brcm,brcmstb-memc-ddr-rev-b.2.3" | ||
195 | "brcm,brcmstb-memc-ddr-rev-b.3.0" | ||
196 | "brcm,brcmstb-memc-ddr-rev-b.3.1" | ||
193 | "brcm,brcmstb-memc-ddr" | 197 | "brcm,brcmstb-memc-ddr" |
194 | - reg : the MEMC DDR register range | 198 | - reg : the MEMC DDR register range |
195 | 199 | ||
diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index c760ecb81381..663766685818 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt | |||
@@ -17,7 +17,6 @@ Required properties: | |||
17 | - "marvell,armada-380-ahci" | 17 | - "marvell,armada-380-ahci" |
18 | - "marvell,armada-3700-ahci" | 18 | - "marvell,armada-3700-ahci" |
19 | - "snps,dwc-ahci" | 19 | - "snps,dwc-ahci" |
20 | - "snps,exynos5440-ahci" | ||
21 | - "snps,spear-ahci" | 20 | - "snps,spear-ahci" |
22 | - "generic-ahci" | 21 | - "generic-ahci" |
23 | - interrupts : <interrupt mapping for SATA IRQ> | 22 | - interrupts : <interrupt mapping for SATA IRQ> |
diff --git a/Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt b/Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt new file mode 100644 index 000000000000..87dfb33fb3be --- /dev/null +++ b/Documentation/devicetree/bindings/bus/sun50i-de2-bus.txt | |||
@@ -0,0 +1,37 @@ | |||
1 | Device tree bindings for Allwinner A64 DE2 bus | ||
2 | |||
3 | The Allwinner A64 DE2 is on a special bus, which needs a SRAM region (SRAM C) | ||
4 | to be claimed for enabling the access. | ||
5 | |||
6 | Required properties: | ||
7 | |||
8 | - compatible: Should contain "allwinner,sun50i-a64-de2" | ||
9 | - reg: A resource specifier for the register space | ||
10 | - #address-cells: Must be set to 1 | ||
11 | - #size-cells: Must be set to 1 | ||
12 | - ranges: Must be set up to map the address space inside the | ||
13 | DE2, for the sub-blocks of DE2. | ||
14 | - allwinner,sram: the SRAM that needs to be claimed | ||
15 | |||
16 | Example: | ||
17 | |||
18 | de2@1000000 { | ||
19 | compatible = "allwinner,sun50i-a64-de2"; | ||
20 | reg = <0x1000000 0x400000>; | ||
21 | allwinner,sram = <&de2_sram 1>; | ||
22 | #address-cells = <1>; | ||
23 | #size-cells = <1>; | ||
24 | ranges = <0 0x1000000 0x400000>; | ||
25 | |||
26 | display_clocks: clock@0 { | ||
27 | compatible = "allwinner,sun50i-a64-de2-clk"; | ||
28 | reg = <0x0 0x100000>; | ||
29 | clocks = <&ccu CLK_DE>, | ||
30 | <&ccu CLK_BUS_DE>; | ||
31 | clock-names = "mod", | ||
32 | "bus"; | ||
33 | resets = <&ccu RST_BUS_DE>; | ||
34 | #clock-cells = <1>; | ||
35 | #reset-cells = <1>; | ||
36 | }; | ||
37 | }; | ||
diff --git a/Documentation/devicetree/bindings/bus/ti-sysc.txt b/Documentation/devicetree/bindings/bus/ti-sysc.txt index d8ed5b780ed9..91dc2333af01 100644 --- a/Documentation/devicetree/bindings/bus/ti-sysc.txt +++ b/Documentation/devicetree/bindings/bus/ti-sysc.txt | |||
@@ -36,6 +36,7 @@ Required standard properties: | |||
36 | "ti,sysc-omap-aes" | 36 | "ti,sysc-omap-aes" |
37 | "ti,sysc-mcasp" | 37 | "ti,sysc-mcasp" |
38 | "ti,sysc-usb-host-fs" | 38 | "ti,sysc-usb-host-fs" |
39 | "ti,sysc-dra7-mcan" | ||
39 | 40 | ||
40 | - reg shall have register areas implemented for the interconnect | 41 | - reg shall have register areas implemented for the interconnect |
41 | target module in question such as revision, sysc and syss | 42 | target module in question such as revision, sysc and syss |
diff --git a/Documentation/devicetree/bindings/clock/exynos5440-clock.txt b/Documentation/devicetree/bindings/clock/exynos5440-clock.txt deleted file mode 100644 index c7d227c31e95..000000000000 --- a/Documentation/devicetree/bindings/clock/exynos5440-clock.txt +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | * Samsung Exynos5440 Clock Controller | ||
2 | |||
3 | The Exynos5440 clock controller generates and supplies clock to various | ||
4 | controllers within the Exynos5440 SoC. | ||
5 | |||
6 | Required Properties: | ||
7 | |||
8 | - compatible: should be "samsung,exynos5440-clock". | ||
9 | |||
10 | - reg: physical base address of the controller and length of memory mapped | ||
11 | region. | ||
12 | |||
13 | - #clock-cells: should be 1. | ||
14 | |||
15 | Each clock is assigned an identifier and client nodes can use this identifier | ||
16 | to specify the clock which they consume. | ||
17 | |||
18 | All available clocks are defined as preprocessor macros in | ||
19 | dt-bindings/clock/exynos5440.h header and can be used in device | ||
20 | tree sources. | ||
21 | |||
22 | Example: An example of a clock controller node is listed below. | ||
23 | |||
24 | clock: clock-controller@10010000 { | ||
25 | compatible = "samsung,exynos5440-clock"; | ||
26 | reg = <0x160000 0x10000>; | ||
27 | #clock-cells = <1>; | ||
28 | }; | ||
diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt deleted file mode 100644 index caff1a57436f..000000000000 --- a/Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | |||
2 | Exynos5440 cpufreq driver | ||
3 | ------------------- | ||
4 | |||
5 | Exynos5440 SoC cpufreq driver for CPU frequency scaling. | ||
6 | |||
7 | Required properties: | ||
8 | - interrupts: Interrupt to know the completion of cpu frequency change. | ||
9 | - operating-points: Table of frequencies and voltage CPU could be transitioned into, | ||
10 | in the decreasing order. Frequency should be in KHz units and voltage | ||
11 | should be in microvolts. | ||
12 | |||
13 | Optional properties: | ||
14 | - clock-latency: Clock monitor latency in microsecond. | ||
15 | |||
16 | All the required listed above must be defined under node cpufreq. | ||
17 | |||
18 | Example: | ||
19 | -------- | ||
20 | cpufreq@160000 { | ||
21 | compatible = "samsung,exynos5440-cpufreq"; | ||
22 | reg = <0x160000 0x1000>; | ||
23 | interrupts = <0 57 0>; | ||
24 | operating-points = < | ||
25 | 1000000 975000 | ||
26 | 800000 925000>; | ||
27 | clock-latency = <100000>; | ||
28 | }; | ||
diff --git a/Documentation/devicetree/bindings/reset/qcom,aoss-reset.txt b/Documentation/devicetree/bindings/reset/qcom,aoss-reset.txt new file mode 100644 index 000000000000..510c748656ec --- /dev/null +++ b/Documentation/devicetree/bindings/reset/qcom,aoss-reset.txt | |||
@@ -0,0 +1,52 @@ | |||
1 | Qualcomm AOSS Reset Controller | ||
2 | ====================================== | ||
3 | |||
4 | This binding describes a reset-controller found on AOSS-CC (always on subsystem) | ||
5 | for Qualcomm SDM845 SoCs. | ||
6 | |||
7 | Required properties: | ||
8 | - compatible: | ||
9 | Usage: required | ||
10 | Value type: <string> | ||
11 | Definition: must be: | ||
12 | "qcom,sdm845-aoss-cc" | ||
13 | |||
14 | - reg: | ||
15 | Usage: required | ||
16 | Value type: <prop-encoded-array> | ||
17 | Definition: must specify the base address and size of the register | ||
18 | space. | ||
19 | |||
20 | - #reset-cells: | ||
21 | Usage: required | ||
22 | Value type: <uint> | ||
23 | Definition: must be 1; cell entry represents the reset index. | ||
24 | |||
25 | Example: | ||
26 | |||
27 | aoss_reset: reset-controller@c2a0000 { | ||
28 | compatible = "qcom,sdm845-aoss-cc"; | ||
29 | reg = <0xc2a0000 0x31000>; | ||
30 | #reset-cells = <1>; | ||
31 | }; | ||
32 | |||
33 | Specifying reset lines connected to IP modules | ||
34 | ============================================== | ||
35 | |||
36 | Device nodes that need access to reset lines should | ||
37 | specify them as a reset phandle in their corresponding node as | ||
38 | specified in reset.txt. | ||
39 | |||
40 | For list of all valid reset indicies see | ||
41 | <dt-bindings/reset/qcom,sdm845-aoss.h> | ||
42 | |||
43 | Example: | ||
44 | |||
45 | modem-pil@4080000 { | ||
46 | ... | ||
47 | |||
48 | resets = <&aoss_reset AOSS_CC_MSS_RESTART>; | ||
49 | reset-names = "mss_restart"; | ||
50 | |||
51 | ... | ||
52 | }; | ||
diff --git a/Documentation/devicetree/bindings/reset/uniphier-reset.txt b/Documentation/devicetree/bindings/reset/uniphier-reset.txt index 93efed629900..101743dda223 100644 --- a/Documentation/devicetree/bindings/reset/uniphier-reset.txt +++ b/Documentation/devicetree/bindings/reset/uniphier-reset.txt | |||
@@ -118,3 +118,59 @@ Example: | |||
118 | 118 | ||
119 | other nodes ... | 119 | other nodes ... |
120 | }; | 120 | }; |
121 | |||
122 | |||
123 | USB3 core reset | ||
124 | --------------- | ||
125 | |||
126 | USB3 core reset belongs to USB3 glue layer. Before using the core reset, | ||
127 | it is necessary to control the clocks and resets to enable this layer. | ||
128 | These clocks and resets should be described in each property. | ||
129 | |||
130 | Required properties: | ||
131 | - compatible: Should be | ||
132 | "socionext,uniphier-pro4-usb3-reset" - for Pro4 SoC | ||
133 | "socionext,uniphier-pxs2-usb3-reset" - for PXs2 SoC | ||
134 | "socionext,uniphier-ld20-usb3-reset" - for LD20 SoC | ||
135 | "socionext,uniphier-pxs3-usb3-reset" - for PXs3 SoC | ||
136 | - #reset-cells: Should be 1. | ||
137 | - reg: Specifies offset and length of the register set for the device. | ||
138 | - clocks: A list of phandles to the clock gate for USB3 glue layer. | ||
139 | According to the clock-names, appropriate clocks are required. | ||
140 | - clock-names: Should contain | ||
141 | "gio", "link" - for Pro4 SoC | ||
142 | "link" - for others | ||
143 | - resets: A list of phandles to the reset control for USB3 glue layer. | ||
144 | According to the reset-names, appropriate resets are required. | ||
145 | - reset-names: Should contain | ||
146 | "gio", "link" - for Pro4 SoC | ||
147 | "link" - for others | ||
148 | |||
149 | Example: | ||
150 | |||
151 | usb-glue@65b00000 { | ||
152 | compatible = "socionext,uniphier-ld20-dwc3-glue", | ||
153 | "simple-mfd"; | ||
154 | #address-cells = <1>; | ||
155 | #size-cells = <1>; | ||
156 | ranges = <0 0x65b00000 0x400>; | ||
157 | |||
158 | usb_rst: reset@0 { | ||
159 | compatible = "socionext,uniphier-ld20-usb3-reset"; | ||
160 | reg = <0x0 0x4>; | ||
161 | #reset-cells = <1>; | ||
162 | clock-names = "link"; | ||
163 | clocks = <&sys_clk 14>; | ||
164 | reset-names = "link"; | ||
165 | resets = <&sys_rst 14>; | ||
166 | }; | ||
167 | |||
168 | regulator { | ||
169 | ... | ||
170 | }; | ||
171 | |||
172 | phy { | ||
173 | ... | ||
174 | }; | ||
175 | ... | ||
176 | }; | ||
diff --git a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt b/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt index bf80e3f96f8c..f9987c30f0d5 100644 --- a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt +++ b/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt | |||
@@ -19,6 +19,7 @@ IP Pairing | |||
19 | Required properties in pwrap device node. | 19 | Required properties in pwrap device node. |
20 | - compatible: | 20 | - compatible: |
21 | "mediatek,mt2701-pwrap" for MT2701/7623 SoCs | 21 | "mediatek,mt2701-pwrap" for MT2701/7623 SoCs |
22 | "mediatek,mt6797-pwrap" for MT6797 SoCs | ||
22 | "mediatek,mt7622-pwrap" for MT7622 SoCs | 23 | "mediatek,mt7622-pwrap" for MT7622 SoCs |
23 | "mediatek,mt8135-pwrap" for MT8135 SoCs | 24 | "mediatek,mt8135-pwrap" for MT8135 SoCs |
24 | "mediatek,mt8173-pwrap" for MT8173 SoCs | 25 | "mediatek,mt8173-pwrap" for MT8173 SoCs |
diff --git a/Documentation/devicetree/bindings/sram/sunxi-sram.txt b/Documentation/devicetree/bindings/sram/sunxi-sram.txt index d087f04a4d7f..c51ade86578c 100644 --- a/Documentation/devicetree/bindings/sram/sunxi-sram.txt +++ b/Documentation/devicetree/bindings/sram/sunxi-sram.txt | |||
@@ -10,8 +10,14 @@ Controller Node | |||
10 | 10 | ||
11 | Required properties: | 11 | Required properties: |
12 | - compatible : should be: | 12 | - compatible : should be: |
13 | - "allwinner,sun4i-a10-sram-controller" | 13 | - "allwinner,sun4i-a10-sram-controller" (deprecated) |
14 | - "allwinner,sun50i-a64-sram-controller" | 14 | - "allwinner,sun4i-a10-system-control" |
15 | - "allwinner,sun5i-a13-system-control" | ||
16 | - "allwinner,sun7i-a20-system-control", "allwinner,sun4i-a10-system-control" | ||
17 | - "allwinner,sun8i-a23-system-control" | ||
18 | - "allwinner,sun8i-h3-system-control" | ||
19 | - "allwinner,sun50i-a64-sram-controller" (deprecated) | ||
20 | - "allwinner,sun50i-a64-system-control" | ||
15 | - reg : sram controller register offset + length | 21 | - reg : sram controller register offset + length |
16 | 22 | ||
17 | SRAM nodes | 23 | SRAM nodes |
@@ -26,8 +32,25 @@ once again the representation described in the mmio-sram binding. | |||
26 | 32 | ||
27 | The valid sections compatible for A10 are: | 33 | The valid sections compatible for A10 are: |
28 | - allwinner,sun4i-a10-sram-a3-a4 | 34 | - allwinner,sun4i-a10-sram-a3-a4 |
35 | - allwinner,sun4i-a10-sram-c1 | ||
29 | - allwinner,sun4i-a10-sram-d | 36 | - allwinner,sun4i-a10-sram-d |
30 | 37 | ||
38 | The valid sections compatible for A13 are: | ||
39 | - allwinner,sun5i-a13-sram-a3-a4, allwinner,sun4i-a10-sram-a3-a4 | ||
40 | - allwinner,sun5i-a13-sram-c1, allwinner,sun4i-a10-sram-c1 | ||
41 | - allwinner,sun5i-a13-sram-d, allwinner,sun4i-a10-sram-d | ||
42 | |||
43 | The valid sections compatible for A20 are: | ||
44 | - allwinner,sun7i-a20-sram-a3-a4, allwinner,sun4i-a10-sram-a3-a4 | ||
45 | - allwinner,sun7i-a20-sram-c1, allwinner,sun4i-a10-sram-c1 | ||
46 | - allwinner,sun7i-a20-sram-d, allwinner,sun4i-a10-sram-d | ||
47 | |||
48 | The valid sections compatible for A23/A33 are: | ||
49 | - allwinner,sun8i-a23-sram-c1, allwinner,sun4i-a10-sram-c1 | ||
50 | |||
51 | The valid sections compatible for H3 are: | ||
52 | - allwinner,sun8i-h3-sram-c1, allwinner,sun4i-a10-sram-c1 | ||
53 | |||
31 | The valid sections compatible for A64 are: | 54 | The valid sections compatible for A64 are: |
32 | - allwinner,sun50i-a64-sram-c | 55 | - allwinner,sun50i-a64-sram-c |
33 | 56 | ||
@@ -47,8 +70,8 @@ This valid values for this argument are: | |||
47 | 70 | ||
48 | Example | 71 | Example |
49 | ------- | 72 | ------- |
50 | sram-controller@1c00000 { | 73 | system-control@1c00000 { |
51 | compatible = "allwinner,sun4i-a10-sram-controller"; | 74 | compatible = "allwinner,sun4i-a10-system-control"; |
52 | reg = <0x01c00000 0x30>; | 75 | reg = <0x01c00000 0x30>; |
53 | #address-cells = <1>; | 76 | #address-cells = <1>; |
54 | #size-cells = <1>; | 77 | #size-cells = <1>; |
diff --git a/Documentation/hwmon/raspberrypi-hwmon b/Documentation/hwmon/raspberrypi-hwmon new file mode 100644 index 000000000000..3c92e2cb52d6 --- /dev/null +++ b/Documentation/hwmon/raspberrypi-hwmon | |||
@@ -0,0 +1,22 @@ | |||
1 | Kernel driver raspberrypi-hwmon | ||
2 | =============================== | ||
3 | |||
4 | Supported boards: | ||
5 | * Raspberry Pi A+ (via GPIO on SoC) | ||
6 | * Raspberry Pi B+ (via GPIO on SoC) | ||
7 | * Raspberry Pi 2 B (via GPIO on SoC) | ||
8 | * Raspberry Pi 3 B (via GPIO on port expander) | ||
9 | * Raspberry Pi 3 B+ (via PMIC) | ||
10 | |||
11 | Author: Stefan Wahren <stefan.wahren@i2se.com> | ||
12 | |||
13 | Description | ||
14 | ----------- | ||
15 | |||
16 | This driver periodically polls a mailbox property of the VC4 firmware to detect | ||
17 | undervoltage conditions. | ||
18 | |||
19 | Sysfs entries | ||
20 | ------------- | ||
21 | |||
22 | in0_lcrit_alarm Undervoltage alarm | ||
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt b/Documentation/networking/dpaa2/dpio-driver.rst index 72ba9da3d179..13588104161b 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt +++ b/Documentation/networking/dpaa2/dpio-driver.rst | |||
@@ -1,7 +1,15 @@ | |||
1 | Copyright 2016 NXP | 1 | .. include:: <isonum.txt> |
2 | |||
3 | DPAA2 DPIO (Data Path I/O) Overview | ||
4 | =================================== | ||
5 | |||
6 | :Copyright: |copy| 2016-2018 NXP | ||
7 | |||
8 | This document provides an overview of the Freescale DPAA2 DPIO | ||
9 | drivers | ||
2 | 10 | ||
3 | Introduction | 11 | Introduction |
4 | ------------ | 12 | ============ |
5 | 13 | ||
6 | A DPAA2 DPIO (Data Path I/O) is a hardware object that provides | 14 | A DPAA2 DPIO (Data Path I/O) is a hardware object that provides |
7 | interfaces to enqueue and dequeue frames to/from network interfaces | 15 | interfaces to enqueue and dequeue frames to/from network interfaces |
@@ -27,8 +35,11 @@ provides services that: | |||
27 | 35 | ||
28 | The Linux DPIO driver consists of 3 primary components-- | 36 | The Linux DPIO driver consists of 3 primary components-- |
29 | DPIO object driver-- fsl-mc driver that manages the DPIO object | 37 | DPIO object driver-- fsl-mc driver that manages the DPIO object |
38 | |||
30 | DPIO service-- provides APIs to other Linux drivers for services | 39 | DPIO service-- provides APIs to other Linux drivers for services |
40 | |||
31 | QBman portal interface-- sends portal commands, gets responses | 41 | QBman portal interface-- sends portal commands, gets responses |
42 | :: | ||
32 | 43 | ||
33 | fsl-mc other | 44 | fsl-mc other |
34 | bus drivers | 45 | bus drivers |
@@ -45,8 +56,9 @@ The Linux DPIO driver consists of 3 primary components-- | |||
45 | | | 56 | | |
46 | hardware | 57 | hardware |
47 | 58 | ||
59 | |||
48 | The diagram below shows how the DPIO driver components fit with the other | 60 | The diagram below shows how the DPIO driver components fit with the other |
49 | DPAA2 Linux driver components: | 61 | DPAA2 Linux driver components:: |
50 | +------------+ | 62 | +------------+ |
51 | | OS Network | | 63 | | OS Network | |
52 | | Stack | | 64 | | Stack | |
@@ -98,20 +110,29 @@ DPIO service (dpio-service.c, dpaa2-io.h) | |||
98 | 110 | ||
99 | Notification handling | 111 | Notification handling |
100 | dpaa2_io_service_register() | 112 | dpaa2_io_service_register() |
113 | |||
101 | dpaa2_io_service_deregister() | 114 | dpaa2_io_service_deregister() |
115 | |||
102 | dpaa2_io_service_rearm() | 116 | dpaa2_io_service_rearm() |
103 | 117 | ||
104 | Queuing | 118 | Queuing |
105 | dpaa2_io_service_pull_fq() | 119 | dpaa2_io_service_pull_fq() |
120 | |||
106 | dpaa2_io_service_pull_channel() | 121 | dpaa2_io_service_pull_channel() |
122 | |||
107 | dpaa2_io_service_enqueue_fq() | 123 | dpaa2_io_service_enqueue_fq() |
124 | |||
108 | dpaa2_io_service_enqueue_qd() | 125 | dpaa2_io_service_enqueue_qd() |
126 | |||
109 | dpaa2_io_store_create() | 127 | dpaa2_io_store_create() |
128 | |||
110 | dpaa2_io_store_destroy() | 129 | dpaa2_io_store_destroy() |
130 | |||
111 | dpaa2_io_store_next() | 131 | dpaa2_io_store_next() |
112 | 132 | ||
113 | Buffer pool management | 133 | Buffer pool management |
114 | dpaa2_io_service_release() | 134 | dpaa2_io_service_release() |
135 | |||
115 | dpaa2_io_service_acquire() | 136 | dpaa2_io_service_acquire() |
116 | 137 | ||
117 | QBman portal interface (qbman-portal.c) | 138 | QBman portal interface (qbman-portal.c) |
@@ -120,7 +141,9 @@ QBman portal interface (qbman-portal.c) | |||
120 | The qbman-portal component provides APIs to do the low level hardware | 141 | The qbman-portal component provides APIs to do the low level hardware |
121 | bit twiddling for operations such as: | 142 | bit twiddling for operations such as: |
122 | -initializing Qman software portals | 143 | -initializing Qman software portals |
144 | |||
123 | -building and sending portal commands | 145 | -building and sending portal commands |
146 | |||
124 | -portal interrupt configuration and processing | 147 | -portal interrupt configuration and processing |
125 | 148 | ||
126 | The qbman-portal APIs are not public to other drivers, and are | 149 | The qbman-portal APIs are not public to other drivers, and are |
diff --git a/Documentation/networking/dpaa2/index.rst b/Documentation/networking/dpaa2/index.rst index 4c6586c87969..10bea113a7bc 100644 --- a/Documentation/networking/dpaa2/index.rst +++ b/Documentation/networking/dpaa2/index.rst | |||
@@ -6,3 +6,4 @@ DPAA2 Documentation | |||
6 | :maxdepth: 1 | 6 | :maxdepth: 1 |
7 | 7 | ||
8 | overview | 8 | overview |
9 | dpio-driver | ||
diff --git a/MAINTAINERS b/MAINTAINERS index a48d24d50753..126335e0471f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -4512,7 +4512,7 @@ DPAA2 DATAPATH I/O (DPIO) DRIVER | |||
4512 | M: Roy Pledge <Roy.Pledge@nxp.com> | 4512 | M: Roy Pledge <Roy.Pledge@nxp.com> |
4513 | L: linux-kernel@vger.kernel.org | 4513 | L: linux-kernel@vger.kernel.org |
4514 | S: Maintained | 4514 | S: Maintained |
4515 | F: drivers/staging/fsl-mc/bus/dpio | 4515 | F: drivers/soc/fsl/dpio |
4516 | 4516 | ||
4517 | DPAA2 ETHERNET DRIVER | 4517 | DPAA2 ETHERNET DRIVER |
4518 | M: Ioana Radulescu <ruxandra.radulescu@nxp.com> | 4518 | M: Ioana Radulescu <ruxandra.radulescu@nxp.com> |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 99f9a895a459..564570ea3e27 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
@@ -75,7 +75,6 @@ static const struct of_device_id ahci_of_match[] = { | |||
75 | { .compatible = "generic-ahci", }, | 75 | { .compatible = "generic-ahci", }, |
76 | /* Keep the following compatibles for device tree compatibility */ | 76 | /* Keep the following compatibles for device tree compatibility */ |
77 | { .compatible = "snps,spear-ahci", }, | 77 | { .compatible = "snps,spear-ahci", }, |
78 | { .compatible = "snps,exynos5440-ahci", }, | ||
79 | { .compatible = "ibm,476gtr-ahci", }, | 78 | { .compatible = "ibm,476gtr-ahci", }, |
80 | { .compatible = "snps,dwc-ahci", }, | 79 | { .compatible = "snps,dwc-ahci", }, |
81 | { .compatible = "hisilicon,hisi-ahci", }, | 80 | { .compatible = "hisilicon,hisi-ahci", }, |
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index d1c0b60e9326..1851112ccc29 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig | |||
@@ -103,6 +103,16 @@ config SIMPLE_PM_BUS | |||
103 | Controller (BSC, sometimes called "LBSC within Bus Bridge", or | 103 | Controller (BSC, sometimes called "LBSC within Bus Bridge", or |
104 | "External Bus Interface") as found on several Renesas ARM SoCs. | 104 | "External Bus Interface") as found on several Renesas ARM SoCs. |
105 | 105 | ||
106 | config SUN50I_DE2_BUS | ||
107 | bool "Allwinner A64 DE2 Bus Driver" | ||
108 | default ARM64 | ||
109 | depends on ARCH_SUNXI | ||
110 | select SUNXI_SRAM | ||
111 | help | ||
112 | Say y here to enable support for Allwinner A64 DE2 bus driver. It's | ||
113 | mostly transparent, but a SRAM region needs to be claimed in the SRAM | ||
114 | controller to make the all blocks in the DE2 part accessible. | ||
115 | |||
106 | config SUNXI_RSB | 116 | config SUNXI_RSB |
107 | tristate "Allwinner sunXi Reduced Serial Bus Driver" | 117 | tristate "Allwinner sunXi Reduced Serial Bus Driver" |
108 | default MACH_SUN8I || MACH_SUN9I || ARM64 | 118 | default MACH_SUN8I || MACH_SUN9I || ARM64 |
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index b8f036cca7ff..ca300b1914ce 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile | |||
@@ -21,6 +21,7 @@ obj-$(CONFIG_OMAP_INTERCONNECT) += omap_l3_smx.o omap_l3_noc.o | |||
21 | 21 | ||
22 | obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o | 22 | obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o |
23 | obj-$(CONFIG_QCOM_EBI2) += qcom-ebi2.o | 23 | obj-$(CONFIG_QCOM_EBI2) += qcom-ebi2.o |
24 | obj-$(CONFIG_SUN50I_DE2_BUS) += sun50i-de2.o | ||
24 | obj-$(CONFIG_SUNXI_RSB) += sunxi-rsb.o | 25 | obj-$(CONFIG_SUNXI_RSB) += sunxi-rsb.o |
25 | obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o | 26 | obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o |
26 | obj-$(CONFIG_TEGRA_ACONNECT) += tegra-aconnect.o | 27 | obj-$(CONFIG_TEGRA_ACONNECT) += tegra-aconnect.o |
diff --git a/drivers/bus/sun50i-de2.c b/drivers/bus/sun50i-de2.c new file mode 100644 index 000000000000..672518741f86 --- /dev/null +++ b/drivers/bus/sun50i-de2.c | |||
@@ -0,0 +1,48 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* | ||
3 | * Allwinner A64 Display Engine 2.0 Bus Driver | ||
4 | * | ||
5 | * Copyright (C) 2018 Icenowy Zheng <icenowy@aosc.io> | ||
6 | */ | ||
7 | |||
8 | #include <linux/of_platform.h> | ||
9 | #include <linux/platform_device.h> | ||
10 | #include <linux/soc/sunxi/sunxi_sram.h> | ||
11 | |||
12 | static int sun50i_de2_bus_probe(struct platform_device *pdev) | ||
13 | { | ||
14 | struct device_node *np = pdev->dev.of_node; | ||
15 | int ret; | ||
16 | |||
17 | ret = sunxi_sram_claim(&pdev->dev); | ||
18 | if (ret) { | ||
19 | dev_err(&pdev->dev, "Error couldn't map SRAM to device\n"); | ||
20 | return ret; | ||
21 | } | ||
22 | |||
23 | of_platform_populate(np, NULL, NULL, &pdev->dev); | ||
24 | |||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | static int sun50i_de2_bus_remove(struct platform_device *pdev) | ||
29 | { | ||
30 | sunxi_sram_release(&pdev->dev); | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | static const struct of_device_id sun50i_de2_bus_of_match[] = { | ||
35 | { .compatible = "allwinner,sun50i-a64-de2", }, | ||
36 | { /* sentinel */ } | ||
37 | }; | ||
38 | |||
39 | static struct platform_driver sun50i_de2_bus_driver = { | ||
40 | .probe = sun50i_de2_bus_probe, | ||
41 | .remove = sun50i_de2_bus_remove, | ||
42 | .driver = { | ||
43 | .name = "sun50i-de2-bus", | ||
44 | .of_match_table = sun50i_de2_bus_of_match, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | builtin_platform_driver(sun50i_de2_bus_driver); | ||
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 80d60f43db56..c9bac9dc4637 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c | |||
@@ -23,11 +23,14 @@ | |||
23 | #include <linux/of_address.h> | 23 | #include <linux/of_address.h> |
24 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/iopoll.h> | ||
26 | 27 | ||
27 | #include <linux/platform_data/ti-sysc.h> | 28 | #include <linux/platform_data/ti-sysc.h> |
28 | 29 | ||
29 | #include <dt-bindings/bus/ti-sysc.h> | 30 | #include <dt-bindings/bus/ti-sysc.h> |
30 | 31 | ||
32 | #define MAX_MODULE_SOFTRESET_WAIT 10000 | ||
33 | |||
31 | static const char * const reg_names[] = { "rev", "sysc", "syss", }; | 34 | static const char * const reg_names[] = { "rev", "sysc", "syss", }; |
32 | 35 | ||
33 | enum sysc_clocks { | 36 | enum sysc_clocks { |
@@ -88,6 +91,11 @@ struct sysc { | |||
88 | struct delayed_work idle_work; | 91 | struct delayed_work idle_work; |
89 | }; | 92 | }; |
90 | 93 | ||
94 | void sysc_write(struct sysc *ddata, int offset, u32 value) | ||
95 | { | ||
96 | writel_relaxed(value, ddata->module_va + offset); | ||
97 | } | ||
98 | |||
91 | static u32 sysc_read(struct sysc *ddata, int offset) | 99 | static u32 sysc_read(struct sysc *ddata, int offset) |
92 | { | 100 | { |
93 | if (ddata->cfg.quirks & SYSC_QUIRK_16BIT) { | 101 | if (ddata->cfg.quirks & SYSC_QUIRK_16BIT) { |
@@ -943,6 +951,36 @@ static void sysc_init_revision_quirks(struct sysc *ddata) | |||
943 | } | 951 | } |
944 | } | 952 | } |
945 | 953 | ||
954 | static int sysc_reset(struct sysc *ddata) | ||
955 | { | ||
956 | int offset = ddata->offsets[SYSC_SYSCONFIG]; | ||
957 | int val; | ||
958 | |||
959 | if (ddata->legacy_mode || offset < 0 || | ||
960 | ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) | ||
961 | return 0; | ||
962 | |||
963 | /* | ||
964 | * Currently only support reset status in sysstatus. | ||
965 | * Warn and return error in all other cases | ||
966 | */ | ||
967 | if (!ddata->cfg.syss_mask) { | ||
968 | dev_err(ddata->dev, "No ti,syss-mask. Reset failed\n"); | ||
969 | return -EINVAL; | ||
970 | } | ||
971 | |||
972 | val = sysc_read(ddata, offset); | ||
973 | val |= (0x1 << ddata->cap->regbits->srst_shift); | ||
974 | sysc_write(ddata, offset, val); | ||
975 | |||
976 | /* Poll on reset status */ | ||
977 | offset = ddata->offsets[SYSC_SYSSTATUS]; | ||
978 | |||
979 | return readl_poll_timeout(ddata->module_va + offset, val, | ||
980 | (val & ddata->cfg.syss_mask) == 0x0, | ||
981 | 100, MAX_MODULE_SOFTRESET_WAIT); | ||
982 | } | ||
983 | |||
946 | /* At this point the module is configured enough to read the revision */ | 984 | /* At this point the module is configured enough to read the revision */ |
947 | static int sysc_init_module(struct sysc *ddata) | 985 | static int sysc_init_module(struct sysc *ddata) |
948 | { | 986 | { |
@@ -960,6 +998,14 @@ static int sysc_init_module(struct sysc *ddata) | |||
960 | return 0; | 998 | return 0; |
961 | } | 999 | } |
962 | 1000 | ||
1001 | error = sysc_reset(ddata); | ||
1002 | if (error) { | ||
1003 | dev_err(ddata->dev, "Reset failed with %d\n", error); | ||
1004 | pm_runtime_put_sync(ddata->dev); | ||
1005 | |||
1006 | return error; | ||
1007 | } | ||
1008 | |||
963 | ddata->revision = sysc_read_revision(ddata); | 1009 | ddata->revision = sysc_read_revision(ddata); |
964 | pm_runtime_put_sync(ddata->dev); | 1010 | pm_runtime_put_sync(ddata->dev); |
965 | 1011 | ||
@@ -1552,6 +1598,23 @@ static const struct sysc_capabilities sysc_omap4_usb_host_fs = { | |||
1552 | .regbits = &sysc_regbits_omap4_usb_host_fs, | 1598 | .regbits = &sysc_regbits_omap4_usb_host_fs, |
1553 | }; | 1599 | }; |
1554 | 1600 | ||
1601 | static const struct sysc_regbits sysc_regbits_dra7_mcan = { | ||
1602 | .dmadisable_shift = -ENODEV, | ||
1603 | .midle_shift = -ENODEV, | ||
1604 | .sidle_shift = -ENODEV, | ||
1605 | .clkact_shift = -ENODEV, | ||
1606 | .enwkup_shift = 4, | ||
1607 | .srst_shift = 0, | ||
1608 | .emufree_shift = -ENODEV, | ||
1609 | .autoidle_shift = -ENODEV, | ||
1610 | }; | ||
1611 | |||
1612 | static const struct sysc_capabilities sysc_dra7_mcan = { | ||
1613 | .type = TI_SYSC_DRA7_MCAN, | ||
1614 | .sysc_mask = SYSC_DRA7_MCAN_ENAWAKEUP | SYSC_OMAP4_SOFTRESET, | ||
1615 | .regbits = &sysc_regbits_dra7_mcan, | ||
1616 | }; | ||
1617 | |||
1555 | static int sysc_init_pdata(struct sysc *ddata) | 1618 | static int sysc_init_pdata(struct sysc *ddata) |
1556 | { | 1619 | { |
1557 | struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); | 1620 | struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); |
@@ -1743,6 +1806,7 @@ static const struct of_device_id sysc_match[] = { | |||
1743 | { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, }, | 1806 | { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, }, |
1744 | { .compatible = "ti,sysc-usb-host-fs", | 1807 | { .compatible = "ti,sysc-usb-host-fs", |
1745 | .data = &sysc_omap4_usb_host_fs, }, | 1808 | .data = &sysc_omap4_usb_host_fs, }, |
1809 | { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, }, | ||
1746 | { }, | 1810 | { }, |
1747 | }; | 1811 | }; |
1748 | MODULE_DEVICE_TABLE(of, sysc_match); | 1812 | MODULE_DEVICE_TABLE(of, sysc_match); |
diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile index 513826393158..1a4e6b787978 100644 --- a/drivers/clk/samsung/Makefile +++ b/drivers/clk/samsung/Makefile | |||
@@ -14,7 +14,6 @@ obj-$(CONFIG_SOC_EXYNOS5410) += clk-exynos5410.o | |||
14 | obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5420.o | 14 | obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5420.o |
15 | obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5-subcmu.o | 15 | obj-$(CONFIG_SOC_EXYNOS5420) += clk-exynos5-subcmu.o |
16 | obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos5433.o | 16 | obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos5433.o |
17 | obj-$(CONFIG_SOC_EXYNOS5440) += clk-exynos5440.o | ||
18 | obj-$(CONFIG_EXYNOS_AUDSS_CLK_CON) += clk-exynos-audss.o | 17 | obj-$(CONFIG_EXYNOS_AUDSS_CLK_CON) += clk-exynos-audss.o |
19 | obj-$(CONFIG_ARCH_EXYNOS) += clk-exynos-clkout.o | 18 | obj-$(CONFIG_ARCH_EXYNOS) += clk-exynos-clkout.o |
20 | obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos7.o | 19 | obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos7.o |
diff --git a/drivers/clk/samsung/clk-exynos5440.c b/drivers/clk/samsung/clk-exynos5440.c deleted file mode 100644 index b08bd54c5e76..000000000000 --- a/drivers/clk/samsung/clk-exynos5440.c +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
3 | * Author: Thomas Abraham <thomas.ab@samsung.com> | ||
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 version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * Common Clock Framework support for Exynos5440 SoC. | ||
10 | */ | ||
11 | |||
12 | #include <dt-bindings/clock/exynos5440.h> | ||
13 | #include <linux/clk-provider.h> | ||
14 | #include <linux/of.h> | ||
15 | #include <linux/of_address.h> | ||
16 | #include <linux/notifier.h> | ||
17 | #include <linux/reboot.h> | ||
18 | |||
19 | #include "clk.h" | ||
20 | #include "clk-pll.h" | ||
21 | |||
22 | #define CLKEN_OV_VAL 0xf8 | ||
23 | #define CPU_CLK_STATUS 0xfc | ||
24 | #define MISC_DOUT1 0x558 | ||
25 | |||
26 | static void __iomem *reg_base; | ||
27 | |||
28 | /* parent clock name list */ | ||
29 | PNAME(mout_armclk_p) = { "cplla", "cpllb" }; | ||
30 | PNAME(mout_spi_p) = { "div125", "div200" }; | ||
31 | |||
32 | /* fixed rate clocks generated outside the soc */ | ||
33 | static struct samsung_fixed_rate_clock exynos5440_fixed_rate_ext_clks[] __initdata = { | ||
34 | FRATE(0, "xtal", NULL, 0, 0), | ||
35 | }; | ||
36 | |||
37 | /* fixed rate clocks */ | ||
38 | static const struct samsung_fixed_rate_clock exynos5440_fixed_rate_clks[] __initconst = { | ||
39 | FRATE(0, "ppll", NULL, 0, 1000000000), | ||
40 | FRATE(0, "usb_phy0", NULL, 0, 60000000), | ||
41 | FRATE(0, "usb_phy1", NULL, 0, 60000000), | ||
42 | FRATE(0, "usb_ohci12", NULL, 0, 12000000), | ||
43 | FRATE(0, "usb_ohci48", NULL, 0, 48000000), | ||
44 | }; | ||
45 | |||
46 | /* fixed factor clocks */ | ||
47 | static const struct samsung_fixed_factor_clock exynos5440_fixed_factor_clks[] __initconst = { | ||
48 | FFACTOR(0, "div250", "ppll", 1, 4, 0), | ||
49 | FFACTOR(0, "div200", "ppll", 1, 5, 0), | ||
50 | FFACTOR(0, "div125", "div250", 1, 2, 0), | ||
51 | }; | ||
52 | |||
53 | /* mux clocks */ | ||
54 | static const struct samsung_mux_clock exynos5440_mux_clks[] __initconst = { | ||
55 | MUX(0, "mout_spi", mout_spi_p, MISC_DOUT1, 5, 1), | ||
56 | MUX(CLK_ARM_CLK, "arm_clk", mout_armclk_p, CPU_CLK_STATUS, 0, 1), | ||
57 | }; | ||
58 | |||
59 | /* divider clocks */ | ||
60 | static const struct samsung_div_clock exynos5440_div_clks[] __initconst = { | ||
61 | DIV(CLK_SPI_BAUD, "div_spi", "mout_spi", MISC_DOUT1, 3, 2), | ||
62 | }; | ||
63 | |||
64 | /* gate clocks */ | ||
65 | static const struct samsung_gate_clock exynos5440_gate_clks[] __initconst = { | ||
66 | GATE(CLK_PB0_250, "pb0_250", "div250", CLKEN_OV_VAL, 3, 0, 0), | ||
67 | GATE(CLK_PR0_250, "pr0_250", "div250", CLKEN_OV_VAL, 4, 0, 0), | ||
68 | GATE(CLK_PR1_250, "pr1_250", "div250", CLKEN_OV_VAL, 5, 0, 0), | ||
69 | GATE(CLK_B_250, "b_250", "div250", CLKEN_OV_VAL, 9, 0, 0), | ||
70 | GATE(CLK_B_125, "b_125", "div125", CLKEN_OV_VAL, 10, 0, 0), | ||
71 | GATE(CLK_B_200, "b_200", "div200", CLKEN_OV_VAL, 11, 0, 0), | ||
72 | GATE(CLK_SATA, "sata", "div200", CLKEN_OV_VAL, 12, 0, 0), | ||
73 | GATE(CLK_USB, "usb", "div200", CLKEN_OV_VAL, 13, 0, 0), | ||
74 | GATE(CLK_GMAC0, "gmac0", "div200", CLKEN_OV_VAL, 14, 0, 0), | ||
75 | GATE(CLK_CS250, "cs250", "div250", CLKEN_OV_VAL, 19, 0, 0), | ||
76 | GATE(CLK_PB0_250_O, "pb0_250_o", "pb0_250", CLKEN_OV_VAL, 3, 0, 0), | ||
77 | GATE(CLK_PR0_250_O, "pr0_250_o", "pr0_250", CLKEN_OV_VAL, 4, 0, 0), | ||
78 | GATE(CLK_PR1_250_O, "pr1_250_o", "pr1_250", CLKEN_OV_VAL, 5, 0, 0), | ||
79 | GATE(CLK_B_250_O, "b_250_o", "b_250", CLKEN_OV_VAL, 9, 0, 0), | ||
80 | GATE(CLK_B_125_O, "b_125_o", "b_125", CLKEN_OV_VAL, 10, 0, 0), | ||
81 | GATE(CLK_B_200_O, "b_200_o", "b_200", CLKEN_OV_VAL, 11, 0, 0), | ||
82 | GATE(CLK_SATA_O, "sata_o", "sata", CLKEN_OV_VAL, 12, 0, 0), | ||
83 | GATE(CLK_USB_O, "usb_o", "usb", CLKEN_OV_VAL, 13, 0, 0), | ||
84 | GATE(CLK_GMAC0_O, "gmac0_o", "gmac", CLKEN_OV_VAL, 14, 0, 0), | ||
85 | GATE(CLK_CS250_O, "cs250_o", "cs250", CLKEN_OV_VAL, 19, 0, 0), | ||
86 | }; | ||
87 | |||
88 | static const struct of_device_id ext_clk_match[] __initconst = { | ||
89 | { .compatible = "samsung,clock-xtal", .data = (void *)0, }, | ||
90 | {}, | ||
91 | }; | ||
92 | |||
93 | static int exynos5440_clk_restart_notify(struct notifier_block *this, | ||
94 | unsigned long code, void *unused) | ||
95 | { | ||
96 | u32 val, status; | ||
97 | |||
98 | status = readl_relaxed(reg_base + 0xbc); | ||
99 | val = readl_relaxed(reg_base + 0xcc); | ||
100 | val = (val & 0xffff0000) | (status & 0xffff); | ||
101 | writel_relaxed(val, reg_base + 0xcc); | ||
102 | |||
103 | return NOTIFY_DONE; | ||
104 | } | ||
105 | |||
106 | /* | ||
107 | * Exynos5440 Clock restart notifier, handles restart functionality | ||
108 | */ | ||
109 | static struct notifier_block exynos5440_clk_restart_handler = { | ||
110 | .notifier_call = exynos5440_clk_restart_notify, | ||
111 | .priority = 128, | ||
112 | }; | ||
113 | |||
114 | static const struct samsung_pll_clock exynos5440_plls[] __initconst = { | ||
115 | PLL(pll_2550x, CLK_CPLLA, "cplla", "xtal", 0, 0x4c, NULL), | ||
116 | PLL(pll_2550x, CLK_CPLLB, "cpllb", "xtal", 0, 0x50, NULL), | ||
117 | }; | ||
118 | |||
119 | /* | ||
120 | * Clock aliases for legacy clkdev look-up. | ||
121 | */ | ||
122 | static const struct samsung_clock_alias exynos5440_aliases[] __initconst = { | ||
123 | ALIAS(CLK_ARM_CLK, NULL, "armclk"), | ||
124 | }; | ||
125 | |||
126 | /* register exynos5440 clocks */ | ||
127 | static void __init exynos5440_clk_init(struct device_node *np) | ||
128 | { | ||
129 | struct samsung_clk_provider *ctx; | ||
130 | |||
131 | reg_base = of_iomap(np, 0); | ||
132 | if (!reg_base) { | ||
133 | pr_err("%s: failed to map clock controller registers," | ||
134 | " aborting clock initialization\n", __func__); | ||
135 | return; | ||
136 | } | ||
137 | |||
138 | ctx = samsung_clk_init(np, reg_base, CLK_NR_CLKS); | ||
139 | |||
140 | samsung_clk_of_register_fixed_ext(ctx, exynos5440_fixed_rate_ext_clks, | ||
141 | ARRAY_SIZE(exynos5440_fixed_rate_ext_clks), ext_clk_match); | ||
142 | |||
143 | samsung_clk_register_pll(ctx, exynos5440_plls, | ||
144 | ARRAY_SIZE(exynos5440_plls), ctx->reg_base); | ||
145 | |||
146 | samsung_clk_register_fixed_rate(ctx, exynos5440_fixed_rate_clks, | ||
147 | ARRAY_SIZE(exynos5440_fixed_rate_clks)); | ||
148 | samsung_clk_register_fixed_factor(ctx, exynos5440_fixed_factor_clks, | ||
149 | ARRAY_SIZE(exynos5440_fixed_factor_clks)); | ||
150 | samsung_clk_register_mux(ctx, exynos5440_mux_clks, | ||
151 | ARRAY_SIZE(exynos5440_mux_clks)); | ||
152 | samsung_clk_register_div(ctx, exynos5440_div_clks, | ||
153 | ARRAY_SIZE(exynos5440_div_clks)); | ||
154 | samsung_clk_register_gate(ctx, exynos5440_gate_clks, | ||
155 | ARRAY_SIZE(exynos5440_gate_clks)); | ||
156 | samsung_clk_register_alias(ctx, exynos5440_aliases, | ||
157 | ARRAY_SIZE(exynos5440_aliases)); | ||
158 | |||
159 | samsung_clk_of_add_provider(np, ctx); | ||
160 | |||
161 | if (register_restart_handler(&exynos5440_clk_restart_handler)) | ||
162 | pr_warn("exynos5440 clock can't register restart handler\n"); | ||
163 | |||
164 | pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("arm_clk")); | ||
165 | pr_info("exynos5440 clock initialization complete\n"); | ||
166 | } | ||
167 | CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init); | ||
diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c index fb249a1637a5..71a122b2dc67 100644 --- a/drivers/clk/ti/clk-7xx.c +++ b/drivers/clk/ti/clk-7xx.c | |||
@@ -708,6 +708,7 @@ static const struct omap_clkctrl_reg_data dra7_wkupaon_clkctrl_regs[] __initcons | |||
708 | { DRA7_COUNTER_32K_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" }, | 708 | { DRA7_COUNTER_32K_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" }, |
709 | { DRA7_UART10_CLKCTRL, dra7_uart10_bit_data, CLKF_SW_SUP, "wkupaon_cm:clk:0060:24" }, | 709 | { DRA7_UART10_CLKCTRL, dra7_uart10_bit_data, CLKF_SW_SUP, "wkupaon_cm:clk:0060:24" }, |
710 | { DRA7_DCAN1_CLKCTRL, dra7_dcan1_bit_data, CLKF_SW_SUP, "wkupaon_cm:clk:0068:24" }, | 710 | { DRA7_DCAN1_CLKCTRL, dra7_dcan1_bit_data, CLKF_SW_SUP, "wkupaon_cm:clk:0068:24" }, |
711 | { DRA7_ADC_CLKCTRL, NULL, CLKF_SW_SUP, "mcan_clk"}, | ||
711 | { 0 }, | 712 | { 0 }, |
712 | }; | 713 | }; |
713 | 714 | ||
diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 52f5f1a2040c..0cd8eb76ad59 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm | |||
@@ -71,20 +71,6 @@ config ARM_BRCMSTB_AVS_CPUFREQ | |||
71 | 71 | ||
72 | Say Y, if you have a Broadcom SoC with AVS support for DFS or DVFS. | 72 | Say Y, if you have a Broadcom SoC with AVS support for DFS or DVFS. |
73 | 73 | ||
74 | config ARM_EXYNOS5440_CPUFREQ | ||
75 | tristate "SAMSUNG EXYNOS5440" | ||
76 | depends on SOC_EXYNOS5440 | ||
77 | depends on HAVE_CLK && OF | ||
78 | select PM_OPP | ||
79 | default y | ||
80 | help | ||
81 | This adds the CPUFreq driver for Samsung EXYNOS5440 | ||
82 | SoC. The nature of exynos5440 clock controller is | ||
83 | different than previous exynos controllers so not using | ||
84 | the common exynos framework. | ||
85 | |||
86 | If in doubt, say N. | ||
87 | |||
88 | config ARM_HIGHBANK_CPUFREQ | 74 | config ARM_HIGHBANK_CPUFREQ |
89 | tristate "Calxeda Highbank-based" | 75 | tristate "Calxeda Highbank-based" |
90 | depends on ARCH_HIGHBANK && CPUFREQ_DT && REGULATOR | 76 | depends on ARCH_HIGHBANK && CPUFREQ_DT && REGULATOR |
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index fb4a2ecac43b..c1ffeabe4ecf 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile | |||
@@ -56,7 +56,6 @@ obj-$(CONFIG_ARM_ARMADA_37XX_CPUFREQ) += armada-37xx-cpufreq.o | |||
56 | obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o | 56 | obj-$(CONFIG_ARM_BRCMSTB_AVS_CPUFREQ) += brcmstb-avs-cpufreq.o |
57 | obj-$(CONFIG_ACPI_CPPC_CPUFREQ) += cppc_cpufreq.o | 57 | obj-$(CONFIG_ACPI_CPPC_CPUFREQ) += cppc_cpufreq.o |
58 | obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o | 58 | obj-$(CONFIG_ARCH_DAVINCI) += davinci-cpufreq.o |
59 | obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ) += exynos5440-cpufreq.o | ||
60 | obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o | 59 | obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ) += highbank-cpufreq.o |
61 | obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o | 60 | obj-$(CONFIG_ARM_IMX6Q_CPUFREQ) += imx6q-cpufreq.o |
62 | obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += kirkwood-cpufreq.o | 61 | obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ) += kirkwood-cpufreq.o |
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c deleted file mode 100644 index 932caa386ece..000000000000 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ /dev/null | |||
@@ -1,452 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.com | ||
4 | * | ||
5 | * Amit Daniel Kachhap <amit.daniel@samsung.com> | ||
6 | * | ||
7 | * EXYNOS5440 - CPU frequency scaling support | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/clk.h> | ||
15 | #include <linux/cpu.h> | ||
16 | #include <linux/cpufreq.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/of_address.h> | ||
22 | #include <linux/of_irq.h> | ||
23 | #include <linux/pm_opp.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/slab.h> | ||
26 | |||
27 | /* Register definitions */ | ||
28 | #define XMU_DVFS_CTRL 0x0060 | ||
29 | #define XMU_PMU_P0_7 0x0064 | ||
30 | #define XMU_C0_3_PSTATE 0x0090 | ||
31 | #define XMU_P_LIMIT 0x00a0 | ||
32 | #define XMU_P_STATUS 0x00a4 | ||
33 | #define XMU_PMUEVTEN 0x00d0 | ||
34 | #define XMU_PMUIRQEN 0x00d4 | ||
35 | #define XMU_PMUIRQ 0x00d8 | ||
36 | |||
37 | /* PMU mask and shift definations */ | ||
38 | #define P_VALUE_MASK 0x7 | ||
39 | |||
40 | #define XMU_DVFS_CTRL_EN_SHIFT 0 | ||
41 | |||
42 | #define P0_7_CPUCLKDEV_SHIFT 21 | ||
43 | #define P0_7_CPUCLKDEV_MASK 0x7 | ||
44 | #define P0_7_ATBCLKDEV_SHIFT 18 | ||
45 | #define P0_7_ATBCLKDEV_MASK 0x7 | ||
46 | #define P0_7_CSCLKDEV_SHIFT 15 | ||
47 | #define P0_7_CSCLKDEV_MASK 0x7 | ||
48 | #define P0_7_CPUEMA_SHIFT 28 | ||
49 | #define P0_7_CPUEMA_MASK 0xf | ||
50 | #define P0_7_L2EMA_SHIFT 24 | ||
51 | #define P0_7_L2EMA_MASK 0xf | ||
52 | #define P0_7_VDD_SHIFT 8 | ||
53 | #define P0_7_VDD_MASK 0x7f | ||
54 | #define P0_7_FREQ_SHIFT 0 | ||
55 | #define P0_7_FREQ_MASK 0xff | ||
56 | |||
57 | #define C0_3_PSTATE_VALID_SHIFT 8 | ||
58 | #define C0_3_PSTATE_CURR_SHIFT 4 | ||
59 | #define C0_3_PSTATE_NEW_SHIFT 0 | ||
60 | |||
61 | #define PSTATE_CHANGED_EVTEN_SHIFT 0 | ||
62 | |||
63 | #define PSTATE_CHANGED_IRQEN_SHIFT 0 | ||
64 | |||
65 | #define PSTATE_CHANGED_SHIFT 0 | ||
66 | |||
67 | /* some constant values for clock divider calculation */ | ||
68 | #define CPU_DIV_FREQ_MAX 500 | ||
69 | #define CPU_DBG_FREQ_MAX 375 | ||
70 | #define CPU_ATB_FREQ_MAX 500 | ||
71 | |||
72 | #define PMIC_LOW_VOLT 0x30 | ||
73 | #define PMIC_HIGH_VOLT 0x28 | ||
74 | |||
75 | #define CPUEMA_HIGH 0x2 | ||
76 | #define CPUEMA_MID 0x4 | ||
77 | #define CPUEMA_LOW 0x7 | ||
78 | |||
79 | #define L2EMA_HIGH 0x1 | ||
80 | #define L2EMA_MID 0x3 | ||
81 | #define L2EMA_LOW 0x4 | ||
82 | |||
83 | #define DIV_TAB_MAX 2 | ||
84 | /* frequency unit is 20MHZ */ | ||
85 | #define FREQ_UNIT 20 | ||
86 | #define MAX_VOLTAGE 1550000 /* In microvolt */ | ||
87 | #define VOLTAGE_STEP 12500 /* In microvolt */ | ||
88 | |||
89 | #define CPUFREQ_NAME "exynos5440_dvfs" | ||
90 | #define DEF_TRANS_LATENCY 100000 | ||
91 | |||
92 | enum cpufreq_level_index { | ||
93 | L0, L1, L2, L3, L4, | ||
94 | L5, L6, L7, L8, L9, | ||
95 | }; | ||
96 | #define CPUFREQ_LEVEL_END (L7 + 1) | ||
97 | |||
98 | struct exynos_dvfs_data { | ||
99 | void __iomem *base; | ||
100 | struct resource *mem; | ||
101 | int irq; | ||
102 | struct clk *cpu_clk; | ||
103 | unsigned int latency; | ||
104 | struct cpufreq_frequency_table *freq_table; | ||
105 | unsigned int freq_count; | ||
106 | struct device *dev; | ||
107 | bool dvfs_enabled; | ||
108 | struct work_struct irq_work; | ||
109 | }; | ||
110 | |||
111 | static struct exynos_dvfs_data *dvfs_info; | ||
112 | static DEFINE_MUTEX(cpufreq_lock); | ||
113 | static struct cpufreq_freqs freqs; | ||
114 | |||
115 | static int init_div_table(void) | ||
116 | { | ||
117 | struct cpufreq_frequency_table *pos, *freq_tbl = dvfs_info->freq_table; | ||
118 | unsigned int tmp, clk_div, ema_div, freq, volt_id, idx; | ||
119 | struct dev_pm_opp *opp; | ||
120 | |||
121 | cpufreq_for_each_entry_idx(pos, freq_tbl, idx) { | ||
122 | opp = dev_pm_opp_find_freq_exact(dvfs_info->dev, | ||
123 | pos->frequency * 1000, true); | ||
124 | if (IS_ERR(opp)) { | ||
125 | dev_err(dvfs_info->dev, | ||
126 | "failed to find valid OPP for %u KHZ\n", | ||
127 | pos->frequency); | ||
128 | return PTR_ERR(opp); | ||
129 | } | ||
130 | |||
131 | freq = pos->frequency / 1000; /* In MHZ */ | ||
132 | clk_div = ((freq / CPU_DIV_FREQ_MAX) & P0_7_CPUCLKDEV_MASK) | ||
133 | << P0_7_CPUCLKDEV_SHIFT; | ||
134 | clk_div |= ((freq / CPU_ATB_FREQ_MAX) & P0_7_ATBCLKDEV_MASK) | ||
135 | << P0_7_ATBCLKDEV_SHIFT; | ||
136 | clk_div |= ((freq / CPU_DBG_FREQ_MAX) & P0_7_CSCLKDEV_MASK) | ||
137 | << P0_7_CSCLKDEV_SHIFT; | ||
138 | |||
139 | /* Calculate EMA */ | ||
140 | volt_id = dev_pm_opp_get_voltage(opp); | ||
141 | |||
142 | volt_id = (MAX_VOLTAGE - volt_id) / VOLTAGE_STEP; | ||
143 | if (volt_id < PMIC_HIGH_VOLT) { | ||
144 | ema_div = (CPUEMA_HIGH << P0_7_CPUEMA_SHIFT) | | ||
145 | (L2EMA_HIGH << P0_7_L2EMA_SHIFT); | ||
146 | } else if (volt_id > PMIC_LOW_VOLT) { | ||
147 | ema_div = (CPUEMA_LOW << P0_7_CPUEMA_SHIFT) | | ||
148 | (L2EMA_LOW << P0_7_L2EMA_SHIFT); | ||
149 | } else { | ||
150 | ema_div = (CPUEMA_MID << P0_7_CPUEMA_SHIFT) | | ||
151 | (L2EMA_MID << P0_7_L2EMA_SHIFT); | ||
152 | } | ||
153 | |||
154 | tmp = (clk_div | ema_div | (volt_id << P0_7_VDD_SHIFT) | ||
155 | | ((freq / FREQ_UNIT) << P0_7_FREQ_SHIFT)); | ||
156 | |||
157 | __raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * idx); | ||
158 | dev_pm_opp_put(opp); | ||
159 | } | ||
160 | |||
161 | return 0; | ||
162 | } | ||
163 | |||
164 | static void exynos_enable_dvfs(unsigned int cur_frequency) | ||
165 | { | ||
166 | unsigned int tmp, cpu; | ||
167 | struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table; | ||
168 | struct cpufreq_frequency_table *pos; | ||
169 | /* Disable DVFS */ | ||
170 | __raw_writel(0, dvfs_info->base + XMU_DVFS_CTRL); | ||
171 | |||
172 | /* Enable PSTATE Change Event */ | ||
173 | tmp = __raw_readl(dvfs_info->base + XMU_PMUEVTEN); | ||
174 | tmp |= (1 << PSTATE_CHANGED_EVTEN_SHIFT); | ||
175 | __raw_writel(tmp, dvfs_info->base + XMU_PMUEVTEN); | ||
176 | |||
177 | /* Enable PSTATE Change IRQ */ | ||
178 | tmp = __raw_readl(dvfs_info->base + XMU_PMUIRQEN); | ||
179 | tmp |= (1 << PSTATE_CHANGED_IRQEN_SHIFT); | ||
180 | __raw_writel(tmp, dvfs_info->base + XMU_PMUIRQEN); | ||
181 | |||
182 | /* Set initial performance index */ | ||
183 | cpufreq_for_each_entry(pos, freq_table) | ||
184 | if (pos->frequency == cur_frequency) | ||
185 | break; | ||
186 | |||
187 | if (pos->frequency == CPUFREQ_TABLE_END) { | ||
188 | dev_crit(dvfs_info->dev, "Boot up frequency not supported\n"); | ||
189 | /* Assign the highest frequency */ | ||
190 | pos = freq_table; | ||
191 | cur_frequency = pos->frequency; | ||
192 | } | ||
193 | |||
194 | dev_info(dvfs_info->dev, "Setting dvfs initial frequency = %uKHZ", | ||
195 | cur_frequency); | ||
196 | |||
197 | for (cpu = 0; cpu < CONFIG_NR_CPUS; cpu++) { | ||
198 | tmp = __raw_readl(dvfs_info->base + XMU_C0_3_PSTATE + cpu * 4); | ||
199 | tmp &= ~(P_VALUE_MASK << C0_3_PSTATE_NEW_SHIFT); | ||
200 | tmp |= ((pos - freq_table) << C0_3_PSTATE_NEW_SHIFT); | ||
201 | __raw_writel(tmp, dvfs_info->base + XMU_C0_3_PSTATE + cpu * 4); | ||
202 | } | ||
203 | |||
204 | /* Enable DVFS */ | ||
205 | __raw_writel(1 << XMU_DVFS_CTRL_EN_SHIFT, | ||
206 | dvfs_info->base + XMU_DVFS_CTRL); | ||
207 | } | ||
208 | |||
209 | static int exynos_target(struct cpufreq_policy *policy, unsigned int index) | ||
210 | { | ||
211 | unsigned int tmp; | ||
212 | int i; | ||
213 | struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table; | ||
214 | |||
215 | mutex_lock(&cpufreq_lock); | ||
216 | |||
217 | freqs.old = policy->cur; | ||
218 | freqs.new = freq_table[index].frequency; | ||
219 | |||
220 | cpufreq_freq_transition_begin(policy, &freqs); | ||
221 | |||
222 | /* Set the target frequency in all C0_3_PSTATE register */ | ||
223 | for_each_cpu(i, policy->cpus) { | ||
224 | tmp = __raw_readl(dvfs_info->base + XMU_C0_3_PSTATE + i * 4); | ||
225 | tmp &= ~(P_VALUE_MASK << C0_3_PSTATE_NEW_SHIFT); | ||
226 | tmp |= (index << C0_3_PSTATE_NEW_SHIFT); | ||
227 | |||
228 | __raw_writel(tmp, dvfs_info->base + XMU_C0_3_PSTATE + i * 4); | ||
229 | } | ||
230 | mutex_unlock(&cpufreq_lock); | ||
231 | return 0; | ||
232 | } | ||
233 | |||
234 | static void exynos_cpufreq_work(struct work_struct *work) | ||
235 | { | ||
236 | unsigned int cur_pstate, index; | ||
237 | struct cpufreq_policy *policy = cpufreq_cpu_get(0); /* boot CPU */ | ||
238 | struct cpufreq_frequency_table *freq_table = dvfs_info->freq_table; | ||
239 | |||
240 | /* Ensure we can access cpufreq structures */ | ||
241 | if (unlikely(dvfs_info->dvfs_enabled == false)) | ||
242 | goto skip_work; | ||
243 | |||
244 | mutex_lock(&cpufreq_lock); | ||
245 | freqs.old = policy->cur; | ||
246 | |||
247 | cur_pstate = __raw_readl(dvfs_info->base + XMU_P_STATUS); | ||
248 | if (cur_pstate >> C0_3_PSTATE_VALID_SHIFT & 0x1) | ||
249 | index = (cur_pstate >> C0_3_PSTATE_CURR_SHIFT) & P_VALUE_MASK; | ||
250 | else | ||
251 | index = (cur_pstate >> C0_3_PSTATE_NEW_SHIFT) & P_VALUE_MASK; | ||
252 | |||
253 | if (likely(index < dvfs_info->freq_count)) { | ||
254 | freqs.new = freq_table[index].frequency; | ||
255 | } else { | ||
256 | dev_crit(dvfs_info->dev, "New frequency out of range\n"); | ||
257 | freqs.new = freqs.old; | ||
258 | } | ||
259 | cpufreq_freq_transition_end(policy, &freqs, 0); | ||
260 | |||
261 | cpufreq_cpu_put(policy); | ||
262 | mutex_unlock(&cpufreq_lock); | ||
263 | skip_work: | ||
264 | enable_irq(dvfs_info->irq); | ||
265 | } | ||
266 | |||
267 | static irqreturn_t exynos_cpufreq_irq(int irq, void *id) | ||
268 | { | ||
269 | unsigned int tmp; | ||
270 | |||
271 | tmp = __raw_readl(dvfs_info->base + XMU_PMUIRQ); | ||
272 | if (tmp >> PSTATE_CHANGED_SHIFT & 0x1) { | ||
273 | __raw_writel(tmp, dvfs_info->base + XMU_PMUIRQ); | ||
274 | disable_irq_nosync(irq); | ||
275 | schedule_work(&dvfs_info->irq_work); | ||
276 | } | ||
277 | return IRQ_HANDLED; | ||
278 | } | ||
279 | |||
280 | static void exynos_sort_descend_freq_table(void) | ||
281 | { | ||
282 | struct cpufreq_frequency_table *freq_tbl = dvfs_info->freq_table; | ||
283 | int i = 0, index; | ||
284 | unsigned int tmp_freq; | ||
285 | /* | ||
286 | * Exynos5440 clock controller state logic expects the cpufreq table to | ||
287 | * be in descending order. But the OPP library constructs the table in | ||
288 | * ascending order. So to make the table descending we just need to | ||
289 | * swap the i element with the N - i element. | ||
290 | */ | ||
291 | for (i = 0; i < dvfs_info->freq_count / 2; i++) { | ||
292 | index = dvfs_info->freq_count - i - 1; | ||
293 | tmp_freq = freq_tbl[i].frequency; | ||
294 | freq_tbl[i].frequency = freq_tbl[index].frequency; | ||
295 | freq_tbl[index].frequency = tmp_freq; | ||
296 | } | ||
297 | } | ||
298 | |||
299 | static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) | ||
300 | { | ||
301 | policy->clk = dvfs_info->cpu_clk; | ||
302 | return cpufreq_generic_init(policy, dvfs_info->freq_table, | ||
303 | dvfs_info->latency); | ||
304 | } | ||
305 | |||
306 | static struct cpufreq_driver exynos_driver = { | ||
307 | .flags = CPUFREQ_STICKY | CPUFREQ_ASYNC_NOTIFICATION | | ||
308 | CPUFREQ_NEED_INITIAL_FREQ_CHECK, | ||
309 | .verify = cpufreq_generic_frequency_table_verify, | ||
310 | .target_index = exynos_target, | ||
311 | .get = cpufreq_generic_get, | ||
312 | .init = exynos_cpufreq_cpu_init, | ||
313 | .name = CPUFREQ_NAME, | ||
314 | .attr = cpufreq_generic_attr, | ||
315 | }; | ||
316 | |||
317 | static const struct of_device_id exynos_cpufreq_match[] = { | ||
318 | { | ||
319 | .compatible = "samsung,exynos5440-cpufreq", | ||
320 | }, | ||
321 | {}, | ||
322 | }; | ||
323 | MODULE_DEVICE_TABLE(of, exynos_cpufreq_match); | ||
324 | |||
325 | static int exynos_cpufreq_probe(struct platform_device *pdev) | ||
326 | { | ||
327 | int ret = -EINVAL; | ||
328 | struct device_node *np; | ||
329 | struct resource res; | ||
330 | unsigned int cur_frequency; | ||
331 | |||
332 | np = pdev->dev.of_node; | ||
333 | if (!np) | ||
334 | return -ENODEV; | ||
335 | |||
336 | dvfs_info = devm_kzalloc(&pdev->dev, sizeof(*dvfs_info), GFP_KERNEL); | ||
337 | if (!dvfs_info) { | ||
338 | ret = -ENOMEM; | ||
339 | goto err_put_node; | ||
340 | } | ||
341 | |||
342 | dvfs_info->dev = &pdev->dev; | ||
343 | |||
344 | ret = of_address_to_resource(np, 0, &res); | ||
345 | if (ret) | ||
346 | goto err_put_node; | ||
347 | |||
348 | dvfs_info->base = devm_ioremap_resource(dvfs_info->dev, &res); | ||
349 | if (IS_ERR(dvfs_info->base)) { | ||
350 | ret = PTR_ERR(dvfs_info->base); | ||
351 | goto err_put_node; | ||
352 | } | ||
353 | |||
354 | dvfs_info->irq = irq_of_parse_and_map(np, 0); | ||
355 | if (!dvfs_info->irq) { | ||
356 | dev_err(dvfs_info->dev, "No cpufreq irq found\n"); | ||
357 | ret = -ENODEV; | ||
358 | goto err_put_node; | ||
359 | } | ||
360 | |||
361 | ret = dev_pm_opp_of_add_table(dvfs_info->dev); | ||
362 | if (ret) { | ||
363 | dev_err(dvfs_info->dev, "failed to init OPP table: %d\n", ret); | ||
364 | goto err_put_node; | ||
365 | } | ||
366 | |||
367 | ret = dev_pm_opp_init_cpufreq_table(dvfs_info->dev, | ||
368 | &dvfs_info->freq_table); | ||
369 | if (ret) { | ||
370 | dev_err(dvfs_info->dev, | ||
371 | "failed to init cpufreq table: %d\n", ret); | ||
372 | goto err_free_opp; | ||
373 | } | ||
374 | dvfs_info->freq_count = dev_pm_opp_get_opp_count(dvfs_info->dev); | ||
375 | exynos_sort_descend_freq_table(); | ||
376 | |||
377 | if (of_property_read_u32(np, "clock-latency", &dvfs_info->latency)) | ||
378 | dvfs_info->latency = DEF_TRANS_LATENCY; | ||
379 | |||
380 | dvfs_info->cpu_clk = devm_clk_get(dvfs_info->dev, "armclk"); | ||
381 | if (IS_ERR(dvfs_info->cpu_clk)) { | ||
382 | dev_err(dvfs_info->dev, "Failed to get cpu clock\n"); | ||
383 | ret = PTR_ERR(dvfs_info->cpu_clk); | ||
384 | goto err_free_table; | ||
385 | } | ||
386 | |||
387 | cur_frequency = clk_get_rate(dvfs_info->cpu_clk); | ||
388 | if (!cur_frequency) { | ||
389 | dev_err(dvfs_info->dev, "Failed to get clock rate\n"); | ||
390 | ret = -EINVAL; | ||
391 | goto err_free_table; | ||
392 | } | ||
393 | cur_frequency /= 1000; | ||
394 | |||
395 | INIT_WORK(&dvfs_info->irq_work, exynos_cpufreq_work); | ||
396 | ret = devm_request_irq(dvfs_info->dev, dvfs_info->irq, | ||
397 | exynos_cpufreq_irq, IRQF_TRIGGER_NONE, | ||
398 | CPUFREQ_NAME, dvfs_info); | ||
399 | if (ret) { | ||
400 | dev_err(dvfs_info->dev, "Failed to register IRQ\n"); | ||
401 | goto err_free_table; | ||
402 | } | ||
403 | |||
404 | ret = init_div_table(); | ||
405 | if (ret) { | ||
406 | dev_err(dvfs_info->dev, "Failed to initialise div table\n"); | ||
407 | goto err_free_table; | ||
408 | } | ||
409 | |||
410 | exynos_enable_dvfs(cur_frequency); | ||
411 | ret = cpufreq_register_driver(&exynos_driver); | ||
412 | if (ret) { | ||
413 | dev_err(dvfs_info->dev, | ||
414 | "%s: failed to register cpufreq driver\n", __func__); | ||
415 | goto err_free_table; | ||
416 | } | ||
417 | |||
418 | of_node_put(np); | ||
419 | dvfs_info->dvfs_enabled = true; | ||
420 | return 0; | ||
421 | |||
422 | err_free_table: | ||
423 | dev_pm_opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table); | ||
424 | err_free_opp: | ||
425 | dev_pm_opp_of_remove_table(dvfs_info->dev); | ||
426 | err_put_node: | ||
427 | of_node_put(np); | ||
428 | dev_err(&pdev->dev, "%s: failed initialization\n", __func__); | ||
429 | return ret; | ||
430 | } | ||
431 | |||
432 | static int exynos_cpufreq_remove(struct platform_device *pdev) | ||
433 | { | ||
434 | cpufreq_unregister_driver(&exynos_driver); | ||
435 | dev_pm_opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table); | ||
436 | dev_pm_opp_of_remove_table(dvfs_info->dev); | ||
437 | return 0; | ||
438 | } | ||
439 | |||
440 | static struct platform_driver exynos_cpufreq_platdrv = { | ||
441 | .driver = { | ||
442 | .name = "exynos5440-cpufreq", | ||
443 | .of_match_table = exynos_cpufreq_match, | ||
444 | }, | ||
445 | .probe = exynos_cpufreq_probe, | ||
446 | .remove = exynos_cpufreq_remove, | ||
447 | }; | ||
448 | module_platform_driver(exynos_cpufreq_platdrv); | ||
449 | |||
450 | MODULE_AUTHOR("Amit Daniel Kachhap <amit.daniel@samsung.com>"); | ||
451 | MODULE_DESCRIPTION("Exynos5440 cpufreq driver"); | ||
452 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/crypto/caam/sg_sw_qm2.h b/drivers/crypto/caam/sg_sw_qm2.h index 31b440757146..b5b4c12179df 100644 --- a/drivers/crypto/caam/sg_sw_qm2.h +++ b/drivers/crypto/caam/sg_sw_qm2.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #ifndef _SG_SW_QM2_H_ | 35 | #ifndef _SG_SW_QM2_H_ |
36 | #define _SG_SW_QM2_H_ | 36 | #define _SG_SW_QM2_H_ |
37 | 37 | ||
38 | #include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h" | 38 | #include <soc/fsl/dpaa2-fd.h> |
39 | 39 | ||
40 | static inline void dma_to_qm_sg_one(struct dpaa2_sg_entry *qm_sg_ptr, | 40 | static inline void dma_to_qm_sg_one(struct dpaa2_sg_entry *qm_sg_ptr, |
41 | dma_addr_t dma, u32 len, u16 offset) | 41 | dma_addr_t dma, u32 len, u16 offset) |
diff --git a/drivers/crypto/caam/sg_sw_sec4.h b/drivers/crypto/caam/sg_sw_sec4.h index e586ffab8358..dbfa9fce33e0 100644 --- a/drivers/crypto/caam/sg_sw_sec4.h +++ b/drivers/crypto/caam/sg_sw_sec4.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include "ctrl.h" | 12 | #include "ctrl.h" |
13 | #include "regs.h" | 13 | #include "regs.h" |
14 | #include "sg_sw_qm2.h" | 14 | #include "sg_sw_qm2.h" |
15 | #include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h" | 15 | #include <soc/fsl/dpaa2-fd.h> |
16 | 16 | ||
17 | struct sec4_sg_entry { | 17 | struct sec4_sg_entry { |
18 | u64 ptr; | 18 | u64 ptr; |
diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 2a219b1261b1..721e6c57beae 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c | |||
@@ -363,8 +363,6 @@ static int scmi_dvfs_device_opps_add(const struct scmi_handle *handle, | |||
363 | return domain; | 363 | return domain; |
364 | 364 | ||
365 | dom = pi->dom_info + domain; | 365 | dom = pi->dom_info + domain; |
366 | if (!dom) | ||
367 | return -EIO; | ||
368 | 366 | ||
369 | for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { | 367 | for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { |
370 | freq = opp->perf * dom->mult_factor; | 368 | freq = opp->perf * dom->mult_factor; |
@@ -394,9 +392,6 @@ static int scmi_dvfs_transition_latency_get(const struct scmi_handle *handle, | |||
394 | return domain; | 392 | return domain; |
395 | 393 | ||
396 | dom = pi->dom_info + domain; | 394 | dom = pi->dom_info + domain; |
397 | if (!dom) | ||
398 | return -EIO; | ||
399 | |||
400 | /* uS to nS */ | 395 | /* uS to nS */ |
401 | return dom->opp[dom->opp_count - 1].trans_latency_us * 1000; | 396 | return dom->opp[dom->opp_count - 1].trans_latency_us * 1000; |
402 | } | 397 | } |
diff --git a/drivers/firmware/psci_checker.c b/drivers/firmware/psci_checker.c index bb1c068bff19..346943657962 100644 --- a/drivers/firmware/psci_checker.c +++ b/drivers/firmware/psci_checker.c | |||
@@ -77,28 +77,6 @@ static int psci_ops_check(void) | |||
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |
79 | 79 | ||
80 | static int find_cpu_groups(const struct cpumask *cpus, | ||
81 | const struct cpumask **cpu_groups) | ||
82 | { | ||
83 | unsigned int nb = 0; | ||
84 | cpumask_var_t tmp; | ||
85 | |||
86 | if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) | ||
87 | return -ENOMEM; | ||
88 | cpumask_copy(tmp, cpus); | ||
89 | |||
90 | while (!cpumask_empty(tmp)) { | ||
91 | const struct cpumask *cpu_group = | ||
92 | topology_core_cpumask(cpumask_any(tmp)); | ||
93 | |||
94 | cpu_groups[nb++] = cpu_group; | ||
95 | cpumask_andnot(tmp, tmp, cpu_group); | ||
96 | } | ||
97 | |||
98 | free_cpumask_var(tmp); | ||
99 | return nb; | ||
100 | } | ||
101 | |||
102 | /* | 80 | /* |
103 | * offlined_cpus is a temporary array but passing it as an argument avoids | 81 | * offlined_cpus is a temporary array but passing it as an argument avoids |
104 | * multiple allocations. | 82 | * multiple allocations. |
@@ -166,29 +144,66 @@ static unsigned int down_and_up_cpus(const struct cpumask *cpus, | |||
166 | return err; | 144 | return err; |
167 | } | 145 | } |
168 | 146 | ||
147 | static void free_cpu_groups(int num, cpumask_var_t **pcpu_groups) | ||
148 | { | ||
149 | int i; | ||
150 | cpumask_var_t *cpu_groups = *pcpu_groups; | ||
151 | |||
152 | for (i = 0; i < num; ++i) | ||
153 | free_cpumask_var(cpu_groups[i]); | ||
154 | kfree(cpu_groups); | ||
155 | } | ||
156 | |||
157 | static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) | ||
158 | { | ||
159 | int num_groups = 0; | ||
160 | cpumask_var_t tmp, *cpu_groups; | ||
161 | |||
162 | if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) | ||
163 | return -ENOMEM; | ||
164 | |||
165 | cpu_groups = kcalloc(nb_available_cpus, sizeof(cpu_groups), | ||
166 | GFP_KERNEL); | ||
167 | if (!cpu_groups) | ||
168 | return -ENOMEM; | ||
169 | |||
170 | cpumask_copy(tmp, cpu_online_mask); | ||
171 | |||
172 | while (!cpumask_empty(tmp)) { | ||
173 | const struct cpumask *cpu_group = | ||
174 | topology_core_cpumask(cpumask_any(tmp)); | ||
175 | |||
176 | if (!alloc_cpumask_var(&cpu_groups[num_groups], GFP_KERNEL)) { | ||
177 | free_cpu_groups(num_groups, &cpu_groups); | ||
178 | return -ENOMEM; | ||
179 | } | ||
180 | cpumask_copy(cpu_groups[num_groups++], cpu_group); | ||
181 | cpumask_andnot(tmp, tmp, cpu_group); | ||
182 | } | ||
183 | |||
184 | free_cpumask_var(tmp); | ||
185 | *pcpu_groups = cpu_groups; | ||
186 | |||
187 | return num_groups; | ||
188 | } | ||
189 | |||
169 | static int hotplug_tests(void) | 190 | static int hotplug_tests(void) |
170 | { | 191 | { |
171 | int err; | 192 | int i, nb_cpu_group, err = -ENOMEM; |
172 | cpumask_var_t offlined_cpus; | 193 | cpumask_var_t offlined_cpus, *cpu_groups; |
173 | int i, nb_cpu_group; | ||
174 | const struct cpumask **cpu_groups; | ||
175 | char *page_buf; | 194 | char *page_buf; |
176 | 195 | ||
177 | err = -ENOMEM; | ||
178 | if (!alloc_cpumask_var(&offlined_cpus, GFP_KERNEL)) | 196 | if (!alloc_cpumask_var(&offlined_cpus, GFP_KERNEL)) |
179 | return err; | 197 | return err; |
180 | /* We may have up to nb_available_cpus cpu_groups. */ | 198 | |
181 | cpu_groups = kmalloc_array(nb_available_cpus, sizeof(*cpu_groups), | 199 | nb_cpu_group = alloc_init_cpu_groups(&cpu_groups); |
182 | GFP_KERNEL); | 200 | if (nb_cpu_group < 0) |
183 | if (!cpu_groups) | ||
184 | goto out_free_cpus; | 201 | goto out_free_cpus; |
185 | page_buf = (char *)__get_free_page(GFP_KERNEL); | 202 | page_buf = (char *)__get_free_page(GFP_KERNEL); |
186 | if (!page_buf) | 203 | if (!page_buf) |
187 | goto out_free_cpu_groups; | 204 | goto out_free_cpu_groups; |
188 | 205 | ||
189 | err = 0; | 206 | err = 0; |
190 | nb_cpu_group = find_cpu_groups(cpu_online_mask, cpu_groups); | ||
191 | |||
192 | /* | 207 | /* |
193 | * Of course the last CPU cannot be powered down and cpu_down() should | 208 | * Of course the last CPU cannot be powered down and cpu_down() should |
194 | * refuse doing that. | 209 | * refuse doing that. |
@@ -212,7 +227,7 @@ static int hotplug_tests(void) | |||
212 | 227 | ||
213 | free_page((unsigned long)page_buf); | 228 | free_page((unsigned long)page_buf); |
214 | out_free_cpu_groups: | 229 | out_free_cpu_groups: |
215 | kfree(cpu_groups); | 230 | free_cpu_groups(nb_cpu_group, &cpu_groups); |
216 | out_free_cpus: | 231 | out_free_cpus: |
217 | free_cpumask_var(offlined_cpus); | 232 | free_cpumask_var(offlined_cpus); |
218 | return err; | 233 | return err; |
diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c index 6692888f04cf..a200a2174611 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c | |||
@@ -21,6 +21,10 @@ | |||
21 | #define MBOX_DATA28(msg) ((msg) & ~0xf) | 21 | #define MBOX_DATA28(msg) ((msg) & ~0xf) |
22 | #define MBOX_CHAN_PROPERTY 8 | 22 | #define MBOX_CHAN_PROPERTY 8 |
23 | 23 | ||
24 | #define MAX_RPI_FW_PROP_BUF_SIZE 32 | ||
25 | |||
26 | static struct platform_device *rpi_hwmon; | ||
27 | |||
24 | struct rpi_firmware { | 28 | struct rpi_firmware { |
25 | struct mbox_client cl; | 29 | struct mbox_client cl; |
26 | struct mbox_chan *chan; /* The property channel. */ | 30 | struct mbox_chan *chan; /* The property channel. */ |
@@ -143,18 +147,22 @@ int rpi_firmware_property(struct rpi_firmware *fw, | |||
143 | /* Single tags are very small (generally 8 bytes), so the | 147 | /* Single tags are very small (generally 8 bytes), so the |
144 | * stack should be safe. | 148 | * stack should be safe. |
145 | */ | 149 | */ |
146 | u8 data[buf_size + sizeof(struct rpi_firmware_property_tag_header)]; | 150 | u8 data[sizeof(struct rpi_firmware_property_tag_header) + |
151 | MAX_RPI_FW_PROP_BUF_SIZE]; | ||
147 | struct rpi_firmware_property_tag_header *header = | 152 | struct rpi_firmware_property_tag_header *header = |
148 | (struct rpi_firmware_property_tag_header *)data; | 153 | (struct rpi_firmware_property_tag_header *)data; |
149 | int ret; | 154 | int ret; |
150 | 155 | ||
156 | if (WARN_ON(buf_size > sizeof(data) - sizeof(*header))) | ||
157 | return -EINVAL; | ||
158 | |||
151 | header->tag = tag; | 159 | header->tag = tag; |
152 | header->buf_size = buf_size; | 160 | header->buf_size = buf_size; |
153 | header->req_resp_size = 0; | 161 | header->req_resp_size = 0; |
154 | memcpy(data + sizeof(struct rpi_firmware_property_tag_header), | 162 | memcpy(data + sizeof(struct rpi_firmware_property_tag_header), |
155 | tag_data, buf_size); | 163 | tag_data, buf_size); |
156 | 164 | ||
157 | ret = rpi_firmware_property_list(fw, &data, sizeof(data)); | 165 | ret = rpi_firmware_property_list(fw, &data, buf_size + sizeof(*header)); |
158 | memcpy(tag_data, | 166 | memcpy(tag_data, |
159 | data + sizeof(struct rpi_firmware_property_tag_header), | 167 | data + sizeof(struct rpi_firmware_property_tag_header), |
160 | buf_size); | 168 | buf_size); |
@@ -183,6 +191,20 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw) | |||
183 | } | 191 | } |
184 | } | 192 | } |
185 | 193 | ||
194 | static void | ||
195 | rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw) | ||
196 | { | ||
197 | u32 packet; | ||
198 | int ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_THROTTLED, | ||
199 | &packet, sizeof(packet)); | ||
200 | |||
201 | if (ret) | ||
202 | return; | ||
203 | |||
204 | rpi_hwmon = platform_device_register_data(dev, "raspberrypi-hwmon", | ||
205 | -1, NULL, 0); | ||
206 | } | ||
207 | |||
186 | static int rpi_firmware_probe(struct platform_device *pdev) | 208 | static int rpi_firmware_probe(struct platform_device *pdev) |
187 | { | 209 | { |
188 | struct device *dev = &pdev->dev; | 210 | struct device *dev = &pdev->dev; |
@@ -209,6 +231,7 @@ static int rpi_firmware_probe(struct platform_device *pdev) | |||
209 | platform_set_drvdata(pdev, fw); | 231 | platform_set_drvdata(pdev, fw); |
210 | 232 | ||
211 | rpi_firmware_print_firmware_revision(fw); | 233 | rpi_firmware_print_firmware_revision(fw); |
234 | rpi_register_hwmon_driver(dev, fw); | ||
212 | 235 | ||
213 | return 0; | 236 | return 0; |
214 | } | 237 | } |
@@ -217,6 +240,8 @@ static int rpi_firmware_remove(struct platform_device *pdev) | |||
217 | { | 240 | { |
218 | struct rpi_firmware *fw = platform_get_drvdata(pdev); | 241 | struct rpi_firmware *fw = platform_get_drvdata(pdev); |
219 | 242 | ||
243 | platform_device_unregister(rpi_hwmon); | ||
244 | rpi_hwmon = NULL; | ||
220 | mbox_free_channel(fw->chan); | 245 | mbox_free_channel(fw->chan); |
221 | 246 | ||
222 | return 0; | 247 | return 0; |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index ccf42663a908..81da17a42dc9 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -1320,6 +1320,16 @@ config SENSORS_PWM_FAN | |||
1320 | This driver can also be built as a module. If so, the module | 1320 | This driver can also be built as a module. If so, the module |
1321 | will be called pwm-fan. | 1321 | will be called pwm-fan. |
1322 | 1322 | ||
1323 | config SENSORS_RASPBERRYPI_HWMON | ||
1324 | tristate "Raspberry Pi voltage monitor" | ||
1325 | depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE) | ||
1326 | help | ||
1327 | If you say yes here you get support for voltage sensor on the | ||
1328 | Raspberry Pi. | ||
1329 | |||
1330 | This driver can also be built as a module. If so, the module | ||
1331 | will be called raspberrypi-hwmon. | ||
1332 | |||
1323 | config SENSORS_SHT15 | 1333 | config SENSORS_SHT15 |
1324 | tristate "Sensiron humidity and temperature sensors. SHT15 and compat." | 1334 | tristate "Sensiron humidity and temperature sensors. SHT15 and compat." |
1325 | depends on GPIOLIB || COMPILE_TEST | 1335 | depends on GPIOLIB || COMPILE_TEST |
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile index 842c92f83ce6..93f7f41ea4ad 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile | |||
@@ -143,6 +143,7 @@ obj-$(CONFIG_SENSORS_PC87427) += pc87427.o | |||
143 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o | 143 | obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o |
144 | obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o | 144 | obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o |
145 | obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o | 145 | obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o |
146 | obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o | ||
146 | obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o | 147 | obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o |
147 | obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o | 148 | obj-$(CONFIG_SENSORS_SCH56XX_COMMON)+= sch56xx-common.o |
148 | obj-$(CONFIG_SENSORS_SCH5627) += sch5627.o | 149 | obj-$(CONFIG_SENSORS_SCH5627) += sch5627.o |
diff --git a/drivers/hwmon/raspberrypi-hwmon.c b/drivers/hwmon/raspberrypi-hwmon.c new file mode 100644 index 000000000000..fb4e4a6bb1f6 --- /dev/null +++ b/drivers/hwmon/raspberrypi-hwmon.c | |||
@@ -0,0 +1,166 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
2 | /* | ||
3 | * Raspberry Pi voltage sensor driver | ||
4 | * | ||
5 | * Based on firmware/raspberrypi.c by Noralf Trønnes | ||
6 | * | ||
7 | * Copyright (C) 2018 Stefan Wahren <stefan.wahren@i2se.com> | ||
8 | */ | ||
9 | #include <linux/device.h> | ||
10 | #include <linux/err.h> | ||
11 | #include <linux/hwmon.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/slab.h> | ||
15 | #include <linux/workqueue.h> | ||
16 | #include <soc/bcm2835/raspberrypi-firmware.h> | ||
17 | |||
18 | #define UNDERVOLTAGE_STICKY_BIT BIT(16) | ||
19 | |||
20 | struct rpi_hwmon_data { | ||
21 | struct device *hwmon_dev; | ||
22 | struct rpi_firmware *fw; | ||
23 | u32 last_throttled; | ||
24 | struct delayed_work get_values_poll_work; | ||
25 | }; | ||
26 | |||
27 | static void rpi_firmware_get_throttled(struct rpi_hwmon_data *data) | ||
28 | { | ||
29 | u32 new_uv, old_uv, value; | ||
30 | int ret; | ||
31 | |||
32 | /* Request firmware to clear sticky bits */ | ||
33 | value = 0xffff; | ||
34 | |||
35 | ret = rpi_firmware_property(data->fw, RPI_FIRMWARE_GET_THROTTLED, | ||
36 | &value, sizeof(value)); | ||
37 | if (ret) { | ||
38 | dev_err_once(data->hwmon_dev, "Failed to get throttled (%d)\n", | ||
39 | ret); | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | new_uv = value & UNDERVOLTAGE_STICKY_BIT; | ||
44 | old_uv = data->last_throttled & UNDERVOLTAGE_STICKY_BIT; | ||
45 | data->last_throttled = value; | ||
46 | |||
47 | if (new_uv == old_uv) | ||
48 | return; | ||
49 | |||
50 | if (new_uv) | ||
51 | dev_crit(data->hwmon_dev, "Undervoltage detected!\n"); | ||
52 | else | ||
53 | dev_info(data->hwmon_dev, "Voltage normalised\n"); | ||
54 | |||
55 | sysfs_notify(&data->hwmon_dev->kobj, NULL, "in0_lcrit_alarm"); | ||
56 | } | ||
57 | |||
58 | static void get_values_poll(struct work_struct *work) | ||
59 | { | ||
60 | struct rpi_hwmon_data *data; | ||
61 | |||
62 | data = container_of(work, struct rpi_hwmon_data, | ||
63 | get_values_poll_work.work); | ||
64 | |||
65 | rpi_firmware_get_throttled(data); | ||
66 | |||
67 | /* | ||
68 | * We can't run faster than the sticky shift (100ms) since we get | ||
69 | * flipping in the sticky bits that are cleared. | ||
70 | */ | ||
71 | schedule_delayed_work(&data->get_values_poll_work, 2 * HZ); | ||
72 | } | ||
73 | |||
74 | static int rpi_read(struct device *dev, enum hwmon_sensor_types type, | ||
75 | u32 attr, int channel, long *val) | ||
76 | { | ||
77 | struct rpi_hwmon_data *data = dev_get_drvdata(dev); | ||
78 | |||
79 | *val = !!(data->last_throttled & UNDERVOLTAGE_STICKY_BIT); | ||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | static umode_t rpi_is_visible(const void *_data, enum hwmon_sensor_types type, | ||
84 | u32 attr, int channel) | ||
85 | { | ||
86 | return 0444; | ||
87 | } | ||
88 | |||
89 | static const u32 rpi_in_config[] = { | ||
90 | HWMON_I_LCRIT_ALARM, | ||
91 | 0 | ||
92 | }; | ||
93 | |||
94 | static const struct hwmon_channel_info rpi_in = { | ||
95 | .type = hwmon_in, | ||
96 | .config = rpi_in_config, | ||
97 | }; | ||
98 | |||
99 | static const struct hwmon_channel_info *rpi_info[] = { | ||
100 | &rpi_in, | ||
101 | NULL | ||
102 | }; | ||
103 | |||
104 | static const struct hwmon_ops rpi_hwmon_ops = { | ||
105 | .is_visible = rpi_is_visible, | ||
106 | .read = rpi_read, | ||
107 | }; | ||
108 | |||
109 | static const struct hwmon_chip_info rpi_chip_info = { | ||
110 | .ops = &rpi_hwmon_ops, | ||
111 | .info = rpi_info, | ||
112 | }; | ||
113 | |||
114 | static int rpi_hwmon_probe(struct platform_device *pdev) | ||
115 | { | ||
116 | struct device *dev = &pdev->dev; | ||
117 | struct rpi_hwmon_data *data; | ||
118 | int ret; | ||
119 | |||
120 | data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); | ||
121 | if (!data) | ||
122 | return -ENOMEM; | ||
123 | |||
124 | /* Parent driver assure that firmware is correct */ | ||
125 | data->fw = dev_get_drvdata(dev->parent); | ||
126 | |||
127 | /* Init throttled */ | ||
128 | ret = rpi_firmware_property(data->fw, RPI_FIRMWARE_GET_THROTTLED, | ||
129 | &data->last_throttled, | ||
130 | sizeof(data->last_throttled)); | ||
131 | |||
132 | data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "rpi_volt", | ||
133 | data, | ||
134 | &rpi_chip_info, | ||
135 | NULL); | ||
136 | |||
137 | INIT_DELAYED_WORK(&data->get_values_poll_work, get_values_poll); | ||
138 | platform_set_drvdata(pdev, data); | ||
139 | |||
140 | if (!PTR_ERR_OR_ZERO(data->hwmon_dev)) | ||
141 | schedule_delayed_work(&data->get_values_poll_work, 2 * HZ); | ||
142 | |||
143 | return PTR_ERR_OR_ZERO(data->hwmon_dev); | ||
144 | } | ||
145 | |||
146 | static int rpi_hwmon_remove(struct platform_device *pdev) | ||
147 | { | ||
148 | struct rpi_hwmon_data *data = platform_get_drvdata(pdev); | ||
149 | |||
150 | cancel_delayed_work_sync(&data->get_values_poll_work); | ||
151 | |||
152 | return 0; | ||
153 | } | ||
154 | |||
155 | static struct platform_driver rpi_hwmon_driver = { | ||
156 | .probe = rpi_hwmon_probe, | ||
157 | .remove = rpi_hwmon_remove, | ||
158 | .driver = { | ||
159 | .name = "raspberrypi-hwmon", | ||
160 | }, | ||
161 | }; | ||
162 | module_platform_driver(rpi_hwmon_driver); | ||
163 | |||
164 | MODULE_AUTHOR("Stefan Wahren <stefan.wahren@i2se.com>"); | ||
165 | MODULE_DESCRIPTION("Raspberry Pi voltage sensor driver"); | ||
166 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c index bb93cc53554e..bd25faf6d13d 100644 --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c | |||
@@ -672,13 +672,6 @@ static int tegra_mc_probe(struct platform_device *pdev) | |||
672 | return err; | 672 | return err; |
673 | } | 673 | } |
674 | 674 | ||
675 | err = tegra_mc_reset_setup(mc); | ||
676 | if (err < 0) { | ||
677 | dev_err(&pdev->dev, "failed to register reset controller: %d\n", | ||
678 | err); | ||
679 | return err; | ||
680 | } | ||
681 | |||
682 | mc->irq = platform_get_irq(pdev, 0); | 675 | mc->irq = platform_get_irq(pdev, 0); |
683 | if (mc->irq < 0) { | 676 | if (mc->irq < 0) { |
684 | dev_err(&pdev->dev, "interrupt not specified\n"); | 677 | dev_err(&pdev->dev, "interrupt not specified\n"); |
@@ -697,13 +690,16 @@ static int tegra_mc_probe(struct platform_device *pdev) | |||
697 | return err; | 690 | return err; |
698 | } | 691 | } |
699 | 692 | ||
693 | err = tegra_mc_reset_setup(mc); | ||
694 | if (err < 0) | ||
695 | dev_err(&pdev->dev, "failed to register reset controller: %d\n", | ||
696 | err); | ||
697 | |||
700 | if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) { | 698 | if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) { |
701 | mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc); | 699 | mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc); |
702 | if (IS_ERR(mc->smmu)) { | 700 | if (IS_ERR(mc->smmu)) |
703 | dev_err(&pdev->dev, "failed to probe SMMU: %ld\n", | 701 | dev_err(&pdev->dev, "failed to probe SMMU: %ld\n", |
704 | PTR_ERR(mc->smmu)); | 702 | PTR_ERR(mc->smmu)); |
705 | return PTR_ERR(mc->smmu); | ||
706 | } | ||
707 | } | 703 | } |
708 | 704 | ||
709 | return 0; | 705 | return 0; |
diff --git a/drivers/memory/ti-emif-pm.c b/drivers/memory/ti-emif-pm.c index 632651f4b6e8..2250d03ea17f 100644 --- a/drivers/memory/ti-emif-pm.c +++ b/drivers/memory/ti-emif-pm.c | |||
@@ -249,6 +249,34 @@ static const struct of_device_id ti_emif_of_match[] = { | |||
249 | }; | 249 | }; |
250 | MODULE_DEVICE_TABLE(of, ti_emif_of_match); | 250 | MODULE_DEVICE_TABLE(of, ti_emif_of_match); |
251 | 251 | ||
252 | #ifdef CONFIG_PM_SLEEP | ||
253 | static int ti_emif_resume(struct device *dev) | ||
254 | { | ||
255 | unsigned long tmp = | ||
256 | __raw_readl((void *)emif_instance->ti_emif_sram_virt); | ||
257 | |||
258 | /* | ||
259 | * Check to see if what we are copying is already present in the | ||
260 | * first byte at the destination, only copy if it is not which | ||
261 | * indicates we have lost context and sram no longer contains | ||
262 | * the PM code | ||
263 | */ | ||
264 | if (tmp != ti_emif_sram) | ||
265 | ti_emif_push_sram(dev, emif_instance); | ||
266 | |||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static int ti_emif_suspend(struct device *dev) | ||
271 | { | ||
272 | /* | ||
273 | * The contents will be present in DDR hence no need to | ||
274 | * explicitly save | ||
275 | */ | ||
276 | return 0; | ||
277 | } | ||
278 | #endif /* CONFIG_PM_SLEEP */ | ||
279 | |||
252 | static int ti_emif_probe(struct platform_device *pdev) | 280 | static int ti_emif_probe(struct platform_device *pdev) |
253 | { | 281 | { |
254 | int ret; | 282 | int ret; |
@@ -308,12 +336,17 @@ static int ti_emif_remove(struct platform_device *pdev) | |||
308 | return 0; | 336 | return 0; |
309 | } | 337 | } |
310 | 338 | ||
339 | static const struct dev_pm_ops ti_emif_pm_ops = { | ||
340 | SET_SYSTEM_SLEEP_PM_OPS(ti_emif_suspend, ti_emif_resume) | ||
341 | }; | ||
342 | |||
311 | static struct platform_driver ti_emif_driver = { | 343 | static struct platform_driver ti_emif_driver = { |
312 | .probe = ti_emif_probe, | 344 | .probe = ti_emif_probe, |
313 | .remove = ti_emif_remove, | 345 | .remove = ti_emif_remove, |
314 | .driver = { | 346 | .driver = { |
315 | .name = KBUILD_MODNAME, | 347 | .name = KBUILD_MODNAME, |
316 | .of_match_table = of_match_ptr(ti_emif_of_match), | 348 | .of_match_table = of_match_ptr(ti_emif_of_match), |
349 | .pm = &ti_emif_pm_ops, | ||
317 | }, | 350 | }, |
318 | }; | 351 | }; |
319 | module_platform_driver(ti_emif_driver); | 352 | module_platform_driver(ti_emif_driver); |
diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index c0b292be1b72..a70262cb7e56 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig | |||
@@ -82,6 +82,15 @@ config RESET_PISTACHIO | |||
82 | help | 82 | help |
83 | This enables the reset driver for ImgTec Pistachio SoCs. | 83 | This enables the reset driver for ImgTec Pistachio SoCs. |
84 | 84 | ||
85 | config RESET_QCOM_AOSS | ||
86 | bool "Qcom AOSS Reset Driver" | ||
87 | depends on ARCH_QCOM || COMPILE_TEST | ||
88 | help | ||
89 | This enables the AOSS (always on subsystem) reset driver | ||
90 | for Qualcomm SDM845 SoCs. Say Y if you want to control | ||
91 | reset signals provided by AOSS for Modem, Venus, ADSP, | ||
92 | GPU, Camera, Wireless, Display subsystem. Otherwise, say N. | ||
93 | |||
85 | config RESET_SIMPLE | 94 | config RESET_SIMPLE |
86 | bool "Simple Reset Controller Driver" if COMPILE_TEST | 95 | bool "Simple Reset Controller Driver" if COMPILE_TEST |
87 | default ARCH_SOCFPGA || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARCH_ASPEED | 96 | default ARCH_SOCFPGA || ARCH_STM32 || ARCH_STRATIX10 || ARCH_SUNXI || ARCH_ZX || ARCH_ASPEED |
@@ -138,6 +147,16 @@ config RESET_UNIPHIER | |||
138 | Say Y if you want to control reset signals provided by System Control | 147 | Say Y if you want to control reset signals provided by System Control |
139 | block, Media I/O block, Peripheral Block. | 148 | block, Media I/O block, Peripheral Block. |
140 | 149 | ||
150 | config RESET_UNIPHIER_USB3 | ||
151 | tristate "USB3 reset driver for UniPhier SoCs" | ||
152 | depends on (ARCH_UNIPHIER || COMPILE_TEST) && OF | ||
153 | default ARCH_UNIPHIER | ||
154 | select RESET_SIMPLE | ||
155 | help | ||
156 | Support for the USB3 core reset on UniPhier SoCs. | ||
157 | Say Y if you want to control reset signals provided by | ||
158 | USB3 glue layer. | ||
159 | |||
141 | config RESET_ZYNQ | 160 | config RESET_ZYNQ |
142 | bool "ZYNQ Reset Driver" if COMPILE_TEST | 161 | bool "ZYNQ Reset Driver" if COMPILE_TEST |
143 | default ARCH_ZYNQ | 162 | default ARCH_ZYNQ |
diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index c1261dcfe9ad..0676b6b1976f 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile | |||
@@ -14,11 +14,13 @@ obj-$(CONFIG_RESET_LPC18XX) += reset-lpc18xx.o | |||
14 | obj-$(CONFIG_RESET_MESON) += reset-meson.o | 14 | obj-$(CONFIG_RESET_MESON) += reset-meson.o |
15 | obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o | 15 | obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o |
16 | obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o | 16 | obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o |
17 | obj-$(CONFIG_RESET_QCOM_AOSS) += reset-qcom-aoss.o | ||
17 | obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o | 18 | obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o |
18 | obj-$(CONFIG_RESET_STM32MP157) += reset-stm32mp1.o | 19 | obj-$(CONFIG_RESET_STM32MP157) += reset-stm32mp1.o |
19 | obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o | 20 | obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o |
20 | obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o | 21 | obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o |
21 | obj-$(CONFIG_RESET_TI_SYSCON) += reset-ti-syscon.o | 22 | obj-$(CONFIG_RESET_TI_SYSCON) += reset-ti-syscon.o |
22 | obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o | 23 | obj-$(CONFIG_RESET_UNIPHIER) += reset-uniphier.o |
24 | obj-$(CONFIG_RESET_UNIPHIER_USB3) += reset-uniphier-usb3.o | ||
23 | obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o | 25 | obj-$(CONFIG_RESET_ZYNQ) += reset-zynq.o |
24 | 26 | ||
diff --git a/drivers/reset/reset-qcom-aoss.c b/drivers/reset/reset-qcom-aoss.c new file mode 100644 index 000000000000..36db96750450 --- /dev/null +++ b/drivers/reset/reset-qcom-aoss.c | |||
@@ -0,0 +1,133 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* | ||
3 | * Copyright (C) 2018 The Linux Foundation. All rights reserved. | ||
4 | */ | ||
5 | |||
6 | #include <linux/module.h> | ||
7 | #include <linux/platform_device.h> | ||
8 | #include <linux/reset-controller.h> | ||
9 | #include <linux/delay.h> | ||
10 | #include <linux/io.h> | ||
11 | #include <linux/of_device.h> | ||
12 | #include <dt-bindings/reset/qcom,sdm845-aoss.h> | ||
13 | |||
14 | struct qcom_aoss_reset_map { | ||
15 | unsigned int reg; | ||
16 | }; | ||
17 | |||
18 | struct qcom_aoss_desc { | ||
19 | const struct qcom_aoss_reset_map *resets; | ||
20 | size_t num_resets; | ||
21 | }; | ||
22 | |||
23 | struct qcom_aoss_reset_data { | ||
24 | struct reset_controller_dev rcdev; | ||
25 | void __iomem *base; | ||
26 | const struct qcom_aoss_desc *desc; | ||
27 | }; | ||
28 | |||
29 | static const struct qcom_aoss_reset_map sdm845_aoss_resets[] = { | ||
30 | [AOSS_CC_MSS_RESTART] = {0x10000}, | ||
31 | [AOSS_CC_CAMSS_RESTART] = {0x11000}, | ||
32 | [AOSS_CC_VENUS_RESTART] = {0x12000}, | ||
33 | [AOSS_CC_GPU_RESTART] = {0x13000}, | ||
34 | [AOSS_CC_DISPSS_RESTART] = {0x14000}, | ||
35 | [AOSS_CC_WCSS_RESTART] = {0x20000}, | ||
36 | [AOSS_CC_LPASS_RESTART] = {0x30000}, | ||
37 | }; | ||
38 | |||
39 | static const struct qcom_aoss_desc sdm845_aoss_desc = { | ||
40 | .resets = sdm845_aoss_resets, | ||
41 | .num_resets = ARRAY_SIZE(sdm845_aoss_resets), | ||
42 | }; | ||
43 | |||
44 | static inline struct qcom_aoss_reset_data *to_qcom_aoss_reset_data( | ||
45 | struct reset_controller_dev *rcdev) | ||
46 | { | ||
47 | return container_of(rcdev, struct qcom_aoss_reset_data, rcdev); | ||
48 | } | ||
49 | |||
50 | static int qcom_aoss_control_assert(struct reset_controller_dev *rcdev, | ||
51 | unsigned long idx) | ||
52 | { | ||
53 | struct qcom_aoss_reset_data *data = to_qcom_aoss_reset_data(rcdev); | ||
54 | const struct qcom_aoss_reset_map *map = &data->desc->resets[idx]; | ||
55 | |||
56 | writel(1, data->base + map->reg); | ||
57 | /* Wait 6 32kHz sleep cycles for reset */ | ||
58 | usleep_range(200, 300); | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | static int qcom_aoss_control_deassert(struct reset_controller_dev *rcdev, | ||
63 | unsigned long idx) | ||
64 | { | ||
65 | struct qcom_aoss_reset_data *data = to_qcom_aoss_reset_data(rcdev); | ||
66 | const struct qcom_aoss_reset_map *map = &data->desc->resets[idx]; | ||
67 | |||
68 | writel(0, data->base + map->reg); | ||
69 | /* Wait 6 32kHz sleep cycles for reset */ | ||
70 | usleep_range(200, 300); | ||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | static int qcom_aoss_control_reset(struct reset_controller_dev *rcdev, | ||
75 | unsigned long idx) | ||
76 | { | ||
77 | qcom_aoss_control_assert(rcdev, idx); | ||
78 | |||
79 | return qcom_aoss_control_deassert(rcdev, idx); | ||
80 | } | ||
81 | |||
82 | static const struct reset_control_ops qcom_aoss_reset_ops = { | ||
83 | .reset = qcom_aoss_control_reset, | ||
84 | .assert = qcom_aoss_control_assert, | ||
85 | .deassert = qcom_aoss_control_deassert, | ||
86 | }; | ||
87 | |||
88 | static int qcom_aoss_reset_probe(struct platform_device *pdev) | ||
89 | { | ||
90 | struct qcom_aoss_reset_data *data; | ||
91 | struct device *dev = &pdev->dev; | ||
92 | const struct qcom_aoss_desc *desc; | ||
93 | struct resource *res; | ||
94 | |||
95 | desc = of_device_get_match_data(dev); | ||
96 | if (!desc) | ||
97 | return -EINVAL; | ||
98 | |||
99 | data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); | ||
100 | if (!data) | ||
101 | return -ENOMEM; | ||
102 | |||
103 | data->desc = desc; | ||
104 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
105 | data->base = devm_ioremap_resource(dev, res); | ||
106 | if (IS_ERR(data->base)) | ||
107 | return PTR_ERR(data->base); | ||
108 | |||
109 | data->rcdev.owner = THIS_MODULE; | ||
110 | data->rcdev.ops = &qcom_aoss_reset_ops; | ||
111 | data->rcdev.nr_resets = desc->num_resets; | ||
112 | data->rcdev.of_node = dev->of_node; | ||
113 | |||
114 | return devm_reset_controller_register(dev, &data->rcdev); | ||
115 | } | ||
116 | |||
117 | static const struct of_device_id qcom_aoss_reset_of_match[] = { | ||
118 | { .compatible = "qcom,sdm845-aoss-cc", .data = &sdm845_aoss_desc }, | ||
119 | {} | ||
120 | }; | ||
121 | |||
122 | static struct platform_driver qcom_aoss_reset_driver = { | ||
123 | .probe = qcom_aoss_reset_probe, | ||
124 | .driver = { | ||
125 | .name = "qcom_aoss_reset", | ||
126 | .of_match_table = qcom_aoss_reset_of_match, | ||
127 | }, | ||
128 | }; | ||
129 | |||
130 | builtin_platform_driver(qcom_aoss_reset_driver); | ||
131 | |||
132 | MODULE_DESCRIPTION("Qualcomm AOSS Reset Driver"); | ||
133 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/reset/reset-simple.c b/drivers/reset/reset-simple.c index f7ce8910a392..a91107fc9e27 100644 --- a/drivers/reset/reset-simple.c +++ b/drivers/reset/reset-simple.c | |||
@@ -87,6 +87,7 @@ const struct reset_control_ops reset_simple_ops = { | |||
87 | .deassert = reset_simple_deassert, | 87 | .deassert = reset_simple_deassert, |
88 | .status = reset_simple_status, | 88 | .status = reset_simple_status, |
89 | }; | 89 | }; |
90 | EXPORT_SYMBOL_GPL(reset_simple_ops); | ||
90 | 91 | ||
91 | /** | 92 | /** |
92 | * struct reset_simple_devdata - simple reset controller properties | 93 | * struct reset_simple_devdata - simple reset controller properties |
diff --git a/drivers/reset/reset-uniphier-usb3.c b/drivers/reset/reset-uniphier-usb3.c new file mode 100644 index 000000000000..ffa1b19b594d --- /dev/null +++ b/drivers/reset/reset-uniphier-usb3.c | |||
@@ -0,0 +1,171 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | // | ||
3 | // reset-uniphier-usb3.c - USB3 reset driver for UniPhier | ||
4 | // Copyright 2018 Socionext Inc. | ||
5 | // Author: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> | ||
6 | |||
7 | #include <linux/clk.h> | ||
8 | #include <linux/module.h> | ||
9 | #include <linux/of_device.h> | ||
10 | #include <linux/platform_device.h> | ||
11 | #include <linux/reset.h> | ||
12 | |||
13 | #include "reset-simple.h" | ||
14 | |||
15 | #define MAX_CLKS 2 | ||
16 | #define MAX_RSTS 2 | ||
17 | |||
18 | struct uniphier_usb3_reset_soc_data { | ||
19 | int nclks; | ||
20 | const char * const *clock_names; | ||
21 | int nrsts; | ||
22 | const char * const *reset_names; | ||
23 | }; | ||
24 | |||
25 | struct uniphier_usb3_reset_priv { | ||
26 | struct clk_bulk_data clk[MAX_CLKS]; | ||
27 | struct reset_control *rst[MAX_RSTS]; | ||
28 | struct reset_simple_data rdata; | ||
29 | const struct uniphier_usb3_reset_soc_data *data; | ||
30 | }; | ||
31 | |||
32 | static int uniphier_usb3_reset_probe(struct platform_device *pdev) | ||
33 | { | ||
34 | struct device *dev = &pdev->dev; | ||
35 | struct uniphier_usb3_reset_priv *priv; | ||
36 | struct resource *res; | ||
37 | resource_size_t size; | ||
38 | const char *name; | ||
39 | int i, ret, nr; | ||
40 | |||
41 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); | ||
42 | if (!priv) | ||
43 | return -ENOMEM; | ||
44 | |||
45 | priv->data = of_device_get_match_data(dev); | ||
46 | if (WARN_ON(!priv->data || priv->data->nclks > MAX_CLKS || | ||
47 | priv->data->nrsts > MAX_RSTS)) | ||
48 | return -EINVAL; | ||
49 | |||
50 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
51 | size = resource_size(res); | ||
52 | priv->rdata.membase = devm_ioremap_resource(dev, res); | ||
53 | if (IS_ERR(priv->rdata.membase)) | ||
54 | return PTR_ERR(priv->rdata.membase); | ||
55 | |||
56 | for (i = 0; i < priv->data->nclks; i++) | ||
57 | priv->clk[i].id = priv->data->clock_names[i]; | ||
58 | ret = devm_clk_bulk_get(dev, priv->data->nclks, priv->clk); | ||
59 | if (ret) | ||
60 | return ret; | ||
61 | |||
62 | for (i = 0; i < priv->data->nrsts; i++) { | ||
63 | name = priv->data->reset_names[i]; | ||
64 | priv->rst[i] = devm_reset_control_get_shared(dev, name); | ||
65 | if (IS_ERR(priv->rst[i])) | ||
66 | return PTR_ERR(priv->rst[i]); | ||
67 | } | ||
68 | |||
69 | ret = clk_bulk_prepare_enable(priv->data->nclks, priv->clk); | ||
70 | if (ret) | ||
71 | return ret; | ||
72 | |||
73 | for (nr = 0; nr < priv->data->nrsts; nr++) { | ||
74 | ret = reset_control_deassert(priv->rst[nr]); | ||
75 | if (ret) | ||
76 | goto out_rst_assert; | ||
77 | } | ||
78 | |||
79 | spin_lock_init(&priv->rdata.lock); | ||
80 | priv->rdata.rcdev.owner = THIS_MODULE; | ||
81 | priv->rdata.rcdev.nr_resets = size * BITS_PER_BYTE; | ||
82 | priv->rdata.rcdev.ops = &reset_simple_ops; | ||
83 | priv->rdata.rcdev.of_node = dev->of_node; | ||
84 | priv->rdata.active_low = true; | ||
85 | |||
86 | platform_set_drvdata(pdev, priv); | ||
87 | |||
88 | ret = devm_reset_controller_register(dev, &priv->rdata.rcdev); | ||
89 | if (ret) | ||
90 | goto out_rst_assert; | ||
91 | |||
92 | return 0; | ||
93 | |||
94 | out_rst_assert: | ||
95 | while (nr--) | ||
96 | reset_control_assert(priv->rst[nr]); | ||
97 | |||
98 | clk_bulk_disable_unprepare(priv->data->nclks, priv->clk); | ||
99 | |||
100 | return ret; | ||
101 | } | ||
102 | |||
103 | static int uniphier_usb3_reset_remove(struct platform_device *pdev) | ||
104 | { | ||
105 | struct uniphier_usb3_reset_priv *priv = platform_get_drvdata(pdev); | ||
106 | int i; | ||
107 | |||
108 | for (i = 0; i < priv->data->nrsts; i++) | ||
109 | reset_control_assert(priv->rst[i]); | ||
110 | |||
111 | clk_bulk_disable_unprepare(priv->data->nclks, priv->clk); | ||
112 | |||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | static const char * const uniphier_pro4_clock_reset_names[] = { | ||
117 | "gio", "link", | ||
118 | }; | ||
119 | |||
120 | static const struct uniphier_usb3_reset_soc_data uniphier_pro4_data = { | ||
121 | .nclks = ARRAY_SIZE(uniphier_pro4_clock_reset_names), | ||
122 | .clock_names = uniphier_pro4_clock_reset_names, | ||
123 | .nrsts = ARRAY_SIZE(uniphier_pro4_clock_reset_names), | ||
124 | .reset_names = uniphier_pro4_clock_reset_names, | ||
125 | }; | ||
126 | |||
127 | static const char * const uniphier_pxs2_clock_reset_names[] = { | ||
128 | "link", | ||
129 | }; | ||
130 | |||
131 | static const struct uniphier_usb3_reset_soc_data uniphier_pxs2_data = { | ||
132 | .nclks = ARRAY_SIZE(uniphier_pxs2_clock_reset_names), | ||
133 | .clock_names = uniphier_pxs2_clock_reset_names, | ||
134 | .nrsts = ARRAY_SIZE(uniphier_pxs2_clock_reset_names), | ||
135 | .reset_names = uniphier_pxs2_clock_reset_names, | ||
136 | }; | ||
137 | |||
138 | static const struct of_device_id uniphier_usb3_reset_match[] = { | ||
139 | { | ||
140 | .compatible = "socionext,uniphier-pro4-usb3-reset", | ||
141 | .data = &uniphier_pro4_data, | ||
142 | }, | ||
143 | { | ||
144 | .compatible = "socionext,uniphier-pxs2-usb3-reset", | ||
145 | .data = &uniphier_pxs2_data, | ||
146 | }, | ||
147 | { | ||
148 | .compatible = "socionext,uniphier-ld20-usb3-reset", | ||
149 | .data = &uniphier_pxs2_data, | ||
150 | }, | ||
151 | { | ||
152 | .compatible = "socionext,uniphier-pxs3-usb3-reset", | ||
153 | .data = &uniphier_pxs2_data, | ||
154 | }, | ||
155 | { /* Sentinel */ } | ||
156 | }; | ||
157 | MODULE_DEVICE_TABLE(of, uniphier_usb3_reset_match); | ||
158 | |||
159 | static struct platform_driver uniphier_usb3_reset_driver = { | ||
160 | .probe = uniphier_usb3_reset_probe, | ||
161 | .remove = uniphier_usb3_reset_remove, | ||
162 | .driver = { | ||
163 | .name = "uniphier-usb3-reset", | ||
164 | .of_match_table = uniphier_usb3_reset_match, | ||
165 | }, | ||
166 | }; | ||
167 | module_platform_driver(uniphier_usb3_reset_driver); | ||
168 | |||
169 | MODULE_AUTHOR("Kunihiko Hayashi <hayashi.kunihiko@socionext.com>"); | ||
170 | MODULE_DESCRIPTION("UniPhier USB3 Reset Driver"); | ||
171 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/reset/reset-uniphier.c b/drivers/reset/reset-uniphier.c index e9030ff1bf2f..5605745663ae 100644 --- a/drivers/reset/reset-uniphier.c +++ b/drivers/reset/reset-uniphier.c | |||
@@ -202,6 +202,12 @@ static const struct uniphier_reset_data uniphier_pro5_sd_reset_data[] = { | |||
202 | #define UNIPHIER_PERI_RESET_FI2C(id, ch) \ | 202 | #define UNIPHIER_PERI_RESET_FI2C(id, ch) \ |
203 | UNIPHIER_RESETX((id), 0x114, 24 + (ch)) | 203 | UNIPHIER_RESETX((id), 0x114, 24 + (ch)) |
204 | 204 | ||
205 | #define UNIPHIER_PERI_RESET_SCSSI(id) \ | ||
206 | UNIPHIER_RESETX((id), 0x110, 17) | ||
207 | |||
208 | #define UNIPHIER_PERI_RESET_MCSSI(id) \ | ||
209 | UNIPHIER_RESETX((id), 0x114, 14) | ||
210 | |||
205 | static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = { | 211 | static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = { |
206 | UNIPHIER_PERI_RESET_UART(0, 0), | 212 | UNIPHIER_PERI_RESET_UART(0, 0), |
207 | UNIPHIER_PERI_RESET_UART(1, 1), | 213 | UNIPHIER_PERI_RESET_UART(1, 1), |
@@ -212,6 +218,7 @@ static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = { | |||
212 | UNIPHIER_PERI_RESET_I2C(6, 2), | 218 | UNIPHIER_PERI_RESET_I2C(6, 2), |
213 | UNIPHIER_PERI_RESET_I2C(7, 3), | 219 | UNIPHIER_PERI_RESET_I2C(7, 3), |
214 | UNIPHIER_PERI_RESET_I2C(8, 4), | 220 | UNIPHIER_PERI_RESET_I2C(8, 4), |
221 | UNIPHIER_PERI_RESET_SCSSI(11), | ||
215 | UNIPHIER_RESET_END, | 222 | UNIPHIER_RESET_END, |
216 | }; | 223 | }; |
217 | 224 | ||
@@ -227,6 +234,8 @@ static const struct uniphier_reset_data uniphier_pro4_peri_reset_data[] = { | |||
227 | UNIPHIER_PERI_RESET_FI2C(8, 4), | 234 | UNIPHIER_PERI_RESET_FI2C(8, 4), |
228 | UNIPHIER_PERI_RESET_FI2C(9, 5), | 235 | UNIPHIER_PERI_RESET_FI2C(9, 5), |
229 | UNIPHIER_PERI_RESET_FI2C(10, 6), | 236 | UNIPHIER_PERI_RESET_FI2C(10, 6), |
237 | UNIPHIER_PERI_RESET_SCSSI(11), | ||
238 | UNIPHIER_PERI_RESET_MCSSI(12), | ||
230 | UNIPHIER_RESET_END, | 239 | UNIPHIER_RESET_END, |
231 | }; | 240 | }; |
232 | 241 | ||
diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c index dcf8c8065508..a5577dd5eb08 100644 --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c | |||
@@ -628,10 +628,26 @@ static const struct of_device_id ddr_shimphy_dt_ids[] = { | |||
628 | 628 | ||
629 | static const struct of_device_id brcmstb_memc_of_match[] = { | 629 | static const struct of_device_id brcmstb_memc_of_match[] = { |
630 | { | 630 | { |
631 | .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.1", | ||
632 | .data = &ddr_seq, | ||
633 | }, | ||
634 | { | ||
631 | .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.2", | 635 | .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.2", |
632 | .data = &ddr_seq_b22, | 636 | .data = &ddr_seq_b22, |
633 | }, | 637 | }, |
634 | { | 638 | { |
639 | .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.3", | ||
640 | .data = &ddr_seq_b22, | ||
641 | }, | ||
642 | { | ||
643 | .compatible = "brcm,brcmstb-memc-ddr-rev-b.3.0", | ||
644 | .data = &ddr_seq_b22, | ||
645 | }, | ||
646 | { | ||
647 | .compatible = "brcm,brcmstb-memc-ddr-rev-b.3.1", | ||
648 | .data = &ddr_seq_b22, | ||
649 | }, | ||
650 | { | ||
635 | .compatible = "brcm,brcmstb-memc-ddr", | 651 | .compatible = "brcm,brcmstb-memc-ddr", |
636 | .data = &ddr_seq, | 652 | .data = &ddr_seq, |
637 | }, | 653 | }, |
diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig index 7a9fb9baa66d..8f80e8bbf29e 100644 --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig | |||
@@ -1,7 +1,9 @@ | |||
1 | # | 1 | # |
2 | # Freescale SOC drivers | 2 | # NXP/Freescale QorIQ series SOC drivers |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "NXP/Freescale QorIQ SoC drivers" | ||
6 | |||
5 | source "drivers/soc/fsl/qbman/Kconfig" | 7 | source "drivers/soc/fsl/qbman/Kconfig" |
6 | source "drivers/soc/fsl/qe/Kconfig" | 8 | source "drivers/soc/fsl/qe/Kconfig" |
7 | 9 | ||
@@ -16,3 +18,14 @@ config FSL_GUTS | |||
16 | Initially only reading SVR and registering soc device are supported. | 18 | Initially only reading SVR and registering soc device are supported. |
17 | Other guts accesses, such as reading RCW, should eventually be moved | 19 | Other guts accesses, such as reading RCW, should eventually be moved |
18 | into this driver as well. | 20 | into this driver as well. |
21 | |||
22 | config FSL_MC_DPIO | ||
23 | tristate "QorIQ DPAA2 DPIO driver" | ||
24 | depends on FSL_MC_BUS | ||
25 | help | ||
26 | Driver for the DPAA2 DPIO object. A DPIO provides queue and | ||
27 | buffer management facilities for software to interact with | ||
28 | other DPAA2 objects. This driver does not expose the DPIO | ||
29 | objects individually, but groups them under a service layer | ||
30 | API. | ||
31 | endmenu | ||
diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile index 44b3bebef24a..803ef1bfb5ff 100644 --- a/drivers/soc/fsl/Makefile +++ b/drivers/soc/fsl/Makefile | |||
@@ -6,3 +6,4 @@ obj-$(CONFIG_FSL_DPAA) += qbman/ | |||
6 | obj-$(CONFIG_QUICC_ENGINE) += qe/ | 6 | obj-$(CONFIG_QUICC_ENGINE) += qe/ |
7 | obj-$(CONFIG_CPM) += qe/ | 7 | obj-$(CONFIG_CPM) += qe/ |
8 | obj-$(CONFIG_FSL_GUTS) += guts.o | 8 | obj-$(CONFIG_FSL_GUTS) += guts.o |
9 | obj-$(CONFIG_FSL_MC_DPIO) += dpio/ | ||
diff --git a/drivers/staging/fsl-mc/bus/dpio/Makefile b/drivers/soc/fsl/dpio/Makefile index b9ff24c76582..b9ff24c76582 100644 --- a/drivers/staging/fsl-mc/bus/dpio/Makefile +++ b/drivers/soc/fsl/dpio/Makefile | |||
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h b/drivers/soc/fsl/dpio/dpio-cmd.h index ab8f82ee7ee5..ab8f82ee7ee5 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h +++ b/drivers/soc/fsl/dpio/dpio-cmd.h | |||
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c index 11a90a90d827..b60b77bfaffa 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c +++ b/drivers/soc/fsl/dpio/dpio-driver.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | 17 | ||
18 | #include <linux/fsl/mc.h> | 18 | #include <linux/fsl/mc.h> |
19 | #include "../../include/dpaa2-io.h" | 19 | #include <soc/fsl/dpaa2-io.h> |
20 | 20 | ||
21 | #include "qbman-portal.h" | 21 | #include "qbman-portal.h" |
22 | #include "dpio.h" | 22 | #include "dpio.h" |
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c index 14ed2beb7432..9b17f72349ed 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio-service.c +++ b/drivers/soc/fsl/dpio/dpio-service.c | |||
@@ -6,7 +6,7 @@ | |||
6 | */ | 6 | */ |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/fsl/mc.h> | 8 | #include <linux/fsl/mc.h> |
9 | #include "../../include/dpaa2-io.h" | 9 | #include <soc/fsl/dpaa2-io.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio.c b/drivers/soc/fsl/dpio/dpio.c index ff37c80e11a0..ff37c80e11a0 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio.c +++ b/drivers/soc/fsl/dpio/dpio.c | |||
diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio.h b/drivers/soc/fsl/dpio/dpio.h index 49194c8e45f1..49194c8e45f1 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio.h +++ b/drivers/soc/fsl/dpio/dpio.h | |||
diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c index 116fafb28640..cf1d448ea468 100644 --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c +++ b/drivers/soc/fsl/dpio/qbman-portal.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <asm/cacheflush.h> | 8 | #include <asm/cacheflush.h> |
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
11 | #include "../../include/dpaa2-global.h" | 11 | #include <soc/fsl/dpaa2-global.h> |
12 | 12 | ||
13 | #include "qbman-portal.h" | 13 | #include "qbman-portal.h" |
14 | 14 | ||
diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.h b/drivers/soc/fsl/dpio/qbman-portal.h index 69db3c818742..89d1dd9969b6 100644 --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.h +++ b/drivers/soc/fsl/dpio/qbman-portal.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #ifndef __FSL_QBMAN_PORTAL_H | 7 | #ifndef __FSL_QBMAN_PORTAL_H |
8 | #define __FSL_QBMAN_PORTAL_H | 8 | #define __FSL_QBMAN_PORTAL_H |
9 | 9 | ||
10 | #include "../../include/dpaa2-fd.h" | 10 | #include <soc/fsl/dpaa2-fd.h> |
11 | 11 | ||
12 | struct dpaa2_dq; | 12 | struct dpaa2_dq; |
13 | struct qbman_swp; | 13 | struct qbman_swp; |
diff --git a/drivers/soc/fsl/qbman/Kconfig b/drivers/soc/fsl/qbman/Kconfig index fb4e6bf0a0c4..d570cb5fd381 100644 --- a/drivers/soc/fsl/qbman/Kconfig +++ b/drivers/soc/fsl/qbman/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | menuconfig FSL_DPAA | 1 | menuconfig FSL_DPAA |
2 | bool "Freescale DPAA 1.x support" | 2 | bool "QorIQ DPAA1 framework support" |
3 | depends on (FSL_SOC_BOOKE || ARCH_LAYERSCAPE) | 3 | depends on (FSL_SOC_BOOKE || ARCH_LAYERSCAPE) |
4 | select GENERIC_ALLOCATOR | 4 | select GENERIC_ALLOCATOR |
5 | help | 5 | help |
diff --git a/drivers/soc/fsl/qe/Kconfig b/drivers/soc/fsl/qe/Kconfig index 73a2e08b47ef..fabba17e9d65 100644 --- a/drivers/soc/fsl/qe/Kconfig +++ b/drivers/soc/fsl/qe/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | config QUICC_ENGINE | 5 | config QUICC_ENGINE |
6 | bool "Freescale QUICC Engine (QE) Support" | 6 | bool "QUICC Engine (QE) framework support" |
7 | depends on FSL_SOC && PPC32 | 7 | depends on FSL_SOC && PPC32 |
8 | select GENERIC_ALLOCATOR | 8 | select GENERIC_ALLOCATOR |
9 | select CRC32 | 9 | select CRC32 |
diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 3b27075c21a7..819bed0f5667 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c | |||
@@ -83,6 +83,33 @@ static void qe_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) | |||
83 | spin_unlock_irqrestore(&qe_gc->lock, flags); | 83 | spin_unlock_irqrestore(&qe_gc->lock, flags); |
84 | } | 84 | } |
85 | 85 | ||
86 | static void qe_gpio_set_multiple(struct gpio_chip *gc, | ||
87 | unsigned long *mask, unsigned long *bits) | ||
88 | { | ||
89 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
90 | struct qe_gpio_chip *qe_gc = gpiochip_get_data(gc); | ||
91 | struct qe_pio_regs __iomem *regs = mm_gc->regs; | ||
92 | unsigned long flags; | ||
93 | int i; | ||
94 | |||
95 | spin_lock_irqsave(&qe_gc->lock, flags); | ||
96 | |||
97 | for (i = 0; i < gc->ngpio; i++) { | ||
98 | if (*mask == 0) | ||
99 | break; | ||
100 | if (__test_and_clear_bit(i, mask)) { | ||
101 | if (test_bit(i, bits)) | ||
102 | qe_gc->cpdata |= (1U << (QE_PIO_PINS - 1 - i)); | ||
103 | else | ||
104 | qe_gc->cpdata &= ~(1U << (QE_PIO_PINS - 1 - i)); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | out_be32(®s->cpdata, qe_gc->cpdata); | ||
109 | |||
110 | spin_unlock_irqrestore(&qe_gc->lock, flags); | ||
111 | } | ||
112 | |||
86 | static int qe_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio) | 113 | static int qe_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio) |
87 | { | 114 | { |
88 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | 115 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); |
@@ -298,6 +325,7 @@ static int __init qe_add_gpiochips(void) | |||
298 | gc->direction_output = qe_gpio_dir_out; | 325 | gc->direction_output = qe_gpio_dir_out; |
299 | gc->get = qe_gpio_get; | 326 | gc->get = qe_gpio_get; |
300 | gc->set = qe_gpio_set; | 327 | gc->set = qe_gpio_set; |
328 | gc->set_multiple = qe_gpio_set_multiple; | ||
301 | 329 | ||
302 | ret = of_mm_gpiochip_add_data(np, mm_gc, qe_gc); | 330 | ret = of_mm_gpiochip_add_data(np, mm_gc, qe_gc); |
303 | if (ret) | 331 | if (ret) |
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c index 546960a18d60..b3da635970ea 100644 --- a/drivers/soc/imx/gpc.c +++ b/drivers/soc/imx/gpc.c | |||
@@ -54,7 +54,6 @@ struct imx_pm_domain { | |||
54 | unsigned int reg_offs; | 54 | unsigned int reg_offs; |
55 | signed char cntr_pdn_bit; | 55 | signed char cntr_pdn_bit; |
56 | unsigned int ipg_rate_mhz; | 56 | unsigned int ipg_rate_mhz; |
57 | unsigned int flags; | ||
58 | }; | 57 | }; |
59 | 58 | ||
60 | static inline struct imx_pm_domain * | 59 | static inline struct imx_pm_domain * |
@@ -69,9 +68,6 @@ static int imx6_pm_domain_power_off(struct generic_pm_domain *genpd) | |||
69 | int iso, iso2sw; | 68 | int iso, iso2sw; |
70 | u32 val; | 69 | u32 val; |
71 | 70 | ||
72 | if (pd->flags & PGC_DOMAIN_FLAG_NO_PD) | ||
73 | return -EBUSY; | ||
74 | |||
75 | /* Read ISO and ISO2SW power down delays */ | 71 | /* Read ISO and ISO2SW power down delays */ |
76 | regmap_read(pd->regmap, pd->reg_offs + GPC_PGC_PUPSCR_OFFS, &val); | 72 | regmap_read(pd->regmap, pd->reg_offs + GPC_PGC_PUPSCR_OFFS, &val); |
77 | iso = val & 0x3f; | 73 | iso = val & 0x3f; |
@@ -295,26 +291,31 @@ static struct imx_pm_domain imx_gpc_domains[] = { | |||
295 | struct imx_gpc_dt_data { | 291 | struct imx_gpc_dt_data { |
296 | int num_domains; | 292 | int num_domains; |
297 | bool err009619_present; | 293 | bool err009619_present; |
294 | bool err006287_present; | ||
298 | }; | 295 | }; |
299 | 296 | ||
300 | static const struct imx_gpc_dt_data imx6q_dt_data = { | 297 | static const struct imx_gpc_dt_data imx6q_dt_data = { |
301 | .num_domains = 2, | 298 | .num_domains = 2, |
302 | .err009619_present = false, | 299 | .err009619_present = false, |
300 | .err006287_present = false, | ||
303 | }; | 301 | }; |
304 | 302 | ||
305 | static const struct imx_gpc_dt_data imx6qp_dt_data = { | 303 | static const struct imx_gpc_dt_data imx6qp_dt_data = { |
306 | .num_domains = 2, | 304 | .num_domains = 2, |
307 | .err009619_present = true, | 305 | .err009619_present = true, |
306 | .err006287_present = false, | ||
308 | }; | 307 | }; |
309 | 308 | ||
310 | static const struct imx_gpc_dt_data imx6sl_dt_data = { | 309 | static const struct imx_gpc_dt_data imx6sl_dt_data = { |
311 | .num_domains = 3, | 310 | .num_domains = 3, |
312 | .err009619_present = false, | 311 | .err009619_present = false, |
312 | .err006287_present = true, | ||
313 | }; | 313 | }; |
314 | 314 | ||
315 | static const struct imx_gpc_dt_data imx6sx_dt_data = { | 315 | static const struct imx_gpc_dt_data imx6sx_dt_data = { |
316 | .num_domains = 4, | 316 | .num_domains = 4, |
317 | .err009619_present = false, | 317 | .err009619_present = false, |
318 | .err006287_present = false, | ||
318 | }; | 319 | }; |
319 | 320 | ||
320 | static const struct of_device_id imx_gpc_dt_ids[] = { | 321 | static const struct of_device_id imx_gpc_dt_ids[] = { |
@@ -434,8 +435,13 @@ static int imx_gpc_probe(struct platform_device *pdev) | |||
434 | 435 | ||
435 | /* Disable PU power down in normal operation if ERR009619 is present */ | 436 | /* Disable PU power down in normal operation if ERR009619 is present */ |
436 | if (of_id_data->err009619_present) | 437 | if (of_id_data->err009619_present) |
437 | imx_gpc_domains[GPC_PGC_DOMAIN_PU].flags |= | 438 | imx_gpc_domains[GPC_PGC_DOMAIN_PU].base.flags |= |
438 | PGC_DOMAIN_FLAG_NO_PD; | 439 | GENPD_FLAG_ALWAYS_ON; |
440 | |||
441 | /* Keep DISP always on if ERR006287 is present */ | ||
442 | if (of_id_data->err006287_present) | ||
443 | imx_gpc_domains[GPC_PGC_DOMAIN_DISPLAY].base.flags |= | ||
444 | GENPD_FLAG_ALWAYS_ON; | ||
439 | 445 | ||
440 | if (!pgc_node) { | 446 | if (!pgc_node) { |
441 | ret = imx_gpc_old_dt_init(&pdev->dev, regmap, | 447 | ret = imx_gpc_old_dt_init(&pdev->dev, regmap, |
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 2afae64061d8..4e931fdf4d09 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c | |||
@@ -146,6 +146,21 @@ static const u32 mt6397_regs[] = { | |||
146 | [PWRAP_DEW_CIPHER_SWRST] = 0xbc24, | 146 | [PWRAP_DEW_CIPHER_SWRST] = 0xbc24, |
147 | }; | 147 | }; |
148 | 148 | ||
149 | static const u32 mt6351_regs[] = { | ||
150 | [PWRAP_DEW_DIO_EN] = 0x02F2, | ||
151 | [PWRAP_DEW_READ_TEST] = 0x02F4, | ||
152 | [PWRAP_DEW_WRITE_TEST] = 0x02F6, | ||
153 | [PWRAP_DEW_CRC_EN] = 0x02FA, | ||
154 | [PWRAP_DEW_CRC_VAL] = 0x02FC, | ||
155 | [PWRAP_DEW_CIPHER_KEY_SEL] = 0x0300, | ||
156 | [PWRAP_DEW_CIPHER_IV_SEL] = 0x0302, | ||
157 | [PWRAP_DEW_CIPHER_EN] = 0x0304, | ||
158 | [PWRAP_DEW_CIPHER_RDY] = 0x0306, | ||
159 | [PWRAP_DEW_CIPHER_MODE] = 0x0308, | ||
160 | [PWRAP_DEW_CIPHER_SWRST] = 0x030A, | ||
161 | [PWRAP_DEW_RDDMY_NO] = 0x030C, | ||
162 | }; | ||
163 | |||
149 | enum pwrap_regs { | 164 | enum pwrap_regs { |
150 | PWRAP_MUX_SEL, | 165 | PWRAP_MUX_SEL, |
151 | PWRAP_WRAP_EN, | 166 | PWRAP_WRAP_EN, |
@@ -366,6 +381,39 @@ static int mt2701_regs[] = { | |||
366 | [PWRAP_ADC_RDATA_ADDR2] = 0x154, | 381 | [PWRAP_ADC_RDATA_ADDR2] = 0x154, |
367 | }; | 382 | }; |
368 | 383 | ||
384 | static int mt6797_regs[] = { | ||
385 | [PWRAP_MUX_SEL] = 0x0, | ||
386 | [PWRAP_WRAP_EN] = 0x4, | ||
387 | [PWRAP_DIO_EN] = 0x8, | ||
388 | [PWRAP_SIDLY] = 0xC, | ||
389 | [PWRAP_RDDMY] = 0x10, | ||
390 | [PWRAP_CSHEXT_WRITE] = 0x18, | ||
391 | [PWRAP_CSHEXT_READ] = 0x1C, | ||
392 | [PWRAP_CSLEXT_START] = 0x20, | ||
393 | [PWRAP_CSLEXT_END] = 0x24, | ||
394 | [PWRAP_STAUPD_PRD] = 0x28, | ||
395 | [PWRAP_HARB_HPRIO] = 0x50, | ||
396 | [PWRAP_HIPRIO_ARB_EN] = 0x54, | ||
397 | [PWRAP_MAN_EN] = 0x60, | ||
398 | [PWRAP_MAN_CMD] = 0x64, | ||
399 | [PWRAP_WACS0_EN] = 0x70, | ||
400 | [PWRAP_WACS1_EN] = 0x84, | ||
401 | [PWRAP_WACS2_EN] = 0x98, | ||
402 | [PWRAP_INIT_DONE2] = 0x9C, | ||
403 | [PWRAP_WACS2_CMD] = 0xA0, | ||
404 | [PWRAP_WACS2_RDATA] = 0xA4, | ||
405 | [PWRAP_WACS2_VLDCLR] = 0xA8, | ||
406 | [PWRAP_INT_EN] = 0xC0, | ||
407 | [PWRAP_INT_FLG_RAW] = 0xC4, | ||
408 | [PWRAP_INT_FLG] = 0xC8, | ||
409 | [PWRAP_INT_CLR] = 0xCC, | ||
410 | [PWRAP_TIMER_EN] = 0xF4, | ||
411 | [PWRAP_WDT_UNIT] = 0xFC, | ||
412 | [PWRAP_WDT_SRC_EN] = 0x100, | ||
413 | [PWRAP_DCM_EN] = 0x1CC, | ||
414 | [PWRAP_DCM_DBC_PRD] = 0x1D4, | ||
415 | }; | ||
416 | |||
369 | static int mt7622_regs[] = { | 417 | static int mt7622_regs[] = { |
370 | [PWRAP_MUX_SEL] = 0x0, | 418 | [PWRAP_MUX_SEL] = 0x0, |
371 | [PWRAP_WRAP_EN] = 0x4, | 419 | [PWRAP_WRAP_EN] = 0x4, |
@@ -635,12 +683,14 @@ static int mt8135_regs[] = { | |||
635 | 683 | ||
636 | enum pmic_type { | 684 | enum pmic_type { |
637 | PMIC_MT6323, | 685 | PMIC_MT6323, |
686 | PMIC_MT6351, | ||
638 | PMIC_MT6380, | 687 | PMIC_MT6380, |
639 | PMIC_MT6397, | 688 | PMIC_MT6397, |
640 | }; | 689 | }; |
641 | 690 | ||
642 | enum pwrap_type { | 691 | enum pwrap_type { |
643 | PWRAP_MT2701, | 692 | PWRAP_MT2701, |
693 | PWRAP_MT6797, | ||
644 | PWRAP_MT7622, | 694 | PWRAP_MT7622, |
645 | PWRAP_MT8135, | 695 | PWRAP_MT8135, |
646 | PWRAP_MT8173, | 696 | PWRAP_MT8173, |
@@ -1067,6 +1117,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) | |||
1067 | pwrap_writel(wrp, 1, PWRAP_CIPHER_START); | 1117 | pwrap_writel(wrp, 1, PWRAP_CIPHER_START); |
1068 | break; | 1118 | break; |
1069 | case PWRAP_MT2701: | 1119 | case PWRAP_MT2701: |
1120 | case PWRAP_MT6797: | ||
1070 | case PWRAP_MT8173: | 1121 | case PWRAP_MT8173: |
1071 | pwrap_writel(wrp, 1, PWRAP_CIPHER_EN); | 1122 | pwrap_writel(wrp, 1, PWRAP_CIPHER_EN); |
1072 | break; | 1123 | break; |
@@ -1080,8 +1131,6 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) | |||
1080 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_SWRST], 0x0); | 1131 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_SWRST], 0x0); |
1081 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_KEY_SEL], 0x1); | 1132 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_KEY_SEL], 0x1); |
1082 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_IV_SEL], 0x2); | 1133 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_IV_SEL], 0x2); |
1083 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_LOAD], 0x1); | ||
1084 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_START], 0x1); | ||
1085 | 1134 | ||
1086 | switch (wrp->slave->type) { | 1135 | switch (wrp->slave->type) { |
1087 | case PMIC_MT6397: | 1136 | case PMIC_MT6397: |
@@ -1091,6 +1140,7 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp) | |||
1091 | 0x1); | 1140 | 0x1); |
1092 | break; | 1141 | break; |
1093 | case PMIC_MT6323: | 1142 | case PMIC_MT6323: |
1143 | case PMIC_MT6351: | ||
1094 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_EN], | 1144 | pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_EN], |
1095 | 0x1); | 1145 | 0x1); |
1096 | break; | 1146 | break; |
@@ -1367,6 +1417,15 @@ static const struct pwrap_slv_type pmic_mt6397 = { | |||
1367 | .pwrap_write = pwrap_write16, | 1417 | .pwrap_write = pwrap_write16, |
1368 | }; | 1418 | }; |
1369 | 1419 | ||
1420 | static const struct pwrap_slv_type pmic_mt6351 = { | ||
1421 | .dew_regs = mt6351_regs, | ||
1422 | .type = PMIC_MT6351, | ||
1423 | .regmap = &pwrap_regmap_config16, | ||
1424 | .caps = 0, | ||
1425 | .pwrap_read = pwrap_read16, | ||
1426 | .pwrap_write = pwrap_write16, | ||
1427 | }; | ||
1428 | |||
1370 | static const struct of_device_id of_slave_match_tbl[] = { | 1429 | static const struct of_device_id of_slave_match_tbl[] = { |
1371 | { | 1430 | { |
1372 | .compatible = "mediatek,mt6323", | 1431 | .compatible = "mediatek,mt6323", |
@@ -1381,6 +1440,9 @@ static const struct of_device_id of_slave_match_tbl[] = { | |||
1381 | .compatible = "mediatek,mt6397", | 1440 | .compatible = "mediatek,mt6397", |
1382 | .data = &pmic_mt6397, | 1441 | .data = &pmic_mt6397, |
1383 | }, { | 1442 | }, { |
1443 | .compatible = "mediatek,mt6351", | ||
1444 | .data = &pmic_mt6351, | ||
1445 | }, { | ||
1384 | /* sentinel */ | 1446 | /* sentinel */ |
1385 | } | 1447 | } |
1386 | }; | 1448 | }; |
@@ -1398,6 +1460,18 @@ static const struct pmic_wrapper_type pwrap_mt2701 = { | |||
1398 | .init_soc_specific = pwrap_mt2701_init_soc_specific, | 1460 | .init_soc_specific = pwrap_mt2701_init_soc_specific, |
1399 | }; | 1461 | }; |
1400 | 1462 | ||
1463 | static const struct pmic_wrapper_type pwrap_mt6797 = { | ||
1464 | .regs = mt6797_regs, | ||
1465 | .type = PWRAP_MT6797, | ||
1466 | .arb_en_all = 0x01fff, | ||
1467 | .int_en_all = 0xffffffc6, | ||
1468 | .spi_w = PWRAP_MAN_CMD_SPI_WRITE, | ||
1469 | .wdt_src = PWRAP_WDT_SRC_MASK_ALL, | ||
1470 | .has_bridge = 0, | ||
1471 | .init_reg_clock = pwrap_common_init_reg_clock, | ||
1472 | .init_soc_specific = NULL, | ||
1473 | }; | ||
1474 | |||
1401 | static const struct pmic_wrapper_type pwrap_mt7622 = { | 1475 | static const struct pmic_wrapper_type pwrap_mt7622 = { |
1402 | .regs = mt7622_regs, | 1476 | .regs = mt7622_regs, |
1403 | .type = PWRAP_MT7622, | 1477 | .type = PWRAP_MT7622, |
@@ -1439,6 +1513,9 @@ static const struct of_device_id of_pwrap_match_tbl[] = { | |||
1439 | .compatible = "mediatek,mt2701-pwrap", | 1513 | .compatible = "mediatek,mt2701-pwrap", |
1440 | .data = &pwrap_mt2701, | 1514 | .data = &pwrap_mt2701, |
1441 | }, { | 1515 | }, { |
1516 | .compatible = "mediatek,mt6797-pwrap", | ||
1517 | .data = &pwrap_mt6797, | ||
1518 | }, { | ||
1442 | .compatible = "mediatek,mt7622-pwrap", | 1519 | .compatible = "mediatek,mt7622-pwrap", |
1443 | .data = &pwrap_mt7622, | 1520 | .data = &pwrap_mt7622, |
1444 | }, { | 1521 | }, { |
diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 882be5ed7e84..b4b0f3480bd3 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/of_address.h> | 17 | #include <linux/of_address.h> |
18 | #include <linux/of_device.h> | 18 | #include <linux/of_device.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/regmap.h> | ||
20 | 21 | ||
21 | #include <linux/soc/sunxi/sunxi_sram.h> | 22 | #include <linux/soc/sunxi/sunxi_sram.h> |
22 | 23 | ||
@@ -63,6 +64,12 @@ static struct sunxi_sram_desc sun4i_a10_sram_a3_a4 = { | |||
63 | SUNXI_SRAM_MAP(1, 1, "emac")), | 64 | SUNXI_SRAM_MAP(1, 1, "emac")), |
64 | }; | 65 | }; |
65 | 66 | ||
67 | static struct sunxi_sram_desc sun4i_a10_sram_c1 = { | ||
68 | .data = SUNXI_SRAM_DATA("C1", 0x0, 0x0, 31, | ||
69 | SUNXI_SRAM_MAP(0, 0, "cpu"), | ||
70 | SUNXI_SRAM_MAP(0x7fffffff, 1, "ve")), | ||
71 | }; | ||
72 | |||
66 | static struct sunxi_sram_desc sun4i_a10_sram_d = { | 73 | static struct sunxi_sram_desc sun4i_a10_sram_d = { |
67 | .data = SUNXI_SRAM_DATA("D", 0x4, 0x0, 1, | 74 | .data = SUNXI_SRAM_DATA("D", 0x4, 0x0, 1, |
68 | SUNXI_SRAM_MAP(0, 0, "cpu"), | 75 | SUNXI_SRAM_MAP(0, 0, "cpu"), |
@@ -81,6 +88,10 @@ static const struct of_device_id sunxi_sram_dt_ids[] = { | |||
81 | .data = &sun4i_a10_sram_a3_a4.data, | 88 | .data = &sun4i_a10_sram_a3_a4.data, |
82 | }, | 89 | }, |
83 | { | 90 | { |
91 | .compatible = "allwinner,sun4i-a10-sram-c1", | ||
92 | .data = &sun4i_a10_sram_c1.data, | ||
93 | }, | ||
94 | { | ||
84 | .compatible = "allwinner,sun4i-a10-sram-d", | 95 | .compatible = "allwinner,sun4i-a10-sram-d", |
85 | .data = &sun4i_a10_sram_d.data, | 96 | .data = &sun4i_a10_sram_d.data, |
86 | }, | 97 | }, |
@@ -281,13 +292,51 @@ int sunxi_sram_release(struct device *dev) | |||
281 | } | 292 | } |
282 | EXPORT_SYMBOL(sunxi_sram_release); | 293 | EXPORT_SYMBOL(sunxi_sram_release); |
283 | 294 | ||
295 | struct sunxi_sramc_variant { | ||
296 | bool has_emac_clock; | ||
297 | }; | ||
298 | |||
299 | static const struct sunxi_sramc_variant sun4i_a10_sramc_variant = { | ||
300 | /* Nothing special */ | ||
301 | }; | ||
302 | |||
303 | static const struct sunxi_sramc_variant sun50i_a64_sramc_variant = { | ||
304 | .has_emac_clock = true, | ||
305 | }; | ||
306 | |||
307 | #define SUNXI_SRAM_EMAC_CLOCK_REG 0x30 | ||
308 | static bool sunxi_sram_regmap_accessible_reg(struct device *dev, | ||
309 | unsigned int reg) | ||
310 | { | ||
311 | if (reg == SUNXI_SRAM_EMAC_CLOCK_REG) | ||
312 | return true; | ||
313 | return false; | ||
314 | } | ||
315 | |||
316 | static struct regmap_config sunxi_sram_emac_clock_regmap = { | ||
317 | .reg_bits = 32, | ||
318 | .val_bits = 32, | ||
319 | .reg_stride = 4, | ||
320 | /* last defined register */ | ||
321 | .max_register = SUNXI_SRAM_EMAC_CLOCK_REG, | ||
322 | /* other devices have no business accessing other registers */ | ||
323 | .readable_reg = sunxi_sram_regmap_accessible_reg, | ||
324 | .writeable_reg = sunxi_sram_regmap_accessible_reg, | ||
325 | }; | ||
326 | |||
284 | static int sunxi_sram_probe(struct platform_device *pdev) | 327 | static int sunxi_sram_probe(struct platform_device *pdev) |
285 | { | 328 | { |
286 | struct resource *res; | 329 | struct resource *res; |
287 | struct dentry *d; | 330 | struct dentry *d; |
331 | struct regmap *emac_clock; | ||
332 | const struct sunxi_sramc_variant *variant; | ||
288 | 333 | ||
289 | sram_dev = &pdev->dev; | 334 | sram_dev = &pdev->dev; |
290 | 335 | ||
336 | variant = of_device_get_match_data(&pdev->dev); | ||
337 | if (!variant) | ||
338 | return -EINVAL; | ||
339 | |||
291 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 340 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
292 | base = devm_ioremap_resource(&pdev->dev, res); | 341 | base = devm_ioremap_resource(&pdev->dev, res); |
293 | if (IS_ERR(base)) | 342 | if (IS_ERR(base)) |
@@ -300,12 +349,46 @@ static int sunxi_sram_probe(struct platform_device *pdev) | |||
300 | if (!d) | 349 | if (!d) |
301 | return -ENOMEM; | 350 | return -ENOMEM; |
302 | 351 | ||
352 | if (variant->has_emac_clock) { | ||
353 | emac_clock = devm_regmap_init_mmio(&pdev->dev, base, | ||
354 | &sunxi_sram_emac_clock_regmap); | ||
355 | |||
356 | if (IS_ERR(emac_clock)) | ||
357 | return PTR_ERR(emac_clock); | ||
358 | } | ||
359 | |||
303 | return 0; | 360 | return 0; |
304 | } | 361 | } |
305 | 362 | ||
306 | static const struct of_device_id sunxi_sram_dt_match[] = { | 363 | static const struct of_device_id sunxi_sram_dt_match[] = { |
307 | { .compatible = "allwinner,sun4i-a10-sram-controller" }, | 364 | { |
308 | { .compatible = "allwinner,sun50i-a64-sram-controller" }, | 365 | .compatible = "allwinner,sun4i-a10-sram-controller", |
366 | .data = &sun4i_a10_sramc_variant, | ||
367 | }, | ||
368 | { | ||
369 | .compatible = "allwinner,sun4i-a10-system-control", | ||
370 | .data = &sun4i_a10_sramc_variant, | ||
371 | }, | ||
372 | { | ||
373 | .compatible = "allwinner,sun5i-a13-system-control", | ||
374 | .data = &sun4i_a10_sramc_variant, | ||
375 | }, | ||
376 | { | ||
377 | .compatible = "allwinner,sun8i-a23-system-control", | ||
378 | .data = &sun4i_a10_sramc_variant, | ||
379 | }, | ||
380 | { | ||
381 | .compatible = "allwinner,sun8i-h3-system-control", | ||
382 | .data = &sun4i_a10_sramc_variant, | ||
383 | }, | ||
384 | { | ||
385 | .compatible = "allwinner,sun50i-a64-sram-controller", | ||
386 | .data = &sun50i_a64_sramc_variant, | ||
387 | }, | ||
388 | { | ||
389 | .compatible = "allwinner,sun50i-a64-system-control", | ||
390 | .data = &sun50i_a64_sramc_variant, | ||
391 | }, | ||
309 | { }, | 392 | { }, |
310 | }; | 393 | }; |
311 | MODULE_DEVICE_TABLE(of, sunxi_sram_dt_match); | 394 | MODULE_DEVICE_TABLE(of, sunxi_sram_dt_match); |
diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c index 369aef5e7228..f5cb8c0af09f 100644 --- a/drivers/soc/ti/wkup_m3_ipc.c +++ b/drivers/soc/ti/wkup_m3_ipc.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #define M3_BASELINE_VERSION 0x191 | 46 | #define M3_BASELINE_VERSION 0x191 |
47 | #define M3_STATUS_RESP_MASK (0xffff << 16) | 47 | #define M3_STATUS_RESP_MASK (0xffff << 16) |
48 | #define M3_FW_VERSION_MASK 0xffff | 48 | #define M3_FW_VERSION_MASK 0xffff |
49 | #define M3_WAKE_SRC_MASK 0xff | ||
49 | 50 | ||
50 | #define M3_STATE_UNKNOWN 0 | 51 | #define M3_STATE_UNKNOWN 0 |
51 | #define M3_STATE_RESET 1 | 52 | #define M3_STATE_RESET 1 |
@@ -55,6 +56,23 @@ | |||
55 | 56 | ||
56 | static struct wkup_m3_ipc *m3_ipc_state; | 57 | static struct wkup_m3_ipc *m3_ipc_state; |
57 | 58 | ||
59 | static const struct wkup_m3_wakeup_src wakeups[] = { | ||
60 | {.irq_nr = 35, .src = "USB0_PHY"}, | ||
61 | {.irq_nr = 36, .src = "USB1_PHY"}, | ||
62 | {.irq_nr = 40, .src = "I2C0"}, | ||
63 | {.irq_nr = 41, .src = "RTC Timer"}, | ||
64 | {.irq_nr = 42, .src = "RTC Alarm"}, | ||
65 | {.irq_nr = 43, .src = "Timer0"}, | ||
66 | {.irq_nr = 44, .src = "Timer1"}, | ||
67 | {.irq_nr = 45, .src = "UART"}, | ||
68 | {.irq_nr = 46, .src = "GPIO0"}, | ||
69 | {.irq_nr = 48, .src = "MPU_WAKE"}, | ||
70 | {.irq_nr = 49, .src = "WDT0"}, | ||
71 | {.irq_nr = 50, .src = "WDT1"}, | ||
72 | {.irq_nr = 51, .src = "ADC_TSC"}, | ||
73 | {.irq_nr = 0, .src = "Unknown"}, | ||
74 | }; | ||
75 | |||
58 | static void am33xx_txev_eoi(struct wkup_m3_ipc *m3_ipc) | 76 | static void am33xx_txev_eoi(struct wkup_m3_ipc *m3_ipc) |
59 | { | 77 | { |
60 | writel(AM33XX_M3_TXEV_ACK, | 78 | writel(AM33XX_M3_TXEV_ACK, |
@@ -329,12 +347,45 @@ static int wkup_m3_finish_low_power(struct wkup_m3_ipc *m3_ipc) | |||
329 | return 0; | 347 | return 0; |
330 | } | 348 | } |
331 | 349 | ||
350 | /** | ||
351 | * wkup_m3_request_wake_src - Get the wakeup source info passed from wkup_m3 | ||
352 | * @m3_ipc: Pointer to wkup_m3_ipc context | ||
353 | */ | ||
354 | static const char *wkup_m3_request_wake_src(struct wkup_m3_ipc *m3_ipc) | ||
355 | { | ||
356 | unsigned int wakeup_src_idx; | ||
357 | int j, val; | ||
358 | |||
359 | val = wkup_m3_ctrl_ipc_read(m3_ipc, 6); | ||
360 | |||
361 | wakeup_src_idx = val & M3_WAKE_SRC_MASK; | ||
362 | |||
363 | for (j = 0; j < ARRAY_SIZE(wakeups) - 1; j++) { | ||
364 | if (wakeups[j].irq_nr == wakeup_src_idx) | ||
365 | return wakeups[j].src; | ||
366 | } | ||
367 | return wakeups[j].src; | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * wkup_m3_set_rtc_only - Set the rtc_only flag | ||
372 | * @wkup_m3_wakeup: struct wkup_m3_wakeup_src * gets assigned the | ||
373 | * wakeup src value | ||
374 | */ | ||
375 | static void wkup_m3_set_rtc_only(struct wkup_m3_ipc *m3_ipc) | ||
376 | { | ||
377 | if (m3_ipc_state) | ||
378 | m3_ipc_state->is_rtc_only = true; | ||
379 | } | ||
380 | |||
332 | static struct wkup_m3_ipc_ops ipc_ops = { | 381 | static struct wkup_m3_ipc_ops ipc_ops = { |
333 | .set_mem_type = wkup_m3_set_mem_type, | 382 | .set_mem_type = wkup_m3_set_mem_type, |
334 | .set_resume_address = wkup_m3_set_resume_address, | 383 | .set_resume_address = wkup_m3_set_resume_address, |
335 | .prepare_low_power = wkup_m3_prepare_low_power, | 384 | .prepare_low_power = wkup_m3_prepare_low_power, |
336 | .finish_low_power = wkup_m3_finish_low_power, | 385 | .finish_low_power = wkup_m3_finish_low_power, |
337 | .request_pm_status = wkup_m3_request_pm_status, | 386 | .request_pm_status = wkup_m3_request_pm_status, |
387 | .request_wake_src = wkup_m3_request_wake_src, | ||
388 | .set_rtc_only = wkup_m3_set_rtc_only, | ||
338 | }; | 389 | }; |
339 | 390 | ||
340 | /** | 391 | /** |
@@ -484,6 +535,30 @@ static int wkup_m3_ipc_remove(struct platform_device *pdev) | |||
484 | return 0; | 535 | return 0; |
485 | } | 536 | } |
486 | 537 | ||
538 | static int __maybe_unused wkup_m3_ipc_suspend(struct device *dev) | ||
539 | { | ||
540 | /* | ||
541 | * Nothing needs to be done on suspend even with rtc_only flag set | ||
542 | */ | ||
543 | return 0; | ||
544 | } | ||
545 | |||
546 | static int __maybe_unused wkup_m3_ipc_resume(struct device *dev) | ||
547 | { | ||
548 | if (m3_ipc_state->is_rtc_only) { | ||
549 | rproc_shutdown(m3_ipc_state->rproc); | ||
550 | rproc_boot(m3_ipc_state->rproc); | ||
551 | } | ||
552 | |||
553 | m3_ipc_state->is_rtc_only = false; | ||
554 | |||
555 | return 0; | ||
556 | } | ||
557 | |||
558 | static const struct dev_pm_ops wkup_m3_ipc_pm_ops = { | ||
559 | SET_SYSTEM_SLEEP_PM_OPS(wkup_m3_ipc_suspend, wkup_m3_ipc_resume) | ||
560 | }; | ||
561 | |||
487 | static const struct of_device_id wkup_m3_ipc_of_match[] = { | 562 | static const struct of_device_id wkup_m3_ipc_of_match[] = { |
488 | { .compatible = "ti,am3352-wkup-m3-ipc", }, | 563 | { .compatible = "ti,am3352-wkup-m3-ipc", }, |
489 | { .compatible = "ti,am4372-wkup-m3-ipc", }, | 564 | { .compatible = "ti,am4372-wkup-m3-ipc", }, |
@@ -497,6 +572,7 @@ static struct platform_driver wkup_m3_ipc_driver = { | |||
497 | .driver = { | 572 | .driver = { |
498 | .name = "wkup_m3_ipc", | 573 | .name = "wkup_m3_ipc", |
499 | .of_match_table = wkup_m3_ipc_of_match, | 574 | .of_match_table = wkup_m3_ipc_of_match, |
575 | .pm = &wkup_m3_ipc_pm_ops, | ||
500 | }, | 576 | }, |
501 | }; | 577 | }; |
502 | 578 | ||
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index 396fb3d56398..1abf76be2aa8 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig | |||
@@ -90,8 +90,6 @@ source "drivers/staging/clocking-wizard/Kconfig" | |||
90 | 90 | ||
91 | source "drivers/staging/fbtft/Kconfig" | 91 | source "drivers/staging/fbtft/Kconfig" |
92 | 92 | ||
93 | source "drivers/staging/fsl-mc/Kconfig" | ||
94 | |||
95 | source "drivers/staging/fsl-dpaa2/Kconfig" | 93 | source "drivers/staging/fsl-dpaa2/Kconfig" |
96 | 94 | ||
97 | source "drivers/staging/wilc1000/Kconfig" | 95 | source "drivers/staging/wilc1000/Kconfig" |
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index ad7b4ca412ef..ab0cbe8815b1 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile | |||
@@ -35,7 +35,6 @@ obj-$(CONFIG_GS_FPGABOOT) += gs_fpgaboot/ | |||
35 | obj-$(CONFIG_UNISYSSPAR) += unisys/ | 35 | obj-$(CONFIG_UNISYSSPAR) += unisys/ |
36 | obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ | 36 | obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ |
37 | obj-$(CONFIG_FB_TFT) += fbtft/ | 37 | obj-$(CONFIG_FB_TFT) += fbtft/ |
38 | obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ | ||
39 | obj-$(CONFIG_FSL_DPAA2) += fsl-dpaa2/ | 38 | obj-$(CONFIG_FSL_DPAA2) += fsl-dpaa2/ |
40 | obj-$(CONFIG_WILC1000) += wilc1000/ | 39 | obj-$(CONFIG_WILC1000) += wilc1000/ |
41 | obj-$(CONFIG_MOST) += most/ | 40 | obj-$(CONFIG_MOST) += most/ |
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index e2dac44eccbe..9329fcad95ac 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | |||
@@ -426,7 +426,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv, | |||
426 | dpaa2_fd_set_format(fd, dpaa2_fd_sg); | 426 | dpaa2_fd_set_format(fd, dpaa2_fd_sg); |
427 | dpaa2_fd_set_addr(fd, addr); | 427 | dpaa2_fd_set_addr(fd, addr); |
428 | dpaa2_fd_set_len(fd, skb->len); | 428 | dpaa2_fd_set_len(fd, skb->len); |
429 | dpaa2_fd_set_ctrl(fd, DPAA2_FD_CTRL_PTA | DPAA2_FD_CTRL_PTV1); | 429 | dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA | FD_CTRL_PTV1); |
430 | 430 | ||
431 | if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) | 431 | if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) |
432 | enable_tx_tstamp(fd, sgt_buf); | 432 | enable_tx_tstamp(fd, sgt_buf); |
@@ -479,7 +479,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv, | |||
479 | dpaa2_fd_set_offset(fd, (u16)(skb->data - buffer_start)); | 479 | dpaa2_fd_set_offset(fd, (u16)(skb->data - buffer_start)); |
480 | dpaa2_fd_set_len(fd, skb->len); | 480 | dpaa2_fd_set_len(fd, skb->len); |
481 | dpaa2_fd_set_format(fd, dpaa2_fd_single); | 481 | dpaa2_fd_set_format(fd, dpaa2_fd_single); |
482 | dpaa2_fd_set_ctrl(fd, DPAA2_FD_CTRL_PTA | DPAA2_FD_CTRL_PTV1); | 482 | dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA | FD_CTRL_PTV1); |
483 | 483 | ||
484 | if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) | 484 | if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) |
485 | enable_tx_tstamp(fd, buffer_start); | 485 | enable_tx_tstamp(fd, buffer_start); |
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h index 506466778b2c..d54cb0b99d08 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | |||
@@ -10,8 +10,8 @@ | |||
10 | #include <linux/if_vlan.h> | 10 | #include <linux/if_vlan.h> |
11 | #include <linux/fsl/mc.h> | 11 | #include <linux/fsl/mc.h> |
12 | 12 | ||
13 | #include "../../fsl-mc/include/dpaa2-io.h" | 13 | #include <soc/fsl/dpaa2-io.h> |
14 | #include "../../fsl-mc/include/dpaa2-fd.h" | 14 | #include <soc/fsl/dpaa2-fd.h> |
15 | #include "dpni.h" | 15 | #include "dpni.h" |
16 | #include "dpni-cmd.h" | 16 | #include "dpni-cmd.h" |
17 | 17 | ||
@@ -97,21 +97,13 @@ struct dpaa2_eth_swa { | |||
97 | #define DPAA2_FD_FRC_FAICFDV 0x0400 | 97 | #define DPAA2_FD_FRC_FAICFDV 0x0400 |
98 | 98 | ||
99 | /* Error bits in FD CTRL */ | 99 | /* Error bits in FD CTRL */ |
100 | #define DPAA2_FD_CTRL_UFD 0x00000004 | 100 | #define DPAA2_FD_RX_ERR_MASK (FD_CTRL_SBE | FD_CTRL_FAERR) |
101 | #define DPAA2_FD_CTRL_SBE 0x00000008 | 101 | #define DPAA2_FD_TX_ERR_MASK (FD_CTRL_UFD | \ |
102 | #define DPAA2_FD_CTRL_FSE 0x00000020 | 102 | FD_CTRL_SBE | \ |
103 | #define DPAA2_FD_CTRL_FAERR 0x00000040 | 103 | FD_CTRL_FSE | \ |
104 | 104 | FD_CTRL_FAERR) | |
105 | #define DPAA2_FD_RX_ERR_MASK (DPAA2_FD_CTRL_SBE | \ | ||
106 | DPAA2_FD_CTRL_FAERR) | ||
107 | #define DPAA2_FD_TX_ERR_MASK (DPAA2_FD_CTRL_UFD | \ | ||
108 | DPAA2_FD_CTRL_SBE | \ | ||
109 | DPAA2_FD_CTRL_FSE | \ | ||
110 | DPAA2_FD_CTRL_FAERR) | ||
111 | 105 | ||
112 | /* Annotation bits in FD CTRL */ | 106 | /* Annotation bits in FD CTRL */ |
113 | #define DPAA2_FD_CTRL_PTA 0x00800000 | ||
114 | #define DPAA2_FD_CTRL_PTV1 0x00400000 | ||
115 | #define DPAA2_FD_CTRL_ASAL 0x00020000 /* ASAL = 128B */ | 107 | #define DPAA2_FD_CTRL_ASAL 0x00020000 /* ASAL = 128B */ |
116 | 108 | ||
117 | /* Frame annotation status */ | 109 | /* Frame annotation status */ |
diff --git a/drivers/staging/fsl-mc/Kconfig b/drivers/staging/fsl-mc/Kconfig deleted file mode 100644 index 3002229bec1b..000000000000 --- a/drivers/staging/fsl-mc/Kconfig +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | source "drivers/staging/fsl-mc/bus/Kconfig" | ||
diff --git a/drivers/staging/fsl-mc/Makefile b/drivers/staging/fsl-mc/Makefile deleted file mode 100644 index 14683889dabd..000000000000 --- a/drivers/staging/fsl-mc/Makefile +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # Freescale Management Complex (MC) bus drivers | ||
3 | obj-$(CONFIG_FSL_MC_BUS) += bus/ | ||
diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig deleted file mode 100644 index 342453035269..000000000000 --- a/drivers/staging/fsl-mc/bus/Kconfig +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # | ||
3 | # DPAA2 fsl-mc bus | ||
4 | # | ||
5 | # Copyright (C) 2014-2016 Freescale Semiconductor, Inc. | ||
6 | # | ||
7 | |||
8 | config FSL_MC_DPIO | ||
9 | tristate "QorIQ DPAA2 DPIO driver" | ||
10 | depends on FSL_MC_BUS | ||
11 | help | ||
12 | Driver for the DPAA2 DPIO object. A DPIO provides queue and | ||
13 | buffer management facilities for software to interact with | ||
14 | other DPAA2 objects. This driver does not expose the DPIO | ||
15 | objects individually, but groups them under a service layer | ||
16 | API. | ||
diff --git a/drivers/staging/fsl-mc/bus/Makefile b/drivers/staging/fsl-mc/bus/Makefile deleted file mode 100644 index 21d8ebc8ce21..000000000000 --- a/drivers/staging/fsl-mc/bus/Makefile +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
2 | # | ||
3 | # Freescale Management Complex (MC) bus drivers | ||
4 | # | ||
5 | # Copyright (C) 2014 Freescale Semiconductor, Inc. | ||
6 | # | ||
7 | |||
8 | # MC DPIO driver | ||
9 | obj-$(CONFIG_FSL_MC_DPIO) += dpio/ | ||
diff --git a/drivers/tee/optee/Kconfig b/drivers/tee/optee/Kconfig index 0126de898036..3c59e19029be 100644 --- a/drivers/tee/optee/Kconfig +++ b/drivers/tee/optee/Kconfig | |||
@@ -5,3 +5,11 @@ config OPTEE | |||
5 | help | 5 | help |
6 | This implements the OP-TEE Trusted Execution Environment (TEE) | 6 | This implements the OP-TEE Trusted Execution Environment (TEE) |
7 | driver. | 7 | driver. |
8 | |||
9 | config OPTEE_SHM_NUM_PRIV_PAGES | ||
10 | int "Private Shared Memory Pages" | ||
11 | default 1 | ||
12 | depends on OPTEE | ||
13 | help | ||
14 | This sets the number of private shared memory pages to be | ||
15 | used by OP-TEE TEE driver. | ||
diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index e5fd5ed217da..e1aafe842d66 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define DRIVER_NAME "optee" | 33 | #define DRIVER_NAME "optee" |
34 | 34 | ||
35 | #define OPTEE_SHM_NUM_PRIV_PAGES 1 | 35 | #define OPTEE_SHM_NUM_PRIV_PAGES CONFIG_OPTEE_SHM_NUM_PRIV_PAGES |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * optee_from_msg_param() - convert from OPTEE_MSG parameters to | 38 | * optee_from_msg_param() - convert from OPTEE_MSG parameters to |
diff --git a/drivers/tee/optee/rpc.c b/drivers/tee/optee/rpc.c index 41aea12e2bcc..b45c73dd37a5 100644 --- a/drivers/tee/optee/rpc.c +++ b/drivers/tee/optee/rpc.c | |||
@@ -48,7 +48,7 @@ static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) | |||
48 | OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT) | 48 | OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT) |
49 | goto bad; | 49 | goto bad; |
50 | 50 | ||
51 | getnstimeofday64(&ts); | 51 | ktime_get_real_ts64(&ts); |
52 | arg->params[0].u.value.a = ts.tv_sec; | 52 | arg->params[0].u.value.a = ts.tv_sec; |
53 | arg->params[0].u.value.b = ts.tv_nsec; | 53 | arg->params[0].u.value.b = ts.tv_nsec; |
54 | 54 | ||
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index d9145a8f35d2..8e3bab1e0c1f 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c | |||
@@ -161,16 +161,10 @@ static int exynos_ehci_probe(struct platform_device *pdev) | |||
161 | } | 161 | } |
162 | exynos_ehci = to_exynos_ehci(hcd); | 162 | exynos_ehci = to_exynos_ehci(hcd); |
163 | 163 | ||
164 | if (of_device_is_compatible(pdev->dev.of_node, | ||
165 | "samsung,exynos5440-ehci")) | ||
166 | goto skip_phy; | ||
167 | |||
168 | err = exynos_ehci_get_phy(&pdev->dev, exynos_ehci); | 164 | err = exynos_ehci_get_phy(&pdev->dev, exynos_ehci); |
169 | if (err) | 165 | if (err) |
170 | goto fail_clk; | 166 | goto fail_clk; |
171 | 167 | ||
172 | skip_phy: | ||
173 | |||
174 | exynos_ehci->clk = devm_clk_get(&pdev->dev, "usbhost"); | 168 | exynos_ehci->clk = devm_clk_get(&pdev->dev, "usbhost"); |
175 | 169 | ||
176 | if (IS_ERR(exynos_ehci->clk)) { | 170 | if (IS_ERR(exynos_ehci->clk)) { |
@@ -304,7 +298,6 @@ static const struct dev_pm_ops exynos_ehci_pm_ops = { | |||
304 | #ifdef CONFIG_OF | 298 | #ifdef CONFIG_OF |
305 | static const struct of_device_id exynos_ehci_match[] = { | 299 | static const struct of_device_id exynos_ehci_match[] = { |
306 | { .compatible = "samsung,exynos4210-ehci" }, | 300 | { .compatible = "samsung,exynos4210-ehci" }, |
307 | { .compatible = "samsung,exynos5440-ehci" }, | ||
308 | {}, | 301 | {}, |
309 | }; | 302 | }; |
310 | MODULE_DEVICE_TABLE(of, exynos_ehci_match); | 303 | MODULE_DEVICE_TABLE(of, exynos_ehci_match); |
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index a39fae41bc70..c0c4dcca6f3c 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
@@ -130,15 +130,10 @@ static int exynos_ohci_probe(struct platform_device *pdev) | |||
130 | 130 | ||
131 | exynos_ohci = to_exynos_ohci(hcd); | 131 | exynos_ohci = to_exynos_ohci(hcd); |
132 | 132 | ||
133 | if (of_device_is_compatible(pdev->dev.of_node, | ||
134 | "samsung,exynos5440-ohci")) | ||
135 | goto skip_phy; | ||
136 | |||
137 | err = exynos_ohci_get_phy(&pdev->dev, exynos_ohci); | 133 | err = exynos_ohci_get_phy(&pdev->dev, exynos_ohci); |
138 | if (err) | 134 | if (err) |
139 | goto fail_clk; | 135 | goto fail_clk; |
140 | 136 | ||
141 | skip_phy: | ||
142 | exynos_ohci->clk = devm_clk_get(&pdev->dev, "usbhost"); | 137 | exynos_ohci->clk = devm_clk_get(&pdev->dev, "usbhost"); |
143 | 138 | ||
144 | if (IS_ERR(exynos_ohci->clk)) { | 139 | if (IS_ERR(exynos_ohci->clk)) { |
@@ -270,7 +265,6 @@ static const struct dev_pm_ops exynos_ohci_pm_ops = { | |||
270 | #ifdef CONFIG_OF | 265 | #ifdef CONFIG_OF |
271 | static const struct of_device_id exynos_ohci_match[] = { | 266 | static const struct of_device_id exynos_ohci_match[] = { |
272 | { .compatible = "samsung,exynos4210-ohci" }, | 267 | { .compatible = "samsung,exynos4210-ohci" }, |
273 | { .compatible = "samsung,exynos5440-ohci" }, | ||
274 | {}, | 268 | {}, |
275 | }; | 269 | }; |
276 | MODULE_DEVICE_TABLE(of, exynos_ohci_match); | 270 | MODULE_DEVICE_TABLE(of, exynos_ohci_match); |
diff --git a/include/dt-bindings/bus/ti-sysc.h b/include/dt-bindings/bus/ti-sysc.h index 2c005376ac0e..7138384e2ef9 100644 --- a/include/dt-bindings/bus/ti-sysc.h +++ b/include/dt-bindings/bus/ti-sysc.h | |||
@@ -15,6 +15,8 @@ | |||
15 | /* SmartReflex sysc found on 36xx and later */ | 15 | /* SmartReflex sysc found on 36xx and later */ |
16 | #define SYSC_OMAP3_SR_ENAWAKEUP (1 << 26) | 16 | #define SYSC_OMAP3_SR_ENAWAKEUP (1 << 26) |
17 | 17 | ||
18 | #define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4) | ||
19 | |||
18 | /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ | 20 | /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ |
19 | #define SYSC_IDLE_FORCE 0 | 21 | #define SYSC_IDLE_FORCE 0 |
20 | #define SYSC_IDLE_NO 1 | 22 | #define SYSC_IDLE_NO 1 |
diff --git a/include/dt-bindings/clock/dra7.h b/include/dt-bindings/clock/dra7.h index 5e1061b15aed..d7549c57cac3 100644 --- a/include/dt-bindings/clock/dra7.h +++ b/include/dt-bindings/clock/dra7.h | |||
@@ -168,5 +168,6 @@ | |||
168 | #define DRA7_COUNTER_32K_CLKCTRL DRA7_CLKCTRL_INDEX(0x50) | 168 | #define DRA7_COUNTER_32K_CLKCTRL DRA7_CLKCTRL_INDEX(0x50) |
169 | #define DRA7_UART10_CLKCTRL DRA7_CLKCTRL_INDEX(0x80) | 169 | #define DRA7_UART10_CLKCTRL DRA7_CLKCTRL_INDEX(0x80) |
170 | #define DRA7_DCAN1_CLKCTRL DRA7_CLKCTRL_INDEX(0x88) | 170 | #define DRA7_DCAN1_CLKCTRL DRA7_CLKCTRL_INDEX(0x88) |
171 | #define DRA7_ADC_CLKCTRL DRA7_CLKCTRL_INDEX(0xa0) | ||
171 | 172 | ||
172 | #endif | 173 | #endif |
diff --git a/include/dt-bindings/clock/exynos5440.h b/include/dt-bindings/clock/exynos5440.h deleted file mode 100644 index 842cdc0adff1..000000000000 --- a/include/dt-bindings/clock/exynos5440.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. | ||
3 | * Author: Andrzej Hajda <a.hajda@samsung.com> | ||
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 version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * Device Tree binding constants for Exynos5440 clock controller. | ||
10 | */ | ||
11 | |||
12 | #ifndef _DT_BINDINGS_CLOCK_EXYNOS_5440_H | ||
13 | #define _DT_BINDINGS_CLOCK_EXYNOS_5440_H | ||
14 | |||
15 | #define CLK_XTAL 1 | ||
16 | #define CLK_ARM_CLK 2 | ||
17 | #define CLK_CPLLA 3 | ||
18 | #define CLK_CPLLB 4 | ||
19 | #define CLK_SPI_BAUD 16 | ||
20 | #define CLK_PB0_250 17 | ||
21 | #define CLK_PR0_250 18 | ||
22 | #define CLK_PR1_250 19 | ||
23 | #define CLK_B_250 20 | ||
24 | #define CLK_B_125 21 | ||
25 | #define CLK_B_200 22 | ||
26 | #define CLK_SATA 23 | ||
27 | #define CLK_USB 24 | ||
28 | #define CLK_GMAC0 25 | ||
29 | #define CLK_CS250 26 | ||
30 | #define CLK_PB0_250_O 27 | ||
31 | #define CLK_PR0_250_O 28 | ||
32 | #define CLK_PR1_250_O 29 | ||
33 | #define CLK_B_250_O 30 | ||
34 | #define CLK_B_125_O 31 | ||
35 | #define CLK_B_200_O 32 | ||
36 | #define CLK_SATA_O 33 | ||
37 | #define CLK_USB_O 34 | ||
38 | #define CLK_GMAC0_O 35 | ||
39 | #define CLK_CS250_O 36 | ||
40 | |||
41 | /* must be greater than maximal clock id */ | ||
42 | #define CLK_NR_CLKS 37 | ||
43 | |||
44 | #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5440_H */ | ||
diff --git a/include/dt-bindings/reset/qcom,sdm845-aoss.h b/include/dt-bindings/reset/qcom,sdm845-aoss.h new file mode 100644 index 000000000000..476c5fc873b6 --- /dev/null +++ b/include/dt-bindings/reset/qcom,sdm845-aoss.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | /* | ||
3 | * Copyright (C) 2018 The Linux Foundation. All rights reserved. | ||
4 | */ | ||
5 | |||
6 | #ifndef _DT_BINDINGS_RESET_AOSS_SDM_845_H | ||
7 | #define _DT_BINDINGS_RESET_AOSS_SDM_845_H | ||
8 | |||
9 | #define AOSS_CC_MSS_RESTART 0 | ||
10 | #define AOSS_CC_CAMSS_RESTART 1 | ||
11 | #define AOSS_CC_VENUS_RESTART 2 | ||
12 | #define AOSS_CC_GPU_RESTART 3 | ||
13 | #define AOSS_CC_DISPSS_RESTART 4 | ||
14 | #define AOSS_CC_WCSS_RESTART 5 | ||
15 | #define AOSS_CC_LPASS_RESTART 6 | ||
16 | |||
17 | #endif | ||
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h index 990aad477458..2efa3470a451 100644 --- a/include/linux/platform_data/ti-sysc.h +++ b/include/linux/platform_data/ti-sysc.h | |||
@@ -14,6 +14,7 @@ enum ti_sysc_module_type { | |||
14 | TI_SYSC_OMAP4_SR, | 14 | TI_SYSC_OMAP4_SR, |
15 | TI_SYSC_OMAP4_MCASP, | 15 | TI_SYSC_OMAP4_MCASP, |
16 | TI_SYSC_OMAP4_USB_HOST_FS, | 16 | TI_SYSC_OMAP4_USB_HOST_FS, |
17 | TI_SYSC_DRA7_MCAN, | ||
17 | }; | 18 | }; |
18 | 19 | ||
19 | struct ti_sysc_cookie { | 20 | struct ti_sysc_cookie { |
diff --git a/include/linux/wkup_m3_ipc.h b/include/linux/wkup_m3_ipc.h index d6ba7d39a62f..e497e621dbb7 100644 --- a/include/linux/wkup_m3_ipc.h +++ b/include/linux/wkup_m3_ipc.h | |||
@@ -40,6 +40,12 @@ struct wkup_m3_ipc { | |||
40 | struct mbox_chan *mbox; | 40 | struct mbox_chan *mbox; |
41 | 41 | ||
42 | struct wkup_m3_ipc_ops *ops; | 42 | struct wkup_m3_ipc_ops *ops; |
43 | int is_rtc_only; | ||
44 | }; | ||
45 | |||
46 | struct wkup_m3_wakeup_src { | ||
47 | int irq_nr; | ||
48 | char src[10]; | ||
43 | }; | 49 | }; |
44 | 50 | ||
45 | struct wkup_m3_ipc_ops { | 51 | struct wkup_m3_ipc_ops { |
@@ -48,8 +54,11 @@ struct wkup_m3_ipc_ops { | |||
48 | int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state); | 54 | int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state); |
49 | int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc); | 55 | int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc); |
50 | int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc); | 56 | int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc); |
57 | const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc); | ||
58 | void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc); | ||
51 | }; | 59 | }; |
52 | 60 | ||
53 | struct wkup_m3_ipc *wkup_m3_ipc_get(void); | 61 | struct wkup_m3_ipc *wkup_m3_ipc_get(void); |
54 | void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc); | 62 | void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc); |
63 | void wkup_m3_set_rtc_only_mode(void); | ||
55 | #endif /* _LINUX_WKUP_M3_IPC_H */ | 64 | #endif /* _LINUX_WKUP_M3_IPC_H */ |
diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h index 8ee8991aa099..c4a5c9e9fb47 100644 --- a/include/soc/bcm2835/raspberrypi-firmware.h +++ b/include/soc/bcm2835/raspberrypi-firmware.h | |||
@@ -75,6 +75,7 @@ enum rpi_firmware_property_tag { | |||
75 | RPI_FIRMWARE_GET_EDID_BLOCK = 0x00030020, | 75 | RPI_FIRMWARE_GET_EDID_BLOCK = 0x00030020, |
76 | RPI_FIRMWARE_GET_CUSTOMER_OTP = 0x00030021, | 76 | RPI_FIRMWARE_GET_CUSTOMER_OTP = 0x00030021, |
77 | RPI_FIRMWARE_GET_DOMAIN_STATE = 0x00030030, | 77 | RPI_FIRMWARE_GET_DOMAIN_STATE = 0x00030030, |
78 | RPI_FIRMWARE_GET_THROTTLED = 0x00030046, | ||
78 | RPI_FIRMWARE_SET_CLOCK_STATE = 0x00038001, | 79 | RPI_FIRMWARE_SET_CLOCK_STATE = 0x00038001, |
79 | RPI_FIRMWARE_SET_CLOCK_RATE = 0x00038002, | 80 | RPI_FIRMWARE_SET_CLOCK_RATE = 0x00038002, |
80 | RPI_FIRMWARE_SET_VOLTAGE = 0x00038003, | 81 | RPI_FIRMWARE_SET_VOLTAGE = 0x00038003, |
diff --git a/drivers/staging/fsl-mc/include/dpaa2-fd.h b/include/soc/fsl/dpaa2-fd.h index b55b89ba4eda..2576abaa7779 100644 --- a/drivers/staging/fsl-mc/include/dpaa2-fd.h +++ b/include/soc/fsl/dpaa2-fd.h | |||
@@ -67,6 +67,18 @@ struct dpaa2_fd { | |||
67 | #define SG_FINAL_FLAG_MASK 0x1 | 67 | #define SG_FINAL_FLAG_MASK 0x1 |
68 | #define SG_FINAL_FLAG_SHIFT 15 | 68 | #define SG_FINAL_FLAG_SHIFT 15 |
69 | 69 | ||
70 | /* Error bits in FD CTRL */ | ||
71 | #define FD_CTRL_ERR_MASK 0x000000FF | ||
72 | #define FD_CTRL_UFD 0x00000004 | ||
73 | #define FD_CTRL_SBE 0x00000008 | ||
74 | #define FD_CTRL_FLC 0x00000010 | ||
75 | #define FD_CTRL_FSE 0x00000020 | ||
76 | #define FD_CTRL_FAERR 0x00000040 | ||
77 | |||
78 | /* Annotation bits in FD CTRL */ | ||
79 | #define FD_CTRL_PTA 0x00800000 | ||
80 | #define FD_CTRL_PTV1 0x00400000 | ||
81 | |||
70 | enum dpaa2_fd_format { | 82 | enum dpaa2_fd_format { |
71 | dpaa2_fd_single = 0, | 83 | dpaa2_fd_single = 0, |
72 | dpaa2_fd_list, | 84 | dpaa2_fd_list, |
diff --git a/drivers/staging/fsl-mc/include/dpaa2-global.h b/include/soc/fsl/dpaa2-global.h index 9bc0713346a8..9bc0713346a8 100644 --- a/drivers/staging/fsl-mc/include/dpaa2-global.h +++ b/include/soc/fsl/dpaa2-global.h | |||
diff --git a/drivers/staging/fsl-mc/include/dpaa2-io.h b/include/soc/fsl/dpaa2-io.h index ab51e40d11db..ab51e40d11db 100644 --- a/drivers/staging/fsl-mc/include/dpaa2-io.h +++ b/include/soc/fsl/dpaa2-io.h | |||