diff options
author | Olof Johansson <olof@lixom.net> | 2013-08-14 02:33:07 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-08-14 02:33:07 -0400 |
commit | 8b2496a22810531cb9157191cd0264bae8efeca0 (patch) | |
tree | 04b3e07e094df65b2ea083eea30af6ac9a15c34e /arch/arm | |
parent | bee22087faf5bbf33fcb61e6c5e8f8ef7ebd77a5 (diff) | |
parent | 4380c39ad3efbe58d7ed3b6adf6e602b23402b1e (diff) |
Merge tag 'v3.12-pwm-cleanup-for-olof' of git://github.com/tom3q/linux into next/cleanup
From Tomasz Figa:
Here is the Samsung PWM cleanup series. Particular patches of the series
involve following modifications:
- fixing up few things in samsung_pwm_timer clocksource driver,
- moving remaining Samsung platforms to the new clocksource driver,
- removing old clocksource driver,
- adding new multiplatform- and DT-aware PWM driver,
- moving all Samsung platforms to use the new PWM driver,
- removing old PWM driver,
- removing all PWM-related code that is not used anymore.
* tag 'v3.12-pwm-cleanup-for-olof' of git://github.com/tom3q/linux: (684 commits)
ARM: SAMSUNG: Remove plat/regs-timer.h header
ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header
ARM: SAMSUNG: Remove pwm-clock infrastructure
ARM: SAMSUNG: Remove old PWM timer platform devices
pwm: Remove superseded pwm-samsung-legacy driver
ARM: SAMSUNG: Modify board files to use new PWM platform device
ARM: SAMSUNG: Rework private data handling in dev-backlight
pwm: Add new pwm-samsung driver
pwm: samsung: Rename to pwm-samsung-legacy
ARM: SAMSUNG: Remove unused PWM timer IRQ chip code
ARM: SAMSUNG: Remove old samsung-time driver
ARM: SAMSUNG: Move all platforms to new clocksource driver
ARM: SAMSUNG: Set PWM platform data
ARM: SAMSUNG: Add new PWM platform device
ARM: SAMSUNG: Unify base address definitions of timer block
clocksource: samsung_pwm_timer: Handle suspend/resume correctly
clocksource: samsung_pwm_timer: Do not use clocksource_mmio
clocksource: samsung_pwm_timer: Cache clocksource register address
clocksource: samsung_pwm_timer: Correct definition of AUTORELOAD bit
clocksource: samsung_pwm_timer: Do not request PWM mem region
+ v3.11-rc4
Conflicts:
arch/arm/Kconfig.debug
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm')
139 files changed, 921 insertions, 1806 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 944fd5ae44cb..39119d64287c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -20,7 +20,6 @@ config ARM | |||
20 | select GENERIC_STRNCPY_FROM_USER | 20 | select GENERIC_STRNCPY_FROM_USER |
21 | select GENERIC_STRNLEN_USER | 21 | select GENERIC_STRNLEN_USER |
22 | select HARDIRQS_SW_RESEND | 22 | select HARDIRQS_SW_RESEND |
23 | select HAVE_AOUT | ||
24 | select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL | 23 | select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL |
25 | select HAVE_ARCH_KGDB | 24 | select HAVE_ARCH_KGDB |
26 | select HAVE_ARCH_SECCOMP_FILTER | 25 | select HAVE_ARCH_SECCOMP_FILTER |
@@ -218,7 +217,8 @@ config VECTORS_BASE | |||
218 | default DRAM_BASE if REMAP_VECTORS_TO_RAM | 217 | default DRAM_BASE if REMAP_VECTORS_TO_RAM |
219 | default 0x00000000 | 218 | default 0x00000000 |
220 | help | 219 | help |
221 | The base address of exception vectors. | 220 | The base address of exception vectors. This must be two pages |
221 | in size. | ||
222 | 222 | ||
223 | config ARM_PATCH_PHYS_VIRT | 223 | config ARM_PATCH_PHYS_VIRT |
224 | bool "Patch physical to virtual translations at runtime" if EMBEDDED | 224 | bool "Patch physical to virtual translations at runtime" if EMBEDDED |
@@ -701,7 +701,7 @@ config ARCH_S3C24XX | |||
701 | select ARCH_HAS_CPUFREQ | 701 | select ARCH_HAS_CPUFREQ |
702 | select ARCH_REQUIRE_GPIOLIB | 702 | select ARCH_REQUIRE_GPIOLIB |
703 | select CLKDEV_LOOKUP | 703 | select CLKDEV_LOOKUP |
704 | select CLKSRC_MMIO | 704 | select CLKSRC_SAMSUNG_PWM |
705 | select GENERIC_CLOCKEVENTS | 705 | select GENERIC_CLOCKEVENTS |
706 | select GPIO_SAMSUNG | 706 | select GPIO_SAMSUNG |
707 | select HAVE_CLK | 707 | select HAVE_CLK |
@@ -724,7 +724,7 @@ config ARCH_S3C64XX | |||
724 | select ARCH_REQUIRE_GPIOLIB | 724 | select ARCH_REQUIRE_GPIOLIB |
725 | select ARM_VIC | 725 | select ARM_VIC |
726 | select CLKDEV_LOOKUP | 726 | select CLKDEV_LOOKUP |
727 | select CLKSRC_MMIO | 727 | select CLKSRC_SAMSUNG_PWM |
728 | select CPU_V6 | 728 | select CPU_V6 |
729 | select GENERIC_CLOCKEVENTS | 729 | select GENERIC_CLOCKEVENTS |
730 | select GPIO_SAMSUNG | 730 | select GPIO_SAMSUNG |
@@ -740,7 +740,6 @@ config ARCH_S3C64XX | |||
740 | select SAMSUNG_ATAGS | 740 | select SAMSUNG_ATAGS |
741 | select SAMSUNG_CLKSRC | 741 | select SAMSUNG_CLKSRC |
742 | select SAMSUNG_GPIOLIB_4BIT | 742 | select SAMSUNG_GPIOLIB_4BIT |
743 | select SAMSUNG_IRQ_VIC_TIMER | ||
744 | select SAMSUNG_WDT_RESET | 743 | select SAMSUNG_WDT_RESET |
745 | select USB_ARCH_HAS_OHCI | 744 | select USB_ARCH_HAS_OHCI |
746 | help | 745 | help |
@@ -749,7 +748,7 @@ config ARCH_S3C64XX | |||
749 | config ARCH_S5P64X0 | 748 | config ARCH_S5P64X0 |
750 | bool "Samsung S5P6440 S5P6450" | 749 | bool "Samsung S5P6440 S5P6450" |
751 | select CLKDEV_LOOKUP | 750 | select CLKDEV_LOOKUP |
752 | select CLKSRC_MMIO | 751 | select CLKSRC_SAMSUNG_PWM |
753 | select CPU_V6 | 752 | select CPU_V6 |
754 | select GENERIC_CLOCKEVENTS | 753 | select GENERIC_CLOCKEVENTS |
755 | select GPIO_SAMSUNG | 754 | select GPIO_SAMSUNG |
@@ -768,7 +767,7 @@ config ARCH_S5PC100 | |||
768 | bool "Samsung S5PC100" | 767 | bool "Samsung S5PC100" |
769 | select ARCH_REQUIRE_GPIOLIB | 768 | select ARCH_REQUIRE_GPIOLIB |
770 | select CLKDEV_LOOKUP | 769 | select CLKDEV_LOOKUP |
771 | select CLKSRC_MMIO | 770 | select CLKSRC_SAMSUNG_PWM |
772 | select CPU_V7 | 771 | select CPU_V7 |
773 | select GENERIC_CLOCKEVENTS | 772 | select GENERIC_CLOCKEVENTS |
774 | select GPIO_SAMSUNG | 773 | select GPIO_SAMSUNG |
@@ -788,7 +787,7 @@ config ARCH_S5PV210 | |||
788 | select ARCH_HAS_HOLES_MEMORYMODEL | 787 | select ARCH_HAS_HOLES_MEMORYMODEL |
789 | select ARCH_SPARSEMEM_ENABLE | 788 | select ARCH_SPARSEMEM_ENABLE |
790 | select CLKDEV_LOOKUP | 789 | select CLKDEV_LOOKUP |
791 | select CLKSRC_MMIO | 790 | select CLKSRC_SAMSUNG_PWM |
792 | select CPU_V7 | 791 | select CPU_V7 |
793 | select GENERIC_CLOCKEVENTS | 792 | select GENERIC_CLOCKEVENTS |
794 | select GPIO_SAMSUNG | 793 | select GPIO_SAMSUNG |
@@ -1591,8 +1590,7 @@ config ARM_PSCI | |||
1591 | config ARCH_NR_GPIO | 1590 | config ARCH_NR_GPIO |
1592 | int | 1591 | int |
1593 | default 1024 if ARCH_SHMOBILE || ARCH_TEGRA | 1592 | default 1024 if ARCH_SHMOBILE || ARCH_TEGRA |
1594 | default 512 if SOC_OMAP5 | 1593 | default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 |
1595 | default 512 if ARCH_KEYSTONE | ||
1596 | default 392 if ARCH_U8500 | 1594 | default 392 if ARCH_U8500 |
1597 | default 352 if ARCH_VT8500 | 1595 | default 352 if ARCH_VT8500 |
1598 | default 288 if ARCH_SUNXI | 1596 | default 288 if ARCH_SUNXI |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 4a62a8d4f3b6..15337833d05d 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -809,9 +809,19 @@ config DEBUG_LL_INCLUDE | |||
809 | 809 | ||
810 | config DEBUG_UNCOMPRESS | 810 | config DEBUG_UNCOMPRESS |
811 | bool | 811 | bool |
812 | default y if (ARCH_MULTIPLATFORM || ARCH_MSM) && DEBUG_LL && \ | 812 | depends on ARCH_MULTIPLATFORM || ARCH_MSM |
813 | !DEBUG_OMAP2PLUS_UART && \ | 813 | default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \ |
814 | !DEBUG_TEGRA_UART | 814 | !DEBUG_TEGRA_UART |
815 | help | ||
816 | This option influences the normal decompressor output for | ||
817 | multiplatform kernels. Normally, multiplatform kernels disable | ||
818 | decompressor output because it is not possible to know where to | ||
819 | send the decompressor output. | ||
820 | |||
821 | When this option is set, the selected DEBUG_LL output method | ||
822 | will be re-used for normal decompressor output on multiplatform | ||
823 | kernels. | ||
824 | |||
815 | 825 | ||
816 | config UNCOMPRESS_INCLUDE | 826 | config UNCOMPRESS_INCLUDE |
817 | string | 827 | string |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c0ac0f5e5e5c..6fd2ceae305a 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -153,6 +153,7 @@ machine-$(CONFIG_ARCH_DAVINCI) += davinci | |||
153 | machine-$(CONFIG_ARCH_DOVE) += dove | 153 | machine-$(CONFIG_ARCH_DOVE) += dove |
154 | machine-$(CONFIG_ARCH_EBSA110) += ebsa110 | 154 | machine-$(CONFIG_ARCH_EBSA110) += ebsa110 |
155 | machine-$(CONFIG_ARCH_EP93XX) += ep93xx | 155 | machine-$(CONFIG_ARCH_EP93XX) += ep93xx |
156 | machine-$(CONFIG_ARCH_EXYNOS) += exynos | ||
156 | machine-$(CONFIG_ARCH_GEMINI) += gemini | 157 | machine-$(CONFIG_ARCH_GEMINI) += gemini |
157 | machine-$(CONFIG_ARCH_HIGHBANK) += highbank | 158 | machine-$(CONFIG_ARCH_HIGHBANK) += highbank |
158 | machine-$(CONFIG_ARCH_INTEGRATOR) += integrator | 159 | machine-$(CONFIG_ARCH_INTEGRATOR) += integrator |
@@ -160,15 +161,16 @@ machine-$(CONFIG_ARCH_IOP13XX) += iop13xx | |||
160 | machine-$(CONFIG_ARCH_IOP32X) += iop32x | 161 | machine-$(CONFIG_ARCH_IOP32X) += iop32x |
161 | machine-$(CONFIG_ARCH_IOP33X) += iop33x | 162 | machine-$(CONFIG_ARCH_IOP33X) += iop33x |
162 | machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx | 163 | machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx |
164 | machine-$(CONFIG_ARCH_KEYSTONE) += keystone | ||
163 | machine-$(CONFIG_ARCH_KIRKWOOD) += kirkwood | 165 | machine-$(CONFIG_ARCH_KIRKWOOD) += kirkwood |
164 | machine-$(CONFIG_ARCH_KS8695) += ks8695 | 166 | machine-$(CONFIG_ARCH_KS8695) += ks8695 |
165 | machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx | 167 | machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx |
166 | machine-$(CONFIG_ARCH_MMP) += mmp | 168 | machine-$(CONFIG_ARCH_MMP) += mmp |
167 | machine-$(CONFIG_ARCH_MSM) += msm | 169 | machine-$(CONFIG_ARCH_MSM) += msm |
168 | machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 | 170 | machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 |
171 | machine-$(CONFIG_ARCH_MVEBU) += mvebu | ||
169 | machine-$(CONFIG_ARCH_MXC) += imx | 172 | machine-$(CONFIG_ARCH_MXC) += imx |
170 | machine-$(CONFIG_ARCH_MXS) += mxs | 173 | machine-$(CONFIG_ARCH_MXS) += mxs |
171 | machine-$(CONFIG_ARCH_MVEBU) += mvebu | ||
172 | machine-$(CONFIG_ARCH_NETX) += netx | 174 | machine-$(CONFIG_ARCH_NETX) += netx |
173 | machine-$(CONFIG_ARCH_NOMADIK) += nomadik | 175 | machine-$(CONFIG_ARCH_NOMADIK) += nomadik |
174 | machine-$(CONFIG_ARCH_NSPIRE) += nspire | 176 | machine-$(CONFIG_ARCH_NSPIRE) += nspire |
@@ -176,7 +178,6 @@ machine-$(CONFIG_ARCH_OMAP1) += omap1 | |||
176 | machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2 | 178 | machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2 |
177 | machine-$(CONFIG_ARCH_ORION5X) += orion5x | 179 | machine-$(CONFIG_ARCH_ORION5X) += orion5x |
178 | machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell | 180 | machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell |
179 | machine-$(CONFIG_ARCH_SIRF) += prima2 | ||
180 | machine-$(CONFIG_ARCH_PXA) += pxa | 181 | machine-$(CONFIG_ARCH_PXA) += pxa |
181 | machine-$(CONFIG_ARCH_REALVIEW) += realview | 182 | machine-$(CONFIG_ARCH_REALVIEW) += realview |
182 | machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip | 183 | machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip |
@@ -186,25 +187,24 @@ machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx | |||
186 | machine-$(CONFIG_ARCH_S5P64X0) += s5p64x0 | 187 | machine-$(CONFIG_ARCH_S5P64X0) += s5p64x0 |
187 | machine-$(CONFIG_ARCH_S5PC100) += s5pc100 | 188 | machine-$(CONFIG_ARCH_S5PC100) += s5pc100 |
188 | machine-$(CONFIG_ARCH_S5PV210) += s5pv210 | 189 | machine-$(CONFIG_ARCH_S5PV210) += s5pv210 |
189 | machine-$(CONFIG_ARCH_EXYNOS) += exynos | ||
190 | machine-$(CONFIG_ARCH_SA1100) += sa1100 | 190 | machine-$(CONFIG_ARCH_SA1100) += sa1100 |
191 | machine-$(CONFIG_ARCH_SHARK) += shark | 191 | machine-$(CONFIG_ARCH_SHARK) += shark |
192 | machine-$(CONFIG_ARCH_SHMOBILE) += shmobile | 192 | machine-$(CONFIG_ARCH_SHMOBILE) += shmobile |
193 | machine-$(CONFIG_ARCH_SIRF) += prima2 | ||
194 | machine-$(CONFIG_ARCH_SOCFPGA) += socfpga | ||
195 | machine-$(CONFIG_ARCH_STI) += sti | ||
196 | machine-$(CONFIG_ARCH_SUNXI) += sunxi | ||
193 | machine-$(CONFIG_ARCH_TEGRA) += tegra | 197 | machine-$(CONFIG_ARCH_TEGRA) += tegra |
194 | machine-$(CONFIG_ARCH_U300) += u300 | 198 | machine-$(CONFIG_ARCH_U300) += u300 |
195 | machine-$(CONFIG_ARCH_U8500) += ux500 | 199 | machine-$(CONFIG_ARCH_U8500) += ux500 |
196 | machine-$(CONFIG_ARCH_VERSATILE) += versatile | 200 | machine-$(CONFIG_ARCH_VERSATILE) += versatile |
197 | machine-$(CONFIG_ARCH_VEXPRESS) += vexpress | 201 | machine-$(CONFIG_ARCH_VEXPRESS) += vexpress |
202 | machine-$(CONFIG_ARCH_VIRT) += virt | ||
198 | machine-$(CONFIG_ARCH_VT8500) += vt8500 | 203 | machine-$(CONFIG_ARCH_VT8500) += vt8500 |
199 | machine-$(CONFIG_ARCH_W90X900) += w90x900 | 204 | machine-$(CONFIG_ARCH_W90X900) += w90x900 |
205 | machine-$(CONFIG_ARCH_ZYNQ) += zynq | ||
200 | machine-$(CONFIG_FOOTBRIDGE) += footbridge | 206 | machine-$(CONFIG_FOOTBRIDGE) += footbridge |
201 | machine-$(CONFIG_ARCH_SOCFPGA) += socfpga | ||
202 | machine-$(CONFIG_PLAT_SPEAR) += spear | 207 | machine-$(CONFIG_PLAT_SPEAR) += spear |
203 | machine-$(CONFIG_ARCH_STI) += sti | ||
204 | machine-$(CONFIG_ARCH_VIRT) += virt | ||
205 | machine-$(CONFIG_ARCH_ZYNQ) += zynq | ||
206 | machine-$(CONFIG_ARCH_SUNXI) += sunxi | ||
207 | machine-$(CONFIG_ARCH_KEYSTONE) += keystone | ||
208 | 208 | ||
209 | # Platform directory name. This list is sorted alphanumerically | 209 | # Platform directory name. This list is sorted alphanumerically |
210 | # by CONFIG_* macro name. | 210 | # by CONFIG_* macro name. |
diff --git a/arch/arm/boot/dts/atlas6.dtsi b/arch/arm/boot/dts/atlas6.dtsi index 9866cd736dee..a0f2721ea583 100644 --- a/arch/arm/boot/dts/atlas6.dtsi +++ b/arch/arm/boot/dts/atlas6.dtsi | |||
@@ -485,6 +485,12 @@ | |||
485 | sirf,function = "usp0"; | 485 | sirf,function = "usp0"; |
486 | }; | 486 | }; |
487 | }; | 487 | }; |
488 | usp0_uart_nostreamctrl_pins_a: usp0@1 { | ||
489 | usp0 { | ||
490 | sirf,pins = "usp0_uart_nostreamctrl_grp"; | ||
491 | sirf,function = "usp0_uart_nostreamctrl"; | ||
492 | }; | ||
493 | }; | ||
488 | usp1_pins_a: usp1@0 { | 494 | usp1_pins_a: usp1@0 { |
489 | usp1 { | 495 | usp1 { |
490 | sirf,pins = "usp1grp"; | 496 | sirf,pins = "usp1grp"; |
@@ -515,16 +521,16 @@ | |||
515 | sirf,function = "pulse_count"; | 521 | sirf,function = "pulse_count"; |
516 | }; | 522 | }; |
517 | }; | 523 | }; |
518 | cko0_rst_pins_a: cko0_rst@0 { | 524 | cko0_pins_a: cko0@0 { |
519 | cko0_rst { | 525 | cko0 { |
520 | sirf,pins = "cko0_rstgrp"; | 526 | sirf,pins = "cko0grp"; |
521 | sirf,function = "cko0_rst"; | 527 | sirf,function = "cko0"; |
522 | }; | 528 | }; |
523 | }; | 529 | }; |
524 | cko1_rst_pins_a: cko1_rst@0 { | 530 | cko1_pins_a: cko1@0 { |
525 | cko1_rst { | 531 | cko1 { |
526 | sirf,pins = "cko1_rstgrp"; | 532 | sirf,pins = "cko1grp"; |
527 | sirf,function = "cko1_rst"; | 533 | sirf,function = "cko1"; |
528 | }; | 534 | }; |
529 | }; | 535 | }; |
530 | }; | 536 | }; |
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts index 43bf3c796cba..0e7fed47bd8d 100644 --- a/arch/arm/boot/dts/imx28-apx4devkit.dts +++ b/arch/arm/boot/dts/imx28-apx4devkit.dts | |||
@@ -147,7 +147,7 @@ | |||
147 | reg = <0x0a>; | 147 | reg = <0x0a>; |
148 | VDDA-supply = <®_3p3v>; | 148 | VDDA-supply = <®_3p3v>; |
149 | VDDIO-supply = <®_3p3v>; | 149 | VDDIO-supply = <®_3p3v>; |
150 | 150 | clocks = <&saif0>; | |
151 | }; | 151 | }; |
152 | 152 | ||
153 | pcf8563: rtc@51 { | 153 | pcf8563: rtc@51 { |
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts index 1f0d38d7b16f..e035f4664b97 100644 --- a/arch/arm/boot/dts/imx28-evk.dts +++ b/arch/arm/boot/dts/imx28-evk.dts | |||
@@ -195,7 +195,7 @@ | |||
195 | reg = <0x0a>; | 195 | reg = <0x0a>; |
196 | VDDA-supply = <®_3p3v>; | 196 | VDDA-supply = <®_3p3v>; |
197 | VDDIO-supply = <®_3p3v>; | 197 | VDDIO-supply = <®_3p3v>; |
198 | 198 | clocks = <&saif0>; | |
199 | }; | 199 | }; |
200 | 200 | ||
201 | at24@51 { | 201 | at24@51 { |
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts index 880df2f13be8..44d9da57736e 100644 --- a/arch/arm/boot/dts/imx28-m28evk.dts +++ b/arch/arm/boot/dts/imx28-m28evk.dts | |||
@@ -184,7 +184,7 @@ | |||
184 | reg = <0x0a>; | 184 | reg = <0x0a>; |
185 | VDDA-supply = <®_3p3v>; | 185 | VDDA-supply = <®_3p3v>; |
186 | VDDIO-supply = <®_3p3v>; | 186 | VDDIO-supply = <®_3p3v>; |
187 | 187 | clocks = <&saif0>; | |
188 | }; | 188 | }; |
189 | 189 | ||
190 | eeprom: eeprom@51 { | 190 | eeprom: eeprom@51 { |
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index 6a8acb01b1d3..9524a0571281 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi | |||
@@ -837,6 +837,7 @@ | |||
837 | compatible = "fsl,imx28-saif"; | 837 | compatible = "fsl,imx28-saif"; |
838 | reg = <0x80042000 0x2000>; | 838 | reg = <0x80042000 0x2000>; |
839 | interrupts = <59 80>; | 839 | interrupts = <59 80>; |
840 | #clock-cells = <0>; | ||
840 | clocks = <&clks 53>; | 841 | clocks = <&clks 53>; |
841 | dmas = <&dma_apbx 4>; | 842 | dmas = <&dma_apbx 4>; |
842 | dma-names = "rx-tx"; | 843 | dma-names = "rx-tx"; |
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts index 6dd9486c755b..ad3471ca17c7 100644 --- a/arch/arm/boot/dts/imx51-babbage.dts +++ b/arch/arm/boot/dts/imx51-babbage.dts | |||
@@ -61,6 +61,16 @@ | |||
61 | mux-int-port = <2>; | 61 | mux-int-port = <2>; |
62 | mux-ext-port = <3>; | 62 | mux-ext-port = <3>; |
63 | }; | 63 | }; |
64 | |||
65 | clocks { | ||
66 | clk_26M: codec_clock { | ||
67 | compatible = "fixed-clock"; | ||
68 | reg=<0>; | ||
69 | #clock-cells = <0>; | ||
70 | clock-frequency = <26000000>; | ||
71 | gpios = <&gpio4 26 1>; | ||
72 | }; | ||
73 | }; | ||
64 | }; | 74 | }; |
65 | 75 | ||
66 | &esdhc1 { | 76 | &esdhc1 { |
@@ -229,6 +239,7 @@ | |||
229 | MX51_PAD_EIM_A27__GPIO2_21 0x5 | 239 | MX51_PAD_EIM_A27__GPIO2_21 0x5 |
230 | MX51_PAD_CSPI1_SS0__GPIO4_24 0x85 | 240 | MX51_PAD_CSPI1_SS0__GPIO4_24 0x85 |
231 | MX51_PAD_CSPI1_SS1__GPIO4_25 0x85 | 241 | MX51_PAD_CSPI1_SS1__GPIO4_25 0x85 |
242 | MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000 | ||
232 | >; | 243 | >; |
233 | }; | 244 | }; |
234 | }; | 245 | }; |
@@ -255,7 +266,7 @@ | |||
255 | sgtl5000: codec@0a { | 266 | sgtl5000: codec@0a { |
256 | compatible = "fsl,sgtl5000"; | 267 | compatible = "fsl,sgtl5000"; |
257 | reg = <0x0a>; | 268 | reg = <0x0a>; |
258 | clock-frequency = <26000000>; | 269 | clocks = <&clk_26M>; |
259 | VDDA-supply = <&vdig_reg>; | 270 | VDDA-supply = <&vdig_reg>; |
260 | VDDIO-supply = <&vvideo_reg>; | 271 | VDDIO-supply = <&vvideo_reg>; |
261 | }; | 272 | }; |
diff --git a/arch/arm/boot/dts/imx53-mba53.dts b/arch/arm/boot/dts/imx53-mba53.dts index aaa33bc99f78..a63090267941 100644 --- a/arch/arm/boot/dts/imx53-mba53.dts +++ b/arch/arm/boot/dts/imx53-mba53.dts | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | backlight { | 28 | backlight { |
29 | compatible = "pwm-backlight"; | 29 | compatible = "pwm-backlight"; |
30 | pwms = <&pwm2 0 50000 0 0>; | 30 | pwms = <&pwm2 0 50000>; |
31 | brightness-levels = <0 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100>; | 31 | brightness-levels = <0 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100>; |
32 | default-brightness-level = <10>; | 32 | default-brightness-level = <10>; |
33 | enable-gpios = <&gpio7 7 0>; | 33 | enable-gpios = <&gpio7 7 0>; |
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index 3895fbba8fce..569aa9f2c4ed 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi | |||
@@ -725,15 +725,15 @@ | |||
725 | uart1 { | 725 | uart1 { |
726 | pinctrl_uart1_1: uart1grp-1 { | 726 | pinctrl_uart1_1: uart1grp-1 { |
727 | fsl,pins = < | 727 | fsl,pins = < |
728 | MX53_PAD_CSI0_DAT10__UART1_TXD_MUX 0x1c5 | 728 | MX53_PAD_CSI0_DAT10__UART1_TXD_MUX 0x1e4 |
729 | MX53_PAD_CSI0_DAT11__UART1_RXD_MUX 0x1c5 | 729 | MX53_PAD_CSI0_DAT11__UART1_RXD_MUX 0x1e4 |
730 | >; | 730 | >; |
731 | }; | 731 | }; |
732 | 732 | ||
733 | pinctrl_uart1_2: uart1grp-2 { | 733 | pinctrl_uart1_2: uart1grp-2 { |
734 | fsl,pins = < | 734 | fsl,pins = < |
735 | MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1c5 | 735 | MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4 |
736 | MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1c5 | 736 | MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4 |
737 | >; | 737 | >; |
738 | }; | 738 | }; |
739 | 739 | ||
@@ -748,8 +748,8 @@ | |||
748 | uart2 { | 748 | uart2 { |
749 | pinctrl_uart2_1: uart2grp-1 { | 749 | pinctrl_uart2_1: uart2grp-1 { |
750 | fsl,pins = < | 750 | fsl,pins = < |
751 | MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1c5 | 751 | MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1e4 |
752 | MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1c5 | 752 | MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1e4 |
753 | >; | 753 | >; |
754 | }; | 754 | }; |
755 | 755 | ||
@@ -766,17 +766,17 @@ | |||
766 | uart3 { | 766 | uart3 { |
767 | pinctrl_uart3_1: uart3grp-1 { | 767 | pinctrl_uart3_1: uart3grp-1 { |
768 | fsl,pins = < | 768 | fsl,pins = < |
769 | MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1c5 | 769 | MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4 |
770 | MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1c5 | 770 | MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4 |
771 | MX53_PAD_PATA_DA_1__UART3_CTS 0x1c5 | 771 | MX53_PAD_PATA_DA_1__UART3_CTS 0x1e4 |
772 | MX53_PAD_PATA_DA_2__UART3_RTS 0x1c5 | 772 | MX53_PAD_PATA_DA_2__UART3_RTS 0x1e4 |
773 | >; | 773 | >; |
774 | }; | 774 | }; |
775 | 775 | ||
776 | pinctrl_uart3_2: uart3grp-2 { | 776 | pinctrl_uart3_2: uart3grp-2 { |
777 | fsl,pins = < | 777 | fsl,pins = < |
778 | MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1c5 | 778 | MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4 |
779 | MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1c5 | 779 | MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4 |
780 | >; | 780 | >; |
781 | }; | 781 | }; |
782 | 782 | ||
@@ -785,8 +785,8 @@ | |||
785 | uart4 { | 785 | uart4 { |
786 | pinctrl_uart4_1: uart4grp-1 { | 786 | pinctrl_uart4_1: uart4grp-1 { |
787 | fsl,pins = < | 787 | fsl,pins = < |
788 | MX53_PAD_KEY_COL0__UART4_TXD_MUX 0x1c5 | 788 | MX53_PAD_KEY_COL0__UART4_TXD_MUX 0x1e4 |
789 | MX53_PAD_KEY_ROW0__UART4_RXD_MUX 0x1c5 | 789 | MX53_PAD_KEY_ROW0__UART4_RXD_MUX 0x1e4 |
790 | >; | 790 | >; |
791 | }; | 791 | }; |
792 | }; | 792 | }; |
@@ -794,8 +794,8 @@ | |||
794 | uart5 { | 794 | uart5 { |
795 | pinctrl_uart5_1: uart5grp-1 { | 795 | pinctrl_uart5_1: uart5grp-1 { |
796 | fsl,pins = < | 796 | fsl,pins = < |
797 | MX53_PAD_KEY_COL1__UART5_TXD_MUX 0x1c5 | 797 | MX53_PAD_KEY_COL1__UART5_TXD_MUX 0x1e4 |
798 | MX53_PAD_KEY_ROW1__UART5_RXD_MUX 0x1c5 | 798 | MX53_PAD_KEY_ROW1__UART5_RXD_MUX 0x1e4 |
799 | >; | 799 | >; |
800 | }; | 800 | }; |
801 | }; | 801 | }; |
diff --git a/arch/arm/boot/dts/prima2.dtsi b/arch/arm/boot/dts/prima2.dtsi index 05e9489cf95c..bbeb623fc2c6 100644 --- a/arch/arm/boot/dts/prima2.dtsi +++ b/arch/arm/boot/dts/prima2.dtsi | |||
@@ -515,16 +515,16 @@ | |||
515 | sirf,function = "pulse_count"; | 515 | sirf,function = "pulse_count"; |
516 | }; | 516 | }; |
517 | }; | 517 | }; |
518 | cko0_rst_pins_a: cko0_rst@0 { | 518 | cko0_pins_a: cko0@0 { |
519 | cko0_rst { | 519 | cko0 { |
520 | sirf,pins = "cko0_rstgrp"; | 520 | sirf,pins = "cko0grp"; |
521 | sirf,function = "cko0_rst"; | 521 | sirf,function = "cko0"; |
522 | }; | 522 | }; |
523 | }; | 523 | }; |
524 | cko1_rst_pins_a: cko1_rst@0 { | 524 | cko1_pins_a: cko1@0 { |
525 | cko1_rst { | 525 | cko1 { |
526 | sirf,pins = "cko1_rstgrp"; | 526 | sirf,pins = "cko1grp"; |
527 | sirf,function = "cko1_rst"; | 527 | sirf,function = "cko1"; |
528 | }; | 528 | }; |
529 | }; | 529 | }; |
530 | }; | 530 | }; |
diff --git a/arch/arm/boot/dts/stih416-pinctrl.dtsi b/arch/arm/boot/dts/stih416-pinctrl.dtsi index 957b21a71b4b..0f246c979262 100644 --- a/arch/arm/boot/dts/stih416-pinctrl.dtsi +++ b/arch/arm/boot/dts/stih416-pinctrl.dtsi | |||
@@ -166,6 +166,15 @@ | |||
166 | reg = <0x9000 0x100>; | 166 | reg = <0x9000 0x100>; |
167 | st,bank-name = "PIO31"; | 167 | st,bank-name = "PIO31"; |
168 | }; | 168 | }; |
169 | |||
170 | serial2-oe { | ||
171 | pinctrl_serial2_oe: serial2-1 { | ||
172 | st,pins { | ||
173 | output-enable = <&PIO11 3 ALT2 OUT>; | ||
174 | }; | ||
175 | }; | ||
176 | }; | ||
177 | |||
169 | }; | 178 | }; |
170 | 179 | ||
171 | pin-controller-rear { | 180 | pin-controller-rear { |
@@ -218,7 +227,6 @@ | |||
218 | st,pins { | 227 | st,pins { |
219 | tx = <&PIO17 4 ALT2 OUT>; | 228 | tx = <&PIO17 4 ALT2 OUT>; |
220 | rx = <&PIO17 5 ALT2 IN>; | 229 | rx = <&PIO17 5 ALT2 IN>; |
221 | output-enable = <&PIO11 3 ALT2 OUT>; | ||
222 | }; | 230 | }; |
223 | }; | 231 | }; |
224 | }; | 232 | }; |
diff --git a/arch/arm/boot/dts/stih416.dtsi b/arch/arm/boot/dts/stih416.dtsi index 3cecd9689a49..1a0326ea7d07 100644 --- a/arch/arm/boot/dts/stih416.dtsi +++ b/arch/arm/boot/dts/stih416.dtsi | |||
@@ -79,7 +79,7 @@ | |||
79 | interrupts = <0 197 0>; | 79 | interrupts = <0 197 0>; |
80 | clocks = <&CLK_S_ICN_REG_0>; | 80 | clocks = <&CLK_S_ICN_REG_0>; |
81 | pinctrl-names = "default"; | 81 | pinctrl-names = "default"; |
82 | pinctrl-0 = <&pinctrl_serial2>; | 82 | pinctrl-0 = <&pinctrl_serial2 &pinctrl_serial2_oe>; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | /* SBC_UART1 */ | 85 | /* SBC_UART1 */ |
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi index b3034da00a37..ae6a17aed9ee 100644 --- a/arch/arm/boot/dts/twl4030.dtsi +++ b/arch/arm/boot/dts/twl4030.dtsi | |||
@@ -47,6 +47,12 @@ | |||
47 | regulator-max-microvolt = <3150000>; | 47 | regulator-max-microvolt = <3150000>; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | vmmc2: regulator-vmmc2 { | ||
51 | compatible = "ti,twl4030-vmmc2"; | ||
52 | regulator-min-microvolt = <1850000>; | ||
53 | regulator-max-microvolt = <3150000>; | ||
54 | }; | ||
55 | |||
50 | vusb1v5: regulator-vusb1v5 { | 56 | vusb1v5: regulator-vusb1v5 { |
51 | compatible = "ti,twl4030-vusb1v5"; | 57 | compatible = "ti,twl4030-vusb1v5"; |
52 | }; | 58 | }; |
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi index e1eb7dadda80..67d929cf9804 100644 --- a/arch/arm/boot/dts/vf610.dtsi +++ b/arch/arm/boot/dts/vf610.dtsi | |||
@@ -442,8 +442,8 @@ | |||
442 | compatible = "fsl,mvf600-fec"; | 442 | compatible = "fsl,mvf600-fec"; |
443 | reg = <0x400d0000 0x1000>; | 443 | reg = <0x400d0000 0x1000>; |
444 | interrupts = <0 78 0x04>; | 444 | interrupts = <0 78 0x04>; |
445 | clocks = <&clks VF610_CLK_ENET>, | 445 | clocks = <&clks VF610_CLK_ENET0>, |
446 | <&clks VF610_CLK_ENET>, | 446 | <&clks VF610_CLK_ENET0>, |
447 | <&clks VF610_CLK_ENET>; | 447 | <&clks VF610_CLK_ENET>; |
448 | clock-names = "ipg", "ahb", "ptp"; | 448 | clock-names = "ipg", "ahb", "ptp"; |
449 | status = "disabled"; | 449 | status = "disabled"; |
@@ -453,8 +453,8 @@ | |||
453 | compatible = "fsl,mvf600-fec"; | 453 | compatible = "fsl,mvf600-fec"; |
454 | reg = <0x400d1000 0x1000>; | 454 | reg = <0x400d1000 0x1000>; |
455 | interrupts = <0 79 0x04>; | 455 | interrupts = <0 79 0x04>; |
456 | clocks = <&clks VF610_CLK_ENET>, | 456 | clocks = <&clks VF610_CLK_ENET1>, |
457 | <&clks VF610_CLK_ENET>, | 457 | <&clks VF610_CLK_ENET1>, |
458 | <&clks VF610_CLK_ENET>; | 458 | <&clks VF610_CLK_ENET>; |
459 | clock-names = "ipg", "ahb", "ptp"; | 459 | clock-names = "ipg", "ahb", "ptp"; |
460 | status = "disabled"; | 460 | status = "disabled"; |
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index a432e6c1dac1..39ad030ac0c7 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/edma.h> | 28 | #include <linux/edma.h> |
29 | #include <linux/err.h> | ||
30 | #include <linux/of_address.h> | 29 | #include <linux/of_address.h> |
31 | #include <linux/of_device.h> | 30 | #include <linux/of_device.h> |
32 | #include <linux/of_dma.h> | 31 | #include <linux/of_dma.h> |
diff --git a/arch/arm/configs/da8xx_omapl_defconfig b/arch/arm/configs/da8xx_omapl_defconfig index 7c868139bdb0..1571bea48bed 100644 --- a/arch/arm/configs/da8xx_omapl_defconfig +++ b/arch/arm/configs/da8xx_omapl_defconfig | |||
@@ -102,6 +102,8 @@ CONFIG_SND_SOC=m | |||
102 | CONFIG_SND_DAVINCI_SOC=m | 102 | CONFIG_SND_DAVINCI_SOC=m |
103 | # CONFIG_HID_SUPPORT is not set | 103 | # CONFIG_HID_SUPPORT is not set |
104 | # CONFIG_USB_SUPPORT is not set | 104 | # CONFIG_USB_SUPPORT is not set |
105 | CONFIG_DMADEVICES=y | ||
106 | CONFIG_TI_EDMA=y | ||
105 | CONFIG_EXT2_FS=y | 107 | CONFIG_EXT2_FS=y |
106 | CONFIG_EXT3_FS=y | 108 | CONFIG_EXT3_FS=y |
107 | CONFIG_XFS_FS=m | 109 | CONFIG_XFS_FS=m |
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig index c86fd75e181a..ab2f7378352c 100644 --- a/arch/arm/configs/davinci_all_defconfig +++ b/arch/arm/configs/davinci_all_defconfig | |||
@@ -162,6 +162,8 @@ CONFIG_LEDS_TRIGGERS=y | |||
162 | CONFIG_LEDS_TRIGGER_TIMER=m | 162 | CONFIG_LEDS_TRIGGER_TIMER=m |
163 | CONFIG_LEDS_TRIGGER_HEARTBEAT=m | 163 | CONFIG_LEDS_TRIGGER_HEARTBEAT=m |
164 | CONFIG_RTC_CLASS=y | 164 | CONFIG_RTC_CLASS=y |
165 | CONFIG_DMADEVICES=y | ||
166 | CONFIG_TI_EDMA=y | ||
165 | CONFIG_EXT2_FS=y | 167 | CONFIG_EXT2_FS=y |
166 | CONFIG_EXT3_FS=y | 168 | CONFIG_EXT3_FS=y |
167 | CONFIG_XFS_FS=m | 169 | CONFIG_XFS_FS=m |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index fe0bdc361d2c..6e572c64cf5a 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -53,6 +53,7 @@ CONFIG_IP_PNP=y | |||
53 | CONFIG_IP_PNP_DHCP=y | 53 | CONFIG_IP_PNP_DHCP=y |
54 | CONFIG_DEVTMPFS=y | 54 | CONFIG_DEVTMPFS=y |
55 | CONFIG_DEVTMPFS_MOUNT=y | 55 | CONFIG_DEVTMPFS_MOUNT=y |
56 | CONFIG_OMAP_OCP2SCP=y | ||
56 | CONFIG_BLK_DEV_SD=y | 57 | CONFIG_BLK_DEV_SD=y |
57 | CONFIG_ATA=y | 58 | CONFIG_ATA=y |
58 | CONFIG_SATA_AHCI_PLATFORM=y | 59 | CONFIG_SATA_AHCI_PLATFORM=y |
@@ -61,6 +62,7 @@ CONFIG_SATA_MV=y | |||
61 | CONFIG_NETDEVICES=y | 62 | CONFIG_NETDEVICES=y |
62 | CONFIG_SUN4I_EMAC=y | 63 | CONFIG_SUN4I_EMAC=y |
63 | CONFIG_NET_CALXEDA_XGMAC=y | 64 | CONFIG_NET_CALXEDA_XGMAC=y |
65 | CONFIG_KS8851=y | ||
64 | CONFIG_SMSC911X=y | 66 | CONFIG_SMSC911X=y |
65 | CONFIG_STMMAC_ETH=y | 67 | CONFIG_STMMAC_ETH=y |
66 | CONFIG_MDIO_SUN4I=y | 68 | CONFIG_MDIO_SUN4I=y |
@@ -89,6 +91,7 @@ CONFIG_I2C_DESIGNWARE_PLATFORM=y | |||
89 | CONFIG_I2C_SIRF=y | 91 | CONFIG_I2C_SIRF=y |
90 | CONFIG_I2C_TEGRA=y | 92 | CONFIG_I2C_TEGRA=y |
91 | CONFIG_SPI=y | 93 | CONFIG_SPI=y |
94 | CONFIG_SPI_OMAP24XX=y | ||
92 | CONFIG_SPI_PL022=y | 95 | CONFIG_SPI_PL022=y |
93 | CONFIG_SPI_SIRF=y | 96 | CONFIG_SPI_SIRF=y |
94 | CONFIG_SPI_TEGRA114=y | 97 | CONFIG_SPI_TEGRA114=y |
@@ -111,11 +114,12 @@ CONFIG_FB_SIMPLE=y | |||
111 | CONFIG_USB=y | 114 | CONFIG_USB=y |
112 | CONFIG_USB_XHCI_HCD=y | 115 | CONFIG_USB_XHCI_HCD=y |
113 | CONFIG_USB_EHCI_HCD=y | 116 | CONFIG_USB_EHCI_HCD=y |
114 | CONFIG_USB_EHCI_MXC=y | ||
115 | CONFIG_USB_EHCI_TEGRA=y | 117 | CONFIG_USB_EHCI_TEGRA=y |
116 | CONFIG_USB_EHCI_HCD_PLATFORM=y | 118 | CONFIG_USB_EHCI_HCD_PLATFORM=y |
117 | CONFIG_USB_ISP1760_HCD=y | 119 | CONFIG_USB_ISP1760_HCD=y |
118 | CONFIG_USB_STORAGE=y | 120 | CONFIG_USB_STORAGE=y |
121 | CONFIG_USB_CHIPIDEA=y | ||
122 | CONFIG_USB_CHIPIDEA_HOST=y | ||
119 | CONFIG_AB8500_USB=y | 123 | CONFIG_AB8500_USB=y |
120 | CONFIG_NOP_USB_XCEIV=y | 124 | CONFIG_NOP_USB_XCEIV=y |
121 | CONFIG_OMAP_USB2=y | 125 | CONFIG_OMAP_USB2=y |
diff --git a/arch/arm/configs/nhk8815_defconfig b/arch/arm/configs/nhk8815_defconfig index 35f8cf299fa2..263ae3869e32 100644 --- a/arch/arm/configs/nhk8815_defconfig +++ b/arch/arm/configs/nhk8815_defconfig | |||
@@ -1,6 +1,8 @@ | |||
1 | # CONFIG_LOCALVERSION_AUTO is not set | 1 | # CONFIG_LOCALVERSION_AUTO is not set |
2 | # CONFIG_SWAP is not set | 2 | # CONFIG_SWAP is not set |
3 | CONFIG_SYSVIPC=y | 3 | CONFIG_SYSVIPC=y |
4 | CONFIG_NO_HZ_IDLE=y | ||
5 | CONFIG_HIGH_RES_TIMERS=y | ||
4 | CONFIG_IKCONFIG=y | 6 | CONFIG_IKCONFIG=y |
5 | CONFIG_IKCONFIG_PROC=y | 7 | CONFIG_IKCONFIG_PROC=y |
6 | CONFIG_LOG_BUF_SHIFT=14 | 8 | CONFIG_LOG_BUF_SHIFT=14 |
@@ -48,7 +50,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | |||
48 | CONFIG_MTD=y | 50 | CONFIG_MTD=y |
49 | CONFIG_MTD_TESTS=m | 51 | CONFIG_MTD_TESTS=m |
50 | CONFIG_MTD_CMDLINE_PARTS=y | 52 | CONFIG_MTD_CMDLINE_PARTS=y |
51 | CONFIG_MTD_CHAR=y | ||
52 | CONFIG_MTD_BLOCK=y | 53 | CONFIG_MTD_BLOCK=y |
53 | CONFIG_MTD_NAND_ECC_SMC=y | 54 | CONFIG_MTD_NAND_ECC_SMC=y |
54 | CONFIG_MTD_NAND=y | 55 | CONFIG_MTD_NAND=y |
@@ -94,8 +95,10 @@ CONFIG_I2C_GPIO=y | |||
94 | CONFIG_I2C_NOMADIK=y | 95 | CONFIG_I2C_NOMADIK=y |
95 | CONFIG_DEBUG_GPIO=y | 96 | CONFIG_DEBUG_GPIO=y |
96 | # CONFIG_HWMON is not set | 97 | # CONFIG_HWMON is not set |
98 | CONFIG_REGULATOR=y | ||
97 | CONFIG_MMC=y | 99 | CONFIG_MMC=y |
98 | CONFIG_MMC_CLKGATE=y | 100 | CONFIG_MMC_UNSAFE_RESUME=y |
101 | # CONFIG_MMC_BLOCK_BOUNCE is not set | ||
99 | CONFIG_MMC_ARMMMCI=y | 102 | CONFIG_MMC_ARMMMCI=y |
100 | CONFIG_NEW_LEDS=y | 103 | CONFIG_NEW_LEDS=y |
101 | CONFIG_LEDS_CLASS=y | 104 | CONFIG_LEDS_CLASS=y |
diff --git a/arch/arm/include/asm/a.out-core.h b/arch/arm/include/asm/a.out-core.h deleted file mode 100644 index 92f10cb5c70c..000000000000 --- a/arch/arm/include/asm/a.out-core.h +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | /* a.out coredump register dumper | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_A_OUT_CORE_H | ||
13 | #define _ASM_A_OUT_CORE_H | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | |||
17 | #include <linux/user.h> | ||
18 | #include <linux/elfcore.h> | ||
19 | |||
20 | /* | ||
21 | * fill in the user structure for an a.out core dump | ||
22 | */ | ||
23 | static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) | ||
24 | { | ||
25 | struct task_struct *tsk = current; | ||
26 | |||
27 | dump->magic = CMAGIC; | ||
28 | dump->start_code = tsk->mm->start_code; | ||
29 | dump->start_stack = regs->ARM_sp & ~(PAGE_SIZE - 1); | ||
30 | |||
31 | dump->u_tsize = (tsk->mm->end_code - tsk->mm->start_code) >> PAGE_SHIFT; | ||
32 | dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
33 | dump->u_ssize = 0; | ||
34 | |||
35 | memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg)); | ||
36 | |||
37 | if (dump->start_stack < 0x04000000) | ||
38 | dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT; | ||
39 | |||
40 | dump->regs = *regs; | ||
41 | dump->u_fpvalid = dump_fpu (regs, &dump->u_fp); | ||
42 | } | ||
43 | |||
44 | #endif /* __KERNEL__ */ | ||
45 | #endif /* _ASM_A_OUT_CORE_H */ | ||
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index 8c25dc4e9851..9672e978d50d 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h | |||
@@ -89,13 +89,18 @@ extern unsigned int processor_id; | |||
89 | __val; \ | 89 | __val; \ |
90 | }) | 90 | }) |
91 | 91 | ||
92 | /* | ||
93 | * The memory clobber prevents gcc 4.5 from reordering the mrc before | ||
94 | * any is_smp() tests, which can cause undefined instruction aborts on | ||
95 | * ARM1136 r0 due to the missing extended CP15 registers. | ||
96 | */ | ||
92 | #define read_cpuid_ext(ext_reg) \ | 97 | #define read_cpuid_ext(ext_reg) \ |
93 | ({ \ | 98 | ({ \ |
94 | unsigned int __val; \ | 99 | unsigned int __val; \ |
95 | asm("mrc p15, 0, %0, c0, " ext_reg \ | 100 | asm("mrc p15, 0, %0, c0, " ext_reg \ |
96 | : "=r" (__val) \ | 101 | : "=r" (__val) \ |
97 | : \ | 102 | : \ |
98 | : "cc"); \ | 103 | : "memory"); \ |
99 | __val; \ | 104 | __val; \ |
100 | }) | 105 | }) |
101 | 106 | ||
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index 38050b1c4800..56211f2084ef 100644 --- a/arch/arm/include/asm/elf.h +++ b/arch/arm/include/asm/elf.h | |||
@@ -130,4 +130,10 @@ struct mm_struct; | |||
130 | extern unsigned long arch_randomize_brk(struct mm_struct *mm); | 130 | extern unsigned long arch_randomize_brk(struct mm_struct *mm); |
131 | #define arch_randomize_brk arch_randomize_brk | 131 | #define arch_randomize_brk arch_randomize_brk |
132 | 132 | ||
133 | #ifdef CONFIG_MMU | ||
134 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 | ||
135 | struct linux_binprm; | ||
136 | int arch_setup_additional_pages(struct linux_binprm *, int); | ||
137 | #endif | ||
138 | |||
133 | #endif | 139 | #endif |
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index e3d55547e755..6f18da09668b 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h | |||
@@ -6,8 +6,11 @@ | |||
6 | typedef struct { | 6 | typedef struct { |
7 | #ifdef CONFIG_CPU_HAS_ASID | 7 | #ifdef CONFIG_CPU_HAS_ASID |
8 | atomic64_t id; | 8 | atomic64_t id; |
9 | #else | ||
10 | int switch_pending; | ||
9 | #endif | 11 | #endif |
10 | unsigned int vmalloc_seq; | 12 | unsigned int vmalloc_seq; |
13 | unsigned long sigpage; | ||
11 | } mm_context_t; | 14 | } mm_context_t; |
12 | 15 | ||
13 | #ifdef CONFIG_CPU_HAS_ASID | 16 | #ifdef CONFIG_CPU_HAS_ASID |
diff --git a/arch/arm/include/asm/mmu_context.h b/arch/arm/include/asm/mmu_context.h index b5792b7fd8d3..9b32f76bb0dd 100644 --- a/arch/arm/include/asm/mmu_context.h +++ b/arch/arm/include/asm/mmu_context.h | |||
@@ -56,7 +56,7 @@ static inline void check_and_switch_context(struct mm_struct *mm, | |||
56 | * on non-ASID CPUs, the old mm will remain valid until the | 56 | * on non-ASID CPUs, the old mm will remain valid until the |
57 | * finish_arch_post_lock_switch() call. | 57 | * finish_arch_post_lock_switch() call. |
58 | */ | 58 | */ |
59 | set_ti_thread_flag(task_thread_info(tsk), TIF_SWITCH_MM); | 59 | mm->context.switch_pending = 1; |
60 | else | 60 | else |
61 | cpu_switch_mm(mm->pgd, mm); | 61 | cpu_switch_mm(mm->pgd, mm); |
62 | } | 62 | } |
@@ -65,9 +65,21 @@ static inline void check_and_switch_context(struct mm_struct *mm, | |||
65 | finish_arch_post_lock_switch | 65 | finish_arch_post_lock_switch |
66 | static inline void finish_arch_post_lock_switch(void) | 66 | static inline void finish_arch_post_lock_switch(void) |
67 | { | 67 | { |
68 | if (test_and_clear_thread_flag(TIF_SWITCH_MM)) { | 68 | struct mm_struct *mm = current->mm; |
69 | struct mm_struct *mm = current->mm; | 69 | |
70 | cpu_switch_mm(mm->pgd, mm); | 70 | if (mm && mm->context.switch_pending) { |
71 | /* | ||
72 | * Preemption must be disabled during cpu_switch_mm() as we | ||
73 | * have some stateful cache flush implementations. Check | ||
74 | * switch_pending again in case we were preempted and the | ||
75 | * switch to this mm was already done. | ||
76 | */ | ||
77 | preempt_disable(); | ||
78 | if (mm->context.switch_pending) { | ||
79 | mm->context.switch_pending = 0; | ||
80 | cpu_switch_mm(mm->pgd, mm); | ||
81 | } | ||
82 | preempt_enable_no_resched(); | ||
71 | } | 83 | } |
72 | } | 84 | } |
73 | 85 | ||
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index 6363f3d1d505..4355f0ec44d6 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h | |||
@@ -142,7 +142,9 @@ extern void __cpu_copy_user_highpage(struct page *to, struct page *from, | |||
142 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) | 142 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) |
143 | extern void copy_page(void *to, const void *from); | 143 | extern void copy_page(void *to, const void *from); |
144 | 144 | ||
145 | #ifdef CONFIG_KUSER_HELPERS | ||
145 | #define __HAVE_ARCH_GATE_AREA 1 | 146 | #define __HAVE_ARCH_GATE_AREA 1 |
147 | #endif | ||
146 | 148 | ||
147 | #ifdef CONFIG_ARM_LPAE | 149 | #ifdef CONFIG_ARM_LPAE |
148 | #include <asm/pgtable-3level-types.h> | 150 | #include <asm/pgtable-3level-types.h> |
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index 06e7d509eaac..413f3876341c 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h | |||
@@ -54,7 +54,6 @@ struct thread_struct { | |||
54 | 54 | ||
55 | #define start_thread(regs,pc,sp) \ | 55 | #define start_thread(regs,pc,sp) \ |
56 | ({ \ | 56 | ({ \ |
57 | unsigned long *stack = (unsigned long *)sp; \ | ||
58 | memset(regs->uregs, 0, sizeof(regs->uregs)); \ | 57 | memset(regs->uregs, 0, sizeof(regs->uregs)); \ |
59 | if (current->personality & ADDR_LIMIT_32BIT) \ | 58 | if (current->personality & ADDR_LIMIT_32BIT) \ |
60 | regs->ARM_cpsr = USR_MODE; \ | 59 | regs->ARM_cpsr = USR_MODE; \ |
@@ -65,9 +64,6 @@ struct thread_struct { | |||
65 | regs->ARM_cpsr |= PSR_ENDSTATE; \ | 64 | regs->ARM_cpsr |= PSR_ENDSTATE; \ |
66 | regs->ARM_pc = pc & ~1; /* pc */ \ | 65 | regs->ARM_pc = pc & ~1; /* pc */ \ |
67 | regs->ARM_sp = sp; /* sp */ \ | 66 | regs->ARM_sp = sp; /* sp */ \ |
68 | regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ | ||
69 | regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ | ||
70 | regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ | ||
71 | nommu_start_thread(regs); \ | 67 | nommu_start_thread(regs); \ |
72 | }) | 68 | }) |
73 | 69 | ||
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 214d4158089a..2b8114fcba09 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h | |||
@@ -156,7 +156,6 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, | |||
156 | #define TIF_USING_IWMMXT 17 | 156 | #define TIF_USING_IWMMXT 17 |
157 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ | 157 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
158 | #define TIF_RESTORE_SIGMASK 20 | 158 | #define TIF_RESTORE_SIGMASK 20 |
159 | #define TIF_SWITCH_MM 22 /* deferred switch_mm */ | ||
160 | 159 | ||
161 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 160 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
162 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 161 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index fdbb9e369745..f467e9b3f8d5 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h | |||
@@ -443,7 +443,18 @@ static inline void local_flush_bp_all(void) | |||
443 | isb(); | 443 | isb(); |
444 | } | 444 | } |
445 | 445 | ||
446 | #include <asm/cputype.h> | ||
446 | #ifdef CONFIG_ARM_ERRATA_798181 | 447 | #ifdef CONFIG_ARM_ERRATA_798181 |
448 | static inline int erratum_a15_798181(void) | ||
449 | { | ||
450 | unsigned int midr = read_cpuid_id(); | ||
451 | |||
452 | /* Cortex-A15 r0p0..r3p2 affected */ | ||
453 | if ((midr & 0xff0ffff0) != 0x410fc0f0 || midr > 0x413fc0f2) | ||
454 | return 0; | ||
455 | return 1; | ||
456 | } | ||
457 | |||
447 | static inline void dummy_flush_tlb_a15_erratum(void) | 458 | static inline void dummy_flush_tlb_a15_erratum(void) |
448 | { | 459 | { |
449 | /* | 460 | /* |
@@ -453,6 +464,11 @@ static inline void dummy_flush_tlb_a15_erratum(void) | |||
453 | dsb(); | 464 | dsb(); |
454 | } | 465 | } |
455 | #else | 466 | #else |
467 | static inline int erratum_a15_798181(void) | ||
468 | { | ||
469 | return 0; | ||
470 | } | ||
471 | |||
456 | static inline void dummy_flush_tlb_a15_erratum(void) | 472 | static inline void dummy_flush_tlb_a15_erratum(void) |
457 | { | 473 | { |
458 | } | 474 | } |
diff --git a/arch/arm/include/asm/virt.h b/arch/arm/include/asm/virt.h index 50af92bac737..4371f45c5784 100644 --- a/arch/arm/include/asm/virt.h +++ b/arch/arm/include/asm/virt.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define BOOT_CPU_MODE_MISMATCH PSR_N_BIT | 29 | #define BOOT_CPU_MODE_MISMATCH PSR_N_BIT |
30 | 30 | ||
31 | #ifndef __ASSEMBLY__ | 31 | #ifndef __ASSEMBLY__ |
32 | #include <asm/cacheflush.h> | ||
32 | 33 | ||
33 | #ifdef CONFIG_ARM_VIRT_EXT | 34 | #ifdef CONFIG_ARM_VIRT_EXT |
34 | /* | 35 | /* |
@@ -41,10 +42,21 @@ | |||
41 | */ | 42 | */ |
42 | extern int __boot_cpu_mode; | 43 | extern int __boot_cpu_mode; |
43 | 44 | ||
45 | static inline void sync_boot_mode(void) | ||
46 | { | ||
47 | /* | ||
48 | * As secondaries write to __boot_cpu_mode with caches disabled, we | ||
49 | * must flush the corresponding cache entries to ensure the visibility | ||
50 | * of their writes. | ||
51 | */ | ||
52 | sync_cache_r(&__boot_cpu_mode); | ||
53 | } | ||
54 | |||
44 | void __hyp_set_vectors(unsigned long phys_vector_base); | 55 | void __hyp_set_vectors(unsigned long phys_vector_base); |
45 | unsigned long __hyp_get_vectors(void); | 56 | unsigned long __hyp_get_vectors(void); |
46 | #else | 57 | #else |
47 | #define __boot_cpu_mode (SVC_MODE) | 58 | #define __boot_cpu_mode (SVC_MODE) |
59 | #define sync_boot_mode() | ||
48 | #endif | 60 | #endif |
49 | 61 | ||
50 | #ifndef ZIMAGE | 62 | #ifndef ZIMAGE |
diff --git a/arch/arm/include/uapi/asm/Kbuild b/arch/arm/include/uapi/asm/Kbuild index 47bcb2d254af..18d76fd5a2af 100644 --- a/arch/arm/include/uapi/asm/Kbuild +++ b/arch/arm/include/uapi/asm/Kbuild | |||
@@ -1,7 +1,6 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | header-y += a.out.h | ||
5 | header-y += byteorder.h | 4 | header-y += byteorder.h |
6 | header-y += fcntl.h | 5 | header-y += fcntl.h |
7 | header-y += hwcap.h | 6 | header-y += hwcap.h |
diff --git a/arch/arm/include/uapi/asm/a.out.h b/arch/arm/include/uapi/asm/a.out.h deleted file mode 100644 index 083894b2e3bc..000000000000 --- a/arch/arm/include/uapi/asm/a.out.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | #ifndef __ARM_A_OUT_H__ | ||
2 | #define __ARM_A_OUT_H__ | ||
3 | |||
4 | #include <linux/personality.h> | ||
5 | #include <linux/types.h> | ||
6 | |||
7 | struct exec | ||
8 | { | ||
9 | __u32 a_info; /* Use macros N_MAGIC, etc for access */ | ||
10 | __u32 a_text; /* length of text, in bytes */ | ||
11 | __u32 a_data; /* length of data, in bytes */ | ||
12 | __u32 a_bss; /* length of uninitialized data area for file, in bytes */ | ||
13 | __u32 a_syms; /* length of symbol table data in file, in bytes */ | ||
14 | __u32 a_entry; /* start address */ | ||
15 | __u32 a_trsize; /* length of relocation info for text, in bytes */ | ||
16 | __u32 a_drsize; /* length of relocation info for data, in bytes */ | ||
17 | }; | ||
18 | |||
19 | /* | ||
20 | * This is always the same | ||
21 | */ | ||
22 | #define N_TXTADDR(a) (0x00008000) | ||
23 | |||
24 | #define N_TRSIZE(a) ((a).a_trsize) | ||
25 | #define N_DRSIZE(a) ((a).a_drsize) | ||
26 | #define N_SYMSIZE(a) ((a).a_syms) | ||
27 | |||
28 | #define M_ARM 103 | ||
29 | |||
30 | #ifndef LIBRARY_START_TEXT | ||
31 | #define LIBRARY_START_TEXT (0x00c00000) | ||
32 | #endif | ||
33 | |||
34 | #endif /* __A_OUT_GNU_H__ */ | ||
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a39cfc2a1f90..d40d0ef389db 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -742,6 +742,18 @@ ENDPROC(__switch_to) | |||
742 | #endif | 742 | #endif |
743 | .endm | 743 | .endm |
744 | 744 | ||
745 | .macro kuser_pad, sym, size | ||
746 | .if (. - \sym) & 3 | ||
747 | .rept 4 - (. - \sym) & 3 | ||
748 | .byte 0 | ||
749 | .endr | ||
750 | .endif | ||
751 | .rept (\size - (. - \sym)) / 4 | ||
752 | .word 0xe7fddef1 | ||
753 | .endr | ||
754 | .endm | ||
755 | |||
756 | #ifdef CONFIG_KUSER_HELPERS | ||
745 | .align 5 | 757 | .align 5 |
746 | .globl __kuser_helper_start | 758 | .globl __kuser_helper_start |
747 | __kuser_helper_start: | 759 | __kuser_helper_start: |
@@ -832,18 +844,13 @@ kuser_cmpxchg64_fixup: | |||
832 | #error "incoherent kernel configuration" | 844 | #error "incoherent kernel configuration" |
833 | #endif | 845 | #endif |
834 | 846 | ||
835 | /* pad to next slot */ | 847 | kuser_pad __kuser_cmpxchg64, 64 |
836 | .rept (16 - (. - __kuser_cmpxchg64)/4) | ||
837 | .word 0 | ||
838 | .endr | ||
839 | |||
840 | .align 5 | ||
841 | 848 | ||
842 | __kuser_memory_barrier: @ 0xffff0fa0 | 849 | __kuser_memory_barrier: @ 0xffff0fa0 |
843 | smp_dmb arm | 850 | smp_dmb arm |
844 | usr_ret lr | 851 | usr_ret lr |
845 | 852 | ||
846 | .align 5 | 853 | kuser_pad __kuser_memory_barrier, 32 |
847 | 854 | ||
848 | __kuser_cmpxchg: @ 0xffff0fc0 | 855 | __kuser_cmpxchg: @ 0xffff0fc0 |
849 | 856 | ||
@@ -916,13 +923,14 @@ kuser_cmpxchg32_fixup: | |||
916 | 923 | ||
917 | #endif | 924 | #endif |
918 | 925 | ||
919 | .align 5 | 926 | kuser_pad __kuser_cmpxchg, 32 |
920 | 927 | ||
921 | __kuser_get_tls: @ 0xffff0fe0 | 928 | __kuser_get_tls: @ 0xffff0fe0 |
922 | ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init | 929 | ldr r0, [pc, #(16 - 8)] @ read TLS, set in kuser_get_tls_init |
923 | usr_ret lr | 930 | usr_ret lr |
924 | mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code | 931 | mrc p15, 0, r0, c13, c0, 3 @ 0xffff0fe8 hardware TLS code |
925 | .rep 4 | 932 | kuser_pad __kuser_get_tls, 16 |
933 | .rep 3 | ||
926 | .word 0 @ 0xffff0ff0 software TLS value, then | 934 | .word 0 @ 0xffff0ff0 software TLS value, then |
927 | .endr @ pad up to __kuser_helper_version | 935 | .endr @ pad up to __kuser_helper_version |
928 | 936 | ||
@@ -932,14 +940,16 @@ __kuser_helper_version: @ 0xffff0ffc | |||
932 | .globl __kuser_helper_end | 940 | .globl __kuser_helper_end |
933 | __kuser_helper_end: | 941 | __kuser_helper_end: |
934 | 942 | ||
943 | #endif | ||
944 | |||
935 | THUMB( .thumb ) | 945 | THUMB( .thumb ) |
936 | 946 | ||
937 | /* | 947 | /* |
938 | * Vector stubs. | 948 | * Vector stubs. |
939 | * | 949 | * |
940 | * This code is copied to 0xffff0200 so we can use branches in the | 950 | * This code is copied to 0xffff1000 so we can use branches in the |
941 | * vectors, rather than ldr's. Note that this code must not | 951 | * vectors, rather than ldr's. Note that this code must not exceed |
942 | * exceed 0x300 bytes. | 952 | * a page size. |
943 | * | 953 | * |
944 | * Common stub entry macro: | 954 | * Common stub entry macro: |
945 | * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC | 955 | * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC |
@@ -986,8 +996,17 @@ ENDPROC(vector_\name) | |||
986 | 1: | 996 | 1: |
987 | .endm | 997 | .endm |
988 | 998 | ||
989 | .globl __stubs_start | 999 | .section .stubs, "ax", %progbits |
990 | __stubs_start: | 1000 | __stubs_start: |
1001 | @ This must be the first word | ||
1002 | .word vector_swi | ||
1003 | |||
1004 | vector_rst: | ||
1005 | ARM( swi SYS_ERROR0 ) | ||
1006 | THUMB( svc #0 ) | ||
1007 | THUMB( nop ) | ||
1008 | b vector_und | ||
1009 | |||
991 | /* | 1010 | /* |
992 | * Interrupt dispatcher | 1011 | * Interrupt dispatcher |
993 | */ | 1012 | */ |
@@ -1082,6 +1101,16 @@ __stubs_start: | |||
1082 | .align 5 | 1101 | .align 5 |
1083 | 1102 | ||
1084 | /*============================================================================= | 1103 | /*============================================================================= |
1104 | * Address exception handler | ||
1105 | *----------------------------------------------------------------------------- | ||
1106 | * These aren't too critical. | ||
1107 | * (they're not supposed to happen, and won't happen in 32-bit data mode). | ||
1108 | */ | ||
1109 | |||
1110 | vector_addrexcptn: | ||
1111 | b vector_addrexcptn | ||
1112 | |||
1113 | /*============================================================================= | ||
1085 | * Undefined FIQs | 1114 | * Undefined FIQs |
1086 | *----------------------------------------------------------------------------- | 1115 | *----------------------------------------------------------------------------- |
1087 | * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC | 1116 | * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC |
@@ -1094,45 +1123,19 @@ __stubs_start: | |||
1094 | vector_fiq: | 1123 | vector_fiq: |
1095 | subs pc, lr, #4 | 1124 | subs pc, lr, #4 |
1096 | 1125 | ||
1097 | /*============================================================================= | 1126 | .globl vector_fiq_offset |
1098 | * Address exception handler | 1127 | .equ vector_fiq_offset, vector_fiq |
1099 | *----------------------------------------------------------------------------- | ||
1100 | * These aren't too critical. | ||
1101 | * (they're not supposed to happen, and won't happen in 32-bit data mode). | ||
1102 | */ | ||
1103 | |||
1104 | vector_addrexcptn: | ||
1105 | b vector_addrexcptn | ||
1106 | |||
1107 | /* | ||
1108 | * We group all the following data together to optimise | ||
1109 | * for CPUs with separate I & D caches. | ||
1110 | */ | ||
1111 | .align 5 | ||
1112 | |||
1113 | .LCvswi: | ||
1114 | .word vector_swi | ||
1115 | |||
1116 | .globl __stubs_end | ||
1117 | __stubs_end: | ||
1118 | |||
1119 | .equ stubs_offset, __vectors_start + 0x200 - __stubs_start | ||
1120 | 1128 | ||
1121 | .globl __vectors_start | 1129 | .section .vectors, "ax", %progbits |
1122 | __vectors_start: | 1130 | __vectors_start: |
1123 | ARM( swi SYS_ERROR0 ) | 1131 | W(b) vector_rst |
1124 | THUMB( svc #0 ) | 1132 | W(b) vector_und |
1125 | THUMB( nop ) | 1133 | W(ldr) pc, __vectors_start + 0x1000 |
1126 | W(b) vector_und + stubs_offset | 1134 | W(b) vector_pabt |
1127 | W(ldr) pc, .LCvswi + stubs_offset | 1135 | W(b) vector_dabt |
1128 | W(b) vector_pabt + stubs_offset | 1136 | W(b) vector_addrexcptn |
1129 | W(b) vector_dabt + stubs_offset | 1137 | W(b) vector_irq |
1130 | W(b) vector_addrexcptn + stubs_offset | 1138 | W(b) vector_fiq |
1131 | W(b) vector_irq + stubs_offset | ||
1132 | W(b) vector_fiq + stubs_offset | ||
1133 | |||
1134 | .globl __vectors_end | ||
1135 | __vectors_end: | ||
1136 | 1139 | ||
1137 | .data | 1140 | .data |
1138 | 1141 | ||
diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S index e00621f1403f..52b26432c9a9 100644 --- a/arch/arm/kernel/entry-v7m.S +++ b/arch/arm/kernel/entry-v7m.S | |||
@@ -49,7 +49,7 @@ __irq_entry: | |||
49 | mov r1, sp | 49 | mov r1, sp |
50 | stmdb sp!, {lr} | 50 | stmdb sp!, {lr} |
51 | @ routine called with r0 = irq number, r1 = struct pt_regs * | 51 | @ routine called with r0 = irq number, r1 = struct pt_regs * |
52 | bl nvic_do_IRQ | 52 | bl nvic_handle_irq |
53 | 53 | ||
54 | pop {lr} | 54 | pop {lr} |
55 | @ | 55 | @ |
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c index 2adda11f712f..25442f451148 100644 --- a/arch/arm/kernel/fiq.c +++ b/arch/arm/kernel/fiq.c | |||
@@ -47,6 +47,11 @@ | |||
47 | #include <asm/irq.h> | 47 | #include <asm/irq.h> |
48 | #include <asm/traps.h> | 48 | #include <asm/traps.h> |
49 | 49 | ||
50 | #define FIQ_OFFSET ({ \ | ||
51 | extern void *vector_fiq_offset; \ | ||
52 | (unsigned)&vector_fiq_offset; \ | ||
53 | }) | ||
54 | |||
50 | static unsigned long no_fiq_insn; | 55 | static unsigned long no_fiq_insn; |
51 | 56 | ||
52 | /* Default reacquire function | 57 | /* Default reacquire function |
@@ -80,13 +85,16 @@ int show_fiq_list(struct seq_file *p, int prec) | |||
80 | void set_fiq_handler(void *start, unsigned int length) | 85 | void set_fiq_handler(void *start, unsigned int length) |
81 | { | 86 | { |
82 | #if defined(CONFIG_CPU_USE_DOMAINS) | 87 | #if defined(CONFIG_CPU_USE_DOMAINS) |
83 | memcpy((void *)0xffff001c, start, length); | 88 | void *base = (void *)0xffff0000; |
84 | #else | 89 | #else |
85 | memcpy(vectors_page + 0x1c, start, length); | 90 | void *base = vectors_page; |
86 | #endif | 91 | #endif |
87 | flush_icache_range(0xffff001c, 0xffff001c + length); | 92 | unsigned offset = FIQ_OFFSET; |
93 | |||
94 | memcpy(base + offset, start, length); | ||
95 | flush_icache_range(0xffff0000 + offset, 0xffff0000 + offset + length); | ||
88 | if (!vectors_high()) | 96 | if (!vectors_high()) |
89 | flush_icache_range(0x1c, 0x1c + length); | 97 | flush_icache_range(offset, offset + length); |
90 | } | 98 | } |
91 | 99 | ||
92 | int claim_fiq(struct fiq_handler *f) | 100 | int claim_fiq(struct fiq_handler *f) |
@@ -144,6 +152,7 @@ EXPORT_SYMBOL(disable_fiq); | |||
144 | 152 | ||
145 | void __init init_FIQ(int start) | 153 | void __init init_FIQ(int start) |
146 | { | 154 | { |
147 | no_fiq_insn = *(unsigned long *)0xffff001c; | 155 | unsigned offset = FIQ_OFFSET; |
156 | no_fiq_insn = *(unsigned long *)(0xffff0000 + offset); | ||
148 | fiq_start = start; | 157 | fiq_start = start; |
149 | } | 158 | } |
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index b361de143756..14235ba64a90 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
@@ -87,6 +87,7 @@ ENTRY(stext) | |||
87 | ENDPROC(stext) | 87 | ENDPROC(stext) |
88 | 88 | ||
89 | #ifdef CONFIG_SMP | 89 | #ifdef CONFIG_SMP |
90 | .text | ||
90 | ENTRY(secondary_startup) | 91 | ENTRY(secondary_startup) |
91 | /* | 92 | /* |
92 | * Common entry point for secondary CPUs. | 93 | * Common entry point for secondary CPUs. |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 9cf6063020ae..2c7cc1e03473 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -343,6 +343,7 @@ __turn_mmu_on_loc: | |||
343 | .long __turn_mmu_on_end | 343 | .long __turn_mmu_on_end |
344 | 344 | ||
345 | #if defined(CONFIG_SMP) | 345 | #if defined(CONFIG_SMP) |
346 | .text | ||
346 | ENTRY(secondary_startup) | 347 | ENTRY(secondary_startup) |
347 | /* | 348 | /* |
348 | * Common entry point for secondary CPUs. | 349 | * Common entry point for secondary CPUs. |
diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index 4910232c4833..797b1a6a4906 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S | |||
@@ -56,8 +56,8 @@ ENTRY(__boot_cpu_mode) | |||
56 | ldr \reg3, [\reg2] | 56 | ldr \reg3, [\reg2] |
57 | ldr \reg1, [\reg2, \reg3] | 57 | ldr \reg1, [\reg2, \reg3] |
58 | cmp \mode, \reg1 @ matches primary CPU boot mode? | 58 | cmp \mode, \reg1 @ matches primary CPU boot mode? |
59 | orrne r7, r7, #BOOT_CPU_MODE_MISMATCH | 59 | orrne \reg1, \reg1, #BOOT_CPU_MODE_MISMATCH |
60 | strne r7, [r5, r6] @ record what happened and give up | 60 | strne \reg1, [\reg2, \reg3] @ record what happened and give up |
61 | .endm | 61 | .endm |
62 | 62 | ||
63 | #else /* ZIMAGE */ | 63 | #else /* ZIMAGE */ |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index d3ca4f6915af..536c85fe72a8 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -197,6 +197,7 @@ void machine_shutdown(void) | |||
197 | */ | 197 | */ |
198 | void machine_halt(void) | 198 | void machine_halt(void) |
199 | { | 199 | { |
200 | local_irq_disable(); | ||
200 | smp_send_stop(); | 201 | smp_send_stop(); |
201 | 202 | ||
202 | local_irq_disable(); | 203 | local_irq_disable(); |
@@ -211,6 +212,7 @@ void machine_halt(void) | |||
211 | */ | 212 | */ |
212 | void machine_power_off(void) | 213 | void machine_power_off(void) |
213 | { | 214 | { |
215 | local_irq_disable(); | ||
214 | smp_send_stop(); | 216 | smp_send_stop(); |
215 | 217 | ||
216 | if (pm_power_off) | 218 | if (pm_power_off) |
@@ -230,6 +232,7 @@ void machine_power_off(void) | |||
230 | */ | 232 | */ |
231 | void machine_restart(char *cmd) | 233 | void machine_restart(char *cmd) |
232 | { | 234 | { |
235 | local_irq_disable(); | ||
233 | smp_send_stop(); | 236 | smp_send_stop(); |
234 | 237 | ||
235 | arm_pm_restart(reboot_mode, cmd); | 238 | arm_pm_restart(reboot_mode, cmd); |
@@ -426,10 +429,11 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
426 | } | 429 | } |
427 | 430 | ||
428 | #ifdef CONFIG_MMU | 431 | #ifdef CONFIG_MMU |
432 | #ifdef CONFIG_KUSER_HELPERS | ||
429 | /* | 433 | /* |
430 | * The vectors page is always readable from user space for the | 434 | * The vectors page is always readable from user space for the |
431 | * atomic helpers and the signal restart code. Insert it into the | 435 | * atomic helpers. Insert it into the gate_vma so that it is visible |
432 | * gate_vma so that it is visible through ptrace and /proc/<pid>/mem. | 436 | * through ptrace and /proc/<pid>/mem. |
433 | */ | 437 | */ |
434 | static struct vm_area_struct gate_vma = { | 438 | static struct vm_area_struct gate_vma = { |
435 | .vm_start = 0xffff0000, | 439 | .vm_start = 0xffff0000, |
@@ -458,9 +462,48 @@ int in_gate_area_no_mm(unsigned long addr) | |||
458 | { | 462 | { |
459 | return in_gate_area(NULL, addr); | 463 | return in_gate_area(NULL, addr); |
460 | } | 464 | } |
465 | #define is_gate_vma(vma) ((vma) = &gate_vma) | ||
466 | #else | ||
467 | #define is_gate_vma(vma) 0 | ||
468 | #endif | ||
461 | 469 | ||
462 | const char *arch_vma_name(struct vm_area_struct *vma) | 470 | const char *arch_vma_name(struct vm_area_struct *vma) |
463 | { | 471 | { |
464 | return (vma == &gate_vma) ? "[vectors]" : NULL; | 472 | return is_gate_vma(vma) ? "[vectors]" : |
473 | (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ? | ||
474 | "[sigpage]" : NULL; | ||
475 | } | ||
476 | |||
477 | static struct page *signal_page; | ||
478 | extern struct page *get_signal_page(void); | ||
479 | |||
480 | int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) | ||
481 | { | ||
482 | struct mm_struct *mm = current->mm; | ||
483 | unsigned long addr; | ||
484 | int ret; | ||
485 | |||
486 | if (!signal_page) | ||
487 | signal_page = get_signal_page(); | ||
488 | if (!signal_page) | ||
489 | return -ENOMEM; | ||
490 | |||
491 | down_write(&mm->mmap_sem); | ||
492 | addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0); | ||
493 | if (IS_ERR_VALUE(addr)) { | ||
494 | ret = addr; | ||
495 | goto up_fail; | ||
496 | } | ||
497 | |||
498 | ret = install_special_mapping(mm, addr, PAGE_SIZE, | ||
499 | VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC, | ||
500 | &signal_page); | ||
501 | |||
502 | if (ret == 0) | ||
503 | mm->context.sigpage = addr; | ||
504 | |||
505 | up_fail: | ||
506 | up_write(&mm->mmap_sem); | ||
507 | return ret; | ||
465 | } | 508 | } |
466 | #endif | 509 | #endif |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 63af9a7ae512..afc2489ee13b 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -836,6 +836,8 @@ static int __init meminfo_cmp(const void *_a, const void *_b) | |||
836 | void __init hyp_mode_check(void) | 836 | void __init hyp_mode_check(void) |
837 | { | 837 | { |
838 | #ifdef CONFIG_ARM_VIRT_EXT | 838 | #ifdef CONFIG_ARM_VIRT_EXT |
839 | sync_boot_mode(); | ||
840 | |||
839 | if (is_hyp_mode_available()) { | 841 | if (is_hyp_mode_available()) { |
840 | pr_info("CPU: All CPU(s) started in HYP mode.\n"); | 842 | pr_info("CPU: All CPU(s) started in HYP mode.\n"); |
841 | pr_info("CPU: Virtualization extensions available.\n"); | 843 | pr_info("CPU: Virtualization extensions available.\n"); |
@@ -971,6 +973,7 @@ static const char *hwcap_str[] = { | |||
971 | "vfpv4", | 973 | "vfpv4", |
972 | "idiva", | 974 | "idiva", |
973 | "idivt", | 975 | "idivt", |
976 | "vfpd32", | ||
974 | "lpae", | 977 | "lpae", |
975 | NULL | 978 | NULL |
976 | }; | 979 | }; |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 1c16c35c271a..ab3304225272 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <linux/random.h> | ||
11 | #include <linux/signal.h> | 12 | #include <linux/signal.h> |
12 | #include <linux/personality.h> | 13 | #include <linux/personality.h> |
13 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
@@ -15,12 +16,11 @@ | |||
15 | 16 | ||
16 | #include <asm/elf.h> | 17 | #include <asm/elf.h> |
17 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/traps.h> | ||
18 | #include <asm/ucontext.h> | 20 | #include <asm/ucontext.h> |
19 | #include <asm/unistd.h> | 21 | #include <asm/unistd.h> |
20 | #include <asm/vfp.h> | 22 | #include <asm/vfp.h> |
21 | 23 | ||
22 | #include "signal.h" | ||
23 | |||
24 | /* | 24 | /* |
25 | * For ARM syscalls, we encode the syscall number into the instruction. | 25 | * For ARM syscalls, we encode the syscall number into the instruction. |
26 | */ | 26 | */ |
@@ -40,11 +40,13 @@ | |||
40 | #define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE)) | 40 | #define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE)) |
41 | #define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) | 41 | #define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) |
42 | 42 | ||
43 | const unsigned long sigreturn_codes[7] = { | 43 | static const unsigned long sigreturn_codes[7] = { |
44 | MOV_R7_NR_SIGRETURN, SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, | 44 | MOV_R7_NR_SIGRETURN, SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, |
45 | MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, | 45 | MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | static unsigned long signal_return_offset; | ||
49 | |||
48 | #ifdef CONFIG_CRUNCH | 50 | #ifdef CONFIG_CRUNCH |
49 | static int preserve_crunch_context(struct crunch_sigframe __user *frame) | 51 | static int preserve_crunch_context(struct crunch_sigframe __user *frame) |
50 | { | 52 | { |
@@ -400,14 +402,20 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig, | |||
400 | __put_user(sigreturn_codes[idx+1], rc+1)) | 402 | __put_user(sigreturn_codes[idx+1], rc+1)) |
401 | return 1; | 403 | return 1; |
402 | 404 | ||
403 | if ((cpsr & MODE32_BIT) && !IS_ENABLED(CONFIG_ARM_MPU)) { | 405 | #ifdef CONFIG_MMU |
406 | if (cpsr & MODE32_BIT) { | ||
407 | struct mm_struct *mm = current->mm; | ||
408 | |||
404 | /* | 409 | /* |
405 | * 32-bit code can use the new high-page | 410 | * 32-bit code can use the signal return page |
406 | * signal return code support except when the MPU has | 411 | * except when the MPU has protected the vectors |
407 | * protected the vectors page from PL0 | 412 | * page from PL0 |
408 | */ | 413 | */ |
409 | retcode = KERN_SIGRETURN_CODE + (idx << 2) + thumb; | 414 | retcode = mm->context.sigpage + signal_return_offset + |
410 | } else { | 415 | (idx << 2) + thumb; |
416 | } else | ||
417 | #endif | ||
418 | { | ||
411 | /* | 419 | /* |
412 | * Ensure that the instruction cache sees | 420 | * Ensure that the instruction cache sees |
413 | * the return code written onto the stack. | 421 | * the return code written onto the stack. |
@@ -608,3 +616,33 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) | |||
608 | } while (thread_flags & _TIF_WORK_MASK); | 616 | } while (thread_flags & _TIF_WORK_MASK); |
609 | return 0; | 617 | return 0; |
610 | } | 618 | } |
619 | |||
620 | struct page *get_signal_page(void) | ||
621 | { | ||
622 | unsigned long ptr; | ||
623 | unsigned offset; | ||
624 | struct page *page; | ||
625 | void *addr; | ||
626 | |||
627 | page = alloc_pages(GFP_KERNEL, 0); | ||
628 | |||
629 | if (!page) | ||
630 | return NULL; | ||
631 | |||
632 | addr = page_address(page); | ||
633 | |||
634 | /* Give the signal return code some randomness */ | ||
635 | offset = 0x200 + (get_random_int() & 0x7fc); | ||
636 | signal_return_offset = offset; | ||
637 | |||
638 | /* | ||
639 | * Copy signal return handlers into the vector page, and | ||
640 | * set sigreturn to be a pointer to these. | ||
641 | */ | ||
642 | memcpy(addr + offset, sigreturn_codes, sizeof(sigreturn_codes)); | ||
643 | |||
644 | ptr = (unsigned long)addr + offset; | ||
645 | flush_icache_range(ptr, ptr + sizeof(sigreturn_codes)); | ||
646 | |||
647 | return page; | ||
648 | } | ||
diff --git a/arch/arm/kernel/signal.h b/arch/arm/kernel/signal.h deleted file mode 100644 index 5ff067b7c752..000000000000 --- a/arch/arm/kernel/signal.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/signal.h | ||
3 | * | ||
4 | * Copyright (C) 2005-2009 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #define KERN_SIGRETURN_CODE (CONFIG_VECTORS_BASE + 0x00000500) | ||
11 | |||
12 | extern const unsigned long sigreturn_codes[7]; | ||
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c index a98b62dca2fa..c2edfff573c2 100644 --- a/arch/arm/kernel/smp_tlb.c +++ b/arch/arm/kernel/smp_tlb.c | |||
@@ -70,23 +70,6 @@ static inline void ipi_flush_bp_all(void *ignored) | |||
70 | local_flush_bp_all(); | 70 | local_flush_bp_all(); |
71 | } | 71 | } |
72 | 72 | ||
73 | #ifdef CONFIG_ARM_ERRATA_798181 | ||
74 | static int erratum_a15_798181(void) | ||
75 | { | ||
76 | unsigned int midr = read_cpuid_id(); | ||
77 | |||
78 | /* Cortex-A15 r0p0..r3p2 affected */ | ||
79 | if ((midr & 0xff0ffff0) != 0x410fc0f0 || midr > 0x413fc0f2) | ||
80 | return 0; | ||
81 | return 1; | ||
82 | } | ||
83 | #else | ||
84 | static int erratum_a15_798181(void) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | #endif | ||
89 | |||
90 | static void ipi_flush_tlb_a15_erratum(void *arg) | 73 | static void ipi_flush_tlb_a15_erratum(void *arg) |
91 | { | 74 | { |
92 | dmb(); | 75 | dmb(); |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index cab094c234ee..ab517fcce21b 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -35,8 +35,6 @@ | |||
35 | #include <asm/tls.h> | 35 | #include <asm/tls.h> |
36 | #include <asm/system_misc.h> | 36 | #include <asm/system_misc.h> |
37 | 37 | ||
38 | #include "signal.h" | ||
39 | |||
40 | static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; | 38 | static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; |
41 | 39 | ||
42 | void *vectors_page; | 40 | void *vectors_page; |
@@ -800,15 +798,26 @@ void __init trap_init(void) | |||
800 | return; | 798 | return; |
801 | } | 799 | } |
802 | 800 | ||
803 | static void __init kuser_get_tls_init(unsigned long vectors) | 801 | #ifdef CONFIG_KUSER_HELPERS |
802 | static void __init kuser_init(void *vectors) | ||
804 | { | 803 | { |
804 | extern char __kuser_helper_start[], __kuser_helper_end[]; | ||
805 | int kuser_sz = __kuser_helper_end - __kuser_helper_start; | ||
806 | |||
807 | memcpy(vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz); | ||
808 | |||
805 | /* | 809 | /* |
806 | * vectors + 0xfe0 = __kuser_get_tls | 810 | * vectors + 0xfe0 = __kuser_get_tls |
807 | * vectors + 0xfe8 = hardware TLS instruction at 0xffff0fe8 | 811 | * vectors + 0xfe8 = hardware TLS instruction at 0xffff0fe8 |
808 | */ | 812 | */ |
809 | if (tls_emu || has_tls_reg) | 813 | if (tls_emu || has_tls_reg) |
810 | memcpy((void *)vectors + 0xfe0, (void *)vectors + 0xfe8, 4); | 814 | memcpy(vectors + 0xfe0, vectors + 0xfe8, 4); |
811 | } | 815 | } |
816 | #else | ||
817 | static void __init kuser_init(void *vectors) | ||
818 | { | ||
819 | } | ||
820 | #endif | ||
812 | 821 | ||
813 | void __init early_trap_init(void *vectors_base) | 822 | void __init early_trap_init(void *vectors_base) |
814 | { | 823 | { |
@@ -816,33 +825,30 @@ void __init early_trap_init(void *vectors_base) | |||
816 | unsigned long vectors = (unsigned long)vectors_base; | 825 | unsigned long vectors = (unsigned long)vectors_base; |
817 | extern char __stubs_start[], __stubs_end[]; | 826 | extern char __stubs_start[], __stubs_end[]; |
818 | extern char __vectors_start[], __vectors_end[]; | 827 | extern char __vectors_start[], __vectors_end[]; |
819 | extern char __kuser_helper_start[], __kuser_helper_end[]; | 828 | unsigned i; |
820 | int kuser_sz = __kuser_helper_end - __kuser_helper_start; | ||
821 | 829 | ||
822 | vectors_page = vectors_base; | 830 | vectors_page = vectors_base; |
823 | 831 | ||
824 | /* | 832 | /* |
833 | * Poison the vectors page with an undefined instruction. This | ||
834 | * instruction is chosen to be undefined for both ARM and Thumb | ||
835 | * ISAs. The Thumb version is an undefined instruction with a | ||
836 | * branch back to the undefined instruction. | ||
837 | */ | ||
838 | for (i = 0; i < PAGE_SIZE / sizeof(u32); i++) | ||
839 | ((u32 *)vectors_base)[i] = 0xe7fddef1; | ||
840 | |||
841 | /* | ||
825 | * Copy the vectors, stubs and kuser helpers (in entry-armv.S) | 842 | * Copy the vectors, stubs and kuser helpers (in entry-armv.S) |
826 | * into the vector page, mapped at 0xffff0000, and ensure these | 843 | * into the vector page, mapped at 0xffff0000, and ensure these |
827 | * are visible to the instruction stream. | 844 | * are visible to the instruction stream. |
828 | */ | 845 | */ |
829 | memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start); | 846 | memcpy((void *)vectors, __vectors_start, __vectors_end - __vectors_start); |
830 | memcpy((void *)vectors + 0x200, __stubs_start, __stubs_end - __stubs_start); | 847 | memcpy((void *)vectors + 0x1000, __stubs_start, __stubs_end - __stubs_start); |
831 | memcpy((void *)vectors + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz); | ||
832 | 848 | ||
833 | /* | 849 | kuser_init(vectors_base); |
834 | * Do processor specific fixups for the kuser helpers | ||
835 | */ | ||
836 | kuser_get_tls_init(vectors); | ||
837 | |||
838 | /* | ||
839 | * Copy signal return handlers into the vector page, and | ||
840 | * set sigreturn to be a pointer to these. | ||
841 | */ | ||
842 | memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE), | ||
843 | sigreturn_codes, sizeof(sigreturn_codes)); | ||
844 | 850 | ||
845 | flush_icache_range(vectors, vectors + PAGE_SIZE); | 851 | flush_icache_range(vectors, vectors + PAGE_SIZE * 2); |
846 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); | 852 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); |
847 | #else /* ifndef CONFIG_CPU_V7M */ | 853 | #else /* ifndef CONFIG_CPU_V7M */ |
848 | /* | 854 | /* |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index fa25e4e425f6..7bcee5c9b604 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -148,6 +148,23 @@ SECTIONS | |||
148 | . = ALIGN(PAGE_SIZE); | 148 | . = ALIGN(PAGE_SIZE); |
149 | __init_begin = .; | 149 | __init_begin = .; |
150 | #endif | 150 | #endif |
151 | /* | ||
152 | * The vectors and stubs are relocatable code, and the | ||
153 | * only thing that matters is their relative offsets | ||
154 | */ | ||
155 | __vectors_start = .; | ||
156 | .vectors 0 : AT(__vectors_start) { | ||
157 | *(.vectors) | ||
158 | } | ||
159 | . = __vectors_start + SIZEOF(.vectors); | ||
160 | __vectors_end = .; | ||
161 | |||
162 | __stubs_start = .; | ||
163 | .stubs 0x1000 : AT(__stubs_start) { | ||
164 | *(.stubs) | ||
165 | } | ||
166 | . = __stubs_start + SIZEOF(.stubs); | ||
167 | __stubs_end = .; | ||
151 | 168 | ||
152 | INIT_TEXT_SECTION(8) | 169 | INIT_TEXT_SECTION(8) |
153 | .exit.text : { | 170 | .exit.text : { |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index afbc439f11d4..4cdb61c54459 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -505,7 +505,7 @@ static struct vpbe_output dm365evm_vpbe_outputs[] = { | |||
505 | /* | 505 | /* |
506 | * Amplifiers on the board | 506 | * Amplifiers on the board |
507 | */ | 507 | */ |
508 | struct ths7303_platform_data ths7303_pdata = { | 508 | static struct ths7303_platform_data ths7303_pdata = { |
509 | .ch_1 = 3, | 509 | .ch_1 = 3, |
510 | .ch_2 = 3, | 510 | .ch_2 = 3, |
511 | .ch_3 = 3, | 511 | .ch_3 = 3, |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 42ef53f62c6c..86100d179694 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
@@ -860,7 +860,7 @@ static struct platform_device dm355_vpbe_display = { | |||
860 | }, | 860 | }, |
861 | }; | 861 | }; |
862 | 862 | ||
863 | struct venc_platform_data dm355_venc_pdata = { | 863 | static struct venc_platform_data dm355_venc_pdata = { |
864 | .setup_pinmux = dm355_vpbe_setup_pinmux, | 864 | .setup_pinmux = dm355_vpbe_setup_pinmux, |
865 | .setup_clock = dm355_venc_setup_clock, | 865 | .setup_clock = dm355_venc_setup_clock, |
866 | }; | 866 | }; |
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index fa7af5eda52d..dad28029ba9b 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -1349,7 +1349,7 @@ static struct platform_device dm365_vpbe_display = { | |||
1349 | }, | 1349 | }, |
1350 | }; | 1350 | }; |
1351 | 1351 | ||
1352 | struct venc_platform_data dm365_venc_pdata = { | 1352 | static struct venc_platform_data dm365_venc_pdata = { |
1353 | .setup_pinmux = dm365_vpbe_setup_pinmux, | 1353 | .setup_pinmux = dm365_vpbe_setup_pinmux, |
1354 | .setup_clock = dm365_venc_setup_clock, | 1354 | .setup_clock = dm365_venc_setup_clock, |
1355 | }; | 1355 | }; |
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 855d4a7b462d..5952e68c76c4 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -92,6 +92,7 @@ config SOC_EXYNOS5440 | |||
92 | bool "SAMSUNG EXYNOS5440" | 92 | bool "SAMSUNG EXYNOS5440" |
93 | default y | 93 | default y |
94 | depends on ARCH_EXYNOS5 | 94 | depends on ARCH_EXYNOS5 |
95 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | ||
95 | select ARCH_HAS_OPP | 96 | select ARCH_HAS_OPP |
96 | select HAVE_ARM_ARCH_TIMER | 97 | select HAVE_ARM_ARCH_TIMER |
97 | select AUTO_ZRELADDR | 98 | select AUTO_ZRELADDR |
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index e970a7a4e278..53696154aead 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile | |||
@@ -14,7 +14,7 @@ obj- := | |||
14 | 14 | ||
15 | obj-$(CONFIG_ARCH_EXYNOS) += common.o | 15 | obj-$(CONFIG_ARCH_EXYNOS) += common.o |
16 | 16 | ||
17 | obj-$(CONFIG_PM) += pm.o | 17 | obj-$(CONFIG_S5P_PM) += pm.o |
18 | obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o | 18 | obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o |
19 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 19 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
20 | 20 | ||
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 164685bd25c8..ba95e5db2501 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c | |||
@@ -58,7 +58,6 @@ static const char name_exynos5440[] = "EXYNOS5440"; | |||
58 | 58 | ||
59 | static void exynos4_map_io(void); | 59 | static void exynos4_map_io(void); |
60 | static void exynos5_map_io(void); | 60 | static void exynos5_map_io(void); |
61 | static void exynos5440_map_io(void); | ||
62 | static int exynos_init(void); | 61 | static int exynos_init(void); |
63 | 62 | ||
64 | static struct cpu_table cpu_ids[] __initdata = { | 63 | static struct cpu_table cpu_ids[] __initdata = { |
@@ -95,7 +94,6 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
95 | }, { | 94 | }, { |
96 | .idcode = EXYNOS5440_SOC_ID, | 95 | .idcode = EXYNOS5440_SOC_ID, |
97 | .idmask = EXYNOS5_SOC_MASK, | 96 | .idmask = EXYNOS5_SOC_MASK, |
98 | .map_io = exynos5440_map_io, | ||
99 | .init = exynos_init, | 97 | .init = exynos_init, |
100 | .name = name_exynos5440, | 98 | .name = name_exynos5440, |
101 | }, | 99 | }, |
@@ -150,11 +148,6 @@ static struct map_desc exynos4_iodesc[] __initdata = { | |||
150 | .length = SZ_64K, | 148 | .length = SZ_64K, |
151 | .type = MT_DEVICE, | 149 | .type = MT_DEVICE, |
152 | }, { | 150 | }, { |
153 | .virtual = (unsigned long)S3C_VA_UART, | ||
154 | .pfn = __phys_to_pfn(EXYNOS4_PA_UART), | ||
155 | .length = SZ_512K, | ||
156 | .type = MT_DEVICE, | ||
157 | }, { | ||
158 | .virtual = (unsigned long)S5P_VA_CMU, | 151 | .virtual = (unsigned long)S5P_VA_CMU, |
159 | .pfn = __phys_to_pfn(EXYNOS4_PA_CMU), | 152 | .pfn = __phys_to_pfn(EXYNOS4_PA_CMU), |
160 | .length = SZ_128K, | 153 | .length = SZ_128K, |
@@ -268,20 +261,6 @@ static struct map_desc exynos5_iodesc[] __initdata = { | |||
268 | .pfn = __phys_to_pfn(EXYNOS5_PA_PMU), | 261 | .pfn = __phys_to_pfn(EXYNOS5_PA_PMU), |
269 | .length = SZ_64K, | 262 | .length = SZ_64K, |
270 | .type = MT_DEVICE, | 263 | .type = MT_DEVICE, |
271 | }, { | ||
272 | .virtual = (unsigned long)S3C_VA_UART, | ||
273 | .pfn = __phys_to_pfn(EXYNOS5_PA_UART), | ||
274 | .length = SZ_512K, | ||
275 | .type = MT_DEVICE, | ||
276 | }, | ||
277 | }; | ||
278 | |||
279 | static struct map_desc exynos5440_iodesc0[] __initdata = { | ||
280 | { | ||
281 | .virtual = (unsigned long)S3C_VA_UART, | ||
282 | .pfn = __phys_to_pfn(EXYNOS5440_PA_UART0), | ||
283 | .length = SZ_512K, | ||
284 | .type = MT_DEVICE, | ||
285 | }, | 264 | }, |
286 | }; | 265 | }; |
287 | 266 | ||
@@ -388,11 +367,6 @@ static void __init exynos5_map_io(void) | |||
388 | iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc)); | 367 | iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc)); |
389 | } | 368 | } |
390 | 369 | ||
391 | static void __init exynos5440_map_io(void) | ||
392 | { | ||
393 | iotable_init(exynos5440_iodesc0, ARRAY_SIZE(exynos5440_iodesc0)); | ||
394 | } | ||
395 | |||
396 | void __init exynos_init_time(void) | 370 | void __init exynos_init_time(void) |
397 | { | 371 | { |
398 | of_clk_init(NULL); | 372 | of_clk_init(NULL); |
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 3e156bcddcb4..972490fc09d6 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -97,6 +97,5 @@ struct exynos_pmu_conf { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | 99 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); |
100 | extern void s3c_cpu_resume(void); | ||
101 | 100 | ||
102 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ | 101 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ |
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 17a18ff3d71e..225ee8431c72 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <mach/regs-pmu.h> | 25 | #include <mach/regs-pmu.h> |
26 | 26 | ||
27 | #include <plat/cpu.h> | 27 | #include <plat/cpu.h> |
28 | #include <plat/pm.h> | ||
28 | 29 | ||
29 | #include "common.h" | 30 | #include "common.h" |
30 | 31 | ||
diff --git a/arch/arm/mach-exynos/include/mach/memory.h b/arch/arm/mach-exynos/include/mach/memory.h index 374ef2cf7152..2a4cdb7cb326 100644 --- a/arch/arm/mach-exynos/include/mach/memory.h +++ b/arch/arm/mach-exynos/include/mach/memory.h | |||
@@ -15,8 +15,13 @@ | |||
15 | 15 | ||
16 | #define PLAT_PHYS_OFFSET UL(0x40000000) | 16 | #define PLAT_PHYS_OFFSET UL(0x40000000) |
17 | 17 | ||
18 | #ifndef CONFIG_ARM_LPAE | ||
18 | /* Maximum of 256MiB in one bank */ | 19 | /* Maximum of 256MiB in one bank */ |
19 | #define MAX_PHYSMEM_BITS 32 | 20 | #define MAX_PHYSMEM_BITS 32 |
20 | #define SECTION_SIZE_BITS 28 | 21 | #define SECTION_SIZE_BITS 28 |
22 | #else | ||
23 | #define MAX_PHYSMEM_BITS 36 | ||
24 | #define SECTION_SIZE_BITS 31 | ||
25 | #endif | ||
21 | 26 | ||
22 | #endif /* __ASM_ARCH_MEMORY_H */ | 27 | #endif /* __ASM_ARCH_MEMORY_H */ |
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 41c20692a13f..c679db577269 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c | |||
@@ -217,6 +217,9 @@ static __init int exynos_pm_drvinit(void) | |||
217 | struct clk *pll_base; | 217 | struct clk *pll_base; |
218 | unsigned int tmp; | 218 | unsigned int tmp; |
219 | 219 | ||
220 | if (soc_is_exynos5440()) | ||
221 | return 0; | ||
222 | |||
220 | s3c_pm_init(); | 223 | s3c_pm_init(); |
221 | 224 | ||
222 | /* All wakeup disable */ | 225 | /* All wakeup disable */ |
@@ -340,6 +343,9 @@ static struct syscore_ops exynos_pm_syscore_ops = { | |||
340 | 343 | ||
341 | static __init int exynos_pm_syscore_init(void) | 344 | static __init int exynos_pm_syscore_init(void) |
342 | { | 345 | { |
346 | if (soc_is_exynos5440()) | ||
347 | return 0; | ||
348 | |||
343 | register_syscore_ops(&exynos_pm_syscore_ops); | 349 | register_syscore_ops(&exynos_pm_syscore_ops); |
344 | return 0; | 350 | return 0; |
345 | } | 351 | } |
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index a7cd2cf5e08d..3490a24f969e 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c | |||
@@ -276,8 +276,6 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys) | |||
276 | 276 | ||
277 | sys->mem_offset = DC21285_PCI_MEM; | 277 | sys->mem_offset = DC21285_PCI_MEM; |
278 | 278 | ||
279 | pci_ioremap_io(0, DC21285_PCI_IO); | ||
280 | |||
281 | pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); | 279 | pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); |
282 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 280 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); |
283 | 281 | ||
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index dc5d6becd8c7..88815795fe26 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c | |||
@@ -115,6 +115,7 @@ static int highbank_platform_notifier(struct notifier_block *nb, | |||
115 | { | 115 | { |
116 | struct resource *res; | 116 | struct resource *res; |
117 | int reg = -1; | 117 | int reg = -1; |
118 | u32 val; | ||
118 | struct device *dev = __dev; | 119 | struct device *dev = __dev; |
119 | 120 | ||
120 | if (event != BUS_NOTIFY_ADD_DEVICE) | 121 | if (event != BUS_NOTIFY_ADD_DEVICE) |
@@ -141,10 +142,10 @@ static int highbank_platform_notifier(struct notifier_block *nb, | |||
141 | return NOTIFY_DONE; | 142 | return NOTIFY_DONE; |
142 | 143 | ||
143 | if (of_property_read_bool(dev->of_node, "dma-coherent")) { | 144 | if (of_property_read_bool(dev->of_node, "dma-coherent")) { |
144 | writel(0xff31, sregs_base + reg); | 145 | val = readl(sregs_base + reg); |
146 | writel(val | 0xff01, sregs_base + reg); | ||
145 | set_dma_ops(dev, &arm_coherent_dma_ops); | 147 | set_dma_ops(dev, &arm_coherent_dma_ops); |
146 | } else | 148 | } |
147 | writel(0, sregs_base + reg); | ||
148 | 149 | ||
149 | return NOTIFY_OK; | 150 | return NOTIFY_OK; |
150 | } | 151 | } |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index 4282e99f5ca1..86567d980b07 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -199,7 +199,8 @@ static const char *pcie_axi_sels[] = { "axi", "ahb", }; | |||
199 | static const char *ssi_sels[] = { "pll3_pfd2_508m", "pll3_pfd3_454m", "pll4_post_div", }; | 199 | static const char *ssi_sels[] = { "pll3_pfd2_508m", "pll3_pfd3_454m", "pll4_post_div", }; |
200 | static const char *usdhc_sels[] = { "pll2_pfd2_396m", "pll2_pfd0_352m", }; | 200 | static const char *usdhc_sels[] = { "pll2_pfd2_396m", "pll2_pfd0_352m", }; |
201 | static const char *enfc_sels[] = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", }; | 201 | static const char *enfc_sels[] = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", }; |
202 | static const char *emi_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", }; | 202 | static const char *emi_sels[] = { "pll2_pfd2_396m", "pll3_usb_otg", "axi", "pll2_pfd0_352m", }; |
203 | static const char *emi_slow_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", }; | ||
203 | static const char *vdo_axi_sels[] = { "axi", "ahb", }; | 204 | static const char *vdo_axi_sels[] = { "axi", "ahb", }; |
204 | static const char *vpu_axi_sels[] = { "axi", "pll2_pfd2_396m", "pll2_pfd0_352m", }; | 205 | static const char *vpu_axi_sels[] = { "axi", "pll2_pfd2_396m", "pll2_pfd0_352m", }; |
205 | static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div", | 206 | static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div", |
@@ -392,7 +393,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
392 | clk[usdhc4_sel] = imx_clk_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels, ARRAY_SIZE(usdhc_sels)); | 393 | clk[usdhc4_sel] = imx_clk_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels, ARRAY_SIZE(usdhc_sels)); |
393 | clk[enfc_sel] = imx_clk_mux("enfc_sel", base + 0x2c, 16, 2, enfc_sels, ARRAY_SIZE(enfc_sels)); | 394 | clk[enfc_sel] = imx_clk_mux("enfc_sel", base + 0x2c, 16, 2, enfc_sels, ARRAY_SIZE(enfc_sels)); |
394 | clk[emi_sel] = imx_clk_mux("emi_sel", base + 0x1c, 27, 2, emi_sels, ARRAY_SIZE(emi_sels)); | 395 | clk[emi_sel] = imx_clk_mux("emi_sel", base + 0x1c, 27, 2, emi_sels, ARRAY_SIZE(emi_sels)); |
395 | clk[emi_slow_sel] = imx_clk_mux("emi_slow_sel", base + 0x1c, 29, 2, emi_sels, ARRAY_SIZE(emi_sels)); | 396 | clk[emi_slow_sel] = imx_clk_mux("emi_slow_sel", base + 0x1c, 29, 2, emi_slow_sels, ARRAY_SIZE(emi_slow_sels)); |
396 | clk[vdo_axi_sel] = imx_clk_mux("vdo_axi_sel", base + 0x18, 11, 1, vdo_axi_sels, ARRAY_SIZE(vdo_axi_sels)); | 397 | clk[vdo_axi_sel] = imx_clk_mux("vdo_axi_sel", base + 0x18, 11, 1, vdo_axi_sels, ARRAY_SIZE(vdo_axi_sels)); |
397 | clk[vpu_axi_sel] = imx_clk_mux("vpu_axi_sel", base + 0x18, 14, 2, vpu_axi_sels, ARRAY_SIZE(vpu_axi_sels)); | 398 | clk[vpu_axi_sel] = imx_clk_mux("vpu_axi_sel", base + 0x18, 14, 2, vpu_axi_sels, ARRAY_SIZE(vpu_axi_sels)); |
398 | clk[cko1_sel] = imx_clk_mux("cko1_sel", base + 0x60, 0, 4, cko1_sels, ARRAY_SIZE(cko1_sels)); | 399 | clk[cko1_sel] = imx_clk_mux("cko1_sel", base + 0x60, 0, 4, cko1_sels, ARRAY_SIZE(cko1_sels)); |
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c index d617c0b7c809..b169a396d93b 100644 --- a/arch/arm/mach-imx/clk-vf610.c +++ b/arch/arm/mach-imx/clk-vf610.c | |||
@@ -183,6 +183,8 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) | |||
183 | clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7); | 183 | clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7); |
184 | clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24); | 184 | clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24); |
185 | clk[VF610_CLK_ENET_TS] = imx_clk_gate("enet_ts", "enet_ts_sel", CCM_CSCDR1, 23); | 185 | clk[VF610_CLK_ENET_TS] = imx_clk_gate("enet_ts", "enet_ts_sel", CCM_CSCDR1, 23); |
186 | clk[VF610_CLK_ENET0] = imx_clk_gate2("enet0", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(0)); | ||
187 | clk[VF610_CLK_ENET1] = imx_clk_gate2("enet1", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(1)); | ||
186 | 188 | ||
187 | clk[VF610_CLK_PIT] = imx_clk_gate2("pit", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(7)); | 189 | clk[VF610_CLK_PIT] = imx_clk_gate2("pit", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(7)); |
188 | 190 | ||
diff --git a/arch/arm/mach-imx/mx27.h b/arch/arm/mach-imx/mx27.h index e074616d54ca..8a65f192e7f3 100644 --- a/arch/arm/mach-imx/mx27.h +++ b/arch/arm/mach-imx/mx27.h | |||
@@ -135,7 +135,7 @@ | |||
135 | #define MX27_INT_GPT4 (NR_IRQS_LEGACY + 4) | 135 | #define MX27_INT_GPT4 (NR_IRQS_LEGACY + 4) |
136 | #define MX27_INT_RTIC (NR_IRQS_LEGACY + 5) | 136 | #define MX27_INT_RTIC (NR_IRQS_LEGACY + 5) |
137 | #define MX27_INT_CSPI3 (NR_IRQS_LEGACY + 6) | 137 | #define MX27_INT_CSPI3 (NR_IRQS_LEGACY + 6) |
138 | #define MX27_INT_SDHC (NR_IRQS_LEGACY + 7) | 138 | #define MX27_INT_MSHC (NR_IRQS_LEGACY + 7) |
139 | #define MX27_INT_GPIO (NR_IRQS_LEGACY + 8) | 139 | #define MX27_INT_GPIO (NR_IRQS_LEGACY + 8) |
140 | #define MX27_INT_SDHC3 (NR_IRQS_LEGACY + 9) | 140 | #define MX27_INT_SDHC3 (NR_IRQS_LEGACY + 9) |
141 | #define MX27_INT_SDHC2 (NR_IRQS_LEGACY + 10) | 141 | #define MX27_INT_SDHC2 (NR_IRQS_LEGACY + 10) |
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index fe4d9ff93a7e..b661c5c2870a 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c | |||
@@ -49,7 +49,7 @@ static const char *keystone_match[] __initconst = { | |||
49 | NULL, | 49 | NULL, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | void keystone_restart(char mode, const char *cmd) | 52 | void keystone_restart(enum reboot_mode mode, const char *cmd) |
53 | { | 53 | { |
54 | u32 val; | 54 | u32 val; |
55 | 55 | ||
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 3d6ee149d3d7..76170dd4d88f 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -61,7 +61,7 @@ config SOC_OMAP5 | |||
61 | select HAVE_SMP | 61 | select HAVE_SMP |
62 | select COMMON_CLK | 62 | select COMMON_CLK |
63 | select HAVE_ARM_ARCH_TIMER | 63 | select HAVE_ARM_ARCH_TIMER |
64 | select ARM_ERRATA_798181 | 64 | select ARM_ERRATA_798181 if SMP |
65 | 65 | ||
66 | config SOC_AM33XX | 66 | config SOC_AM33XX |
67 | bool "AM33XX support" | 67 | bool "AM33XX support" |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index e5fbfed69aa2..be5d005ebad2 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/of_irq.h> | 15 | #include <linux/of_irq.h> |
16 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
17 | #include <linux/irqdomain.h> | 17 | #include <linux/irqdomain.h> |
18 | #include <linux/clk.h> | ||
18 | 19 | ||
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
20 | 21 | ||
@@ -35,6 +36,21 @@ static struct of_device_id omap_dt_match_table[] __initdata = { | |||
35 | { } | 36 | { } |
36 | }; | 37 | }; |
37 | 38 | ||
39 | /* | ||
40 | * Create alias for USB host PHY clock. | ||
41 | * Remove this when clock phandle can be provided via DT | ||
42 | */ | ||
43 | static void __init legacy_init_ehci_clk(char *clkname) | ||
44 | { | ||
45 | int ret; | ||
46 | |||
47 | ret = clk_add_alias("main_clk", NULL, clkname, NULL); | ||
48 | if (ret) { | ||
49 | pr_err("%s:Failed to add main_clk alias to %s :%d\n", | ||
50 | __func__, clkname, ret); | ||
51 | } | ||
52 | } | ||
53 | |||
38 | static void __init omap_generic_init(void) | 54 | static void __init omap_generic_init(void) |
39 | { | 55 | { |
40 | omap_sdrc_init(NULL, NULL); | 56 | omap_sdrc_init(NULL, NULL); |
@@ -45,10 +61,15 @@ static void __init omap_generic_init(void) | |||
45 | * HACK: call display setup code for selected boards to enable omapdss. | 61 | * HACK: call display setup code for selected boards to enable omapdss. |
46 | * This will be removed when omapdss supports DT. | 62 | * This will be removed when omapdss supports DT. |
47 | */ | 63 | */ |
48 | if (of_machine_is_compatible("ti,omap4-panda")) | 64 | if (of_machine_is_compatible("ti,omap4-panda")) { |
49 | omap4_panda_display_init_of(); | 65 | omap4_panda_display_init_of(); |
66 | legacy_init_ehci_clk("auxclk3_ck"); | ||
67 | |||
68 | } | ||
50 | else if (of_machine_is_compatible("ti,omap4-sdp")) | 69 | else if (of_machine_is_compatible("ti,omap4-sdp")) |
51 | omap_4430sdp_display_init_of(); | 70 | omap_4430sdp_display_init_of(); |
71 | else if (of_machine_is_compatible("ti,omap5-uevm")) | ||
72 | legacy_init_ehci_clk("auxclk1_ck"); | ||
52 | } | 73 | } |
53 | 74 | ||
54 | #ifdef CONFIG_SOC_OMAP2420 | 75 | #ifdef CONFIG_SOC_OMAP2420 |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index f6726bb4eb95..3a3362fa793e 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -477,16 +477,24 @@ static int em_x270_usb_hub_init(void) | |||
477 | /* USB Hub power-on and reset */ | 477 | /* USB Hub power-on and reset */ |
478 | gpio_direction_output(usb_hub_reset, 1); | 478 | gpio_direction_output(usb_hub_reset, 1); |
479 | gpio_direction_output(GPIO9_USB_VBUS_EN, 0); | 479 | gpio_direction_output(GPIO9_USB_VBUS_EN, 0); |
480 | regulator_enable(em_x270_usb_ldo); | 480 | err = regulator_enable(em_x270_usb_ldo); |
481 | if (err) | ||
482 | goto err_free_rst_gpio; | ||
483 | |||
481 | gpio_set_value(usb_hub_reset, 0); | 484 | gpio_set_value(usb_hub_reset, 0); |
482 | gpio_set_value(usb_hub_reset, 1); | 485 | gpio_set_value(usb_hub_reset, 1); |
483 | regulator_disable(em_x270_usb_ldo); | 486 | regulator_disable(em_x270_usb_ldo); |
484 | regulator_enable(em_x270_usb_ldo); | 487 | err = regulator_enable(em_x270_usb_ldo); |
488 | if (err) | ||
489 | goto err_free_rst_gpio; | ||
490 | |||
485 | gpio_set_value(usb_hub_reset, 0); | 491 | gpio_set_value(usb_hub_reset, 0); |
486 | gpio_set_value(GPIO9_USB_VBUS_EN, 1); | 492 | gpio_set_value(GPIO9_USB_VBUS_EN, 1); |
487 | 493 | ||
488 | return 0; | 494 | return 0; |
489 | 495 | ||
496 | err_free_rst_gpio: | ||
497 | gpio_free(usb_hub_reset); | ||
490 | err_free_vbus_gpio: | 498 | err_free_vbus_gpio: |
491 | gpio_free(GPIO9_USB_VBUS_EN); | 499 | gpio_free(GPIO9_USB_VBUS_EN); |
492 | err_free_usb_ldo: | 500 | err_free_usb_ldo: |
@@ -592,7 +600,7 @@ err_irq: | |||
592 | return err; | 600 | return err; |
593 | } | 601 | } |
594 | 602 | ||
595 | static void em_x270_mci_setpower(struct device *dev, unsigned int vdd) | 603 | static int em_x270_mci_setpower(struct device *dev, unsigned int vdd) |
596 | { | 604 | { |
597 | struct pxamci_platform_data* p_d = dev->platform_data; | 605 | struct pxamci_platform_data* p_d = dev->platform_data; |
598 | 606 | ||
@@ -600,10 +608,11 @@ static void em_x270_mci_setpower(struct device *dev, unsigned int vdd) | |||
600 | int vdd_uV = (2000 + (vdd - __ffs(MMC_VDD_20_21)) * 100) * 1000; | 608 | int vdd_uV = (2000 + (vdd - __ffs(MMC_VDD_20_21)) * 100) * 1000; |
601 | 609 | ||
602 | regulator_set_voltage(em_x270_sdio_ldo, vdd_uV, vdd_uV); | 610 | regulator_set_voltage(em_x270_sdio_ldo, vdd_uV, vdd_uV); |
603 | regulator_enable(em_x270_sdio_ldo); | 611 | return regulator_enable(em_x270_sdio_ldo); |
604 | } else { | 612 | } else { |
605 | regulator_disable(em_x270_sdio_ldo); | 613 | regulator_disable(em_x270_sdio_ldo); |
606 | } | 614 | } |
615 | return 0; | ||
607 | } | 616 | } |
608 | 617 | ||
609 | static void em_x270_mci_exit(struct device *dev, void *data) | 618 | static void em_x270_mci_exit(struct device *dev, void *data) |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index d2c652318376..dd70343c8708 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -408,7 +408,7 @@ static int mainstone_mci_init(struct device *dev, irq_handler_t mstone_detect_in | |||
408 | return err; | 408 | return err; |
409 | } | 409 | } |
410 | 410 | ||
411 | static void mainstone_mci_setpower(struct device *dev, unsigned int vdd) | 411 | static int mainstone_mci_setpower(struct device *dev, unsigned int vdd) |
412 | { | 412 | { |
413 | struct pxamci_platform_data* p_d = dev->platform_data; | 413 | struct pxamci_platform_data* p_d = dev->platform_data; |
414 | 414 | ||
@@ -420,6 +420,7 @@ static void mainstone_mci_setpower(struct device *dev, unsigned int vdd) | |||
420 | printk(KERN_DEBUG "%s: off\n", __func__); | 420 | printk(KERN_DEBUG "%s: off\n", __func__); |
421 | MST_MSCWR1 &= ~MST_MSCWR1_MMC_ON; | 421 | MST_MSCWR1 &= ~MST_MSCWR1_MMC_ON; |
422 | } | 422 | } |
423 | return 0; | ||
423 | } | 424 | } |
424 | 425 | ||
425 | static void mainstone_mci_exit(struct device *dev, void *data) | 426 | static void mainstone_mci_exit(struct device *dev, void *data) |
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index fb7f1d1627dc..13e5b00eae90 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c | |||
@@ -335,7 +335,7 @@ static int pcm990_mci_init(struct device *dev, irq_handler_t mci_detect_int, | |||
335 | return err; | 335 | return err; |
336 | } | 336 | } |
337 | 337 | ||
338 | static void pcm990_mci_setpower(struct device *dev, unsigned int vdd) | 338 | static int pcm990_mci_setpower(struct device *dev, unsigned int vdd) |
339 | { | 339 | { |
340 | struct pxamci_platform_data *p_d = dev->platform_data; | 340 | struct pxamci_platform_data *p_d = dev->platform_data; |
341 | u8 val; | 341 | u8 val; |
@@ -348,6 +348,7 @@ static void pcm990_mci_setpower(struct device *dev, unsigned int vdd) | |||
348 | val &= ~PCM990_CTRL_MMC2PWR; | 348 | val &= ~PCM990_CTRL_MMC2PWR; |
349 | 349 | ||
350 | pcm990_cpld_writeb(PCM990_CTRL_MMC2PWR, PCM990_CTRL_REG5); | 350 | pcm990_cpld_writeb(PCM990_CTRL_MMC2PWR, PCM990_CTRL_REG5); |
351 | return 0; | ||
351 | } | 352 | } |
352 | 353 | ||
353 | static void pcm990_mci_exit(struct device *dev, void *data) | 354 | static void pcm990_mci_exit(struct device *dev, void *data) |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 711d37e26bd8..aedf053a1de5 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -258,7 +258,7 @@ err_free_2: | |||
258 | return err; | 258 | return err; |
259 | } | 259 | } |
260 | 260 | ||
261 | static void poodle_mci_setpower(struct device *dev, unsigned int vdd) | 261 | static int poodle_mci_setpower(struct device *dev, unsigned int vdd) |
262 | { | 262 | { |
263 | struct pxamci_platform_data* p_d = dev->platform_data; | 263 | struct pxamci_platform_data* p_d = dev->platform_data; |
264 | 264 | ||
@@ -270,6 +270,8 @@ static void poodle_mci_setpower(struct device *dev, unsigned int vdd) | |||
270 | gpio_set_value(POODLE_GPIO_SD_PWR1, 0); | 270 | gpio_set_value(POODLE_GPIO_SD_PWR1, 0); |
271 | gpio_set_value(POODLE_GPIO_SD_PWR, 0); | 271 | gpio_set_value(POODLE_GPIO_SD_PWR, 0); |
272 | } | 272 | } |
273 | |||
274 | return 0; | ||
273 | } | 275 | } |
274 | 276 | ||
275 | static void poodle_mci_exit(struct device *dev, void *data) | 277 | static void poodle_mci_exit(struct device *dev, void *data) |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 2125df0444e7..4c29173026e8 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -598,7 +598,7 @@ static inline void spitz_spi_init(void) {} | |||
598 | * NOTE: The card detect interrupt isn't debounced so we delay it by 250ms to | 598 | * NOTE: The card detect interrupt isn't debounced so we delay it by 250ms to |
599 | * give the card a chance to fully insert/eject. | 599 | * give the card a chance to fully insert/eject. |
600 | */ | 600 | */ |
601 | static void spitz_mci_setpower(struct device *dev, unsigned int vdd) | 601 | static int spitz_mci_setpower(struct device *dev, unsigned int vdd) |
602 | { | 602 | { |
603 | struct pxamci_platform_data* p_d = dev->platform_data; | 603 | struct pxamci_platform_data* p_d = dev->platform_data; |
604 | 604 | ||
@@ -606,6 +606,8 @@ static void spitz_mci_setpower(struct device *dev, unsigned int vdd) | |||
606 | spitz_card_pwr_ctrl(SCOOP_CPR_SD_3V, SCOOP_CPR_SD_3V); | 606 | spitz_card_pwr_ctrl(SCOOP_CPR_SD_3V, SCOOP_CPR_SD_3V); |
607 | else | 607 | else |
608 | spitz_card_pwr_ctrl(SCOOP_CPR_SD_3V, 0x0); | 608 | spitz_card_pwr_ctrl(SCOOP_CPR_SD_3V, 0x0); |
609 | |||
610 | return 0; | ||
609 | } | 611 | } |
610 | 612 | ||
611 | static struct pxamci_platform_data spitz_mci_platform_data = { | 613 | static struct pxamci_platform_data spitz_mci_platform_data = { |
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 88fde43c948c..62aea3e835f3 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -734,9 +734,10 @@ static int stargate2_mci_init(struct device *dev, | |||
734 | * | 734 | * |
735 | * Very simple control. Either it is on or off and is controlled by | 735 | * Very simple control. Either it is on or off and is controlled by |
736 | * a gpio pin */ | 736 | * a gpio pin */ |
737 | static void stargate2_mci_setpower(struct device *dev, unsigned int vdd) | 737 | static int stargate2_mci_setpower(struct device *dev, unsigned int vdd) |
738 | { | 738 | { |
739 | gpio_set_value(SG2_SD_POWER_ENABLE, !!vdd); | 739 | gpio_set_value(SG2_SD_POWER_ENABLE, !!vdd); |
740 | return 0; | ||
740 | } | 741 | } |
741 | 742 | ||
742 | static void stargate2_mci_exit(struct device *dev, void *data) | 743 | static void stargate2_mci_exit(struct device *dev, void *data) |
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index 7791ac76f945..dba2173e70f3 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig | |||
@@ -30,7 +30,6 @@ config CPU_S3C2410 | |||
30 | select S3C2410_CLOCK | 30 | select S3C2410_CLOCK |
31 | select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ | 31 | select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ |
32 | select S3C2410_PM if PM | 32 | select S3C2410_PM if PM |
33 | select SAMSUNG_HRT | ||
34 | select SAMSUNG_WDT_RESET | 33 | select SAMSUNG_WDT_RESET |
35 | help | 34 | help |
36 | Support for S3C2410 and S3C2410A family from the S3C24XX line | 35 | Support for S3C2410 and S3C2410A family from the S3C24XX line |
@@ -42,7 +41,6 @@ config CPU_S3C2412 | |||
42 | select CPU_LLSERIAL_S3C2440 | 41 | select CPU_LLSERIAL_S3C2440 |
43 | select S3C2412_DMA if S3C24XX_DMA | 42 | select S3C2412_DMA if S3C24XX_DMA |
44 | select S3C2412_PM if PM | 43 | select S3C2412_PM if PM |
45 | select SAMSUNG_HRT | ||
46 | help | 44 | help |
47 | Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line | 45 | Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line |
48 | 46 | ||
@@ -54,7 +52,6 @@ config CPU_S3C2416 | |||
54 | select S3C2443_COMMON | 52 | select S3C2443_COMMON |
55 | select S3C2443_DMA if S3C24XX_DMA | 53 | select S3C2443_DMA if S3C24XX_DMA |
56 | select SAMSUNG_CLKSRC | 54 | select SAMSUNG_CLKSRC |
57 | select SAMSUNG_HRT | ||
58 | help | 55 | help |
59 | Support for the S3C2416 SoC from the S3C24XX line | 56 | Support for the S3C2416 SoC from the S3C24XX line |
60 | 57 | ||
@@ -65,7 +62,6 @@ config CPU_S3C2440 | |||
65 | select S3C2410_CLOCK | 62 | select S3C2410_CLOCK |
66 | select S3C2410_PM if PM | 63 | select S3C2410_PM if PM |
67 | select S3C2440_DMA if S3C24XX_DMA | 64 | select S3C2440_DMA if S3C24XX_DMA |
68 | select SAMSUNG_HRT | ||
69 | help | 65 | help |
70 | Support for S3C2440 Samsung Mobile CPU based systems. | 66 | Support for S3C2440 Samsung Mobile CPU based systems. |
71 | 67 | ||
@@ -75,7 +71,6 @@ config CPU_S3C2442 | |||
75 | select CPU_LLSERIAL_S3C2440 | 71 | select CPU_LLSERIAL_S3C2440 |
76 | select S3C2410_CLOCK | 72 | select S3C2410_CLOCK |
77 | select S3C2410_PM if PM | 73 | select S3C2410_PM if PM |
78 | select SAMSUNG_HRT | ||
79 | help | 74 | help |
80 | Support for S3C2442 Samsung Mobile CPU based systems. | 75 | Support for S3C2442 Samsung Mobile CPU based systems. |
81 | 76 | ||
@@ -91,7 +86,6 @@ config CPU_S3C2443 | |||
91 | select S3C2443_COMMON | 86 | select S3C2443_COMMON |
92 | select S3C2443_DMA if S3C24XX_DMA | 87 | select S3C2443_DMA if S3C24XX_DMA |
93 | select SAMSUNG_CLKSRC | 88 | select SAMSUNG_CLKSRC |
94 | select SAMSUNG_HRT | ||
95 | help | 89 | help |
96 | Support for the S3C2443 SoC from the S3C24XX line | 90 | Support for the S3C2443 SoC from the S3C24XX line |
97 | 91 | ||
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2410.c b/arch/arm/mach-s3c24xx/clock-s3c2410.c index 34fffdf6fc1d..d39d3c787580 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2410.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2410.c | |||
@@ -119,66 +119,101 @@ static struct clk init_clocks_off[] = { | |||
119 | } | 119 | } |
120 | }; | 120 | }; |
121 | 121 | ||
122 | static struct clk init_clocks[] = { | 122 | static struct clk clk_lcd = { |
123 | { | 123 | .name = "lcd", |
124 | .name = "lcd", | 124 | .parent = &clk_h, |
125 | .parent = &clk_h, | 125 | .enable = s3c2410_clkcon_enable, |
126 | .enable = s3c2410_clkcon_enable, | 126 | .ctrlbit = S3C2410_CLKCON_LCDC, |
127 | .ctrlbit = S3C2410_CLKCON_LCDC, | 127 | }; |
128 | }, { | 128 | |
129 | .name = "gpio", | 129 | static struct clk clk_gpio = { |
130 | .parent = &clk_p, | 130 | .name = "gpio", |
131 | .enable = s3c2410_clkcon_enable, | 131 | .parent = &clk_p, |
132 | .ctrlbit = S3C2410_CLKCON_GPIO, | 132 | .enable = s3c2410_clkcon_enable, |
133 | }, { | 133 | .ctrlbit = S3C2410_CLKCON_GPIO, |
134 | .name = "usb-host", | 134 | }; |
135 | .parent = &clk_h, | 135 | |
136 | .enable = s3c2410_clkcon_enable, | 136 | static struct clk clk_usb_host = { |
137 | .ctrlbit = S3C2410_CLKCON_USBH, | 137 | .name = "usb-host", |
138 | }, { | 138 | .parent = &clk_h, |
139 | .name = "usb-device", | 139 | .enable = s3c2410_clkcon_enable, |
140 | .parent = &clk_h, | 140 | .ctrlbit = S3C2410_CLKCON_USBH, |
141 | .enable = s3c2410_clkcon_enable, | 141 | }; |
142 | .ctrlbit = S3C2410_CLKCON_USBD, | 142 | |
143 | }, { | 143 | static struct clk clk_usb_device = { |
144 | .name = "timers", | 144 | .name = "usb-device", |
145 | .parent = &clk_p, | 145 | .parent = &clk_h, |
146 | .enable = s3c2410_clkcon_enable, | 146 | .enable = s3c2410_clkcon_enable, |
147 | .ctrlbit = S3C2410_CLKCON_PWMT, | 147 | .ctrlbit = S3C2410_CLKCON_USBD, |
148 | }, { | 148 | }; |
149 | .name = "uart", | 149 | |
150 | .devname = "s3c2410-uart.0", | 150 | static struct clk clk_timers = { |
151 | .parent = &clk_p, | 151 | .name = "timers", |
152 | .enable = s3c2410_clkcon_enable, | 152 | .parent = &clk_p, |
153 | .ctrlbit = S3C2410_CLKCON_UART0, | 153 | .enable = s3c2410_clkcon_enable, |
154 | }, { | 154 | .ctrlbit = S3C2410_CLKCON_PWMT, |
155 | .name = "uart", | 155 | }; |
156 | .devname = "s3c2410-uart.1", | 156 | |
157 | .parent = &clk_p, | 157 | struct clk s3c24xx_clk_uart0 = { |
158 | .enable = s3c2410_clkcon_enable, | 158 | .name = "uart", |
159 | .ctrlbit = S3C2410_CLKCON_UART1, | 159 | .devname = "s3c2410-uart.0", |
160 | }, { | 160 | .parent = &clk_p, |
161 | .name = "uart", | 161 | .enable = s3c2410_clkcon_enable, |
162 | .devname = "s3c2410-uart.2", | 162 | .ctrlbit = S3C2410_CLKCON_UART0, |
163 | .parent = &clk_p, | 163 | }; |
164 | .enable = s3c2410_clkcon_enable, | 164 | |
165 | .ctrlbit = S3C2410_CLKCON_UART2, | 165 | struct clk s3c24xx_clk_uart1 = { |
166 | }, { | 166 | .name = "uart", |
167 | .name = "rtc", | 167 | .devname = "s3c2410-uart.1", |
168 | .parent = &clk_p, | 168 | .parent = &clk_p, |
169 | .enable = s3c2410_clkcon_enable, | 169 | .enable = s3c2410_clkcon_enable, |
170 | .ctrlbit = S3C2410_CLKCON_RTC, | 170 | .ctrlbit = S3C2410_CLKCON_UART1, |
171 | }, { | 171 | }; |
172 | .name = "watchdog", | 172 | |
173 | .parent = &clk_p, | 173 | struct clk s3c24xx_clk_uart2 = { |
174 | .ctrlbit = 0, | 174 | .name = "uart", |
175 | }, { | 175 | .devname = "s3c2410-uart.2", |
176 | .name = "usb-bus-host", | 176 | .parent = &clk_p, |
177 | .parent = &clk_usb_bus, | 177 | .enable = s3c2410_clkcon_enable, |
178 | }, { | 178 | .ctrlbit = S3C2410_CLKCON_UART2, |
179 | .name = "usb-bus-gadget", | 179 | }; |
180 | .parent = &clk_usb_bus, | 180 | |
181 | }, | 181 | static struct clk clk_rtc = { |
182 | .name = "rtc", | ||
183 | .parent = &clk_p, | ||
184 | .enable = s3c2410_clkcon_enable, | ||
185 | .ctrlbit = S3C2410_CLKCON_RTC, | ||
186 | }; | ||
187 | |||
188 | static struct clk clk_watchdog = { | ||
189 | .name = "watchdog", | ||
190 | .parent = &clk_p, | ||
191 | .ctrlbit = 0, | ||
192 | }; | ||
193 | |||
194 | static struct clk clk_usb_bus_host = { | ||
195 | .name = "usb-bus-host", | ||
196 | .parent = &clk_usb_bus, | ||
197 | }; | ||
198 | |||
199 | static struct clk clk_usb_bus_gadget = { | ||
200 | .name = "usb-bus-gadget", | ||
201 | .parent = &clk_usb_bus, | ||
202 | }; | ||
203 | |||
204 | static struct clk *init_clocks[] = { | ||
205 | &clk_lcd, | ||
206 | &clk_gpio, | ||
207 | &clk_usb_host, | ||
208 | &clk_usb_device, | ||
209 | &clk_timers, | ||
210 | &s3c24xx_clk_uart0, | ||
211 | &s3c24xx_clk_uart1, | ||
212 | &s3c24xx_clk_uart2, | ||
213 | &clk_rtc, | ||
214 | &clk_watchdog, | ||
215 | &clk_usb_bus_host, | ||
216 | &clk_usb_bus_gadget, | ||
182 | }; | 217 | }; |
183 | 218 | ||
184 | /* s3c2410_baseclk_add() | 219 | /* s3c2410_baseclk_add() |
@@ -195,7 +230,6 @@ int __init s3c2410_baseclk_add(void) | |||
195 | { | 230 | { |
196 | unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW); | 231 | unsigned long clkslow = __raw_readl(S3C2410_CLKSLOW); |
197 | unsigned long clkcon = __raw_readl(S3C2410_CLKCON); | 232 | unsigned long clkcon = __raw_readl(S3C2410_CLKCON); |
198 | struct clk *clkp; | ||
199 | struct clk *xtal; | 233 | struct clk *xtal; |
200 | int ret; | 234 | int ret; |
201 | int ptr; | 235 | int ptr; |
@@ -207,8 +241,9 @@ int __init s3c2410_baseclk_add(void) | |||
207 | 241 | ||
208 | /* register clocks from clock array */ | 242 | /* register clocks from clock array */ |
209 | 243 | ||
210 | clkp = init_clocks; | 244 | for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++) { |
211 | for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) { | 245 | struct clk *clkp = init_clocks[ptr]; |
246 | |||
212 | /* ensure that we note the clock state */ | 247 | /* ensure that we note the clock state */ |
213 | 248 | ||
214 | clkp->usage = clkcon & clkp->ctrlbit ? 1 : 0; | 249 | clkp->usage = clkcon & clkp->ctrlbit ? 1 : 0; |
@@ -246,6 +281,5 @@ int __init s3c2410_baseclk_add(void) | |||
246 | (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on", | 281 | (clkslow & S3C2410_CLKSLOW_MPLL_OFF) ? "off" : "on", |
247 | (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on"); | 282 | (clkslow & S3C2410_CLKSLOW_UCLK_OFF) ? "off" : "on"); |
248 | 283 | ||
249 | s3c_pwmclk_init(); | ||
250 | return 0; | 284 | return 0; |
251 | } | 285 | } |
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2412.c b/arch/arm/mach-s3c24xx/clock-s3c2412.c index 2cc017da88fe..d8f253f2b486 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2412.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2412.c | |||
@@ -757,6 +757,5 @@ int __init s3c2412_baseclk_add(void) | |||
757 | } | 757 | } |
758 | 758 | ||
759 | clkdev_add_table(s3c2412_clk_lookup, ARRAY_SIZE(s3c2412_clk_lookup)); | 759 | clkdev_add_table(s3c2412_clk_lookup, ARRAY_SIZE(s3c2412_clk_lookup)); |
760 | s3c_pwmclk_init(); | ||
761 | return 0; | 760 | return 0; |
762 | } | 761 | } |
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2416.c b/arch/arm/mach-s3c24xx/clock-s3c2416.c index 036056cea57c..d421a72920a5 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2416.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2416.c | |||
@@ -168,6 +168,4 @@ void __init s3c2416_init_clocks(int xtal) | |||
168 | s3c24xx_register_clock(&hsmmc0_clk); | 168 | s3c24xx_register_clock(&hsmmc0_clk); |
169 | clkdev_add_table(s3c2416_clk_lookup, ARRAY_SIZE(s3c2416_clk_lookup)); | 169 | clkdev_add_table(s3c2416_clk_lookup, ARRAY_SIZE(s3c2416_clk_lookup)); |
170 | 170 | ||
171 | s3c_pwmclk_init(); | ||
172 | |||
173 | } | 171 | } |
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c index 1069b5680826..aaf006d1d6dc 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2440.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c | |||
@@ -166,6 +166,9 @@ static struct clk_lookup s3c2440_clk_lookup[] = { | |||
166 | CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), | 166 | CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), |
167 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | 167 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), |
168 | CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n), | 168 | CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n), |
169 | CLKDEV_INIT("s3c2440-uart.0", "uart", &s3c24xx_clk_uart0), | ||
170 | CLKDEV_INIT("s3c2440-uart.1", "uart", &s3c24xx_clk_uart1), | ||
171 | CLKDEV_INIT("s3c2440-uart.2", "uart", &s3c24xx_clk_uart2), | ||
169 | CLKDEV_INIT("s3c2440-camif", "camera", &s3c2440_clk_cam_upll), | 172 | CLKDEV_INIT("s3c2440-camif", "camera", &s3c2440_clk_cam_upll), |
170 | }; | 173 | }; |
171 | 174 | ||
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2443.c b/arch/arm/mach-s3c24xx/clock-s3c2443.c index 0a53051b0787..76cd31f7804e 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2443.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2443.c | |||
@@ -209,6 +209,4 @@ void __init s3c2443_init_clocks(int xtal) | |||
209 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 209 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
210 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 210 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
211 | clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup)); | 211 | clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup)); |
212 | |||
213 | s3c_pwmclk_init(); | ||
214 | } | 212 | } |
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index c157103ed8eb..457261c98433 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/ioport.h> | 28 | #include <linux/ioport.h> |
29 | #include <linux/serial_core.h> | 29 | #include <linux/serial_core.h> |
30 | #include <clocksource/samsung_pwm.h> | ||
30 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
31 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
32 | #include <linux/io.h> | 33 | #include <linux/io.h> |
@@ -49,6 +50,7 @@ | |||
49 | #include <plat/clock.h> | 50 | #include <plat/clock.h> |
50 | #include <plat/cpu-freq.h> | 51 | #include <plat/cpu-freq.h> |
51 | #include <plat/pll.h> | 52 | #include <plat/pll.h> |
53 | #include <plat/pwm-core.h> | ||
52 | 54 | ||
53 | #include "common.h" | 55 | #include "common.h" |
54 | 56 | ||
@@ -216,6 +218,13 @@ static void s3c24xx_default_idle(void) | |||
216 | S3C2410_CLKCON); | 218 | S3C2410_CLKCON); |
217 | } | 219 | } |
218 | 220 | ||
221 | static struct samsung_pwm_variant s3c24xx_pwm_variant = { | ||
222 | .bits = 16, | ||
223 | .div_base = 1, | ||
224 | .has_tint_cstat = false, | ||
225 | .tclk_mask = (1 << 4), | ||
226 | }; | ||
227 | |||
219 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | 228 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) |
220 | { | 229 | { |
221 | arm_pm_idle = s3c24xx_default_idle; | 230 | arm_pm_idle = s3c24xx_default_idle; |
@@ -232,6 +241,24 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | |||
232 | s3c24xx_init_cpu(); | 241 | s3c24xx_init_cpu(); |
233 | 242 | ||
234 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 243 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
244 | |||
245 | samsung_pwm_set_platdata(&s3c24xx_pwm_variant); | ||
246 | } | ||
247 | |||
248 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
249 | { | ||
250 | s3c24xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
251 | s3c24xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
252 | } | ||
253 | |||
254 | void __init samsung_timer_init(void) | ||
255 | { | ||
256 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
257 | IRQ_TIMER0, IRQ_TIMER1, IRQ_TIMER2, IRQ_TIMER3, IRQ_TIMER4, | ||
258 | }; | ||
259 | |||
260 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
261 | timer_irqs, &s3c24xx_pwm_variant); | ||
235 | } | 262 | } |
236 | 263 | ||
237 | /* Serial port registrations */ | 264 | /* Serial port registrations */ |
diff --git a/arch/arm/mach-s3c24xx/include/mach/map.h b/arch/arm/mach-s3c24xx/include/mach/map.h index 8ba381f2dbe1..444793f0f5f1 100644 --- a/arch/arm/mach-s3c24xx/include/mach/map.h +++ b/arch/arm/mach-s3c24xx/include/mach/map.h | |||
@@ -167,4 +167,6 @@ | |||
167 | #define S3C_PA_SPI0 S3C2443_PA_SPI0 | 167 | #define S3C_PA_SPI0 S3C2443_PA_SPI0 |
168 | #define S3C_PA_SPI1 S3C2443_PA_SPI1 | 168 | #define S3C_PA_SPI1 S3C2443_PA_SPI1 |
169 | 169 | ||
170 | #define SAMSUNG_PA_TIMER S3C2410_PA_TIMER | ||
171 | |||
170 | #endif /* __ASM_ARCH_MAP_H */ | 172 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index af4334d6b4d5..74dd47988b41 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c | |||
@@ -512,7 +512,7 @@ static struct platform_pwm_backlight_data backlight_data = { | |||
512 | static struct platform_device h1940_backlight = { | 512 | static struct platform_device h1940_backlight = { |
513 | .name = "pwm-backlight", | 513 | .name = "pwm-backlight", |
514 | .dev = { | 514 | .dev = { |
515 | .parent = &s3c_device_timer[0].dev, | 515 | .parent = &samsung_device_pwm.dev, |
516 | .platform_data = &backlight_data, | 516 | .platform_data = &backlight_data, |
517 | }, | 517 | }, |
518 | .id = -1, | 518 | .id = -1, |
@@ -632,7 +632,7 @@ static struct platform_device *h1940_devices[] __initdata = { | |||
632 | &h1940_device_bluetooth, | 632 | &h1940_device_bluetooth, |
633 | &s3c_device_sdi, | 633 | &s3c_device_sdi, |
634 | &s3c_device_rtc, | 634 | &s3c_device_rtc, |
635 | &s3c_device_timer[0], | 635 | &samsung_device_pwm, |
636 | &h1940_backlight, | 636 | &h1940_backlight, |
637 | &h1940_lcd_powerdev, | 637 | &h1940_lcd_powerdev, |
638 | &s3c_device_adc, | 638 | &s3c_device_adc, |
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index 44ca018e1f96..206b1f7546d1 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c | |||
@@ -530,7 +530,7 @@ static struct platform_pwm_backlight_data rx1950_backlight_data = { | |||
530 | static struct platform_device rx1950_backlight = { | 530 | static struct platform_device rx1950_backlight = { |
531 | .name = "pwm-backlight", | 531 | .name = "pwm-backlight", |
532 | .dev = { | 532 | .dev = { |
533 | .parent = &s3c_device_timer[0].dev, | 533 | .parent = &samsung_device_pwm.dev, |
534 | .platform_data = &rx1950_backlight_data, | 534 | .platform_data = &rx1950_backlight_data, |
535 | }, | 535 | }, |
536 | }; | 536 | }; |
@@ -717,8 +717,7 @@ static struct platform_device *rx1950_devices[] __initdata = { | |||
717 | &s3c_device_sdi, | 717 | &s3c_device_sdi, |
718 | &s3c_device_adc, | 718 | &s3c_device_adc, |
719 | &s3c_device_ts, | 719 | &s3c_device_ts, |
720 | &s3c_device_timer[0], | 720 | &samsung_device_pwm, |
721 | &s3c_device_timer[1], | ||
722 | &rx1950_backlight, | 721 | &rx1950_backlight, |
723 | &rx1950_device_gpiokeys, | 722 | &rx1950_device_gpiokeys, |
724 | &power_supply, | 723 | &power_supply, |
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 20578536aec7..041da5172423 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
@@ -17,13 +17,11 @@ config PLAT_S3C64XX | |||
17 | # Configuration options for the S3C6410 CPU | 17 | # Configuration options for the S3C6410 CPU |
18 | 18 | ||
19 | config CPU_S3C6400 | 19 | config CPU_S3C6400 |
20 | select SAMSUNG_HRT | ||
21 | bool | 20 | bool |
22 | help | 21 | help |
23 | Enable S3C6400 CPU support | 22 | Enable S3C6400 CPU support |
24 | 23 | ||
25 | config CPU_S3C6410 | 24 | config CPU_S3C6410 |
26 | select SAMSUNG_HRT | ||
27 | bool | 25 | bool |
28 | help | 26 | help |
29 | Enable S3C6410 CPU support | 27 | Enable S3C6410 CPU support |
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c index 8499415be9cd..c1bcc4a6d3a8 100644 --- a/arch/arm/mach-s3c64xx/clock.c +++ b/arch/arm/mach-s3c64xx/clock.c | |||
@@ -1004,6 +1004,4 @@ void __init s3c64xx_register_clocks(unsigned long xtal, | |||
1004 | for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++) | 1004 | for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++) |
1005 | s3c_register_clksrc(clksrc_cdev[cnt], 1); | 1005 | s3c_register_clksrc(clksrc_cdev[cnt], 1); |
1006 | clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup)); | 1006 | clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup)); |
1007 | |||
1008 | s3c_pwmclk_init(); | ||
1009 | } | 1007 | } |
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 3f62e467b129..73d79cf5e141 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
29 | #include <linux/irqchip/arm-vic.h> | 29 | #include <linux/irqchip/arm-vic.h> |
30 | #include <clocksource/samsung_pwm.h> | ||
30 | 31 | ||
31 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
@@ -42,7 +43,7 @@ | |||
42 | #include <plat/pm.h> | 43 | #include <plat/pm.h> |
43 | #include <plat/gpio-cfg.h> | 44 | #include <plat/gpio-cfg.h> |
44 | #include <plat/irq-uart.h> | 45 | #include <plat/irq-uart.h> |
45 | #include <plat/irq-vic-timer.h> | 46 | #include <plat/pwm-core.h> |
46 | #include <plat/regs-irqtype.h> | 47 | #include <plat/regs-irqtype.h> |
47 | #include <plat/regs-serial.h> | 48 | #include <plat/regs-serial.h> |
48 | #include <plat/watchdog-reset.h> | 49 | #include <plat/watchdog-reset.h> |
@@ -149,6 +150,30 @@ static struct device s3c64xx_dev = { | |||
149 | .bus = &s3c64xx_subsys, | 150 | .bus = &s3c64xx_subsys, |
150 | }; | 151 | }; |
151 | 152 | ||
153 | static struct samsung_pwm_variant s3c64xx_pwm_variant = { | ||
154 | .bits = 32, | ||
155 | .div_base = 0, | ||
156 | .has_tint_cstat = true, | ||
157 | .tclk_mask = (1 << 7) | (1 << 6) | (1 << 5), | ||
158 | }; | ||
159 | |||
160 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
161 | { | ||
162 | s3c64xx_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
163 | s3c64xx_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
164 | } | ||
165 | |||
166 | void __init samsung_timer_init(void) | ||
167 | { | ||
168 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
169 | IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
170 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, | ||
171 | }; | ||
172 | |||
173 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
174 | timer_irqs, &s3c64xx_pwm_variant); | ||
175 | } | ||
176 | |||
152 | /* read cpu identification code */ | 177 | /* read cpu identification code */ |
153 | 178 | ||
154 | void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) | 179 | void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) |
@@ -161,6 +186,8 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) | |||
161 | s3c64xx_init_cpu(); | 186 | s3c64xx_init_cpu(); |
162 | 187 | ||
163 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 188 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
189 | |||
190 | samsung_pwm_set_platdata(&s3c64xx_pwm_variant); | ||
164 | } | 191 | } |
165 | 192 | ||
166 | static __init int s3c64xx_dev_init(void) | 193 | static __init int s3c64xx_dev_init(void) |
@@ -195,9 +222,6 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid) | |||
195 | /* initialise the pair of VICs */ | 222 | /* initialise the pair of VICs */ |
196 | vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME); | 223 | vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, IRQ_VIC0_RESUME); |
197 | vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME); | 224 | vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, IRQ_VIC1_RESUME); |
198 | |||
199 | /* add the timer sub-irqs */ | ||
200 | s3c_init_vic_timer_irq(5, IRQ_TIMER0); | ||
201 | } | 225 | } |
202 | 226 | ||
203 | #define eint_offset(irq) ((irq) - IRQ_EINT(0)) | 227 | #define eint_offset(irq) ((irq) - IRQ_EINT(0)) |
diff --git a/arch/arm/mach-s3c64xx/include/mach/irqs.h b/arch/arm/mach-s3c64xx/include/mach/irqs.h index 96d60e0d9372..67bbd1dd04c2 100644 --- a/arch/arm/mach-s3c64xx/include/mach/irqs.h +++ b/arch/arm/mach-s3c64xx/include/mach/irqs.h | |||
@@ -107,14 +107,6 @@ | |||
107 | #define IRQ_TC IRQ_PENDN | 107 | #define IRQ_TC IRQ_PENDN |
108 | #define IRQ_ADC S3C64XX_IRQ_VIC1(31) | 108 | #define IRQ_ADC S3C64XX_IRQ_VIC1(31) |
109 | 109 | ||
110 | #define S3C64XX_TIMER_IRQ(x) S3C_IRQ(64 + (x)) | ||
111 | |||
112 | #define IRQ_TIMER0 S3C64XX_TIMER_IRQ(0) | ||
113 | #define IRQ_TIMER1 S3C64XX_TIMER_IRQ(1) | ||
114 | #define IRQ_TIMER2 S3C64XX_TIMER_IRQ(2) | ||
115 | #define IRQ_TIMER3 S3C64XX_TIMER_IRQ(3) | ||
116 | #define IRQ_TIMER4 S3C64XX_TIMER_IRQ(4) | ||
117 | |||
118 | /* compatibility for device defines */ | 110 | /* compatibility for device defines */ |
119 | 111 | ||
120 | #define IRQ_IIC1 IRQ_S3C6410_IIC1 | 112 | #define IRQ_IIC1 IRQ_S3C6410_IIC1 |
diff --git a/arch/arm/mach-s3c64xx/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h index 8e2097bb208a..f55ccb1ce893 100644 --- a/arch/arm/mach-s3c64xx/include/mach/map.h +++ b/arch/arm/mach-s3c64xx/include/mach/map.h | |||
@@ -121,5 +121,6 @@ | |||
121 | #define SAMSUNG_PA_ADC S3C64XX_PA_ADC | 121 | #define SAMSUNG_PA_ADC S3C64XX_PA_ADC |
122 | #define SAMSUNG_PA_CFCON S3C64XX_PA_CFCON | 122 | #define SAMSUNG_PA_CFCON S3C64XX_PA_CFCON |
123 | #define SAMSUNG_PA_KEYPAD S3C64XX_PA_KEYPAD | 123 | #define SAMSUNG_PA_KEYPAD S3C64XX_PA_KEYPAD |
124 | #define SAMSUNG_PA_TIMER S3C64XX_PA_TIMER | ||
124 | 125 | ||
125 | #endif /* __ASM_ARCH_6400_MAP_H */ | 126 | #endif /* __ASM_ARCH_6400_MAP_H */ |
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c index 0c7e1d960ca4..c3da1b68d03e 100644 --- a/arch/arm/mach-s3c64xx/irq-pm.c +++ b/arch/arm/mach-s3c64xx/irq-pm.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <mach/map.h> | 22 | #include <mach/map.h> |
23 | 23 | ||
24 | #include <plat/regs-serial.h> | 24 | #include <plat/regs-serial.h> |
25 | #include <plat/regs-timer.h> | ||
26 | #include <mach/regs-gpio.h> | 25 | #include <mach/regs-gpio.h> |
27 | #include <plat/cpu.h> | 26 | #include <plat/cpu.h> |
28 | #include <plat/pm.h> | 27 | #include <plat/pm.h> |
@@ -43,7 +42,6 @@ static struct sleep_save irq_save[] = { | |||
43 | SAVE_ITEM(S3C64XX_EINT0FLTCON2), | 42 | SAVE_ITEM(S3C64XX_EINT0FLTCON2), |
44 | SAVE_ITEM(S3C64XX_EINT0FLTCON3), | 43 | SAVE_ITEM(S3C64XX_EINT0FLTCON3), |
45 | SAVE_ITEM(S3C64XX_EINT0MASK), | 44 | SAVE_ITEM(S3C64XX_EINT0MASK), |
46 | SAVE_ITEM(S3C64XX_TINT_CSTAT), | ||
47 | }; | 45 | }; |
48 | 46 | ||
49 | static struct irq_grp_save { | 47 | static struct irq_grp_save { |
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index 8ad88ace795a..28889cc788b3 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c | |||
@@ -120,7 +120,7 @@ static struct platform_device crag6410_backlight_device = { | |||
120 | .name = "pwm-backlight", | 120 | .name = "pwm-backlight", |
121 | .id = -1, | 121 | .id = -1, |
122 | .dev = { | 122 | .dev = { |
123 | .parent = &s3c_device_timer[0].dev, | 123 | .parent = &samsung_device_pwm.dev, |
124 | .platform_data = &crag6410_backlight_data, | 124 | .platform_data = &crag6410_backlight_data, |
125 | }, | 125 | }, |
126 | }; | 126 | }; |
@@ -375,7 +375,7 @@ static struct platform_device *crag6410_devices[] __initdata = { | |||
375 | &s3c_device_fb, | 375 | &s3c_device_fb, |
376 | &s3c_device_ohci, | 376 | &s3c_device_ohci, |
377 | &s3c_device_usb_hsotg, | 377 | &s3c_device_usb_hsotg, |
378 | &s3c_device_timer[0], | 378 | &samsung_device_pwm, |
379 | &s3c64xx_device_iis0, | 379 | &s3c64xx_device_iis0, |
380 | &s3c64xx_device_iis1, | 380 | &s3c64xx_device_iis1, |
381 | &samsung_device_keypad, | 381 | &samsung_device_keypad, |
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c index 5b7f357d8c22..f39569e0f2e6 100644 --- a/arch/arm/mach-s3c64xx/mach-hmt.c +++ b/arch/arm/mach-s3c64xx/mach-hmt.c | |||
@@ -123,7 +123,7 @@ static struct platform_pwm_backlight_data hmt_backlight_data = { | |||
123 | static struct platform_device hmt_backlight_device = { | 123 | static struct platform_device hmt_backlight_device = { |
124 | .name = "pwm-backlight", | 124 | .name = "pwm-backlight", |
125 | .dev = { | 125 | .dev = { |
126 | .parent = &s3c_device_timer[1].dev, | 126 | .parent = &samsung_device_pwm.dev, |
127 | .platform_data = &hmt_backlight_data, | 127 | .platform_data = &hmt_backlight_data, |
128 | }, | 128 | }, |
129 | }; | 129 | }; |
@@ -239,7 +239,7 @@ static struct platform_device *hmt_devices[] __initdata = { | |||
239 | &s3c_device_nand, | 239 | &s3c_device_nand, |
240 | &s3c_device_fb, | 240 | &s3c_device_fb, |
241 | &s3c_device_ohci, | 241 | &s3c_device_ohci, |
242 | &s3c_device_timer[1], | 242 | &samsung_device_pwm, |
243 | &hmt_backlight_device, | 243 | &hmt_backlight_device, |
244 | &hmt_leds_device, | 244 | &hmt_leds_device, |
245 | }; | 245 | }; |
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c index 58ac99041274..86d980b448fd 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq.c +++ b/arch/arm/mach-s3c64xx/mach-smartq.c | |||
@@ -157,7 +157,7 @@ static struct platform_pwm_backlight_data smartq_backlight_data = { | |||
157 | static struct platform_device smartq_backlight_device = { | 157 | static struct platform_device smartq_backlight_device = { |
158 | .name = "pwm-backlight", | 158 | .name = "pwm-backlight", |
159 | .dev = { | 159 | .dev = { |
160 | .parent = &s3c_device_timer[1].dev, | 160 | .parent = &samsung_device_pwm.dev, |
161 | .platform_data = &smartq_backlight_data, | 161 | .platform_data = &smartq_backlight_data, |
162 | }, | 162 | }, |
163 | }; | 163 | }; |
@@ -246,7 +246,7 @@ static struct platform_device *smartq_devices[] __initdata = { | |||
246 | &s3c_device_i2c0, | 246 | &s3c_device_i2c0, |
247 | &s3c_device_ohci, | 247 | &s3c_device_ohci, |
248 | &s3c_device_rtc, | 248 | &s3c_device_rtc, |
249 | &s3c_device_timer[1], | 249 | &samsung_device_pwm, |
250 | &s3c_device_ts, | 250 | &s3c_device_ts, |
251 | &s3c_device_usb_hsotg, | 251 | &s3c_device_usb_hsotg, |
252 | &s3c64xx_device_iis0, | 252 | &s3c64xx_device_iis0, |
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index bd3295a19ad7..d90b450c5645 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c | |||
@@ -274,6 +274,7 @@ static struct platform_device *smdk6410_devices[] __initdata = { | |||
274 | &s3c_device_i2c1, | 274 | &s3c_device_i2c1, |
275 | &s3c_device_fb, | 275 | &s3c_device_fb, |
276 | &s3c_device_ohci, | 276 | &s3c_device_ohci, |
277 | &samsung_device_pwm, | ||
277 | &s3c_device_usb_hsotg, | 278 | &s3c_device_usb_hsotg, |
278 | &s3c64xx_device_iisv4, | 279 | &s3c64xx_device_iisv4, |
279 | &samsung_device_keypad, | 280 | &samsung_device_keypad, |
@@ -691,9 +692,9 @@ static void __init smdk6410_machine_init(void) | |||
691 | 692 | ||
692 | s3c_ide_set_platdata(&smdk6410_ide_pdata); | 693 | s3c_ide_set_platdata(&smdk6410_ide_pdata); |
693 | 694 | ||
694 | samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data); | ||
695 | |||
696 | platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); | 695 | platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); |
696 | |||
697 | samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data); | ||
697 | } | 698 | } |
698 | 699 | ||
699 | MACHINE_START(SMDK6410, "SMDK6410") | 700 | MACHINE_START(SMDK6410, "SMDK6410") |
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig index 5a707bdb9ea0..bb2111b3751e 100644 --- a/arch/arm/mach-s5p64x0/Kconfig +++ b/arch/arm/mach-s5p64x0/Kconfig | |||
@@ -11,14 +11,12 @@ config CPU_S5P6440 | |||
11 | bool | 11 | bool |
12 | select S5P_SLEEP if PM | 12 | select S5P_SLEEP if PM |
13 | select SAMSUNG_DMADEV | 13 | select SAMSUNG_DMADEV |
14 | select SAMSUNG_HRT | ||
15 | select SAMSUNG_WAKEMASK if PM | 14 | select SAMSUNG_WAKEMASK if PM |
16 | help | 15 | help |
17 | Enable S5P6440 CPU support | 16 | Enable S5P6440 CPU support |
18 | 17 | ||
19 | config CPU_S5P6450 | 18 | config CPU_S5P6450 |
20 | bool | 19 | bool |
21 | select SAMSUNG_HRT | ||
22 | select S5P_SLEEP if PM | 20 | select S5P_SLEEP if PM |
23 | select SAMSUNG_DMADEV | 21 | select SAMSUNG_DMADEV |
24 | select SAMSUNG_WAKEMASK if PM | 22 | select SAMSUNG_WAKEMASK if PM |
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c index 3537815247f1..ae34a1d5e10a 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6440.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c | |||
@@ -629,6 +629,4 @@ void __init s5p6440_register_clocks(void) | |||
629 | clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup)); | 629 | clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup)); |
630 | 630 | ||
631 | s3c24xx_register_clock(&dummy_apb_pclk); | 631 | s3c24xx_register_clock(&dummy_apb_pclk); |
632 | |||
633 | s3c_pwmclk_init(); | ||
634 | } | 632 | } |
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c index af384ddd2dcf..0b3ca2ed53e9 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6450.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c | |||
@@ -698,6 +698,4 @@ void __init s5p6450_register_clocks(void) | |||
698 | clkdev_add_table(s5p6450_clk_lookup, ARRAY_SIZE(s5p6450_clk_lookup)); | 698 | clkdev_add_table(s5p6450_clk_lookup, ARRAY_SIZE(s5p6450_clk_lookup)); |
699 | 699 | ||
700 | s3c24xx_register_clock(&dummy_apb_pclk); | 700 | s3c24xx_register_clock(&dummy_apb_pclk); |
701 | |||
702 | s3c_pwmclk_init(); | ||
703 | } | 701 | } |
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index dfdfdc320ce7..42e14f2e7ca7 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <clocksource/samsung_pwm.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
24 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
@@ -47,6 +48,7 @@ | |||
47 | #include <plat/fb-core.h> | 48 | #include <plat/fb-core.h> |
48 | #include <plat/spi-core.h> | 49 | #include <plat/spi-core.h> |
49 | #include <plat/gpio-cfg.h> | 50 | #include <plat/gpio-cfg.h> |
51 | #include <plat/pwm-core.h> | ||
50 | #include <plat/regs-irqtype.h> | 52 | #include <plat/regs-irqtype.h> |
51 | #include <plat/regs-serial.h> | 53 | #include <plat/regs-serial.h> |
52 | #include <plat/watchdog-reset.h> | 54 | #include <plat/watchdog-reset.h> |
@@ -157,6 +159,30 @@ static void s5p64x0_idle(void) | |||
157 | cpu_do_idle(); | 159 | cpu_do_idle(); |
158 | } | 160 | } |
159 | 161 | ||
162 | static struct samsung_pwm_variant s5p64x0_pwm_variant = { | ||
163 | .bits = 32, | ||
164 | .div_base = 0, | ||
165 | .has_tint_cstat = true, | ||
166 | .tclk_mask = 0, | ||
167 | }; | ||
168 | |||
169 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
170 | { | ||
171 | s5p64x0_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
172 | s5p64x0_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
173 | } | ||
174 | |||
175 | void __init samsung_timer_init(void) | ||
176 | { | ||
177 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
178 | IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
179 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, | ||
180 | }; | ||
181 | |||
182 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
183 | timer_irqs, &s5p64x0_pwm_variant); | ||
184 | } | ||
185 | |||
160 | /* | 186 | /* |
161 | * s5p64x0_map_io | 187 | * s5p64x0_map_io |
162 | * | 188 | * |
@@ -176,6 +202,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size) | |||
176 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 202 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
177 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); | 203 | samsung_wdt_reset_init(S3C_VA_WATCHDOG); |
178 | 204 | ||
205 | samsung_pwm_set_platdata(&s5p64x0_pwm_variant); | ||
179 | } | 206 | } |
180 | 207 | ||
181 | void __init s5p6440_map_io(void) | 208 | void __init s5p6440_map_io(void) |
diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h b/arch/arm/mach-s5p64x0/include/mach/irqs.h index 5b845e849b30..53982db9d259 100644 --- a/arch/arm/mach-s5p64x0/include/mach/irqs.h +++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h | |||
@@ -141,8 +141,6 @@ | |||
141 | 141 | ||
142 | #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x)) | 142 | #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x)) |
143 | 143 | ||
144 | #define IRQ_TIMER_BASE (11) | ||
145 | |||
146 | /* Set the default NR_IRQS */ | 144 | /* Set the default NR_IRQS */ |
147 | 145 | ||
148 | #define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1) | 146 | #define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1) |
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h index 0c0175dbfa34..50a6e96d6389 100644 --- a/arch/arm/mach-s5p64x0/include/mach/map.h +++ b/arch/arm/mach-s5p64x0/include/mach/map.h | |||
@@ -76,6 +76,7 @@ | |||
76 | #define S5P_PA_TIMER S5P64X0_PA_TIMER | 76 | #define S5P_PA_TIMER S5P64X0_PA_TIMER |
77 | 77 | ||
78 | #define SAMSUNG_PA_ADC S5P64X0_PA_ADC | 78 | #define SAMSUNG_PA_ADC S5P64X0_PA_ADC |
79 | #define SAMSUNG_PA_TIMER S5P64X0_PA_TIMER | ||
79 | 80 | ||
80 | /* UART */ | 81 | /* UART */ |
81 | 82 | ||
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c index 73f71a698a34..0b00304c1e91 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6440.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c | |||
@@ -162,6 +162,7 @@ static struct platform_device *smdk6440_devices[] __initdata = { | |||
162 | &s3c_device_rtc, | 162 | &s3c_device_rtc, |
163 | &s3c_device_i2c0, | 163 | &s3c_device_i2c0, |
164 | &s3c_device_i2c1, | 164 | &s3c_device_i2c1, |
165 | &samsung_device_pwm, | ||
165 | &s3c_device_ts, | 166 | &s3c_device_ts, |
166 | &s3c_device_wdt, | 167 | &s3c_device_wdt, |
167 | &s5p6440_device_iis, | 168 | &s5p6440_device_iis, |
@@ -254,8 +255,6 @@ static void __init smdk6440_machine_init(void) | |||
254 | i2c_register_board_info(1, smdk6440_i2c_devs1, | 255 | i2c_register_board_info(1, smdk6440_i2c_devs1, |
255 | ARRAY_SIZE(smdk6440_i2c_devs1)); | 256 | ARRAY_SIZE(smdk6440_i2c_devs1)); |
256 | 257 | ||
257 | samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data); | ||
258 | |||
259 | s5p6440_set_lcd_interface(); | 258 | s5p6440_set_lcd_interface(); |
260 | s3c_fb_set_platdata(&smdk6440_lcd_pdata); | 259 | s3c_fb_set_platdata(&smdk6440_lcd_pdata); |
261 | 260 | ||
@@ -264,6 +263,8 @@ static void __init smdk6440_machine_init(void) | |||
264 | s3c_sdhci2_set_platdata(&smdk6440_hsmmc2_pdata); | 263 | s3c_sdhci2_set_platdata(&smdk6440_hsmmc2_pdata); |
265 | 264 | ||
266 | platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); | 265 | platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices)); |
266 | |||
267 | samsung_bl_set(&smdk6440_bl_gpio_info, &smdk6440_bl_data); | ||
267 | } | 268 | } |
268 | 269 | ||
269 | MACHINE_START(SMDK6440, "SMDK6440") | 270 | MACHINE_START(SMDK6440, "SMDK6440") |
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c index 18303e12019f..5949296e88fd 100644 --- a/arch/arm/mach-s5p64x0/mach-smdk6450.c +++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c | |||
@@ -180,6 +180,7 @@ static struct platform_device *smdk6450_devices[] __initdata = { | |||
180 | &s3c_device_rtc, | 180 | &s3c_device_rtc, |
181 | &s3c_device_i2c0, | 181 | &s3c_device_i2c0, |
182 | &s3c_device_i2c1, | 182 | &s3c_device_i2c1, |
183 | &samsung_device_pwm, | ||
183 | &s3c_device_ts, | 184 | &s3c_device_ts, |
184 | &s3c_device_wdt, | 185 | &s3c_device_wdt, |
185 | &s5p6450_device_iis0, | 186 | &s5p6450_device_iis0, |
@@ -273,8 +274,6 @@ static void __init smdk6450_machine_init(void) | |||
273 | i2c_register_board_info(1, smdk6450_i2c_devs1, | 274 | i2c_register_board_info(1, smdk6450_i2c_devs1, |
274 | ARRAY_SIZE(smdk6450_i2c_devs1)); | 275 | ARRAY_SIZE(smdk6450_i2c_devs1)); |
275 | 276 | ||
276 | samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data); | ||
277 | |||
278 | s5p6450_set_lcd_interface(); | 277 | s5p6450_set_lcd_interface(); |
279 | s3c_fb_set_platdata(&smdk6450_lcd_pdata); | 278 | s3c_fb_set_platdata(&smdk6450_lcd_pdata); |
280 | 279 | ||
@@ -283,6 +282,8 @@ static void __init smdk6450_machine_init(void) | |||
283 | s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata); | 282 | s3c_sdhci2_set_platdata(&smdk6450_hsmmc2_pdata); |
284 | 283 | ||
285 | platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); | 284 | platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices)); |
285 | |||
286 | samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data); | ||
286 | } | 287 | } |
287 | 288 | ||
288 | MACHINE_START(SMDK6450, "SMDK6450") | 289 | MACHINE_START(SMDK6450, "SMDK6450") |
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c index 97c2a08ad490..861e15cea691 100644 --- a/arch/arm/mach-s5p64x0/pm.c +++ b/arch/arm/mach-s5p64x0/pm.c | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | #include <plat/cpu.h> | 19 | #include <plat/cpu.h> |
20 | #include <plat/pm.h> | 20 | #include <plat/pm.h> |
21 | #include <plat/regs-timer.h> | ||
22 | #include <plat/wakeup-mask.h> | 21 | #include <plat/wakeup-mask.h> |
23 | 22 | ||
24 | #include <mach/regs-clock.h> | 23 | #include <mach/regs-clock.h> |
@@ -48,8 +47,6 @@ static struct sleep_save s5p64x0_misc_save[] = { | |||
48 | SAVE_ITEM(S5P64X0_MEM0CONSLP1), | 47 | SAVE_ITEM(S5P64X0_MEM0CONSLP1), |
49 | SAVE_ITEM(S5P64X0_MEM0DRVCON), | 48 | SAVE_ITEM(S5P64X0_MEM0DRVCON), |
50 | SAVE_ITEM(S5P64X0_MEM1DRVCON), | 49 | SAVE_ITEM(S5P64X0_MEM1DRVCON), |
51 | |||
52 | SAVE_ITEM(S3C64XX_TINT_CSTAT), | ||
53 | }; | 50 | }; |
54 | 51 | ||
55 | /* DPLL is present only in S5P6450 */ | 52 | /* DPLL is present only in S5P6450 */ |
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig index 2f456a4533ba..15170be97a74 100644 --- a/arch/arm/mach-s5pc100/Kconfig +++ b/arch/arm/mach-s5pc100/Kconfig | |||
@@ -11,7 +11,6 @@ config CPU_S5PC100 | |||
11 | bool | 11 | bool |
12 | select S5P_EXT_INT | 12 | select S5P_EXT_INT |
13 | select SAMSUNG_DMADEV | 13 | select SAMSUNG_DMADEV |
14 | select SAMSUNG_HRT | ||
15 | help | 14 | help |
16 | Enable S5PC100 CPU support | 15 | Enable S5PC100 CPU support |
17 | 16 | ||
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c index a206dc35eff1..d0dc10ee7729 100644 --- a/arch/arm/mach-s5pc100/clock.c +++ b/arch/arm/mach-s5pc100/clock.c | |||
@@ -1358,6 +1358,4 @@ void __init s5pc100_register_clocks(void) | |||
1358 | s3c_disable_clocks(clk_cdev[ptr], 1); | 1358 | s3c_disable_clocks(clk_cdev[ptr], 1); |
1359 | 1359 | ||
1360 | s3c24xx_register_clock(&dummy_apb_pclk); | 1360 | s3c24xx_register_clock(&dummy_apb_pclk); |
1361 | |||
1362 | s3c_pwmclk_init(); | ||
1363 | } | 1361 | } |
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index 4bdfecf6d024..c5a8eeacf81c 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/serial_core.h> | 24 | #include <linux/serial_core.h> |
25 | #include <clocksource/samsung_pwm.h> | ||
25 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
26 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
27 | #include <linux/reboot.h> | 28 | #include <linux/reboot.h> |
@@ -46,6 +47,7 @@ | |||
46 | #include <plat/fb-core.h> | 47 | #include <plat/fb-core.h> |
47 | #include <plat/iic-core.h> | 48 | #include <plat/iic-core.h> |
48 | #include <plat/onenand-core.h> | 49 | #include <plat/onenand-core.h> |
50 | #include <plat/pwm-core.h> | ||
49 | #include <plat/spi-core.h> | 51 | #include <plat/spi-core.h> |
50 | #include <plat/regs-serial.h> | 52 | #include <plat/regs-serial.h> |
51 | #include <plat/watchdog-reset.h> | 53 | #include <plat/watchdog-reset.h> |
@@ -132,6 +134,30 @@ static struct map_desc s5pc100_iodesc[] __initdata = { | |||
132 | } | 134 | } |
133 | }; | 135 | }; |
134 | 136 | ||
137 | static struct samsung_pwm_variant s5pc100_pwm_variant = { | ||
138 | .bits = 32, | ||
139 | .div_base = 0, | ||
140 | .has_tint_cstat = true, | ||
141 | .tclk_mask = (1 << 5), | ||
142 | }; | ||
143 | |||
144 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
145 | { | ||
146 | s5pc100_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
147 | s5pc100_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
148 | } | ||
149 | |||
150 | void __init samsung_timer_init(void) | ||
151 | { | ||
152 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
153 | IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
154 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, | ||
155 | }; | ||
156 | |||
157 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
158 | timer_irqs, &s5pc100_pwm_variant); | ||
159 | } | ||
160 | |||
135 | /* | 161 | /* |
136 | * s5pc100_map_io | 162 | * s5pc100_map_io |
137 | * | 163 | * |
@@ -149,6 +175,8 @@ void __init s5pc100_init_io(struct map_desc *mach_desc, int size) | |||
149 | s5p_init_cpu(S5P_VA_CHIPID); | 175 | s5p_init_cpu(S5P_VA_CHIPID); |
150 | 176 | ||
151 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 177 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
178 | |||
179 | samsung_pwm_set_platdata(&s5pc100_pwm_variant); | ||
152 | } | 180 | } |
153 | 181 | ||
154 | void __init s5pc100_map_io(void) | 182 | void __init s5pc100_map_io(void) |
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-s5pc100/include/mach/irqs.h index 2870f12c7926..d2eb4757381f 100644 --- a/arch/arm/mach-s5pc100/include/mach/irqs.h +++ b/arch/arm/mach-s5pc100/include/mach/irqs.h | |||
@@ -97,8 +97,6 @@ | |||
97 | #define IRQ_SDMFIQ S5P_IRQ_VIC2(31) | 97 | #define IRQ_SDMFIQ S5P_IRQ_VIC2(31) |
98 | #define IRQ_VIC_END S5P_IRQ_VIC2(31) | 98 | #define IRQ_VIC_END S5P_IRQ_VIC2(31) |
99 | 99 | ||
100 | #define IRQ_TIMER_BASE (11) | ||
101 | |||
102 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) | 100 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) |
103 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) | 101 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) |
104 | 102 | ||
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h index 54bc4f82e17a..2550b6112b82 100644 --- a/arch/arm/mach-s5pc100/include/mach/map.h +++ b/arch/arm/mach-s5pc100/include/mach/map.h | |||
@@ -116,6 +116,7 @@ | |||
116 | #define SAMSUNG_PA_ADC S5PC100_PA_TSADC | 116 | #define SAMSUNG_PA_ADC S5PC100_PA_TSADC |
117 | #define SAMSUNG_PA_CFCON S5PC100_PA_CFCON | 117 | #define SAMSUNG_PA_CFCON S5PC100_PA_CFCON |
118 | #define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD | 118 | #define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD |
119 | #define SAMSUNG_PA_TIMER S5PC100_PA_TIMER | ||
119 | 120 | ||
120 | #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000) | 121 | #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000) |
121 | 122 | ||
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c index 8c880f76f274..7c57a221785e 100644 --- a/arch/arm/mach-s5pc100/mach-smdkc100.c +++ b/arch/arm/mach-s5pc100/mach-smdkc100.c | |||
@@ -194,6 +194,7 @@ static struct platform_device *smdkc100_devices[] __initdata = { | |||
194 | &s3c_device_hsmmc0, | 194 | &s3c_device_hsmmc0, |
195 | &s3c_device_hsmmc1, | 195 | &s3c_device_hsmmc1, |
196 | &s3c_device_hsmmc2, | 196 | &s3c_device_hsmmc2, |
197 | &samsung_device_pwm, | ||
197 | &s3c_device_ts, | 198 | &s3c_device_ts, |
198 | &s3c_device_wdt, | 199 | &s3c_device_wdt, |
199 | &smdkc100_lcd_powerdev, | 200 | &smdkc100_lcd_powerdev, |
@@ -246,9 +247,9 @@ static void __init smdkc100_machine_init(void) | |||
246 | gpio_request(S5PC100_GPH0(6), "GPH0"); | 247 | gpio_request(S5PC100_GPH0(6), "GPH0"); |
247 | smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0); | 248 | smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0); |
248 | 249 | ||
249 | samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data); | ||
250 | |||
251 | platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); | 250 | platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); |
251 | |||
252 | samsung_bl_set(&smdkc100_bl_gpio_info, &smdkc100_bl_data); | ||
252 | } | 253 | } |
253 | 254 | ||
254 | MACHINE_START(SMDKC100, "SMDKC100") | 255 | MACHINE_START(SMDKC100, "SMDKC100") |
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 0963283a7c5d..caaedafbbf5f 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig | |||
@@ -15,7 +15,6 @@ config CPU_S5PV210 | |||
15 | select S5P_PM if PM | 15 | select S5P_PM if PM |
16 | select S5P_SLEEP if PM | 16 | select S5P_SLEEP if PM |
17 | select SAMSUNG_DMADEV | 17 | select SAMSUNG_DMADEV |
18 | select SAMSUNG_HRT | ||
19 | help | 18 | help |
20 | Enable S5PV210 CPU support | 19 | Enable S5PV210 CPU support |
21 | 20 | ||
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index f051f53e35b7..ca463724a3df 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c | |||
@@ -1362,5 +1362,4 @@ void __init s5pv210_register_clocks(void) | |||
1362 | for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++) | 1362 | for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++) |
1363 | s3c_disable_clocks(clk_cdev[ptr], 1); | 1363 | s3c_disable_clocks(clk_cdev[ptr], 1); |
1364 | 1364 | ||
1365 | s3c_pwmclk_init(); | ||
1366 | } | 1365 | } |
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 023f1a796a9c..26027a29b8a1 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <clocksource/samsung_pwm.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
24 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
@@ -42,6 +43,7 @@ | |||
42 | #include <plat/fimc-core.h> | 43 | #include <plat/fimc-core.h> |
43 | #include <plat/iic-core.h> | 44 | #include <plat/iic-core.h> |
44 | #include <plat/keypad-core.h> | 45 | #include <plat/keypad-core.h> |
46 | #include <plat/pwm-core.h> | ||
45 | #include <plat/tv-core.h> | 47 | #include <plat/tv-core.h> |
46 | #include <plat/spi-core.h> | 48 | #include <plat/spi-core.h> |
47 | #include <plat/regs-serial.h> | 49 | #include <plat/regs-serial.h> |
@@ -148,6 +150,30 @@ void s5pv210_restart(enum reboot_mode mode, const char *cmd) | |||
148 | __raw_writel(0x1, S5P_SWRESET); | 150 | __raw_writel(0x1, S5P_SWRESET); |
149 | } | 151 | } |
150 | 152 | ||
153 | static struct samsung_pwm_variant s5pv210_pwm_variant = { | ||
154 | .bits = 32, | ||
155 | .div_base = 0, | ||
156 | .has_tint_cstat = true, | ||
157 | .tclk_mask = (1 << 5), | ||
158 | }; | ||
159 | |||
160 | void __init samsung_set_timer_source(unsigned int event, unsigned int source) | ||
161 | { | ||
162 | s5pv210_pwm_variant.output_mask = BIT(SAMSUNG_PWM_NUM) - 1; | ||
163 | s5pv210_pwm_variant.output_mask &= ~(BIT(event) | BIT(source)); | ||
164 | } | ||
165 | |||
166 | void __init samsung_timer_init(void) | ||
167 | { | ||
168 | unsigned int timer_irqs[SAMSUNG_PWM_NUM] = { | ||
169 | IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
170 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC, | ||
171 | }; | ||
172 | |||
173 | samsung_pwm_clocksource_init(S3C_VA_TIMER, | ||
174 | timer_irqs, &s5pv210_pwm_variant); | ||
175 | } | ||
176 | |||
151 | /* | 177 | /* |
152 | * s5pv210_map_io | 178 | * s5pv210_map_io |
153 | * | 179 | * |
@@ -165,6 +191,8 @@ void __init s5pv210_init_io(struct map_desc *mach_desc, int size) | |||
165 | s5p_init_cpu(S5P_VA_CHIPID); | 191 | s5p_init_cpu(S5P_VA_CHIPID); |
166 | 192 | ||
167 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); | 193 | s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); |
194 | |||
195 | samsung_pwm_set_platdata(&s5pv210_pwm_variant); | ||
168 | } | 196 | } |
169 | 197 | ||
170 | void __init s5pv210_map_io(void) | 198 | void __init s5pv210_map_io(void) |
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index e777e010ed2e..5e0de3a31f3d 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h | |||
@@ -118,8 +118,6 @@ | |||
118 | #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) | 118 | #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) |
119 | #define IRQ_VIC_END S5P_IRQ_VIC3(31) | 119 | #define IRQ_VIC_END S5P_IRQ_VIC3(31) |
120 | 120 | ||
121 | #define IRQ_TIMER_BASE (11) | ||
122 | |||
123 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) | 121 | #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) |
124 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) | 122 | #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) |
125 | 123 | ||
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index b7c8a1917ffc..763929aca52d 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
@@ -139,6 +139,7 @@ | |||
139 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC | 139 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC |
140 | #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON | 140 | #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON |
141 | #define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD | 141 | #define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD |
142 | #define SAMSUNG_PA_TIMER S5PV210_PA_TIMER | ||
142 | 143 | ||
143 | /* UART */ | 144 | /* UART */ |
144 | 145 | ||
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c index d50b6f124465..6d72bb992e38 100644 --- a/arch/arm/mach-s5pv210/mach-smdkv210.c +++ b/arch/arm/mach-s5pv210/mach-smdkv210.c | |||
@@ -218,6 +218,7 @@ static struct platform_device *smdkv210_devices[] __initdata = { | |||
218 | &s3c_device_i2c0, | 218 | &s3c_device_i2c0, |
219 | &s3c_device_i2c1, | 219 | &s3c_device_i2c1, |
220 | &s3c_device_i2c2, | 220 | &s3c_device_i2c2, |
221 | &samsung_device_pwm, | ||
221 | &s3c_device_rtc, | 222 | &s3c_device_rtc, |
222 | &s3c_device_ts, | 223 | &s3c_device_ts, |
223 | &s3c_device_usb_hsotg, | 224 | &s3c_device_usb_hsotg, |
@@ -316,11 +317,11 @@ static void __init smdkv210_machine_init(void) | |||
316 | 317 | ||
317 | s3c_fb_set_platdata(&smdkv210_lcd0_pdata); | 318 | s3c_fb_set_platdata(&smdkv210_lcd0_pdata); |
318 | 319 | ||
319 | samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data); | ||
320 | |||
321 | s3c_hsotg_set_platdata(&smdkv210_hsotg_pdata); | 320 | s3c_hsotg_set_platdata(&smdkv210_hsotg_pdata); |
322 | 321 | ||
323 | platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); | 322 | platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); |
323 | |||
324 | samsung_bl_set(&smdkv210_bl_gpio_info, &smdkv210_bl_data); | ||
324 | } | 325 | } |
325 | 326 | ||
326 | MACHINE_START(SMDKV210, "SMDKV210") | 327 | MACHINE_START(SMDKV210, "SMDKV210") |
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 2b68a67b6e95..3cf3f9c8ddd1 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | #include <plat/cpu.h> | 22 | #include <plat/cpu.h> |
23 | #include <plat/pm.h> | 23 | #include <plat/pm.h> |
24 | #include <plat/regs-timer.h> | ||
25 | 24 | ||
26 | #include <mach/regs-irq.h> | 25 | #include <mach/regs-irq.h> |
27 | #include <mach/regs-clock.h> | 26 | #include <mach/regs-clock.h> |
@@ -77,15 +76,6 @@ static struct sleep_save s5pv210_core_save[] = { | |||
77 | /* Clock ETC */ | 76 | /* Clock ETC */ |
78 | SAVE_ITEM(S5P_CLK_OUT), | 77 | SAVE_ITEM(S5P_CLK_OUT), |
79 | SAVE_ITEM(S5P_MDNIE_SEL), | 78 | SAVE_ITEM(S5P_MDNIE_SEL), |
80 | |||
81 | /* PWM Register */ | ||
82 | SAVE_ITEM(S3C2410_TCFG0), | ||
83 | SAVE_ITEM(S3C2410_TCFG1), | ||
84 | SAVE_ITEM(S3C64XX_TINT_CSTAT), | ||
85 | SAVE_ITEM(S3C2410_TCON), | ||
86 | SAVE_ITEM(S3C2410_TCNTB(0)), | ||
87 | SAVE_ITEM(S3C2410_TCMPB(0)), | ||
88 | SAVE_ITEM(S3C2410_TCNTO(0)), | ||
89 | }; | 79 | }; |
90 | 80 | ||
91 | static int s5pv210_cpu_suspend(unsigned long arg) | 81 | static int s5pv210_cpu_suspend(unsigned long arg) |
diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig index d04e3bfe1918..835833e3c4f8 100644 --- a/arch/arm/mach-sti/Kconfig +++ b/arch/arm/mach-sti/Kconfig | |||
@@ -11,8 +11,9 @@ menuconfig ARCH_STI | |||
11 | select HAVE_SMP | 11 | select HAVE_SMP |
12 | select HAVE_ARM_SCU if SMP | 12 | select HAVE_ARM_SCU if SMP |
13 | select ARCH_REQUIRE_GPIOLIB | 13 | select ARCH_REQUIRE_GPIOLIB |
14 | select ARM_ERRATA_720789 | ||
15 | select ARM_ERRATA_754322 | 14 | select ARM_ERRATA_754322 |
15 | select ARM_ERRATA_764369 | ||
16 | select ARM_ERRATA_775420 | ||
16 | select PL310_ERRATA_753970 if CACHE_PL310 | 17 | select PL310_ERRATA_753970 if CACHE_PL310 |
17 | select PL310_ERRATA_769419 if CACHE_PL310 | 18 | select PL310_ERRATA_769419 if CACHE_PL310 |
18 | help | 19 | help |
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 5b799c29886e..5f252569c689 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -91,7 +91,7 @@ static void __init zynq_map_io(void) | |||
91 | zynq_scu_map_io(); | 91 | zynq_scu_map_io(); |
92 | } | 92 | } |
93 | 93 | ||
94 | static void zynq_system_reset(char mode, const char *cmd) | 94 | static void zynq_system_reset(enum reboot_mode mode, const char *cmd) |
95 | { | 95 | { |
96 | zynq_slcr_system_reset(); | 96 | zynq_slcr_system_reset(); |
97 | } | 97 | } |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 6cacdc8dd654..db5c2cab8fda 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -421,24 +421,28 @@ config CPU_32v3 | |||
421 | select CPU_USE_DOMAINS if MMU | 421 | select CPU_USE_DOMAINS if MMU |
422 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 422 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
423 | select TLS_REG_EMUL if SMP || !MMU | 423 | select TLS_REG_EMUL if SMP || !MMU |
424 | select NEED_KUSER_HELPERS | ||
424 | 425 | ||
425 | config CPU_32v4 | 426 | config CPU_32v4 |
426 | bool | 427 | bool |
427 | select CPU_USE_DOMAINS if MMU | 428 | select CPU_USE_DOMAINS if MMU |
428 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 429 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
429 | select TLS_REG_EMUL if SMP || !MMU | 430 | select TLS_REG_EMUL if SMP || !MMU |
431 | select NEED_KUSER_HELPERS | ||
430 | 432 | ||
431 | config CPU_32v4T | 433 | config CPU_32v4T |
432 | bool | 434 | bool |
433 | select CPU_USE_DOMAINS if MMU | 435 | select CPU_USE_DOMAINS if MMU |
434 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 436 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
435 | select TLS_REG_EMUL if SMP || !MMU | 437 | select TLS_REG_EMUL if SMP || !MMU |
438 | select NEED_KUSER_HELPERS | ||
436 | 439 | ||
437 | config CPU_32v5 | 440 | config CPU_32v5 |
438 | bool | 441 | bool |
439 | select CPU_USE_DOMAINS if MMU | 442 | select CPU_USE_DOMAINS if MMU |
440 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 443 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
441 | select TLS_REG_EMUL if SMP || !MMU | 444 | select TLS_REG_EMUL if SMP || !MMU |
445 | select NEED_KUSER_HELPERS | ||
442 | 446 | ||
443 | config CPU_32v6 | 447 | config CPU_32v6 |
444 | bool | 448 | bool |
@@ -776,6 +780,7 @@ config CPU_BPREDICT_DISABLE | |||
776 | 780 | ||
777 | config TLS_REG_EMUL | 781 | config TLS_REG_EMUL |
778 | bool | 782 | bool |
783 | select NEED_KUSER_HELPERS | ||
779 | help | 784 | help |
780 | An SMP system using a pre-ARMv6 processor (there are apparently | 785 | An SMP system using a pre-ARMv6 processor (there are apparently |
781 | a few prototypes like that in existence) and therefore access to | 786 | a few prototypes like that in existence) and therefore access to |
@@ -783,11 +788,40 @@ config TLS_REG_EMUL | |||
783 | 788 | ||
784 | config NEEDS_SYSCALL_FOR_CMPXCHG | 789 | config NEEDS_SYSCALL_FOR_CMPXCHG |
785 | bool | 790 | bool |
791 | select NEED_KUSER_HELPERS | ||
786 | help | 792 | help |
787 | SMP on a pre-ARMv6 processor? Well OK then. | 793 | SMP on a pre-ARMv6 processor? Well OK then. |
788 | Forget about fast user space cmpxchg support. | 794 | Forget about fast user space cmpxchg support. |
789 | It is just not possible. | 795 | It is just not possible. |
790 | 796 | ||
797 | config NEED_KUSER_HELPERS | ||
798 | bool | ||
799 | |||
800 | config KUSER_HELPERS | ||
801 | bool "Enable kuser helpers in vector page" if !NEED_KUSER_HELPERS | ||
802 | default y | ||
803 | help | ||
804 | Warning: disabling this option may break user programs. | ||
805 | |||
806 | Provide kuser helpers in the vector page. The kernel provides | ||
807 | helper code to userspace in read only form at a fixed location | ||
808 | in the high vector page to allow userspace to be independent of | ||
809 | the CPU type fitted to the system. This permits binaries to be | ||
810 | run on ARMv4 through to ARMv7 without modification. | ||
811 | |||
812 | However, the fixed address nature of these helpers can be used | ||
813 | by ROP (return orientated programming) authors when creating | ||
814 | exploits. | ||
815 | |||
816 | If all of the binaries and libraries which run on your platform | ||
817 | are built specifically for your platform, and make no use of | ||
818 | these helpers, then you can turn this option off. However, | ||
819 | when such an binary or library is run, it will receive a SIGILL | ||
820 | signal, which will terminate the program. | ||
821 | |||
822 | Say N here only if you are absolutely certain that you do not | ||
823 | need these helpers; otherwise, the safe option is to say Y. | ||
824 | |||
791 | config DMA_CACHE_RWFO | 825 | config DMA_CACHE_RWFO |
792 | bool "Enable read/write for ownership DMA cache maintenance" | 826 | bool "Enable read/write for ownership DMA cache maintenance" |
793 | depends on CPU_V6K && SMP | 827 | depends on CPU_V6K && SMP |
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c index b55b1015724b..4a0544492f10 100644 --- a/arch/arm/mm/context.c +++ b/arch/arm/mm/context.c | |||
@@ -245,7 +245,8 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk) | |||
245 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { | 245 | if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { |
246 | local_flush_bp_all(); | 246 | local_flush_bp_all(); |
247 | local_flush_tlb_all(); | 247 | local_flush_tlb_all(); |
248 | dummy_flush_tlb_a15_erratum(); | 248 | if (erratum_a15_798181()) |
249 | dummy_flush_tlb_a15_erratum(); | ||
249 | } | 250 | } |
250 | 251 | ||
251 | atomic64_set(&per_cpu(active_asids, cpu), asid); | 252 | atomic64_set(&per_cpu(active_asids, cpu), asid); |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4f56617a2392..53cdbd39ec8e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -989,6 +989,7 @@ phys_addr_t arm_lowmem_limit __initdata = 0; | |||
989 | 989 | ||
990 | void __init sanity_check_meminfo(void) | 990 | void __init sanity_check_meminfo(void) |
991 | { | 991 | { |
992 | phys_addr_t memblock_limit = 0; | ||
992 | int i, j, highmem = 0; | 993 | int i, j, highmem = 0; |
993 | phys_addr_t vmalloc_limit = __pa(vmalloc_min - 1) + 1; | 994 | phys_addr_t vmalloc_limit = __pa(vmalloc_min - 1) + 1; |
994 | 995 | ||
@@ -1052,9 +1053,32 @@ void __init sanity_check_meminfo(void) | |||
1052 | bank->size = size_limit; | 1053 | bank->size = size_limit; |
1053 | } | 1054 | } |
1054 | #endif | 1055 | #endif |
1055 | if (!bank->highmem && bank->start + bank->size > arm_lowmem_limit) | 1056 | if (!bank->highmem) { |
1056 | arm_lowmem_limit = bank->start + bank->size; | 1057 | phys_addr_t bank_end = bank->start + bank->size; |
1057 | 1058 | ||
1059 | if (bank_end > arm_lowmem_limit) | ||
1060 | arm_lowmem_limit = bank_end; | ||
1061 | |||
1062 | /* | ||
1063 | * Find the first non-section-aligned page, and point | ||
1064 | * memblock_limit at it. This relies on rounding the | ||
1065 | * limit down to be section-aligned, which happens at | ||
1066 | * the end of this function. | ||
1067 | * | ||
1068 | * With this algorithm, the start or end of almost any | ||
1069 | * bank can be non-section-aligned. The only exception | ||
1070 | * is that the start of the bank 0 must be section- | ||
1071 | * aligned, since otherwise memory would need to be | ||
1072 | * allocated when mapping the start of bank 0, which | ||
1073 | * occurs before any free memory is mapped. | ||
1074 | */ | ||
1075 | if (!memblock_limit) { | ||
1076 | if (!IS_ALIGNED(bank->start, SECTION_SIZE)) | ||
1077 | memblock_limit = bank->start; | ||
1078 | else if (!IS_ALIGNED(bank_end, SECTION_SIZE)) | ||
1079 | memblock_limit = bank_end; | ||
1080 | } | ||
1081 | } | ||
1058 | j++; | 1082 | j++; |
1059 | } | 1083 | } |
1060 | #ifdef CONFIG_HIGHMEM | 1084 | #ifdef CONFIG_HIGHMEM |
@@ -1079,7 +1103,18 @@ void __init sanity_check_meminfo(void) | |||
1079 | #endif | 1103 | #endif |
1080 | meminfo.nr_banks = j; | 1104 | meminfo.nr_banks = j; |
1081 | high_memory = __va(arm_lowmem_limit - 1) + 1; | 1105 | high_memory = __va(arm_lowmem_limit - 1) + 1; |
1082 | memblock_set_current_limit(arm_lowmem_limit); | 1106 | |
1107 | /* | ||
1108 | * Round the memblock limit down to a section size. This | ||
1109 | * helps to ensure that we will allocate memory from the | ||
1110 | * last full section, which should be mapped. | ||
1111 | */ | ||
1112 | if (memblock_limit) | ||
1113 | memblock_limit = round_down(memblock_limit, SECTION_SIZE); | ||
1114 | if (!memblock_limit) | ||
1115 | memblock_limit = arm_lowmem_limit; | ||
1116 | |||
1117 | memblock_set_current_limit(memblock_limit); | ||
1083 | } | 1118 | } |
1084 | 1119 | ||
1085 | static inline void prepare_page_table(void) | 1120 | static inline void prepare_page_table(void) |
@@ -1160,7 +1195,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc) | |||
1160 | /* | 1195 | /* |
1161 | * Allocate the vector page early. | 1196 | * Allocate the vector page early. |
1162 | */ | 1197 | */ |
1163 | vectors = early_alloc(PAGE_SIZE); | 1198 | vectors = early_alloc(PAGE_SIZE * 2); |
1164 | 1199 | ||
1165 | early_trap_init(vectors); | 1200 | early_trap_init(vectors); |
1166 | 1201 | ||
@@ -1205,15 +1240,27 @@ static void __init devicemaps_init(struct machine_desc *mdesc) | |||
1205 | map.pfn = __phys_to_pfn(virt_to_phys(vectors)); | 1240 | map.pfn = __phys_to_pfn(virt_to_phys(vectors)); |
1206 | map.virtual = 0xffff0000; | 1241 | map.virtual = 0xffff0000; |
1207 | map.length = PAGE_SIZE; | 1242 | map.length = PAGE_SIZE; |
1243 | #ifdef CONFIG_KUSER_HELPERS | ||
1208 | map.type = MT_HIGH_VECTORS; | 1244 | map.type = MT_HIGH_VECTORS; |
1245 | #else | ||
1246 | map.type = MT_LOW_VECTORS; | ||
1247 | #endif | ||
1209 | create_mapping(&map); | 1248 | create_mapping(&map); |
1210 | 1249 | ||
1211 | if (!vectors_high()) { | 1250 | if (!vectors_high()) { |
1212 | map.virtual = 0; | 1251 | map.virtual = 0; |
1252 | map.length = PAGE_SIZE * 2; | ||
1213 | map.type = MT_LOW_VECTORS; | 1253 | map.type = MT_LOW_VECTORS; |
1214 | create_mapping(&map); | 1254 | create_mapping(&map); |
1215 | } | 1255 | } |
1216 | 1256 | ||
1257 | /* Now create a kernel read-only mapping */ | ||
1258 | map.pfn += 1; | ||
1259 | map.virtual = 0xffff0000 + PAGE_SIZE; | ||
1260 | map.length = PAGE_SIZE; | ||
1261 | map.type = MT_LOW_VECTORS; | ||
1262 | create_mapping(&map); | ||
1263 | |||
1217 | /* | 1264 | /* |
1218 | * Ask the machine support to map in the statically mapped devices. | 1265 | * Ask the machine support to map in the statically mapped devices. |
1219 | */ | 1266 | */ |
@@ -1276,8 +1323,6 @@ void __init paging_init(struct machine_desc *mdesc) | |||
1276 | { | 1323 | { |
1277 | void *zero_page; | 1324 | void *zero_page; |
1278 | 1325 | ||
1279 | memblock_set_current_limit(arm_lowmem_limit); | ||
1280 | |||
1281 | build_mem_type_table(); | 1326 | build_mem_type_table(); |
1282 | prepare_page_table(); | 1327 | prepare_page_table(); |
1283 | map_lowmem(); | 1328 | map_lowmem(); |
diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S index f64afb9f1bd5..bdd3be4be77a 100644 --- a/arch/arm/mm/proc-v7-2level.S +++ b/arch/arm/mm/proc-v7-2level.S | |||
@@ -110,7 +110,7 @@ ENTRY(cpu_v7_set_pte_ext) | |||
110 | ARM( str r3, [r0, #2048]! ) | 110 | ARM( str r3, [r0, #2048]! ) |
111 | THUMB( add r0, r0, #2048 ) | 111 | THUMB( add r0, r0, #2048 ) |
112 | THUMB( str r3, [r0] ) | 112 | THUMB( str r3, [r0] ) |
113 | ALT_SMP(mov pc,lr) | 113 | ALT_SMP(W(nop)) |
114 | ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte | 114 | ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte |
115 | #endif | 115 | #endif |
116 | mov pc, lr | 116 | mov pc, lr |
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S index c36ac69488c8..01a719e18bb0 100644 --- a/arch/arm/mm/proc-v7-3level.S +++ b/arch/arm/mm/proc-v7-3level.S | |||
@@ -81,7 +81,7 @@ ENTRY(cpu_v7_set_pte_ext) | |||
81 | tst r3, #1 << (55 - 32) @ L_PTE_DIRTY | 81 | tst r3, #1 << (55 - 32) @ L_PTE_DIRTY |
82 | orreq r2, #L_PTE_RDONLY | 82 | orreq r2, #L_PTE_RDONLY |
83 | 1: strd r2, r3, [r0] | 83 | 1: strd r2, r3, [r0] |
84 | ALT_SMP(mov pc, lr) | 84 | ALT_SMP(W(nop)) |
85 | ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte | 85 | ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte |
86 | #endif | 86 | #endif |
87 | mov pc, lr | 87 | mov pc, lr |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 5c6d5a3050ea..73398bcf9bd8 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -75,13 +75,14 @@ ENTRY(cpu_v7_do_idle) | |||
75 | ENDPROC(cpu_v7_do_idle) | 75 | ENDPROC(cpu_v7_do_idle) |
76 | 76 | ||
77 | ENTRY(cpu_v7_dcache_clean_area) | 77 | ENTRY(cpu_v7_dcache_clean_area) |
78 | ALT_SMP(mov pc, lr) @ MP extensions imply L1 PTW | 78 | ALT_SMP(W(nop)) @ MP extensions imply L1 PTW |
79 | ALT_UP(W(nop)) | 79 | ALT_UP_B(1f) |
80 | dcache_line_size r2, r3 | 80 | mov pc, lr |
81 | 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 81 | 1: dcache_line_size r2, r3 |
82 | 2: mcr p15, 0, r0, c7, c10, 1 @ clean D entry | ||
82 | add r0, r0, r2 | 83 | add r0, r0, r2 |
83 | subs r1, r1, r2 | 84 | subs r1, r1, r2 |
84 | bhi 1b | 85 | bhi 2b |
85 | dsb | 86 | dsb |
86 | mov pc, lr | 87 | mov pc, lr |
87 | ENDPROC(cpu_v7_dcache_clean_area) | 88 | ENDPROC(cpu_v7_dcache_clean_area) |
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 3dc5cbea86cc..7dfba937d8fc 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig | |||
@@ -25,10 +25,16 @@ config PLAT_S5P | |||
25 | select S5P_GPIO_DRVSTR | 25 | select S5P_GPIO_DRVSTR |
26 | select SAMSUNG_CLKSRC if !COMMON_CLK | 26 | select SAMSUNG_CLKSRC if !COMMON_CLK |
27 | select SAMSUNG_GPIOLIB_4BIT | 27 | select SAMSUNG_GPIOLIB_4BIT |
28 | select SAMSUNG_IRQ_VIC_TIMER | ||
29 | help | 28 | help |
30 | Base platform code for Samsung's S5P series SoC. | 29 | Base platform code for Samsung's S5P series SoC. |
31 | 30 | ||
31 | config SAMSUNG_PM | ||
32 | bool | ||
33 | depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5P64X0 || S5P_PM) | ||
34 | default y | ||
35 | help | ||
36 | Base platform power management code for samsung code | ||
37 | |||
32 | if PLAT_SAMSUNG | 38 | if PLAT_SAMSUNG |
33 | 39 | ||
34 | # boot configurations | 40 | # boot configurations |
@@ -72,14 +78,6 @@ config SAMSUNG_ATAGS | |||
72 | 78 | ||
73 | if SAMSUNG_ATAGS | 79 | if SAMSUNG_ATAGS |
74 | 80 | ||
75 | # timer options | ||
76 | |||
77 | config SAMSUNG_HRT | ||
78 | bool | ||
79 | select SAMSUNG_DEV_PWM | ||
80 | help | ||
81 | Use the High Resolution timer support | ||
82 | |||
83 | # clock options | 81 | # clock options |
84 | 82 | ||
85 | config SAMSUNG_CLOCK | 83 | config SAMSUNG_CLOCK |
@@ -99,11 +97,6 @@ config S5P_CLOCK | |||
99 | 97 | ||
100 | # options for IRQ support | 98 | # options for IRQ support |
101 | 99 | ||
102 | config SAMSUNG_IRQ_VIC_TIMER | ||
103 | bool | ||
104 | help | ||
105 | Internal configuration to build the VIC timer interrupt code. | ||
106 | |||
107 | config S5P_IRQ | 100 | config S5P_IRQ |
108 | def_bool (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210) | 101 | def_bool (ARCH_S5P64X0 || ARCH_S5PC100 || ARCH_S5PV210) |
109 | help | 102 | help |
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile index 98d07d8fc7a7..498c7c23e9f4 100644 --- a/arch/arm/plat-samsung/Makefile +++ b/arch/arm/plat-samsung/Makefile | |||
@@ -12,15 +12,12 @@ obj- := | |||
12 | # Objects we always build independent of SoC choice | 12 | # Objects we always build independent of SoC choice |
13 | 13 | ||
14 | obj-y += init.o cpu.o | 14 | obj-y += init.o cpu.o |
15 | obj-$(CONFIG_SAMSUNG_HRT) += samsung-time.o | ||
16 | 15 | ||
17 | obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o | 16 | obj-$(CONFIG_SAMSUNG_CLOCK) += clock.o |
18 | obj-$(CONFIG_SAMSUNG_CLOCK) += pwm-clock.o | ||
19 | 17 | ||
20 | obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o | 18 | obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o |
21 | obj-$(CONFIG_S5P_CLOCK) += s5p-clock.o | 19 | obj-$(CONFIG_S5P_CLOCK) += s5p-clock.o |
22 | 20 | ||
23 | obj-$(CONFIG_SAMSUNG_IRQ_VIC_TIMER) += irq-vic-timer.o | ||
24 | obj-$(CONFIG_S5P_IRQ) += s5p-irq.o | 21 | obj-$(CONFIG_S5P_IRQ) += s5p-irq.o |
25 | obj-$(CONFIG_S5P_EXT_INT) += s5p-irq-eint.o | 22 | obj-$(CONFIG_S5P_EXT_INT) += s5p-irq-eint.o |
26 | obj-$(CONFIG_S5P_GPIO_INT) += s5p-irq-gpioint.o | 23 | obj-$(CONFIG_S5P_GPIO_INT) += s5p-irq-gpioint.o |
@@ -51,7 +48,7 @@ obj-$(CONFIG_SAMSUNG_DMADEV) += dma-ops.o | |||
51 | 48 | ||
52 | # PM support | 49 | # PM support |
53 | 50 | ||
54 | obj-$(CONFIG_PM) += pm.o | 51 | obj-$(CONFIG_SAMSUNG_PM) += pm.o |
55 | obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o | 52 | obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o |
56 | obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o | 53 | obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o |
57 | 54 | ||
diff --git a/arch/arm/plat-samsung/dev-backlight.c b/arch/arm/plat-samsung/dev-backlight.c index 5f197dcaf10c..d51f9565567c 100644 --- a/arch/arm/plat-samsung/dev-backlight.c +++ b/arch/arm/plat-samsung/dev-backlight.c | |||
@@ -20,13 +20,18 @@ | |||
20 | #include <plat/gpio-cfg.h> | 20 | #include <plat/gpio-cfg.h> |
21 | #include <plat/backlight.h> | 21 | #include <plat/backlight.h> |
22 | 22 | ||
23 | struct samsung_bl_drvdata { | ||
24 | struct platform_pwm_backlight_data plat_data; | ||
25 | struct samsung_bl_gpio_info *gpio_info; | ||
26 | }; | ||
27 | |||
23 | static int samsung_bl_init(struct device *dev) | 28 | static int samsung_bl_init(struct device *dev) |
24 | { | 29 | { |
25 | int ret = 0; | 30 | int ret = 0; |
26 | struct platform_device *timer_dev = | 31 | struct platform_pwm_backlight_data *pdata = dev->platform_data; |
27 | container_of(dev->parent, struct platform_device, dev); | 32 | struct samsung_bl_drvdata *drvdata = container_of(pdata, |
28 | struct samsung_bl_gpio_info *bl_gpio_info = | 33 | struct samsung_bl_drvdata, plat_data); |
29 | timer_dev->dev.platform_data; | 34 | struct samsung_bl_gpio_info *bl_gpio_info = drvdata->gpio_info; |
30 | 35 | ||
31 | ret = gpio_request(bl_gpio_info->no, "Backlight"); | 36 | ret = gpio_request(bl_gpio_info->no, "Backlight"); |
32 | if (ret) { | 37 | if (ret) { |
@@ -42,10 +47,10 @@ static int samsung_bl_init(struct device *dev) | |||
42 | 47 | ||
43 | static void samsung_bl_exit(struct device *dev) | 48 | static void samsung_bl_exit(struct device *dev) |
44 | { | 49 | { |
45 | struct platform_device *timer_dev = | 50 | struct platform_pwm_backlight_data *pdata = dev->platform_data; |
46 | container_of(dev->parent, struct platform_device, dev); | 51 | struct samsung_bl_drvdata *drvdata = container_of(pdata, |
47 | struct samsung_bl_gpio_info *bl_gpio_info = | 52 | struct samsung_bl_drvdata, plat_data); |
48 | timer_dev->dev.platform_data; | 53 | struct samsung_bl_gpio_info *bl_gpio_info = drvdata->gpio_info; |
49 | 54 | ||
50 | s3c_gpio_cfgpin(bl_gpio_info->no, S3C_GPIO_OUTPUT); | 55 | s3c_gpio_cfgpin(bl_gpio_info->no, S3C_GPIO_OUTPUT); |
51 | gpio_free(bl_gpio_info->no); | 56 | gpio_free(bl_gpio_info->no); |
@@ -60,12 +65,14 @@ static void samsung_bl_exit(struct device *dev) | |||
60 | * for their specific boards | 65 | * for their specific boards |
61 | */ | 66 | */ |
62 | 67 | ||
63 | static struct platform_pwm_backlight_data samsung_dfl_bl_data __initdata = { | 68 | static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = { |
64 | .max_brightness = 255, | 69 | .plat_data = { |
65 | .dft_brightness = 255, | 70 | .max_brightness = 255, |
66 | .pwm_period_ns = 78770, | 71 | .dft_brightness = 255, |
67 | .init = samsung_bl_init, | 72 | .pwm_period_ns = 78770, |
68 | .exit = samsung_bl_exit, | 73 | .init = samsung_bl_init, |
74 | .exit = samsung_bl_exit, | ||
75 | }, | ||
69 | }; | 76 | }; |
70 | 77 | ||
71 | static struct platform_device samsung_dfl_bl_device __initdata = { | 78 | static struct platform_device samsung_dfl_bl_device __initdata = { |
@@ -82,6 +89,7 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, | |||
82 | { | 89 | { |
83 | int ret = 0; | 90 | int ret = 0; |
84 | struct platform_device *samsung_bl_device; | 91 | struct platform_device *samsung_bl_device; |
92 | struct samsung_bl_drvdata *samsung_bl_drvdata; | ||
85 | struct platform_pwm_backlight_data *samsung_bl_data; | 93 | struct platform_pwm_backlight_data *samsung_bl_data; |
86 | 94 | ||
87 | samsung_bl_device = kmemdup(&samsung_dfl_bl_device, | 95 | samsung_bl_device = kmemdup(&samsung_dfl_bl_device, |
@@ -91,17 +99,19 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, | |||
91 | return; | 99 | return; |
92 | } | 100 | } |
93 | 101 | ||
94 | samsung_bl_data = s3c_set_platdata(&samsung_dfl_bl_data, | 102 | samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data, |
95 | sizeof(struct platform_pwm_backlight_data), samsung_bl_device); | 103 | sizeof(samsung_dfl_bl_data), GFP_KERNEL); |
96 | if (!samsung_bl_data) { | 104 | if (!samsung_bl_drvdata) { |
97 | printk(KERN_ERR "%s: no memory for platform dev\n", __func__); | 105 | printk(KERN_ERR "%s: no memory for platform dev\n", __func__); |
98 | goto err_data; | 106 | goto err_data; |
99 | } | 107 | } |
108 | samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data; | ||
109 | samsung_bl_drvdata->gpio_info = gpio_info; | ||
110 | samsung_bl_data = &samsung_bl_drvdata->plat_data; | ||
100 | 111 | ||
101 | /* Copy board specific data provided by user */ | 112 | /* Copy board specific data provided by user */ |
102 | samsung_bl_data->pwm_id = bl_data->pwm_id; | 113 | samsung_bl_data->pwm_id = bl_data->pwm_id; |
103 | samsung_bl_device->dev.parent = | 114 | samsung_bl_device->dev.parent = &samsung_device_pwm.dev; |
104 | &s3c_device_timer[samsung_bl_data->pwm_id].dev; | ||
105 | 115 | ||
106 | if (bl_data->max_brightness) | 116 | if (bl_data->max_brightness) |
107 | samsung_bl_data->max_brightness = bl_data->max_brightness; | 117 | samsung_bl_data->max_brightness = bl_data->max_brightness; |
@@ -122,17 +132,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, | |||
122 | if (bl_data->check_fb) | 132 | if (bl_data->check_fb) |
123 | samsung_bl_data->check_fb = bl_data->check_fb; | 133 | samsung_bl_data->check_fb = bl_data->check_fb; |
124 | 134 | ||
125 | /* Keep the GPIO info for future use */ | ||
126 | s3c_device_timer[samsung_bl_data->pwm_id].dev.platform_data = gpio_info; | ||
127 | |||
128 | /* Register the specific PWM timer dev for Backlight control */ | ||
129 | ret = platform_device_register( | ||
130 | &s3c_device_timer[samsung_bl_data->pwm_id]); | ||
131 | if (ret) { | ||
132 | printk(KERN_ERR "failed to register pwm timer for backlight: %d\n", ret); | ||
133 | goto err_plat_reg1; | ||
134 | } | ||
135 | |||
136 | /* Register the Backlight dev */ | 135 | /* Register the Backlight dev */ |
137 | ret = platform_device_register(samsung_bl_device); | 136 | ret = platform_device_register(samsung_bl_device); |
138 | if (ret) { | 137 | if (ret) { |
@@ -143,8 +142,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, | |||
143 | return; | 142 | return; |
144 | 143 | ||
145 | err_plat_reg2: | 144 | err_plat_reg2: |
146 | platform_device_unregister(&s3c_device_timer[samsung_bl_data->pwm_id]); | ||
147 | err_plat_reg1: | ||
148 | kfree(samsung_bl_data); | 145 | kfree(samsung_bl_data); |
149 | err_data: | 146 | err_data: |
150 | kfree(samsung_bl_device); | 147 | kfree(samsung_bl_device); |
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c index 0f9c3f431a5f..8ce0ac007eb9 100644 --- a/arch/arm/plat-samsung/devs.c +++ b/arch/arm/plat-samsung/devs.c | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <plat/keypad.h> | 58 | #include <plat/keypad.h> |
59 | #include <linux/platform_data/mmc-s3cmci.h> | 59 | #include <linux/platform_data/mmc-s3cmci.h> |
60 | #include <linux/platform_data/mtd-nand-s3c2410.h> | 60 | #include <linux/platform_data/mtd-nand-s3c2410.h> |
61 | #include <plat/pwm-core.h> | ||
61 | #include <plat/sdhci.h> | 62 | #include <plat/sdhci.h> |
62 | #include <linux/platform_data/touchscreen-s3c2410.h> | 63 | #include <linux/platform_data/touchscreen-s3c2410.h> |
63 | #include <linux/platform_data/usb-s3c2410_udc.h> | 64 | #include <linux/platform_data/usb-s3c2410_udc.h> |
@@ -1097,36 +1098,21 @@ arch_initcall(s5p_pmu_init); | |||
1097 | /* PWM Timer */ | 1098 | /* PWM Timer */ |
1098 | 1099 | ||
1099 | #ifdef CONFIG_SAMSUNG_DEV_PWM | 1100 | #ifdef CONFIG_SAMSUNG_DEV_PWM |
1101 | static struct resource samsung_pwm_resource[] = { | ||
1102 | DEFINE_RES_MEM(SAMSUNG_PA_TIMER, SZ_4K), | ||
1103 | }; | ||
1100 | 1104 | ||
1101 | #define TIMER_RESOURCE_SIZE (1) | 1105 | struct platform_device samsung_device_pwm = { |
1102 | 1106 | .name = "samsung-pwm", | |
1103 | #define TIMER_RESOURCE(_tmr, _irq) \ | 1107 | .id = -1, |
1104 | (struct resource [TIMER_RESOURCE_SIZE]) { \ | 1108 | .num_resources = ARRAY_SIZE(samsung_pwm_resource), |
1105 | [0] = { \ | 1109 | .resource = samsung_pwm_resource, |
1106 | .start = _irq, \ | ||
1107 | .end = _irq, \ | ||
1108 | .flags = IORESOURCE_IRQ \ | ||
1109 | } \ | ||
1110 | } | ||
1111 | |||
1112 | #define DEFINE_S3C_TIMER(_tmr_no, _irq) \ | ||
1113 | .name = "s3c24xx-pwm", \ | ||
1114 | .id = _tmr_no, \ | ||
1115 | .num_resources = TIMER_RESOURCE_SIZE, \ | ||
1116 | .resource = TIMER_RESOURCE(_tmr_no, _irq), \ | ||
1117 | |||
1118 | /* | ||
1119 | * since we already have an static mapping for the timer, | ||
1120 | * we do not bother setting any IO resource for the base. | ||
1121 | */ | ||
1122 | |||
1123 | struct platform_device s3c_device_timer[] = { | ||
1124 | [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) }, | ||
1125 | [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) }, | ||
1126 | [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) }, | ||
1127 | [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) }, | ||
1128 | [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) }, | ||
1129 | }; | 1110 | }; |
1111 | |||
1112 | void __init samsung_pwm_set_platdata(struct samsung_pwm_variant *pd) | ||
1113 | { | ||
1114 | samsung_device_pwm.dev.platform_data = pd; | ||
1115 | } | ||
1130 | #endif /* CONFIG_SAMSUNG_DEV_PWM */ | 1116 | #endif /* CONFIG_SAMSUNG_DEV_PWM */ |
1131 | 1117 | ||
1132 | /* RTC */ | 1118 | /* RTC */ |
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h index a62753dc15ba..63239f409807 100644 --- a/arch/arm/plat-samsung/include/plat/clock.h +++ b/arch/arm/plat-samsung/include/plat/clock.h | |||
@@ -83,6 +83,11 @@ extern struct clk clk_ext; | |||
83 | extern struct clksrc_clk clk_epllref; | 83 | extern struct clksrc_clk clk_epllref; |
84 | extern struct clksrc_clk clk_esysclk; | 84 | extern struct clksrc_clk clk_esysclk; |
85 | 85 | ||
86 | /* S3C24XX UART clocks */ | ||
87 | extern struct clk s3c24xx_clk_uart0; | ||
88 | extern struct clk s3c24xx_clk_uart1; | ||
89 | extern struct clk s3c24xx_clk_uart2; | ||
90 | |||
86 | /* S3C64XX specific clocks */ | 91 | /* S3C64XX specific clocks */ |
87 | extern struct clk clk_h2; | 92 | extern struct clk clk_h2; |
88 | extern struct clk clk_27m; | 93 | extern struct clk clk_27m; |
@@ -140,10 +145,6 @@ extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable); | |||
140 | 145 | ||
141 | extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable); | 146 | extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable); |
142 | 147 | ||
143 | /* Init for pwm clock code */ | ||
144 | |||
145 | extern void s3c_pwmclk_init(void); | ||
146 | |||
147 | /* Global watchdog clock used by arch_wtd_reset() callback */ | 148 | /* Global watchdog clock used by arch_wtd_reset() callback */ |
148 | 149 | ||
149 | extern struct clk *s3c2410_wdtclk; | 150 | extern struct clk *s3c2410_wdtclk; |
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index 87d501ff3328..0dc4ac4909b0 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -134,6 +134,7 @@ extern struct platform_device exynos4_device_spdif; | |||
134 | 134 | ||
135 | extern struct platform_device samsung_asoc_idma; | 135 | extern struct platform_device samsung_asoc_idma; |
136 | extern struct platform_device samsung_device_keypad; | 136 | extern struct platform_device samsung_device_keypad; |
137 | extern struct platform_device samsung_device_pwm; | ||
137 | 138 | ||
138 | /* s3c2440 specific devices */ | 139 | /* s3c2440 specific devices */ |
139 | 140 | ||
diff --git a/arch/arm/plat-samsung/include/plat/irq-vic-timer.h b/arch/arm/plat-samsung/include/plat/irq-vic-timer.h deleted file mode 100644 index 5b9c42fd32d7..000000000000 --- a/arch/arm/plat-samsung/include/plat/irq-vic-timer.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/irq-vic-timer.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for Samsung SoC IRQ VIC timer | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | extern void s3c_init_vic_timer_irq(unsigned int num, unsigned int timer_irq); | ||
diff --git a/arch/arm/plat-samsung/include/plat/irqs.h b/arch/arm/plat-samsung/include/plat/irqs.h index df46b776976a..039001c0ef05 100644 --- a/arch/arm/plat-samsung/include/plat/irqs.h +++ b/arch/arm/plat-samsung/include/plat/irqs.h | |||
@@ -44,15 +44,6 @@ | |||
44 | #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x)) | 44 | #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x)) |
45 | #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x)) | 45 | #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x)) |
46 | 46 | ||
47 | #define S5P_TIMER_IRQ(x) (IRQ_TIMER_BASE + (x)) | ||
48 | |||
49 | #define IRQ_TIMER0 S5P_TIMER_IRQ(0) | ||
50 | #define IRQ_TIMER1 S5P_TIMER_IRQ(1) | ||
51 | #define IRQ_TIMER2 S5P_TIMER_IRQ(2) | ||
52 | #define IRQ_TIMER3 S5P_TIMER_IRQ(3) | ||
53 | #define IRQ_TIMER4 S5P_TIMER_IRQ(4) | ||
54 | #define IRQ_TIMER_COUNT (5) | ||
55 | |||
56 | #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \ | 47 | #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \ |
57 | : ((x) - 16 + S5P_EINT_BASE2)) | 48 | : ((x) - 16 + S5P_EINT_BASE2)) |
58 | 49 | ||
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h index 5d47ca35cabd..6bc1a8f471e3 100644 --- a/arch/arm/plat-samsung/include/plat/pm.h +++ b/arch/arm/plat-samsung/include/plat/pm.h | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | struct device; | 20 | struct device; |
21 | 21 | ||
22 | #ifdef CONFIG_PM | 22 | #ifdef CONFIG_SAMSUNG_PM |
23 | 23 | ||
24 | extern __init int s3c_pm_init(void); | 24 | extern __init int s3c_pm_init(void); |
25 | extern __init int s3c64xx_pm_init(void); | 25 | extern __init int s3c64xx_pm_init(void); |
@@ -58,8 +58,6 @@ extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */ | |||
58 | 58 | ||
59 | /* from sleep.S */ | 59 | /* from sleep.S */ |
60 | 60 | ||
61 | extern void s3c_cpu_resume(void); | ||
62 | |||
63 | extern int s3c2410_cpu_suspend(unsigned long); | 61 | extern int s3c2410_cpu_suspend(unsigned long); |
64 | 62 | ||
65 | /* sleep save info */ | 63 | /* sleep save info */ |
@@ -106,12 +104,14 @@ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); | |||
106 | extern void s3c_pm_do_restore(struct sleep_save *ptr, int count); | 104 | extern void s3c_pm_do_restore(struct sleep_save *ptr, int count); |
107 | extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); | 105 | extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); |
108 | 106 | ||
109 | #ifdef CONFIG_PM | 107 | #ifdef CONFIG_SAMSUNG_PM |
110 | extern int s3c_irq_wake(struct irq_data *data, unsigned int state); | 108 | extern int s3c_irq_wake(struct irq_data *data, unsigned int state); |
111 | extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); | 109 | extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); |
110 | extern void s3c_cpu_resume(void); | ||
112 | #else | 111 | #else |
113 | #define s3c_irq_wake NULL | 112 | #define s3c_irq_wake NULL |
114 | #define s3c_irqext_wake NULL | 113 | #define s3c_irqext_wake NULL |
114 | #define s3c_cpu_resume NULL | ||
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | /* PM debug functions */ | 117 | /* PM debug functions */ |
diff --git a/arch/arm/plat-samsung/include/plat/pwm-clock.h b/arch/arm/plat-samsung/include/plat/pwm-clock.h deleted file mode 100644 index bf6a60eb6237..000000000000 --- a/arch/arm/plat-samsung/include/plat/pwm-clock.h +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | /* linux/arch/arm/plat-samsung/include/plat/pwm-clock.h | ||
2 | * | ||
3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | ||
5 | * | ||
6 | * Copyright 2008 Openmoko, Inc. | ||
7 | * Copyright 2008 Simtec Electronics | ||
8 | * Ben Dooks <ben@simtec.co.uk> | ||
9 | * http://armlinux.simtec.co.uk/ | ||
10 | * | ||
11 | * SAMSUNG - pwm clock and timer support | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_PLAT_PWM_CLOCK_H | ||
19 | #define __ASM_PLAT_PWM_CLOCK_H __FILE__ | ||
20 | |||
21 | /** | ||
22 | * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk | ||
23 | * @tcfg: The timer TCFG1 register bits shifted down to 0. | ||
24 | * | ||
25 | * Return true if the given configuration from TCFG1 is a TCLK instead | ||
26 | * any of the TDIV clocks. | ||
27 | */ | ||
28 | static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) | ||
29 | { | ||
30 | if (soc_is_s3c24xx()) | ||
31 | return tcfg == S3C2410_TCFG1_MUX_TCLK; | ||
32 | else if (soc_is_s3c64xx() || soc_is_s5pc100()) | ||
33 | return tcfg >= S3C64XX_TCFG1_MUX_TCLK; | ||
34 | else if (soc_is_s5p6440() || soc_is_s5p6450()) | ||
35 | return 0; | ||
36 | else | ||
37 | return tcfg == S3C64XX_TCFG1_MUX_TCLK; | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * tcfg_to_divisor() - convert tcfg1 setting to a divisor | ||
42 | * @tcfg1: The tcfg1 setting, shifted down. | ||
43 | * | ||
44 | * Get the divisor value for the given tcfg1 setting. We assume the | ||
45 | * caller has already checked to see if this is not a TCLK source. | ||
46 | */ | ||
47 | static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) | ||
48 | { | ||
49 | if (soc_is_s3c24xx()) | ||
50 | return 1 << (tcfg1 + 1); | ||
51 | else | ||
52 | return 1 << tcfg1; | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * pwm_tdiv_has_div1() - does the tdiv setting have a /1 | ||
57 | * | ||
58 | * Return true if we have a /1 in the tdiv setting. | ||
59 | */ | ||
60 | static inline unsigned int pwm_tdiv_has_div1(void) | ||
61 | { | ||
62 | if (soc_is_s3c24xx()) | ||
63 | return 0; | ||
64 | else | ||
65 | return 1; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * pwm_tdiv_div_bits() - calculate TCFG1 divisor value. | ||
70 | * @div: The divisor to calculate the bit information for. | ||
71 | * | ||
72 | * Turn a divisor into the necessary bit field for TCFG1. | ||
73 | */ | ||
74 | static inline unsigned long pwm_tdiv_div_bits(unsigned int div) | ||
75 | { | ||
76 | if (soc_is_s3c24xx()) | ||
77 | return ilog2(div) - 1; | ||
78 | else | ||
79 | return ilog2(div); | ||
80 | } | ||
81 | #endif /* __ASM_PLAT_PWM_CLOCK_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/pwm-core.h b/arch/arm/plat-samsung/include/plat/pwm-core.h new file mode 100644 index 000000000000..5bff1facb672 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/pwm-core.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright 2013 Tomasz Figa <tomasz.figa@gmail.com> | ||
3 | * | ||
4 | * Samsung PWM controller platform data helpers. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_PWM_CORE_H | ||
12 | #define __ASM_ARCH_PWM_CORE_H __FILE__ | ||
13 | |||
14 | #include <clocksource/samsung_pwm.h> | ||
15 | |||
16 | #ifdef CONFIG_SAMSUNG_DEV_PWM | ||
17 | extern void samsung_pwm_set_platdata(struct samsung_pwm_variant *pd); | ||
18 | #else | ||
19 | static inline void samsung_pwm_set_platdata(struct samsung_pwm_variant *pd) { } | ||
20 | #endif | ||
21 | |||
22 | #endif /* __ASM_ARCH_PWM_CORE_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/regs-timer.h b/arch/arm/plat-samsung/include/plat/regs-timer.h deleted file mode 100644 index d097d92f8cc7..000000000000 --- a/arch/arm/plat-samsung/include/plat/regs-timer.h +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* arch/arm/mach-s3c2410/include/mach/regs-timer.h | ||
2 | * | ||
3 | * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> | ||
4 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * S3C2410 Timer configuration | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_REGS_TIMER_H | ||
14 | #define __ASM_ARCH_REGS_TIMER_H | ||
15 | |||
16 | #define S3C_TIMERREG(x) (S3C_VA_TIMER + (x)) | ||
17 | #define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c)) | ||
18 | |||
19 | #define S3C2410_TCFG0 S3C_TIMERREG(0x00) | ||
20 | #define S3C2410_TCFG1 S3C_TIMERREG(0x04) | ||
21 | #define S3C2410_TCON S3C_TIMERREG(0x08) | ||
22 | |||
23 | #define S3C64XX_TINT_CSTAT S3C_TIMERREG(0x44) | ||
24 | |||
25 | #define S3C2410_TCFG_PRESCALER0_MASK (255<<0) | ||
26 | #define S3C2410_TCFG_PRESCALER1_MASK (255<<8) | ||
27 | #define S3C2410_TCFG_PRESCALER1_SHIFT (8) | ||
28 | #define S3C2410_TCFG_DEADZONE_MASK (255<<16) | ||
29 | #define S3C2410_TCFG_DEADZONE_SHIFT (16) | ||
30 | |||
31 | #define S3C2410_TCFG1_MUX4_DIV2 (0<<16) | ||
32 | #define S3C2410_TCFG1_MUX4_DIV4 (1<<16) | ||
33 | #define S3C2410_TCFG1_MUX4_DIV8 (2<<16) | ||
34 | #define S3C2410_TCFG1_MUX4_DIV16 (3<<16) | ||
35 | #define S3C2410_TCFG1_MUX4_TCLK1 (4<<16) | ||
36 | #define S3C2410_TCFG1_MUX4_MASK (15<<16) | ||
37 | #define S3C2410_TCFG1_MUX4_SHIFT (16) | ||
38 | |||
39 | #define S3C2410_TCFG1_MUX3_DIV2 (0<<12) | ||
40 | #define S3C2410_TCFG1_MUX3_DIV4 (1<<12) | ||
41 | #define S3C2410_TCFG1_MUX3_DIV8 (2<<12) | ||
42 | #define S3C2410_TCFG1_MUX3_DIV16 (3<<12) | ||
43 | #define S3C2410_TCFG1_MUX3_TCLK1 (4<<12) | ||
44 | #define S3C2410_TCFG1_MUX3_MASK (15<<12) | ||
45 | |||
46 | |||
47 | #define S3C2410_TCFG1_MUX2_DIV2 (0<<8) | ||
48 | #define S3C2410_TCFG1_MUX2_DIV4 (1<<8) | ||
49 | #define S3C2410_TCFG1_MUX2_DIV8 (2<<8) | ||
50 | #define S3C2410_TCFG1_MUX2_DIV16 (3<<8) | ||
51 | #define S3C2410_TCFG1_MUX2_TCLK1 (4<<8) | ||
52 | #define S3C2410_TCFG1_MUX2_MASK (15<<8) | ||
53 | |||
54 | |||
55 | #define S3C2410_TCFG1_MUX1_DIV2 (0<<4) | ||
56 | #define S3C2410_TCFG1_MUX1_DIV4 (1<<4) | ||
57 | #define S3C2410_TCFG1_MUX1_DIV8 (2<<4) | ||
58 | #define S3C2410_TCFG1_MUX1_DIV16 (3<<4) | ||
59 | #define S3C2410_TCFG1_MUX1_TCLK0 (4<<4) | ||
60 | #define S3C2410_TCFG1_MUX1_MASK (15<<4) | ||
61 | |||
62 | #define S3C2410_TCFG1_MUX0_DIV2 (0<<0) | ||
63 | #define S3C2410_TCFG1_MUX0_DIV4 (1<<0) | ||
64 | #define S3C2410_TCFG1_MUX0_DIV8 (2<<0) | ||
65 | #define S3C2410_TCFG1_MUX0_DIV16 (3<<0) | ||
66 | #define S3C2410_TCFG1_MUX0_TCLK0 (4<<0) | ||
67 | #define S3C2410_TCFG1_MUX0_MASK (15<<0) | ||
68 | |||
69 | #define S3C2410_TCFG1_MUX_DIV2 (0<<0) | ||
70 | #define S3C2410_TCFG1_MUX_DIV4 (1<<0) | ||
71 | #define S3C2410_TCFG1_MUX_DIV8 (2<<0) | ||
72 | #define S3C2410_TCFG1_MUX_DIV16 (3<<0) | ||
73 | #define S3C2410_TCFG1_MUX_TCLK (4<<0) | ||
74 | #define S3C2410_TCFG1_MUX_MASK (15<<0) | ||
75 | |||
76 | #define S3C64XX_TCFG1_MUX_DIV1 (0<<0) | ||
77 | #define S3C64XX_TCFG1_MUX_DIV2 (1<<0) | ||
78 | #define S3C64XX_TCFG1_MUX_DIV4 (2<<0) | ||
79 | #define S3C64XX_TCFG1_MUX_DIV8 (3<<0) | ||
80 | #define S3C64XX_TCFG1_MUX_DIV16 (4<<0) | ||
81 | #define S3C64XX_TCFG1_MUX_TCLK (5<<0) /* 3 sets of TCLK */ | ||
82 | #define S3C64XX_TCFG1_MUX_MASK (15<<0) | ||
83 | |||
84 | #define S3C2410_TCFG1_SHIFT(x) ((x) * 4) | ||
85 | |||
86 | /* for each timer, we have an count buffer, an compare buffer and | ||
87 | * an observation buffer | ||
88 | */ | ||
89 | |||
90 | /* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */ | ||
91 | |||
92 | #define S3C2410_TCNTB(tmr) S3C_TIMERREG2(tmr, 0x00) | ||
93 | #define S3C2410_TCMPB(tmr) S3C_TIMERREG2(tmr, 0x04) | ||
94 | #define S3C2410_TCNTO(tmr) S3C_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08)) | ||
95 | |||
96 | #define S3C2410_TCON_T4RELOAD (1<<22) | ||
97 | #define S3C2410_TCON_T4MANUALUPD (1<<21) | ||
98 | #define S3C2410_TCON_T4START (1<<20) | ||
99 | |||
100 | #define S3C2410_TCON_T3RELOAD (1<<19) | ||
101 | #define S3C2410_TCON_T3INVERT (1<<18) | ||
102 | #define S3C2410_TCON_T3MANUALUPD (1<<17) | ||
103 | #define S3C2410_TCON_T3START (1<<16) | ||
104 | |||
105 | #define S3C2410_TCON_T2RELOAD (1<<15) | ||
106 | #define S3C2410_TCON_T2INVERT (1<<14) | ||
107 | #define S3C2410_TCON_T2MANUALUPD (1<<13) | ||
108 | #define S3C2410_TCON_T2START (1<<12) | ||
109 | |||
110 | #define S3C2410_TCON_T1RELOAD (1<<11) | ||
111 | #define S3C2410_TCON_T1INVERT (1<<10) | ||
112 | #define S3C2410_TCON_T1MANUALUPD (1<<9) | ||
113 | #define S3C2410_TCON_T1START (1<<8) | ||
114 | |||
115 | #define S3C2410_TCON_T0DEADZONE (1<<4) | ||
116 | #define S3C2410_TCON_T0RELOAD (1<<3) | ||
117 | #define S3C2410_TCON_T0INVERT (1<<2) | ||
118 | #define S3C2410_TCON_T0MANUALUPD (1<<1) | ||
119 | #define S3C2410_TCON_T0START (1<<0) | ||
120 | |||
121 | #endif /* __ASM_ARCH_REGS_TIMER_H */ | ||
122 | |||
123 | |||
124 | |||
diff --git a/arch/arm/plat-samsung/include/plat/samsung-time.h b/arch/arm/plat-samsung/include/plat/samsung-time.h index 4cc99bb1f176..209464adef97 100644 --- a/arch/arm/plat-samsung/include/plat/samsung-time.h +++ b/arch/arm/plat-samsung/include/plat/samsung-time.h | |||
@@ -22,29 +22,6 @@ enum samsung_timer_mode { | |||
22 | SAMSUNG_PWM4, | 22 | SAMSUNG_PWM4, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | struct samsung_timer_source { | ||
26 | unsigned int event_id; | ||
27 | unsigned int source_id; | ||
28 | }; | ||
29 | |||
30 | /* Be able to sleep for atleast 4 seconds (usually more) */ | ||
31 | #define SAMSUNG_TIMER_MIN_RANGE 4 | ||
32 | |||
33 | #if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S5PC100) | ||
34 | #define TCNT_MAX 0xffff | ||
35 | #define TSCALER_DIV 25 | ||
36 | #define TDIV 50 | ||
37 | #define TSIZE 16 | ||
38 | #else | ||
39 | #define TCNT_MAX 0xffffffff | ||
40 | #define TSCALER_DIV 2 | ||
41 | #define TDIV 2 | ||
42 | #define TSIZE 32 | ||
43 | #endif | ||
44 | |||
45 | #define NON_PERIODIC 0 | ||
46 | #define PERIODIC 1 | ||
47 | |||
48 | extern void __init samsung_set_timer_source(enum samsung_timer_mode event, | 25 | extern void __init samsung_set_timer_source(enum samsung_timer_mode event, |
49 | enum samsung_timer_mode source); | 26 | enum samsung_timer_mode source); |
50 | 27 | ||
diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c deleted file mode 100644 index 0fceb4273824..000000000000 --- a/arch/arm/plat-samsung/irq-vic-timer.c +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* arch/arm/plat-samsung/irq-vic-timer.c | ||
2 | * originally part of arch/arm/plat-s3c64xx/irq.c | ||
3 | * | ||
4 | * Copyright 2008 Openmoko, Inc. | ||
5 | * Copyright 2008 Simtec Electronics | ||
6 | * Ben Dooks <ben@simtec.co.uk> | ||
7 | * http://armlinux.simtec.co.uk/ | ||
8 | * | ||
9 | * S3C64XX - Interrupt handling | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/irqchip/chained_irq.h> | ||
20 | #include <linux/io.h> | ||
21 | |||
22 | #include <mach/map.h> | ||
23 | #include <mach/irqs.h> | ||
24 | #include <plat/cpu.h> | ||
25 | #include <plat/irq-vic-timer.h> | ||
26 | #include <plat/regs-timer.h> | ||
27 | |||
28 | static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) | ||
29 | { | ||
30 | struct irq_chip *chip = irq_get_chip(irq); | ||
31 | chained_irq_enter(chip, desc); | ||
32 | generic_handle_irq((int)desc->irq_data.handler_data); | ||
33 | chained_irq_exit(chip, desc); | ||
34 | } | ||
35 | |||
36 | /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ | ||
37 | static void s3c_irq_timer_ack(struct irq_data *d) | ||
38 | { | ||
39 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | ||
40 | u32 mask = (1 << 5) << (d->irq - gc->irq_base); | ||
41 | |||
42 | irq_reg_writel(mask | gc->mask_cache, gc->reg_base); | ||
43 | } | ||
44 | |||
45 | /** | ||
46 | * s3c_init_vic_timer_irq() - initialise timer irq chanined off VIC.\ | ||
47 | * @num: Number of timers to initialize | ||
48 | * @timer_irq: Base IRQ number to be used for the timers. | ||
49 | * | ||
50 | * Register the necessary IRQ chaining and support for the timer IRQs | ||
51 | * chained of the VIC. | ||
52 | */ | ||
53 | void __init s3c_init_vic_timer_irq(unsigned int num, unsigned int timer_irq) | ||
54 | { | ||
55 | unsigned int pirq[5] = { IRQ_TIMER0_VIC, IRQ_TIMER1_VIC, IRQ_TIMER2_VIC, | ||
56 | IRQ_TIMER3_VIC, IRQ_TIMER4_VIC }; | ||
57 | struct irq_chip_generic *s3c_tgc; | ||
58 | struct irq_chip_type *ct; | ||
59 | unsigned int i; | ||
60 | |||
61 | #ifdef CONFIG_ARCH_EXYNOS | ||
62 | if (soc_is_exynos5250()) { | ||
63 | pirq[0] = EXYNOS5_IRQ_TIMER0_VIC; | ||
64 | pirq[1] = EXYNOS5_IRQ_TIMER1_VIC; | ||
65 | pirq[2] = EXYNOS5_IRQ_TIMER2_VIC; | ||
66 | pirq[3] = EXYNOS5_IRQ_TIMER3_VIC; | ||
67 | pirq[4] = EXYNOS5_IRQ_TIMER4_VIC; | ||
68 | } else { | ||
69 | pirq[0] = EXYNOS4_IRQ_TIMER0_VIC; | ||
70 | pirq[1] = EXYNOS4_IRQ_TIMER1_VIC; | ||
71 | pirq[2] = EXYNOS4_IRQ_TIMER2_VIC; | ||
72 | pirq[3] = EXYNOS4_IRQ_TIMER3_VIC; | ||
73 | pirq[4] = EXYNOS4_IRQ_TIMER4_VIC; | ||
74 | } | ||
75 | #endif | ||
76 | s3c_tgc = irq_alloc_generic_chip("s3c-timer", 1, timer_irq, | ||
77 | S3C64XX_TINT_CSTAT, handle_level_irq); | ||
78 | |||
79 | if (!s3c_tgc) { | ||
80 | pr_err("%s: irq_alloc_generic_chip for IRQ %d failed\n", | ||
81 | __func__, timer_irq); | ||
82 | return; | ||
83 | } | ||
84 | |||
85 | ct = s3c_tgc->chip_types; | ||
86 | ct->chip.irq_mask = irq_gc_mask_clr_bit; | ||
87 | ct->chip.irq_unmask = irq_gc_mask_set_bit; | ||
88 | ct->chip.irq_ack = s3c_irq_timer_ack; | ||
89 | irq_setup_generic_chip(s3c_tgc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, | ||
90 | IRQ_NOREQUEST | IRQ_NOPROBE, 0); | ||
91 | /* Clear the upper bits of the mask_cache*/ | ||
92 | s3c_tgc->mask_cache &= 0x1f; | ||
93 | |||
94 | for (i = 0; i < num; i++, timer_irq++) { | ||
95 | irq_set_chained_handler(pirq[i], s3c_irq_demux_vic_timer); | ||
96 | irq_set_handler_data(pirq[i], (void *)timer_irq); | ||
97 | } | ||
98 | } | ||
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index ea3613642451..d0c23010b693 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c | |||
@@ -80,7 +80,7 @@ unsigned char pm_uart_udivslot; | |||
80 | 80 | ||
81 | #ifdef CONFIG_SAMSUNG_PM_DEBUG | 81 | #ifdef CONFIG_SAMSUNG_PM_DEBUG |
82 | 82 | ||
83 | static struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS]; | 83 | static struct pm_uart_save uart_save; |
84 | 84 | ||
85 | static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save) | 85 | static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save) |
86 | { | 86 | { |
@@ -101,11 +101,7 @@ static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save) | |||
101 | 101 | ||
102 | static void s3c_pm_save_uarts(void) | 102 | static void s3c_pm_save_uarts(void) |
103 | { | 103 | { |
104 | struct pm_uart_save *save = uart_save; | 104 | s3c_pm_save_uart(CONFIG_DEBUG_S3C_UART, &uart_save); |
105 | unsigned int uart; | ||
106 | |||
107 | for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++) | ||
108 | s3c_pm_save_uart(uart, save); | ||
109 | } | 105 | } |
110 | 106 | ||
111 | static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save) | 107 | static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save) |
@@ -126,11 +122,7 @@ static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save) | |||
126 | 122 | ||
127 | static void s3c_pm_restore_uarts(void) | 123 | static void s3c_pm_restore_uarts(void) |
128 | { | 124 | { |
129 | struct pm_uart_save *save = uart_save; | 125 | s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save); |
130 | unsigned int uart; | ||
131 | |||
132 | for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++) | ||
133 | s3c_pm_restore_uart(uart, save); | ||
134 | } | 126 | } |
135 | #else | 127 | #else |
136 | static void s3c_pm_save_uarts(void) { } | 128 | static void s3c_pm_save_uarts(void) { } |
diff --git a/arch/arm/plat-samsung/pwm-clock.c b/arch/arm/plat-samsung/pwm-clock.c deleted file mode 100644 index a35ff3bcffe4..000000000000 --- a/arch/arm/plat-samsung/pwm-clock.c +++ /dev/null | |||
@@ -1,474 +0,0 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/pwm-clock.c | ||
2 | * | ||
3 | * Copyright (c) 2007 Simtec Electronics | ||
4 | * Copyright (c) 2007, 2008 Ben Dooks | ||
5 | * Ben Dooks <ben-linux@fluff.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/log2.h> | ||
18 | #include <linux/clk.h> | ||
19 | #include <linux/err.h> | ||
20 | #include <linux/io.h> | ||
21 | |||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/map.h> | ||
24 | #include <asm/irq.h> | ||
25 | |||
26 | #include <plat/clock.h> | ||
27 | #include <plat/cpu.h> | ||
28 | |||
29 | #include <plat/regs-timer.h> | ||
30 | #include <plat/pwm-clock.h> | ||
31 | |||
32 | /* Each of the timers 0 through 5 go through the following | ||
33 | * clock tree, with the inputs depending on the timers. | ||
34 | * | ||
35 | * pclk ---- [ prescaler 0 ] -+---> timer 0 | ||
36 | * +---> timer 1 | ||
37 | * | ||
38 | * pclk ---- [ prescaler 1 ] -+---> timer 2 | ||
39 | * +---> timer 3 | ||
40 | * \---> timer 4 | ||
41 | * | ||
42 | * Which are fed into the timers as so: | ||
43 | * | ||
44 | * prescaled 0 ---- [ div 2,4,8,16 ] ---\ | ||
45 | * [mux] -> timer 0 | ||
46 | * tclk 0 ------------------------------/ | ||
47 | * | ||
48 | * prescaled 0 ---- [ div 2,4,8,16 ] ---\ | ||
49 | * [mux] -> timer 1 | ||
50 | * tclk 0 ------------------------------/ | ||
51 | * | ||
52 | * | ||
53 | * prescaled 1 ---- [ div 2,4,8,16 ] ---\ | ||
54 | * [mux] -> timer 2 | ||
55 | * tclk 1 ------------------------------/ | ||
56 | * | ||
57 | * prescaled 1 ---- [ div 2,4,8,16 ] ---\ | ||
58 | * [mux] -> timer 3 | ||
59 | * tclk 1 ------------------------------/ | ||
60 | * | ||
61 | * prescaled 1 ---- [ div 2,4,8, 16 ] --\ | ||
62 | * [mux] -> timer 4 | ||
63 | * tclk 1 ------------------------------/ | ||
64 | * | ||
65 | * Since the mux and the divider are tied together in the | ||
66 | * same register space, it is impossible to set the parent | ||
67 | * and the rate at the same time. To avoid this, we add an | ||
68 | * intermediate 'prescaled-and-divided' clock to select | ||
69 | * as the parent for the timer input clock called tdiv. | ||
70 | * | ||
71 | * prescaled clk --> pwm-tdiv ---\ | ||
72 | * [ mux ] --> timer X | ||
73 | * tclk -------------------------/ | ||
74 | */ | ||
75 | |||
76 | static struct clk clk_timer_scaler[]; | ||
77 | |||
78 | static unsigned long clk_pwm_scaler_get_rate(struct clk *clk) | ||
79 | { | ||
80 | unsigned long tcfg0 = __raw_readl(S3C2410_TCFG0); | ||
81 | |||
82 | if (clk == &clk_timer_scaler[1]) { | ||
83 | tcfg0 &= S3C2410_TCFG_PRESCALER1_MASK; | ||
84 | tcfg0 >>= S3C2410_TCFG_PRESCALER1_SHIFT; | ||
85 | } else { | ||
86 | tcfg0 &= S3C2410_TCFG_PRESCALER0_MASK; | ||
87 | } | ||
88 | |||
89 | return clk_get_rate(clk->parent) / (tcfg0 + 1); | ||
90 | } | ||
91 | |||
92 | static unsigned long clk_pwm_scaler_round_rate(struct clk *clk, | ||
93 | unsigned long rate) | ||
94 | { | ||
95 | unsigned long parent_rate = clk_get_rate(clk->parent); | ||
96 | unsigned long divisor = parent_rate / rate; | ||
97 | |||
98 | if (divisor > 256) | ||
99 | divisor = 256; | ||
100 | else if (divisor < 2) | ||
101 | divisor = 2; | ||
102 | |||
103 | return parent_rate / divisor; | ||
104 | } | ||
105 | |||
106 | static int clk_pwm_scaler_set_rate(struct clk *clk, unsigned long rate) | ||
107 | { | ||
108 | unsigned long round = clk_pwm_scaler_round_rate(clk, rate); | ||
109 | unsigned long tcfg0; | ||
110 | unsigned long divisor; | ||
111 | unsigned long flags; | ||
112 | |||
113 | divisor = clk_get_rate(clk->parent) / round; | ||
114 | divisor--; | ||
115 | |||
116 | local_irq_save(flags); | ||
117 | tcfg0 = __raw_readl(S3C2410_TCFG0); | ||
118 | |||
119 | if (clk == &clk_timer_scaler[1]) { | ||
120 | tcfg0 &= ~S3C2410_TCFG_PRESCALER1_MASK; | ||
121 | tcfg0 |= divisor << S3C2410_TCFG_PRESCALER1_SHIFT; | ||
122 | } else { | ||
123 | tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK; | ||
124 | tcfg0 |= divisor; | ||
125 | } | ||
126 | |||
127 | __raw_writel(tcfg0, S3C2410_TCFG0); | ||
128 | local_irq_restore(flags); | ||
129 | |||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | static struct clk_ops clk_pwm_scaler_ops = { | ||
134 | .get_rate = clk_pwm_scaler_get_rate, | ||
135 | .set_rate = clk_pwm_scaler_set_rate, | ||
136 | .round_rate = clk_pwm_scaler_round_rate, | ||
137 | }; | ||
138 | |||
139 | static struct clk clk_timer_scaler[] = { | ||
140 | [0] = { | ||
141 | .name = "pwm-scaler0", | ||
142 | .id = -1, | ||
143 | .ops = &clk_pwm_scaler_ops, | ||
144 | }, | ||
145 | [1] = { | ||
146 | .name = "pwm-scaler1", | ||
147 | .id = -1, | ||
148 | .ops = &clk_pwm_scaler_ops, | ||
149 | }, | ||
150 | }; | ||
151 | |||
152 | static struct clk clk_timer_tclk[] = { | ||
153 | [0] = { | ||
154 | .name = "pwm-tclk0", | ||
155 | .id = -1, | ||
156 | }, | ||
157 | [1] = { | ||
158 | .name = "pwm-tclk1", | ||
159 | .id = -1, | ||
160 | }, | ||
161 | }; | ||
162 | |||
163 | struct pwm_tdiv_clk { | ||
164 | struct clk clk; | ||
165 | unsigned int divisor; | ||
166 | }; | ||
167 | |||
168 | static inline struct pwm_tdiv_clk *to_tdiv(struct clk *clk) | ||
169 | { | ||
170 | return container_of(clk, struct pwm_tdiv_clk, clk); | ||
171 | } | ||
172 | |||
173 | static unsigned long clk_pwm_tdiv_get_rate(struct clk *clk) | ||
174 | { | ||
175 | unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
176 | unsigned int divisor; | ||
177 | |||
178 | tcfg1 >>= S3C2410_TCFG1_SHIFT(clk->id); | ||
179 | tcfg1 &= S3C2410_TCFG1_MUX_MASK; | ||
180 | |||
181 | if (pwm_cfg_src_is_tclk(tcfg1)) | ||
182 | divisor = to_tdiv(clk)->divisor; | ||
183 | else | ||
184 | divisor = tcfg_to_divisor(tcfg1); | ||
185 | |||
186 | return clk_get_rate(clk->parent) / divisor; | ||
187 | } | ||
188 | |||
189 | static unsigned long clk_pwm_tdiv_round_rate(struct clk *clk, | ||
190 | unsigned long rate) | ||
191 | { | ||
192 | unsigned long parent_rate; | ||
193 | unsigned long divisor; | ||
194 | |||
195 | parent_rate = clk_get_rate(clk->parent); | ||
196 | divisor = parent_rate / rate; | ||
197 | |||
198 | if (divisor <= 1 && pwm_tdiv_has_div1()) | ||
199 | divisor = 1; | ||
200 | else if (divisor <= 2) | ||
201 | divisor = 2; | ||
202 | else if (divisor <= 4) | ||
203 | divisor = 4; | ||
204 | else if (divisor <= 8) | ||
205 | divisor = 8; | ||
206 | else | ||
207 | divisor = 16; | ||
208 | |||
209 | return parent_rate / divisor; | ||
210 | } | ||
211 | |||
212 | static unsigned long clk_pwm_tdiv_bits(struct pwm_tdiv_clk *divclk) | ||
213 | { | ||
214 | return pwm_tdiv_div_bits(divclk->divisor); | ||
215 | } | ||
216 | |||
217 | static void clk_pwm_tdiv_update(struct pwm_tdiv_clk *divclk) | ||
218 | { | ||
219 | unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
220 | unsigned long bits = clk_pwm_tdiv_bits(divclk); | ||
221 | unsigned long flags; | ||
222 | unsigned long shift = S3C2410_TCFG1_SHIFT(divclk->clk.id); | ||
223 | |||
224 | local_irq_save(flags); | ||
225 | |||
226 | tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
227 | tcfg1 &= ~(S3C2410_TCFG1_MUX_MASK << shift); | ||
228 | tcfg1 |= bits << shift; | ||
229 | __raw_writel(tcfg1, S3C2410_TCFG1); | ||
230 | |||
231 | local_irq_restore(flags); | ||
232 | } | ||
233 | |||
234 | static int clk_pwm_tdiv_set_rate(struct clk *clk, unsigned long rate) | ||
235 | { | ||
236 | struct pwm_tdiv_clk *divclk = to_tdiv(clk); | ||
237 | unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
238 | unsigned long parent_rate = clk_get_rate(clk->parent); | ||
239 | unsigned long divisor; | ||
240 | |||
241 | tcfg1 >>= S3C2410_TCFG1_SHIFT(clk->id); | ||
242 | tcfg1 &= S3C2410_TCFG1_MUX_MASK; | ||
243 | |||
244 | rate = clk_round_rate(clk, rate); | ||
245 | divisor = parent_rate / rate; | ||
246 | |||
247 | if (divisor > 16) | ||
248 | return -EINVAL; | ||
249 | |||
250 | divclk->divisor = divisor; | ||
251 | |||
252 | /* Update the current MUX settings if we are currently | ||
253 | * selected as the clock source for this clock. */ | ||
254 | |||
255 | if (!pwm_cfg_src_is_tclk(tcfg1)) | ||
256 | clk_pwm_tdiv_update(divclk); | ||
257 | |||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static struct clk_ops clk_tdiv_ops = { | ||
262 | .get_rate = clk_pwm_tdiv_get_rate, | ||
263 | .set_rate = clk_pwm_tdiv_set_rate, | ||
264 | .round_rate = clk_pwm_tdiv_round_rate, | ||
265 | }; | ||
266 | |||
267 | static struct pwm_tdiv_clk clk_timer_tdiv[] = { | ||
268 | [0] = { | ||
269 | .clk = { | ||
270 | .name = "pwm-tdiv", | ||
271 | .devname = "s3c24xx-pwm.0", | ||
272 | .ops = &clk_tdiv_ops, | ||
273 | .parent = &clk_timer_scaler[0], | ||
274 | }, | ||
275 | }, | ||
276 | [1] = { | ||
277 | .clk = { | ||
278 | .name = "pwm-tdiv", | ||
279 | .devname = "s3c24xx-pwm.1", | ||
280 | .ops = &clk_tdiv_ops, | ||
281 | .parent = &clk_timer_scaler[0], | ||
282 | } | ||
283 | }, | ||
284 | [2] = { | ||
285 | .clk = { | ||
286 | .name = "pwm-tdiv", | ||
287 | .devname = "s3c24xx-pwm.2", | ||
288 | .ops = &clk_tdiv_ops, | ||
289 | .parent = &clk_timer_scaler[1], | ||
290 | }, | ||
291 | }, | ||
292 | [3] = { | ||
293 | .clk = { | ||
294 | .name = "pwm-tdiv", | ||
295 | .devname = "s3c24xx-pwm.3", | ||
296 | .ops = &clk_tdiv_ops, | ||
297 | .parent = &clk_timer_scaler[1], | ||
298 | }, | ||
299 | }, | ||
300 | [4] = { | ||
301 | .clk = { | ||
302 | .name = "pwm-tdiv", | ||
303 | .devname = "s3c24xx-pwm.4", | ||
304 | .ops = &clk_tdiv_ops, | ||
305 | .parent = &clk_timer_scaler[1], | ||
306 | }, | ||
307 | }, | ||
308 | }; | ||
309 | |||
310 | static int __init clk_pwm_tdiv_register(unsigned int id) | ||
311 | { | ||
312 | struct pwm_tdiv_clk *divclk = &clk_timer_tdiv[id]; | ||
313 | unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
314 | |||
315 | tcfg1 >>= S3C2410_TCFG1_SHIFT(id); | ||
316 | tcfg1 &= S3C2410_TCFG1_MUX_MASK; | ||
317 | |||
318 | divclk->clk.id = id; | ||
319 | divclk->divisor = tcfg_to_divisor(tcfg1); | ||
320 | |||
321 | return s3c24xx_register_clock(&divclk->clk); | ||
322 | } | ||
323 | |||
324 | static inline struct clk *s3c24xx_pwmclk_tclk(unsigned int id) | ||
325 | { | ||
326 | return (id >= 2) ? &clk_timer_tclk[1] : &clk_timer_tclk[0]; | ||
327 | } | ||
328 | |||
329 | static inline struct clk *s3c24xx_pwmclk_tdiv(unsigned int id) | ||
330 | { | ||
331 | return &clk_timer_tdiv[id].clk; | ||
332 | } | ||
333 | |||
334 | static int clk_pwm_tin_set_parent(struct clk *clk, struct clk *parent) | ||
335 | { | ||
336 | unsigned int id = clk->id; | ||
337 | unsigned long tcfg1; | ||
338 | unsigned long flags; | ||
339 | unsigned long bits; | ||
340 | unsigned long shift = S3C2410_TCFG1_SHIFT(id); | ||
341 | |||
342 | unsigned long mux_tclk; | ||
343 | |||
344 | if (soc_is_s3c24xx()) | ||
345 | mux_tclk = S3C2410_TCFG1_MUX_TCLK; | ||
346 | else if (soc_is_s5p6440() || soc_is_s5p6450()) | ||
347 | mux_tclk = 0; | ||
348 | else | ||
349 | mux_tclk = S3C64XX_TCFG1_MUX_TCLK; | ||
350 | |||
351 | if (parent == s3c24xx_pwmclk_tclk(id)) | ||
352 | bits = mux_tclk << shift; | ||
353 | else if (parent == s3c24xx_pwmclk_tdiv(id)) | ||
354 | bits = clk_pwm_tdiv_bits(to_tdiv(parent)) << shift; | ||
355 | else | ||
356 | return -EINVAL; | ||
357 | |||
358 | clk->parent = parent; | ||
359 | |||
360 | local_irq_save(flags); | ||
361 | |||
362 | tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
363 | tcfg1 &= ~(S3C2410_TCFG1_MUX_MASK << shift); | ||
364 | __raw_writel(tcfg1 | bits, S3C2410_TCFG1); | ||
365 | |||
366 | local_irq_restore(flags); | ||
367 | |||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | static struct clk_ops clk_tin_ops = { | ||
372 | .set_parent = clk_pwm_tin_set_parent, | ||
373 | }; | ||
374 | |||
375 | static struct clk clk_tin[] = { | ||
376 | [0] = { | ||
377 | .name = "pwm-tin", | ||
378 | .devname = "s3c24xx-pwm.0", | ||
379 | .id = 0, | ||
380 | .ops = &clk_tin_ops, | ||
381 | }, | ||
382 | [1] = { | ||
383 | .name = "pwm-tin", | ||
384 | .devname = "s3c24xx-pwm.1", | ||
385 | .id = 1, | ||
386 | .ops = &clk_tin_ops, | ||
387 | }, | ||
388 | [2] = { | ||
389 | .name = "pwm-tin", | ||
390 | .devname = "s3c24xx-pwm.2", | ||
391 | .id = 2, | ||
392 | .ops = &clk_tin_ops, | ||
393 | }, | ||
394 | [3] = { | ||
395 | .name = "pwm-tin", | ||
396 | .devname = "s3c24xx-pwm.3", | ||
397 | .id = 3, | ||
398 | .ops = &clk_tin_ops, | ||
399 | }, | ||
400 | [4] = { | ||
401 | .name = "pwm-tin", | ||
402 | .devname = "s3c24xx-pwm.4", | ||
403 | .id = 4, | ||
404 | .ops = &clk_tin_ops, | ||
405 | }, | ||
406 | }; | ||
407 | |||
408 | static __init int clk_pwm_tin_register(struct clk *pwm) | ||
409 | { | ||
410 | unsigned long tcfg1 = __raw_readl(S3C2410_TCFG1); | ||
411 | unsigned int id = pwm->id; | ||
412 | |||
413 | struct clk *parent; | ||
414 | int ret; | ||
415 | |||
416 | ret = s3c24xx_register_clock(pwm); | ||
417 | if (ret < 0) | ||
418 | return ret; | ||
419 | |||
420 | tcfg1 >>= S3C2410_TCFG1_SHIFT(id); | ||
421 | tcfg1 &= S3C2410_TCFG1_MUX_MASK; | ||
422 | |||
423 | if (pwm_cfg_src_is_tclk(tcfg1)) | ||
424 | parent = s3c24xx_pwmclk_tclk(id); | ||
425 | else | ||
426 | parent = s3c24xx_pwmclk_tdiv(id); | ||
427 | |||
428 | return clk_set_parent(pwm, parent); | ||
429 | } | ||
430 | |||
431 | /** | ||
432 | * s3c_pwmclk_init() - initialise pwm clocks | ||
433 | * | ||
434 | * Initialise and register the clocks which provide the inputs for the | ||
435 | * pwm timer blocks. | ||
436 | * | ||
437 | * Note, this call is required by the time core, so must be called after | ||
438 | * the base clocks are added and before any of the initcalls are run. | ||
439 | */ | ||
440 | __init void s3c_pwmclk_init(void) | ||
441 | { | ||
442 | struct clk *clk_timers; | ||
443 | unsigned int clk; | ||
444 | int ret; | ||
445 | |||
446 | clk_timers = clk_get(NULL, "timers"); | ||
447 | if (IS_ERR(clk_timers)) { | ||
448 | printk(KERN_ERR "%s: no parent clock\n", __func__); | ||
449 | return; | ||
450 | } | ||
451 | |||
452 | for (clk = 0; clk < ARRAY_SIZE(clk_timer_scaler); clk++) | ||
453 | clk_timer_scaler[clk].parent = clk_timers; | ||
454 | |||
455 | s3c_register_clocks(clk_timer_scaler, ARRAY_SIZE(clk_timer_scaler)); | ||
456 | s3c_register_clocks(clk_timer_tclk, ARRAY_SIZE(clk_timer_tclk)); | ||
457 | |||
458 | for (clk = 0; clk < ARRAY_SIZE(clk_timer_tdiv); clk++) { | ||
459 | ret = clk_pwm_tdiv_register(clk); | ||
460 | |||
461 | if (ret < 0) { | ||
462 | printk(KERN_ERR "error adding pwm%d tdiv clock\n", clk); | ||
463 | return; | ||
464 | } | ||
465 | } | ||
466 | |||
467 | for (clk = 0; clk < ARRAY_SIZE(clk_tin); clk++) { | ||
468 | ret = clk_pwm_tin_register(&clk_tin[clk]); | ||
469 | if (ret < 0) { | ||
470 | printk(KERN_ERR "error adding pwm%d tin clock\n", clk); | ||
471 | return; | ||
472 | } | ||
473 | } | ||
474 | } | ||
diff --git a/arch/arm/plat-samsung/s5p-irq.c b/arch/arm/plat-samsung/s5p-irq.c index ff1a76011b1e..ddfaca9c79d8 100644 --- a/arch/arm/plat-samsung/s5p-irq.c +++ b/arch/arm/plat-samsung/s5p-irq.c | |||
@@ -17,9 +17,7 @@ | |||
17 | 17 | ||
18 | #include <mach/irqs.h> | 18 | #include <mach/irqs.h> |
19 | #include <mach/map.h> | 19 | #include <mach/map.h> |
20 | #include <plat/regs-timer.h> | ||
21 | #include <plat/cpu.h> | 20 | #include <plat/cpu.h> |
22 | #include <plat/irq-vic-timer.h> | ||
23 | 21 | ||
24 | void __init s5p_init_irq(u32 *vic, u32 num_vic) | 22 | void __init s5p_init_irq(u32 *vic, u32 num_vic) |
25 | { | 23 | { |
@@ -30,6 +28,4 @@ void __init s5p_init_irq(u32 *vic, u32 num_vic) | |||
30 | for (irq = 0; irq < num_vic; irq++) | 28 | for (irq = 0; irq < num_vic; irq++) |
31 | vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); | 29 | vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); |
32 | #endif | 30 | #endif |
33 | |||
34 | s3c_init_vic_timer_irq(5, IRQ_TIMER0); | ||
35 | } | 31 | } |
diff --git a/arch/arm/plat-samsung/samsung-time.c b/arch/arm/plat-samsung/samsung-time.c deleted file mode 100644 index 2957075ca836..000000000000 --- a/arch/arm/plat-samsung/samsung-time.c +++ /dev/null | |||
@@ -1,394 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.com/ | ||
4 | * | ||
5 | * samsung - Common hr-timer support (s3c and s5p) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/interrupt.h> | ||
13 | #include <linux/irq.h> | ||
14 | #include <linux/err.h> | ||
15 | #include <linux/clk.h> | ||
16 | #include <linux/clockchips.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/sched_clock.h> | ||
19 | |||
20 | #include <asm/smp_twd.h> | ||
21 | #include <asm/mach/time.h> | ||
22 | #include <asm/mach/arch.h> | ||
23 | #include <asm/mach/map.h> | ||
24 | |||
25 | #include <mach/map.h> | ||
26 | #include <plat/devs.h> | ||
27 | #include <plat/regs-timer.h> | ||
28 | #include <plat/samsung-time.h> | ||
29 | |||
30 | static struct clk *tin_event; | ||
31 | static struct clk *tin_source; | ||
32 | static struct clk *tdiv_event; | ||
33 | static struct clk *tdiv_source; | ||
34 | static struct clk *timerclk; | ||
35 | static struct samsung_timer_source timer_source; | ||
36 | static unsigned long clock_count_per_tick; | ||
37 | static void samsung_timer_resume(void); | ||
38 | |||
39 | static void samsung_time_stop(enum samsung_timer_mode mode) | ||
40 | { | ||
41 | unsigned long tcon; | ||
42 | |||
43 | tcon = __raw_readl(S3C2410_TCON); | ||
44 | |||
45 | switch (mode) { | ||
46 | case SAMSUNG_PWM0: | ||
47 | tcon &= ~S3C2410_TCON_T0START; | ||
48 | break; | ||
49 | |||
50 | case SAMSUNG_PWM1: | ||
51 | tcon &= ~S3C2410_TCON_T1START; | ||
52 | break; | ||
53 | |||
54 | case SAMSUNG_PWM2: | ||
55 | tcon &= ~S3C2410_TCON_T2START; | ||
56 | break; | ||
57 | |||
58 | case SAMSUNG_PWM3: | ||
59 | tcon &= ~S3C2410_TCON_T3START; | ||
60 | break; | ||
61 | |||
62 | case SAMSUNG_PWM4: | ||
63 | tcon &= ~S3C2410_TCON_T4START; | ||
64 | break; | ||
65 | |||
66 | default: | ||
67 | printk(KERN_ERR "Invalid Timer %d\n", mode); | ||
68 | break; | ||
69 | } | ||
70 | __raw_writel(tcon, S3C2410_TCON); | ||
71 | } | ||
72 | |||
73 | static void samsung_time_setup(enum samsung_timer_mode mode, unsigned long tcnt) | ||
74 | { | ||
75 | unsigned long tcon; | ||
76 | |||
77 | tcon = __raw_readl(S3C2410_TCON); | ||
78 | |||
79 | tcnt--; | ||
80 | |||
81 | switch (mode) { | ||
82 | case SAMSUNG_PWM0: | ||
83 | tcon &= ~(0x0f << 0); | ||
84 | tcon |= S3C2410_TCON_T0MANUALUPD; | ||
85 | break; | ||
86 | |||
87 | case SAMSUNG_PWM1: | ||
88 | tcon &= ~(0x0f << 8); | ||
89 | tcon |= S3C2410_TCON_T1MANUALUPD; | ||
90 | break; | ||
91 | |||
92 | case SAMSUNG_PWM2: | ||
93 | tcon &= ~(0x0f << 12); | ||
94 | tcon |= S3C2410_TCON_T2MANUALUPD; | ||
95 | break; | ||
96 | |||
97 | case SAMSUNG_PWM3: | ||
98 | tcon &= ~(0x0f << 16); | ||
99 | tcon |= S3C2410_TCON_T3MANUALUPD; | ||
100 | break; | ||
101 | |||
102 | case SAMSUNG_PWM4: | ||
103 | tcon &= ~(0x07 << 20); | ||
104 | tcon |= S3C2410_TCON_T4MANUALUPD; | ||
105 | break; | ||
106 | |||
107 | default: | ||
108 | printk(KERN_ERR "Invalid Timer %d\n", mode); | ||
109 | break; | ||
110 | } | ||
111 | |||
112 | __raw_writel(tcnt, S3C2410_TCNTB(mode)); | ||
113 | __raw_writel(tcnt, S3C2410_TCMPB(mode)); | ||
114 | __raw_writel(tcon, S3C2410_TCON); | ||
115 | } | ||
116 | |||
117 | static void samsung_time_start(enum samsung_timer_mode mode, bool periodic) | ||
118 | { | ||
119 | unsigned long tcon; | ||
120 | |||
121 | tcon = __raw_readl(S3C2410_TCON); | ||
122 | |||
123 | switch (mode) { | ||
124 | case SAMSUNG_PWM0: | ||
125 | tcon |= S3C2410_TCON_T0START; | ||
126 | tcon &= ~S3C2410_TCON_T0MANUALUPD; | ||
127 | |||
128 | if (periodic) | ||
129 | tcon |= S3C2410_TCON_T0RELOAD; | ||
130 | else | ||
131 | tcon &= ~S3C2410_TCON_T0RELOAD; | ||
132 | break; | ||
133 | |||
134 | case SAMSUNG_PWM1: | ||
135 | tcon |= S3C2410_TCON_T1START; | ||
136 | tcon &= ~S3C2410_TCON_T1MANUALUPD; | ||
137 | |||
138 | if (periodic) | ||
139 | tcon |= S3C2410_TCON_T1RELOAD; | ||
140 | else | ||
141 | tcon &= ~S3C2410_TCON_T1RELOAD; | ||
142 | break; | ||
143 | |||
144 | case SAMSUNG_PWM2: | ||
145 | tcon |= S3C2410_TCON_T2START; | ||
146 | tcon &= ~S3C2410_TCON_T2MANUALUPD; | ||
147 | |||
148 | if (periodic) | ||
149 | tcon |= S3C2410_TCON_T2RELOAD; | ||
150 | else | ||
151 | tcon &= ~S3C2410_TCON_T2RELOAD; | ||
152 | break; | ||
153 | |||
154 | case SAMSUNG_PWM3: | ||
155 | tcon |= S3C2410_TCON_T3START; | ||
156 | tcon &= ~S3C2410_TCON_T3MANUALUPD; | ||
157 | |||
158 | if (periodic) | ||
159 | tcon |= S3C2410_TCON_T3RELOAD; | ||
160 | else | ||
161 | tcon &= ~S3C2410_TCON_T3RELOAD; | ||
162 | break; | ||
163 | |||
164 | case SAMSUNG_PWM4: | ||
165 | tcon |= S3C2410_TCON_T4START; | ||
166 | tcon &= ~S3C2410_TCON_T4MANUALUPD; | ||
167 | |||
168 | if (periodic) | ||
169 | tcon |= S3C2410_TCON_T4RELOAD; | ||
170 | else | ||
171 | tcon &= ~S3C2410_TCON_T4RELOAD; | ||
172 | break; | ||
173 | |||
174 | default: | ||
175 | printk(KERN_ERR "Invalid Timer %d\n", mode); | ||
176 | break; | ||
177 | } | ||
178 | __raw_writel(tcon, S3C2410_TCON); | ||
179 | } | ||
180 | |||
181 | static int samsung_set_next_event(unsigned long cycles, | ||
182 | struct clock_event_device *evt) | ||
183 | { | ||
184 | samsung_time_setup(timer_source.event_id, cycles); | ||
185 | samsung_time_start(timer_source.event_id, NON_PERIODIC); | ||
186 | |||
187 | return 0; | ||
188 | } | ||
189 | |||
190 | static void samsung_set_mode(enum clock_event_mode mode, | ||
191 | struct clock_event_device *evt) | ||
192 | { | ||
193 | samsung_time_stop(timer_source.event_id); | ||
194 | |||
195 | switch (mode) { | ||
196 | case CLOCK_EVT_MODE_PERIODIC: | ||
197 | samsung_time_setup(timer_source.event_id, clock_count_per_tick); | ||
198 | samsung_time_start(timer_source.event_id, PERIODIC); | ||
199 | break; | ||
200 | |||
201 | case CLOCK_EVT_MODE_ONESHOT: | ||
202 | break; | ||
203 | |||
204 | case CLOCK_EVT_MODE_UNUSED: | ||
205 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
206 | break; | ||
207 | |||
208 | case CLOCK_EVT_MODE_RESUME: | ||
209 | samsung_timer_resume(); | ||
210 | break; | ||
211 | } | ||
212 | } | ||
213 | |||
214 | static void samsung_timer_resume(void) | ||
215 | { | ||
216 | /* event timer restart */ | ||
217 | samsung_time_setup(timer_source.event_id, clock_count_per_tick); | ||
218 | samsung_time_start(timer_source.event_id, PERIODIC); | ||
219 | |||
220 | /* source timer restart */ | ||
221 | samsung_time_setup(timer_source.source_id, TCNT_MAX); | ||
222 | samsung_time_start(timer_source.source_id, PERIODIC); | ||
223 | } | ||
224 | |||
225 | void __init samsung_set_timer_source(enum samsung_timer_mode event, | ||
226 | enum samsung_timer_mode source) | ||
227 | { | ||
228 | s3c_device_timer[event].dev.bus = &platform_bus_type; | ||
229 | s3c_device_timer[source].dev.bus = &platform_bus_type; | ||
230 | |||
231 | timer_source.event_id = event; | ||
232 | timer_source.source_id = source; | ||
233 | } | ||
234 | |||
235 | static struct clock_event_device time_event_device = { | ||
236 | .name = "samsung_event_timer", | ||
237 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
238 | .rating = 200, | ||
239 | .set_next_event = samsung_set_next_event, | ||
240 | .set_mode = samsung_set_mode, | ||
241 | }; | ||
242 | |||
243 | static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id) | ||
244 | { | ||
245 | struct clock_event_device *evt = dev_id; | ||
246 | |||
247 | evt->event_handler(evt); | ||
248 | |||
249 | return IRQ_HANDLED; | ||
250 | } | ||
251 | |||
252 | static struct irqaction samsung_clock_event_irq = { | ||
253 | .name = "samsung_time_irq", | ||
254 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
255 | .handler = samsung_clock_event_isr, | ||
256 | .dev_id = &time_event_device, | ||
257 | }; | ||
258 | |||
259 | static void __init samsung_clockevent_init(void) | ||
260 | { | ||
261 | unsigned long pclk; | ||
262 | unsigned long clock_rate; | ||
263 | unsigned int irq_number; | ||
264 | struct clk *tscaler; | ||
265 | |||
266 | pclk = clk_get_rate(timerclk); | ||
267 | |||
268 | tscaler = clk_get_parent(tdiv_event); | ||
269 | |||
270 | clk_set_rate(tscaler, pclk / TSCALER_DIV); | ||
271 | clk_set_rate(tdiv_event, pclk / TDIV); | ||
272 | clk_set_parent(tin_event, tdiv_event); | ||
273 | |||
274 | clock_rate = clk_get_rate(tin_event); | ||
275 | clock_count_per_tick = clock_rate / HZ; | ||
276 | |||
277 | time_event_device.cpumask = cpumask_of(0); | ||
278 | clockevents_config_and_register(&time_event_device, clock_rate, 1, -1); | ||
279 | |||
280 | irq_number = timer_source.event_id + IRQ_TIMER0; | ||
281 | setup_irq(irq_number, &samsung_clock_event_irq); | ||
282 | } | ||
283 | |||
284 | static void __iomem *samsung_timer_reg(void) | ||
285 | { | ||
286 | unsigned long offset = 0; | ||
287 | |||
288 | switch (timer_source.source_id) { | ||
289 | case SAMSUNG_PWM0: | ||
290 | case SAMSUNG_PWM1: | ||
291 | case SAMSUNG_PWM2: | ||
292 | case SAMSUNG_PWM3: | ||
293 | offset = (timer_source.source_id * 0x0c) + 0x14; | ||
294 | break; | ||
295 | |||
296 | case SAMSUNG_PWM4: | ||
297 | offset = 0x40; | ||
298 | break; | ||
299 | |||
300 | default: | ||
301 | printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id); | ||
302 | return NULL; | ||
303 | } | ||
304 | |||
305 | return S3C_TIMERREG(offset); | ||
306 | } | ||
307 | |||
308 | /* | ||
309 | * Override the global weak sched_clock symbol with this | ||
310 | * local implementation which uses the clocksource to get some | ||
311 | * better resolution when scheduling the kernel. We accept that | ||
312 | * this wraps around for now, since it is just a relative time | ||
313 | * stamp. (Inspired by U300 implementation.) | ||
314 | */ | ||
315 | static u32 notrace samsung_read_sched_clock(void) | ||
316 | { | ||
317 | void __iomem *reg = samsung_timer_reg(); | ||
318 | |||
319 | if (!reg) | ||
320 | return 0; | ||
321 | |||
322 | return ~__raw_readl(reg); | ||
323 | } | ||
324 | |||
325 | static void __init samsung_clocksource_init(void) | ||
326 | { | ||
327 | unsigned long pclk; | ||
328 | unsigned long clock_rate; | ||
329 | |||
330 | pclk = clk_get_rate(timerclk); | ||
331 | |||
332 | clk_set_rate(tdiv_source, pclk / TDIV); | ||
333 | clk_set_parent(tin_source, tdiv_source); | ||
334 | |||
335 | clock_rate = clk_get_rate(tin_source); | ||
336 | |||
337 | samsung_time_setup(timer_source.source_id, TCNT_MAX); | ||
338 | samsung_time_start(timer_source.source_id, PERIODIC); | ||
339 | |||
340 | setup_sched_clock(samsung_read_sched_clock, TSIZE, clock_rate); | ||
341 | |||
342 | if (clocksource_mmio_init(samsung_timer_reg(), "samsung_clocksource_timer", | ||
343 | clock_rate, 250, TSIZE, clocksource_mmio_readl_down)) | ||
344 | panic("samsung_clocksource_timer: can't register clocksource\n"); | ||
345 | } | ||
346 | |||
347 | static void __init samsung_timer_resources(void) | ||
348 | { | ||
349 | |||
350 | unsigned long event_id = timer_source.event_id; | ||
351 | unsigned long source_id = timer_source.source_id; | ||
352 | char devname[15]; | ||
353 | |||
354 | timerclk = clk_get(NULL, "timers"); | ||
355 | if (IS_ERR(timerclk)) | ||
356 | panic("failed to get timers clock for timer"); | ||
357 | |||
358 | clk_enable(timerclk); | ||
359 | |||
360 | sprintf(devname, "s3c24xx-pwm.%lu", event_id); | ||
361 | s3c_device_timer[event_id].id = event_id; | ||
362 | s3c_device_timer[event_id].dev.init_name = devname; | ||
363 | |||
364 | tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin"); | ||
365 | if (IS_ERR(tin_event)) | ||
366 | panic("failed to get pwm-tin clock for event timer"); | ||
367 | |||
368 | tdiv_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tdiv"); | ||
369 | if (IS_ERR(tdiv_event)) | ||
370 | panic("failed to get pwm-tdiv clock for event timer"); | ||
371 | |||
372 | clk_enable(tin_event); | ||
373 | |||
374 | sprintf(devname, "s3c24xx-pwm.%lu", source_id); | ||
375 | s3c_device_timer[source_id].id = source_id; | ||
376 | s3c_device_timer[source_id].dev.init_name = devname; | ||
377 | |||
378 | tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin"); | ||
379 | if (IS_ERR(tin_source)) | ||
380 | panic("failed to get pwm-tin clock for source timer"); | ||
381 | |||
382 | tdiv_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tdiv"); | ||
383 | if (IS_ERR(tdiv_source)) | ||
384 | panic("failed to get pwm-tdiv clock for source timer"); | ||
385 | |||
386 | clk_enable(tin_source); | ||
387 | } | ||
388 | |||
389 | void __init samsung_timer_init(void) | ||
390 | { | ||
391 | samsung_timer_resources(); | ||
392 | samsung_clockevent_init(); | ||
393 | samsung_clocksource_init(); | ||
394 | } | ||
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index f71c37edca26..c9770ba5c7df 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -172,7 +172,7 @@ static void __init xen_percpu_init(void *unused) | |||
172 | enable_percpu_irq(xen_events_irq, 0); | 172 | enable_percpu_irq(xen_events_irq, 0); |
173 | } | 173 | } |
174 | 174 | ||
175 | static void xen_restart(char str, const char *cmd) | 175 | static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) |
176 | { | 176 | { |
177 | struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; | 177 | struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; |
178 | int rc; | 178 | int rc; |