diff options
Diffstat (limited to 'arch/sh')
37 files changed, 947 insertions, 302 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 8a9011dced14..9af3c8d0776b 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -23,8 +23,8 @@ config SUPERH | |||
23 | select HAVE_SPARSE_IRQ | 23 | select HAVE_SPARSE_IRQ |
24 | select RTC_LIB | 24 | select RTC_LIB |
25 | select GENERIC_ATOMIC64 | 25 | select GENERIC_ATOMIC64 |
26 | # Support the deprecated APIs until MFD and GPIOLIB catch up. | 26 | select GENERIC_HARDIRQS_NO_DEPRECATED |
27 | select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB | 27 | select GENERIC_IRQ_SHOW |
28 | help | 28 | help |
29 | The SuperH is a RISC processor targeted for use in embedded systems | 29 | The SuperH is a RISC processor targeted for use in embedded systems |
30 | and consumer electronics; it was also used in the Sega Dreamcast | 30 | and consumer electronics; it was also used in the Sega Dreamcast |
@@ -74,6 +74,9 @@ config GENERIC_CSUM | |||
74 | config GENERIC_FIND_NEXT_BIT | 74 | config GENERIC_FIND_NEXT_BIT |
75 | def_bool y | 75 | def_bool y |
76 | 76 | ||
77 | config GENERIC_FIND_BIT_LE | ||
78 | def_bool y | ||
79 | |||
77 | config GENERIC_HWEIGHT | 80 | config GENERIC_HWEIGHT |
78 | def_bool y | 81 | def_bool y |
79 | 82 | ||
@@ -434,6 +437,8 @@ config CPU_SUBTYPE_SH7757 | |||
434 | select CPU_SH4A | 437 | select CPU_SH4A |
435 | select CPU_SHX2 | 438 | select CPU_SHX2 |
436 | select ARCH_WANT_OPTIONAL_GPIOLIB | 439 | select ARCH_WANT_OPTIONAL_GPIOLIB |
440 | select USB_ARCH_HAS_OHCI | ||
441 | select USB_ARCH_HAS_EHCI | ||
437 | help | 442 | help |
438 | Select SH7757 if you have a SH4A SH7757 CPU. | 443 | Select SH7757 if you have a SH4A SH7757 CPU. |
439 | 444 | ||
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c index f47ac82da876..e9656a2cc4cc 100644 --- a/arch/sh/boards/board-edosk7760.c +++ b/arch/sh/boards/board-edosk7760.c | |||
@@ -56,7 +56,7 @@ static struct mtd_partition edosk7760_nor_flash_partitions[] = { | |||
56 | }, { | 56 | }, { |
57 | .name = "fs", | 57 | .name = "fs", |
58 | .offset = MTDPART_OFS_APPEND, | 58 | .offset = MTDPART_OFS_APPEND, |
59 | .size = SZ_26M, | 59 | .size = (26 << 20), |
60 | }, { | 60 | }, { |
61 | .name = "other", | 61 | .name = "other", |
62 | .offset = MTDPART_OFS_APPEND, | 62 | .offset = MTDPART_OFS_APPEND, |
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c index d5ce5e18eb37..9da92ac36533 100644 --- a/arch/sh/boards/board-espt.c +++ b/arch/sh/boards/board-espt.c | |||
@@ -66,6 +66,11 @@ static struct resource sh_eth_resources[] = { | |||
66 | .end = 0xFEE00F7C - 1, | 66 | .end = 0xFEE00F7C - 1, |
67 | .flags = IORESOURCE_MEM, | 67 | .flags = IORESOURCE_MEM, |
68 | }, { | 68 | }, { |
69 | .start = 0xFEE01800, /* TSU */ | ||
70 | .end = 0xFEE01FFF, | ||
71 | .flags = IORESOURCE_MEM, | ||
72 | }, { | ||
73 | |||
69 | .start = 57, /* irq number */ | 74 | .start = 57, /* irq number */ |
70 | .flags = IORESOURCE_IRQ, | 75 | .flags = IORESOURCE_IRQ, |
71 | }, | 76 | }, |
@@ -74,6 +79,8 @@ static struct resource sh_eth_resources[] = { | |||
74 | static struct sh_eth_plat_data sh7763_eth_pdata = { | 79 | static struct sh_eth_plat_data sh7763_eth_pdata = { |
75 | .phy = 0, | 80 | .phy = 0, |
76 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 81 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
82 | .register_type = SH_ETH_REG_GIGABIT, | ||
83 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
77 | }; | 84 | }; |
78 | 85 | ||
79 | static struct platform_device espt_eth_device = { | 86 | static struct platform_device espt_eth_device = { |
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c index c475f1056ab4..a9e33569ad38 100644 --- a/arch/sh/boards/board-sh7757lcr.c +++ b/arch/sh/boards/board-sh7757lcr.c | |||
@@ -15,6 +15,9 @@ | |||
15 | #include <linux/spi/spi.h> | 15 | #include <linux/spi/spi.h> |
16 | #include <linux/spi/flash.h> | 16 | #include <linux/spi/flash.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/mmc/host.h> | ||
19 | #include <linux/mmc/sh_mmcif.h> | ||
20 | #include <linux/mfd/sh_mobile_sdhi.h> | ||
18 | #include <cpu/sh7757.h> | 21 | #include <cpu/sh7757.h> |
19 | #include <asm/sh_eth.h> | 22 | #include <asm/sh_eth.h> |
20 | #include <asm/heartbeat.h> | 23 | #include <asm/heartbeat.h> |
@@ -44,6 +47,17 @@ static struct platform_device heartbeat_device = { | |||
44 | }; | 47 | }; |
45 | 48 | ||
46 | /* Fast Ethernet */ | 49 | /* Fast Ethernet */ |
50 | #define GBECONT 0xffc10100 | ||
51 | #define GBECONT_RMII1 BIT(17) | ||
52 | #define GBECONT_RMII0 BIT(16) | ||
53 | static void sh7757_eth_set_mdio_gate(unsigned long addr) | ||
54 | { | ||
55 | if ((addr & 0x00000fff) < 0x0800) | ||
56 | writel(readl(GBECONT) | GBECONT_RMII0, GBECONT); | ||
57 | else | ||
58 | writel(readl(GBECONT) | GBECONT_RMII1, GBECONT); | ||
59 | } | ||
60 | |||
47 | static struct resource sh_eth0_resources[] = { | 61 | static struct resource sh_eth0_resources[] = { |
48 | { | 62 | { |
49 | .start = 0xfef00000, | 63 | .start = 0xfef00000, |
@@ -59,6 +73,8 @@ static struct resource sh_eth0_resources[] = { | |||
59 | static struct sh_eth_plat_data sh7757_eth0_pdata = { | 73 | static struct sh_eth_plat_data sh7757_eth0_pdata = { |
60 | .phy = 1, | 74 | .phy = 1, |
61 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 75 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
76 | .register_type = SH_ETH_REG_FAST_SH4, | ||
77 | .set_mdio_gate = sh7757_eth_set_mdio_gate, | ||
62 | }; | 78 | }; |
63 | 79 | ||
64 | static struct platform_device sh7757_eth0_device = { | 80 | static struct platform_device sh7757_eth0_device = { |
@@ -86,6 +102,8 @@ static struct resource sh_eth1_resources[] = { | |||
86 | static struct sh_eth_plat_data sh7757_eth1_pdata = { | 102 | static struct sh_eth_plat_data sh7757_eth1_pdata = { |
87 | .phy = 1, | 103 | .phy = 1, |
88 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 104 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
105 | .register_type = SH_ETH_REG_FAST_SH4, | ||
106 | .set_mdio_gate = sh7757_eth_set_mdio_gate, | ||
89 | }; | 107 | }; |
90 | 108 | ||
91 | static struct platform_device sh7757_eth1_device = { | 109 | static struct platform_device sh7757_eth1_device = { |
@@ -98,10 +116,173 @@ static struct platform_device sh7757_eth1_device = { | |||
98 | }, | 116 | }, |
99 | }; | 117 | }; |
100 | 118 | ||
119 | static void sh7757_eth_giga_set_mdio_gate(unsigned long addr) | ||
120 | { | ||
121 | if ((addr & 0x00000fff) < 0x0800) { | ||
122 | gpio_set_value(GPIO_PTT4, 1); | ||
123 | writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT); | ||
124 | } else { | ||
125 | gpio_set_value(GPIO_PTT4, 0); | ||
126 | writel(readl(GBECONT) & ~GBECONT_RMII1, GBECONT); | ||
127 | } | ||
128 | } | ||
129 | |||
130 | static struct resource sh_eth_giga0_resources[] = { | ||
131 | { | ||
132 | .start = 0xfee00000, | ||
133 | .end = 0xfee007ff, | ||
134 | .flags = IORESOURCE_MEM, | ||
135 | }, { | ||
136 | /* TSU */ | ||
137 | .start = 0xfee01800, | ||
138 | .end = 0xfee01fff, | ||
139 | .flags = IORESOURCE_MEM, | ||
140 | }, { | ||
141 | .start = 315, | ||
142 | .end = 315, | ||
143 | .flags = IORESOURCE_IRQ, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static struct sh_eth_plat_data sh7757_eth_giga0_pdata = { | ||
148 | .phy = 18, | ||
149 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | ||
150 | .register_type = SH_ETH_REG_GIGABIT, | ||
151 | .set_mdio_gate = sh7757_eth_giga_set_mdio_gate, | ||
152 | .phy_interface = PHY_INTERFACE_MODE_RGMII_ID, | ||
153 | }; | ||
154 | |||
155 | static struct platform_device sh7757_eth_giga0_device = { | ||
156 | .name = "sh-eth", | ||
157 | .resource = sh_eth_giga0_resources, | ||
158 | .id = 2, | ||
159 | .num_resources = ARRAY_SIZE(sh_eth_giga0_resources), | ||
160 | .dev = { | ||
161 | .platform_data = &sh7757_eth_giga0_pdata, | ||
162 | }, | ||
163 | }; | ||
164 | |||
165 | static struct resource sh_eth_giga1_resources[] = { | ||
166 | { | ||
167 | .start = 0xfee00800, | ||
168 | .end = 0xfee00fff, | ||
169 | .flags = IORESOURCE_MEM, | ||
170 | }, { | ||
171 | .start = 316, | ||
172 | .end = 316, | ||
173 | .flags = IORESOURCE_IRQ, | ||
174 | }, | ||
175 | }; | ||
176 | |||
177 | static struct sh_eth_plat_data sh7757_eth_giga1_pdata = { | ||
178 | .phy = 19, | ||
179 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | ||
180 | .register_type = SH_ETH_REG_GIGABIT, | ||
181 | .set_mdio_gate = sh7757_eth_giga_set_mdio_gate, | ||
182 | .phy_interface = PHY_INTERFACE_MODE_RGMII_ID, | ||
183 | }; | ||
184 | |||
185 | static struct platform_device sh7757_eth_giga1_device = { | ||
186 | .name = "sh-eth", | ||
187 | .resource = sh_eth_giga1_resources, | ||
188 | .id = 3, | ||
189 | .num_resources = ARRAY_SIZE(sh_eth_giga1_resources), | ||
190 | .dev = { | ||
191 | .platform_data = &sh7757_eth_giga1_pdata, | ||
192 | }, | ||
193 | }; | ||
194 | |||
195 | /* SH_MMCIF */ | ||
196 | static struct resource sh_mmcif_resources[] = { | ||
197 | [0] = { | ||
198 | .start = 0xffcb0000, | ||
199 | .end = 0xffcb00ff, | ||
200 | .flags = IORESOURCE_MEM, | ||
201 | }, | ||
202 | [1] = { | ||
203 | .start = 211, | ||
204 | .flags = IORESOURCE_IRQ, | ||
205 | }, | ||
206 | [2] = { | ||
207 | .start = 212, | ||
208 | .flags = IORESOURCE_IRQ, | ||
209 | }, | ||
210 | }; | ||
211 | |||
212 | static struct sh_mmcif_dma sh7757lcr_mmcif_dma = { | ||
213 | .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX, | ||
214 | .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX, | ||
215 | }; | ||
216 | |||
217 | static struct sh_mmcif_plat_data sh_mmcif_plat = { | ||
218 | .dma = &sh7757lcr_mmcif_dma, | ||
219 | .sup_pclk = 0x0f, | ||
220 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
221 | .ocr = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
222 | }; | ||
223 | |||
224 | static struct platform_device sh_mmcif_device = { | ||
225 | .name = "sh_mmcif", | ||
226 | .id = 0, | ||
227 | .dev = { | ||
228 | .platform_data = &sh_mmcif_plat, | ||
229 | }, | ||
230 | .num_resources = ARRAY_SIZE(sh_mmcif_resources), | ||
231 | .resource = sh_mmcif_resources, | ||
232 | }; | ||
233 | |||
234 | /* SDHI0 */ | ||
235 | static struct sh_mobile_sdhi_info sdhi_info = { | ||
236 | .dma_slave_tx = SHDMA_SLAVE_SDHI_TX, | ||
237 | .dma_slave_rx = SHDMA_SLAVE_SDHI_RX, | ||
238 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, | ||
239 | }; | ||
240 | |||
241 | static struct resource sdhi_resources[] = { | ||
242 | [0] = { | ||
243 | .start = 0xffe50000, | ||
244 | .end = 0xffe501ff, | ||
245 | .flags = IORESOURCE_MEM, | ||
246 | }, | ||
247 | [1] = { | ||
248 | .start = 20, | ||
249 | .flags = IORESOURCE_IRQ, | ||
250 | }, | ||
251 | }; | ||
252 | |||
253 | static struct platform_device sdhi_device = { | ||
254 | .name = "sh_mobile_sdhi", | ||
255 | .num_resources = ARRAY_SIZE(sdhi_resources), | ||
256 | .resource = sdhi_resources, | ||
257 | .id = 0, | ||
258 | .dev = { | ||
259 | .platform_data = &sdhi_info, | ||
260 | }, | ||
261 | }; | ||
262 | |||
101 | static struct platform_device *sh7757lcr_devices[] __initdata = { | 263 | static struct platform_device *sh7757lcr_devices[] __initdata = { |
102 | &heartbeat_device, | 264 | &heartbeat_device, |
103 | &sh7757_eth0_device, | 265 | &sh7757_eth0_device, |
104 | &sh7757_eth1_device, | 266 | &sh7757_eth1_device, |
267 | &sh7757_eth_giga0_device, | ||
268 | &sh7757_eth_giga1_device, | ||
269 | &sh_mmcif_device, | ||
270 | &sdhi_device, | ||
271 | }; | ||
272 | |||
273 | static struct flash_platform_data spi_flash_data = { | ||
274 | .name = "m25p80", | ||
275 | .type = "m25px64", | ||
276 | }; | ||
277 | |||
278 | static struct spi_board_info spi_board_info[] = { | ||
279 | { | ||
280 | .modalias = "m25p80", | ||
281 | .max_speed_hz = 25000000, | ||
282 | .bus_num = 0, | ||
283 | .chip_select = 1, | ||
284 | .platform_data = &spi_flash_data, | ||
285 | }, | ||
105 | }; | 286 | }; |
106 | 287 | ||
107 | static int __init sh7757lcr_devices_setup(void) | 288 | static int __init sh7757lcr_devices_setup(void) |
@@ -332,6 +513,10 @@ static int __init sh7757lcr_devices_setup(void) | |||
332 | gpio_request(GPIO_PTT5, NULL); /* eMMC_PRST# */ | 513 | gpio_request(GPIO_PTT5, NULL); /* eMMC_PRST# */ |
333 | gpio_direction_output(GPIO_PTT5, 1); | 514 | gpio_direction_output(GPIO_PTT5, 1); |
334 | 515 | ||
516 | /* register SPI device information */ | ||
517 | spi_register_board_info(spi_board_info, | ||
518 | ARRAY_SIZE(spi_board_info)); | ||
519 | |||
335 | /* General platform */ | 520 | /* General platform */ |
336 | return platform_add_devices(sh7757lcr_devices, | 521 | return platform_add_devices(sh7757lcr_devices, |
337 | ARRAY_SIZE(sh7757lcr_devices)); | 522 | ARRAY_SIZE(sh7757lcr_devices)); |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index a2c06220bbab..c68e2863bf86 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -142,6 +142,8 @@ static struct resource sh_eth_resources[] = { | |||
142 | static struct sh_eth_plat_data sh_eth_plat = { | 142 | static struct sh_eth_plat_data sh_eth_plat = { |
143 | .phy = 0x1f, /* SMSC LAN8700 */ | 143 | .phy = 0x1f, /* SMSC LAN8700 */ |
144 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 144 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
145 | .register_type = SH_ETH_REG_FAST_SH4, | ||
146 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
145 | .ether_link_active_low = 1 | 147 | .ether_link_active_low = 1 |
146 | }; | 148 | }; |
147 | 149 | ||
@@ -741,11 +743,7 @@ static struct platform_device camera_devices[] = { | |||
741 | 743 | ||
742 | /* FSI */ | 744 | /* FSI */ |
743 | static struct sh_fsi_platform_info fsi_info = { | 745 | static struct sh_fsi_platform_info fsi_info = { |
744 | .portb_flags = SH_FSI_BRS_INV | | 746 | .portb_flags = SH_FSI_BRS_INV, |
745 | SH_FSI_OUT_SLAVE_MODE | | ||
746 | SH_FSI_IN_SLAVE_MODE | | ||
747 | SH_FSI_OFMT(I2S) | | ||
748 | SH_FSI_IFMT(I2S), | ||
749 | }; | 747 | }; |
750 | 748 | ||
751 | static struct resource fsi_resources[] = { | 749 | static struct resource fsi_resources[] = { |
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 527679394a25..c8bcf6a19b55 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -286,11 +286,7 @@ static struct platform_device ceu1_device = { | |||
286 | /* FSI */ | 286 | /* FSI */ |
287 | /* change J20, J21, J22 pin to 1-2 connection to use slave mode */ | 287 | /* change J20, J21, J22 pin to 1-2 connection to use slave mode */ |
288 | static struct sh_fsi_platform_info fsi_info = { | 288 | static struct sh_fsi_platform_info fsi_info = { |
289 | .porta_flags = SH_FSI_BRS_INV | | 289 | .porta_flags = SH_FSI_BRS_INV, |
290 | SH_FSI_OUT_SLAVE_MODE | | ||
291 | SH_FSI_IN_SLAVE_MODE | | ||
292 | SH_FSI_OFMT(PCM) | | ||
293 | SH_FSI_IFMT(PCM), | ||
294 | }; | 290 | }; |
295 | 291 | ||
296 | static struct resource fsi_resources[] = { | 292 | static struct resource fsi_resources[] = { |
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c index f64a6918224c..f3d828f133e5 100644 --- a/arch/sh/boards/mach-sh7763rdp/setup.c +++ b/arch/sh/boards/mach-sh7763rdp/setup.c | |||
@@ -75,6 +75,10 @@ static struct resource sh_eth_resources[] = { | |||
75 | .end = 0xFEE00F7C - 1, | 75 | .end = 0xFEE00F7C - 1, |
76 | .flags = IORESOURCE_MEM, | 76 | .flags = IORESOURCE_MEM, |
77 | }, { | 77 | }, { |
78 | .start = 0xFEE01800, /* TSU */ | ||
79 | .end = 0xFEE01FFF, | ||
80 | .flags = IORESOURCE_MEM, | ||
81 | }, { | ||
78 | .start = 57, /* irq number */ | 82 | .start = 57, /* irq number */ |
79 | .flags = IORESOURCE_IRQ, | 83 | .flags = IORESOURCE_IRQ, |
80 | }, | 84 | }, |
@@ -83,6 +87,8 @@ static struct resource sh_eth_resources[] = { | |||
83 | static struct sh_eth_plat_data sh7763_eth_pdata = { | 87 | static struct sh_eth_plat_data sh7763_eth_pdata = { |
84 | .phy = 1, | 88 | .phy = 1, |
85 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 89 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
90 | .register_type = SH_ETH_REG_GIGABIT, | ||
91 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
86 | }; | 92 | }; |
87 | 93 | ||
88 | static struct platform_device sh7763rdp_eth_device = { | 94 | static struct platform_device sh7763rdp_eth_device = { |
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index e0b0293bae63..780e083e4d17 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
@@ -11,6 +11,8 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz \ | |||
11 | 11 | ||
12 | OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o | 12 | OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o |
13 | 13 | ||
14 | GCOV_PROFILE := n | ||
15 | |||
14 | # | 16 | # |
15 | # IMAGE_OFFSET is the load offset of the compression loader | 17 | # IMAGE_OFFSET is the load offset of the compression loader |
16 | # | 18 | # |
diff --git a/arch/sh/boot/romimage/mmcif-sh7724.c b/arch/sh/boot/romimage/mmcif-sh7724.c index c84e7831018d..16b122510c84 100644 --- a/arch/sh/boot/romimage/mmcif-sh7724.c +++ b/arch/sh/boot/romimage/mmcif-sh7724.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/mmc/sh_mmcif.h> | 11 | #include <linux/mmc/sh_mmcif.h> |
12 | #include <linux/mmc/boot.h> | ||
12 | #include <mach/romimage.h> | 13 | #include <mach/romimage.h> |
13 | 14 | ||
14 | #define MMCIF_BASE (void __iomem *)0xa4ca0000 | 15 | #define MMCIF_BASE (void __iomem *)0xa4ca0000 |
@@ -29,7 +30,7 @@ | |||
29 | */ | 30 | */ |
30 | asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) | 31 | asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) |
31 | { | 32 | { |
32 | mmcif_update_progress(MMCIF_PROGRESS_ENTER); | 33 | mmcif_update_progress(MMC_PROGRESS_ENTER); |
33 | 34 | ||
34 | /* enable clock to the MMCIF hardware block */ | 35 | /* enable clock to the MMCIF hardware block */ |
35 | __raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2); | 36 | __raw_writel(__raw_readl(MSTPCR2) & ~0x20000000, MSTPCR2); |
@@ -52,12 +53,12 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) | |||
52 | /* high drive capability for MMC pins */ | 53 | /* high drive capability for MMC pins */ |
53 | __raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA); | 54 | __raw_writew(__raw_readw(DRVCRA) | 0x3000, DRVCRA); |
54 | 55 | ||
55 | mmcif_update_progress(MMCIF_PROGRESS_INIT); | 56 | mmcif_update_progress(MMC_PROGRESS_INIT); |
56 | 57 | ||
57 | /* setup MMCIF hardware */ | 58 | /* setup MMCIF hardware */ |
58 | sh_mmcif_boot_init(MMCIF_BASE); | 59 | sh_mmcif_boot_init(MMCIF_BASE); |
59 | 60 | ||
60 | mmcif_update_progress(MMCIF_PROGRESS_LOAD); | 61 | mmcif_update_progress(MMC_PROGRESS_LOAD); |
61 | 62 | ||
62 | /* load kernel via MMCIF interface */ | 63 | /* load kernel via MMCIF interface */ |
63 | sh_mmcif_boot_do_read(MMCIF_BASE, 512, | 64 | sh_mmcif_boot_do_read(MMCIF_BASE, 512, |
@@ -67,5 +68,5 @@ asmlinkage void mmcif_loader(unsigned char *buf, unsigned long no_bytes) | |||
67 | /* disable clock to the MMCIF hardware block */ | 68 | /* disable clock to the MMCIF hardware block */ |
68 | __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); | 69 | __raw_writel(__raw_readl(MSTPCR2) | 0x20000000, MSTPCR2); |
69 | 70 | ||
70 | mmcif_update_progress(MMCIF_PROGRESS_DONE); | 71 | mmcif_update_progress(MMC_PROGRESS_DONE); |
71 | } | 72 | } |
diff --git a/arch/sh/configs/sh7757lcr_defconfig b/arch/sh/configs/sh7757lcr_defconfig index 5f7f667b9f3b..fa0ecf87034c 100644 --- a/arch/sh/configs/sh7757lcr_defconfig +++ b/arch/sh/configs/sh7757lcr_defconfig | |||
@@ -38,7 +38,15 @@ CONFIG_IPV6=y | |||
38 | # CONFIG_WIRELESS is not set | 38 | # CONFIG_WIRELESS is not set |
39 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 39 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
40 | # CONFIG_FW_LOADER is not set | 40 | # CONFIG_FW_LOADER is not set |
41 | CONFIG_MTD=y | ||
42 | CONFIG_MTD_CONCAT=y | ||
43 | CONFIG_MTD_PARTITIONS=y | ||
44 | CONFIG_MTD_CHAR=y | ||
45 | CONFIG_MTD_BLOCK=y | ||
46 | CONFIG_MTD_M25P80=y | ||
41 | CONFIG_BLK_DEV_RAM=y | 47 | CONFIG_BLK_DEV_RAM=y |
48 | CONFIG_SCSI=y | ||
49 | CONFIG_BLK_DEV_SD=y | ||
42 | CONFIG_NETDEVICES=y | 50 | CONFIG_NETDEVICES=y |
43 | CONFIG_VITESSE_PHY=y | 51 | CONFIG_VITESSE_PHY=y |
44 | CONFIG_NET_ETHERNET=y | 52 | CONFIG_NET_ETHERNET=y |
@@ -53,8 +61,17 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=3 | |||
53 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | 61 | CONFIG_SERIAL_SH_SCI_CONSOLE=y |
54 | # CONFIG_LEGACY_PTYS is not set | 62 | # CONFIG_LEGACY_PTYS is not set |
55 | # CONFIG_HW_RANDOM is not set | 63 | # CONFIG_HW_RANDOM is not set |
64 | CONFIG_SPI=y | ||
65 | CONFIG_SPI_SH=y | ||
56 | # CONFIG_HWMON is not set | 66 | # CONFIG_HWMON is not set |
57 | # CONFIG_USB_SUPPORT is not set | 67 | CONFIG_MFD_SH_MOBILE_SDHI=y |
68 | CONFIG_USB=y | ||
69 | CONFIG_USB_EHCI_HCD=y | ||
70 | CONFIG_USB_OHCI_HCD=y | ||
71 | CONFIG_USB_STORAGE=y | ||
72 | CONFIG_MMC=y | ||
73 | CONFIG_MMC_TMIO=y | ||
74 | CONFIG_MMC_SH_MMCIF=y | ||
58 | CONFIG_EXT2_FS=y | 75 | CONFIG_EXT2_FS=y |
59 | CONFIG_EXT3_FS=y | 76 | CONFIG_EXT3_FS=y |
60 | CONFIG_ISO9660_FS=y | 77 | CONFIG_ISO9660_FS=y |
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c index 96e9b058aa1d..4418f9070ed1 100644 --- a/arch/sh/drivers/pci/pcie-sh7786.c +++ b/arch/sh/drivers/pci/pcie-sh7786.c | |||
@@ -1,16 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * Low-Level PCI Express Support for the SH7786 | 2 | * Low-Level PCI Express Support for the SH7786 |
3 | * | 3 | * |
4 | * Copyright (C) 2009 - 2010 Paul Mundt | 4 | * Copyright (C) 2009 - 2011 Paul Mundt |
5 | * | 5 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 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 | 7 | * License. See the file "COPYING" in the main directory of this archive |
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | #define pr_fmt(fmt) "PCI: " fmt | ||
11 | |||
10 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
11 | #include <linux/init.h> | 13 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
13 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/async.h> | ||
14 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
15 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
16 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
@@ -31,7 +34,7 @@ static unsigned int nr_ports; | |||
31 | 34 | ||
32 | static struct sh7786_pcie_hwops { | 35 | static struct sh7786_pcie_hwops { |
33 | int (*core_init)(void); | 36 | int (*core_init)(void); |
34 | int (*port_init_hw)(struct sh7786_pcie_port *port); | 37 | async_func_ptr *port_init_hw; |
35 | } *sh7786_pcie_hwops; | 38 | } *sh7786_pcie_hwops; |
36 | 39 | ||
37 | static struct resource sh7786_pci0_resources[] = { | 40 | static struct resource sh7786_pci0_resources[] = { |
@@ -474,8 +477,9 @@ static int __init sh7786_pcie_core_init(void) | |||
474 | return test_mode_pin(MODE_PIN12) ? 3 : 2; | 477 | return test_mode_pin(MODE_PIN12) ? 3 : 2; |
475 | } | 478 | } |
476 | 479 | ||
477 | static int __init sh7786_pcie_init_hw(struct sh7786_pcie_port *port) | 480 | static void __init sh7786_pcie_init_hw(void *data, async_cookie_t cookie) |
478 | { | 481 | { |
482 | struct sh7786_pcie_port *port = data; | ||
479 | int ret; | 483 | int ret; |
480 | 484 | ||
481 | /* | 485 | /* |
@@ -488,18 +492,30 @@ static int __init sh7786_pcie_init_hw(struct sh7786_pcie_port *port) | |||
488 | * Setup clocks, needed both for PHY and PCIe registers. | 492 | * Setup clocks, needed both for PHY and PCIe registers. |
489 | */ | 493 | */ |
490 | ret = pcie_clk_init(port); | 494 | ret = pcie_clk_init(port); |
491 | if (unlikely(ret < 0)) | 495 | if (unlikely(ret < 0)) { |
492 | return ret; | 496 | pr_err("clock initialization failed for port#%d\n", |
497 | port->index); | ||
498 | return; | ||
499 | } | ||
493 | 500 | ||
494 | ret = phy_init(port); | 501 | ret = phy_init(port); |
495 | if (unlikely(ret < 0)) | 502 | if (unlikely(ret < 0)) { |
496 | return ret; | 503 | pr_err("phy initialization failed for port#%d\n", |
504 | port->index); | ||
505 | return; | ||
506 | } | ||
497 | 507 | ||
498 | ret = pcie_init(port); | 508 | ret = pcie_init(port); |
499 | if (unlikely(ret < 0)) | 509 | if (unlikely(ret < 0)) { |
500 | return ret; | 510 | pr_err("core initialization failed for port#%d\n", |
511 | port->index); | ||
512 | return; | ||
513 | } | ||
501 | 514 | ||
502 | return register_pci_controller(port->hose); | 515 | /* In the interest of preserving device ordering, synchronize */ |
516 | async_synchronize_cookie(cookie); | ||
517 | |||
518 | register_pci_controller(port->hose); | ||
503 | } | 519 | } |
504 | 520 | ||
505 | static struct sh7786_pcie_hwops sh7786_65nm_pcie_hwops __initdata = { | 521 | static struct sh7786_pcie_hwops sh7786_65nm_pcie_hwops __initdata = { |
@@ -510,7 +526,7 @@ static struct sh7786_pcie_hwops sh7786_65nm_pcie_hwops __initdata = { | |||
510 | static int __init sh7786_pcie_init(void) | 526 | static int __init sh7786_pcie_init(void) |
511 | { | 527 | { |
512 | struct clk *platclk; | 528 | struct clk *platclk; |
513 | int ret = 0, i; | 529 | int i; |
514 | 530 | ||
515 | printk(KERN_NOTICE "PCI: Starting initialization.\n"); | 531 | printk(KERN_NOTICE "PCI: Starting initialization.\n"); |
516 | 532 | ||
@@ -552,14 +568,10 @@ static int __init sh7786_pcie_init(void) | |||
552 | port->hose = sh7786_pci_channels + i; | 568 | port->hose = sh7786_pci_channels + i; |
553 | port->hose->io_map_base = port->hose->resources[0].start; | 569 | port->hose->io_map_base = port->hose->resources[0].start; |
554 | 570 | ||
555 | ret |= sh7786_pcie_hwops->port_init_hw(port); | 571 | async_schedule(sh7786_pcie_hwops->port_init_hw, port); |
556 | } | 572 | } |
557 | 573 | ||
558 | if (unlikely(ret)) { | 574 | async_synchronize_full(); |
559 | clk_disable(platclk); | ||
560 | clk_put(platclk); | ||
561 | return ret; | ||
562 | } | ||
563 | 575 | ||
564 | return 0; | 576 | return 0; |
565 | } | 577 | } |
diff --git a/arch/sh/include/asm/bitops.h b/arch/sh/include/asm/bitops.h index 98511e4d28cb..90fa3e48b4d6 100644 --- a/arch/sh/include/asm/bitops.h +++ b/arch/sh/include/asm/bitops.h | |||
@@ -94,9 +94,8 @@ static inline unsigned long ffz(unsigned long word) | |||
94 | #include <asm-generic/bitops/hweight.h> | 94 | #include <asm-generic/bitops/hweight.h> |
95 | #include <asm-generic/bitops/lock.h> | 95 | #include <asm-generic/bitops/lock.h> |
96 | #include <asm-generic/bitops/sched.h> | 96 | #include <asm-generic/bitops/sched.h> |
97 | #include <asm-generic/bitops/ext2-non-atomic.h> | 97 | #include <asm-generic/bitops/le.h> |
98 | #include <asm-generic/bitops/ext2-atomic.h> | 98 | #include <asm-generic/bitops/ext2-atomic.h> |
99 | #include <asm-generic/bitops/minix.h> | ||
100 | #include <asm-generic/bitops/fls.h> | 99 | #include <asm-generic/bitops/fls.h> |
101 | #include <asm-generic/bitops/__fls.h> | 100 | #include <asm-generic/bitops/__fls.h> |
102 | #include <asm-generic/bitops/fls64.h> | 101 | #include <asm-generic/bitops/fls64.h> |
diff --git a/arch/sh/include/asm/futex-irq.h b/arch/sh/include/asm/futex-irq.h index a9f16a7f9aea..6cb9f193a95e 100644 --- a/arch/sh/include/asm/futex-irq.h +++ b/arch/sh/include/asm/futex-irq.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <asm/system.h> | 4 | #include <asm/system.h> |
5 | 5 | ||
6 | static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, | 6 | static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr, |
7 | int *oldval) | 7 | int *oldval) |
8 | { | 8 | { |
9 | unsigned long flags; | 9 | unsigned long flags; |
@@ -20,7 +20,7 @@ static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, | |||
20 | return ret; | 20 | return ret; |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, | 23 | static inline int atomic_futex_op_xchg_add(int oparg, u32 __user *uaddr, |
24 | int *oldval) | 24 | int *oldval) |
25 | { | 25 | { |
26 | unsigned long flags; | 26 | unsigned long flags; |
@@ -37,7 +37,7 @@ static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, | |||
37 | return ret; | 37 | return ret; |
38 | } | 38 | } |
39 | 39 | ||
40 | static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, | 40 | static inline int atomic_futex_op_xchg_or(int oparg, u32 __user *uaddr, |
41 | int *oldval) | 41 | int *oldval) |
42 | { | 42 | { |
43 | unsigned long flags; | 43 | unsigned long flags; |
@@ -54,7 +54,7 @@ static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, | |||
54 | return ret; | 54 | return ret; |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, | 57 | static inline int atomic_futex_op_xchg_and(int oparg, u32 __user *uaddr, |
58 | int *oldval) | 58 | int *oldval) |
59 | { | 59 | { |
60 | unsigned long flags; | 60 | unsigned long flags; |
@@ -71,7 +71,7 @@ static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, | |||
71 | return ret; | 71 | return ret; |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, | 74 | static inline int atomic_futex_op_xchg_xor(int oparg, u32 __user *uaddr, |
75 | int *oldval) | 75 | int *oldval) |
76 | { | 76 | { |
77 | unsigned long flags; | 77 | unsigned long flags; |
@@ -88,11 +88,13 @@ static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, | |||
88 | return ret; | 88 | return ret; |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline int atomic_futex_op_cmpxchg_inatomic(int __user *uaddr, | 91 | static inline int atomic_futex_op_cmpxchg_inatomic(u32 *uval, |
92 | int oldval, int newval) | 92 | u32 __user *uaddr, |
93 | u32 oldval, u32 newval) | ||
93 | { | 94 | { |
94 | unsigned long flags; | 95 | unsigned long flags; |
95 | int ret, prev = 0; | 96 | int ret; |
97 | u32 prev = 0; | ||
96 | 98 | ||
97 | local_irq_save(flags); | 99 | local_irq_save(flags); |
98 | 100 | ||
@@ -102,10 +104,8 @@ static inline int atomic_futex_op_cmpxchg_inatomic(int __user *uaddr, | |||
102 | 104 | ||
103 | local_irq_restore(flags); | 105 | local_irq_restore(flags); |
104 | 106 | ||
105 | if (ret) | 107 | *uval = prev; |
106 | return ret; | 108 | return ret; |
107 | |||
108 | return prev; | ||
109 | } | 109 | } |
110 | 110 | ||
111 | #endif /* __ASM_SH_FUTEX_IRQ_H */ | 111 | #endif /* __ASM_SH_FUTEX_IRQ_H */ |
diff --git a/arch/sh/include/asm/futex.h b/arch/sh/include/asm/futex.h index 68256ec5fa35..7be39a646fbd 100644 --- a/arch/sh/include/asm/futex.h +++ b/arch/sh/include/asm/futex.h | |||
@@ -10,7 +10,7 @@ | |||
10 | /* XXX: UP variants, fix for SH-4A and SMP.. */ | 10 | /* XXX: UP variants, fix for SH-4A and SMP.. */ |
11 | #include <asm/futex-irq.h> | 11 | #include <asm/futex-irq.h> |
12 | 12 | ||
13 | static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | 13 | static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) |
14 | { | 14 | { |
15 | int op = (encoded_op >> 28) & 7; | 15 | int op = (encoded_op >> 28) & 7; |
16 | int cmp = (encoded_op >> 24) & 15; | 16 | int cmp = (encoded_op >> 24) & 15; |
@@ -21,7 +21,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
21 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 21 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
22 | oparg = 1 << oparg; | 22 | oparg = 1 << oparg; |
23 | 23 | ||
24 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 24 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
25 | return -EFAULT; | 25 | return -EFAULT; |
26 | 26 | ||
27 | pagefault_disable(); | 27 | pagefault_disable(); |
@@ -65,12 +65,13 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | static inline int | 67 | static inline int |
68 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 68 | futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
69 | u32 oldval, u32 newval) | ||
69 | { | 70 | { |
70 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 71 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
71 | return -EFAULT; | 72 | return -EFAULT; |
72 | 73 | ||
73 | return atomic_futex_op_cmpxchg_inatomic(uaddr, oldval, newval); | 74 | return atomic_futex_op_cmpxchg_inatomic(uval, uaddr, oldval, newval); |
74 | } | 75 | } |
75 | 76 | ||
76 | #endif /* __KERNEL__ */ | 77 | #endif /* __KERNEL__ */ |
diff --git a/arch/sh/include/asm/ioctls.h b/arch/sh/include/asm/ioctls.h index 84e85a792638..a6769f352bf6 100644 --- a/arch/sh/include/asm/ioctls.h +++ b/arch/sh/include/asm/ioctls.h | |||
@@ -87,6 +87,7 @@ | |||
87 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 87 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
88 | #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ | 88 | #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ |
89 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ | 89 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ |
90 | #define TIOCVHANGUP _IO('T', 0x37) | ||
90 | 91 | ||
91 | #define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ | 92 | #define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ |
92 | #define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */ | 93 | #define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */ |
diff --git a/arch/sh/include/asm/rwsem.h b/arch/sh/include/asm/rwsem.h index 06e2251a5e48..edab57265293 100644 --- a/arch/sh/include/asm/rwsem.h +++ b/arch/sh/include/asm/rwsem.h | |||
@@ -11,64 +11,13 @@ | |||
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | #include <linux/list.h> | ||
15 | #include <linux/spinlock.h> | ||
16 | #include <asm/atomic.h> | ||
17 | #include <asm/system.h> | ||
18 | 14 | ||
19 | /* | ||
20 | * the semaphore definition | ||
21 | */ | ||
22 | struct rw_semaphore { | ||
23 | long count; | ||
24 | #define RWSEM_UNLOCKED_VALUE 0x00000000 | 15 | #define RWSEM_UNLOCKED_VALUE 0x00000000 |
25 | #define RWSEM_ACTIVE_BIAS 0x00000001 | 16 | #define RWSEM_ACTIVE_BIAS 0x00000001 |
26 | #define RWSEM_ACTIVE_MASK 0x0000ffff | 17 | #define RWSEM_ACTIVE_MASK 0x0000ffff |
27 | #define RWSEM_WAITING_BIAS (-0x00010000) | 18 | #define RWSEM_WAITING_BIAS (-0x00010000) |
28 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS | 19 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS |
29 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 20 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
30 | spinlock_t wait_lock; | ||
31 | struct list_head wait_list; | ||
32 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
33 | struct lockdep_map dep_map; | ||
34 | #endif | ||
35 | }; | ||
36 | |||
37 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
38 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } | ||
39 | #else | ||
40 | # define __RWSEM_DEP_MAP_INIT(lockname) | ||
41 | #endif | ||
42 | |||
43 | #define __RWSEM_INITIALIZER(name) \ | ||
44 | { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \ | ||
45 | LIST_HEAD_INIT((name).wait_list) \ | ||
46 | __RWSEM_DEP_MAP_INIT(name) } | ||
47 | |||
48 | #define DECLARE_RWSEM(name) \ | ||
49 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | ||
50 | |||
51 | extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); | ||
52 | extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); | ||
53 | extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); | ||
54 | extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); | ||
55 | |||
56 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, | ||
57 | struct lock_class_key *key); | ||
58 | |||
59 | #define init_rwsem(sem) \ | ||
60 | do { \ | ||
61 | static struct lock_class_key __key; \ | ||
62 | \ | ||
63 | __init_rwsem((sem), #sem, &__key); \ | ||
64 | } while (0) | ||
65 | |||
66 | static inline void init_rwsem(struct rw_semaphore *sem) | ||
67 | { | ||
68 | sem->count = RWSEM_UNLOCKED_VALUE; | ||
69 | spin_lock_init(&sem->wait_lock); | ||
70 | INIT_LIST_HEAD(&sem->wait_list); | ||
71 | } | ||
72 | 21 | ||
73 | /* | 22 | /* |
74 | * lock for reading | 23 | * lock for reading |
@@ -179,10 +128,5 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
179 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 128 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
180 | } | 129 | } |
181 | 130 | ||
182 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
183 | { | ||
184 | return (sem->count != 0); | ||
185 | } | ||
186 | |||
187 | #endif /* __KERNEL__ */ | 131 | #endif /* __KERNEL__ */ |
188 | #endif /* _ASM_SH_RWSEM_H */ | 132 | #endif /* _ASM_SH_RWSEM_H */ |
diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h index f739061e2ee4..0f325da0f923 100644 --- a/arch/sh/include/asm/sh_eth.h +++ b/arch/sh/include/asm/sh_eth.h | |||
@@ -1,11 +1,21 @@ | |||
1 | #ifndef __ASM_SH_ETH_H__ | 1 | #ifndef __ASM_SH_ETH_H__ |
2 | #define __ASM_SH_ETH_H__ | 2 | #define __ASM_SH_ETH_H__ |
3 | 3 | ||
4 | #include <linux/phy.h> | ||
5 | |||
4 | enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; | 6 | enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; |
7 | enum { | ||
8 | SH_ETH_REG_GIGABIT, | ||
9 | SH_ETH_REG_FAST_SH4, | ||
10 | SH_ETH_REG_FAST_SH3_SH2 | ||
11 | }; | ||
5 | 12 | ||
6 | struct sh_eth_plat_data { | 13 | struct sh_eth_plat_data { |
7 | int phy; | 14 | int phy; |
8 | int edmac_endian; | 15 | int edmac_endian; |
16 | int register_type; | ||
17 | phy_interface_t phy_interface; | ||
18 | void (*set_mdio_gate)(unsigned long addr); | ||
9 | 19 | ||
10 | unsigned char mac_addr[6]; | 20 | unsigned char mac_addr[6]; |
11 | unsigned no_ether_link:1; | 21 | unsigned no_ether_link:1; |
diff --git a/arch/sh/include/asm/sizes.h b/arch/sh/include/asm/sizes.h index 0b9fe2d5c36d..dd248c2e1085 100644 --- a/arch/sh/include/asm/sizes.h +++ b/arch/sh/include/asm/sizes.h | |||
@@ -1,62 +1 @@ | |||
1 | /* | #include <asm-generic/sizes.h> | |
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License as published by | ||
4 | * the Free Software Foundation; either version 2 of the License, or | ||
5 | * (at your option) any later version. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
15 | */ | ||
16 | /* DO NOT EDIT!! - this file automatically generated | ||
17 | * from .s file by awk -f s2h.awk | ||
18 | */ | ||
19 | /* Size definitions | ||
20 | * Copyright (C) ARM Limited 1998. All rights reserved. | ||
21 | */ | ||
22 | |||
23 | #ifndef __sizes_h | ||
24 | #define __sizes_h 1 | ||
25 | |||
26 | /* handy sizes */ | ||
27 | #define SZ_16 0x00000010 | ||
28 | #define SZ_32 0x00000020 | ||
29 | #define SZ_64 0x00000040 | ||
30 | #define SZ_128 0x00000080 | ||
31 | #define SZ_256 0x00000100 | ||
32 | #define SZ_512 0x00000200 | ||
33 | |||
34 | #define SZ_1K 0x00000400 | ||
35 | #define SZ_2K 0x00000800 | ||
36 | #define SZ_4K 0x00001000 | ||
37 | #define SZ_8K 0x00002000 | ||
38 | #define SZ_16K 0x00004000 | ||
39 | #define SZ_32K 0x00008000 | ||
40 | #define SZ_64K 0x00010000 | ||
41 | #define SZ_128K 0x00020000 | ||
42 | #define SZ_256K 0x00040000 | ||
43 | #define SZ_512K 0x00080000 | ||
44 | |||
45 | #define SZ_1M 0x00100000 | ||
46 | #define SZ_2M 0x00200000 | ||
47 | #define SZ_4M 0x00400000 | ||
48 | #define SZ_8M 0x00800000 | ||
49 | #define SZ_16M 0x01000000 | ||
50 | #define SZ_26M 0x01a00000 | ||
51 | #define SZ_32M 0x02000000 | ||
52 | #define SZ_64M 0x04000000 | ||
53 | #define SZ_128M 0x08000000 | ||
54 | #define SZ_256M 0x10000000 | ||
55 | #define SZ_512M 0x20000000 | ||
56 | |||
57 | #define SZ_1G 0x40000000 | ||
58 | #define SZ_2G 0x80000000 | ||
59 | |||
60 | #endif | ||
61 | |||
62 | /* END */ | ||
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h index c228946926ed..ea2d5089de1e 100644 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h | |||
@@ -95,7 +95,7 @@ static inline struct thread_info *current_thread_info(void) | |||
95 | 95 | ||
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | extern struct thread_info *alloc_thread_info(struct task_struct *tsk); | 98 | extern struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node); |
99 | extern void free_thread_info(struct thread_info *ti); | 99 | extern void free_thread_info(struct thread_info *ti); |
100 | extern void arch_task_cache_init(void); | 100 | extern void arch_task_cache_init(void); |
101 | #define arch_task_cache_init arch_task_cache_init | 101 | #define arch_task_cache_init arch_task_cache_init |
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h index d6741fca89a4..ca7765e5f967 100644 --- a/arch/sh/include/asm/unistd_32.h +++ b/arch/sh/include/asm/unistd_32.h | |||
@@ -369,8 +369,12 @@ | |||
369 | #define __NR_recvmsg 356 | 369 | #define __NR_recvmsg 356 |
370 | #define __NR_recvmmsg 357 | 370 | #define __NR_recvmmsg 357 |
371 | #define __NR_accept4 358 | 371 | #define __NR_accept4 358 |
372 | #define __NR_name_to_handle_at 359 | ||
373 | #define __NR_open_by_handle_at 360 | ||
374 | #define __NR_clock_adjtime 361 | ||
375 | #define __NR_syncfs 362 | ||
372 | 376 | ||
373 | #define NR_syscalls 359 | 377 | #define NR_syscalls 363 |
374 | 378 | ||
375 | #ifdef __KERNEL__ | 379 | #ifdef __KERNEL__ |
376 | 380 | ||
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h index 09aa93f9eb70..a694009bb816 100644 --- a/arch/sh/include/asm/unistd_64.h +++ b/arch/sh/include/asm/unistd_64.h | |||
@@ -390,10 +390,14 @@ | |||
390 | #define __NR_fanotify_init 367 | 390 | #define __NR_fanotify_init 367 |
391 | #define __NR_fanotify_mark 368 | 391 | #define __NR_fanotify_mark 368 |
392 | #define __NR_prlimit64 369 | 392 | #define __NR_prlimit64 369 |
393 | #define __NR_name_to_handle_at 370 | ||
394 | #define __NR_open_by_handle_at 371 | ||
395 | #define __NR_clock_adjtime 372 | ||
396 | #define __NR_syncfs 373 | ||
393 | 397 | ||
394 | #ifdef __KERNEL__ | 398 | #ifdef __KERNEL__ |
395 | 399 | ||
396 | #define NR_syscalls 370 | 400 | #define NR_syscalls 374 |
397 | 401 | ||
398 | #define __ARCH_WANT_IPC_PARSE_VERSION | 402 | #define __ARCH_WANT_IPC_PARSE_VERSION |
399 | #define __ARCH_WANT_OLD_READDIR | 403 | #define __ARCH_WANT_OLD_READDIR |
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-register.h b/arch/sh/include/cpu-sh4/cpu/dma-register.h index 9a6125eb0079..18fa80aba15e 100644 --- a/arch/sh/include/cpu-sh4/cpu/dma-register.h +++ b/arch/sh/include/cpu-sh4/cpu/dma-register.h | |||
@@ -40,6 +40,11 @@ | |||
40 | #define CHCR_TS_LOW_SHIFT 3 | 40 | #define CHCR_TS_LOW_SHIFT 3 |
41 | #define CHCR_TS_HIGH_MASK 0 | 41 | #define CHCR_TS_HIGH_MASK 0 |
42 | #define CHCR_TS_HIGH_SHIFT 0 | 42 | #define CHCR_TS_HIGH_SHIFT 0 |
43 | #elif defined(CONFIG_CPU_SUBTYPE_SH7757) | ||
44 | #define CHCR_TS_LOW_MASK 0x00000018 | ||
45 | #define CHCR_TS_LOW_SHIFT 3 | ||
46 | #define CHCR_TS_HIGH_MASK 0x00100000 | ||
47 | #define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ | ||
43 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | 48 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) |
44 | #define CHCR_TS_LOW_MASK 0x00000018 | 49 | #define CHCR_TS_LOW_MASK 0x00000018 |
45 | #define CHCR_TS_LOW_SHIFT 3 | 50 | #define CHCR_TS_LOW_SHIFT 3 |
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7757.h b/arch/sh/include/cpu-sh4/cpu/sh7757.h index 15f3de11c55a..05b8196c7753 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7757.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7757.h | |||
@@ -251,4 +251,36 @@ enum { | |||
251 | GPIO_FN_ON_DQ3, GPIO_FN_ON_DQ2, GPIO_FN_ON_DQ1, GPIO_FN_ON_DQ0, | 251 | GPIO_FN_ON_DQ3, GPIO_FN_ON_DQ2, GPIO_FN_ON_DQ1, GPIO_FN_ON_DQ0, |
252 | }; | 252 | }; |
253 | 253 | ||
254 | enum { | ||
255 | SHDMA_SLAVE_SDHI_TX, | ||
256 | SHDMA_SLAVE_SDHI_RX, | ||
257 | SHDMA_SLAVE_MMCIF_TX, | ||
258 | SHDMA_SLAVE_MMCIF_RX, | ||
259 | SHDMA_SLAVE_SCIF2_TX, | ||
260 | SHDMA_SLAVE_SCIF2_RX, | ||
261 | SHDMA_SLAVE_SCIF3_TX, | ||
262 | SHDMA_SLAVE_SCIF3_RX, | ||
263 | SHDMA_SLAVE_SCIF4_TX, | ||
264 | SHDMA_SLAVE_SCIF4_RX, | ||
265 | SHDMA_SLAVE_RIIC0_TX, | ||
266 | SHDMA_SLAVE_RIIC0_RX, | ||
267 | SHDMA_SLAVE_RIIC1_TX, | ||
268 | SHDMA_SLAVE_RIIC1_RX, | ||
269 | SHDMA_SLAVE_RIIC2_TX, | ||
270 | SHDMA_SLAVE_RIIC2_RX, | ||
271 | SHDMA_SLAVE_RIIC3_TX, | ||
272 | SHDMA_SLAVE_RIIC3_RX, | ||
273 | SHDMA_SLAVE_RIIC4_TX, | ||
274 | SHDMA_SLAVE_RIIC4_RX, | ||
275 | SHDMA_SLAVE_RIIC5_TX, | ||
276 | SHDMA_SLAVE_RIIC5_RX, | ||
277 | SHDMA_SLAVE_RIIC6_TX, | ||
278 | SHDMA_SLAVE_RIIC6_RX, | ||
279 | SHDMA_SLAVE_RIIC7_TX, | ||
280 | SHDMA_SLAVE_RIIC7_RX, | ||
281 | SHDMA_SLAVE_RIIC8_TX, | ||
282 | SHDMA_SLAVE_RIIC8_RX, | ||
283 | SHDMA_SLAVE_RIIC9_TX, | ||
284 | SHDMA_SLAVE_RIIC9_RX, | ||
285 | }; | ||
254 | #endif /* __ASM_SH7757_H__ */ | 286 | #endif /* __ASM_SH7757_H__ */ |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c index e073e3eb4c3d..eedddad13835 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c | |||
@@ -77,9 +77,10 @@ struct clk div4_clks[DIV4_NR] = { | |||
77 | 77 | ||
78 | #define MSTPCR0 0xffc80030 | 78 | #define MSTPCR0 0xffc80030 |
79 | #define MSTPCR1 0xffc80034 | 79 | #define MSTPCR1 0xffc80034 |
80 | #define MSTPCR2 0xffc10028 | ||
80 | 81 | ||
81 | enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112, | 82 | enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112, |
82 | MSTP111, MSTP110, MSTP103, MSTP102, | 83 | MSTP111, MSTP110, MSTP103, MSTP102, MSTP220, |
83 | MSTP_NR }; | 84 | MSTP_NR }; |
84 | 85 | ||
85 | static struct clk mstp_clks[MSTP_NR] = { | 86 | static struct clk mstp_clks[MSTP_NR] = { |
@@ -95,6 +96,9 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
95 | [MSTP110] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 10, 0), | 96 | [MSTP110] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 10, 0), |
96 | [MSTP103] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 3, 0), | 97 | [MSTP103] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 3, 0), |
97 | [MSTP102] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 2, 0), | 98 | [MSTP102] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 2, 0), |
99 | |||
100 | /* MSTPCR2 */ | ||
101 | [MSTP220] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR2, 20, 0), | ||
98 | }; | 102 | }; |
99 | 103 | ||
100 | #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } | 104 | #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } |
@@ -140,6 +144,7 @@ static struct clk_lookup lookups[] = { | |||
140 | .clk = &mstp_clks[MSTP110], | 144 | .clk = &mstp_clks[MSTP110], |
141 | }, | 145 | }, |
142 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]), | 146 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]), |
147 | CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]), | ||
143 | }; | 148 | }; |
144 | 149 | ||
145 | int __init arch_clk_init(void) | 150 | int __init arch_clk_init(void) |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index 9c1de2633ac3..423dabf542d3 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SH7757 Setup | 2 | * SH7757 Setup |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Renesas Solutions Corp. | 4 | * Copyright (C) 2009, 2011 Renesas Solutions Corp. |
5 | * | 5 | * |
6 | * based on setup-sh7785.c : Copyright (C) 2007 Paul Mundt | 6 | * based on setup-sh7785.c : Copyright (C) 2007 Paul Mundt |
7 | * | 7 | * |
@@ -16,6 +16,10 @@ | |||
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/sh_timer.h> | 18 | #include <linux/sh_timer.h> |
19 | #include <linux/sh_dma.h> | ||
20 | |||
21 | #include <cpu/dma-register.h> | ||
22 | #include <cpu/sh7757.h> | ||
19 | 23 | ||
20 | static struct plat_sci_port scif2_platform_data = { | 24 | static struct plat_sci_port scif2_platform_data = { |
21 | .mapbase = 0xfe4b0000, /* SCIF2 */ | 25 | .mapbase = 0xfe4b0000, /* SCIF2 */ |
@@ -124,12 +128,548 @@ static struct platform_device tmu1_device = { | |||
124 | .num_resources = ARRAY_SIZE(tmu1_resources), | 128 | .num_resources = ARRAY_SIZE(tmu1_resources), |
125 | }; | 129 | }; |
126 | 130 | ||
131 | static struct resource spi0_resources[] = { | ||
132 | [0] = { | ||
133 | .start = 0xfe002000, | ||
134 | .end = 0xfe0020ff, | ||
135 | .flags = IORESOURCE_MEM, | ||
136 | }, | ||
137 | [1] = { | ||
138 | .start = 86, | ||
139 | .flags = IORESOURCE_IRQ, | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | /* DMA */ | ||
144 | static const struct sh_dmae_slave_config sh7757_dmae0_slaves[] = { | ||
145 | { | ||
146 | .slave_id = SHDMA_SLAVE_SDHI_TX, | ||
147 | .addr = 0x1fe50030, | ||
148 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
149 | TS_INDEX2VAL(XMIT_SZ_16BIT), | ||
150 | .mid_rid = 0xc5, | ||
151 | }, | ||
152 | { | ||
153 | .slave_id = SHDMA_SLAVE_SDHI_RX, | ||
154 | .addr = 0x1fe50030, | ||
155 | .chcr = DM_INC | 0x800 | 0x40000000 | | ||
156 | TS_INDEX2VAL(XMIT_SZ_16BIT), | ||
157 | .mid_rid = 0xc6, | ||
158 | }, | ||
159 | { | ||
160 | .slave_id = SHDMA_SLAVE_MMCIF_TX, | ||
161 | .addr = 0x1fcb0034, | ||
162 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
163 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
164 | .mid_rid = 0xd3, | ||
165 | }, | ||
166 | { | ||
167 | .slave_id = SHDMA_SLAVE_MMCIF_RX, | ||
168 | .addr = 0x1fcb0034, | ||
169 | .chcr = DM_INC | 0x800 | 0x40000000 | | ||
170 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
171 | .mid_rid = 0xd7, | ||
172 | }, | ||
173 | }; | ||
174 | |||
175 | static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = { | ||
176 | { | ||
177 | .slave_id = SHDMA_SLAVE_SCIF2_TX, | ||
178 | .addr = 0x1f4b000c, | ||
179 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
180 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
181 | .mid_rid = 0x21, | ||
182 | }, | ||
183 | { | ||
184 | .slave_id = SHDMA_SLAVE_SCIF2_RX, | ||
185 | .addr = 0x1f4b0014, | ||
186 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
187 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
188 | .mid_rid = 0x22, | ||
189 | }, | ||
190 | { | ||
191 | .slave_id = SHDMA_SLAVE_SCIF3_TX, | ||
192 | .addr = 0x1f4c000c, | ||
193 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
194 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
195 | .mid_rid = 0x29, | ||
196 | }, | ||
197 | { | ||
198 | .slave_id = SHDMA_SLAVE_SCIF3_RX, | ||
199 | .addr = 0x1f4c0014, | ||
200 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
201 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
202 | .mid_rid = 0x2a, | ||
203 | }, | ||
204 | { | ||
205 | .slave_id = SHDMA_SLAVE_SCIF4_TX, | ||
206 | .addr = 0x1f4d000c, | ||
207 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
208 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
209 | .mid_rid = 0x41, | ||
210 | }, | ||
211 | { | ||
212 | .slave_id = SHDMA_SLAVE_SCIF4_RX, | ||
213 | .addr = 0x1f4d0014, | ||
214 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
215 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
216 | .mid_rid = 0x42, | ||
217 | }, | ||
218 | }; | ||
219 | |||
220 | static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = { | ||
221 | { | ||
222 | .slave_id = SHDMA_SLAVE_RIIC0_TX, | ||
223 | .addr = 0x1e500012, | ||
224 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
225 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
226 | .mid_rid = 0x21, | ||
227 | }, | ||
228 | { | ||
229 | .slave_id = SHDMA_SLAVE_RIIC0_RX, | ||
230 | .addr = 0x1e500013, | ||
231 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
232 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
233 | .mid_rid = 0x22, | ||
234 | }, | ||
235 | { | ||
236 | .slave_id = SHDMA_SLAVE_RIIC1_TX, | ||
237 | .addr = 0x1e510012, | ||
238 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
239 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
240 | .mid_rid = 0x29, | ||
241 | }, | ||
242 | { | ||
243 | .slave_id = SHDMA_SLAVE_RIIC1_RX, | ||
244 | .addr = 0x1e510013, | ||
245 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
246 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
247 | .mid_rid = 0x2a, | ||
248 | }, | ||
249 | { | ||
250 | .slave_id = SHDMA_SLAVE_RIIC2_TX, | ||
251 | .addr = 0x1e520012, | ||
252 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
253 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
254 | .mid_rid = 0xa1, | ||
255 | }, | ||
256 | { | ||
257 | .slave_id = SHDMA_SLAVE_RIIC2_RX, | ||
258 | .addr = 0x1e520013, | ||
259 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
260 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
261 | .mid_rid = 0xa2, | ||
262 | }, | ||
263 | { | ||
264 | .slave_id = SHDMA_SLAVE_RIIC3_TX, | ||
265 | .addr = 0x1e530012, | ||
266 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
267 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
268 | .mid_rid = 0xab, | ||
269 | }, | ||
270 | { | ||
271 | .slave_id = SHDMA_SLAVE_RIIC3_RX, | ||
272 | .addr = 0x1e530013, | ||
273 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
274 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
275 | .mid_rid = 0xaf, | ||
276 | }, | ||
277 | { | ||
278 | .slave_id = SHDMA_SLAVE_RIIC4_TX, | ||
279 | .addr = 0x1e540012, | ||
280 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
281 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
282 | .mid_rid = 0xc1, | ||
283 | }, | ||
284 | { | ||
285 | .slave_id = SHDMA_SLAVE_RIIC4_RX, | ||
286 | .addr = 0x1e540013, | ||
287 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
288 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
289 | .mid_rid = 0xc2, | ||
290 | }, | ||
291 | }; | ||
292 | |||
293 | static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = { | ||
294 | { | ||
295 | .slave_id = SHDMA_SLAVE_RIIC5_TX, | ||
296 | .addr = 0x1e550012, | ||
297 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
298 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
299 | .mid_rid = 0x21, | ||
300 | }, | ||
301 | { | ||
302 | .slave_id = SHDMA_SLAVE_RIIC5_RX, | ||
303 | .addr = 0x1e550013, | ||
304 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
305 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
306 | .mid_rid = 0x22, | ||
307 | }, | ||
308 | { | ||
309 | .slave_id = SHDMA_SLAVE_RIIC6_TX, | ||
310 | .addr = 0x1e560012, | ||
311 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
312 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
313 | .mid_rid = 0x29, | ||
314 | }, | ||
315 | { | ||
316 | .slave_id = SHDMA_SLAVE_RIIC6_RX, | ||
317 | .addr = 0x1e560013, | ||
318 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
319 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
320 | .mid_rid = 0x2a, | ||
321 | }, | ||
322 | { | ||
323 | .slave_id = SHDMA_SLAVE_RIIC7_TX, | ||
324 | .addr = 0x1e570012, | ||
325 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
326 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
327 | .mid_rid = 0x41, | ||
328 | }, | ||
329 | { | ||
330 | .slave_id = SHDMA_SLAVE_RIIC7_RX, | ||
331 | .addr = 0x1e570013, | ||
332 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
333 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
334 | .mid_rid = 0x42, | ||
335 | }, | ||
336 | { | ||
337 | .slave_id = SHDMA_SLAVE_RIIC8_TX, | ||
338 | .addr = 0x1e580012, | ||
339 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
340 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
341 | .mid_rid = 0x45, | ||
342 | }, | ||
343 | { | ||
344 | .slave_id = SHDMA_SLAVE_RIIC8_RX, | ||
345 | .addr = 0x1e580013, | ||
346 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
347 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
348 | .mid_rid = 0x46, | ||
349 | }, | ||
350 | { | ||
351 | .slave_id = SHDMA_SLAVE_RIIC9_TX, | ||
352 | .addr = 0x1e590012, | ||
353 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
354 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
355 | .mid_rid = 0x51, | ||
356 | }, | ||
357 | { | ||
358 | .slave_id = SHDMA_SLAVE_RIIC9_RX, | ||
359 | .addr = 0x1e590013, | ||
360 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
361 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
362 | .mid_rid = 0x52, | ||
363 | }, | ||
364 | }; | ||
365 | |||
366 | static const struct sh_dmae_channel sh7757_dmae_channels[] = { | ||
367 | { | ||
368 | .offset = 0, | ||
369 | .dmars = 0, | ||
370 | .dmars_bit = 0, | ||
371 | }, { | ||
372 | .offset = 0x10, | ||
373 | .dmars = 0, | ||
374 | .dmars_bit = 8, | ||
375 | }, { | ||
376 | .offset = 0x20, | ||
377 | .dmars = 4, | ||
378 | .dmars_bit = 0, | ||
379 | }, { | ||
380 | .offset = 0x30, | ||
381 | .dmars = 4, | ||
382 | .dmars_bit = 8, | ||
383 | }, { | ||
384 | .offset = 0x50, | ||
385 | .dmars = 8, | ||
386 | .dmars_bit = 0, | ||
387 | }, { | ||
388 | .offset = 0x60, | ||
389 | .dmars = 8, | ||
390 | .dmars_bit = 8, | ||
391 | } | ||
392 | }; | ||
393 | |||
394 | static const unsigned int ts_shift[] = TS_SHIFT; | ||
395 | |||
396 | static struct sh_dmae_pdata dma0_platform_data = { | ||
397 | .slave = sh7757_dmae0_slaves, | ||
398 | .slave_num = ARRAY_SIZE(sh7757_dmae0_slaves), | ||
399 | .channel = sh7757_dmae_channels, | ||
400 | .channel_num = ARRAY_SIZE(sh7757_dmae_channels), | ||
401 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
402 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
403 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
404 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
405 | .ts_shift = ts_shift, | ||
406 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
407 | .dmaor_init = DMAOR_INIT, | ||
408 | }; | ||
409 | |||
410 | static struct sh_dmae_pdata dma1_platform_data = { | ||
411 | .slave = sh7757_dmae1_slaves, | ||
412 | .slave_num = ARRAY_SIZE(sh7757_dmae1_slaves), | ||
413 | .channel = sh7757_dmae_channels, | ||
414 | .channel_num = ARRAY_SIZE(sh7757_dmae_channels), | ||
415 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
416 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
417 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
418 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
419 | .ts_shift = ts_shift, | ||
420 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
421 | .dmaor_init = DMAOR_INIT, | ||
422 | }; | ||
423 | |||
424 | static struct sh_dmae_pdata dma2_platform_data = { | ||
425 | .slave = sh7757_dmae2_slaves, | ||
426 | .slave_num = ARRAY_SIZE(sh7757_dmae2_slaves), | ||
427 | .channel = sh7757_dmae_channels, | ||
428 | .channel_num = ARRAY_SIZE(sh7757_dmae_channels), | ||
429 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
430 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
431 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
432 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
433 | .ts_shift = ts_shift, | ||
434 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
435 | .dmaor_init = DMAOR_INIT, | ||
436 | }; | ||
437 | |||
438 | static struct sh_dmae_pdata dma3_platform_data = { | ||
439 | .slave = sh7757_dmae3_slaves, | ||
440 | .slave_num = ARRAY_SIZE(sh7757_dmae3_slaves), | ||
441 | .channel = sh7757_dmae_channels, | ||
442 | .channel_num = ARRAY_SIZE(sh7757_dmae_channels), | ||
443 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
444 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
445 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
446 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
447 | .ts_shift = ts_shift, | ||
448 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
449 | .dmaor_init = DMAOR_INIT, | ||
450 | }; | ||
451 | |||
452 | /* channel 0 to 5 */ | ||
453 | static struct resource sh7757_dmae0_resources[] = { | ||
454 | [0] = { | ||
455 | /* Channel registers and DMAOR */ | ||
456 | .start = 0xff608020, | ||
457 | .end = 0xff60808f, | ||
458 | .flags = IORESOURCE_MEM, | ||
459 | }, | ||
460 | [1] = { | ||
461 | /* DMARSx */ | ||
462 | .start = 0xff609000, | ||
463 | .end = 0xff60900b, | ||
464 | .flags = IORESOURCE_MEM, | ||
465 | }, | ||
466 | { | ||
467 | .start = 34, | ||
468 | .end = 34, | ||
469 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
470 | }, | ||
471 | }; | ||
472 | |||
473 | /* channel 6 to 11 */ | ||
474 | static struct resource sh7757_dmae1_resources[] = { | ||
475 | [0] = { | ||
476 | /* Channel registers and DMAOR */ | ||
477 | .start = 0xff618020, | ||
478 | .end = 0xff61808f, | ||
479 | .flags = IORESOURCE_MEM, | ||
480 | }, | ||
481 | [1] = { | ||
482 | /* DMARSx */ | ||
483 | .start = 0xff619000, | ||
484 | .end = 0xff61900b, | ||
485 | .flags = IORESOURCE_MEM, | ||
486 | }, | ||
487 | { | ||
488 | /* DMA error */ | ||
489 | .start = 34, | ||
490 | .end = 34, | ||
491 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
492 | }, | ||
493 | { | ||
494 | /* IRQ for channels 4 */ | ||
495 | .start = 46, | ||
496 | .end = 46, | ||
497 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
498 | }, | ||
499 | { | ||
500 | /* IRQ for channels 5 */ | ||
501 | .start = 46, | ||
502 | .end = 46, | ||
503 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
504 | }, | ||
505 | { | ||
506 | /* IRQ for channels 6 */ | ||
507 | .start = 88, | ||
508 | .end = 88, | ||
509 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
510 | }, | ||
511 | { | ||
512 | /* IRQ for channels 7 */ | ||
513 | .start = 88, | ||
514 | .end = 88, | ||
515 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
516 | }, | ||
517 | { | ||
518 | /* IRQ for channels 8 */ | ||
519 | .start = 88, | ||
520 | .end = 88, | ||
521 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
522 | }, | ||
523 | { | ||
524 | /* IRQ for channels 9 */ | ||
525 | .start = 88, | ||
526 | .end = 88, | ||
527 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
528 | }, | ||
529 | { | ||
530 | /* IRQ for channels 10 */ | ||
531 | .start = 88, | ||
532 | .end = 88, | ||
533 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
534 | }, | ||
535 | { | ||
536 | /* IRQ for channels 11 */ | ||
537 | .start = 88, | ||
538 | .end = 88, | ||
539 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
540 | }, | ||
541 | }; | ||
542 | |||
543 | /* channel 12 to 17 */ | ||
544 | static struct resource sh7757_dmae2_resources[] = { | ||
545 | [0] = { | ||
546 | /* Channel registers and DMAOR */ | ||
547 | .start = 0xff708020, | ||
548 | .end = 0xff70808f, | ||
549 | .flags = IORESOURCE_MEM, | ||
550 | }, | ||
551 | [1] = { | ||
552 | /* DMARSx */ | ||
553 | .start = 0xff709000, | ||
554 | .end = 0xff70900b, | ||
555 | .flags = IORESOURCE_MEM, | ||
556 | }, | ||
557 | { | ||
558 | /* DMA error */ | ||
559 | .start = 323, | ||
560 | .end = 323, | ||
561 | .flags = IORESOURCE_IRQ, | ||
562 | }, | ||
563 | { | ||
564 | /* IRQ for channels 12 to 16 */ | ||
565 | .start = 272, | ||
566 | .end = 276, | ||
567 | .flags = IORESOURCE_IRQ, | ||
568 | }, | ||
569 | { | ||
570 | /* IRQ for channel 17 */ | ||
571 | .start = 279, | ||
572 | .end = 279, | ||
573 | .flags = IORESOURCE_IRQ, | ||
574 | }, | ||
575 | }; | ||
576 | |||
577 | /* channel 18 to 23 */ | ||
578 | static struct resource sh7757_dmae3_resources[] = { | ||
579 | [0] = { | ||
580 | /* Channel registers and DMAOR */ | ||
581 | .start = 0xff718020, | ||
582 | .end = 0xff71808f, | ||
583 | .flags = IORESOURCE_MEM, | ||
584 | }, | ||
585 | [1] = { | ||
586 | /* DMARSx */ | ||
587 | .start = 0xff719000, | ||
588 | .end = 0xff71900b, | ||
589 | .flags = IORESOURCE_MEM, | ||
590 | }, | ||
591 | { | ||
592 | /* DMA error */ | ||
593 | .start = 324, | ||
594 | .end = 324, | ||
595 | .flags = IORESOURCE_IRQ, | ||
596 | }, | ||
597 | { | ||
598 | /* IRQ for channels 18 to 22 */ | ||
599 | .start = 280, | ||
600 | .end = 284, | ||
601 | .flags = IORESOURCE_IRQ, | ||
602 | }, | ||
603 | { | ||
604 | /* IRQ for channel 23 */ | ||
605 | .start = 288, | ||
606 | .end = 288, | ||
607 | .flags = IORESOURCE_IRQ, | ||
608 | }, | ||
609 | }; | ||
610 | |||
611 | static struct platform_device dma0_device = { | ||
612 | .name = "sh-dma-engine", | ||
613 | .id = 0, | ||
614 | .resource = sh7757_dmae0_resources, | ||
615 | .num_resources = ARRAY_SIZE(sh7757_dmae0_resources), | ||
616 | .dev = { | ||
617 | .platform_data = &dma0_platform_data, | ||
618 | }, | ||
619 | }; | ||
620 | |||
621 | static struct platform_device dma1_device = { | ||
622 | .name = "sh-dma-engine", | ||
623 | .id = 1, | ||
624 | .resource = sh7757_dmae1_resources, | ||
625 | .num_resources = ARRAY_SIZE(sh7757_dmae1_resources), | ||
626 | .dev = { | ||
627 | .platform_data = &dma1_platform_data, | ||
628 | }, | ||
629 | }; | ||
630 | |||
631 | static struct platform_device dma2_device = { | ||
632 | .name = "sh-dma-engine", | ||
633 | .id = 2, | ||
634 | .resource = sh7757_dmae2_resources, | ||
635 | .num_resources = ARRAY_SIZE(sh7757_dmae2_resources), | ||
636 | .dev = { | ||
637 | .platform_data = &dma2_platform_data, | ||
638 | }, | ||
639 | }; | ||
640 | |||
641 | static struct platform_device dma3_device = { | ||
642 | .name = "sh-dma-engine", | ||
643 | .id = 3, | ||
644 | .resource = sh7757_dmae3_resources, | ||
645 | .num_resources = ARRAY_SIZE(sh7757_dmae3_resources), | ||
646 | .dev = { | ||
647 | .platform_data = &dma3_platform_data, | ||
648 | }, | ||
649 | }; | ||
650 | |||
651 | static struct platform_device spi0_device = { | ||
652 | .name = "sh_spi", | ||
653 | .id = 0, | ||
654 | .dev = { | ||
655 | .dma_mask = NULL, | ||
656 | .coherent_dma_mask = 0xffffffff, | ||
657 | }, | ||
658 | .num_resources = ARRAY_SIZE(spi0_resources), | ||
659 | .resource = spi0_resources, | ||
660 | }; | ||
661 | |||
127 | static struct platform_device *sh7757_devices[] __initdata = { | 662 | static struct platform_device *sh7757_devices[] __initdata = { |
128 | &scif2_device, | 663 | &scif2_device, |
129 | &scif3_device, | 664 | &scif3_device, |
130 | &scif4_device, | 665 | &scif4_device, |
131 | &tmu0_device, | 666 | &tmu0_device, |
132 | &tmu1_device, | 667 | &tmu1_device, |
668 | &dma0_device, | ||
669 | &dma1_device, | ||
670 | &dma2_device, | ||
671 | &dma3_device, | ||
672 | &spi0_device, | ||
133 | }; | 673 | }; |
134 | 674 | ||
135 | static int __init sh7757_devices_setup(void) | 675 | static int __init sh7757_devices_setup(void) |
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c index c19e2a940e3f..e4469e7233cb 100644 --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c | |||
@@ -75,7 +75,7 @@ void sh_mobile_setup_cpuidle(void) | |||
75 | i = CPUIDLE_DRIVER_STATE_START; | 75 | i = CPUIDLE_DRIVER_STATE_START; |
76 | 76 | ||
77 | state = &dev->states[i++]; | 77 | state = &dev->states[i++]; |
78 | snprintf(state->name, CPUIDLE_NAME_LEN, "C0"); | 78 | snprintf(state->name, CPUIDLE_NAME_LEN, "C1"); |
79 | strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN); | 79 | strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN); |
80 | state->exit_latency = 1; | 80 | state->exit_latency = 1; |
81 | state->target_residency = 1 * 2; | 81 | state->target_residency = 1 * 2; |
@@ -88,7 +88,7 @@ void sh_mobile_setup_cpuidle(void) | |||
88 | 88 | ||
89 | if (sh_mobile_sleep_supported & SUSP_SH_SF) { | 89 | if (sh_mobile_sleep_supported & SUSP_SH_SF) { |
90 | state = &dev->states[i++]; | 90 | state = &dev->states[i++]; |
91 | snprintf(state->name, CPUIDLE_NAME_LEN, "C1"); | 91 | snprintf(state->name, CPUIDLE_NAME_LEN, "C2"); |
92 | strncpy(state->desc, "SuperH Sleep Mode [SF]", | 92 | strncpy(state->desc, "SuperH Sleep Mode [SF]", |
93 | CPUIDLE_DESC_LEN); | 93 | CPUIDLE_DESC_LEN); |
94 | state->exit_latency = 100; | 94 | state->exit_latency = 100; |
@@ -101,7 +101,7 @@ void sh_mobile_setup_cpuidle(void) | |||
101 | 101 | ||
102 | if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) { | 102 | if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) { |
103 | state = &dev->states[i++]; | 103 | state = &dev->states[i++]; |
104 | snprintf(state->name, CPUIDLE_NAME_LEN, "C2"); | 104 | snprintf(state->name, CPUIDLE_NAME_LEN, "C3"); |
105 | strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", | 105 | strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", |
106 | CPUIDLE_DESC_LEN); | 106 | CPUIDLE_DESC_LEN); |
107 | state->exit_latency = 2300; | 107 | state->exit_latency = 2300; |
diff --git a/arch/sh/kernel/crash_dump.c b/arch/sh/kernel/crash_dump.c index 37c97d444576..569e7b171c01 100644 --- a/arch/sh/kernel/crash_dump.c +++ b/arch/sh/kernel/crash_dump.c | |||
@@ -9,28 +9,6 @@ | |||
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <asm/uaccess.h> | 10 | #include <asm/uaccess.h> |
11 | 11 | ||
12 | /* Stores the physical address of elf header of crash image. */ | ||
13 | unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; | ||
14 | |||
15 | /* | ||
16 | * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by | ||
17 | * is_kdump_kernel() to determine if we are booting after a panic. Hence | ||
18 | * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. | ||
19 | * | ||
20 | * elfcorehdr= specifies the location of elf core header | ||
21 | * stored by the crashed kernel. | ||
22 | */ | ||
23 | static int __init parse_elfcorehdr(char *arg) | ||
24 | { | ||
25 | if (!arg) | ||
26 | return -EINVAL; | ||
27 | |||
28 | elfcorehdr_addr = memparse(arg, &arg); | ||
29 | |||
30 | return 0; | ||
31 | } | ||
32 | early_param("elfcorehdr", parse_elfcorehdr); | ||
33 | |||
34 | /** | 12 | /** |
35 | * copy_oldmem_page - copy one page from "oldmem" | 13 | * copy_oldmem_page - copy one page from "oldmem" |
36 | * @pfn: page frame number to be copied | 14 | * @pfn: page frame number to be copied |
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 68ecbe6c881a..64ea0b165399 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
@@ -34,9 +34,9 @@ void ack_bad_irq(unsigned int irq) | |||
34 | 34 | ||
35 | #if defined(CONFIG_PROC_FS) | 35 | #if defined(CONFIG_PROC_FS) |
36 | /* | 36 | /* |
37 | * /proc/interrupts printing: | 37 | * /proc/interrupts printing for arch specific interrupts |
38 | */ | 38 | */ |
39 | static int show_other_interrupts(struct seq_file *p, int prec) | 39 | int arch_show_interrupts(struct seq_file *p, int prec) |
40 | { | 40 | { |
41 | int j; | 41 | int j; |
42 | 42 | ||
@@ -49,63 +49,6 @@ static int show_other_interrupts(struct seq_file *p, int prec) | |||
49 | 49 | ||
50 | return 0; | 50 | return 0; |
51 | } | 51 | } |
52 | |||
53 | int show_interrupts(struct seq_file *p, void *v) | ||
54 | { | ||
55 | unsigned long flags, any_count = 0; | ||
56 | int i = *(loff_t *)v, j, prec; | ||
57 | struct irqaction *action; | ||
58 | struct irq_desc *desc; | ||
59 | struct irq_data *data; | ||
60 | struct irq_chip *chip; | ||
61 | |||
62 | if (i > nr_irqs) | ||
63 | return 0; | ||
64 | |||
65 | for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec) | ||
66 | j *= 10; | ||
67 | |||
68 | if (i == nr_irqs) | ||
69 | return show_other_interrupts(p, prec); | ||
70 | |||
71 | if (i == 0) { | ||
72 | seq_printf(p, "%*s", prec + 8, ""); | ||
73 | for_each_online_cpu(j) | ||
74 | seq_printf(p, "CPU%-8d", j); | ||
75 | seq_putc(p, '\n'); | ||
76 | } | ||
77 | |||
78 | desc = irq_to_desc(i); | ||
79 | if (!desc) | ||
80 | return 0; | ||
81 | |||
82 | data = irq_get_irq_data(i); | ||
83 | chip = irq_data_get_irq_chip(data); | ||
84 | |||
85 | raw_spin_lock_irqsave(&desc->lock, flags); | ||
86 | for_each_online_cpu(j) | ||
87 | any_count |= kstat_irqs_cpu(i, j); | ||
88 | action = desc->action; | ||
89 | if (!action && !any_count) | ||
90 | goto out; | ||
91 | |||
92 | seq_printf(p, "%*d: ", prec, i); | ||
93 | for_each_online_cpu(j) | ||
94 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | ||
95 | seq_printf(p, " %14s", chip->name); | ||
96 | seq_printf(p, "-%-8s", desc->name); | ||
97 | |||
98 | if (action) { | ||
99 | seq_printf(p, " %s", action->name); | ||
100 | while ((action = action->next) != NULL) | ||
101 | seq_printf(p, ", %s", action->name); | ||
102 | } | ||
103 | |||
104 | seq_putc(p, '\n'); | ||
105 | out: | ||
106 | raw_spin_unlock_irqrestore(&desc->lock, flags); | ||
107 | return 0; | ||
108 | } | ||
109 | #endif | 52 | #endif |
110 | 53 | ||
111 | #ifdef CONFIG_IRQSTACKS | 54 | #ifdef CONFIG_IRQSTACKS |
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index dcb126dc76fd..325f98b1736d 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
@@ -32,16 +32,16 @@ void free_thread_xstate(struct task_struct *tsk) | |||
32 | #if THREAD_SHIFT < PAGE_SHIFT | 32 | #if THREAD_SHIFT < PAGE_SHIFT |
33 | static struct kmem_cache *thread_info_cache; | 33 | static struct kmem_cache *thread_info_cache; |
34 | 34 | ||
35 | struct thread_info *alloc_thread_info(struct task_struct *tsk) | 35 | struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node) |
36 | { | 36 | { |
37 | struct thread_info *ti; | 37 | struct thread_info *ti; |
38 | |||
39 | ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL); | ||
40 | if (unlikely(ti == NULL)) | ||
41 | return NULL; | ||
42 | #ifdef CONFIG_DEBUG_STACK_USAGE | 38 | #ifdef CONFIG_DEBUG_STACK_USAGE |
43 | memset(ti, 0, THREAD_SIZE); | 39 | gfp_t mask = GFP_KERNEL | __GFP_ZERO; |
40 | #else | ||
41 | gfp_t mask = GFP_KERNEL; | ||
44 | #endif | 42 | #endif |
43 | |||
44 | ti = kmem_cache_alloc_node(thread_info_cache, mask, node); | ||
45 | return ti; | 45 | return ti; |
46 | } | 46 | } |
47 | 47 | ||
@@ -57,14 +57,16 @@ void thread_info_cache_init(void) | |||
57 | THREAD_SIZE, SLAB_PANIC, NULL); | 57 | THREAD_SIZE, SLAB_PANIC, NULL); |
58 | } | 58 | } |
59 | #else | 59 | #else |
60 | struct thread_info *alloc_thread_info(struct task_struct *tsk) | 60 | struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node) |
61 | { | 61 | { |
62 | #ifdef CONFIG_DEBUG_STACK_USAGE | 62 | #ifdef CONFIG_DEBUG_STACK_USAGE |
63 | gfp_t mask = GFP_KERNEL | __GFP_ZERO; | 63 | gfp_t mask = GFP_KERNEL | __GFP_ZERO; |
64 | #else | 64 | #else |
65 | gfp_t mask = GFP_KERNEL; | 65 | gfp_t mask = GFP_KERNEL; |
66 | #endif | 66 | #endif |
67 | return (struct thread_info *)__get_free_pages(mask, THREAD_SIZE_ORDER); | 67 | struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER); |
68 | |||
69 | return page ? page_address(page) : NULL; | ||
68 | } | 70 | } |
69 | 71 | ||
70 | void free_thread_info(struct thread_info *ti) | 72 | void free_thread_info(struct thread_info *ti) |
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index 90a15d29feeb..2130ca674e9b 100644 --- a/arch/sh/kernel/ptrace_32.c +++ b/arch/sh/kernel/ptrace_32.c | |||
@@ -101,6 +101,8 @@ static int set_single_step(struct task_struct *tsk, unsigned long addr) | |||
101 | 101 | ||
102 | attr = bp->attr; | 102 | attr = bp->attr; |
103 | attr.bp_addr = addr; | 103 | attr.bp_addr = addr; |
104 | /* reenable breakpoint */ | ||
105 | attr.disabled = false; | ||
104 | err = modify_user_hw_breakpoint(bp, &attr); | 106 | err = modify_user_hw_breakpoint(bp, &attr); |
105 | if (unlikely(err)) | 107 | if (unlikely(err)) |
106 | return err; | 108 | return err; |
@@ -392,6 +394,9 @@ long arch_ptrace(struct task_struct *child, long request, | |||
392 | tmp = 0; | 394 | tmp = 0; |
393 | } else { | 395 | } else { |
394 | unsigned long index; | 396 | unsigned long index; |
397 | ret = init_fpu(child); | ||
398 | if (ret) | ||
399 | break; | ||
395 | index = addr - offsetof(struct user, fpu); | 400 | index = addr - offsetof(struct user, fpu); |
396 | tmp = ((unsigned long *)child->thread.xstate) | 401 | tmp = ((unsigned long *)child->thread.xstate) |
397 | [index >> 2]; | 402 | [index >> 2]; |
@@ -423,6 +428,9 @@ long arch_ptrace(struct task_struct *child, long request, | |||
423 | else if (addr >= offsetof(struct user, fpu) && | 428 | else if (addr >= offsetof(struct user, fpu) && |
424 | addr < offsetof(struct user, u_fpvalid)) { | 429 | addr < offsetof(struct user, u_fpvalid)) { |
425 | unsigned long index; | 430 | unsigned long index; |
431 | ret = init_fpu(child); | ||
432 | if (ret) | ||
433 | break; | ||
426 | index = addr - offsetof(struct user, fpu); | 434 | index = addr - offsetof(struct user, fpu); |
427 | set_stopped_child_used_math(child); | 435 | set_stopped_child_used_math(child); |
428 | ((unsigned long *)child->thread.xstate) | 436 | ((unsigned long *)child->thread.xstate) |
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index 4436eacddb15..c8f97649f354 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *child, long request, | |||
403 | else if ((addr >= offsetof(struct user, fpu)) && | 403 | else if ((addr >= offsetof(struct user, fpu)) && |
404 | (addr < offsetof(struct user, u_fpvalid))) { | 404 | (addr < offsetof(struct user, u_fpvalid))) { |
405 | unsigned long index; | 405 | unsigned long index; |
406 | ret = init_fpu(child); | ||
407 | if (ret) | ||
408 | break; | ||
406 | index = addr - offsetof(struct user, fpu); | 409 | index = addr - offsetof(struct user, fpu); |
407 | tmp = get_fpu_long(child, index); | 410 | tmp = get_fpu_long(child, index); |
408 | } else if (addr == offsetof(struct user, u_fpvalid)) { | 411 | } else if (addr == offsetof(struct user, u_fpvalid)) { |
@@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *child, long request, | |||
442 | else if ((addr >= offsetof(struct user, fpu)) && | 445 | else if ((addr >= offsetof(struct user, fpu)) && |
443 | (addr < offsetof(struct user, u_fpvalid))) { | 446 | (addr < offsetof(struct user, u_fpvalid))) { |
444 | unsigned long index; | 447 | unsigned long index; |
448 | ret = init_fpu(child); | ||
449 | if (ret) | ||
450 | break; | ||
445 | index = addr - offsetof(struct user, fpu); | 451 | index = addr - offsetof(struct user, fpu); |
446 | ret = put_fpu_long(child, index, data); | 452 | ret = put_fpu_long(child, index, data); |
447 | } | 453 | } |
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 6fc347ebe59d..030966a9305c 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
@@ -376,3 +376,7 @@ ENTRY(sys_call_table) | |||
376 | .long sys_recvmsg | 376 | .long sys_recvmsg |
377 | .long sys_recvmmsg | 377 | .long sys_recvmmsg |
378 | .long sys_accept4 | 378 | .long sys_accept4 |
379 | .long sys_name_to_handle_at | ||
380 | .long sys_open_by_handle_at /* 360 */ | ||
381 | .long sys_clock_adjtime | ||
382 | .long sys_syncfs | ||
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 66585708ce90..ca0a6142ab63 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S | |||
@@ -396,3 +396,7 @@ sys_call_table: | |||
396 | .long sys_fanotify_init | 396 | .long sys_fanotify_init |
397 | .long sys_fanotify_mark | 397 | .long sys_fanotify_mark |
398 | .long sys_prlimit64 | 398 | .long sys_prlimit64 |
399 | .long sys_name_to_handle_at /* 370 */ | ||
400 | .long sys_open_by_handle_at | ||
401 | .long sys_clock_adjtime | ||
402 | .long sys_syncfs | ||
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 7f8a709c3ada..af4d46187a79 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S | |||
@@ -66,7 +66,7 @@ SECTIONS | |||
66 | __machvec_end = .; | 66 | __machvec_end = .; |
67 | } | 67 | } |
68 | 68 | ||
69 | PERCPU(PAGE_SIZE) | 69 | PERCPU(L1_CACHE_BYTES, PAGE_SIZE) |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * .exit.text is discarded at runtime, not link time, to deal with | 72 | * .exit.text is discarded at runtime, not link time, to deal with |
diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c index 242117cbad67..1d6d51a1ce79 100644 --- a/arch/sh/kernel/vsyscall/vsyscall.c +++ b/arch/sh/kernel/vsyscall/vsyscall.c | |||
@@ -94,17 +94,17 @@ const char *arch_vma_name(struct vm_area_struct *vma) | |||
94 | return NULL; | 94 | return NULL; |
95 | } | 95 | } |
96 | 96 | ||
97 | struct vm_area_struct *get_gate_vma(struct task_struct *task) | 97 | struct vm_area_struct *get_gate_vma(struct mm_struct *mm) |
98 | { | 98 | { |
99 | return NULL; | 99 | return NULL; |
100 | } | 100 | } |
101 | 101 | ||
102 | int in_gate_area(struct task_struct *task, unsigned long address) | 102 | int in_gate_area(struct mm_struct *mm, unsigned long address) |
103 | { | 103 | { |
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |
106 | 106 | ||
107 | int in_gate_area_no_task(unsigned long address) | 107 | int in_gate_area_no_mm(unsigned long address) |
108 | { | 108 | { |
109 | return 0; | 109 | return 0; |
110 | } | 110 | } |
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index 150aa326afff..2228c8cee4d6 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile | |||
@@ -42,6 +42,8 @@ obj-$(CONFIG_IOREMAP_FIXED) += ioremap_fixed.o | |||
42 | obj-$(CONFIG_UNCACHED_MAPPING) += uncached.o | 42 | obj-$(CONFIG_UNCACHED_MAPPING) += uncached.o |
43 | obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o | 43 | obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o |
44 | 44 | ||
45 | GCOV_PROFILE_pmb.o := n | ||
46 | |||
45 | # Special flags for fault_64.o. This puts restrictions on the number of | 47 | # Special flags for fault_64.o. This puts restrictions on the number of |
46 | # caller-save registers that the compiler can target when building this file. | 48 | # caller-save registers that the compiler can target when building this file. |
47 | # This is required because the code is called from a context in entry.S where | 49 | # This is required because the code is called from a context in entry.S where |
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index b20b1b3eee4b..fad52f1f6812 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Privileged Space Mapping Buffer (PMB) Support. | 4 | * Privileged Space Mapping Buffer (PMB) Support. |
5 | * | 5 | * |
6 | * Copyright (C) 2005 - 2010 Paul Mundt | 6 | * Copyright (C) 2005 - 2011 Paul Mundt |
7 | * Copyright (C) 2010 Matt Fleming | 7 | * Copyright (C) 2010 Matt Fleming |
8 | * | 8 | * |
9 | * This file is subject to the terms and conditions of the GNU General Public | 9 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/sysdev.h> | 15 | #include <linux/syscore_ops.h> |
16 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/bitops.h> | 18 | #include <linux/bitops.h> |
@@ -874,46 +874,31 @@ static int __init pmb_debugfs_init(void) | |||
874 | subsys_initcall(pmb_debugfs_init); | 874 | subsys_initcall(pmb_debugfs_init); |
875 | 875 | ||
876 | #ifdef CONFIG_PM | 876 | #ifdef CONFIG_PM |
877 | static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state) | 877 | static void pmb_syscore_resume(void) |
878 | { | 878 | { |
879 | static pm_message_t prev_state; | 879 | struct pmb_entry *pmbe; |
880 | int i; | 880 | int i; |
881 | 881 | ||
882 | /* Restore the PMB after a resume from hibernation */ | 882 | read_lock(&pmb_rwlock); |
883 | if (state.event == PM_EVENT_ON && | ||
884 | prev_state.event == PM_EVENT_FREEZE) { | ||
885 | struct pmb_entry *pmbe; | ||
886 | |||
887 | read_lock(&pmb_rwlock); | ||
888 | 883 | ||
889 | for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { | 884 | for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { |
890 | if (test_bit(i, pmb_map)) { | 885 | if (test_bit(i, pmb_map)) { |
891 | pmbe = &pmb_entry_list[i]; | 886 | pmbe = &pmb_entry_list[i]; |
892 | set_pmb_entry(pmbe); | 887 | set_pmb_entry(pmbe); |
893 | } | ||
894 | } | 888 | } |
895 | |||
896 | read_unlock(&pmb_rwlock); | ||
897 | } | 889 | } |
898 | 890 | ||
899 | prev_state = state; | 891 | read_unlock(&pmb_rwlock); |
900 | |||
901 | return 0; | ||
902 | } | ||
903 | |||
904 | static int pmb_sysdev_resume(struct sys_device *dev) | ||
905 | { | ||
906 | return pmb_sysdev_suspend(dev, PMSG_ON); | ||
907 | } | 892 | } |
908 | 893 | ||
909 | static struct sysdev_driver pmb_sysdev_driver = { | 894 | static struct syscore_ops pmb_syscore_ops = { |
910 | .suspend = pmb_sysdev_suspend, | 895 | .resume = pmb_syscore_resume, |
911 | .resume = pmb_sysdev_resume, | ||
912 | }; | 896 | }; |
913 | 897 | ||
914 | static int __init pmb_sysdev_init(void) | 898 | static int __init pmb_sysdev_init(void) |
915 | { | 899 | { |
916 | return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver); | 900 | register_syscore_ops(&pmb_syscore_ops); |
901 | return 0; | ||
917 | } | 902 | } |
918 | subsys_initcall(pmb_sysdev_init); | 903 | subsys_initcall(pmb_sysdev_init); |
919 | #endif | 904 | #endif |