aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-02-19 01:19:33 -0500
committerOlof Johansson <olof@lixom.net>2014-02-19 01:19:33 -0500
commit11d73c56b96b4297bd96273e9a22b7c72d13f1fa (patch)
tree3edc8cfa1508dabd06a7d3e0d615cea943ba0cca
parent6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff)
parentfb3174e4ad2427c6ad90c67093d6ca97f13e8672 (diff)
Merge tag 'dropmachtimexh-v2' of git://git.pengutronix.de/git/ukl/linux into next/cleanup
This cleanup series gets rid of <mach/timex.h> for platforms not using ARCH_MULTIPLATFORM. (For multi-platform code it's already unused since 387798b (ARM: initial multiplatform support).) To make this work some code out of arch/arm needed to be adapted. The respective changes got acks by their maintainers to be taken via armsoc (with Andrew Morton substituting for Alessandro Zummo as rtc maintainer). Compared to the previous pull request there was another patch added that fixes a (non-critical) regression on ixp4xx. Olof Johansson asked to not squash this fix into the original commit to save him from the need to reverify the series. * tag 'dropmachtimexh-v2' of git://git.pengutronix.de/git/ukl/linux: ARM: ixp4xx: fix timer latch calculation ARM: drop <mach/timex.h> for !ARCH_MULTIPLATFORM, too ARM: rpc: stop using <mach/timex.h> ARM: ixp4xx: stop using <mach/timex.h> input: ixp4xx-beeper: don't use symbols from <mach/timex.h> ARM: at91: don't use <mach/timex.h> ARM: ep93xx: stop using mach/timex.h ARM: mmp: stop using mach/timex.h ARM: netx: stop using mach/timex.h ARM: sa1100: stop using mach/timex.h clocksource: sirf/marco+prima2: drop usage of CLOCK_TICK_RATE rtc: pxa: drop unused #define TIMER_FREQ rtc: at91sam9: include <mach/hardware.h> explicitly ARM/serial: at91: switch atmel serial to use gpiolib Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--Documentation/devicetree/bindings/serial/atmel-usart.txt3
-rw-r--r--arch/arm/include/asm/timex.h6
-rw-r--r--arch/arm/mach-at91/at91rm9200.c1
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c11
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c8
-rw-r--r--arch/arm/mach-at91/at91sam9261.c1
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c5
-rw-r--r--arch/arm/mach-at91/at91sam9263.c1
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c5
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c1
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c1
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c1
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c6
-rw-r--r--arch/arm/mach-at91/at91x40.c2
-rw-r--r--arch/arm/mach-at91/at91x40_time.c1
-rw-r--r--arch/arm/mach-at91/board-gsia18s.c1
-rw-r--r--arch/arm/mach-at91/board-pcontrol-g20.c1
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c1
-rw-r--r--arch/arm/mach-at91/include/mach/at91x40.h2
-rw-r--r--arch/arm/mach-at91/include/mach/timex.h37
-rw-r--r--arch/arm/mach-at91/pm.c1
-rw-r--r--arch/arm/mach-clps711x/include/mach/timex.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/timex.h22
-rw-r--r--arch/arm/mach-dove/include/mach/timex.h9
-rw-r--r--arch/arm/mach-ebsa110/include/mach/timex.h19
-rw-r--r--arch/arm/mach-ep93xx/core.c2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/timex.h5
-rw-r--r--arch/arm/mach-exynos/include/mach/timex.h29
-rw-r--r--arch/arm/mach-footbridge/include/mach/timex.h18
-rw-r--r--arch/arm/mach-gemini/include/mach/timex.h13
-rw-r--r--arch/arm/mach-integrator/include/mach/timex.h26
-rw-r--r--arch/arm/mach-iop13xx/include/mach/timex.h1
-rw-r--r--arch/arm/mach-iop32x/include/mach/timex.h6
-rw-r--r--arch/arm/mach-iop33x/include/mach/timex.h6
-rw-r--r--arch/arm/mach-ixp4xx/common.c14
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/timex.h16
-rw-r--r--arch/arm/mach-kirkwood/include/mach/timex.h10
-rw-r--r--arch/arm/mach-ks8695/include/mach/timex.h21
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/timex.h28
-rw-r--r--arch/arm/mach-mmp/include/mach/timex.h13
-rw-r--r--arch/arm/mach-mmp/time.c12
-rw-r--r--arch/arm/mach-msm/include/mach/timex.h21
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/timex.h9
-rw-r--r--arch/arm/mach-netx/include/mach/timex.h20
-rw-r--r--arch/arm/mach-netx/time.c11
-rw-r--r--arch/arm/mach-omap1/include/mach/timex.h5
-rw-r--r--arch/arm/mach-omap2/include/mach/timex.h5
-rw-r--r--arch/arm/mach-orion5x/include/mach/timex.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/timex.h34
-rw-r--r--arch/arm/mach-realview/include/mach/timex.h23
-rw-r--r--arch/arm/mach-rpc/include/mach/timex.h17
-rw-r--r--arch/arm/mach-rpc/time.c15
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/timex.h27
-rw-r--r--arch/arm/mach-s5pc100/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s5pv210/include/mach/timex.h29
-rw-r--r--arch/arm/mach-sa1100/include/mach/timex.h12
-rw-r--r--arch/arm/mach-sa1100/time.c8
-rw-r--r--arch/arm/mach-shmobile/include/mach/timex.h6
-rw-r--r--arch/arm/mach-spear/include/mach/timex.h19
-rw-r--r--arch/arm/mach-versatile/include/mach/timex.h23
-rw-r--r--arch/arm/mach-w90x900/include/mach/timex.h25
-rw-r--r--arch/arm/plat-omap/include/plat/timex.h33
-rw-r--r--drivers/clocksource/timer-marco.c13
-rw-r--r--drivers/clocksource/timer-prima2.c16
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c2
-rw-r--r--drivers/rtc/rtc-at91sam9.c2
-rw-r--r--drivers/rtc/rtc-pxa.c1
-rw-r--r--drivers/tty/serial/atmel_serial.c49
-rw-r--r--include/linux/platform_data/atmel.h1
74 files changed, 153 insertions, 732 deletions
diff --git a/Documentation/devicetree/bindings/serial/atmel-usart.txt b/Documentation/devicetree/bindings/serial/atmel-usart.txt
index 9c5d19ac935c..17c1042b2df8 100644
--- a/Documentation/devicetree/bindings/serial/atmel-usart.txt
+++ b/Documentation/devicetree/bindings/serial/atmel-usart.txt
@@ -13,6 +13,8 @@ Required properties:
13Optional properties: 13Optional properties:
14- atmel,use-dma-rx: use of PDC or DMA for receiving data 14- atmel,use-dma-rx: use of PDC or DMA for receiving data
15- atmel,use-dma-tx: use of PDC or DMA for transmitting data 15- atmel,use-dma-tx: use of PDC or DMA for transmitting data
16- rts-gpios: specify a GPIO for RTS line. It will use specified PIO instead of the peripheral
17 function pin for the USART RTS feature. If unsure, don't specify this property.
16- add dma bindings for dma transfer: 18- add dma bindings for dma transfer:
17 - dmas: DMA specifier, consisting of a phandle to DMA controller node, 19 - dmas: DMA specifier, consisting of a phandle to DMA controller node,
18 memory peripheral interface and USART DMA channel ID, FIFO configuration. 20 memory peripheral interface and USART DMA channel ID, FIFO configuration.
@@ -33,6 +35,7 @@ Example:
33 clock-names = "usart"; 35 clock-names = "usart";
34 atmel,use-dma-rx; 36 atmel,use-dma-rx;
35 atmel,use-dma-tx; 37 atmel,use-dma-tx;
38 rts-gpios = <&pioD 15 0>;
36 }; 39 };
37 40
38- use DMA: 41- use DMA:
diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
index 83f2aa83899c..f6fcc67ef06e 100644
--- a/arch/arm/include/asm/timex.h
+++ b/arch/arm/include/asm/timex.h
@@ -12,12 +12,6 @@
12#ifndef _ASMARM_TIMEX_H 12#ifndef _ASMARM_TIMEX_H
13#define _ASMARM_TIMEX_H 13#define _ASMARM_TIMEX_H
14 14
15#ifdef CONFIG_ARCH_MULTIPLATFORM
16#define CLOCK_TICK_RATE 1000000
17#else
18#include <mach/timex.h>
19#endif
20
21typedef unsigned long cycles_t; 15typedef unsigned long cycles_t;
22#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) 16#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
23 17
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index e47f5fd232f5..787bb50a4dff 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -21,6 +21,7 @@
21#include <mach/at91rm9200.h> 21#include <mach/at91rm9200.h>
22#include <mach/at91_st.h> 22#include <mach/at91_st.h>
23#include <mach/cpu.h> 23#include <mach/cpu.h>
24#include <mach/hardware.h>
24 25
25#include "at91_aic.h" 26#include "at91_aic.h"
26#include "soc.h" 27#include "soc.h"
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 3ebc9792560c..f3f19f21352a 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -21,6 +21,7 @@
21#include <mach/at91rm9200.h> 21#include <mach/at91rm9200.h>
22#include <mach/at91rm9200_mc.h> 22#include <mach/at91rm9200_mc.h>
23#include <mach/at91_ramc.h> 23#include <mach/at91_ramc.h>
24#include <mach/hardware.h>
24 25
25#include "board.h" 26#include "board.h"
26#include "generic.h" 27#include "generic.h"
@@ -922,6 +923,7 @@ static struct resource dbgu_resources[] = {
922static struct atmel_uart_data dbgu_data = { 923static struct atmel_uart_data dbgu_data = {
923 .use_dma_tx = 0, 924 .use_dma_tx = 0,
924 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 925 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
926 .rts_gpio = -EINVAL,
925}; 927};
926 928
927static u64 dbgu_dmamask = DMA_BIT_MASK(32); 929static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -960,6 +962,7 @@ static struct resource uart0_resources[] = {
960static struct atmel_uart_data uart0_data = { 962static struct atmel_uart_data uart0_data = {
961 .use_dma_tx = 1, 963 .use_dma_tx = 1,
962 .use_dma_rx = 1, 964 .use_dma_rx = 1,
965 .rts_gpio = -EINVAL,
963}; 966};
964 967
965static u64 uart0_dmamask = DMA_BIT_MASK(32); 968static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -987,9 +990,10 @@ static inline void configure_usart0_pins(unsigned pins)
987 if (pins & ATMEL_UART_RTS) { 990 if (pins & ATMEL_UART_RTS) {
988 /* 991 /*
989 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21. 992 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21.
990 * We need to drive the pin manually. Default is off (RTS is active low). 993 * We need to drive the pin manually. The serial driver will driver
994 * this to high when initializing.
991 */ 995 */
992 at91_set_gpio_output(AT91_PIN_PA21, 1); 996 uart0_data.rts_gpio = AT91_PIN_PA21;
993 } 997 }
994} 998}
995 999
@@ -1009,6 +1013,7 @@ static struct resource uart1_resources[] = {
1009static struct atmel_uart_data uart1_data = { 1013static struct atmel_uart_data uart1_data = {
1010 .use_dma_tx = 1, 1014 .use_dma_tx = 1,
1011 .use_dma_rx = 1, 1015 .use_dma_rx = 1,
1016 .rts_gpio = -EINVAL,
1012}; 1017};
1013 1018
1014static u64 uart1_dmamask = DMA_BIT_MASK(32); 1019static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1060,6 +1065,7 @@ static struct resource uart2_resources[] = {
1060static struct atmel_uart_data uart2_data = { 1065static struct atmel_uart_data uart2_data = {
1061 .use_dma_tx = 1, 1066 .use_dma_tx = 1,
1062 .use_dma_rx = 1, 1067 .use_dma_rx = 1,
1068 .rts_gpio = -EINVAL,
1063}; 1069};
1064 1070
1065static u64 uart2_dmamask = DMA_BIT_MASK(32); 1071static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1103,6 +1109,7 @@ static struct resource uart3_resources[] = {
1103static struct atmel_uart_data uart3_data = { 1109static struct atmel_uart_data uart3_data = {
1104 .use_dma_tx = 1, 1110 .use_dma_tx = 1,
1105 .use_dma_rx = 1, 1111 .use_dma_rx = 1,
1112 .rts_gpio = -EINVAL,
1106}; 1113};
1107 1114
1108static u64 uart3_dmamask = DMA_BIT_MASK(32); 1115static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index bc7b363a3083..7fd13aef9827 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -31,6 +31,7 @@
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
32 32
33#include <mach/at91_st.h> 33#include <mach/at91_st.h>
34#include <mach/hardware.h>
34 35
35static unsigned long last_crtr; 36static unsigned long last_crtr;
36static u32 irqmask; 37static u32 irqmask;
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 6c821e562159..c3d22be73b7c 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -21,6 +21,7 @@
21#include <mach/cpu.h> 21#include <mach/cpu.h>
22#include <mach/at91_dbgu.h> 22#include <mach/at91_dbgu.h>
23#include <mach/at91sam9260.h> 23#include <mach/at91sam9260.h>
24#include <mach/hardware.h>
24 25
25#include "at91_aic.h" 26#include "at91_aic.h"
26#include "at91_rstc.h" 27#include "at91_rstc.h"
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index eda8d1679d40..2ae7715f1309 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -25,6 +25,7 @@
25#include <mach/at91_matrix.h> 25#include <mach/at91_matrix.h>
26#include <mach/at91sam9_smc.h> 26#include <mach/at91sam9_smc.h>
27#include <mach/at91_adc.h> 27#include <mach/at91_adc.h>
28#include <mach/hardware.h>
28 29
29#include "board.h" 30#include "board.h"
30#include "generic.h" 31#include "generic.h"
@@ -819,6 +820,7 @@ static struct resource dbgu_resources[] = {
819static struct atmel_uart_data dbgu_data = { 820static struct atmel_uart_data dbgu_data = {
820 .use_dma_tx = 0, 821 .use_dma_tx = 0,
821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 822 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
823 .rts_gpio = -EINVAL,
822}; 824};
823 825
824static u64 dbgu_dmamask = DMA_BIT_MASK(32); 826static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -857,6 +859,7 @@ static struct resource uart0_resources[] = {
857static struct atmel_uart_data uart0_data = { 859static struct atmel_uart_data uart0_data = {
858 .use_dma_tx = 1, 860 .use_dma_tx = 1,
859 .use_dma_rx = 1, 861 .use_dma_rx = 1,
862 .rts_gpio = -EINVAL,
860}; 863};
861 864
862static u64 uart0_dmamask = DMA_BIT_MASK(32); 865static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -908,6 +911,7 @@ static struct resource uart1_resources[] = {
908static struct atmel_uart_data uart1_data = { 911static struct atmel_uart_data uart1_data = {
909 .use_dma_tx = 1, 912 .use_dma_tx = 1,
910 .use_dma_rx = 1, 913 .use_dma_rx = 1,
914 .rts_gpio = -EINVAL,
911}; 915};
912 916
913static u64 uart1_dmamask = DMA_BIT_MASK(32); 917static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -951,6 +955,7 @@ static struct resource uart2_resources[] = {
951static struct atmel_uart_data uart2_data = { 955static struct atmel_uart_data uart2_data = {
952 .use_dma_tx = 1, 956 .use_dma_tx = 1,
953 .use_dma_rx = 1, 957 .use_dma_rx = 1,
958 .rts_gpio = -EINVAL,
954}; 959};
955 960
956static u64 uart2_dmamask = DMA_BIT_MASK(32); 961static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -994,6 +999,7 @@ static struct resource uart3_resources[] = {
994static struct atmel_uart_data uart3_data = { 999static struct atmel_uart_data uart3_data = {
995 .use_dma_tx = 1, 1000 .use_dma_tx = 1,
996 .use_dma_rx = 1, 1001 .use_dma_rx = 1,
1002 .rts_gpio = -EINVAL,
997}; 1003};
998 1004
999static u64 uart3_dmamask = DMA_BIT_MASK(32); 1005static u64 uart3_dmamask = DMA_BIT_MASK(32);
@@ -1037,6 +1043,7 @@ static struct resource uart4_resources[] = {
1037static struct atmel_uart_data uart4_data = { 1043static struct atmel_uart_data uart4_data = {
1038 .use_dma_tx = 1, 1044 .use_dma_tx = 1,
1039 .use_dma_rx = 1, 1045 .use_dma_rx = 1,
1046 .rts_gpio = -EINVAL,
1040}; 1047};
1041 1048
1042static u64 uart4_dmamask = DMA_BIT_MASK(32); 1049static u64 uart4_dmamask = DMA_BIT_MASK(32);
@@ -1075,6 +1082,7 @@ static struct resource uart5_resources[] = {
1075static struct atmel_uart_data uart5_data = { 1082static struct atmel_uart_data uart5_data = {
1076 .use_dma_tx = 1, 1083 .use_dma_tx = 1,
1077 .use_dma_rx = 1, 1084 .use_dma_rx = 1,
1085 .rts_gpio = -EINVAL,
1078}; 1086};
1079 1087
1080static u64 uart5_dmamask = DMA_BIT_MASK(32); 1088static u64 uart5_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 6276b4c1acfe..48b51f796d6a 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -20,6 +20,7 @@
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/cpu.h> 21#include <mach/cpu.h>
22#include <mach/at91sam9261.h> 22#include <mach/at91sam9261.h>
23#include <mach/hardware.h>
23 24
24#include "at91_aic.h" 25#include "at91_aic.h"
25#include "at91_rstc.h" 26#include "at91_rstc.h"
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index b2a34740146a..80e35895d28f 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -25,6 +25,7 @@
25#include <mach/at91sam9261_matrix.h> 25#include <mach/at91sam9261_matrix.h>
26#include <mach/at91_matrix.h> 26#include <mach/at91_matrix.h>
27#include <mach/at91sam9_smc.h> 27#include <mach/at91sam9_smc.h>
28#include <mach/hardware.h>
28 29
29#include "board.h" 30#include "board.h"
30#include "generic.h" 31#include "generic.h"
@@ -880,6 +881,7 @@ static struct resource dbgu_resources[] = {
880static struct atmel_uart_data dbgu_data = { 881static struct atmel_uart_data dbgu_data = {
881 .use_dma_tx = 0, 882 .use_dma_tx = 0,
882 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 883 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
884 .rts_gpio = -EINVAL,
883}; 885};
884 886
885static u64 dbgu_dmamask = DMA_BIT_MASK(32); 887static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -918,6 +920,7 @@ static struct resource uart0_resources[] = {
918static struct atmel_uart_data uart0_data = { 920static struct atmel_uart_data uart0_data = {
919 .use_dma_tx = 1, 921 .use_dma_tx = 1,
920 .use_dma_rx = 1, 922 .use_dma_rx = 1,
923 .rts_gpio = -EINVAL,
921}; 924};
922 925
923static u64 uart0_dmamask = DMA_BIT_MASK(32); 926static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -961,6 +964,7 @@ static struct resource uart1_resources[] = {
961static struct atmel_uart_data uart1_data = { 964static struct atmel_uart_data uart1_data = {
962 .use_dma_tx = 1, 965 .use_dma_tx = 1,
963 .use_dma_rx = 1, 966 .use_dma_rx = 1,
967 .rts_gpio = -EINVAL,
964}; 968};
965 969
966static u64 uart1_dmamask = DMA_BIT_MASK(32); 970static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1004,6 +1008,7 @@ static struct resource uart2_resources[] = {
1004static struct atmel_uart_data uart2_data = { 1008static struct atmel_uart_data uart2_data = {
1005 .use_dma_tx = 1, 1009 .use_dma_tx = 1,
1006 .use_dma_rx = 1, 1010 .use_dma_rx = 1,
1011 .rts_gpio = -EINVAL,
1007}; 1012};
1008 1013
1009static u64 uart2_dmamask = DMA_BIT_MASK(32); 1014static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 37b90f4b990c..486530c3973b 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -19,6 +19,7 @@
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/at91sam9263.h> 21#include <mach/at91sam9263.h>
22#include <mach/hardware.h>
22 23
23#include "at91_aic.h" 24#include "at91_aic.h"
24#include "at91_rstc.h" 25#include "at91_rstc.h"
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 4aeadddbc181..43d53d6156dd 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -24,6 +24,7 @@
24#include <mach/at91sam9263_matrix.h> 24#include <mach/at91sam9263_matrix.h>
25#include <mach/at91_matrix.h> 25#include <mach/at91_matrix.h>
26#include <mach/at91sam9_smc.h> 26#include <mach/at91sam9_smc.h>
27#include <mach/hardware.h>
27 28
28#include "board.h" 29#include "board.h"
29#include "generic.h" 30#include "generic.h"
@@ -1324,6 +1325,7 @@ static struct resource dbgu_resources[] = {
1324static struct atmel_uart_data dbgu_data = { 1325static struct atmel_uart_data dbgu_data = {
1325 .use_dma_tx = 0, 1326 .use_dma_tx = 0,
1326 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 1327 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
1328 .rts_gpio = -EINVAL,
1327}; 1329};
1328 1330
1329static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1331static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1362,6 +1364,7 @@ static struct resource uart0_resources[] = {
1362static struct atmel_uart_data uart0_data = { 1364static struct atmel_uart_data uart0_data = {
1363 .use_dma_tx = 1, 1365 .use_dma_tx = 1,
1364 .use_dma_rx = 1, 1366 .use_dma_rx = 1,
1367 .rts_gpio = -EINVAL,
1365}; 1368};
1366 1369
1367static u64 uart0_dmamask = DMA_BIT_MASK(32); 1370static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1405,6 +1408,7 @@ static struct resource uart1_resources[] = {
1405static struct atmel_uart_data uart1_data = { 1408static struct atmel_uart_data uart1_data = {
1406 .use_dma_tx = 1, 1409 .use_dma_tx = 1,
1407 .use_dma_rx = 1, 1410 .use_dma_rx = 1,
1411 .rts_gpio = -EINVAL,
1408}; 1412};
1409 1413
1410static u64 uart1_dmamask = DMA_BIT_MASK(32); 1414static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1448,6 +1452,7 @@ static struct resource uart2_resources[] = {
1448static struct atmel_uart_data uart2_data = { 1452static struct atmel_uart_data uart2_data = {
1449 .use_dma_tx = 1, 1453 .use_dma_tx = 1,
1450 .use_dma_rx = 1, 1454 .use_dma_rx = 1,
1455 .rts_gpio = -EINVAL,
1451}; 1456};
1452 1457
1453static u64 uart2_dmamask = DMA_BIT_MASK(32); 1458static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 0f04ffe9c5a8..0a9e2fc8f796 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -19,6 +19,7 @@
19#include <linux/of_irq.h> 19#include <linux/of_irq.h>
20 20
21#include <asm/mach/time.h> 21#include <asm/mach/time.h>
22#include <mach/hardware.h>
22 23
23#define AT91_PIT_MR 0x00 /* Mode Register */ 24#define AT91_PIT_MR 0x00 /* Mode Register */
24#define AT91_PIT_PITIEN (1 << 25) /* Timer Interrupt Enable */ 25#define AT91_PIT_PITIEN (1 << 25) /* Timer Interrupt Enable */
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 2f455ce35268..8c11696f606e 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -20,6 +20,7 @@
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/at91sam9g45.h> 21#include <mach/at91sam9g45.h>
22#include <mach/cpu.h> 22#include <mach/cpu.h>
23#include <mach/hardware.h>
23 24
24#include "at91_aic.h" 25#include "at91_aic.h"
25#include "soc.h" 26#include "soc.h"
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index cb36fa872d30..77b04c2edd78 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -32,6 +32,7 @@
32#include <mach/at91sam9_smc.h> 32#include <mach/at91sam9_smc.h>
33#include <linux/platform_data/dma-atmel.h> 33#include <linux/platform_data/dma-atmel.h>
34#include <mach/atmel-mci.h> 34#include <mach/atmel-mci.h>
35#include <mach/hardware.h>
35 36
36#include <media/atmel-isi.h> 37#include <media/atmel-isi.h>
37 38
@@ -1587,6 +1588,7 @@ static struct resource dbgu_resources[] = {
1587static struct atmel_uart_data dbgu_data = { 1588static struct atmel_uart_data dbgu_data = {
1588 .use_dma_tx = 0, 1589 .use_dma_tx = 0,
1589 .use_dma_rx = 0, 1590 .use_dma_rx = 0,
1591 .rts_gpio = -EINVAL,
1590}; 1592};
1591 1593
1592static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1594static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1625,6 +1627,7 @@ static struct resource uart0_resources[] = {
1625static struct atmel_uart_data uart0_data = { 1627static struct atmel_uart_data uart0_data = {
1626 .use_dma_tx = 1, 1628 .use_dma_tx = 1,
1627 .use_dma_rx = 1, 1629 .use_dma_rx = 1,
1630 .rts_gpio = -EINVAL,
1628}; 1631};
1629 1632
1630static u64 uart0_dmamask = DMA_BIT_MASK(32); 1633static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1668,6 +1671,7 @@ static struct resource uart1_resources[] = {
1668static struct atmel_uart_data uart1_data = { 1671static struct atmel_uart_data uart1_data = {
1669 .use_dma_tx = 1, 1672 .use_dma_tx = 1,
1670 .use_dma_rx = 1, 1673 .use_dma_rx = 1,
1674 .rts_gpio = -EINVAL,
1671}; 1675};
1672 1676
1673static u64 uart1_dmamask = DMA_BIT_MASK(32); 1677static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1711,6 +1715,7 @@ static struct resource uart2_resources[] = {
1711static struct atmel_uart_data uart2_data = { 1715static struct atmel_uart_data uart2_data = {
1712 .use_dma_tx = 1, 1716 .use_dma_tx = 1,
1713 .use_dma_rx = 1, 1717 .use_dma_rx = 1,
1718 .rts_gpio = -EINVAL,
1714}; 1719};
1715 1720
1716static u64 uart2_dmamask = DMA_BIT_MASK(32); 1721static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1754,6 +1759,7 @@ static struct resource uart3_resources[] = {
1754static struct atmel_uart_data uart3_data = { 1759static struct atmel_uart_data uart3_data = {
1755 .use_dma_tx = 1, 1760 .use_dma_tx = 1,
1756 .use_dma_rx = 1, 1761 .use_dma_rx = 1,
1762 .rts_gpio = -EINVAL,
1757}; 1763};
1758 1764
1759static u64 uart3_dmamask = DMA_BIT_MASK(32); 1765static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 3651517abedf..c0d5474706f8 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -20,6 +20,7 @@
20#include <mach/cpu.h> 20#include <mach/cpu.h>
21#include <mach/at91_dbgu.h> 21#include <mach/at91_dbgu.h>
22#include <mach/at91sam9rl.h> 22#include <mach/at91sam9rl.h>
23#include <mach/hardware.h>
23 24
24#include "at91_aic.h" 25#include "at91_aic.h"
25#include "at91_rstc.h" 26#include "at91_rstc.h"
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index a698bdab2cce..428fc412aaf1 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -21,6 +21,7 @@
21#include <mach/at91sam9rl_matrix.h> 21#include <mach/at91sam9rl_matrix.h>
22#include <mach/at91_matrix.h> 22#include <mach/at91_matrix.h>
23#include <mach/at91sam9_smc.h> 23#include <mach/at91sam9_smc.h>
24#include <mach/hardware.h>
24#include <linux/platform_data/dma-atmel.h> 25#include <linux/platform_data/dma-atmel.h>
25 26
26#include "board.h" 27#include "board.h"
@@ -956,6 +957,7 @@ static struct resource dbgu_resources[] = {
956static struct atmel_uart_data dbgu_data = { 957static struct atmel_uart_data dbgu_data = {
957 .use_dma_tx = 0, 958 .use_dma_tx = 0,
958 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 959 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
960 .rts_gpio = -EINVAL,
959}; 961};
960 962
961static u64 dbgu_dmamask = DMA_BIT_MASK(32); 963static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -994,6 +996,7 @@ static struct resource uart0_resources[] = {
994static struct atmel_uart_data uart0_data = { 996static struct atmel_uart_data uart0_data = {
995 .use_dma_tx = 1, 997 .use_dma_tx = 1,
996 .use_dma_rx = 1, 998 .use_dma_rx = 1,
999 .rts_gpio = -EINVAL,
997}; 1000};
998 1001
999static u64 uart0_dmamask = DMA_BIT_MASK(32); 1002static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1045,6 +1048,7 @@ static struct resource uart1_resources[] = {
1045static struct atmel_uart_data uart1_data = { 1048static struct atmel_uart_data uart1_data = {
1046 .use_dma_tx = 1, 1049 .use_dma_tx = 1,
1047 .use_dma_rx = 1, 1050 .use_dma_rx = 1,
1051 .rts_gpio = -EINVAL,
1048}; 1052};
1049 1053
1050static u64 uart1_dmamask = DMA_BIT_MASK(32); 1054static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1088,6 +1092,7 @@ static struct resource uart2_resources[] = {
1088static struct atmel_uart_data uart2_data = { 1092static struct atmel_uart_data uart2_data = {
1089 .use_dma_tx = 1, 1093 .use_dma_tx = 1,
1090 .use_dma_rx = 1, 1094 .use_dma_rx = 1,
1095 .rts_gpio = -EINVAL,
1091}; 1096};
1092 1097
1093static u64 uart2_dmamask = DMA_BIT_MASK(32); 1098static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1131,6 +1136,7 @@ static struct resource uart3_resources[] = {
1131static struct atmel_uart_data uart3_data = { 1136static struct atmel_uart_data uart3_data = {
1132 .use_dma_tx = 1, 1137 .use_dma_tx = 1,
1133 .use_dma_rx = 1, 1138 .use_dma_rx = 1,
1139 .rts_gpio = -EINVAL,
1134}; 1140};
1135 1141
1136static u64 uart3_dmamask = DMA_BIT_MASK(32); 1142static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index bad94b84a46f..7523f1cdfe1d 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -19,7 +19,7 @@
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <mach/at91x40.h> 20#include <mach/at91x40.h>
21#include <mach/at91_st.h> 21#include <mach/at91_st.h>
22#include <mach/timex.h> 22#include <mach/hardware.h>
23 23
24#include "at91_aic.h" 24#include "at91_aic.h"
25#include "generic.h" 25#include "generic.h"
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index c0e637adf65d..07d0bf2ac2da 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -25,6 +25,7 @@
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/at91x40.h>
28#include <asm/mach/time.h> 29#include <asm/mach/time.h>
29 30
30#include "at91_tc.h" 31#include "at91_tc.h"
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index c1d61d247790..416bae8435ee 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -31,6 +31,7 @@
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32 32
33#include <mach/at91sam9_smc.h> 33#include <mach/at91sam9_smc.h>
34#include <mach/hardware.h>
34 35
35#include "at91_aic.h" 36#include "at91_aic.h"
36#include "board.h" 37#include "board.h"
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 65c0d6b5ecba..5f25fa54eb93 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -30,6 +30,7 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31 31
32#include <mach/at91sam9_smc.h> 32#include <mach/at91sam9_smc.h>
33#include <mach/hardware.h>
33 34
34#include "at91_aic.h" 35#include "at91_aic.h"
35#include "board.h" 36#include "board.h"
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 869cbecf00b7..e4a5ac17cdbc 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -26,6 +26,7 @@
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27 27
28#include <mach/at91sam9_smc.h> 28#include <mach/at91sam9_smc.h>
29#include <mach/hardware.h>
29 30
30#include "at91_aic.h" 31#include "at91_aic.h"
31#include "board.h" 32#include "board.h"
diff --git a/arch/arm/mach-at91/include/mach/at91x40.h b/arch/arm/mach-at91/include/mach/at91x40.h
index 90680217064e..38dca2bb027f 100644
--- a/arch/arm/mach-at91/include/mach/at91x40.h
+++ b/arch/arm/mach-at91/include/mach/at91x40.h
@@ -55,4 +55,6 @@
55#define AT91_PS_CR (AT91_PS + 0) /* PS Control register */ 55#define AT91_PS_CR (AT91_PS + 0) /* PS Control register */
56#define AT91_PS_CR_CPU (1 << 0) /* CPU clock disable bit */ 56#define AT91_PS_CR_CPU (1 << 0) /* CPU clock disable bit */
57 57
58#define AT91X40_MASTER_CLOCK 40000000
59
58#endif /* AT91X40_H */ 60#endif /* AT91X40_H */
diff --git a/arch/arm/mach-at91/include/mach/timex.h b/arch/arm/mach-at91/include/mach/timex.h
deleted file mode 100644
index 5e917a66edd7..000000000000
--- a/arch/arm/mach-at91/include/mach/timex.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * arch/arm/mach-at91/include/mach/timex.h
3 *
4 * Copyright (C) 2003 SAN People
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __ASM_ARCH_TIMEX_H
22#define __ASM_ARCH_TIMEX_H
23
24#include <mach/hardware.h>
25
26#ifdef CONFIG_ARCH_AT91X40
27
28#define AT91X40_MASTER_CLOCK 40000000
29#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK)
30
31#else
32
33#define CLOCK_TICK_RATE 12345678
34
35#endif
36
37#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 590b52dea9f7..8bda1cefdf96 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -27,6 +27,7 @@
27#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
28 28
29#include <mach/cpu.h> 29#include <mach/cpu.h>
30#include <mach/hardware.h>
30 31
31#include "at91_aic.h" 32#include "at91_aic.h"
32#include "generic.h" 33#include "generic.h"
diff --git a/arch/arm/mach-clps711x/include/mach/timex.h b/arch/arm/mach-clps711x/include/mach/timex.h
deleted file mode 100644
index de6fd192d1c3..000000000000
--- a/arch/arm/mach-clps711x/include/mach/timex.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* Bogus value */
2#define CLOCK_TICK_RATE 512000
diff --git a/arch/arm/mach-davinci/include/mach/timex.h b/arch/arm/mach-davinci/include/mach/timex.h
deleted file mode 100644
index 9b885298f106..000000000000
--- a/arch/arm/mach-davinci/include/mach/timex.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * DaVinci timer defines
3 *
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_TIMEX_H
12#define __ASM_ARCH_TIMEX_H
13
14/*
15 * Alert: Not all timers of the DaVinci family run at a frequency of 27MHz,
16 * but we should be fine as long as CLOCK_TICK_RATE or LATCH (see include/
17 * linux/jiffies.h) are not used directly in code. Currently none of the
18 * code relevant to DaVinci platform depends on these values directly.
19 */
20#define CLOCK_TICK_RATE 27000000
21
22#endif /* __ASM_ARCH_TIMEX_H__ */
diff --git a/arch/arm/mach-dove/include/mach/timex.h b/arch/arm/mach-dove/include/mach/timex.h
deleted file mode 100644
index 251d538541db..000000000000
--- a/arch/arm/mach-dove/include/mach/timex.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-ebsa110/include/mach/timex.h b/arch/arm/mach-ebsa110/include/mach/timex.h
deleted file mode 100644
index 4fb43b22a102..000000000000
--- a/arch/arm/mach-ebsa110/include/mach/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-ebsa110/include/mach/timex.h
3 *
4 * Copyright (C) 1997, 1998 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 * EBSA110 architecture timex specifications
11 */
12
13/*
14 * On the EBSA, the clock ticks at weird rates.
15 * This is therefore not used to calculate the
16 * divisor.
17 */
18#define CLOCK_TICK_RATE 47894000
19
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 157ba88433c9..6c705472da6c 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -117,7 +117,7 @@ void __init ep93xx_map_io(void)
117#define EP93XX_TIMER4_CLOCK 983040 117#define EP93XX_TIMER4_CLOCK 983040
118 118
119#define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1) 119#define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1)
120#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ) 120#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(EP93XX_TIMER4_CLOCK, HZ)
121 121
122static unsigned int last_jiffy_time; 122static unsigned int last_jiffy_time;
123 123
diff --git a/arch/arm/mach-ep93xx/include/mach/timex.h b/arch/arm/mach-ep93xx/include/mach/timex.h
deleted file mode 100644
index 6b3503b01fa6..000000000000
--- a/arch/arm/mach-ep93xx/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/timex.h
3 */
4
5#define CLOCK_TICK_RATE 983040
diff --git a/arch/arm/mach-exynos/include/mach/timex.h b/arch/arm/mach-exynos/include/mach/timex.h
deleted file mode 100644
index 6d138750a708..000000000000
--- a/arch/arm/mach-exynos/include/mach/timex.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/timex.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2003-2010 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 *
9 * Based on arch/arm/mach-s5p6442/include/mach/timex.h
10 *
11 * EXYNOS4 - time parameters
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_ARCH_TIMEX_H
19#define __ASM_ARCH_TIMEX_H __FILE__
20
21/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
22 * a variable is useless. It seems as long as we make our timers an
23 * exact multiple of HZ, any value that makes a 1->1 correspondence
24 * for the time conversion functions to/from jiffies is acceptable.
25*/
26
27#define CLOCK_TICK_RATE 12000000
28
29#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-footbridge/include/mach/timex.h b/arch/arm/mach-footbridge/include/mach/timex.h
deleted file mode 100644
index d0fea9d6d4ab..000000000000
--- a/arch/arm/mach-footbridge/include/mach/timex.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * arch/arm/mach-footbridge/include/mach/timex.h
3 *
4 * Copyright (C) 1998 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 * EBSA285 architecture timex specifications
11 */
12
13/*
14 * We assume a constant here; this satisfies the maths in linux/timex.h
15 * and linux/time.h. CLOCK_TICK_RATE is actually system dependent, but
16 * this must be a constant.
17 */
18#define CLOCK_TICK_RATE (50000000/16)
diff --git a/arch/arm/mach-gemini/include/mach/timex.h b/arch/arm/mach-gemini/include/mach/timex.h
deleted file mode 100644
index dc5690ba975c..000000000000
--- a/arch/arm/mach-gemini/include/mach/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * Gemini timex specifications
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12/* When AHB bus frequency is 150MHz */
13#define CLOCK_TICK_RATE 38000000
diff --git a/arch/arm/mach-integrator/include/mach/timex.h b/arch/arm/mach-integrator/include/mach/timex.h
deleted file mode 100644
index 1dcb42028c82..000000000000
--- a/arch/arm/mach-integrator/include/mach/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-integrator/include/mach/timex.h
3 *
4 * Integrator architecture timex specifications
5 *
6 * Copyright (C) 1999 ARM Limited
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23/*
24 * ??
25 */
26#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-iop13xx/include/mach/timex.h b/arch/arm/mach-iop13xx/include/mach/timex.h
deleted file mode 100644
index 45fb2745bb54..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/timex.h
+++ /dev/null
@@ -1 +0,0 @@
1#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-iop32x/include/mach/timex.h b/arch/arm/mach-iop32x/include/mach/timex.h
deleted file mode 100644
index 7262ab81419d..000000000000
--- a/arch/arm/mach-iop32x/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/*
2 * arch/arm/mach-iop32x/include/mach/timex.h
3 *
4 * IOP32x architecture timex specifications
5 */
6#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-iop33x/include/mach/timex.h b/arch/arm/mach-iop33x/include/mach/timex.h
deleted file mode 100644
index 54c589091d6e..000000000000
--- a/arch/arm/mach-iop33x/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/*
2 * arch/arm/mach-iop33x/include/mach/timex.h
3 *
4 * IOP3xx architecture timex specifications
5 */
6#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 6d68aed6548a..dc5d7a0e5d9c 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -23,7 +23,6 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/timex.h>
27#include <linux/clocksource.h> 26#include <linux/clocksource.h>
28#include <linux/clockchips.h> 27#include <linux/clockchips.h>
29#include <linux/io.h> 28#include <linux/io.h>
@@ -45,6 +44,17 @@
45#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
46#include <asm/mach/time.h> 45#include <asm/mach/time.h>
47 46
47#define IXP4XX_TIMER_FREQ 66666000
48
49/*
50 * The timer register doesn't allow to specify the two least significant bits of
51 * the timeout value and assumes them being zero. So make sure IXP4XX_LATCH is
52 * the best value with the two least significant bits unset.
53 */
54#define IXP4XX_LATCH DIV_ROUND_CLOSEST(IXP4XX_TIMER_FREQ, \
55 (IXP4XX_OST_RELOAD_MASK + 1) * HZ) * \
56 (IXP4XX_OST_RELOAD_MASK + 1)
57
48static void __init ixp4xx_clocksource_init(void); 58static void __init ixp4xx_clocksource_init(void);
49static void __init ixp4xx_clockevent_init(void); 59static void __init ixp4xx_clockevent_init(void);
50static struct clock_event_device clockevent_ixp4xx; 60static struct clock_event_device clockevent_ixp4xx;
@@ -520,7 +530,7 @@ static void ixp4xx_set_mode(enum clock_event_mode mode,
520 530
521 switch (mode) { 531 switch (mode) {
522 case CLOCK_EVT_MODE_PERIODIC: 532 case CLOCK_EVT_MODE_PERIODIC:
523 osrt = LATCH & ~IXP4XX_OST_RELOAD_MASK; 533 osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK;
524 opts = IXP4XX_OST_ENABLE; 534 opts = IXP4XX_OST_ENABLE;
525 break; 535 break;
526 case CLOCK_EVT_MODE_ONESHOT: 536 case CLOCK_EVT_MODE_ONESHOT:
diff --git a/arch/arm/mach-ixp4xx/include/mach/timex.h b/arch/arm/mach-ixp4xx/include/mach/timex.h
deleted file mode 100644
index 0396d89f947c..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/timex.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * arch/arm/mach-ixp4xx/include/mach/timex.h
3 *
4 */
5
6#include <mach/ixp4xx-regs.h>
7
8/*
9 * We use IXP425 General purpose timer for our timer needs, it runs at
10 * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the
11 * timer register ignores the bottom 2 bits of the LATCH value.
12 */
13#define IXP4XX_TIMER_FREQ 66666000
14#define CLOCK_TICK_RATE \
15 (((IXP4XX_TIMER_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
16
diff --git a/arch/arm/mach-kirkwood/include/mach/timex.h b/arch/arm/mach-kirkwood/include/mach/timex.h
deleted file mode 100644
index c923cd169b9c..000000000000
--- a/arch/arm/mach-kirkwood/include/mach/timex.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
10
diff --git a/arch/arm/mach-ks8695/include/mach/timex.h b/arch/arm/mach-ks8695/include/mach/timex.h
deleted file mode 100644
index 10f716371bd3..000000000000
--- a/arch/arm/mach-ks8695/include/mach/timex.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/timex.h
3 *
4 * Copyright (C) 2006 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * KS8695 - Time Parameters
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ASM_ARCH_TIMEX_H
15#define __ASM_ARCH_TIMEX_H
16
17#include <mach/hardware.h>
18
19#define CLOCK_TICK_RATE KS8695_CLOCK_RATE
20
21#endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/timex.h b/arch/arm/mach-lpc32xx/include/mach/timex.h
deleted file mode 100644
index 8d4066b16b3f..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/timex.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * arch/arm/mach-lpc32xx/include/mach/timex.h
3 *
4 * Author: Kevin Wells <kevin.wells@nxp.com>
5 *
6 * Copyright (C) 2010 NXP Semiconductors
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#ifndef __ASM_ARCH_TIMEX_H
20#define __ASM_ARCH_TIMEX_H
21
22/*
23 * Rate in Hz of the main system oscillator. This value should match
24 * the value 'MAIN_OSC_FREQ' in platform.h
25 */
26#define CLOCK_TICK_RATE 13000000
27
28#endif
diff --git a/arch/arm/mach-mmp/include/mach/timex.h b/arch/arm/mach-mmp/include/mach/timex.h
deleted file mode 100644
index 70c9f1d88c02..000000000000
--- a/arch/arm/mach-mmp/include/mach/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/timex.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifdef CONFIG_CPU_MMP2
10#define CLOCK_TICK_RATE 6500000
11#else
12#define CLOCK_TICK_RATE 3250000
13#endif
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 024022d91fe3..048997e75dd0 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -39,6 +39,12 @@
39 39
40#include "clock.h" 40#include "clock.h"
41 41
42#ifdef CONFIG_CPU_MMP2
43#define MMP_CLOCK_FREQ 6500000
44#else
45#define MMP_CLOCK_FREQ 3250000
46#endif
47
42#define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE 48#define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE
43 49
44#define MAX_DELTA (0xfffffffe) 50#define MAX_DELTA (0xfffffffe)
@@ -195,14 +201,14 @@ void __init timer_init(int irq)
195{ 201{
196 timer_config(); 202 timer_config();
197 203
198 sched_clock_register(mmp_read_sched_clock, 32, CLOCK_TICK_RATE); 204 sched_clock_register(mmp_read_sched_clock, 32, MMP_CLOCK_FREQ);
199 205
200 ckevt.cpumask = cpumask_of(0); 206 ckevt.cpumask = cpumask_of(0);
201 207
202 setup_irq(irq, &timer_irq); 208 setup_irq(irq, &timer_irq);
203 209
204 clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); 210 clocksource_register_hz(&cksrc, MMP_CLOCK_FREQ);
205 clockevents_config_and_register(&ckevt, CLOCK_TICK_RATE, 211 clockevents_config_and_register(&ckevt, MMP_CLOCK_FREQ,
206 MIN_DELTA, MAX_DELTA); 212 MIN_DELTA, MAX_DELTA);
207} 213}
208 214
diff --git a/arch/arm/mach-msm/include/mach/timex.h b/arch/arm/mach-msm/include/mach/timex.h
deleted file mode 100644
index a62e6b215aec..000000000000
--- a/arch/arm/mach-msm/include/mach/timex.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-msm/include/mach/timex.h
2 *
3 * Copyright (C) 2007 Google, Inc.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __ASM_ARCH_MSM_TIMEX_H
17#define __ASM_ARCH_MSM_TIMEX_H
18
19#define CLOCK_TICK_RATE 1000000
20
21#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/timex.h b/arch/arm/mach-mv78xx0/include/mach/timex.h
deleted file mode 100644
index 0e8c443c723a..000000000000
--- a/arch/arm/mach-mv78xx0/include/mach/timex.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-mv78xx0/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-netx/include/mach/timex.h b/arch/arm/mach-netx/include/mach/timex.h
deleted file mode 100644
index 1120dd0ba393..000000000000
--- a/arch/arm/mach-netx/include/mach/timex.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-netx/include/mach/timex.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define CLOCK_TICK_RATE 100000000
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index 6df42e643031..e2346013e227 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -28,6 +28,9 @@
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <mach/netx-regs.h> 29#include <mach/netx-regs.h>
30 30
31#define NETX_CLOCK_FREQ 100000000
32#define NETX_LATCH DIV_ROUND_CLOSEST(NETX_CLOCK_FREQ, HZ)
33
31#define TIMER_CLOCKEVENT 0 34#define TIMER_CLOCKEVENT 0
32#define TIMER_CLOCKSOURCE 1 35#define TIMER_CLOCKSOURCE 1
33 36
@@ -41,7 +44,7 @@ static void netx_set_mode(enum clock_event_mode mode,
41 44
42 switch (mode) { 45 switch (mode) {
43 case CLOCK_EVT_MODE_PERIODIC: 46 case CLOCK_EVT_MODE_PERIODIC:
44 writel(LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 47 writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT));
45 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | 48 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN |
46 NETX_GPIO_COUNTER_CTRL_IRQ_EN | 49 NETX_GPIO_COUNTER_CTRL_IRQ_EN |
47 NETX_GPIO_COUNTER_CTRL_RUN; 50 NETX_GPIO_COUNTER_CTRL_RUN;
@@ -114,7 +117,7 @@ void __init netx_timer_init(void)
114 /* Reset the timer value to zero */ 117 /* Reset the timer value to zero */
115 writel(0, NETX_GPIO_COUNTER_CURRENT(0)); 118 writel(0, NETX_GPIO_COUNTER_CURRENT(0));
116 119
117 writel(LATCH, NETX_GPIO_COUNTER_MAX(0)); 120 writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(0));
118 121
119 /* acknowledge interrupt */ 122 /* acknowledge interrupt */
120 writel(COUNTER_BIT(0), NETX_GPIO_IRQ); 123 writel(COUNTER_BIT(0), NETX_GPIO_IRQ);
@@ -137,11 +140,11 @@ void __init netx_timer_init(void)
137 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); 140 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
138 141
139 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), 142 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
140 "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); 143 "netx_timer", NETX_CLOCK_FREQ, 200, 32, clocksource_mmio_readl_up);
141 144
142 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. 145 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine.
143 * Adding some safety ... */ 146 * Adding some safety ... */
144 netx_clockevent.cpumask = cpumask_of(0); 147 netx_clockevent.cpumask = cpumask_of(0);
145 clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE, 148 clockevents_config_and_register(&netx_clockevent, NETX_CLOCK_FREQ,
146 0xa00, 0xfffffffe); 149 0xa00, 0xfffffffe);
147} 150}
diff --git a/arch/arm/mach-omap1/include/mach/timex.h b/arch/arm/mach-omap1/include/mach/timex.h
deleted file mode 100644
index 4793790d53cc..000000000000
--- a/arch/arm/mach-omap1/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap1/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-omap2/include/mach/timex.h b/arch/arm/mach-omap2/include/mach/timex.h
deleted file mode 100644
index de9f8fc40e7c..000000000000
--- a/arch/arm/mach-omap2/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap2/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-orion5x/include/mach/timex.h b/arch/arm/mach-orion5x/include/mach/timex.h
deleted file mode 100644
index 4c69820e0810..000000000000
--- a/arch/arm/mach-orion5x/include/mach/timex.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/include/mach/timex.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-pxa/include/mach/timex.h b/arch/arm/mach-pxa/include/mach/timex.h
deleted file mode 100644
index af6760a50e1a..000000000000
--- a/arch/arm/mach-pxa/include/mach/timex.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * arch/arm/mach-pxa/include/mach/timex.h
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software Inc.
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/* Various drivers are still using the constant of CLOCK_TICK_RATE, for
14 * those drivers to at least work, the definition is provided here.
15 *
16 * NOTE: this is no longer accurate when multiple processors and boards
17 * are selected, newer drivers should not depend on this any more. Use
18 * either the clocksource/clockevent or get this at run-time by calling
19 * get_clock_tick_rate() (as defined in generic.c).
20 */
21
22#if defined(CONFIG_PXA25x)
23/* PXA250/210 timer base */
24#define CLOCK_TICK_RATE 3686400
25#elif defined(CONFIG_PXA27x)
26/* PXA27x timer base */
27#ifdef CONFIG_MACH_MAINSTONE
28#define CLOCK_TICK_RATE 3249600
29#else
30#define CLOCK_TICK_RATE 3250000
31#endif
32#else
33#define CLOCK_TICK_RATE 3250000
34#endif
diff --git a/arch/arm/mach-realview/include/mach/timex.h b/arch/arm/mach-realview/include/mach/timex.h
deleted file mode 100644
index 4eeb069373c2..000000000000
--- a/arch/arm/mach-realview/include/mach/timex.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/mach-realview/include/mach/timex.h
3 *
4 * RealView architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-rpc/include/mach/timex.h b/arch/arm/mach-rpc/include/mach/timex.h
deleted file mode 100644
index dd75e7387bbe..000000000000
--- a/arch/arm/mach-rpc/include/mach/timex.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * arch/arm/mach-rpc/include/mach/timex.h
3 *
4 * Copyright (C) 1997, 1998 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 * RiscPC architecture timex specifications
11 */
12
13/*
14 * On the RiscPC, the clock ticks at 2MHz.
15 */
16#define CLOCK_TICK_RATE 2000000
17
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c
index 9a6def14df01..99363ae5cac7 100644
--- a/arch/arm/mach-rpc/time.c
+++ b/arch/arm/mach-rpc/time.c
@@ -24,6 +24,9 @@
24 24
25#include <asm/mach/time.h> 25#include <asm/mach/time.h>
26 26
27#define RPC_CLOCK_FREQ 2000000
28#define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ)
29
27static u32 ioc_timer_gettimeoffset(void) 30static u32 ioc_timer_gettimeoffset(void)
28{ 31{
29 unsigned int count1, count2, status; 32 unsigned int count1, count2, status;
@@ -46,23 +49,23 @@ static u32 ioc_timer_gettimeoffset(void)
46 * and count2. 49 * and count2.
47 */ 50 */
48 if (status & (1 << 5)) 51 if (status & (1 << 5))
49 offset -= LATCH; 52 offset -= RPC_LATCH;
50 } else if (count2 > count1) { 53 } else if (count2 > count1) {
51 /* 54 /*
52 * We have just had another interrupt between reading 55 * We have just had another interrupt between reading
53 * count1 and count2. 56 * count1 and count2.
54 */ 57 */
55 offset -= LATCH; 58 offset -= RPC_LATCH;
56 } 59 }
57 60
58 offset = (LATCH - offset) * (tick_nsec / 1000); 61 offset = (RPC_LATCH - offset) * (tick_nsec / 1000);
59 return ((offset + LATCH/2) / LATCH) * 1000; 62 return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000;
60} 63}
61 64
62void __init ioctime_init(void) 65void __init ioctime_init(void)
63{ 66{
64 ioc_writeb(LATCH & 255, IOC_T0LTCHL); 67 ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL);
65 ioc_writeb(LATCH >> 8, IOC_T0LTCHH); 68 ioc_writeb(RPC_LATCH >> 8, IOC_T0LTCHH);
66 ioc_writeb(0, IOC_T0GO); 69 ioc_writeb(0, IOC_T0GO);
67} 70}
68 71
diff --git a/arch/arm/mach-s3c24xx/include/mach/timex.h b/arch/arm/mach-s3c24xx/include/mach/timex.h
deleted file mode 100644
index fe9ca1ffd51b..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/timex.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - time parameters
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#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/timex.h b/arch/arm/mach-s3c64xx/include/mach/timex.h
deleted file mode 100644
index fb2e8cd40829..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/timex.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s3c64xx/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C6400 - time parameters
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#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/timex.h b/arch/arm/mach-s5p64x0/include/mach/timex.h
deleted file mode 100644
index 4b91faa195a8..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/timex.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/timex.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2003-2005 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 *
9 * S5P64X0 - time parameters
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#ifndef __ASM_ARCH_TIMEX_H
17#define __ASM_ARCH_TIMEX_H
18
19/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
20 * a variable is useless. It seems as long as we make our timers an
21 * exact multiple of HZ, any value that makes a 1->1 correspondence
22 * for the time conversion functions to/from jiffies is acceptable.
23*/
24
25#define CLOCK_TICK_RATE 12000000
26
27#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/timex.h b/arch/arm/mach-s5pc100/include/mach/timex.h
deleted file mode 100644
index 47ffb17aff96..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/timex.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s5pc100/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C6400 - time parameters
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#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/timex.h b/arch/arm/mach-s5pv210/include/mach/timex.h
deleted file mode 100644
index 73dc85496a83..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/timex.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
7 * http://www.samsung.com/
8 *
9 * Based on arch/arm/mach-s5p6442/include/mach/timex.h
10 *
11 * S5PV210 - time parameters
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_ARCH_TIMEX_H
19#define __ASM_ARCH_TIMEX_H __FILE__
20
21/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
22 * a variable is useless. It seems as long as we make our timers an
23 * exact multiple of HZ, any value that makes a 1->1 correspondence
24 * for the time conversion functions to/from jiffies is acceptable.
25*/
26
27#define CLOCK_TICK_RATE 12000000
28
29#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-sa1100/include/mach/timex.h b/arch/arm/mach-sa1100/include/mach/timex.h
deleted file mode 100644
index 7a5d017b58b3..000000000000
--- a/arch/arm/mach-sa1100/include/mach/timex.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * arch/arm/mach-sa1100/include/mach/timex.h
3 *
4 * SA1100 architecture timex specifications
5 *
6 * Copyright (C) 1998
7 */
8
9/*
10 * SA1100 timer
11 */
12#define CLOCK_TICK_RATE 3686400
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 6fd4acb8f187..7aaac005e036 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -9,6 +9,7 @@
9 * 9 *
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h>
12#include <linux/errno.h> 13#include <linux/errno.h>
13#include <linux/interrupt.h> 14#include <linux/interrupt.h>
14#include <linux/irq.h> 15#include <linux/irq.h>
@@ -20,6 +21,9 @@
20#include <mach/hardware.h> 21#include <mach/hardware.h>
21#include <mach/irqs.h> 22#include <mach/irqs.h>
22 23
24#define SA1100_CLOCK_FREQ 3686400
25#define SA1100_LATCH DIV_ROUND_CLOSEST(SA1100_CLOCK_FREQ, HZ)
26
23static u64 notrace sa1100_read_sched_clock(void) 27static u64 notrace sa1100_read_sched_clock(void)
24{ 28{
25 return readl_relaxed(OSCR); 29 return readl_relaxed(OSCR);
@@ -93,7 +97,7 @@ static void sa1100_timer_resume(struct clock_event_device *cedev)
93 /* 97 /*
94 * OSMR0 is the system timer: make sure OSCR is sufficiently behind 98 * OSMR0 is the system timer: make sure OSCR is sufficiently behind
95 */ 99 */
96 writel_relaxed(OSMR0 - LATCH, OSCR); 100 writel_relaxed(OSMR0 - SA1100_LATCH, OSCR);
97} 101}
98#else 102#else
99#define sa1100_timer_suspend NULL 103#define sa1100_timer_suspend NULL
@@ -128,7 +132,7 @@ void __init sa1100_timer_init(void)
128 132
129 setup_irq(IRQ_OST0, &sa1100_timer_irq); 133 setup_irq(IRQ_OST0, &sa1100_timer_irq);
130 134
131 clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, 135 clocksource_mmio_init(OSCR, "oscr", SA1100_CLOCK_FREQ, 200, 32,
132 clocksource_mmio_readl_up); 136 clocksource_mmio_readl_up);
133 clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400, 137 clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400,
134 MIN_OSCR_DELTA * 2, 0x7fffffff); 138 MIN_OSCR_DELTA * 2, 0x7fffffff);
diff --git a/arch/arm/mach-shmobile/include/mach/timex.h b/arch/arm/mach-shmobile/include/mach/timex.h
deleted file mode 100644
index ae0d8d825c23..000000000000
--- a/arch/arm/mach-shmobile/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_MACH_TIMEX_H
2#define __ASM_MACH_TIMEX_H
3
4#define CLOCK_TICK_RATE 1193180 /* unused i8253 PIT value */
5
6#endif /* __ASM_MACH_TIMEX_H */
diff --git a/arch/arm/mach-spear/include/mach/timex.h b/arch/arm/mach-spear/include/mach/timex.h
deleted file mode 100644
index ef95e5b780bd..000000000000
--- a/arch/arm/mach-spear/include/mach/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/plat-spear/include/plat/timex.h
3 *
4 * SPEAr platform specific timex definitions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar <viresh.linux@gmail.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_TIMEX_H
15#define __PLAT_TIMEX_H
16
17#define CLOCK_TICK_RATE 48000000
18
19#endif /* __PLAT_TIMEX_H */
diff --git a/arch/arm/mach-versatile/include/mach/timex.h b/arch/arm/mach-versatile/include/mach/timex.h
deleted file mode 100644
index 426199b1add5..000000000000
--- a/arch/arm/mach-versatile/include/mach/timex.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/mach-versatile/include/mach/timex.h
3 *
4 * Versatile architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-w90x900/include/mach/timex.h b/arch/arm/mach-w90x900/include/mach/timex.h
deleted file mode 100644
index 164dce0b64db..000000000000
--- a/arch/arm/mach-w90x900/include/mach/timex.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/timex.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/timex.h
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#ifndef __ASM_ARCH_TIMEX_H
19#define __ASM_ARCH_TIMEX_H
20
21/* CLOCK_TICK_RATE Now, I don't use it. */
22
23#define CLOCK_TICK_RATE 15000000
24
25#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/plat-omap/include/plat/timex.h b/arch/arm/plat-omap/include/plat/timex.h
deleted file mode 100644
index e27d2daa7790..000000000000
--- a/arch/arm/plat-omap/include/plat/timex.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/timex.h
3 *
4 * Copyright (C) 2000 RidgeRun, Inc.
5 * Author: Greg Lonnon <glonnon@ridgerun.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#if !defined(__ASM_ARCH_OMAP_TIMEX_H)
29#define __ASM_ARCH_OMAP_TIMEX_H
30
31#define CLOCK_TICK_RATE (HZ * 100000UL)
32
33#endif /* __ASM_ARCH_OMAP_TIMEX_H */
diff --git a/drivers/clocksource/timer-marco.c b/drivers/clocksource/timer-marco.c
index 09a17d9a6594..b52e1c078b99 100644
--- a/drivers/clocksource/timer-marco.c
+++ b/drivers/clocksource/timer-marco.c
@@ -19,7 +19,8 @@
19#include <linux/of_irq.h> 19#include <linux/of_irq.h>
20#include <linux/of_address.h> 20#include <linux/of_address.h>
21#include <linux/sched_clock.h> 21#include <linux/sched_clock.h>
22#include <asm/mach/time.h> 22
23#define MARCO_CLOCK_FREQ 1000000
23 24
24#define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 25#define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000
25#define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 26#define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004
@@ -191,7 +192,7 @@ static int sirfsoc_local_timer_setup(struct clock_event_device *ce)
191 ce->rating = 200; 192 ce->rating = 200;
192 ce->set_mode = sirfsoc_timer_set_mode; 193 ce->set_mode = sirfsoc_timer_set_mode;
193 ce->set_next_event = sirfsoc_timer_set_next_event; 194 ce->set_next_event = sirfsoc_timer_set_next_event;
194 clockevents_calc_mult_shift(ce, CLOCK_TICK_RATE, 60); 195 clockevents_calc_mult_shift(ce, MARCO_CLOCK_FREQ, 60);
195 ce->max_delta_ns = clockevent_delta2ns(-2, ce); 196 ce->max_delta_ns = clockevent_delta2ns(-2, ce);
196 ce->min_delta_ns = clockevent_delta2ns(2, ce); 197 ce->min_delta_ns = clockevent_delta2ns(2, ce);
197 ce->cpumask = cpumask_of(cpu); 198 ce->cpumask = cpumask_of(cpu);
@@ -263,11 +264,11 @@ static void __init sirfsoc_marco_timer_init(void)
263 BUG_ON(IS_ERR(clk)); 264 BUG_ON(IS_ERR(clk));
264 rate = clk_get_rate(clk); 265 rate = clk_get_rate(clk);
265 266
266 BUG_ON(rate < CLOCK_TICK_RATE); 267 BUG_ON(rate < MARCO_CLOCK_FREQ);
267 BUG_ON(rate % CLOCK_TICK_RATE); 268 BUG_ON(rate % MARCO_CLOCK_FREQ);
268 269
269 /* Initialize the timer dividers */ 270 /* Initialize the timer dividers */
270 timer_div = rate / CLOCK_TICK_RATE - 1; 271 timer_div = rate / MARCO_CLOCK_FREQ - 1;
271 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 272 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
272 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); 273 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL);
273 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); 274 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL);
@@ -283,7 +284,7 @@ static void __init sirfsoc_marco_timer_init(void)
283 /* Clear all interrupts */ 284 /* Clear all interrupts */
284 writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); 285 writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
285 286
286 BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 287 BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, MARCO_CLOCK_FREQ));
287 288
288 sirfsoc_clockevent_init(); 289 sirfsoc_clockevent_init();
289} 290}
diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
index 8a492d34ff9f..1a6b2d6356d6 100644
--- a/drivers/clocksource/timer-prima2.c
+++ b/drivers/clocksource/timer-prima2.c
@@ -21,6 +21,8 @@
21#include <linux/sched_clock.h> 21#include <linux/sched_clock.h>
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23 23
24#define PRIMA2_CLOCK_FREQ 1000000
25
24#define SIRFSOC_TIMER_COUNTER_LO 0x0000 26#define SIRFSOC_TIMER_COUNTER_LO 0x0000
25#define SIRFSOC_TIMER_COUNTER_HI 0x0004 27#define SIRFSOC_TIMER_COUNTER_HI 0x0004
26#define SIRFSOC_TIMER_MATCH_0 0x0008 28#define SIRFSOC_TIMER_MATCH_0 0x0008
@@ -173,7 +175,7 @@ static u64 notrace sirfsoc_read_sched_clock(void)
173static void __init sirfsoc_clockevent_init(void) 175static void __init sirfsoc_clockevent_init(void)
174{ 176{
175 sirfsoc_clockevent.cpumask = cpumask_of(0); 177 sirfsoc_clockevent.cpumask = cpumask_of(0);
176 clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE, 178 clockevents_config_and_register(&sirfsoc_clockevent, PRIMA2_CLOCK_FREQ,
177 2, -2); 179 2, -2);
178} 180}
179 181
@@ -190,8 +192,8 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
190 192
191 rate = clk_get_rate(clk); 193 rate = clk_get_rate(clk);
192 194
193 BUG_ON(rate < CLOCK_TICK_RATE); 195 BUG_ON(rate < PRIMA2_CLOCK_FREQ);
194 BUG_ON(rate % CLOCK_TICK_RATE); 196 BUG_ON(rate % PRIMA2_CLOCK_FREQ);
195 197
196 sirfsoc_timer_base = of_iomap(np, 0); 198 sirfsoc_timer_base = of_iomap(np, 0);
197 if (!sirfsoc_timer_base) 199 if (!sirfsoc_timer_base)
@@ -199,14 +201,16 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
199 201
200 sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); 202 sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0);
201 203
202 writel_relaxed(rate / CLOCK_TICK_RATE / 2 - 1, sirfsoc_timer_base + SIRFSOC_TIMER_DIV); 204 writel_relaxed(rate / PRIMA2_CLOCK_FREQ / 2 - 1,
205 sirfsoc_timer_base + SIRFSOC_TIMER_DIV);
203 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO); 206 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
204 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI); 207 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
205 writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS); 208 writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
206 209
207 BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 210 BUG_ON(clocksource_register_hz(&sirfsoc_clocksource,
211 PRIMA2_CLOCK_FREQ));
208 212
209 sched_clock_register(sirfsoc_read_sched_clock, 64, CLOCK_TICK_RATE); 213 sched_clock_register(sirfsoc_read_sched_clock, 64, PRIMA2_CLOCK_FREQ);
210 214
211 BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq)); 215 BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq));
212 216
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index 17ccba88d636..ed8e5e8449d3 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -67,7 +67,7 @@ static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned
67 } 67 }
68 68
69 if (value > 20 && value < 32767) 69 if (value > 20 && value < 32767)
70 count = (IXP4XX_TIMER_FREQ / (value * 4)) - 1; 70 count = (ixp4xx_timer_freq / (value * 4)) - 1;
71 71
72 ixp4xx_spkr_control(pin, count); 72 ixp4xx_spkr_control(pin, count);
73 73
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 309b8b342d9c..596374304532 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -24,7 +24,7 @@
24 24
25#include <mach/at91_rtt.h> 25#include <mach/at91_rtt.h>
26#include <mach/cpu.h> 26#include <mach/cpu.h>
27 27#include <mach/hardware.h>
28 28
29/* 29/*
30 * This driver uses two configurable hardware resources that live in the 30 * This driver uses two configurable hardware resources that live in the
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c
index a355f2b82bb8..cccbf9d89729 100644
--- a/drivers/rtc/rtc-pxa.c
+++ b/drivers/rtc/rtc-pxa.c
@@ -32,7 +32,6 @@
32 32
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34 34
35#define TIMER_FREQ CLOCK_TICK_RATE
36#define RTC_DEF_DIVIDER (32768 - 1) 35#define RTC_DEF_DIVIDER (32768 - 1)
37#define RTC_DEF_TRIM 0 36#define RTC_DEF_TRIM 0
38#define MAXFREQ_PERIODIC 1000 37#define MAXFREQ_PERIODIC 1000
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index a49f10d269b2..91c0d8839570 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -35,21 +35,18 @@
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36#include <linux/of.h> 36#include <linux/of.h>
37#include <linux/of_device.h> 37#include <linux/of_device.h>
38#include <linux/of_gpio.h>
38#include <linux/dma-mapping.h> 39#include <linux/dma-mapping.h>
39#include <linux/atmel_pdc.h> 40#include <linux/atmel_pdc.h>
40#include <linux/atmel_serial.h> 41#include <linux/atmel_serial.h>
41#include <linux/uaccess.h> 42#include <linux/uaccess.h>
42#include <linux/platform_data/atmel.h> 43#include <linux/platform_data/atmel.h>
43#include <linux/timer.h> 44#include <linux/timer.h>
45#include <linux/gpio.h>
44 46
45#include <asm/io.h> 47#include <asm/io.h>
46#include <asm/ioctls.h> 48#include <asm/ioctls.h>
47 49
48#ifdef CONFIG_ARM
49#include <mach/cpu.h>
50#include <asm/gpio.h>
51#endif
52
53#define PDC_BUFFER_SIZE 512 50#define PDC_BUFFER_SIZE 512
54/* Revisit: We should calculate this based on the actual port settings */ 51/* Revisit: We should calculate this based on the actual port settings */
55#define PDC_RX_TIMEOUT (3 * 10) /* 3 bytes */ 52#define PDC_RX_TIMEOUT (3 * 10) /* 3 bytes */
@@ -168,6 +165,7 @@ struct atmel_uart_port {
168 struct circ_buf rx_ring; 165 struct circ_buf rx_ring;
169 166
170 struct serial_rs485 rs485; /* rs485 settings */ 167 struct serial_rs485 rs485; /* rs485 settings */
168 int rts_gpio; /* optional RTS GPIO */
171 unsigned int tx_done_mask; 169 unsigned int tx_done_mask;
172 bool is_usart; /* usart or uart */ 170 bool is_usart; /* usart or uart */
173 struct timer_list uart_timer; /* uart timer */ 171 struct timer_list uart_timer; /* uart timer */
@@ -301,20 +299,16 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
301 unsigned int mode; 299 unsigned int mode;
302 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 300 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
303 301
304#ifdef CONFIG_ARCH_AT91RM9200 302 /*
305 if (cpu_is_at91rm9200()) { 303 * AT91RM9200 Errata #39: RTS0 is not internally connected
306 /* 304 * to PA21. We need to drive the pin as a GPIO.
307 * AT91RM9200 Errata #39: RTS0 is not internally connected 305 */
308 * to PA21. We need to drive the pin manually. 306 if (gpio_is_valid(atmel_port->rts_gpio)) {
309 */ 307 if (mctrl & TIOCM_RTS)
310 if (port->mapbase == AT91RM9200_BASE_US0) { 308 gpio_set_value(atmel_port->rts_gpio, 0);
311 if (mctrl & TIOCM_RTS) 309 else
312 at91_set_gpio_value(AT91_PIN_PA21, 0); 310 gpio_set_value(atmel_port->rts_gpio, 1);
313 else
314 at91_set_gpio_value(AT91_PIN_PA21, 1);
315 }
316 } 311 }
317#endif
318 312
319 if (mctrl & TIOCM_RTS) 313 if (mctrl & TIOCM_RTS)
320 control |= ATMEL_US_RTSEN; 314 control |= ATMEL_US_RTSEN;
@@ -2389,6 +2383,25 @@ static int atmel_serial_probe(struct platform_device *pdev)
2389 port = &atmel_ports[ret]; 2383 port = &atmel_ports[ret];
2390 port->backup_imr = 0; 2384 port->backup_imr = 0;
2391 port->uart.line = ret; 2385 port->uart.line = ret;
2386 port->rts_gpio = -EINVAL; /* Invalid, zero could be valid */
2387 if (pdata)
2388 port->rts_gpio = pdata->rts_gpio;
2389 else if (np)
2390 port->rts_gpio = of_get_named_gpio(np, "rts-gpios", 0);
2391
2392 if (gpio_is_valid(port->rts_gpio)) {
2393 ret = devm_gpio_request(&pdev->dev, port->rts_gpio, "RTS");
2394 if (ret) {
2395 dev_err(&pdev->dev, "error requesting RTS GPIO\n");
2396 goto err;
2397 }
2398 /* Default to 1 as RTS is active low */
2399 ret = gpio_direction_output(port->rts_gpio, 1);
2400 if (ret) {
2401 dev_err(&pdev->dev, "error setting up RTS GPIO\n");
2402 goto err;
2403 }
2404 }
2392 2405
2393 ret = atmel_init_port(port, pdev); 2406 ret = atmel_init_port(port, pdev);
2394 if (ret) 2407 if (ret)
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index cea9f70133c5..e26b0c14edea 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -84,6 +84,7 @@ struct atmel_uart_data {
84 short use_dma_rx; /* use receive DMA? */ 84 short use_dma_rx; /* use receive DMA? */
85 void __iomem *regs; /* virt. base address, if any */ 85 void __iomem *regs; /* virt. base address, if any */
86 struct serial_rs485 rs485; /* rs485 settings */ 86 struct serial_rs485 rs485; /* rs485 settings */
87 int rts_gpio; /* optional RTS GPIO */
87}; 88};
88 89
89 /* Touchscreen Controller */ 90 /* Touchscreen Controller */