Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'dropmachtimexh-v2' of git://git.pengutronix.de/git/ukl/linux

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.

Conflicts:
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-mmp/time.c
arch/arm/mach-sa1100/time.c

+153 -732
+3
Documentation/devicetree/bindings/serial/atmel-usart.txt
··· 13 13 Optional properties: 14 14 - atmel,use-dma-rx: use of PDC or DMA for receiving data 15 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 18 - add dma bindings for dma transfer: 17 19 - dmas: DMA specifier, consisting of a phandle to DMA controller node, 18 20 memory peripheral interface and USART DMA channel ID, FIFO configuration. ··· 35 33 clock-names = "usart"; 36 34 atmel,use-dma-rx; 37 35 atmel,use-dma-tx; 36 + rts-gpios = <&pioD 15 0>; 38 37 }; 39 38 40 39 - use DMA:
-6
arch/arm/include/asm/timex.h
··· 12 12 #ifndef _ASMARM_TIMEX_H 13 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 - 21 15 typedef unsigned long cycles_t; 22 16 #define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) 23 17
+1
arch/arm/mach-at91/at91rm9200.c
··· 21 21 #include <mach/at91rm9200.h> 22 22 #include <mach/at91_st.h> 23 23 #include <mach/cpu.h> 24 + #include <mach/hardware.h> 24 25 25 26 #include "at91_aic.h" 26 27 #include "soc.h"
+9 -2
arch/arm/mach-at91/at91rm9200_devices.c
··· 21 21 #include <mach/at91rm9200.h> 22 22 #include <mach/at91rm9200_mc.h> 23 23 #include <mach/at91_ramc.h> 24 + #include <mach/hardware.h> 24 25 25 26 #include "board.h" 26 27 #include "generic.h" ··· 923 922 static struct atmel_uart_data dbgu_data = { 924 923 .use_dma_tx = 0, 925 924 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 925 + .rts_gpio = -EINVAL, 926 926 }; 927 927 928 928 static u64 dbgu_dmamask = DMA_BIT_MASK(32); ··· 962 960 static struct atmel_uart_data uart0_data = { 963 961 .use_dma_tx = 1, 964 962 .use_dma_rx = 1, 963 + .rts_gpio = -EINVAL, 965 964 }; 966 965 967 966 static u64 uart0_dmamask = DMA_BIT_MASK(32); ··· 990 987 if (pins & ATMEL_UART_RTS) { 991 988 /* 992 989 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21. 993 - * We need to drive the pin manually. Default is off (RTS is active low). 990 + * We need to drive the pin manually. The serial driver will driver 991 + * this to high when initializing. 994 992 */ 995 - at91_set_gpio_output(AT91_PIN_PA21, 1); 993 + uart0_data.rts_gpio = AT91_PIN_PA21; 996 994 } 997 995 } 998 996 ··· 1013 1009 static struct atmel_uart_data uart1_data = { 1014 1010 .use_dma_tx = 1, 1015 1011 .use_dma_rx = 1, 1012 + .rts_gpio = -EINVAL, 1016 1013 }; 1017 1014 1018 1015 static u64 uart1_dmamask = DMA_BIT_MASK(32); ··· 1065 1060 static struct atmel_uart_data uart2_data = { 1066 1061 .use_dma_tx = 1, 1067 1062 .use_dma_rx = 1, 1063 + .rts_gpio = -EINVAL, 1068 1064 }; 1069 1065 1070 1066 static u64 uart2_dmamask = DMA_BIT_MASK(32); ··· 1109 1103 static struct atmel_uart_data uart3_data = { 1110 1104 .use_dma_tx = 1, 1111 1105 .use_dma_rx = 1, 1106 + .rts_gpio = -EINVAL, 1112 1107 }; 1113 1108 1114 1109 static u64 uart3_dmamask = DMA_BIT_MASK(32);
+1
arch/arm/mach-at91/at91rm9200_time.c
··· 31 31 #include <asm/mach/time.h> 32 32 33 33 #include <mach/at91_st.h> 34 + #include <mach/hardware.h> 34 35 35 36 static unsigned long last_crtr; 36 37 static u32 irqmask;
+1
arch/arm/mach-at91/at91sam9260.c
··· 21 21 #include <mach/cpu.h> 22 22 #include <mach/at91_dbgu.h> 23 23 #include <mach/at91sam9260.h> 24 + #include <mach/hardware.h> 24 25 25 26 #include "at91_aic.h" 26 27 #include "at91_rstc.h"
+8
arch/arm/mach-at91/at91sam9260_devices.c
··· 25 25 #include <mach/at91_matrix.h> 26 26 #include <mach/at91sam9_smc.h> 27 27 #include <mach/at91_adc.h> 28 + #include <mach/hardware.h> 28 29 29 30 #include "board.h" 30 31 #include "generic.h" ··· 820 819 static struct atmel_uart_data dbgu_data = { 821 820 .use_dma_tx = 0, 822 821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 822 + .rts_gpio = -EINVAL, 823 823 }; 824 824 825 825 static u64 dbgu_dmamask = DMA_BIT_MASK(32); ··· 859 857 static struct atmel_uart_data uart0_data = { 860 858 .use_dma_tx = 1, 861 859 .use_dma_rx = 1, 860 + .rts_gpio = -EINVAL, 862 861 }; 863 862 864 863 static u64 uart0_dmamask = DMA_BIT_MASK(32); ··· 911 908 static struct atmel_uart_data uart1_data = { 912 909 .use_dma_tx = 1, 913 910 .use_dma_rx = 1, 911 + .rts_gpio = -EINVAL, 914 912 }; 915 913 916 914 static u64 uart1_dmamask = DMA_BIT_MASK(32); ··· 955 951 static struct atmel_uart_data uart2_data = { 956 952 .use_dma_tx = 1, 957 953 .use_dma_rx = 1, 954 + .rts_gpio = -EINVAL, 958 955 }; 959 956 960 957 static u64 uart2_dmamask = DMA_BIT_MASK(32); ··· 999 994 static struct atmel_uart_data uart3_data = { 1000 995 .use_dma_tx = 1, 1001 996 .use_dma_rx = 1, 997 + .rts_gpio = -EINVAL, 1002 998 }; 1003 999 1004 1000 static u64 uart3_dmamask = DMA_BIT_MASK(32); ··· 1043 1037 static struct atmel_uart_data uart4_data = { 1044 1038 .use_dma_tx = 1, 1045 1039 .use_dma_rx = 1, 1040 + .rts_gpio = -EINVAL, 1046 1041 }; 1047 1042 1048 1043 static u64 uart4_dmamask = DMA_BIT_MASK(32); ··· 1082 1075 static struct atmel_uart_data uart5_data = { 1083 1076 .use_dma_tx = 1, 1084 1077 .use_dma_rx = 1, 1078 + .rts_gpio = -EINVAL, 1085 1079 }; 1086 1080 1087 1081 static u64 uart5_dmamask = DMA_BIT_MASK(32);
+1
arch/arm/mach-at91/at91sam9261.c
··· 20 20 #include <asm/system_misc.h> 21 21 #include <mach/cpu.h> 22 22 #include <mach/at91sam9261.h> 23 + #include <mach/hardware.h> 23 24 24 25 #include "at91_aic.h" 25 26 #include "at91_rstc.h"
+5
arch/arm/mach-at91/at91sam9261_devices.c
··· 25 25 #include <mach/at91sam9261_matrix.h> 26 26 #include <mach/at91_matrix.h> 27 27 #include <mach/at91sam9_smc.h> 28 + #include <mach/hardware.h> 28 29 29 30 #include "board.h" 30 31 #include "generic.h" ··· 881 880 static struct atmel_uart_data dbgu_data = { 882 881 .use_dma_tx = 0, 883 882 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 883 + .rts_gpio = -EINVAL, 884 884 }; 885 885 886 886 static u64 dbgu_dmamask = DMA_BIT_MASK(32); ··· 920 918 static struct atmel_uart_data uart0_data = { 921 919 .use_dma_tx = 1, 922 920 .use_dma_rx = 1, 921 + .rts_gpio = -EINVAL, 923 922 }; 924 923 925 924 static u64 uart0_dmamask = DMA_BIT_MASK(32); ··· 964 961 static struct atmel_uart_data uart1_data = { 965 962 .use_dma_tx = 1, 966 963 .use_dma_rx = 1, 964 + .rts_gpio = -EINVAL, 967 965 }; 968 966 969 967 static u64 uart1_dmamask = DMA_BIT_MASK(32); ··· 1008 1004 static struct atmel_uart_data uart2_data = { 1009 1005 .use_dma_tx = 1, 1010 1006 .use_dma_rx = 1, 1007 + .rts_gpio = -EINVAL, 1011 1008 }; 1012 1009 1013 1010 static u64 uart2_dmamask = DMA_BIT_MASK(32);
+1
arch/arm/mach-at91/at91sam9263.c
··· 19 19 #include <asm/mach/map.h> 20 20 #include <asm/system_misc.h> 21 21 #include <mach/at91sam9263.h> 22 + #include <mach/hardware.h> 22 23 23 24 #include "at91_aic.h" 24 25 #include "at91_rstc.h"
+5
arch/arm/mach-at91/at91sam9263_devices.c
··· 24 24 #include <mach/at91sam9263_matrix.h> 25 25 #include <mach/at91_matrix.h> 26 26 #include <mach/at91sam9_smc.h> 27 + #include <mach/hardware.h> 27 28 28 29 #include "board.h" 29 30 #include "generic.h" ··· 1325 1324 static struct atmel_uart_data dbgu_data = { 1326 1325 .use_dma_tx = 0, 1327 1326 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 1327 + .rts_gpio = -EINVAL, 1328 1328 }; 1329 1329 1330 1330 static u64 dbgu_dmamask = DMA_BIT_MASK(32); ··· 1364 1362 static struct atmel_uart_data uart0_data = { 1365 1363 .use_dma_tx = 1, 1366 1364 .use_dma_rx = 1, 1365 + .rts_gpio = -EINVAL, 1367 1366 }; 1368 1367 1369 1368 static u64 uart0_dmamask = DMA_BIT_MASK(32); ··· 1408 1405 static struct atmel_uart_data uart1_data = { 1409 1406 .use_dma_tx = 1, 1410 1407 .use_dma_rx = 1, 1408 + .rts_gpio = -EINVAL, 1411 1409 }; 1412 1410 1413 1411 static u64 uart1_dmamask = DMA_BIT_MASK(32); ··· 1452 1448 static struct atmel_uart_data uart2_data = { 1453 1449 .use_dma_tx = 1, 1454 1450 .use_dma_rx = 1, 1451 + .rts_gpio = -EINVAL, 1455 1452 }; 1456 1453 1457 1454 static u64 uart2_dmamask = DMA_BIT_MASK(32);
+1
arch/arm/mach-at91/at91sam926x_time.c
··· 19 19 #include <linux/of_irq.h> 20 20 21 21 #include <asm/mach/time.h> 22 + #include <mach/hardware.h> 22 23 23 24 #define AT91_PIT_MR 0x00 /* Mode Register */ 24 25 #define AT91_PIT_PITIEN (1 << 25) /* Timer Interrupt Enable */
+1
arch/arm/mach-at91/at91sam9g45.c
··· 20 20 #include <asm/system_misc.h> 21 21 #include <mach/at91sam9g45.h> 22 22 #include <mach/cpu.h> 23 + #include <mach/hardware.h> 23 24 24 25 #include "at91_aic.h" 25 26 #include "soc.h"
+6
arch/arm/mach-at91/at91sam9g45_devices.c
··· 32 32 #include <mach/at91sam9_smc.h> 33 33 #include <linux/platform_data/dma-atmel.h> 34 34 #include <mach/atmel-mci.h> 35 + #include <mach/hardware.h> 35 36 36 37 #include <media/atmel-isi.h> 37 38 ··· 1588 1587 static struct atmel_uart_data dbgu_data = { 1589 1588 .use_dma_tx = 0, 1590 1589 .use_dma_rx = 0, 1590 + .rts_gpio = -EINVAL, 1591 1591 }; 1592 1592 1593 1593 static u64 dbgu_dmamask = DMA_BIT_MASK(32); ··· 1627 1625 static struct atmel_uart_data uart0_data = { 1628 1626 .use_dma_tx = 1, 1629 1627 .use_dma_rx = 1, 1628 + .rts_gpio = -EINVAL, 1630 1629 }; 1631 1630 1632 1631 static u64 uart0_dmamask = DMA_BIT_MASK(32); ··· 1671 1668 static struct atmel_uart_data uart1_data = { 1672 1669 .use_dma_tx = 1, 1673 1670 .use_dma_rx = 1, 1671 + .rts_gpio = -EINVAL, 1674 1672 }; 1675 1673 1676 1674 static u64 uart1_dmamask = DMA_BIT_MASK(32); ··· 1715 1711 static struct atmel_uart_data uart2_data = { 1716 1712 .use_dma_tx = 1, 1717 1713 .use_dma_rx = 1, 1714 + .rts_gpio = -EINVAL, 1718 1715 }; 1719 1716 1720 1717 static u64 uart2_dmamask = DMA_BIT_MASK(32); ··· 1759 1754 static struct atmel_uart_data uart3_data = { 1760 1755 .use_dma_tx = 1, 1761 1756 .use_dma_rx = 1, 1757 + .rts_gpio = -EINVAL, 1762 1758 }; 1763 1759 1764 1760 static u64 uart3_dmamask = DMA_BIT_MASK(32);
+1
arch/arm/mach-at91/at91sam9rl.c
··· 20 20 #include <mach/cpu.h> 21 21 #include <mach/at91_dbgu.h> 22 22 #include <mach/at91sam9rl.h> 23 + #include <mach/hardware.h> 23 24 24 25 #include "at91_aic.h" 25 26 #include "at91_rstc.h"
+6
arch/arm/mach-at91/at91sam9rl_devices.c
··· 21 21 #include <mach/at91sam9rl_matrix.h> 22 22 #include <mach/at91_matrix.h> 23 23 #include <mach/at91sam9_smc.h> 24 + #include <mach/hardware.h> 24 25 #include <linux/platform_data/dma-atmel.h> 25 26 26 27 #include "board.h" ··· 957 956 static struct atmel_uart_data dbgu_data = { 958 957 .use_dma_tx = 0, 959 958 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 959 + .rts_gpio = -EINVAL, 960 960 }; 961 961 962 962 static u64 dbgu_dmamask = DMA_BIT_MASK(32); ··· 996 994 static struct atmel_uart_data uart0_data = { 997 995 .use_dma_tx = 1, 998 996 .use_dma_rx = 1, 997 + .rts_gpio = -EINVAL, 999 998 }; 1000 999 1001 1000 static u64 uart0_dmamask = DMA_BIT_MASK(32); ··· 1048 1045 static struct atmel_uart_data uart1_data = { 1049 1046 .use_dma_tx = 1, 1050 1047 .use_dma_rx = 1, 1048 + .rts_gpio = -EINVAL, 1051 1049 }; 1052 1050 1053 1051 static u64 uart1_dmamask = DMA_BIT_MASK(32); ··· 1092 1088 static struct atmel_uart_data uart2_data = { 1093 1089 .use_dma_tx = 1, 1094 1090 .use_dma_rx = 1, 1091 + .rts_gpio = -EINVAL, 1095 1092 }; 1096 1093 1097 1094 static u64 uart2_dmamask = DMA_BIT_MASK(32); ··· 1136 1131 static struct atmel_uart_data uart3_data = { 1137 1132 .use_dma_tx = 1, 1138 1133 .use_dma_rx = 1, 1134 + .rts_gpio = -EINVAL, 1139 1135 }; 1140 1136 1141 1137 static u64 uart3_dmamask = DMA_BIT_MASK(32);
+1 -1
arch/arm/mach-at91/at91x40.c
··· 19 19 #include <asm/mach/arch.h> 20 20 #include <mach/at91x40.h> 21 21 #include <mach/at91_st.h> 22 - #include <mach/timex.h> 22 + #include <mach/hardware.h> 23 23 24 24 #include "at91_aic.h" 25 25 #include "generic.h"
+1
arch/arm/mach-at91/at91x40_time.c
··· 25 25 #include <linux/time.h> 26 26 #include <linux/io.h> 27 27 #include <mach/hardware.h> 28 + #include <mach/at91x40.h> 28 29 #include <asm/mach/time.h> 29 30 30 31 #include "at91_tc.h"
+1
arch/arm/mach-at91/board-gsia18s.c
··· 31 31 #include <asm/mach/arch.h> 32 32 33 33 #include <mach/at91sam9_smc.h> 34 + #include <mach/hardware.h> 34 35 35 36 #include "at91_aic.h" 36 37 #include "board.h"
+1
arch/arm/mach-at91/board-pcontrol-g20.c
··· 30 30 #include <asm/mach/arch.h> 31 31 32 32 #include <mach/at91sam9_smc.h> 33 + #include <mach/hardware.h> 33 34 34 35 #include "at91_aic.h" 35 36 #include "board.h"
+1
arch/arm/mach-at91/board-stamp9g20.c
··· 26 26 #include <asm/mach/arch.h> 27 27 28 28 #include <mach/at91sam9_smc.h> 29 + #include <mach/hardware.h> 29 30 30 31 #include "at91_aic.h" 31 32 #include "board.h"
+2
arch/arm/mach-at91/include/mach/at91x40.h
··· 55 55 #define AT91_PS_CR (AT91_PS + 0) /* PS Control register */ 56 56 #define AT91_PS_CR_CPU (1 << 0) /* CPU clock disable bit */ 57 57 58 + #define AT91X40_MASTER_CLOCK 40000000 59 + 58 60 #endif /* AT91X40_H */
-37
arch/arm/mach-at91/include/mach/timex.h
··· 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 */
+1
arch/arm/mach-at91/pm.c
··· 27 27 #include <asm/mach/irq.h> 28 28 29 29 #include <mach/cpu.h> 30 + #include <mach/hardware.h> 30 31 31 32 #include "at91_aic.h" 32 33 #include "generic.h"
-2
arch/arm/mach-clps711x/include/mach/timex.h
··· 1 - /* Bogus value */ 2 - #define CLOCK_TICK_RATE 512000
-22
arch/arm/mach-davinci/include/mach/timex.h
··· 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__ */
-9
arch/arm/mach-dove/include/mach/timex.h
··· 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)
-19
arch/arm/mach-ebsa110/include/mach/timex.h
··· 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 -
+1 -1
arch/arm/mach-ep93xx/core.c
··· 117 117 #define EP93XX_TIMER4_CLOCK 983040 118 118 119 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 122 122 static unsigned int last_jiffy_time; 123 123
-5
arch/arm/mach-ep93xx/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-ep93xx/include/mach/timex.h 3 - */ 4 - 5 - #define CLOCK_TICK_RATE 983040
-29
arch/arm/mach-exynos/include/mach/timex.h
··· 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 */
-18
arch/arm/mach-footbridge/include/mach/timex.h
··· 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)
-13
arch/arm/mach-gemini/include/mach/timex.h
··· 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
-26
arch/arm/mach-integrator/include/mach/timex.h
··· 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)
-1
arch/arm/mach-iop13xx/include/mach/timex.h
··· 1 - #define CLOCK_TICK_RATE (100 * HZ)
-6
arch/arm/mach-iop32x/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-iop32x/include/mach/timex.h 3 - * 4 - * IOP32x architecture timex specifications 5 - */ 6 - #define CLOCK_TICK_RATE (100 * HZ)
-6
arch/arm/mach-iop33x/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-iop33x/include/mach/timex.h 3 - * 4 - * IOP3xx architecture timex specifications 5 - */ 6 - #define CLOCK_TICK_RATE (100 * HZ)
+12 -2
arch/arm/mach-ixp4xx/common.c
··· 23 23 #include <linux/interrupt.h> 24 24 #include <linux/bitops.h> 25 25 #include <linux/time.h> 26 - #include <linux/timex.h> 27 26 #include <linux/clocksource.h> 28 27 #include <linux/clockchips.h> 29 28 #include <linux/io.h> ··· 43 44 #include <asm/mach/map.h> 44 45 #include <asm/mach/irq.h> 45 46 #include <asm/mach/time.h> 47 + 48 + #define IXP4XX_TIMER_FREQ 66666000 49 + 50 + /* 51 + * The timer register doesn't allow to specify the two least significant bits of 52 + * the timeout value and assumes them being zero. So make sure IXP4XX_LATCH is 53 + * the best value with the two least significant bits unset. 54 + */ 55 + #define IXP4XX_LATCH DIV_ROUND_CLOSEST(IXP4XX_TIMER_FREQ, \ 56 + (IXP4XX_OST_RELOAD_MASK + 1) * HZ) * \ 57 + (IXP4XX_OST_RELOAD_MASK + 1) 46 58 47 59 static void __init ixp4xx_clocksource_init(void); 48 60 static void __init ixp4xx_clockevent_init(void); ··· 530 520 531 521 switch (mode) { 532 522 case CLOCK_EVT_MODE_PERIODIC: 533 - osrt = LATCH & ~IXP4XX_OST_RELOAD_MASK; 523 + osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK; 534 524 opts = IXP4XX_OST_ENABLE; 535 525 break; 536 526 case CLOCK_EVT_MODE_ONESHOT:
-16
arch/arm/mach-ixp4xx/include/mach/timex.h
··· 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 -
-10
arch/arm/mach-kirkwood/include/mach/timex.h
··· 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 -
-21
arch/arm/mach-ks8695/include/mach/timex.h
··· 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
-28
arch/arm/mach-lpc32xx/include/mach/timex.h
··· 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
-13
arch/arm/mach-mmp/include/mach/timex.h
··· 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
+9 -3
arch/arm/mach-mmp/time.c
··· 39 39 40 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 48 #define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE 43 49 44 50 #define MAX_DELTA (0xfffffffe) ··· 201 195 { 202 196 timer_config(); 203 197 204 - sched_clock_register(mmp_read_sched_clock, 32, CLOCK_TICK_RATE); 198 + sched_clock_register(mmp_read_sched_clock, 32, MMP_CLOCK_FREQ); 205 199 206 200 ckevt.cpumask = cpumask_of(0); 207 201 208 202 setup_irq(irq, &timer_irq); 209 203 210 - clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); 211 - clockevents_config_and_register(&ckevt, CLOCK_TICK_RATE, 204 + clocksource_register_hz(&cksrc, MMP_CLOCK_FREQ); 205 + clockevents_config_and_register(&ckevt, MMP_CLOCK_FREQ, 212 206 MIN_DELTA, MAX_DELTA); 213 207 } 214 208
-21
arch/arm/mach-msm/include/mach/timex.h
··· 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
-9
arch/arm/mach-mv78xx0/include/mach/timex.h
··· 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)
-20
arch/arm/mach-netx/include/mach/timex.h
··· 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
+7 -4
arch/arm/mach-netx/time.c
··· 28 28 #include <asm/mach/time.h> 29 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 34 #define TIMER_CLOCKEVENT 0 32 35 #define TIMER_CLOCKSOURCE 1 33 36 ··· 44 41 45 42 switch (mode) { 46 43 case CLOCK_EVT_MODE_PERIODIC: 47 - writel(LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 44 + writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 48 45 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | 49 46 NETX_GPIO_COUNTER_CTRL_IRQ_EN | 50 47 NETX_GPIO_COUNTER_CTRL_RUN; ··· 117 114 /* Reset the timer value to zero */ 118 115 writel(0, NETX_GPIO_COUNTER_CURRENT(0)); 119 116 120 - writel(LATCH, NETX_GPIO_COUNTER_MAX(0)); 117 + writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(0)); 121 118 122 119 /* acknowledge interrupt */ 123 120 writel(COUNTER_BIT(0), NETX_GPIO_IRQ); ··· 140 137 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); 141 138 142 139 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), 143 - "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); 140 + "netx_timer", NETX_CLOCK_FREQ, 200, 32, clocksource_mmio_readl_up); 144 141 145 142 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. 146 143 * Adding some safety ... */ 147 144 netx_clockevent.cpumask = cpumask_of(0); 148 - clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE, 145 + clockevents_config_and_register(&netx_clockevent, NETX_CLOCK_FREQ, 149 146 0xa00, 0xfffffffe); 150 147 }
-5
arch/arm/mach-omap1/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-omap1/include/mach/timex.h 3 - */ 4 - 5 - #include <plat/timex.h>
-5
arch/arm/mach-omap2/include/mach/timex.h
··· 1 - /* 2 - * arch/arm/mach-omap2/include/mach/timex.h 3 - */ 4 - 5 - #include <plat/timex.h>
-11
arch/arm/mach-orion5x/include/mach/timex.h
··· 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)
-34
arch/arm/mach-pxa/include/mach/timex.h
··· 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
-23
arch/arm/mach-realview/include/mach/timex.h
··· 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)
-17
arch/arm/mach-rpc/include/mach/timex.h
··· 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 -
+9 -6
arch/arm/mach-rpc/time.c
··· 24 24 25 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 + 27 30 static u32 ioc_timer_gettimeoffset(void) 28 31 { 29 32 unsigned int count1, count2, status; ··· 49 46 * and count2. 50 47 */ 51 48 if (status & (1 << 5)) 52 - offset -= LATCH; 49 + offset -= RPC_LATCH; 53 50 } else if (count2 > count1) { 54 51 /* 55 52 * We have just had another interrupt between reading 56 53 * count1 and count2. 57 54 */ 58 - offset -= LATCH; 55 + offset -= RPC_LATCH; 59 56 } 60 57 61 - offset = (LATCH - offset) * (tick_nsec / 1000); 62 - return ((offset + LATCH/2) / LATCH) * 1000; 58 + offset = (RPC_LATCH - offset) * (tick_nsec / 1000); 59 + return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000; 63 60 } 64 61 65 62 void __init ioctime_init(void) 66 63 { 67 - ioc_writeb(LATCH & 255, IOC_T0LTCHL); 68 - ioc_writeb(LATCH >> 8, IOC_T0LTCHH); 64 + ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL); 65 + ioc_writeb(RPC_LATCH >> 8, IOC_T0LTCHH); 69 66 ioc_writeb(0, IOC_T0GO); 70 67 } 71 68
-24
arch/arm/mach-s3c24xx/include/mach/timex.h
··· 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 */
-24
arch/arm/mach-s3c64xx/include/mach/timex.h
··· 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 */
-27
arch/arm/mach-s5p64x0/include/mach/timex.h
··· 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 */
-24
arch/arm/mach-s5pc100/include/mach/timex.h
··· 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 */
-29
arch/arm/mach-s5pv210/include/mach/timex.h
··· 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 */
-12
arch/arm/mach-sa1100/include/mach/timex.h
··· 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
+6 -2
arch/arm/mach-sa1100/time.c
··· 9 9 * 10 10 */ 11 11 #include <linux/init.h> 12 + #include <linux/kernel.h> 12 13 #include <linux/errno.h> 13 14 #include <linux/interrupt.h> 14 15 #include <linux/irq.h> ··· 20 19 #include <asm/mach/time.h> 21 20 #include <mach/hardware.h> 22 21 #include <mach/irqs.h> 22 + 23 + #define SA1100_CLOCK_FREQ 3686400 24 + #define SA1100_LATCH DIV_ROUND_CLOSEST(SA1100_CLOCK_FREQ, HZ) 23 25 24 26 static u64 notrace sa1100_read_sched_clock(void) 25 27 { ··· 97 93 /* 98 94 * OSMR0 is the system timer: make sure OSCR is sufficiently behind 99 95 */ 100 - writel_relaxed(OSMR0 - LATCH, OSCR); 96 + writel_relaxed(OSMR0 - SA1100_LATCH, OSCR); 101 97 } 102 98 #else 103 99 #define sa1100_timer_suspend NULL ··· 132 128 133 129 setup_irq(IRQ_OST0, &sa1100_timer_irq); 134 130 135 - clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, 131 + clocksource_mmio_init(OSCR, "oscr", SA1100_CLOCK_FREQ, 200, 32, 136 132 clocksource_mmio_readl_up); 137 133 clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400, 138 134 MIN_OSCR_DELTA * 2, 0x7fffffff);
-6
arch/arm/mach-shmobile/include/mach/timex.h
··· 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 */
-19
arch/arm/mach-spear/include/mach/timex.h
··· 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 */
-23
arch/arm/mach-versatile/include/mach/timex.h
··· 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)
-25
arch/arm/mach-w90x900/include/mach/timex.h
··· 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 */
-33
arch/arm/plat-omap/include/plat/timex.h
··· 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 */
+7 -6
drivers/clocksource/timer-marco.c
··· 19 19 #include <linux/of_irq.h> 20 20 #include <linux/of_address.h> 21 21 #include <linux/sched_clock.h> 22 - #include <asm/mach/time.h> 22 + 23 + #define MARCO_CLOCK_FREQ 1000000 23 24 24 25 #define SIRFSOC_TIMER_32COUNTER_0_CTRL 0x0000 25 26 #define SIRFSOC_TIMER_32COUNTER_1_CTRL 0x0004 ··· 192 191 ce->rating = 200; 193 192 ce->set_mode = sirfsoc_timer_set_mode; 194 193 ce->set_next_event = sirfsoc_timer_set_next_event; 195 - clockevents_calc_mult_shift(ce, CLOCK_TICK_RATE, 60); 194 + clockevents_calc_mult_shift(ce, MARCO_CLOCK_FREQ, 60); 196 195 ce->max_delta_ns = clockevent_delta2ns(-2, ce); 197 196 ce->min_delta_ns = clockevent_delta2ns(2, ce); 198 197 ce->cpumask = cpumask_of(cpu); ··· 264 263 BUG_ON(IS_ERR(clk)); 265 264 rate = clk_get_rate(clk); 266 265 267 - BUG_ON(rate < CLOCK_TICK_RATE); 268 - BUG_ON(rate % CLOCK_TICK_RATE); 266 + BUG_ON(rate < MARCO_CLOCK_FREQ); 267 + BUG_ON(rate % MARCO_CLOCK_FREQ); 269 268 270 269 /* Initialize the timer dividers */ 271 - timer_div = rate / CLOCK_TICK_RATE - 1; 270 + timer_div = rate / MARCO_CLOCK_FREQ - 1; 272 271 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL); 273 272 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL); 274 273 writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL); ··· 284 283 /* Clear all interrupts */ 285 284 writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS); 286 285 287 - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 286 + BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, MARCO_CLOCK_FREQ)); 288 287 289 288 sirfsoc_clockevent_init(); 290 289 }
+10 -6
drivers/clocksource/timer-prima2.c
··· 21 21 #include <linux/sched_clock.h> 22 22 #include <asm/mach/time.h> 23 23 24 + #define PRIMA2_CLOCK_FREQ 1000000 25 + 24 26 #define SIRFSOC_TIMER_COUNTER_LO 0x0000 25 27 #define SIRFSOC_TIMER_COUNTER_HI 0x0004 26 28 #define SIRFSOC_TIMER_MATCH_0 0x0008 ··· 175 173 static void __init sirfsoc_clockevent_init(void) 176 174 { 177 175 sirfsoc_clockevent.cpumask = cpumask_of(0); 178 - clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE, 176 + clockevents_config_and_register(&sirfsoc_clockevent, PRIMA2_CLOCK_FREQ, 179 177 2, -2); 180 178 } 181 179 ··· 192 190 193 191 rate = clk_get_rate(clk); 194 192 195 - BUG_ON(rate < CLOCK_TICK_RATE); 196 - BUG_ON(rate % CLOCK_TICK_RATE); 193 + BUG_ON(rate < PRIMA2_CLOCK_FREQ); 194 + BUG_ON(rate % PRIMA2_CLOCK_FREQ); 197 195 198 196 sirfsoc_timer_base = of_iomap(np, 0); 199 197 if (!sirfsoc_timer_base) ··· 201 199 202 200 sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0); 203 201 204 - writel_relaxed(rate / CLOCK_TICK_RATE / 2 - 1, sirfsoc_timer_base + SIRFSOC_TIMER_DIV); 202 + writel_relaxed(rate / PRIMA2_CLOCK_FREQ / 2 - 1, 203 + sirfsoc_timer_base + SIRFSOC_TIMER_DIV); 205 204 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO); 206 205 writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI); 207 206 writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS); 208 207 209 - BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE)); 208 + BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, 209 + PRIMA2_CLOCK_FREQ)); 210 210 211 - sched_clock_register(sirfsoc_read_sched_clock, 64, CLOCK_TICK_RATE); 211 + sched_clock_register(sirfsoc_read_sched_clock, 64, PRIMA2_CLOCK_FREQ); 212 212 213 213 BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq)); 214 214
+1 -1
drivers/input/misc/ixp4xx-beeper.c
··· 67 67 } 68 68 69 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 72 ixp4xx_spkr_control(pin, count); 73 73
+1 -1
drivers/rtc/rtc-at91sam9.c
··· 24 24 25 25 #include <mach/at91_rtt.h> 26 26 #include <mach/cpu.h> 27 - 27 + #include <mach/hardware.h> 28 28 29 29 /* 30 30 * This driver uses two configurable hardware resources that live in the
-1
drivers/rtc/rtc-pxa.c
··· 32 32 33 33 #include <mach/hardware.h> 34 34 35 - #define TIMER_FREQ CLOCK_TICK_RATE 36 35 #define RTC_DEF_DIVIDER (32768 - 1) 37 36 #define RTC_DEF_TRIM 0 38 37 #define MAXFREQ_PERIODIC 1000
+31 -18
drivers/tty/serial/atmel_serial.c
··· 35 35 #include <linux/platform_device.h> 36 36 #include <linux/of.h> 37 37 #include <linux/of_device.h> 38 + #include <linux/of_gpio.h> 38 39 #include <linux/dma-mapping.h> 39 40 #include <linux/atmel_pdc.h> 40 41 #include <linux/atmel_serial.h> 41 42 #include <linux/uaccess.h> 42 43 #include <linux/platform_data/atmel.h> 43 44 #include <linux/timer.h> 45 + #include <linux/gpio.h> 44 46 45 47 #include <asm/io.h> 46 48 #include <asm/ioctls.h> 47 - 48 - #ifdef CONFIG_ARM 49 - #include <mach/cpu.h> 50 - #include <asm/gpio.h> 51 - #endif 52 49 53 50 #define PDC_BUFFER_SIZE 512 54 51 /* Revisit: We should calculate this based on the actual port settings */ ··· 165 168 struct circ_buf rx_ring; 166 169 167 170 struct serial_rs485 rs485; /* rs485 settings */ 171 + int rts_gpio; /* optional RTS GPIO */ 168 172 unsigned int tx_done_mask; 169 173 bool is_usart; /* usart or uart */ 170 174 struct timer_list uart_timer; /* uart timer */ ··· 299 301 unsigned int mode; 300 302 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 301 303 302 - #ifdef CONFIG_ARCH_AT91RM9200 303 - if (cpu_is_at91rm9200()) { 304 - /* 305 - * AT91RM9200 Errata #39: RTS0 is not internally connected 306 - * to PA21. We need to drive the pin manually. 307 - */ 308 - if (port->mapbase == AT91RM9200_BASE_US0) { 309 - if (mctrl & TIOCM_RTS) 310 - at91_set_gpio_value(AT91_PIN_PA21, 0); 311 - else 312 - at91_set_gpio_value(AT91_PIN_PA21, 1); 313 - } 304 + /* 305 + * AT91RM9200 Errata #39: RTS0 is not internally connected 306 + * to PA21. We need to drive the pin as a GPIO. 307 + */ 308 + if (gpio_is_valid(atmel_port->rts_gpio)) { 309 + if (mctrl & TIOCM_RTS) 310 + gpio_set_value(atmel_port->rts_gpio, 0); 311 + else 312 + gpio_set_value(atmel_port->rts_gpio, 1); 314 313 } 315 - #endif 316 314 317 315 if (mctrl & TIOCM_RTS) 318 316 control |= ATMEL_US_RTSEN; ··· 2383 2389 port = &atmel_ports[ret]; 2384 2390 port->backup_imr = 0; 2385 2391 port->uart.line = ret; 2392 + port->rts_gpio = -EINVAL; /* Invalid, zero could be valid */ 2393 + if (pdata) 2394 + port->rts_gpio = pdata->rts_gpio; 2395 + else if (np) 2396 + port->rts_gpio = of_get_named_gpio(np, "rts-gpios", 0); 2397 + 2398 + if (gpio_is_valid(port->rts_gpio)) { 2399 + ret = devm_gpio_request(&pdev->dev, port->rts_gpio, "RTS"); 2400 + if (ret) { 2401 + dev_err(&pdev->dev, "error requesting RTS GPIO\n"); 2402 + goto err; 2403 + } 2404 + /* Default to 1 as RTS is active low */ 2405 + ret = gpio_direction_output(port->rts_gpio, 1); 2406 + if (ret) { 2407 + dev_err(&pdev->dev, "error setting up RTS GPIO\n"); 2408 + goto err; 2409 + } 2410 + } 2386 2411 2387 2412 ret = atmel_init_port(port, pdev); 2388 2413 if (ret)
+1
include/linux/platform_data/atmel.h
··· 84 84 short use_dma_rx; /* use receive DMA? */ 85 85 void __iomem *regs; /* virt. base address, if any */ 86 86 struct serial_rs485 rs485; /* rs485 settings */ 87 + int rts_gpio; /* optional RTS GPIO */ 87 88 }; 88 89 89 90 /* Touchscreen Controller */