diff options
Diffstat (limited to 'arch/sh/boards')
27 files changed, 1067 insertions, 142 deletions
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig index 07b35ca2f64..9c94711aa6c 100644 --- a/arch/sh/boards/Kconfig +++ b/arch/sh/boards/Kconfig | |||
@@ -155,6 +155,8 @@ config SH_SDK7786 | |||
155 | depends on CPU_SUBTYPE_SH7786 | 155 | depends on CPU_SUBTYPE_SH7786 |
156 | select SYS_SUPPORTS_PCI | 156 | select SYS_SUPPORTS_PCI |
157 | select NO_IOPORT if !PCI | 157 | select NO_IOPORT if !PCI |
158 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
159 | select HAVE_SRAM_POOL | ||
158 | help | 160 | help |
159 | Select SDK7786 if configuring for a Renesas Technology Europe | 161 | Select SDK7786 if configuring for a Renesas Technology Europe |
160 | SH7786-65nm board. | 162 | SH7786-65nm board. |
@@ -165,6 +167,11 @@ config SH_HIGHLANDER | |||
165 | select SYS_SUPPORTS_PCI | 167 | select SYS_SUPPORTS_PCI |
166 | select IO_TRAPPED if MMU | 168 | select IO_TRAPPED if MMU |
167 | 169 | ||
170 | config SH_SH7757LCR | ||
171 | bool "SH7757LCR" | ||
172 | depends on CPU_SUBTYPE_SH7757 | ||
173 | select ARCH_REQUIRE_GPIOLIB | ||
174 | |||
168 | config SH_SH7785LCR | 175 | config SH_SH7785LCR |
169 | bool "SH7785LCR" | 176 | bool "SH7785LCR" |
170 | depends on CPU_SUBTYPE_SH7785 | 177 | depends on CPU_SUBTYPE_SH7785 |
@@ -309,6 +316,17 @@ config SH_POLARIS | |||
309 | help | 316 | help |
310 | Select if configuring for an SMSC Polaris development board | 317 | Select if configuring for an SMSC Polaris development board |
311 | 318 | ||
319 | config SH_SH2007 | ||
320 | bool "SH-2007 board" | ||
321 | select NO_IOPORT | ||
322 | depends on CPU_SUBTYPE_SH7780 | ||
323 | help | ||
324 | SH-2007 is a single-board computer based around SH7780 chip | ||
325 | intended for embedded applications. | ||
326 | It has an Ethernet interface (SMC9118), direct connected | ||
327 | Compact Flash socket, two serial ports and PC-104 bus. | ||
328 | More information at <http://sh2000.sh-linux.org>. | ||
329 | |||
312 | endmenu | 330 | endmenu |
313 | 331 | ||
314 | source "arch/sh/boards/mach-r2d/Kconfig" | 332 | source "arch/sh/boards/mach-r2d/Kconfig" |
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile index 4f90f9b7a92..38ef655cc0f 100644 --- a/arch/sh/boards/Makefile +++ b/arch/sh/boards/Makefile | |||
@@ -2,6 +2,7 @@ | |||
2 | # Specific board support, not covered by a mach group. | 2 | # Specific board support, not covered by a mach group. |
3 | # | 3 | # |
4 | obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o | 4 | obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o |
5 | obj-$(CONFIG_SH_SH2007) += board-sh2007.o | ||
5 | obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o | 6 | obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o |
6 | obj-$(CONFIG_SH_URQUELL) += board-urquell.o | 7 | obj-$(CONFIG_SH_URQUELL) += board-urquell.o |
7 | obj-$(CONFIG_SH_SHMIN) += board-shmin.o | 8 | obj-$(CONFIG_SH_SHMIN) += board-shmin.o |
@@ -9,3 +10,4 @@ obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o | |||
9 | obj-$(CONFIG_SH_ESPT) += board-espt.o | 10 | obj-$(CONFIG_SH_ESPT) += board-espt.o |
10 | obj-$(CONFIG_SH_POLARIS) += board-polaris.o | 11 | obj-$(CONFIG_SH_POLARIS) += board-polaris.o |
11 | obj-$(CONFIG_SH_TITAN) += board-titan.o | 12 | obj-$(CONFIG_SH_TITAN) += board-titan.o |
13 | obj-$(CONFIG_SH_SH7757LCR) += board-sh7757lcr.o | ||
diff --git a/arch/sh/boards/board-sh2007.c b/arch/sh/boards/board-sh2007.c new file mode 100644 index 00000000000..b90b78f6a82 --- /dev/null +++ b/arch/sh/boards/board-sh2007.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* | ||
2 | * SH-2007 board support. | ||
3 | * | ||
4 | * Copyright (C) 2003, 2004 SUGIOKA Toshinobu | ||
5 | * Copyright (C) 2010 Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> | ||
6 | */ | ||
7 | #include <linux/init.h> | ||
8 | #include <linux/irq.h> | ||
9 | #include <linux/smsc911x.h> | ||
10 | #include <linux/platform_device.h> | ||
11 | #include <linux/ata_platform.h> | ||
12 | #include <linux/io.h> | ||
13 | #include <asm/machvec.h> | ||
14 | #include <mach/sh2007.h> | ||
15 | |||
16 | struct smsc911x_platform_config smc911x_info = { | ||
17 | .flags = SMSC911X_USE_32BIT, | ||
18 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
19 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
20 | }; | ||
21 | |||
22 | static struct resource smsc9118_0_resources[] = { | ||
23 | [0] = { | ||
24 | .start = SMC0_BASE, | ||
25 | .end = SMC0_BASE + 0xff, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | [1] = { | ||
29 | .start = evt2irq(0x240), | ||
30 | .end = evt2irq(0x240), | ||
31 | .flags = IORESOURCE_IRQ, | ||
32 | } | ||
33 | }; | ||
34 | |||
35 | static struct resource smsc9118_1_resources[] = { | ||
36 | [0] = { | ||
37 | .start = SMC1_BASE, | ||
38 | .end = SMC1_BASE + 0xff, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }, | ||
41 | [1] = { | ||
42 | .start = evt2irq(0x280), | ||
43 | .end = evt2irq(0x280), | ||
44 | .flags = IORESOURCE_IRQ, | ||
45 | } | ||
46 | }; | ||
47 | |||
48 | static struct platform_device smsc9118_0_device = { | ||
49 | .name = "smsc911x", | ||
50 | .id = 0, | ||
51 | .num_resources = ARRAY_SIZE(smsc9118_0_resources), | ||
52 | .resource = smsc9118_0_resources, | ||
53 | .dev = { | ||
54 | .platform_data = &smc911x_info, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static struct platform_device smsc9118_1_device = { | ||
59 | .name = "smsc911x", | ||
60 | .id = 1, | ||
61 | .num_resources = ARRAY_SIZE(smsc9118_1_resources), | ||
62 | .resource = smsc9118_1_resources, | ||
63 | .dev = { | ||
64 | .platform_data = &smc911x_info, | ||
65 | }, | ||
66 | }; | ||
67 | |||
68 | static struct resource cf_resources[] = { | ||
69 | [0] = { | ||
70 | .start = CF_BASE + CF_OFFSET, | ||
71 | .end = CF_BASE + CF_OFFSET + 0x0f, | ||
72 | .flags = IORESOURCE_MEM, | ||
73 | }, | ||
74 | [1] = { | ||
75 | .start = CF_BASE + CF_OFFSET + 0x206, | ||
76 | .end = CF_BASE + CF_OFFSET + 0x20f, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, | ||
79 | [2] = { | ||
80 | .start = evt2irq(0x2c0), | ||
81 | .end = evt2irq(0x2c0), | ||
82 | .flags = IORESOURCE_IRQ, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device cf_device = { | ||
87 | .name = "pata_platform", | ||
88 | .id = 0, | ||
89 | .num_resources = ARRAY_SIZE(cf_resources), | ||
90 | .resource = cf_resources, | ||
91 | }; | ||
92 | |||
93 | static struct platform_device *sh2007_devices[] __initdata = { | ||
94 | &smsc9118_0_device, | ||
95 | &smsc9118_1_device, | ||
96 | &cf_device, | ||
97 | }; | ||
98 | |||
99 | static int __init sh2007_io_init(void) | ||
100 | { | ||
101 | platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); | ||
102 | return 0; | ||
103 | } | ||
104 | subsys_initcall(sh2007_io_init); | ||
105 | |||
106 | static void __init sh2007_init_irq(void) | ||
107 | { | ||
108 | plat_irq_setup_pins(IRQ_MODE_IRQ); | ||
109 | } | ||
110 | |||
111 | /* | ||
112 | * Initialize the board | ||
113 | */ | ||
114 | static void __init sh2007_setup(char **cmdline_p) | ||
115 | { | ||
116 | printk(KERN_INFO "SH-2007 Setup..."); | ||
117 | |||
118 | /* setup wait control registers for area 5 */ | ||
119 | __raw_writel(CS5BCR_D, CS5BCR); | ||
120 | __raw_writel(CS5WCR_D, CS5WCR); | ||
121 | __raw_writel(CS5PCR_D, CS5PCR); | ||
122 | |||
123 | printk(KERN_INFO " done.\n"); | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * The Machine Vector | ||
128 | */ | ||
129 | struct sh_machine_vector mv_sh2007 __initmv = { | ||
130 | .mv_setup = sh2007_setup, | ||
131 | .mv_name = "sh2007", | ||
132 | .mv_init_irq = sh2007_init_irq, | ||
133 | }; | ||
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c new file mode 100644 index 00000000000..c475f1056ab --- /dev/null +++ b/arch/sh/boards/board-sh7757lcr.c | |||
@@ -0,0 +1,374 @@ | |||
1 | /* | ||
2 | * Renesas R0P7757LC0012RL Support. | ||
3 | * | ||
4 | * Copyright (C) 2009 - 2010 Renesas Solutions Corp. | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/gpio.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/spi/spi.h> | ||
16 | #include <linux/spi/flash.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <cpu/sh7757.h> | ||
19 | #include <asm/sh_eth.h> | ||
20 | #include <asm/heartbeat.h> | ||
21 | |||
22 | static struct resource heartbeat_resource = { | ||
23 | .start = 0xffec005c, /* PUDR */ | ||
24 | .end = 0xffec005c, | ||
25 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, | ||
26 | }; | ||
27 | |||
28 | static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 }; | ||
29 | |||
30 | static struct heartbeat_data heartbeat_data = { | ||
31 | .bit_pos = heartbeat_bit_pos, | ||
32 | .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), | ||
33 | .flags = HEARTBEAT_INVERTED, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device heartbeat_device = { | ||
37 | .name = "heartbeat", | ||
38 | .id = -1, | ||
39 | .dev = { | ||
40 | .platform_data = &heartbeat_data, | ||
41 | }, | ||
42 | .num_resources = 1, | ||
43 | .resource = &heartbeat_resource, | ||
44 | }; | ||
45 | |||
46 | /* Fast Ethernet */ | ||
47 | static struct resource sh_eth0_resources[] = { | ||
48 | { | ||
49 | .start = 0xfef00000, | ||
50 | .end = 0xfef001ff, | ||
51 | .flags = IORESOURCE_MEM, | ||
52 | }, { | ||
53 | .start = 84, | ||
54 | .end = 84, | ||
55 | .flags = IORESOURCE_IRQ, | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | static struct sh_eth_plat_data sh7757_eth0_pdata = { | ||
60 | .phy = 1, | ||
61 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | ||
62 | }; | ||
63 | |||
64 | static struct platform_device sh7757_eth0_device = { | ||
65 | .name = "sh-eth", | ||
66 | .resource = sh_eth0_resources, | ||
67 | .id = 0, | ||
68 | .num_resources = ARRAY_SIZE(sh_eth0_resources), | ||
69 | .dev = { | ||
70 | .platform_data = &sh7757_eth0_pdata, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct resource sh_eth1_resources[] = { | ||
75 | { | ||
76 | .start = 0xfef00800, | ||
77 | .end = 0xfef009ff, | ||
78 | .flags = IORESOURCE_MEM, | ||
79 | }, { | ||
80 | .start = 84, | ||
81 | .end = 84, | ||
82 | .flags = IORESOURCE_IRQ, | ||
83 | }, | ||
84 | }; | ||
85 | |||
86 | static struct sh_eth_plat_data sh7757_eth1_pdata = { | ||
87 | .phy = 1, | ||
88 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | ||
89 | }; | ||
90 | |||
91 | static struct platform_device sh7757_eth1_device = { | ||
92 | .name = "sh-eth", | ||
93 | .resource = sh_eth1_resources, | ||
94 | .id = 1, | ||
95 | .num_resources = ARRAY_SIZE(sh_eth1_resources), | ||
96 | .dev = { | ||
97 | .platform_data = &sh7757_eth1_pdata, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct platform_device *sh7757lcr_devices[] __initdata = { | ||
102 | &heartbeat_device, | ||
103 | &sh7757_eth0_device, | ||
104 | &sh7757_eth1_device, | ||
105 | }; | ||
106 | |||
107 | static int __init sh7757lcr_devices_setup(void) | ||
108 | { | ||
109 | /* RGMII (PTA) */ | ||
110 | gpio_request(GPIO_FN_ET0_MDC, NULL); | ||
111 | gpio_request(GPIO_FN_ET0_MDIO, NULL); | ||
112 | gpio_request(GPIO_FN_ET1_MDC, NULL); | ||
113 | gpio_request(GPIO_FN_ET1_MDIO, NULL); | ||
114 | |||
115 | /* ONFI (PTB, PTZ) */ | ||
116 | gpio_request(GPIO_FN_ON_NRE, NULL); | ||
117 | gpio_request(GPIO_FN_ON_NWE, NULL); | ||
118 | gpio_request(GPIO_FN_ON_NWP, NULL); | ||
119 | gpio_request(GPIO_FN_ON_NCE0, NULL); | ||
120 | gpio_request(GPIO_FN_ON_R_B0, NULL); | ||
121 | gpio_request(GPIO_FN_ON_ALE, NULL); | ||
122 | gpio_request(GPIO_FN_ON_CLE, NULL); | ||
123 | |||
124 | gpio_request(GPIO_FN_ON_DQ7, NULL); | ||
125 | gpio_request(GPIO_FN_ON_DQ6, NULL); | ||
126 | gpio_request(GPIO_FN_ON_DQ5, NULL); | ||
127 | gpio_request(GPIO_FN_ON_DQ4, NULL); | ||
128 | gpio_request(GPIO_FN_ON_DQ3, NULL); | ||
129 | gpio_request(GPIO_FN_ON_DQ2, NULL); | ||
130 | gpio_request(GPIO_FN_ON_DQ1, NULL); | ||
131 | gpio_request(GPIO_FN_ON_DQ0, NULL); | ||
132 | |||
133 | /* IRQ8 to 0 (PTB, PTC) */ | ||
134 | gpio_request(GPIO_FN_IRQ8, NULL); | ||
135 | gpio_request(GPIO_FN_IRQ7, NULL); | ||
136 | gpio_request(GPIO_FN_IRQ6, NULL); | ||
137 | gpio_request(GPIO_FN_IRQ5, NULL); | ||
138 | gpio_request(GPIO_FN_IRQ4, NULL); | ||
139 | gpio_request(GPIO_FN_IRQ3, NULL); | ||
140 | gpio_request(GPIO_FN_IRQ2, NULL); | ||
141 | gpio_request(GPIO_FN_IRQ1, NULL); | ||
142 | gpio_request(GPIO_FN_IRQ0, NULL); | ||
143 | |||
144 | /* SPI0 (PTD) */ | ||
145 | gpio_request(GPIO_FN_SP0_MOSI, NULL); | ||
146 | gpio_request(GPIO_FN_SP0_MISO, NULL); | ||
147 | gpio_request(GPIO_FN_SP0_SCK, NULL); | ||
148 | gpio_request(GPIO_FN_SP0_SCK_FB, NULL); | ||
149 | gpio_request(GPIO_FN_SP0_SS0, NULL); | ||
150 | gpio_request(GPIO_FN_SP0_SS1, NULL); | ||
151 | gpio_request(GPIO_FN_SP0_SS2, NULL); | ||
152 | gpio_request(GPIO_FN_SP0_SS3, NULL); | ||
153 | |||
154 | /* RMII 0/1 (PTE, PTF) */ | ||
155 | gpio_request(GPIO_FN_RMII0_CRS_DV, NULL); | ||
156 | gpio_request(GPIO_FN_RMII0_TXD1, NULL); | ||
157 | gpio_request(GPIO_FN_RMII0_TXD0, NULL); | ||
158 | gpio_request(GPIO_FN_RMII0_TXEN, NULL); | ||
159 | gpio_request(GPIO_FN_RMII0_REFCLK, NULL); | ||
160 | gpio_request(GPIO_FN_RMII0_RXD1, NULL); | ||
161 | gpio_request(GPIO_FN_RMII0_RXD0, NULL); | ||
162 | gpio_request(GPIO_FN_RMII0_RX_ER, NULL); | ||
163 | gpio_request(GPIO_FN_RMII1_CRS_DV, NULL); | ||
164 | gpio_request(GPIO_FN_RMII1_TXD1, NULL); | ||
165 | gpio_request(GPIO_FN_RMII1_TXD0, NULL); | ||
166 | gpio_request(GPIO_FN_RMII1_TXEN, NULL); | ||
167 | gpio_request(GPIO_FN_RMII1_REFCLK, NULL); | ||
168 | gpio_request(GPIO_FN_RMII1_RXD1, NULL); | ||
169 | gpio_request(GPIO_FN_RMII1_RXD0, NULL); | ||
170 | gpio_request(GPIO_FN_RMII1_RX_ER, NULL); | ||
171 | |||
172 | /* eMMC (PTG) */ | ||
173 | gpio_request(GPIO_FN_MMCCLK, NULL); | ||
174 | gpio_request(GPIO_FN_MMCCMD, NULL); | ||
175 | gpio_request(GPIO_FN_MMCDAT7, NULL); | ||
176 | gpio_request(GPIO_FN_MMCDAT6, NULL); | ||
177 | gpio_request(GPIO_FN_MMCDAT5, NULL); | ||
178 | gpio_request(GPIO_FN_MMCDAT4, NULL); | ||
179 | gpio_request(GPIO_FN_MMCDAT3, NULL); | ||
180 | gpio_request(GPIO_FN_MMCDAT2, NULL); | ||
181 | gpio_request(GPIO_FN_MMCDAT1, NULL); | ||
182 | gpio_request(GPIO_FN_MMCDAT0, NULL); | ||
183 | |||
184 | /* LPC (PTG, PTH, PTQ, PTU) */ | ||
185 | gpio_request(GPIO_FN_SERIRQ, NULL); | ||
186 | gpio_request(GPIO_FN_LPCPD, NULL); | ||
187 | gpio_request(GPIO_FN_LDRQ, NULL); | ||
188 | gpio_request(GPIO_FN_WP, NULL); | ||
189 | gpio_request(GPIO_FN_FMS0, NULL); | ||
190 | gpio_request(GPIO_FN_LAD3, NULL); | ||
191 | gpio_request(GPIO_FN_LAD2, NULL); | ||
192 | gpio_request(GPIO_FN_LAD1, NULL); | ||
193 | gpio_request(GPIO_FN_LAD0, NULL); | ||
194 | gpio_request(GPIO_FN_LFRAME, NULL); | ||
195 | gpio_request(GPIO_FN_LRESET, NULL); | ||
196 | gpio_request(GPIO_FN_LCLK, NULL); | ||
197 | gpio_request(GPIO_FN_LGPIO7, NULL); | ||
198 | gpio_request(GPIO_FN_LGPIO6, NULL); | ||
199 | gpio_request(GPIO_FN_LGPIO5, NULL); | ||
200 | gpio_request(GPIO_FN_LGPIO4, NULL); | ||
201 | |||
202 | /* SPI1 (PTH) */ | ||
203 | gpio_request(GPIO_FN_SP1_MOSI, NULL); | ||
204 | gpio_request(GPIO_FN_SP1_MISO, NULL); | ||
205 | gpio_request(GPIO_FN_SP1_SCK, NULL); | ||
206 | gpio_request(GPIO_FN_SP1_SCK_FB, NULL); | ||
207 | gpio_request(GPIO_FN_SP1_SS0, NULL); | ||
208 | gpio_request(GPIO_FN_SP1_SS1, NULL); | ||
209 | |||
210 | /* SDHI (PTI) */ | ||
211 | gpio_request(GPIO_FN_SD_WP, NULL); | ||
212 | gpio_request(GPIO_FN_SD_CD, NULL); | ||
213 | gpio_request(GPIO_FN_SD_CLK, NULL); | ||
214 | gpio_request(GPIO_FN_SD_CMD, NULL); | ||
215 | gpio_request(GPIO_FN_SD_D3, NULL); | ||
216 | gpio_request(GPIO_FN_SD_D2, NULL); | ||
217 | gpio_request(GPIO_FN_SD_D1, NULL); | ||
218 | gpio_request(GPIO_FN_SD_D0, NULL); | ||
219 | |||
220 | /* SCIF3/4 (PTJ, PTW) */ | ||
221 | gpio_request(GPIO_FN_RTS3, NULL); | ||
222 | gpio_request(GPIO_FN_CTS3, NULL); | ||
223 | gpio_request(GPIO_FN_TXD3, NULL); | ||
224 | gpio_request(GPIO_FN_RXD3, NULL); | ||
225 | gpio_request(GPIO_FN_RTS4, NULL); | ||
226 | gpio_request(GPIO_FN_RXD4, NULL); | ||
227 | gpio_request(GPIO_FN_TXD4, NULL); | ||
228 | gpio_request(GPIO_FN_CTS4, NULL); | ||
229 | |||
230 | /* SERMUX (PTK, PTL, PTO, PTV) */ | ||
231 | gpio_request(GPIO_FN_COM2_TXD, NULL); | ||
232 | gpio_request(GPIO_FN_COM2_RXD, NULL); | ||
233 | gpio_request(GPIO_FN_COM2_RTS, NULL); | ||
234 | gpio_request(GPIO_FN_COM2_CTS, NULL); | ||
235 | gpio_request(GPIO_FN_COM2_DTR, NULL); | ||
236 | gpio_request(GPIO_FN_COM2_DSR, NULL); | ||
237 | gpio_request(GPIO_FN_COM2_DCD, NULL); | ||
238 | gpio_request(GPIO_FN_COM2_RI, NULL); | ||
239 | gpio_request(GPIO_FN_RAC_RXD, NULL); | ||
240 | gpio_request(GPIO_FN_RAC_RTS, NULL); | ||
241 | gpio_request(GPIO_FN_RAC_CTS, NULL); | ||
242 | gpio_request(GPIO_FN_RAC_DTR, NULL); | ||
243 | gpio_request(GPIO_FN_RAC_DSR, NULL); | ||
244 | gpio_request(GPIO_FN_RAC_DCD, NULL); | ||
245 | gpio_request(GPIO_FN_RAC_TXD, NULL); | ||
246 | gpio_request(GPIO_FN_COM1_TXD, NULL); | ||
247 | gpio_request(GPIO_FN_COM1_RXD, NULL); | ||
248 | gpio_request(GPIO_FN_COM1_RTS, NULL); | ||
249 | gpio_request(GPIO_FN_COM1_CTS, NULL); | ||
250 | |||
251 | writeb(0x10, 0xfe470000); /* SMR0: SerMux mode 0 */ | ||
252 | |||
253 | /* IIC (PTM, PTR, PTS) */ | ||
254 | gpio_request(GPIO_FN_SDA7, NULL); | ||
255 | gpio_request(GPIO_FN_SCL7, NULL); | ||
256 | gpio_request(GPIO_FN_SDA6, NULL); | ||
257 | gpio_request(GPIO_FN_SCL6, NULL); | ||
258 | gpio_request(GPIO_FN_SDA5, NULL); | ||
259 | gpio_request(GPIO_FN_SCL5, NULL); | ||
260 | gpio_request(GPIO_FN_SDA4, NULL); | ||
261 | gpio_request(GPIO_FN_SCL4, NULL); | ||
262 | gpio_request(GPIO_FN_SDA3, NULL); | ||
263 | gpio_request(GPIO_FN_SCL3, NULL); | ||
264 | gpio_request(GPIO_FN_SDA2, NULL); | ||
265 | gpio_request(GPIO_FN_SCL2, NULL); | ||
266 | gpio_request(GPIO_FN_SDA1, NULL); | ||
267 | gpio_request(GPIO_FN_SCL1, NULL); | ||
268 | gpio_request(GPIO_FN_SDA0, NULL); | ||
269 | gpio_request(GPIO_FN_SCL0, NULL); | ||
270 | |||
271 | /* USB (PTN) */ | ||
272 | gpio_request(GPIO_FN_VBUS_EN, NULL); | ||
273 | gpio_request(GPIO_FN_VBUS_OC, NULL); | ||
274 | |||
275 | /* SGPIO1/0 (PTN, PTO) */ | ||
276 | gpio_request(GPIO_FN_SGPIO1_CLK, NULL); | ||
277 | gpio_request(GPIO_FN_SGPIO1_LOAD, NULL); | ||
278 | gpio_request(GPIO_FN_SGPIO1_DI, NULL); | ||
279 | gpio_request(GPIO_FN_SGPIO1_DO, NULL); | ||
280 | gpio_request(GPIO_FN_SGPIO0_CLK, NULL); | ||
281 | gpio_request(GPIO_FN_SGPIO0_LOAD, NULL); | ||
282 | gpio_request(GPIO_FN_SGPIO0_DI, NULL); | ||
283 | gpio_request(GPIO_FN_SGPIO0_DO, NULL); | ||
284 | |||
285 | /* WDT (PTN) */ | ||
286 | gpio_request(GPIO_FN_SUB_CLKIN, NULL); | ||
287 | |||
288 | /* System (PTT) */ | ||
289 | gpio_request(GPIO_FN_STATUS1, NULL); | ||
290 | gpio_request(GPIO_FN_STATUS0, NULL); | ||
291 | |||
292 | /* PWMX (PTT) */ | ||
293 | gpio_request(GPIO_FN_PWMX1, NULL); | ||
294 | gpio_request(GPIO_FN_PWMX0, NULL); | ||
295 | |||
296 | /* R-SPI (PTV) */ | ||
297 | gpio_request(GPIO_FN_R_SPI_MOSI, NULL); | ||
298 | gpio_request(GPIO_FN_R_SPI_MISO, NULL); | ||
299 | gpio_request(GPIO_FN_R_SPI_RSPCK, NULL); | ||
300 | gpio_request(GPIO_FN_R_SPI_SSL0, NULL); | ||
301 | gpio_request(GPIO_FN_R_SPI_SSL1, NULL); | ||
302 | |||
303 | /* EVC (PTV, PTW) */ | ||
304 | gpio_request(GPIO_FN_EVENT7, NULL); | ||
305 | gpio_request(GPIO_FN_EVENT6, NULL); | ||
306 | gpio_request(GPIO_FN_EVENT5, NULL); | ||
307 | gpio_request(GPIO_FN_EVENT4, NULL); | ||
308 | gpio_request(GPIO_FN_EVENT3, NULL); | ||
309 | gpio_request(GPIO_FN_EVENT2, NULL); | ||
310 | gpio_request(GPIO_FN_EVENT1, NULL); | ||
311 | gpio_request(GPIO_FN_EVENT0, NULL); | ||
312 | |||
313 | /* LED for heartbeat */ | ||
314 | gpio_request(GPIO_PTU3, NULL); | ||
315 | gpio_direction_output(GPIO_PTU3, 1); | ||
316 | gpio_request(GPIO_PTU2, NULL); | ||
317 | gpio_direction_output(GPIO_PTU2, 1); | ||
318 | gpio_request(GPIO_PTU1, NULL); | ||
319 | gpio_direction_output(GPIO_PTU1, 1); | ||
320 | gpio_request(GPIO_PTU0, NULL); | ||
321 | gpio_direction_output(GPIO_PTU0, 1); | ||
322 | |||
323 | /* control for MDIO of Gigabit Ethernet */ | ||
324 | gpio_request(GPIO_PTT4, NULL); | ||
325 | gpio_direction_output(GPIO_PTT4, 1); | ||
326 | |||
327 | /* control for eMMC */ | ||
328 | gpio_request(GPIO_PTT7, NULL); /* eMMC_RST# */ | ||
329 | gpio_direction_output(GPIO_PTT7, 0); | ||
330 | gpio_request(GPIO_PTT6, NULL); /* eMMC_INDEX# */ | ||
331 | gpio_direction_output(GPIO_PTT6, 0); | ||
332 | gpio_request(GPIO_PTT5, NULL); /* eMMC_PRST# */ | ||
333 | gpio_direction_output(GPIO_PTT5, 1); | ||
334 | |||
335 | /* General platform */ | ||
336 | return platform_add_devices(sh7757lcr_devices, | ||
337 | ARRAY_SIZE(sh7757lcr_devices)); | ||
338 | } | ||
339 | arch_initcall(sh7757lcr_devices_setup); | ||
340 | |||
341 | /* Initialize IRQ setting */ | ||
342 | void __init init_sh7757lcr_IRQ(void) | ||
343 | { | ||
344 | plat_irq_setup_pins(IRQ_MODE_IRQ7654); | ||
345 | plat_irq_setup_pins(IRQ_MODE_IRQ3210); | ||
346 | } | ||
347 | |||
348 | /* Initialize the board */ | ||
349 | static void __init sh7757lcr_setup(char **cmdline_p) | ||
350 | { | ||
351 | printk(KERN_INFO "Renesas R0P7757LC0012RL support.\n"); | ||
352 | } | ||
353 | |||
354 | static int sh7757lcr_mode_pins(void) | ||
355 | { | ||
356 | int value = 0; | ||
357 | |||
358 | /* These are the factory default settings of S3 (Low active). | ||
359 | * If you change these dip switches then you will need to | ||
360 | * adjust the values below as well. | ||
361 | */ | ||
362 | value |= MODE_PIN0; /* Clock Mode: 1 */ | ||
363 | |||
364 | return value; | ||
365 | } | ||
366 | |||
367 | /* The Machine Vector */ | ||
368 | static struct sh_machine_vector mv_sh7757lcr __initmv = { | ||
369 | .mv_name = "SH7757LCR", | ||
370 | .mv_setup = sh7757lcr_setup, | ||
371 | .mv_init_irq = init_sh7757lcr_IRQ, | ||
372 | .mv_mode_pins = sh7757lcr_mode_pins, | ||
373 | }; | ||
374 | |||
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 3da116f47f0..881a3a5f564 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -481,7 +481,6 @@ static struct soc_camera_link ov7725_link = { | |||
481 | .power = ov7725_power, | 481 | .power = ov7725_power, |
482 | .board_info = &ap325rxa_i2c_camera[0], | 482 | .board_info = &ap325rxa_i2c_camera[0], |
483 | .i2c_adapter_id = 0, | 483 | .i2c_adapter_id = 0, |
484 | .module_name = "ov772x", | ||
485 | .priv = &ov7725_info, | 484 | .priv = &ov7725_info, |
486 | }; | 485 | }; |
487 | 486 | ||
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c index 1394b078db3..d7ac5af9d10 100644 --- a/arch/sh/boards/mach-cayman/irq.c +++ b/arch/sh/boards/mach-cayman/irq.c | |||
@@ -55,8 +55,9 @@ static struct irqaction cayman_action_pci2 = { | |||
55 | .flags = IRQF_DISABLED, | 55 | .flags = IRQF_DISABLED, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static void enable_cayman_irq(unsigned int irq) | 58 | static void enable_cayman_irq(struct irq_data *data) |
59 | { | 59 | { |
60 | unsigned int irq = data->irq; | ||
60 | unsigned long flags; | 61 | unsigned long flags; |
61 | unsigned long mask; | 62 | unsigned long mask; |
62 | unsigned int reg; | 63 | unsigned int reg; |
@@ -72,8 +73,9 @@ static void enable_cayman_irq(unsigned int irq) | |||
72 | local_irq_restore(flags); | 73 | local_irq_restore(flags); |
73 | } | 74 | } |
74 | 75 | ||
75 | void disable_cayman_irq(unsigned int irq) | 76 | static void disable_cayman_irq(struct irq_data *data) |
76 | { | 77 | { |
78 | unsigned int irq = data->irq; | ||
77 | unsigned long flags; | 79 | unsigned long flags; |
78 | unsigned long mask; | 80 | unsigned long mask; |
79 | unsigned int reg; | 81 | unsigned int reg; |
@@ -89,16 +91,10 @@ void disable_cayman_irq(unsigned int irq) | |||
89 | local_irq_restore(flags); | 91 | local_irq_restore(flags); |
90 | } | 92 | } |
91 | 93 | ||
92 | static void ack_cayman_irq(unsigned int irq) | ||
93 | { | ||
94 | disable_cayman_irq(irq); | ||
95 | } | ||
96 | |||
97 | struct irq_chip cayman_irq_type = { | 94 | struct irq_chip cayman_irq_type = { |
98 | .name = "Cayman-IRQ", | 95 | .name = "Cayman-IRQ", |
99 | .unmask = enable_cayman_irq, | 96 | .irq_unmask = enable_cayman_irq, |
100 | .mask = disable_cayman_irq, | 97 | .irq_mask = disable_cayman_irq, |
101 | .mask_ack = ack_cayman_irq, | ||
102 | }; | 98 | }; |
103 | 99 | ||
104 | int cayman_irq_demux(int evt) | 100 | int cayman_irq_demux(int evt) |
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c index d932667410a..72e7ac9549d 100644 --- a/arch/sh/boards/mach-dreamcast/irq.c +++ b/arch/sh/boards/mach-dreamcast/irq.c | |||
@@ -60,8 +60,9 @@ | |||
60 | */ | 60 | */ |
61 | 61 | ||
62 | /* Disable the hardware event by masking its bit in its EMR */ | 62 | /* Disable the hardware event by masking its bit in its EMR */ |
63 | static inline void disable_systemasic_irq(unsigned int irq) | 63 | static inline void disable_systemasic_irq(struct irq_data *data) |
64 | { | 64 | { |
65 | unsigned int irq = data->irq; | ||
65 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); | 66 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); |
66 | __u32 mask; | 67 | __u32 mask; |
67 | 68 | ||
@@ -71,8 +72,9 @@ static inline void disable_systemasic_irq(unsigned int irq) | |||
71 | } | 72 | } |
72 | 73 | ||
73 | /* Enable the hardware event by setting its bit in its EMR */ | 74 | /* Enable the hardware event by setting its bit in its EMR */ |
74 | static inline void enable_systemasic_irq(unsigned int irq) | 75 | static inline void enable_systemasic_irq(struct irq_data *data) |
75 | { | 76 | { |
77 | unsigned int irq = data->irq; | ||
76 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); | 78 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); |
77 | __u32 mask; | 79 | __u32 mask; |
78 | 80 | ||
@@ -82,18 +84,19 @@ static inline void enable_systemasic_irq(unsigned int irq) | |||
82 | } | 84 | } |
83 | 85 | ||
84 | /* Acknowledge a hardware event by writing its bit back to its ESR */ | 86 | /* Acknowledge a hardware event by writing its bit back to its ESR */ |
85 | static void mask_ack_systemasic_irq(unsigned int irq) | 87 | static void mask_ack_systemasic_irq(struct irq_data *data) |
86 | { | 88 | { |
89 | unsigned int irq = data->irq; | ||
87 | __u32 esr = ESR_BASE + (LEVEL(irq) << 2); | 90 | __u32 esr = ESR_BASE + (LEVEL(irq) << 2); |
88 | disable_systemasic_irq(irq); | 91 | disable_systemasic_irq(data); |
89 | outl((1 << EVENT_BIT(irq)), esr); | 92 | outl((1 << EVENT_BIT(irq)), esr); |
90 | } | 93 | } |
91 | 94 | ||
92 | struct irq_chip systemasic_int = { | 95 | struct irq_chip systemasic_int = { |
93 | .name = "System ASIC", | 96 | .name = "System ASIC", |
94 | .mask = disable_systemasic_irq, | 97 | .irq_mask = disable_systemasic_irq, |
95 | .mask_ack = mask_ack_systemasic_irq, | 98 | .irq_mask_ack = mask_ack_systemasic_irq, |
96 | .unmask = enable_systemasic_irq, | 99 | .irq_unmask = enable_systemasic_irq, |
97 | }; | 100 | }; |
98 | 101 | ||
99 | /* | 102 | /* |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 1d7b495a7db..ddc7e4e4d2a 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -620,7 +620,6 @@ static struct soc_camera_link tw9910_link = { | |||
620 | .bus_id = 1, | 620 | .bus_id = 1, |
621 | .power = tw9910_power, | 621 | .power = tw9910_power, |
622 | .board_info = &i2c_camera[0], | 622 | .board_info = &i2c_camera[0], |
623 | .module_name = "tw9910", | ||
624 | .priv = &tw9910_info, | 623 | .priv = &tw9910_info, |
625 | }; | 624 | }; |
626 | 625 | ||
@@ -644,7 +643,6 @@ static struct soc_camera_link mt9t112_link1 = { | |||
644 | .power = mt9t112_power1, | 643 | .power = mt9t112_power1, |
645 | .bus_id = 0, | 644 | .bus_id = 0, |
646 | .board_info = &i2c_camera[1], | 645 | .board_info = &i2c_camera[1], |
647 | .module_name = "mt9t112", | ||
648 | .priv = &mt9t112_info1, | 646 | .priv = &mt9t112_info1, |
649 | }; | 647 | }; |
650 | 648 | ||
@@ -667,7 +665,6 @@ static struct soc_camera_link mt9t112_link2 = { | |||
667 | .power = mt9t112_power2, | 665 | .power = mt9t112_power2, |
668 | .bus_id = 1, | 666 | .bus_id = 1, |
669 | .board_info = &i2c_camera[2], | 667 | .board_info = &i2c_camera[2], |
670 | .module_name = "mt9t112", | ||
671 | .priv = &mt9t112_info2, | 668 | .priv = &mt9t112_info2, |
672 | }; | 669 | }; |
673 | 670 | ||
@@ -793,7 +790,6 @@ static struct sh_vou_pdata sh_vou_pdata = { | |||
793 | .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, | 790 | .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, |
794 | .board_info = &ak8813, | 791 | .board_info = &ak8813, |
795 | .i2c_adap = 0, | 792 | .i2c_adap = 0, |
796 | .module_name = "ak881x", | ||
797 | }; | 793 | }; |
798 | 794 | ||
799 | static struct resource sh_vou_resources[] = { | 795 | static struct resource sh_vou_resources[] = { |
@@ -1248,14 +1244,14 @@ static int __init arch_setup(void) | |||
1248 | 1244 | ||
1249 | /* set SPU2 clock to 83.4 MHz */ | 1245 | /* set SPU2 clock to 83.4 MHz */ |
1250 | clk = clk_get(NULL, "spu_clk"); | 1246 | clk = clk_get(NULL, "spu_clk"); |
1251 | if (clk) { | 1247 | if (!IS_ERR(clk)) { |
1252 | clk_set_rate(clk, clk_round_rate(clk, 83333333)); | 1248 | clk_set_rate(clk, clk_round_rate(clk, 83333333)); |
1253 | clk_put(clk); | 1249 | clk_put(clk); |
1254 | } | 1250 | } |
1255 | 1251 | ||
1256 | /* change parent of FSI B */ | 1252 | /* change parent of FSI B */ |
1257 | clk = clk_get(NULL, "fsib_clk"); | 1253 | clk = clk_get(NULL, "fsib_clk"); |
1258 | if (clk) { | 1254 | if (!IS_ERR(clk)) { |
1259 | clk_register(&fsimckb_clk); | 1255 | clk_register(&fsimckb_clk); |
1260 | clk_set_parent(clk, &fsimckb_clk); | 1256 | clk_set_parent(clk, &fsimckb_clk); |
1261 | clk_set_rate(clk, 11000); | 1257 | clk_set_rate(clk, 11000); |
@@ -1273,7 +1269,7 @@ static int __init arch_setup(void) | |||
1273 | 1269 | ||
1274 | /* set VPU clock to 166 MHz */ | 1270 | /* set VPU clock to 166 MHz */ |
1275 | clk = clk_get(NULL, "vpu_clk"); | 1271 | clk = clk_get(NULL, "vpu_clk"); |
1276 | if (clk) { | 1272 | if (!IS_ERR(clk)) { |
1277 | clk_set_rate(clk, clk_round_rate(clk, 166000000)); | 1273 | clk_set_rate(clk, clk_round_rate(clk, 166000000)); |
1278 | clk_put(clk); | 1274 | clk_put(clk); |
1279 | } | 1275 | } |
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 68994a163f6..1742849db64 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
@@ -333,7 +333,6 @@ static struct soc_camera_link rj54n1_link = { | |||
333 | .power = camera_power, | 333 | .power = camera_power, |
334 | .board_info = &kfr2r09_i2c_camera, | 334 | .board_info = &kfr2r09_i2c_camera, |
335 | .i2c_adapter_id = 1, | 335 | .i2c_adapter_id = 1, |
336 | .module_name = "rj54n1cb0c", | ||
337 | .priv = &rj54n1_priv, | 336 | .priv = &rj54n1_priv, |
338 | }; | 337 | }; |
339 | 338 | ||
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c index 01e6abb769b..8132dff078f 100644 --- a/arch/sh/boards/mach-landisk/gio.c +++ b/arch/sh/boards/mach-landisk/gio.c | |||
@@ -128,6 +128,7 @@ static const struct file_operations gio_fops = { | |||
128 | .open = gio_open, /* open */ | 128 | .open = gio_open, /* open */ |
129 | .release = gio_close, /* release */ | 129 | .release = gio_close, /* release */ |
130 | .unlocked_ioctl = gio_ioctl, | 130 | .unlocked_ioctl = gio_ioctl, |
131 | .llseek = noop_llseek, | ||
131 | }; | 132 | }; |
132 | 133 | ||
133 | static int __init gio_init(void) | 134 | static int __init gio_init(void) |
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c index 96f38a4187d..e79412a4049 100644 --- a/arch/sh/boards/mach-landisk/irq.c +++ b/arch/sh/boards/mach-landisk/irq.c | |||
@@ -18,25 +18,24 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <mach-landisk/mach/iodata_landisk.h> | 19 | #include <mach-landisk/mach/iodata_landisk.h> |
20 | 20 | ||
21 | static void disable_landisk_irq(unsigned int irq) | 21 | static void disable_landisk_irq(struct irq_data *data) |
22 | { | 22 | { |
23 | unsigned char mask = 0xff ^ (0x01 << (irq - 5)); | 23 | unsigned char mask = 0xff ^ (0x01 << (data->irq - 5)); |
24 | 24 | ||
25 | __raw_writeb(__raw_readb(PA_IMASK) & mask, PA_IMASK); | 25 | __raw_writeb(__raw_readb(PA_IMASK) & mask, PA_IMASK); |
26 | } | 26 | } |
27 | 27 | ||
28 | static void enable_landisk_irq(unsigned int irq) | 28 | static void enable_landisk_irq(struct irq_data *data) |
29 | { | 29 | { |
30 | unsigned char value = (0x01 << (irq - 5)); | 30 | unsigned char value = (0x01 << (data->irq - 5)); |
31 | 31 | ||
32 | __raw_writeb(__raw_readb(PA_IMASK) | value, PA_IMASK); | 32 | __raw_writeb(__raw_readb(PA_IMASK) | value, PA_IMASK); |
33 | } | 33 | } |
34 | 34 | ||
35 | static struct irq_chip landisk_irq_chip __read_mostly = { | 35 | static struct irq_chip landisk_irq_chip __read_mostly = { |
36 | .name = "LANDISK", | 36 | .name = "LANDISK", |
37 | .mask = disable_landisk_irq, | 37 | .irq_mask = disable_landisk_irq, |
38 | .unmask = enable_landisk_irq, | 38 | .irq_unmask = enable_landisk_irq, |
39 | .mask_ack = disable_landisk_irq, | ||
40 | }; | 39 | }; |
41 | 40 | ||
42 | /* | 41 | /* |
@@ -50,7 +49,7 @@ void __init init_landisk_IRQ(void) | |||
50 | disable_irq_nosync(i); | 49 | disable_irq_nosync(i); |
51 | set_irq_chip_and_handler_name(i, &landisk_irq_chip, | 50 | set_irq_chip_and_handler_name(i, &landisk_irq_chip, |
52 | handle_level_irq, "level"); | 51 | handle_level_irq, "level"); |
53 | enable_landisk_irq(i); | 52 | enable_landisk_irq(irq_get_irq_data(i)); |
54 | } | 53 | } |
55 | __raw_writeb(0x00, PA_PWRINT_CLR); | 54 | __raw_writeb(0x00, PA_PWRINT_CLR); |
56 | } | 55 | } |
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c index a26d16669aa..c35001fd903 100644 --- a/arch/sh/boards/mach-microdev/irq.c +++ b/arch/sh/boards/mach-microdev/irq.c | |||
@@ -65,19 +65,9 @@ static const struct { | |||
65 | # error Inconsistancy in defining the IRQ# for primary IDE! | 65 | # error Inconsistancy in defining the IRQ# for primary IDE! |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | static void enable_microdev_irq(unsigned int irq); | 68 | static void disable_microdev_irq(struct irq_data *data) |
69 | static void disable_microdev_irq(unsigned int irq); | ||
70 | static void mask_and_ack_microdev(unsigned int); | ||
71 | |||
72 | static struct irq_chip microdev_irq_type = { | ||
73 | .name = "MicroDev-IRQ", | ||
74 | .unmask = enable_microdev_irq, | ||
75 | .mask = disable_microdev_irq, | ||
76 | .ack = mask_and_ack_microdev, | ||
77 | }; | ||
78 | |||
79 | static void disable_microdev_irq(unsigned int irq) | ||
80 | { | 69 | { |
70 | unsigned int irq = data->irq; | ||
81 | unsigned int fpgaIrq; | 71 | unsigned int fpgaIrq; |
82 | 72 | ||
83 | if (irq >= NUM_EXTERNAL_IRQS) | 73 | if (irq >= NUM_EXTERNAL_IRQS) |
@@ -91,8 +81,9 @@ static void disable_microdev_irq(unsigned int irq) | |||
91 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); | 81 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); |
92 | } | 82 | } |
93 | 83 | ||
94 | static void enable_microdev_irq(unsigned int irq) | 84 | static void enable_microdev_irq(struct irq_data *data) |
95 | { | 85 | { |
86 | unsigned int irq = data->irq; | ||
96 | unsigned long priorityReg, priorities, pri; | 87 | unsigned long priorityReg, priorities, pri; |
97 | unsigned int fpgaIrq; | 88 | unsigned int fpgaIrq; |
98 | 89 | ||
@@ -116,17 +107,18 @@ static void enable_microdev_irq(unsigned int irq) | |||
116 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); | 107 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); |
117 | } | 108 | } |
118 | 109 | ||
110 | static struct irq_chip microdev_irq_type = { | ||
111 | .name = "MicroDev-IRQ", | ||
112 | .irq_unmask = enable_microdev_irq, | ||
113 | .irq_mask = disable_microdev_irq, | ||
114 | }; | ||
115 | |||
119 | /* This function sets the desired irq handler to be a MicroDev type */ | 116 | /* This function sets the desired irq handler to be a MicroDev type */ |
120 | static void __init make_microdev_irq(unsigned int irq) | 117 | static void __init make_microdev_irq(unsigned int irq) |
121 | { | 118 | { |
122 | disable_irq_nosync(irq); | 119 | disable_irq_nosync(irq); |
123 | set_irq_chip_and_handler(irq, µdev_irq_type, handle_level_irq); | 120 | set_irq_chip_and_handler(irq, µdev_irq_type, handle_level_irq); |
124 | disable_microdev_irq(irq); | 121 | disable_microdev_irq(irq_get_irq_data(irq)); |
125 | } | ||
126 | |||
127 | static void mask_and_ack_microdev(unsigned int irq) | ||
128 | { | ||
129 | disable_microdev_irq(irq); | ||
130 | } | 122 | } |
131 | 123 | ||
132 | extern void __init init_microdev_irq(void) | 124 | extern void __init init_microdev_irq(void) |
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 662debe4ead..03af8484255 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -450,7 +450,6 @@ static struct soc_camera_link ov7725_link = { | |||
450 | .power = ov7725_power, | 450 | .power = ov7725_power, |
451 | .board_info = &migor_i2c_camera[0], | 451 | .board_info = &migor_i2c_camera[0], |
452 | .i2c_adapter_id = 0, | 452 | .i2c_adapter_id = 0, |
453 | .module_name = "ov772x", | ||
454 | .priv = &ov7725_info, | 453 | .priv = &ov7725_info, |
455 | }; | 454 | }; |
456 | 455 | ||
@@ -463,7 +462,6 @@ static struct soc_camera_link tw9910_link = { | |||
463 | .power = tw9910_power, | 462 | .power = tw9910_power, |
464 | .board_info = &migor_i2c_camera[1], | 463 | .board_info = &migor_i2c_camera[1], |
465 | .i2c_adapter_id = 0, | 464 | .i2c_adapter_id = 0, |
466 | .module_name = "tw9910", | ||
467 | .priv = &tw9910_info, | 465 | .priv = &tw9910_info, |
468 | }; | 466 | }; |
469 | 467 | ||
diff --git a/arch/sh/boards/mach-sdk7786/Makefile b/arch/sh/boards/mach-sdk7786/Makefile index a29f19e85b6..23ff7d4ac49 100644 --- a/arch/sh/boards/mach-sdk7786/Makefile +++ b/arch/sh/boards/mach-sdk7786/Makefile | |||
@@ -1 +1,4 @@ | |||
1 | obj-y := setup.o fpga.o irq.o | 1 | obj-y := fpga.o irq.o setup.o |
2 | |||
3 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o | ||
4 | obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o | ||
diff --git a/arch/sh/boards/mach-sdk7786/gpio.c b/arch/sh/boards/mach-sdk7786/gpio.c new file mode 100644 index 00000000000..f71ce09d4e1 --- /dev/null +++ b/arch/sh/boards/mach-sdk7786/gpio.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * SDK7786 FPGA USRGPIR Support. | ||
3 | * | ||
4 | * Copyright (C) 2010 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #include <linux/init.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/gpio.h> | ||
13 | #include <linux/irq.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <mach/fpga.h> | ||
18 | |||
19 | #define NR_FPGA_GPIOS 8 | ||
20 | |||
21 | static const char *usrgpir_gpio_names[NR_FPGA_GPIOS] = { | ||
22 | "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7", | ||
23 | }; | ||
24 | |||
25 | static int usrgpir_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) | ||
26 | { | ||
27 | /* always in */ | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | static int usrgpir_gpio_get(struct gpio_chip *chip, unsigned gpio) | ||
32 | { | ||
33 | return !!(fpga_read_reg(USRGPIR) & (1 << gpio)); | ||
34 | } | ||
35 | |||
36 | static struct gpio_chip usrgpir_gpio_chip = { | ||
37 | .label = "sdk7786-fpga", | ||
38 | .names = usrgpir_gpio_names, | ||
39 | .direction_input = usrgpir_gpio_direction_input, | ||
40 | .get = usrgpir_gpio_get, | ||
41 | .base = -1, /* don't care */ | ||
42 | .ngpio = NR_FPGA_GPIOS, | ||
43 | }; | ||
44 | |||
45 | static int __init usrgpir_gpio_setup(void) | ||
46 | { | ||
47 | return gpiochip_add(&usrgpir_gpio_chip); | ||
48 | } | ||
49 | device_initcall(usrgpir_gpio_setup); | ||
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c index 2ec1ea5cf8e..7e0c4e3878e 100644 --- a/arch/sh/boards/mach-sdk7786/setup.c +++ b/arch/sh/boards/mach-sdk7786/setup.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <asm/machvec.h> | 20 | #include <asm/machvec.h> |
21 | #include <asm/heartbeat.h> | 21 | #include <asm/heartbeat.h> |
22 | #include <asm/sizes.h> | 22 | #include <asm/sizes.h> |
23 | #include <asm/clock.h> | ||
24 | #include <asm/clkdev.h> | ||
23 | #include <asm/reboot.h> | 25 | #include <asm/reboot.h> |
24 | #include <asm/smp-ops.h> | 26 | #include <asm/smp-ops.h> |
25 | 27 | ||
@@ -140,6 +142,45 @@ static int sdk7786_mode_pins(void) | |||
140 | return fpga_read_reg(MODSWR); | 142 | return fpga_read_reg(MODSWR); |
141 | } | 143 | } |
142 | 144 | ||
145 | /* | ||
146 | * FPGA-driven PCIe clocks | ||
147 | * | ||
148 | * Historically these include the oscillator, clock B (slots 2/3/4) and | ||
149 | * clock A (slot 1 and the CPU clock). Newer revs of the PCB shove | ||
150 | * everything under a single PCIe clocks enable bit that happens to map | ||
151 | * to the same bit position as the oscillator bit for earlier FPGA | ||
152 | * versions. | ||
153 | * | ||
154 | * Given that the legacy clocks have the side-effect of shutting the CPU | ||
155 | * off through the FPGA along with the PCI slots, we simply leave them in | ||
156 | * their initial state and don't bother registering them with the clock | ||
157 | * framework. | ||
158 | */ | ||
159 | static int sdk7786_pcie_clk_enable(struct clk *clk) | ||
160 | { | ||
161 | fpga_write_reg(fpga_read_reg(PCIECR) | PCIECR_CLKEN, PCIECR); | ||
162 | return 0; | ||
163 | } | ||
164 | |||
165 | static void sdk7786_pcie_clk_disable(struct clk *clk) | ||
166 | { | ||
167 | fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR); | ||
168 | } | ||
169 | |||
170 | static struct clk_ops sdk7786_pcie_clk_ops = { | ||
171 | .enable = sdk7786_pcie_clk_enable, | ||
172 | .disable = sdk7786_pcie_clk_disable, | ||
173 | }; | ||
174 | |||
175 | static struct clk sdk7786_pcie_clk = { | ||
176 | .ops = &sdk7786_pcie_clk_ops, | ||
177 | }; | ||
178 | |||
179 | static struct clk_lookup sdk7786_pcie_cl = { | ||
180 | .con_id = "pcie_plat_clk", | ||
181 | .clk = &sdk7786_pcie_clk, | ||
182 | }; | ||
183 | |||
143 | static int sdk7786_clk_init(void) | 184 | static int sdk7786_clk_init(void) |
144 | { | 185 | { |
145 | struct clk *clk; | 186 | struct clk *clk; |
@@ -158,7 +199,18 @@ static int sdk7786_clk_init(void) | |||
158 | ret = clk_set_rate(clk, 33333333); | 199 | ret = clk_set_rate(clk, 33333333); |
159 | clk_put(clk); | 200 | clk_put(clk); |
160 | 201 | ||
161 | return ret; | 202 | /* |
203 | * Setup the FPGA clocks. | ||
204 | */ | ||
205 | ret = clk_register(&sdk7786_pcie_clk); | ||
206 | if (unlikely(ret)) { | ||
207 | pr_err("FPGA clock registration failed\n"); | ||
208 | return ret; | ||
209 | } | ||
210 | |||
211 | clkdev_add(&sdk7786_pcie_cl); | ||
212 | |||
213 | return 0; | ||
162 | } | 214 | } |
163 | 215 | ||
164 | static void sdk7786_restart(char *cmd) | 216 | static void sdk7786_restart(char *cmd) |
diff --git a/arch/sh/boards/mach-sdk7786/sram.c b/arch/sh/boards/mach-sdk7786/sram.c new file mode 100644 index 00000000000..c81c3abbe01 --- /dev/null +++ b/arch/sh/boards/mach-sdk7786/sram.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * SDK7786 FPGA SRAM Support. | ||
3 | * | ||
4 | * Copyright (C) 2010 Paul Mundt | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/string.h> | ||
17 | #include <mach/fpga.h> | ||
18 | #include <asm/sram.h> | ||
19 | #include <asm/sizes.h> | ||
20 | |||
21 | static int __init fpga_sram_init(void) | ||
22 | { | ||
23 | unsigned long phys; | ||
24 | unsigned int area; | ||
25 | void __iomem *vaddr; | ||
26 | int ret; | ||
27 | u16 data; | ||
28 | |||
29 | /* Enable FPGA SRAM */ | ||
30 | data = fpga_read_reg(LCLASR); | ||
31 | data |= LCLASR_FRAMEN; | ||
32 | fpga_write_reg(data, LCLASR); | ||
33 | |||
34 | /* | ||
35 | * FPGA_SEL determines the area mapping | ||
36 | */ | ||
37 | area = (data & LCLASR_FPGA_SEL_MASK) >> LCLASR_FPGA_SEL_SHIFT; | ||
38 | if (unlikely(area == LCLASR_AREA_MASK)) { | ||
39 | pr_err("FPGA memory unmapped.\n"); | ||
40 | return -ENXIO; | ||
41 | } | ||
42 | |||
43 | /* | ||
44 | * The memory itself occupies a 2KiB range at the top of the area | ||
45 | * immediately below the system registers. | ||
46 | */ | ||
47 | phys = (area << 26) + SZ_64M - SZ_4K; | ||
48 | |||
49 | /* | ||
50 | * The FPGA SRAM resides in translatable physical space, so set | ||
51 | * up a mapping prior to inserting it in to the pool. | ||
52 | */ | ||
53 | vaddr = ioremap(phys, SZ_2K); | ||
54 | if (unlikely(!vaddr)) { | ||
55 | pr_err("Failed remapping FPGA memory.\n"); | ||
56 | return -ENXIO; | ||
57 | } | ||
58 | |||
59 | pr_info("Adding %dKiB of FPGA memory at 0x%08lx-0x%08lx " | ||
60 | "(area %d) to pool.\n", | ||
61 | SZ_2K >> 10, phys, phys + SZ_2K - 1, area); | ||
62 | |||
63 | ret = gen_pool_add(sram_pool, (unsigned long)vaddr, SZ_2K, -1); | ||
64 | if (unlikely(ret < 0)) { | ||
65 | pr_err("Failed adding memory\n"); | ||
66 | iounmap(vaddr); | ||
67 | return ret; | ||
68 | } | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | postcore_initcall(fpga_sram_init); | ||
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c index 8d82175d83a..883b21eacaa 100644 --- a/arch/sh/boards/mach-se/7206/irq.c +++ b/arch/sh/boards/mach-se/7206/irq.c | |||
@@ -25,8 +25,9 @@ | |||
25 | #define INTC_IPR01 0xfffe0818 | 25 | #define INTC_IPR01 0xfffe0818 |
26 | #define INTC_ICR1 0xfffe0802 | 26 | #define INTC_ICR1 0xfffe0802 |
27 | 27 | ||
28 | static void disable_se7206_irq(unsigned int irq) | 28 | static void disable_se7206_irq(struct irq_data *data) |
29 | { | 29 | { |
30 | unsigned int irq = data->irq; | ||
30 | unsigned short val; | 31 | unsigned short val; |
31 | unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq))); | 32 | unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq))); |
32 | unsigned short msk0,msk1; | 33 | unsigned short msk0,msk1; |
@@ -55,8 +56,9 @@ static void disable_se7206_irq(unsigned int irq) | |||
55 | __raw_writew(msk1, INTMSK1); | 56 | __raw_writew(msk1, INTMSK1); |
56 | } | 57 | } |
57 | 58 | ||
58 | static void enable_se7206_irq(unsigned int irq) | 59 | static void enable_se7206_irq(struct irq_data *data) |
59 | { | 60 | { |
61 | unsigned int irq = data->irq; | ||
60 | unsigned short val; | 62 | unsigned short val; |
61 | unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq))); | 63 | unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq))); |
62 | unsigned short msk0,msk1; | 64 | unsigned short msk0,msk1; |
@@ -86,13 +88,14 @@ static void enable_se7206_irq(unsigned int irq) | |||
86 | __raw_writew(msk1, INTMSK1); | 88 | __raw_writew(msk1, INTMSK1); |
87 | } | 89 | } |
88 | 90 | ||
89 | static void eoi_se7206_irq(unsigned int irq) | 91 | static void eoi_se7206_irq(struct irq_data *data) |
90 | { | 92 | { |
91 | unsigned short sts0,sts1; | 93 | unsigned short sts0,sts1; |
94 | unsigned int irq = data->irq; | ||
92 | struct irq_desc *desc = irq_to_desc(irq); | 95 | struct irq_desc *desc = irq_to_desc(irq); |
93 | 96 | ||
94 | if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) | 97 | if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) |
95 | enable_se7206_irq(irq); | 98 | enable_se7206_irq(data); |
96 | /* FPGA isr clear */ | 99 | /* FPGA isr clear */ |
97 | sts0 = __raw_readw(INTSTS0); | 100 | sts0 = __raw_readw(INTSTS0); |
98 | sts1 = __raw_readw(INTSTS1); | 101 | sts1 = __raw_readw(INTSTS1); |
@@ -115,10 +118,9 @@ static void eoi_se7206_irq(unsigned int irq) | |||
115 | 118 | ||
116 | static struct irq_chip se7206_irq_chip __read_mostly = { | 119 | static struct irq_chip se7206_irq_chip __read_mostly = { |
117 | .name = "SE7206-FPGA", | 120 | .name = "SE7206-FPGA", |
118 | .mask = disable_se7206_irq, | 121 | .irq_mask = disable_se7206_irq, |
119 | .unmask = enable_se7206_irq, | 122 | .irq_unmask = enable_se7206_irq, |
120 | .mask_ack = disable_se7206_irq, | 123 | .irq_eoi = eoi_se7206_irq, |
121 | .eoi = eoi_se7206_irq, | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | static void make_se7206_irq(unsigned int irq) | 126 | static void make_se7206_irq(unsigned int irq) |
@@ -126,7 +128,7 @@ static void make_se7206_irq(unsigned int irq) | |||
126 | disable_irq_nosync(irq); | 128 | disable_irq_nosync(irq); |
127 | set_irq_chip_and_handler_name(irq, &se7206_irq_chip, | 129 | set_irq_chip_and_handler_name(irq, &se7206_irq_chip, |
128 | handle_level_irq, "level"); | 130 | handle_level_irq, "level"); |
129 | disable_se7206_irq(irq); | 131 | disable_se7206_irq(irq_get_irq_data(irq)); |
130 | } | 132 | } |
131 | 133 | ||
132 | /* | 134 | /* |
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c index d4305c26e9f..76255a19417 100644 --- a/arch/sh/boards/mach-se/7343/irq.c +++ b/arch/sh/boards/mach-se/7343/irq.c | |||
@@ -18,23 +18,22 @@ | |||
18 | 18 | ||
19 | unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, }; | 19 | unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, }; |
20 | 20 | ||
21 | static void disable_se7343_irq(unsigned int irq) | 21 | static void disable_se7343_irq(struct irq_data *data) |
22 | { | 22 | { |
23 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 23 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
24 | __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK); | 24 | __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK); |
25 | } | 25 | } |
26 | 26 | ||
27 | static void enable_se7343_irq(unsigned int irq) | 27 | static void enable_se7343_irq(struct irq_data *data) |
28 | { | 28 | { |
29 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 29 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
30 | __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK); | 30 | __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK); |
31 | } | 31 | } |
32 | 32 | ||
33 | static struct irq_chip se7343_irq_chip __read_mostly = { | 33 | static struct irq_chip se7343_irq_chip __read_mostly = { |
34 | .name = "SE7343-FPGA", | 34 | .name = "SE7343-FPGA", |
35 | .mask = disable_se7343_irq, | 35 | .irq_mask = disable_se7343_irq, |
36 | .unmask = enable_se7343_irq, | 36 | .irq_unmask = enable_se7343_irq, |
37 | .mask_ack = disable_se7343_irq, | ||
38 | }; | 37 | }; |
39 | 38 | ||
40 | static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) | 39 | static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c index 61605db04ee..c013f95628e 100644 --- a/arch/sh/boards/mach-se/7722/irq.c +++ b/arch/sh/boards/mach-se/7722/irq.c | |||
@@ -18,23 +18,22 @@ | |||
18 | 18 | ||
19 | unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, }; | 19 | unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, }; |
20 | 20 | ||
21 | static void disable_se7722_irq(unsigned int irq) | 21 | static void disable_se7722_irq(struct irq_data *data) |
22 | { | 22 | { |
23 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 23 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
24 | __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK); | 24 | __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK); |
25 | } | 25 | } |
26 | 26 | ||
27 | static void enable_se7722_irq(unsigned int irq) | 27 | static void enable_se7722_irq(struct irq_data *data) |
28 | { | 28 | { |
29 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 29 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
30 | __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK); | 30 | __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK); |
31 | } | 31 | } |
32 | 32 | ||
33 | static struct irq_chip se7722_irq_chip __read_mostly = { | 33 | static struct irq_chip se7722_irq_chip __read_mostly = { |
34 | .name = "SE7722-FPGA", | 34 | .name = "SE7722-FPGA", |
35 | .mask = disable_se7722_irq, | 35 | .irq_mask = disable_se7722_irq, |
36 | .unmask = enable_se7722_irq, | 36 | .irq_unmask = enable_se7722_irq, |
37 | .mask_ack = disable_se7722_irq, | ||
38 | }; | 37 | }; |
39 | 38 | ||
40 | static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) | 39 | static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c index 0942be2daef..5bd87c22b65 100644 --- a/arch/sh/boards/mach-se/7724/irq.c +++ b/arch/sh/boards/mach-se/7724/irq.c | |||
@@ -68,25 +68,26 @@ static struct fpga_irq get_fpga_irq(unsigned int irq) | |||
68 | return set; | 68 | return set; |
69 | } | 69 | } |
70 | 70 | ||
71 | static void disable_se7724_irq(unsigned int irq) | 71 | static void disable_se7724_irq(struct irq_data *data) |
72 | { | 72 | { |
73 | unsigned int irq = data->irq; | ||
73 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); | 74 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); |
74 | unsigned int bit = irq - set.base; | 75 | unsigned int bit = irq - set.base; |
75 | __raw_writew(__raw_readw(set.mraddr) | 0x0001 << bit, set.mraddr); | 76 | __raw_writew(__raw_readw(set.mraddr) | 0x0001 << bit, set.mraddr); |
76 | } | 77 | } |
77 | 78 | ||
78 | static void enable_se7724_irq(unsigned int irq) | 79 | static void enable_se7724_irq(struct irq_data *data) |
79 | { | 80 | { |
81 | unsigned int irq = data->irq; | ||
80 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); | 82 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); |
81 | unsigned int bit = irq - set.base; | 83 | unsigned int bit = irq - set.base; |
82 | __raw_writew(__raw_readw(set.mraddr) & ~(0x0001 << bit), set.mraddr); | 84 | __raw_writew(__raw_readw(set.mraddr) & ~(0x0001 << bit), set.mraddr); |
83 | } | 85 | } |
84 | 86 | ||
85 | static struct irq_chip se7724_irq_chip __read_mostly = { | 87 | static struct irq_chip se7724_irq_chip __read_mostly = { |
86 | .name = "SE7724-FPGA", | 88 | .name = "SE7724-FPGA", |
87 | .mask = disable_se7724_irq, | 89 | .irq_mask = disable_se7724_irq, |
88 | .unmask = enable_se7724_irq, | 90 | .irq_unmask = enable_se7724_irq, |
89 | .mask_ack = disable_se7724_irq, | ||
90 | }; | 91 | }; |
91 | 92 | ||
92 | static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc) | 93 | static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 552ebd9ba82..8cc1d7295d8 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -550,7 +550,6 @@ static struct sh_vou_pdata sh_vou_pdata = { | |||
550 | .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, | 550 | .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, |
551 | .board_info = &ak8813, | 551 | .board_info = &ak8813, |
552 | .i2c_adap = 0, | 552 | .i2c_adap = 0, |
553 | .module_name = "ak881x", | ||
554 | }; | 553 | }; |
555 | 554 | ||
556 | static struct resource sh_vou_resources[] = { | 555 | static struct resource sh_vou_resources[] = { |
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c index 523aea5dc94..e5ee13adeff 100644 --- a/arch/sh/boards/mach-systemh/irq.c +++ b/arch/sh/boards/mach-systemh/irq.c | |||
@@ -23,54 +23,39 @@ | |||
23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; | 23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; |
24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; | 24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; |
25 | 25 | ||
26 | /* forward declaration */ | 26 | static void disable_systemh_irq(struct irq_data *data) |
27 | static void enable_systemh_irq(unsigned int irq); | ||
28 | static void disable_systemh_irq(unsigned int irq); | ||
29 | static void mask_and_ack_systemh(unsigned int); | ||
30 | |||
31 | static struct irq_chip systemh_irq_type = { | ||
32 | .name = " SystemH Register", | ||
33 | .unmask = enable_systemh_irq, | ||
34 | .mask = disable_systemh_irq, | ||
35 | .ack = mask_and_ack_systemh, | ||
36 | }; | ||
37 | |||
38 | static void disable_systemh_irq(unsigned int irq) | ||
39 | { | 27 | { |
40 | if (systemh_irq_mask_register) { | 28 | unsigned long val, mask = 0x01 << 1; |
41 | unsigned long val, mask = 0x01 << 1; | ||
42 | 29 | ||
43 | /* Clear the "irq"th bit in the mask and set it in the request */ | 30 | /* Clear the "irq"th bit in the mask and set it in the request */ |
44 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | 31 | val = __raw_readl((unsigned long)systemh_irq_mask_register); |
45 | val &= ~mask; | 32 | val &= ~mask; |
46 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | 33 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); |
47 | 34 | ||
48 | val = __raw_readl((unsigned long)systemh_irq_request_register); | 35 | val = __raw_readl((unsigned long)systemh_irq_request_register); |
49 | val |= mask; | 36 | val |= mask; |
50 | __raw_writel(val, (unsigned long)systemh_irq_request_register); | 37 | __raw_writel(val, (unsigned long)systemh_irq_request_register); |
51 | } | ||
52 | } | 38 | } |
53 | 39 | ||
54 | static void enable_systemh_irq(unsigned int irq) | 40 | static void enable_systemh_irq(struct irq_data *data) |
55 | { | 41 | { |
56 | if (systemh_irq_mask_register) { | 42 | unsigned long val, mask = 0x01 << 1; |
57 | unsigned long val, mask = 0x01 << 1; | ||
58 | 43 | ||
59 | /* Set "irq"th bit in the mask register */ | 44 | /* Set "irq"th bit in the mask register */ |
60 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | 45 | val = __raw_readl((unsigned long)systemh_irq_mask_register); |
61 | val |= mask; | 46 | val |= mask; |
62 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | 47 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); |
63 | } | ||
64 | } | 48 | } |
65 | 49 | ||
66 | static void mask_and_ack_systemh(unsigned int irq) | 50 | static struct irq_chip systemh_irq_type = { |
67 | { | 51 | .name = "SystemH Register", |
68 | disable_systemh_irq(irq); | 52 | .irq_unmask = enable_systemh_irq, |
69 | } | 53 | .irq_mask = disable_systemh_irq, |
54 | }; | ||
70 | 55 | ||
71 | void make_systemh_irq(unsigned int irq) | 56 | void make_systemh_irq(unsigned int irq) |
72 | { | 57 | { |
73 | disable_irq_nosync(irq); | 58 | disable_irq_nosync(irq); |
74 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); | 59 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); |
75 | disable_systemh_irq(irq); | 60 | disable_systemh_irq(irq_get_irq_data(irq)); |
76 | } | 61 | } |
diff --git a/arch/sh/boards/mach-x3proto/Makefile b/arch/sh/boards/mach-x3proto/Makefile index 983e4551fec..708c21c919f 100644 --- a/arch/sh/boards/mach-x3proto/Makefile +++ b/arch/sh/boards/mach-x3proto/Makefile | |||
@@ -1 +1,3 @@ | |||
1 | obj-y += setup.o ilsel.o | 1 | obj-y += setup.o ilsel.o |
2 | |||
3 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o | ||
diff --git a/arch/sh/boards/mach-x3proto/gpio.c b/arch/sh/boards/mach-x3proto/gpio.c new file mode 100644 index 00000000000..239e7406625 --- /dev/null +++ b/arch/sh/boards/mach-x3proto/gpio.c | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * arch/sh/boards/mach-x3proto/gpio.c | ||
3 | * | ||
4 | * Renesas SH-X3 Prototype Baseboard GPIO Support. | ||
5 | * | ||
6 | * Copyright (C) 2010 Paul Mundt | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/interrupt.h> | ||
16 | #include <linux/gpio.h> | ||
17 | #include <linux/irq.h> | ||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/io.h> | ||
21 | #include <mach/ilsel.h> | ||
22 | #include <mach/hardware.h> | ||
23 | |||
24 | #define KEYCTLR 0xb81c0000 | ||
25 | #define KEYOUTR 0xb81c0002 | ||
26 | #define KEYDETR 0xb81c0004 | ||
27 | |||
28 | static DEFINE_SPINLOCK(x3proto_gpio_lock); | ||
29 | static unsigned int x3proto_gpio_irq_map[NR_BASEBOARD_GPIOS] = { 0, }; | ||
30 | |||
31 | static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) | ||
32 | { | ||
33 | unsigned long flags; | ||
34 | unsigned int data; | ||
35 | |||
36 | spin_lock_irqsave(&x3proto_gpio_lock, flags); | ||
37 | data = __raw_readw(KEYCTLR); | ||
38 | data |= (1 << gpio); | ||
39 | __raw_writew(data, KEYCTLR); | ||
40 | spin_unlock_irqrestore(&x3proto_gpio_lock, flags); | ||
41 | |||
42 | return 0; | ||
43 | } | ||
44 | |||
45 | static int x3proto_gpio_get(struct gpio_chip *chip, unsigned gpio) | ||
46 | { | ||
47 | return !!(__raw_readw(KEYDETR) & (1 << gpio)); | ||
48 | } | ||
49 | |||
50 | static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) | ||
51 | { | ||
52 | return x3proto_gpio_irq_map[gpio]; | ||
53 | } | ||
54 | |||
55 | static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
56 | { | ||
57 | struct irq_data *data = irq_get_irq_data(irq); | ||
58 | struct irq_chip *chip = irq_data_get_irq_chip(data); | ||
59 | unsigned long mask; | ||
60 | int pin; | ||
61 | |||
62 | chip->irq_mask_ack(data); | ||
63 | |||
64 | mask = __raw_readw(KEYDETR); | ||
65 | |||
66 | for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS) | ||
67 | generic_handle_irq(x3proto_gpio_to_irq(NULL, pin)); | ||
68 | |||
69 | chip->irq_unmask(data); | ||
70 | } | ||
71 | |||
72 | struct gpio_chip x3proto_gpio_chip = { | ||
73 | .label = "x3proto-gpio", | ||
74 | .direction_input = x3proto_gpio_direction_input, | ||
75 | .get = x3proto_gpio_get, | ||
76 | .to_irq = x3proto_gpio_to_irq, | ||
77 | .base = -1, | ||
78 | .ngpio = NR_BASEBOARD_GPIOS, | ||
79 | }; | ||
80 | |||
81 | int __init x3proto_gpio_setup(void) | ||
82 | { | ||
83 | int ilsel; | ||
84 | int ret, i; | ||
85 | |||
86 | ilsel = ilsel_enable(ILSEL_KEY); | ||
87 | if (unlikely(ilsel < 0)) | ||
88 | return ilsel; | ||
89 | |||
90 | ret = gpiochip_add(&x3proto_gpio_chip); | ||
91 | if (unlikely(ret)) | ||
92 | goto err_gpio; | ||
93 | |||
94 | for (i = 0; i < NR_BASEBOARD_GPIOS; i++) { | ||
95 | unsigned long flags; | ||
96 | int irq = create_irq(); | ||
97 | |||
98 | if (unlikely(irq < 0)) { | ||
99 | ret = -EINVAL; | ||
100 | goto err_irq; | ||
101 | } | ||
102 | |||
103 | spin_lock_irqsave(&x3proto_gpio_lock, flags); | ||
104 | x3proto_gpio_irq_map[i] = irq; | ||
105 | set_irq_chip_and_handler_name(irq, &dummy_irq_chip, | ||
106 | handle_simple_irq, "gpio"); | ||
107 | spin_unlock_irqrestore(&x3proto_gpio_lock, flags); | ||
108 | } | ||
109 | |||
110 | pr_info("registering '%s' support, handling GPIOs %u -> %u, " | ||
111 | "bound to IRQ %u\n", | ||
112 | x3proto_gpio_chip.label, x3proto_gpio_chip.base, | ||
113 | x3proto_gpio_chip.base + x3proto_gpio_chip.ngpio, | ||
114 | ilsel); | ||
115 | |||
116 | set_irq_chained_handler(ilsel, x3proto_gpio_irq_handler); | ||
117 | set_irq_wake(ilsel, 1); | ||
118 | |||
119 | return 0; | ||
120 | |||
121 | err_irq: | ||
122 | for (; i >= 0; --i) | ||
123 | if (x3proto_gpio_irq_map[i]) | ||
124 | destroy_irq(x3proto_gpio_irq_map[i]); | ||
125 | |||
126 | ret = gpiochip_remove(&x3proto_gpio_chip); | ||
127 | if (unlikely(ret)) | ||
128 | pr_err("Failed deregistering GPIO\n"); | ||
129 | |||
130 | err_gpio: | ||
131 | synchronize_irq(ilsel); | ||
132 | |||
133 | ilsel_disable(ILSEL_KEY); | ||
134 | |||
135 | return ret; | ||
136 | } | ||
diff --git a/arch/sh/boards/mach-x3proto/ilsel.c b/arch/sh/boards/mach-x3proto/ilsel.c index 5c9842704c6..95e34613951 100644 --- a/arch/sh/boards/mach-x3proto/ilsel.c +++ b/arch/sh/boards/mach-x3proto/ilsel.c | |||
@@ -1,20 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/boards/renesas/x3proto/ilsel.c | 2 | * arch/sh/boards/mach-x3proto/ilsel.c |
3 | * | 3 | * |
4 | * Helper routines for SH-X3 proto board ILSEL. | 4 | * Helper routines for SH-X3 proto board ILSEL. |
5 | * | 5 | * |
6 | * Copyright (C) 2007 Paul Mundt | 6 | * Copyright (C) 2007 - 2010 Paul Mundt |
7 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
9 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
10 | * for more details. | 10 | * for more details. |
11 | */ | 11 | */ |
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
13 | |||
12 | #include <linux/init.h> | 14 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | 16 | #include <linux/module.h> |
15 | #include <linux/bitmap.h> | 17 | #include <linux/bitmap.h> |
16 | #include <linux/io.h> | 18 | #include <linux/io.h> |
17 | #include <asm/ilsel.h> | 19 | #include <mach/ilsel.h> |
18 | 20 | ||
19 | /* | 21 | /* |
20 | * ILSEL is split across: | 22 | * ILSEL is split across: |
@@ -64,6 +66,8 @@ static void __ilsel_enable(ilsel_source_t set, unsigned int bit) | |||
64 | unsigned int tmp, shift; | 66 | unsigned int tmp, shift; |
65 | unsigned long addr; | 67 | unsigned long addr; |
66 | 68 | ||
69 | pr_notice("enabling ILSEL set %d\n", set); | ||
70 | |||
67 | addr = mk_ilsel_addr(bit); | 71 | addr = mk_ilsel_addr(bit); |
68 | shift = mk_ilsel_shift(bit); | 72 | shift = mk_ilsel_shift(bit); |
69 | 73 | ||
@@ -92,8 +96,10 @@ int ilsel_enable(ilsel_source_t set) | |||
92 | { | 96 | { |
93 | unsigned int bit; | 97 | unsigned int bit; |
94 | 98 | ||
95 | /* Aliased sources must use ilsel_enable_fixed() */ | 99 | if (unlikely(set > ILSEL_KEY)) { |
96 | BUG_ON(set > ILSEL_KEY); | 100 | pr_err("Aliased sources must use ilsel_enable_fixed()\n"); |
101 | return -EINVAL; | ||
102 | } | ||
97 | 103 | ||
98 | do { | 104 | do { |
99 | bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS); | 105 | bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS); |
@@ -140,6 +146,8 @@ void ilsel_disable(unsigned int irq) | |||
140 | unsigned long addr; | 146 | unsigned long addr; |
141 | unsigned int tmp; | 147 | unsigned int tmp; |
142 | 148 | ||
149 | pr_notice("disabling ILSEL set %d\n", irq); | ||
150 | |||
143 | addr = mk_ilsel_addr(irq); | 151 | addr = mk_ilsel_addr(irq); |
144 | 152 | ||
145 | tmp = __raw_readw(addr); | 153 | tmp = __raw_readw(addr); |
diff --git a/arch/sh/boards/mach-x3proto/setup.c b/arch/sh/boards/mach-x3proto/setup.c index 102bf56befb..d682e2b6a85 100644 --- a/arch/sh/boards/mach-x3proto/setup.c +++ b/arch/sh/boards/mach-x3proto/setup.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * arch/sh/boards/renesas/x3proto/setup.c | 2 | * arch/sh/boards/mach-x3proto/setup.c |
3 | * | 3 | * |
4 | * Renesas SH-X3 Prototype Board Support. | 4 | * Renesas SH-X3 Prototype Board Support. |
5 | * | 5 | * |
6 | * Copyright (C) 2007 - 2008 Paul Mundt | 6 | * Copyright (C) 2007 - 2010 Paul Mundt |
7 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
9 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
@@ -16,9 +16,13 @@ | |||
16 | #include <linux/smc91x.h> | 16 | #include <linux/smc91x.h> |
17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/input.h> | ||
19 | #include <linux/usb/r8a66597.h> | 20 | #include <linux/usb/r8a66597.h> |
20 | #include <linux/usb/m66592.h> | 21 | #include <linux/usb/m66592.h> |
21 | #include <asm/ilsel.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/gpio_keys.h> | ||
24 | #include <mach/ilsel.h> | ||
25 | #include <mach/hardware.h> | ||
22 | #include <asm/smp-ops.h> | 26 | #include <asm/smp-ops.h> |
23 | 27 | ||
24 | static struct resource heartbeat_resources[] = { | 28 | static struct resource heartbeat_resources[] = { |
@@ -122,15 +126,128 @@ static struct platform_device m66592_usb_peripheral_device = { | |||
122 | .resource = m66592_usb_peripheral_resources, | 126 | .resource = m66592_usb_peripheral_resources, |
123 | }; | 127 | }; |
124 | 128 | ||
129 | static struct gpio_keys_button baseboard_buttons[NR_BASEBOARD_GPIOS] = { | ||
130 | { | ||
131 | .desc = "key44", | ||
132 | .code = KEY_POWER, | ||
133 | .active_low = 1, | ||
134 | .wakeup = 1, | ||
135 | }, { | ||
136 | .desc = "key43", | ||
137 | .code = KEY_SUSPEND, | ||
138 | .active_low = 1, | ||
139 | .wakeup = 1, | ||
140 | }, { | ||
141 | .desc = "key42", | ||
142 | .code = KEY_KATAKANAHIRAGANA, | ||
143 | .active_low = 1, | ||
144 | }, { | ||
145 | .desc = "key41", | ||
146 | .code = KEY_SWITCHVIDEOMODE, | ||
147 | .active_low = 1, | ||
148 | }, { | ||
149 | .desc = "key34", | ||
150 | .code = KEY_F12, | ||
151 | .active_low = 1, | ||
152 | }, { | ||
153 | .desc = "key33", | ||
154 | .code = KEY_F11, | ||
155 | .active_low = 1, | ||
156 | }, { | ||
157 | .desc = "key32", | ||
158 | .code = KEY_F10, | ||
159 | .active_low = 1, | ||
160 | }, { | ||
161 | .desc = "key31", | ||
162 | .code = KEY_F9, | ||
163 | .active_low = 1, | ||
164 | }, { | ||
165 | .desc = "key24", | ||
166 | .code = KEY_F8, | ||
167 | .active_low = 1, | ||
168 | }, { | ||
169 | .desc = "key23", | ||
170 | .code = KEY_F7, | ||
171 | .active_low = 1, | ||
172 | }, { | ||
173 | .desc = "key22", | ||
174 | .code = KEY_F6, | ||
175 | .active_low = 1, | ||
176 | }, { | ||
177 | .desc = "key21", | ||
178 | .code = KEY_F5, | ||
179 | .active_low = 1, | ||
180 | }, { | ||
181 | .desc = "key14", | ||
182 | .code = KEY_F4, | ||
183 | .active_low = 1, | ||
184 | }, { | ||
185 | .desc = "key13", | ||
186 | .code = KEY_F3, | ||
187 | .active_low = 1, | ||
188 | }, { | ||
189 | .desc = "key12", | ||
190 | .code = KEY_F2, | ||
191 | .active_low = 1, | ||
192 | }, { | ||
193 | .desc = "key11", | ||
194 | .code = KEY_F1, | ||
195 | .active_low = 1, | ||
196 | }, | ||
197 | }; | ||
198 | |||
199 | static struct gpio_keys_platform_data baseboard_buttons_data = { | ||
200 | .buttons = baseboard_buttons, | ||
201 | .nbuttons = ARRAY_SIZE(baseboard_buttons), | ||
202 | }; | ||
203 | |||
204 | static struct platform_device baseboard_buttons_device = { | ||
205 | .name = "gpio-keys", | ||
206 | .id = -1, | ||
207 | .dev = { | ||
208 | .platform_data = &baseboard_buttons_data, | ||
209 | }, | ||
210 | }; | ||
211 | |||
125 | static struct platform_device *x3proto_devices[] __initdata = { | 212 | static struct platform_device *x3proto_devices[] __initdata = { |
126 | &heartbeat_device, | 213 | &heartbeat_device, |
127 | &smc91x_device, | 214 | &smc91x_device, |
128 | &r8a66597_usb_host_device, | 215 | &r8a66597_usb_host_device, |
129 | &m66592_usb_peripheral_device, | 216 | &m66592_usb_peripheral_device, |
217 | &baseboard_buttons_device, | ||
130 | }; | 218 | }; |
131 | 219 | ||
220 | static void __init x3proto_init_irq(void) | ||
221 | { | ||
222 | plat_irq_setup_pins(IRQ_MODE_IRL3210); | ||
223 | |||
224 | /* Set ICR0.LVLMODE */ | ||
225 | __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000); | ||
226 | } | ||
227 | |||
132 | static int __init x3proto_devices_setup(void) | 228 | static int __init x3proto_devices_setup(void) |
133 | { | 229 | { |
230 | int ret, i; | ||
231 | |||
232 | /* | ||
233 | * IRLs are only needed for ILSEL mappings, so flip over the INTC | ||
234 | * pins at a later point to enable the GPIOs to settle. | ||
235 | */ | ||
236 | x3proto_init_irq(); | ||
237 | |||
238 | /* | ||
239 | * Now that ILSELs are available, set up the baseboard GPIOs. | ||
240 | */ | ||
241 | ret = x3proto_gpio_setup(); | ||
242 | if (unlikely(ret)) | ||
243 | return ret; | ||
244 | |||
245 | /* | ||
246 | * Propagate dynamic GPIOs for the baseboard button device. | ||
247 | */ | ||
248 | for (i = 0; i < ARRAY_SIZE(baseboard_buttons); i++) | ||
249 | baseboard_buttons[i].gpio = x3proto_gpio_chip.base + i; | ||
250 | |||
134 | r8a66597_usb_host_resources[1].start = | 251 | r8a66597_usb_host_resources[1].start = |
135 | r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I); | 252 | r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I); |
136 | 253 | ||
@@ -145,14 +262,6 @@ static int __init x3proto_devices_setup(void) | |||
145 | } | 262 | } |
146 | device_initcall(x3proto_devices_setup); | 263 | device_initcall(x3proto_devices_setup); |
147 | 264 | ||
148 | static void __init x3proto_init_irq(void) | ||
149 | { | ||
150 | plat_irq_setup_pins(IRQ_MODE_IRL3210); | ||
151 | |||
152 | /* Set ICR0.LVLMODE */ | ||
153 | __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000); | ||
154 | } | ||
155 | |||
156 | static void __init x3proto_setup(char **cmdline_p) | 265 | static void __init x3proto_setup(char **cmdline_p) |
157 | { | 266 | { |
158 | register_smp_ops(&shx3_smp_ops); | 267 | register_smp_ops(&shx3_smp_ops); |
@@ -161,5 +270,4 @@ static void __init x3proto_setup(char **cmdline_p) | |||
161 | static struct sh_machine_vector mv_x3proto __initmv = { | 270 | static struct sh_machine_vector mv_x3proto __initmv = { |
162 | .mv_name = "x3proto", | 271 | .mv_name = "x3proto", |
163 | .mv_setup = x3proto_setup, | 272 | .mv_setup = x3proto_setup, |
164 | .mv_init_irq = x3proto_init_irq, | ||
165 | }; | 273 | }; |