aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear6xx/spear6xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-spear6xx/spear6xx.c')
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c60
1 files changed, 43 insertions, 17 deletions
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index f2fe14e8471d..981812961ac7 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -18,9 +18,9 @@
18#include <asm/hardware/vic.h> 18#include <asm/hardware/vic.h>
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <mach/irqs.h>
22#include <mach/generic.h> 21#include <mach/generic.h>
23#include <mach/spear.h> 22#include <mach/hardware.h>
23#include <mach/irqs.h>
24 24
25/* Add spear6xx machines common devices here */ 25/* Add spear6xx machines common devices here */
26/* uart device registration */ 26/* uart device registration */
@@ -31,8 +31,7 @@ struct amba_device uart_device[] = {
31 }, 31 },
32 .res = { 32 .res = {
33 .start = SPEAR6XX_ICM1_UART0_BASE, 33 .start = SPEAR6XX_ICM1_UART0_BASE,
34 .end = SPEAR6XX_ICM1_UART0_BASE + 34 .end = SPEAR6XX_ICM1_UART0_BASE + SZ_4K - 1,
35 SPEAR6XX_ICM1_UART0_SIZE - 1,
36 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
37 }, 36 },
38 .irq = {IRQ_UART_0, NO_IRQ}, 37 .irq = {IRQ_UART_0, NO_IRQ},
@@ -42,8 +41,7 @@ struct amba_device uart_device[] = {
42 }, 41 },
43 .res = { 42 .res = {
44 .start = SPEAR6XX_ICM1_UART1_BASE, 43 .start = SPEAR6XX_ICM1_UART1_BASE,
45 .end = SPEAR6XX_ICM1_UART1_BASE + 44 .end = SPEAR6XX_ICM1_UART1_BASE + SZ_4K - 1,
46 SPEAR6XX_ICM1_UART1_SIZE - 1,
47 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
48 }, 46 },
49 .irq = {IRQ_UART_1, NO_IRQ}, 47 .irq = {IRQ_UART_1, NO_IRQ},
@@ -72,8 +70,7 @@ struct amba_device gpio_device[] = {
72 }, 70 },
73 .res = { 71 .res = {
74 .start = SPEAR6XX_CPU_GPIO_BASE, 72 .start = SPEAR6XX_CPU_GPIO_BASE,
75 .end = SPEAR6XX_CPU_GPIO_BASE + 73 .end = SPEAR6XX_CPU_GPIO_BASE + SZ_4K - 1,
76 SPEAR6XX_CPU_GPIO_SIZE - 1,
77 .flags = IORESOURCE_MEM, 74 .flags = IORESOURCE_MEM,
78 }, 75 },
79 .irq = {IRQ_LOCAL_GPIO, NO_IRQ}, 76 .irq = {IRQ_LOCAL_GPIO, NO_IRQ},
@@ -84,8 +81,7 @@ struct amba_device gpio_device[] = {
84 }, 81 },
85 .res = { 82 .res = {
86 .start = SPEAR6XX_ICM3_GPIO_BASE, 83 .start = SPEAR6XX_ICM3_GPIO_BASE,
87 .end = SPEAR6XX_ICM3_GPIO_BASE + 84 .end = SPEAR6XX_ICM3_GPIO_BASE + SZ_4K - 1,
88 SPEAR6XX_ICM3_GPIO_SIZE - 1,
89 .flags = IORESOURCE_MEM, 85 .flags = IORESOURCE_MEM,
90 }, 86 },
91 .irq = {IRQ_BASIC_GPIO, NO_IRQ}, 87 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
@@ -96,8 +92,7 @@ struct amba_device gpio_device[] = {
96 }, 92 },
97 .res = { 93 .res = {
98 .start = SPEAR6XX_ICM2_GPIO_BASE, 94 .start = SPEAR6XX_ICM2_GPIO_BASE,
99 .end = SPEAR6XX_ICM2_GPIO_BASE + 95 .end = SPEAR6XX_ICM2_GPIO_BASE + SZ_4K - 1,
100 SPEAR6XX_ICM2_GPIO_SIZE - 1,
101 .flags = IORESOURCE_MEM, 96 .flags = IORESOURCE_MEM,
102 }, 97 },
103 .irq = {IRQ_APPL_GPIO, NO_IRQ}, 98 .irq = {IRQ_APPL_GPIO, NO_IRQ},
@@ -122,27 +117,27 @@ static struct map_desc spear6xx_io_desc[] __initdata = {
122 { 117 {
123 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE, 118 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE,
124 .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE), 119 .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE),
125 .length = SPEAR6XX_ICM1_UART0_SIZE, 120 .length = SZ_4K,
126 .type = MT_DEVICE 121 .type = MT_DEVICE
127 }, { 122 }, {
128 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE, 123 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE,
129 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE), 124 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE),
130 .length = SPEAR6XX_CPU_VIC_PRI_SIZE, 125 .length = SZ_4K,
131 .type = MT_DEVICE 126 .type = MT_DEVICE
132 }, { 127 }, {
133 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE, 128 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE,
134 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE), 129 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE),
135 .length = SPEAR6XX_CPU_VIC_SEC_SIZE, 130 .length = SZ_4K,
136 .type = MT_DEVICE 131 .type = MT_DEVICE
137 }, { 132 }, {
138 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE, 133 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE,
139 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE), 134 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE),
140 .length = SPEAR6XX_ICM3_MISC_REG_BASE, 135 .length = SZ_4K,
141 .type = MT_DEVICE 136 .type = MT_DEVICE
142 }, { 137 }, {
143 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE, 138 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE,
144 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE), 139 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE),
145 .length = SPEAR6XX_ICM3_MISC_REG_SIZE, 140 .length = SZ_4K,
146 .type = MT_DEVICE 141 .type = MT_DEVICE
147 }, 142 },
148}; 143};
@@ -155,3 +150,34 @@ void __init spear6xx_map_io(void)
155 /* This will initialize clock framework */ 150 /* This will initialize clock framework */
156 clk_init(); 151 clk_init();
157} 152}
153
154static void __init spear6xx_timer_init(void)
155{
156 char pclk_name[] = "pll3_48m_clk";
157 struct clk *gpt_clk, *pclk;
158
159 /* get the system timer clock */
160 gpt_clk = clk_get_sys("gpt0", NULL);
161 if (IS_ERR(gpt_clk)) {
162 pr_err("%s:couldn't get clk for gpt\n", __func__);
163 BUG();
164 }
165
166 /* get the suitable parent clock for timer*/
167 pclk = clk_get(NULL, pclk_name);
168 if (IS_ERR(pclk)) {
169 pr_err("%s:couldn't get %s as parent for gpt\n",
170 __func__, pclk_name);
171 BUG();
172 }
173
174 clk_set_parent(gpt_clk, pclk);
175 clk_put(gpt_clk);
176 clk_put(pclk);
177
178 spear_setup_timer();
179}
180
181struct sys_timer spear6xx_timer = {
182 .init = spear6xx_timer_init,
183};