diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7366.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 139 |
1 files changed, 136 insertions, 3 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c index f26b5cdad0d1..6851dba02f31 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c | |||
@@ -13,6 +13,112 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/uio_driver.h> | ||
17 | #include <asm/clock.h> | ||
18 | |||
19 | static struct resource iic_resources[] = { | ||
20 | [0] = { | ||
21 | .name = "IIC", | ||
22 | .start = 0x04470000, | ||
23 | .end = 0x04470017, | ||
24 | .flags = IORESOURCE_MEM, | ||
25 | }, | ||
26 | [1] = { | ||
27 | .start = 96, | ||
28 | .end = 99, | ||
29 | .flags = IORESOURCE_IRQ, | ||
30 | }, | ||
31 | }; | ||
32 | |||
33 | static struct platform_device iic_device = { | ||
34 | .name = "i2c-sh_mobile", | ||
35 | .num_resources = ARRAY_SIZE(iic_resources), | ||
36 | .resource = iic_resources, | ||
37 | }; | ||
38 | |||
39 | static struct uio_info vpu_platform_data = { | ||
40 | .name = "VPU5", | ||
41 | .version = "0", | ||
42 | .irq = 60, | ||
43 | }; | ||
44 | |||
45 | static struct resource vpu_resources[] = { | ||
46 | [0] = { | ||
47 | .name = "VPU", | ||
48 | .start = 0xfe900000, | ||
49 | .end = 0xfe902807, | ||
50 | .flags = IORESOURCE_MEM, | ||
51 | }, | ||
52 | [1] = { | ||
53 | /* place holder for contiguous memory */ | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | static struct platform_device vpu_device = { | ||
58 | .name = "uio_pdrv_genirq", | ||
59 | .id = 0, | ||
60 | .dev = { | ||
61 | .platform_data = &vpu_platform_data, | ||
62 | }, | ||
63 | .resource = vpu_resources, | ||
64 | .num_resources = ARRAY_SIZE(vpu_resources), | ||
65 | }; | ||
66 | |||
67 | static struct uio_info veu0_platform_data = { | ||
68 | .name = "VEU", | ||
69 | .version = "0", | ||
70 | .irq = 54, | ||
71 | }; | ||
72 | |||
73 | static struct resource veu0_resources[] = { | ||
74 | [0] = { | ||
75 | .name = "VEU(1)", | ||
76 | .start = 0xfe920000, | ||
77 | .end = 0xfe9200b7, | ||
78 | .flags = IORESOURCE_MEM, | ||
79 | }, | ||
80 | [1] = { | ||
81 | /* place holder for contiguous memory */ | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct platform_device veu0_device = { | ||
86 | .name = "uio_pdrv_genirq", | ||
87 | .id = 1, | ||
88 | .dev = { | ||
89 | .platform_data = &veu0_platform_data, | ||
90 | }, | ||
91 | .resource = veu0_resources, | ||
92 | .num_resources = ARRAY_SIZE(veu0_resources), | ||
93 | }; | ||
94 | |||
95 | static struct uio_info veu1_platform_data = { | ||
96 | .name = "VEU", | ||
97 | .version = "0", | ||
98 | .irq = 27, | ||
99 | }; | ||
100 | |||
101 | static struct resource veu1_resources[] = { | ||
102 | [0] = { | ||
103 | .name = "VEU(2)", | ||
104 | .start = 0xfe924000, | ||
105 | .end = 0xfe9240b7, | ||
106 | .flags = IORESOURCE_MEM, | ||
107 | }, | ||
108 | [1] = { | ||
109 | /* place holder for contiguous memory */ | ||
110 | }, | ||
111 | }; | ||
112 | |||
113 | static struct platform_device veu1_device = { | ||
114 | .name = "uio_pdrv_genirq", | ||
115 | .id = 2, | ||
116 | .dev = { | ||
117 | .platform_data = &veu1_platform_data, | ||
118 | }, | ||
119 | .resource = veu1_resources, | ||
120 | .num_resources = ARRAY_SIZE(veu1_resources), | ||
121 | }; | ||
16 | 122 | ||
17 | static struct plat_sci_port sci_platform_data[] = { | 123 | static struct plat_sci_port sci_platform_data[] = { |
18 | { | 124 | { |
@@ -34,11 +140,32 @@ static struct platform_device sci_device = { | |||
34 | }; | 140 | }; |
35 | 141 | ||
36 | static struct platform_device *sh7366_devices[] __initdata = { | 142 | static struct platform_device *sh7366_devices[] __initdata = { |
143 | &iic_device, | ||
37 | &sci_device, | 144 | &sci_device, |
145 | &vpu_device, | ||
146 | &veu0_device, | ||
147 | &veu1_device, | ||
38 | }; | 148 | }; |
39 | 149 | ||
40 | static int __init sh7366_devices_setup(void) | 150 | static int __init sh7366_devices_setup(void) |
41 | { | 151 | { |
152 | clk_always_enable("mstp031"); /* TLB */ | ||
153 | clk_always_enable("mstp030"); /* IC */ | ||
154 | clk_always_enable("mstp029"); /* OC */ | ||
155 | clk_always_enable("mstp028"); /* RSMEM */ | ||
156 | clk_always_enable("mstp026"); /* XYMEM */ | ||
157 | clk_always_enable("mstp023"); /* INTC3 */ | ||
158 | clk_always_enable("mstp022"); /* INTC */ | ||
159 | clk_always_enable("mstp020"); /* SuperHyway */ | ||
160 | clk_always_enable("mstp109"); /* I2C */ | ||
161 | clk_always_enable("mstp207"); /* VEU-2 */ | ||
162 | clk_always_enable("mstp202"); /* VEU-1 */ | ||
163 | clk_always_enable("mstp201"); /* VPU */ | ||
164 | |||
165 | platform_resource_setup_memory(&vpu_device, "vpu", 2 << 20); | ||
166 | platform_resource_setup_memory(&veu0_device, "veu0", 2 << 20); | ||
167 | platform_resource_setup_memory(&veu1_device, "veu1", 2 << 20); | ||
168 | |||
42 | return platform_add_devices(sh7366_devices, | 169 | return platform_add_devices(sh7366_devices, |
43 | ARRAY_SIZE(sh7366_devices)); | 170 | ARRAY_SIZE(sh7366_devices)); |
44 | } | 171 | } |
@@ -97,7 +224,7 @@ static struct intc_vect vectors[] __initdata = { | |||
97 | INTC_VECT(SIU, 0xf80), | 224 | INTC_VECT(SIU, 0xf80), |
98 | INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), | 225 | INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), |
99 | INTC_VECT(TMU2, 0x440), | 226 | INTC_VECT(TMU2, 0x440), |
100 | INTC_VECT(VEU2, 0x580), INTC_VECT(LCDC, 0x580), | 227 | INTC_VECT(VEU2, 0x560), INTC_VECT(LCDC, 0x580), |
101 | }; | 228 | }; |
102 | 229 | ||
103 | static struct intc_group groups[] __initdata = { | 230 | static struct intc_group groups[] __initdata = { |
@@ -163,8 +290,14 @@ static struct intc_sense_reg sense_registers[] __initdata = { | |||
163 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, | 290 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, |
164 | }; | 291 | }; |
165 | 292 | ||
166 | static DECLARE_INTC_DESC(intc_desc, "sh7366", vectors, groups, | 293 | static struct intc_mask_reg ack_registers[] __initdata = { |
167 | mask_registers, prio_registers, sense_registers); | 294 | { 0xa4140024, 0, 8, /* INTREQ00 */ |
295 | { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, | ||
296 | }; | ||
297 | |||
298 | static DECLARE_INTC_DESC_ACK(intc_desc, "sh7366", vectors, groups, | ||
299 | mask_registers, prio_registers, sense_registers, | ||
300 | ack_registers); | ||
168 | 301 | ||
169 | void __init plat_irq_setup(void) | 302 | void __init plat_irq_setup(void) |
170 | { | 303 | { |