aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh2/setup-sh7619.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/sh2/setup-sh7619.c')
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index 0e32d8e448ca..13798733f2db 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -12,6 +12,8 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/serial.h> 13#include <linux/serial.h>
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/sh_timer.h>
16#include <linux/io.h>
15 17
16enum { 18enum {
17 UNUSED = 0, 19 UNUSED = 0,
@@ -109,9 +111,75 @@ static struct platform_device eth_device = {
109 .resource = eth_resources, 111 .resource = eth_resources,
110}; 112};
111 113
114static struct sh_timer_config cmt0_platform_data = {
115 .name = "CMT0",
116 .channel_offset = 0x02,
117 .timer_bit = 0,
118 .clk = "peripheral_clk",
119 .clockevent_rating = 125,
120 .clocksource_rating = 0, /* disabled due to code generation issues */
121};
122
123static struct resource cmt0_resources[] = {
124 [0] = {
125 .name = "CMT0",
126 .start = 0xf84a0072,
127 .end = 0xf84a0077,
128 .flags = IORESOURCE_MEM,
129 },
130 [1] = {
131 .start = 86,
132 .flags = IORESOURCE_IRQ,
133 },
134};
135
136static struct platform_device cmt0_device = {
137 .name = "sh_cmt",
138 .id = 0,
139 .dev = {
140 .platform_data = &cmt0_platform_data,
141 },
142 .resource = cmt0_resources,
143 .num_resources = ARRAY_SIZE(cmt0_resources),
144};
145
146static struct sh_timer_config cmt1_platform_data = {
147 .name = "CMT1",
148 .channel_offset = 0x08,
149 .timer_bit = 1,
150 .clk = "peripheral_clk",
151 .clockevent_rating = 125,
152 .clocksource_rating = 0, /* disabled due to code generation issues */
153};
154
155static struct resource cmt1_resources[] = {
156 [0] = {
157 .name = "CMT1",
158 .start = 0xf84a0078,
159 .end = 0xf84a007d,
160 .flags = IORESOURCE_MEM,
161 },
162 [1] = {
163 .start = 87,
164 .flags = IORESOURCE_IRQ,
165 },
166};
167
168static struct platform_device cmt1_device = {
169 .name = "sh_cmt",
170 .id = 1,
171 .dev = {
172 .platform_data = &cmt1_platform_data,
173 },
174 .resource = cmt1_resources,
175 .num_resources = ARRAY_SIZE(cmt1_resources),
176};
177
112static struct platform_device *sh7619_devices[] __initdata = { 178static struct platform_device *sh7619_devices[] __initdata = {
113 &sci_device, 179 &sci_device,
114 &eth_device, 180 &eth_device,
181 &cmt0_device,
182 &cmt1_device,
115}; 183};
116 184
117static int __init sh7619_devices_setup(void) 185static int __init sh7619_devices_setup(void)
@@ -125,3 +193,19 @@ void __init plat_irq_setup(void)
125{ 193{
126 register_intc_controller(&intc_desc); 194 register_intc_controller(&intc_desc);
127} 195}
196
197static struct platform_device *sh7619_early_devices[] __initdata = {
198 &cmt0_device,
199 &cmt1_device,
200};
201
202#define STBCR3 0xf80a0000
203
204void __init plat_early_device_setup(void)
205{
206 /* enable CMT clock */
207 __raw_writeb(__raw_readb(STBCR3) & ~0x10, STBCR3);
208
209 early_platform_add_devices(sh7619_early_devices,
210 ARRAY_SIZE(sh7619_early_devices));
211}