Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh

Pull SuperH updates from Paul Mundt.

* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: (25 commits)
sh: Support I/O space swapping where needed.
sh: use set_current_blocked() and block_sigmask()
sh: no need to reset handler if SA_ONESHOT
sh: intc: Fix up section mismatch for intc_ack_data
sh: select ARCH_DISCARD_MEMBLOCK.
sh: Consolidate duplicate _32/_64 unistd definitions.
sh: ecovec: switch SDHI controllers to card polling
sh: Avoid exporting unimplemented syscalls.
sh: add platform_device for RSPI in setup-sh7757
SH: pci-sh7780: enable big-endian operation.
serial: sh-sci: fix a race of DMA submit_tx on transfer
sh: dma: Collect up CHCR of SH7763, SH7764, SH7780 and SH7785
sh: dma: Collect up CHCR of SH7723 and SH7730
sh/next: Fix build fail by asm/system.h in asm/bitops.h
arch/sh/drivers/dma/{dma-g2,dmabrg}.c: ensure arguments to request_irq and free_irq are compatible
sh: cpufreq: Wire up scaling_available_freqs support.
sh: cpufreq: notify about rate rounding fallback.
sh: cpufreq: Support CPU clock frequency table.
sh: cpufreq: struct device lookup from CPU topology.
sh: cpufreq: percpu struct clk accounting.
...

+433 -384
+4
arch/sh/Kconfig
··· 5 5 select HAVE_IDE if HAS_IOPORT 6 6 select HAVE_MEMBLOCK 7 7 select HAVE_MEMBLOCK_NODE_MAP 8 + select ARCH_DISCARD_MEMBLOCK 8 9 select HAVE_OPROFILE 9 10 select HAVE_GENERIC_DMA_COHERENT 10 11 select HAVE_ARCH_TRACEHOOK ··· 160 159 depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN 161 160 162 161 config IO_TRAPPED 162 + bool 163 + 164 + config SWAP_IO_SPACE 163 165 bool 164 166 165 167 config DMA_COHERENT
+63 -41
arch/sh/boards/mach-ecovec24/setup.c
··· 522 522 gpio_set_value(GPIO_PTB6, state); 523 523 } 524 524 525 + static int sdhi0_get_cd(struct platform_device *pdev) 526 + { 527 + return !gpio_get_value(GPIO_PTY7); 528 + } 529 + 525 530 static struct sh_mobile_sdhi_info sdhi0_info = { 526 531 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 527 532 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 528 533 .set_pwr = sdhi0_set_pwr, 529 - .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD, 534 + .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 535 + MMC_CAP_NEEDS_POLL, 536 + .get_cd = sdhi0_get_cd, 530 537 }; 531 538 532 539 static struct resource sdhi0_resources[] = { ··· 566 559 gpio_set_value(GPIO_PTB7, state); 567 560 } 568 561 562 + static int sdhi1_get_cd(struct platform_device *pdev) 563 + { 564 + return !gpio_get_value(GPIO_PTW7); 565 + } 566 + 569 567 static struct sh_mobile_sdhi_info sdhi1_info = { 570 568 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, 571 569 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 572 - .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD, 570 + .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 571 + MMC_CAP_NEEDS_POLL, 573 572 .set_pwr = sdhi1_set_pwr, 573 + .get_cd = sdhi1_get_cd, 574 574 }; 575 575 576 576 static struct resource sdhi1_resources[] = { ··· 1015 1001 static int __init arch_setup(void) 1016 1002 { 1017 1003 struct clk *clk; 1004 + bool cn12_enabled = false; 1018 1005 1019 1006 /* register board specific self-refresh code */ 1020 1007 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | ··· 1216 1201 gpio_direction_input(GPIO_PTR5); 1217 1202 gpio_direction_input(GPIO_PTR6); 1218 1203 1204 + /* SD-card slot CN11 */ 1205 + /* Card-detect, used on CN11, either with SDHI0 or with SPI */ 1206 + gpio_request(GPIO_PTY7, NULL); 1207 + gpio_direction_input(GPIO_PTY7); 1208 + 1219 1209 #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 1220 1210 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */ 1221 - gpio_request(GPIO_FN_SDHI0CD, NULL); 1222 1211 gpio_request(GPIO_FN_SDHI0WP, NULL); 1223 1212 gpio_request(GPIO_FN_SDHI0CMD, NULL); 1224 1213 gpio_request(GPIO_FN_SDHI0CLK, NULL); ··· 1232 1213 gpio_request(GPIO_FN_SDHI0D0, NULL); 1233 1214 gpio_request(GPIO_PTB6, NULL); 1234 1215 gpio_direction_output(GPIO_PTB6, 0); 1235 - 1236 - #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1237 - /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */ 1238 - gpio_request(GPIO_FN_SDHI1CD, NULL); 1239 - gpio_request(GPIO_FN_SDHI1WP, NULL); 1240 - gpio_request(GPIO_FN_SDHI1CMD, NULL); 1241 - gpio_request(GPIO_FN_SDHI1CLK, NULL); 1242 - gpio_request(GPIO_FN_SDHI1D3, NULL); 1243 - gpio_request(GPIO_FN_SDHI1D2, NULL); 1244 - gpio_request(GPIO_FN_SDHI1D1, NULL); 1245 - gpio_request(GPIO_FN_SDHI1D0, NULL); 1246 - gpio_request(GPIO_PTB7, NULL); 1247 - gpio_direction_output(GPIO_PTB7, 0); 1248 - 1249 - /* I/O buffer drive ability is high for SDHI1 */ 1250 - __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); 1251 - #endif /* CONFIG_MMC_SH_MMCIF */ 1252 1216 #else 1253 1217 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ 1254 1218 gpio_request(GPIO_FN_MSIOF0_TXD, NULL); ··· 1243 1241 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ 1244 1242 gpio_request(GPIO_PTY6, NULL); /* write protect */ 1245 1243 gpio_direction_input(GPIO_PTY6); 1246 - gpio_request(GPIO_PTY7, NULL); /* card detect */ 1247 - gpio_direction_input(GPIO_PTY7); 1248 1244 1249 1245 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); 1250 1246 #endif 1247 + 1248 + /* MMC/SD-card slot CN12 */ 1249 + #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 1250 + /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */ 1251 + gpio_request(GPIO_FN_MMC_D7, NULL); 1252 + gpio_request(GPIO_FN_MMC_D6, NULL); 1253 + gpio_request(GPIO_FN_MMC_D5, NULL); 1254 + gpio_request(GPIO_FN_MMC_D4, NULL); 1255 + gpio_request(GPIO_FN_MMC_D3, NULL); 1256 + gpio_request(GPIO_FN_MMC_D2, NULL); 1257 + gpio_request(GPIO_FN_MMC_D1, NULL); 1258 + gpio_request(GPIO_FN_MMC_D0, NULL); 1259 + gpio_request(GPIO_FN_MMC_CLK, NULL); 1260 + gpio_request(GPIO_FN_MMC_CMD, NULL); 1261 + gpio_request(GPIO_PTB7, NULL); 1262 + gpio_direction_output(GPIO_PTB7, 0); 1263 + 1264 + cn12_enabled = true; 1265 + #elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 1266 + /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */ 1267 + gpio_request(GPIO_FN_SDHI1WP, NULL); 1268 + gpio_request(GPIO_FN_SDHI1CMD, NULL); 1269 + gpio_request(GPIO_FN_SDHI1CLK, NULL); 1270 + gpio_request(GPIO_FN_SDHI1D3, NULL); 1271 + gpio_request(GPIO_FN_SDHI1D2, NULL); 1272 + gpio_request(GPIO_FN_SDHI1D1, NULL); 1273 + gpio_request(GPIO_FN_SDHI1D0, NULL); 1274 + gpio_request(GPIO_PTB7, NULL); 1275 + gpio_direction_output(GPIO_PTB7, 0); 1276 + 1277 + /* Card-detect, used on CN12 with SDHI1 */ 1278 + gpio_request(GPIO_PTW7, NULL); 1279 + gpio_direction_input(GPIO_PTW7); 1280 + 1281 + cn12_enabled = true; 1282 + #endif 1283 + 1284 + if (cn12_enabled) 1285 + /* I/O buffer drive ability is high for CN12 */ 1286 + __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000, 1287 + IODRIVEA); 1251 1288 1252 1289 /* enable Video */ 1253 1290 gpio_request(GPIO_PTU2, NULL); ··· 1345 1304 gpio_request(GPIO_FN_IRDA_IN, NULL); 1346 1305 gpio_request(GPIO_PTU5, NULL); 1347 1306 gpio_direction_output(GPIO_PTU5, 0); 1348 - 1349 - #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 1350 - /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */ 1351 - gpio_request(GPIO_FN_MMC_D7, NULL); 1352 - gpio_request(GPIO_FN_MMC_D6, NULL); 1353 - gpio_request(GPIO_FN_MMC_D5, NULL); 1354 - gpio_request(GPIO_FN_MMC_D4, NULL); 1355 - gpio_request(GPIO_FN_MMC_D3, NULL); 1356 - gpio_request(GPIO_FN_MMC_D2, NULL); 1357 - gpio_request(GPIO_FN_MMC_D1, NULL); 1358 - gpio_request(GPIO_FN_MMC_D0, NULL); 1359 - gpio_request(GPIO_FN_MMC_CLK, NULL); 1360 - gpio_request(GPIO_FN_MMC_CMD, NULL); 1361 - gpio_request(GPIO_PTB7, NULL); 1362 - gpio_direction_output(GPIO_PTB7, 0); 1363 - 1364 - /* I/O buffer drive ability is high for MMCIF */ 1365 - __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); 1366 - #endif 1367 1307 1368 1308 /* enable I2C device */ 1369 1309 i2c_register_board_info(0, i2c0_devices,
+2 -2
arch/sh/drivers/dma/dma-g2.c
··· 181 181 182 182 ret = register_dmac(&g2_dma_info); 183 183 if (unlikely(ret != 0)) 184 - free_irq(HW_EVENT_G2_DMA, 0); 184 + free_irq(HW_EVENT_G2_DMA, &g2_dma_info); 185 185 186 186 return ret; 187 187 } 188 188 189 189 static void __exit g2_dma_exit(void) 190 190 { 191 - free_irq(HW_EVENT_G2_DMA, 0); 191 + free_irq(HW_EVENT_G2_DMA, &g2_dma_info); 192 192 unregister_dmac(&g2_dma_info); 193 193 } 194 194
+2 -2
arch/sh/drivers/dma/dmabrg.c
··· 189 189 if (ret == 0) 190 190 return ret; 191 191 192 - free_irq(DMABRGI1, 0); 193 - out1: free_irq(DMABRGI0, 0); 192 + free_irq(DMABRGI1, NULL); 193 + out1: free_irq(DMABRGI0, NULL); 194 194 out0: kfree(dmabrg_handlers); 195 195 return ret; 196 196 }
+12 -3
arch/sh/drivers/pci/pci-sh7780.c
··· 21 21 #include <asm/mmu.h> 22 22 #include <asm/sizes.h> 23 23 24 + #if defined(CONFIG_CPU_BIG_ENDIAN) 25 + # define PCICR_ENDIANNESS SH4_PCICR_BSWP 26 + #else 27 + # define PCICR_ENDIANNESS 0 28 + #endif 29 + 30 + 24 31 static struct resource sh7785_pci_resources[] = { 25 32 { 26 33 .name = "PCI IO", ··· 261 254 __raw_writel(PCIECR_ENBL, PCIECR); 262 255 263 256 /* Reset */ 264 - __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST, 257 + __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST | PCICR_ENDIANNESS, 265 258 chan->reg_base + SH4_PCICR); 266 259 267 260 /* ··· 297 290 * Now throw it in to register initialization mode and 298 291 * start the real work. 299 292 */ 300 - __raw_writel(SH4_PCICR_PREFIX, chan->reg_base + SH4_PCICR); 293 + __raw_writel(SH4_PCICR_PREFIX | PCICR_ENDIANNESS, 294 + chan->reg_base + SH4_PCICR); 301 295 302 296 memphys = __pa(memory_start); 303 297 memsize = roundup_pow_of_two(memory_end - memory_start); ··· 388 380 * Initialization mode complete, release the control register and 389 381 * enable round robin mode to stop device overruns/starvation. 390 382 */ 391 - __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO, 383 + __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO | 384 + PCICR_ENDIANNESS, 392 385 chan->reg_base + SH4_PCICR); 393 386 394 387 ret = register_pci_controller(chan);
+9 -14
arch/sh/include/asm/io.h
··· 23 23 #define __IO_PREFIX generic 24 24 #include <asm/io_generic.h> 25 25 #include <asm/io_trapped.h> 26 + #include <mach/mangle-port.h> 26 27 27 28 #define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v)) 28 29 #define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile u16 __force *)(a) = (v)) ··· 35 34 #define __raw_readl(a) (__chk_io_ptr(a), *(volatile u32 __force *)(a)) 36 35 #define __raw_readq(a) (__chk_io_ptr(a), *(volatile u64 __force *)(a)) 37 36 38 - #define readb_relaxed(c) ({ u8 __v = __raw_readb(c); __v; }) 39 - #define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \ 40 - __raw_readw(c)); __v; }) 41 - #define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \ 42 - __raw_readl(c)); __v; }) 43 - #define readq_relaxed(c) ({ u64 __v = le64_to_cpu((__force __le64) \ 44 - __raw_readq(c)); __v; }) 37 + #define readb_relaxed(c) ({ u8 __v = ioswabb(__raw_readb(c)); __v; }) 38 + #define readw_relaxed(c) ({ u16 __v = ioswabw(__raw_readw(c)); __v; }) 39 + #define readl_relaxed(c) ({ u32 __v = ioswabl(__raw_readl(c)); __v; }) 40 + #define readq_relaxed(c) ({ u64 __v = ioswabq(__raw_readq(c)); __v; }) 45 41 46 - #define writeb_relaxed(v,c) ((void)__raw_writeb(v,c)) 47 - #define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ 48 - cpu_to_le16(v),c)) 49 - #define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \ 50 - cpu_to_le32(v),c)) 51 - #define writeq_relaxed(v,c) ((void)__raw_writeq((__force u64) \ 52 - cpu_to_le64(v),c)) 42 + #define writeb_relaxed(v,c) ((void)__raw_writeb((__force u8)ioswabb(v),c)) 43 + #define writew_relaxed(v,c) ((void)__raw_writew((__force u16)ioswabw(v),c)) 44 + #define writel_relaxed(v,c) ((void)__raw_writel((__force u32)ioswabl(v),c)) 45 + #define writeq_relaxed(v,c) ((void)__raw_writeq((__force u64)ioswabq(v),c)) 53 46 54 47 #define readb(a) ({ u8 r_ = readb_relaxed(a); rmb(); r_; }) 55 48 #define readw(a) ({ u16 r_ = readw_relaxed(a); rmb(); r_; })
+37
arch/sh/include/asm/unistd.h
··· 1 1 #ifdef __KERNEL__ 2 2 # ifdef CONFIG_SUPERH32 3 + 3 4 # include "unistd_32.h" 5 + # define __ARCH_WANT_SYS_RT_SIGSUSPEND 6 + 4 7 # else 5 8 # include "unistd_64.h" 6 9 # endif 10 + 11 + # define __ARCH_WANT_IPC_PARSE_VERSION 12 + # define __ARCH_WANT_OLD_READDIR 13 + # define __ARCH_WANT_OLD_STAT 14 + # define __ARCH_WANT_STAT64 15 + # define __ARCH_WANT_SYS_ALARM 16 + # define __ARCH_WANT_SYS_GETHOSTNAME 17 + # define __ARCH_WANT_SYS_IPC 18 + # define __ARCH_WANT_SYS_PAUSE 19 + # define __ARCH_WANT_SYS_SGETMASK 20 + # define __ARCH_WANT_SYS_SIGNAL 21 + # define __ARCH_WANT_SYS_TIME 22 + # define __ARCH_WANT_SYS_UTIME 23 + # define __ARCH_WANT_SYS_WAITPID 24 + # define __ARCH_WANT_SYS_SOCKETCALL 25 + # define __ARCH_WANT_SYS_FADVISE64 26 + # define __ARCH_WANT_SYS_GETPGRP 27 + # define __ARCH_WANT_SYS_LLSEEK 28 + # define __ARCH_WANT_SYS_NICE 29 + # define __ARCH_WANT_SYS_OLD_GETRLIMIT 30 + # define __ARCH_WANT_SYS_OLD_UNAME 31 + # define __ARCH_WANT_SYS_OLDUMOUNT 32 + # define __ARCH_WANT_SYS_SIGPENDING 33 + # define __ARCH_WANT_SYS_SIGPROCMASK 34 + # define __ARCH_WANT_SYS_RT_SIGACTION 35 + 36 + /* 37 + * "Conditional" syscalls 38 + * 39 + * What we want is __attribute__((weak,alias("sys_ni_syscall"))), 40 + * but it doesn't work on all toolchains, so we just do it by hand 41 + */ 42 + # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 43 + 7 44 #else 8 45 # ifdef __SH5__ 9 46 # include "unistd_64.h"
+32 -70
arch/sh/include/asm/unistd_32.h
··· 1 - #ifndef __ASM_SH_UNISTD_H 2 - #define __ASM_SH_UNISTD_H 1 + #ifndef __ASM_SH_UNISTD_32_H 2 + #define __ASM_SH_UNISTD_32_H 3 3 4 4 /* 5 5 * Copyright (C) 1999 Niibe Yutaka ··· 26 26 #define __NR_mknod 14 27 27 #define __NR_chmod 15 28 28 #define __NR_lchown 16 29 - #define __NR_break 17 29 + /* 17 was sys_break */ 30 30 #define __NR_oldstat 18 31 31 #define __NR_lseek 19 32 32 #define __NR_getpid 20 ··· 40 40 #define __NR_oldfstat 28 41 41 #define __NR_pause 29 42 42 #define __NR_utime 30 43 - #define __NR_stty 31 44 - #define __NR_gtty 32 43 + /* 31 was sys_stty */ 44 + /* 32 was sys_gtty */ 45 45 #define __NR_access 33 46 46 #define __NR_nice 34 47 - #define __NR_ftime 35 47 + /* 35 was sys_ftime */ 48 48 #define __NR_sync 36 49 49 #define __NR_kill 37 50 50 #define __NR_rename 38 ··· 53 53 #define __NR_dup 41 54 54 #define __NR_pipe 42 55 55 #define __NR_times 43 56 - #define __NR_prof 44 56 + /* 44 was sys_prof */ 57 57 #define __NR_brk 45 58 58 #define __NR_setgid 46 59 59 #define __NR_getgid 47 ··· 62 62 #define __NR_getegid 50 63 63 #define __NR_acct 51 64 64 #define __NR_umount2 52 65 - #define __NR_lock 53 65 + /* 53 was sys_lock */ 66 66 #define __NR_ioctl 54 67 67 #define __NR_fcntl 55 68 - #define __NR_mpx 56 68 + /* 56 was sys_mpx */ 69 69 #define __NR_setpgid 57 70 - #define __NR_ulimit 58 71 - #define __NR_oldolduname 59 70 + /* 58 was sys_ulimit */ 71 + /* 59 was sys_olduname */ 72 72 #define __NR_umask 60 73 73 #define __NR_chroot 61 74 74 #define __NR_ustat 62 ··· 91 91 #define __NR_settimeofday 79 92 92 #define __NR_getgroups 80 93 93 #define __NR_setgroups 81 94 - #define __NR_select 82 94 + /* 82 was sys_oldselect */ 95 95 #define __NR_symlink 83 96 96 #define __NR_oldlstat 84 97 97 #define __NR_readlink 85 ··· 107 107 #define __NR_fchown 95 108 108 #define __NR_getpriority 96 109 109 #define __NR_setpriority 97 110 - #define __NR_profil 98 110 + /* 98 was sys_profil */ 111 111 #define __NR_statfs 99 112 112 #define __NR_fstatfs 100 113 - #define __NR_ioperm 101 113 + /* 101 was sys_ioperm */ 114 114 #define __NR_socketcall 102 115 115 #define __NR_syslog 103 116 116 #define __NR_setitimer 104 ··· 119 119 #define __NR_lstat 107 120 120 #define __NR_fstat 108 121 121 #define __NR_olduname 109 122 - #define __NR_iopl 110 122 + /* 110 was sys_iopl */ 123 123 #define __NR_vhangup 111 124 - #define __NR_idle 112 125 - #define __NR_vm86old 113 124 + /* 112 was sys_idle */ 125 + /* 113 was sys_vm86old */ 126 126 #define __NR_wait4 114 127 127 #define __NR_swapoff 115 128 128 #define __NR_sysinfo 116 ··· 136 136 #define __NR_adjtimex 124 137 137 #define __NR_mprotect 125 138 138 #define __NR_sigprocmask 126 139 - #define __NR_create_module 127 139 + /* 127 was sys_create_module */ 140 140 #define __NR_init_module 128 141 141 #define __NR_delete_module 129 142 - #define __NR_get_kernel_syms 130 142 + /* 130 was sys_get_kernel_syms */ 143 143 #define __NR_quotactl 131 144 144 #define __NR_getpgid 132 145 145 #define __NR_fchdir 133 146 146 #define __NR_bdflush 134 147 147 #define __NR_sysfs 135 148 148 #define __NR_personality 136 149 - #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ 149 + /* 137 was sys_afs_syscall */ 150 150 #define __NR_setfsuid 138 151 151 #define __NR_setfsgid 139 152 152 #define __NR__llseek 140 ··· 175 175 #define __NR_mremap 163 176 176 #define __NR_setresuid 164 177 177 #define __NR_getresuid 165 178 - #define __NR_vm86 166 179 - #define __NR_query_module 167 178 + /* 166 was sys_vm86 */ 179 + /* 167 was sys_query_module */ 180 180 #define __NR_poll 168 181 181 #define __NR_nfsservctl 169 182 182 #define __NR_setresgid 170 ··· 197 197 #define __NR_capset 185 198 198 #define __NR_sigaltstack 186 199 199 #define __NR_sendfile 187 200 - #define __NR_streams1 188 /* some people actually want it */ 201 - #define __NR_streams2 189 /* some people actually want it */ 200 + /* 188 reserved for sys_getpmsg */ 201 + /* 189 reserved for sys_putpmsg */ 202 202 #define __NR_vfork 190 203 203 #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ 204 204 #define __NR_mmap2 192 ··· 231 231 #define __NR_madvise 219 232 232 #define __NR_getdents64 220 233 233 #define __NR_fcntl64 221 234 - /* 223 is unused */ 234 + /* 222 is reserved for tux */ 235 + /* 223 is unused */ 235 236 #define __NR_gettid 224 236 237 #define __NR_readahead 225 237 238 #define __NR_setxattr 226 ··· 252 251 #define __NR_futex 240 253 252 #define __NR_sched_setaffinity 241 254 253 #define __NR_sched_getaffinity 242 255 - #define __NR_set_thread_area 243 256 - #define __NR_get_thread_area 244 254 + /* 243 is reserved for set_thread_area */ 255 + /* 244 is reserved for get_thread_area */ 257 256 #define __NR_io_setup 245 258 257 #define __NR_io_destroy 246 259 258 #define __NR_io_getevents 247 260 259 #define __NR_io_submit 248 261 260 #define __NR_io_cancel 249 262 261 #define __NR_fadvise64 250 263 - 262 + /* 251 is unused */ 264 263 #define __NR_exit_group 252 265 264 #define __NR_lookup_dcookie 253 266 265 #define __NR_epoll_create 254 ··· 282 281 #define __NR_tgkill 270 283 282 #define __NR_utimes 271 284 283 #define __NR_fadvise64_64 272 285 - #define __NR_vserver 273 284 + /* 273 is reserved for vserver */ 286 285 #define __NR_mbind 274 287 286 #define __NR_get_mempolicy 275 288 287 #define __NR_set_mempolicy 276 ··· 302 301 #define __NR_inotify_init 290 303 302 #define __NR_inotify_add_watch 291 304 303 #define __NR_inotify_rm_watch 292 305 - /* 293 is unused */ 304 + /* 293 is unused */ 306 305 #define __NR_migrate_pages 294 307 306 #define __NR_openat 295 308 307 #define __NR_mkdirat 296 ··· 381 380 382 381 #define NR_syscalls 367 383 382 384 - #ifdef __KERNEL__ 385 - 386 - #define __ARCH_WANT_IPC_PARSE_VERSION 387 - #define __ARCH_WANT_OLD_READDIR 388 - #define __ARCH_WANT_OLD_STAT 389 - #define __ARCH_WANT_STAT64 390 - #define __ARCH_WANT_SYS_ALARM 391 - #define __ARCH_WANT_SYS_GETHOSTNAME 392 - #define __ARCH_WANT_SYS_IPC 393 - #define __ARCH_WANT_SYS_PAUSE 394 - #define __ARCH_WANT_SYS_SGETMASK 395 - #define __ARCH_WANT_SYS_SIGNAL 396 - #define __ARCH_WANT_SYS_TIME 397 - #define __ARCH_WANT_SYS_UTIME 398 - #define __ARCH_WANT_SYS_WAITPID 399 - #define __ARCH_WANT_SYS_SOCKETCALL 400 - #define __ARCH_WANT_SYS_FADVISE64 401 - #define __ARCH_WANT_SYS_GETPGRP 402 - #define __ARCH_WANT_SYS_LLSEEK 403 - #define __ARCH_WANT_SYS_NICE 404 - #define __ARCH_WANT_SYS_OLD_GETRLIMIT 405 - #define __ARCH_WANT_SYS_OLD_UNAME 406 - #define __ARCH_WANT_SYS_OLDUMOUNT 407 - #define __ARCH_WANT_SYS_SIGPENDING 408 - #define __ARCH_WANT_SYS_SIGPROCMASK 409 - #define __ARCH_WANT_SYS_RT_SIGACTION 410 - #define __ARCH_WANT_SYS_RT_SIGSUSPEND 411 - 412 - /* 413 - * "Conditional" syscalls 414 - * 415 - * What we want is __attribute__((weak,alias("sys_ni_syscall"))), 416 - * but it doesn't work on all toolchains, so we just do it by hand 417 - */ 418 - #ifndef cond_syscall 419 - #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 420 - #endif 421 - 422 - #endif /* __KERNEL__ */ 423 - #endif /* __ASM_SH_UNISTD_H */ 383 + #endif /* __ASM_SH_UNISTD_32_H */
+34 -72
arch/sh/include/asm/unistd_64.h
··· 31 31 #define __NR_mknod 14 32 32 #define __NR_chmod 15 33 33 #define __NR_lchown 16 34 - #define __NR_break 17 34 + /* 17 was sys_break */ 35 35 #define __NR_oldstat 18 36 36 #define __NR_lseek 19 37 37 #define __NR_getpid 20 ··· 45 45 #define __NR_oldfstat 28 46 46 #define __NR_pause 29 47 47 #define __NR_utime 30 48 - #define __NR_stty 31 49 - #define __NR_gtty 32 48 + /* 31 was sys_stty */ 49 + /* 32 was sys_gtty */ 50 50 #define __NR_access 33 51 51 #define __NR_nice 34 52 - #define __NR_ftime 35 52 + /* 35 was sys_ftime */ 53 53 #define __NR_sync 36 54 54 #define __NR_kill 37 55 55 #define __NR_rename 38 ··· 58 58 #define __NR_dup 41 59 59 #define __NR_pipe 42 60 60 #define __NR_times 43 61 - #define __NR_prof 44 61 + /* 44 was sys_prof */ 62 62 #define __NR_brk 45 63 63 #define __NR_setgid 46 64 64 #define __NR_getgid 47 ··· 67 67 #define __NR_getegid 50 68 68 #define __NR_acct 51 69 69 #define __NR_umount2 52 70 - #define __NR_lock 53 70 + /* 53 was sys_lock */ 71 71 #define __NR_ioctl 54 72 72 #define __NR_fcntl 55 73 - #define __NR_mpx 56 73 + /* 56 was sys_mpx */ 74 74 #define __NR_setpgid 57 75 - #define __NR_ulimit 58 76 - #define __NR_oldolduname 59 75 + /* 58 was sys_ulimit */ 76 + /* 59 was sys_olduname */ 77 77 #define __NR_umask 60 78 78 #define __NR_chroot 61 79 79 #define __NR_ustat 62 ··· 96 96 #define __NR_settimeofday 79 97 97 #define __NR_getgroups 80 98 98 #define __NR_setgroups 81 99 - #define __NR_select 82 99 + /* 82 was sys_select */ 100 100 #define __NR_symlink 83 101 101 #define __NR_oldlstat 84 102 102 #define __NR_readlink 85 ··· 112 112 #define __NR_fchown 95 113 113 #define __NR_getpriority 96 114 114 #define __NR_setpriority 97 115 - #define __NR_profil 98 115 + /* 98 was sys_profil */ 116 116 #define __NR_statfs 99 117 117 #define __NR_fstatfs 100 118 - #define __NR_ioperm 101 118 + /* 101 was sys_ioperm */ 119 119 #define __NR_socketcall 102 /* old implementation of socket systemcall */ 120 120 #define __NR_syslog 103 121 121 #define __NR_setitimer 104 ··· 124 124 #define __NR_lstat 107 125 125 #define __NR_fstat 108 126 126 #define __NR_olduname 109 127 - #define __NR_iopl 110 127 + /* 110 was sys_iopl */ 128 128 #define __NR_vhangup 111 129 - #define __NR_idle 112 130 - #define __NR_vm86old 113 129 + /* 112 was sys_idle */ 130 + /* 113 was sys_vm86old */ 131 131 #define __NR_wait4 114 132 132 #define __NR_swapoff 115 133 133 #define __NR_sysinfo 116 ··· 141 141 #define __NR_adjtimex 124 142 142 #define __NR_mprotect 125 143 143 #define __NR_sigprocmask 126 144 - #define __NR_create_module 127 144 + /* 127 was sys_create_module */ 145 145 #define __NR_init_module 128 146 146 #define __NR_delete_module 129 147 - #define __NR_get_kernel_syms 130 147 + /* 130 was sys_get_kernel_syms */ 148 148 #define __NR_quotactl 131 149 149 #define __NR_getpgid 132 150 150 #define __NR_fchdir 133 151 151 #define __NR_bdflush 134 152 152 #define __NR_sysfs 135 153 153 #define __NR_personality 136 154 - #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ 154 + /* 137 was sys_afs_syscall */ 155 155 #define __NR_setfsuid 138 156 156 #define __NR_setfsgid 139 157 157 #define __NR__llseek 140 ··· 180 180 #define __NR_mremap 163 181 181 #define __NR_setresuid 164 182 182 #define __NR_getresuid 165 183 - #define __NR_vm86 166 184 - #define __NR_query_module 167 183 + /* 166 was sys_vm86 */ 184 + /* 167 was sys_query_module */ 185 185 #define __NR_poll 168 186 186 #define __NR_nfsservctl 169 187 187 #define __NR_setresgid 170 ··· 202 202 #define __NR_capset 185 203 203 #define __NR_sigaltstack 186 204 204 #define __NR_sendfile 187 205 - #define __NR_streams1 188 /* some people actually want it */ 206 - #define __NR_streams2 189 /* some people actually want it */ 205 + /* 188 reserved for getpmsg */ 206 + /* 189 reserved for putpmsg */ 207 207 #define __NR_vfork 190 208 208 #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ 209 209 #define __NR_mmap2 192 ··· 262 262 #define __NR_msgrcv 241 263 263 #define __NR_msgget 242 264 264 #define __NR_msgctl 243 265 - #if 0 266 - #define __NR_shmatcall 244 267 - #endif 265 + #define __NR_shmat 244 268 266 #define __NR_shmdt 245 269 267 #define __NR_shmget 246 270 268 #define __NR_shmctl 247 271 269 272 270 #define __NR_getdents64 248 273 271 #define __NR_fcntl64 249 274 - /* 223 is unused */ 272 + /* 250 is reserved for tux */ 273 + /* 251 is unused */ 275 274 #define __NR_gettid 252 276 275 #define __NR_readahead 253 277 276 #define __NR_setxattr 254 ··· 290 291 #define __NR_futex 268 291 292 #define __NR_sched_setaffinity 269 292 293 #define __NR_sched_getaffinity 270 293 - #define __NR_set_thread_area 271 294 - #define __NR_get_thread_area 272 294 + /* 271 is reserved for set_thread_area */ 295 + /* 272 is reserved for get_thread_area */ 295 296 #define __NR_io_setup 273 296 297 #define __NR_io_destroy 274 297 298 #define __NR_io_getevents 275 298 299 #define __NR_io_submit 276 299 300 #define __NR_io_cancel 277 300 301 #define __NR_fadvise64 278 302 + /* 279 is unused */ 301 303 #define __NR_exit_group 280 302 304 303 305 #define __NR_lookup_dcookie 281 ··· 321 321 #define __NR_tgkill 298 322 322 #define __NR_utimes 299 323 323 #define __NR_fadvise64_64 300 324 - #define __NR_vserver 301 325 - #define __NR_mbind 302 326 - #define __NR_get_mempolicy 303 327 - #define __NR_set_mempolicy 304 324 + /* 301 is reserved for vserver */ 325 + /* 302 is reserved for mbind */ 326 + /* 303 is reserved for get_mempolicy */ 327 + /* 304 is reserved for set_mempolicy */ 328 328 #define __NR_mq_open 305 329 329 #define __NR_mq_unlink (__NR_mq_open+1) 330 330 #define __NR_mq_timedsend (__NR_mq_open+2) 331 331 #define __NR_mq_timedreceive (__NR_mq_open+3) 332 332 #define __NR_mq_notify (__NR_mq_open+4) 333 333 #define __NR_mq_getsetattr (__NR_mq_open+5) 334 - #define __NR_kexec_load 311 334 + /* 311 is reserved for kexec */ 335 335 #define __NR_waitid 312 336 336 #define __NR_add_key 313 337 337 #define __NR_request_key 314 ··· 341 341 #define __NR_inotify_init 318 342 342 #define __NR_inotify_add_watch 319 343 343 #define __NR_inotify_rm_watch 320 344 - /* 321 is unused */ 344 + /* 321 is unused */ 345 345 #define __NR_migrate_pages 322 346 346 #define __NR_openat 323 347 347 #define __NR_mkdirat 324 ··· 399 399 #define __NR_process_vm_readv 376 400 400 #define __NR_process_vm_writev 377 401 401 402 - #ifdef __KERNEL__ 403 - 404 402 #define NR_syscalls 378 405 403 406 - #define __ARCH_WANT_IPC_PARSE_VERSION 407 - #define __ARCH_WANT_OLD_READDIR 408 - #define __ARCH_WANT_OLD_STAT 409 - #define __ARCH_WANT_STAT64 410 - #define __ARCH_WANT_SYS_ALARM 411 - #define __ARCH_WANT_SYS_GETHOSTNAME 412 - #define __ARCH_WANT_SYS_IPC 413 - #define __ARCH_WANT_SYS_PAUSE 414 - #define __ARCH_WANT_SYS_SGETMASK 415 - #define __ARCH_WANT_SYS_SIGNAL 416 - #define __ARCH_WANT_SYS_TIME 417 - #define __ARCH_WANT_SYS_UTIME 418 - #define __ARCH_WANT_SYS_WAITPID 419 - #define __ARCH_WANT_SYS_SOCKETCALL 420 - #define __ARCH_WANT_SYS_FADVISE64 421 - #define __ARCH_WANT_SYS_GETPGRP 422 - #define __ARCH_WANT_SYS_LLSEEK 423 - #define __ARCH_WANT_SYS_NICE 424 - #define __ARCH_WANT_SYS_OLD_GETRLIMIT 425 - #define __ARCH_WANT_SYS_OLD_UNAME 426 - #define __ARCH_WANT_SYS_OLDUMOUNT 427 - #define __ARCH_WANT_SYS_SIGPENDING 428 - #define __ARCH_WANT_SYS_SIGPROCMASK 429 - #define __ARCH_WANT_SYS_RT_SIGACTION 430 - 431 - /* 432 - * "Conditional" syscalls 433 - * 434 - * What we want is __attribute__((weak,alias("sys_ni_syscall"))), 435 - * but it doesn't work on all toolchains, so we just do it by hand 436 - */ 437 - #ifndef cond_syscall 438 - #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 439 - #endif 440 - 441 - #endif /* __KERNEL__ */ 442 404 #endif /* __ASM_SH_UNISTD_64_H */
+8 -24
arch/sh/include/cpu-sh4/cpu/dma-register.h
··· 16 16 17 17 #define DMAOR_INIT DMAOR_DME 18 18 19 - #if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ 20 - defined(CONFIG_CPU_SUBTYPE_SH7730) 19 + #if defined(CONFIG_CPU_SUBTYPE_SH7343) 21 20 #define CHCR_TS_LOW_MASK 0x00000018 22 21 #define CHCR_TS_LOW_SHIFT 3 23 22 #define CHCR_TS_HIGH_MASK 0 24 23 #define CHCR_TS_HIGH_SHIFT 0 25 24 #elif defined(CONFIG_CPU_SUBTYPE_SH7722) || \ 25 + defined(CONFIG_CPU_SUBTYPE_SH7723) || \ 26 26 defined(CONFIG_CPU_SUBTYPE_SH7724) || \ 27 + defined(CONFIG_CPU_SUBTYPE_SH7730) || \ 27 28 defined(CONFIG_CPU_SUBTYPE_SH7786) 28 29 #define CHCR_TS_LOW_MASK 0x00000018 29 30 #define CHCR_TS_LOW_SHIFT 3 30 31 #define CHCR_TS_HIGH_MASK 0x00300000 31 32 #define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ 32 - #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 33 - defined(CONFIG_CPU_SUBTYPE_SH7764) 34 - #define CHCR_TS_LOW_MASK 0x00000018 35 - #define CHCR_TS_LOW_SHIFT 3 36 - #define CHCR_TS_HIGH_MASK 0 37 - #define CHCR_TS_HIGH_SHIFT 0 38 - #elif defined(CONFIG_CPU_SUBTYPE_SH7723) 39 - #define CHCR_TS_LOW_MASK 0x00000018 40 - #define CHCR_TS_LOW_SHIFT 3 41 - #define CHCR_TS_HIGH_MASK 0 42 - #define CHCR_TS_HIGH_SHIFT 0 43 - #elif defined(CONFIG_CPU_SUBTYPE_SH7757) 33 + #elif defined(CONFIG_CPU_SUBTYPE_SH7757) || \ 34 + defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 35 + defined(CONFIG_CPU_SUBTYPE_SH7764) || \ 36 + defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 37 + defined(CONFIG_CPU_SUBTYPE_SH7785) 44 38 #define CHCR_TS_LOW_MASK 0x00000018 45 39 #define CHCR_TS_LOW_SHIFT 3 46 40 #define CHCR_TS_HIGH_MASK 0x00100000 47 41 #define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ 48 - #elif defined(CONFIG_CPU_SUBTYPE_SH7780) 49 - #define CHCR_TS_LOW_MASK 0x00000018 50 - #define CHCR_TS_LOW_SHIFT 3 51 - #define CHCR_TS_HIGH_MASK 0 52 - #define CHCR_TS_HIGH_SHIFT 0 53 - #else /* SH7785 */ 54 - #define CHCR_TS_LOW_MASK 0x00000018 55 - #define CHCR_TS_LOW_SHIFT 3 56 - #define CHCR_TS_HIGH_MASK 0 57 - #define CHCR_TS_HIGH_SHIFT 0 58 42 #endif 59 43 60 44 /* Transmit sizes and respective CHCR register values */
+49
arch/sh/include/mach-common/mach/mangle-port.h
··· 1 + /* 2 + * SH version cribbed from the MIPS copy: 3 + * 4 + * This file is subject to the terms and conditions of the GNU General Public 5 + * License. See the file "COPYING" in the main directory of this archive 6 + * for more details. 7 + * 8 + * Copyright (C) 2003, 2004 Ralf Baechle 9 + */ 10 + #ifndef __MACH_COMMON_MANGLE_PORT_H 11 + #define __MACH_COMMON_MANGLE_PORT_H 12 + 13 + /* 14 + * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; 15 + * less sane hardware forces software to fiddle with this... 16 + * 17 + * Regardless, if the host bus endianness mismatches that of PCI/ISA, then 18 + * you can't have the numerical value of data and byte addresses within 19 + * multibyte quantities both preserved at the same time. Hence two 20 + * variations of functions: non-prefixed ones that preserve the value 21 + * and prefixed ones that preserve byte addresses. The latters are 22 + * typically used for moving raw data between a peripheral and memory (cf. 23 + * string I/O functions), hence the "__mem_" prefix. 24 + */ 25 + #if defined(CONFIG_SWAP_IO_SPACE) 26 + 27 + # define ioswabb(x) (x) 28 + # define __mem_ioswabb(x) (x) 29 + # define ioswabw(x) le16_to_cpu(x) 30 + # define __mem_ioswabw(x) (x) 31 + # define ioswabl(x) le32_to_cpu(x) 32 + # define __mem_ioswabl(x) (x) 33 + # define ioswabq(x) le64_to_cpu(x) 34 + # define __mem_ioswabq(x) (x) 35 + 36 + #else 37 + 38 + # define ioswabb(x) (x) 39 + # define __mem_ioswabb(x) (x) 40 + # define ioswabw(x) (x) 41 + # define __mem_ioswabw(x) cpu_to_le16(x) 42 + # define ioswabl(x) (x) 43 + # define __mem_ioswabl(x) cpu_to_le32(x) 44 + # define ioswabq(x) (x) 45 + # define __mem_ioswabq(x) cpu_to_le32(x) 46 + 47 + #endif 48 + 49 + #endif /* __MACH_COMMON_MANGLE_PORT_H */
+20
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
··· 680 680 .resource = spi1_resources, 681 681 }; 682 682 683 + static struct resource rspi_resources[] = { 684 + { 685 + .start = 0xfe480000, 686 + .end = 0xfe4800ff, 687 + .flags = IORESOURCE_MEM, 688 + }, 689 + { 690 + .start = 220, 691 + .flags = IORESOURCE_IRQ, 692 + }, 693 + }; 694 + 695 + static struct platform_device rspi_device = { 696 + .name = "rspi", 697 + .id = 2, 698 + .num_resources = ARRAY_SIZE(rspi_resources), 699 + .resource = rspi_resources, 700 + }; 701 + 683 702 static struct resource usb_ehci_resources[] = { 684 703 [0] = { 685 704 .start = 0xfe4f1000, ··· 759 740 &dma3_device, 760 741 &spi0_device, 761 742 &spi1_device, 743 + &rspi_device, 762 744 &usb_ehci_device, 763 745 &usb_ohci_device, 764 746 };
+96 -53
arch/sh/kernel/cpufreq.c
··· 3 3 * 4 4 * cpufreq driver for the SuperH processors. 5 5 * 6 - * Copyright (C) 2002 - 2007 Paul Mundt 6 + * Copyright (C) 2002 - 2012 Paul Mundt 7 7 * Copyright (C) 2002 M. R. Brown 8 8 * 9 9 * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c ··· 14 14 * License. See the file "COPYING" in the main directory of this archive 15 15 * for more details. 16 16 */ 17 + #define pr_fmt(fmt) "cpufreq: " fmt 18 + 17 19 #include <linux/types.h> 18 20 #include <linux/cpufreq.h> 19 21 #include <linux/kernel.h> ··· 23 21 #include <linux/init.h> 24 22 #include <linux/err.h> 25 23 #include <linux/cpumask.h> 24 + #include <linux/cpu.h> 26 25 #include <linux/smp.h> 27 26 #include <linux/sched.h> /* set_cpus_allowed() */ 28 27 #include <linux/clk.h> 28 + #include <linux/percpu.h> 29 + #include <linux/sh_clk.h> 29 30 30 - static struct clk *cpuclk; 31 + static DEFINE_PER_CPU(struct clk, sh_cpuclk); 31 32 32 33 static unsigned int sh_cpufreq_get(unsigned int cpu) 33 34 { 34 - return (clk_get_rate(cpuclk) + 500) / 1000; 35 + return (clk_get_rate(&per_cpu(sh_cpuclk, cpu)) + 500) / 1000; 35 36 } 36 37 37 38 /* ··· 45 40 unsigned int relation) 46 41 { 47 42 unsigned int cpu = policy->cpu; 43 + struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); 48 44 cpumask_t cpus_allowed; 49 45 struct cpufreq_freqs freqs; 46 + struct device *dev; 50 47 long freq; 51 48 52 49 if (!cpu_online(cpu)) ··· 59 52 60 53 BUG_ON(smp_processor_id() != cpu); 61 54 55 + dev = get_cpu_device(cpu); 56 + 62 57 /* Convert target_freq from kHz to Hz */ 63 58 freq = clk_round_rate(cpuclk, target_freq * 1000); 64 59 65 60 if (freq < (policy->min * 1000) || freq > (policy->max * 1000)) 66 61 return -EINVAL; 67 62 68 - pr_debug("cpufreq: requested frequency %u Hz\n", target_freq * 1000); 63 + dev_dbg(dev, "requested frequency %u Hz\n", target_freq * 1000); 69 64 70 65 freqs.cpu = cpu; 71 66 freqs.old = sh_cpufreq_get(cpu); ··· 79 70 clk_set_rate(cpuclk, freq); 80 71 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 81 72 82 - pr_debug("cpufreq: set frequency %lu Hz\n", freq); 83 - 84 - return 0; 85 - } 86 - 87 - static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) 88 - { 89 - if (!cpu_online(policy->cpu)) 90 - return -ENODEV; 91 - 92 - cpuclk = clk_get(NULL, "cpu_clk"); 93 - if (IS_ERR(cpuclk)) { 94 - printk(KERN_ERR "cpufreq: couldn't get CPU#%d clk\n", 95 - policy->cpu); 96 - return PTR_ERR(cpuclk); 97 - } 98 - 99 - /* cpuinfo and default policy values */ 100 - policy->cpuinfo.min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000; 101 - policy->cpuinfo.max_freq = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; 102 - policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 103 - 104 - policy->cur = sh_cpufreq_get(policy->cpu); 105 - policy->min = policy->cpuinfo.min_freq; 106 - policy->max = policy->cpuinfo.max_freq; 107 - 108 - /* 109 - * Catch the cases where the clock framework hasn't been wired up 110 - * properly to support scaling. 111 - */ 112 - if (unlikely(policy->min == policy->max)) { 113 - printk(KERN_ERR "cpufreq: clock framework rate rounding " 114 - "not supported on CPU#%d.\n", policy->cpu); 115 - 116 - clk_put(cpuclk); 117 - return -EINVAL; 118 - } 119 - 120 - printk(KERN_INFO "cpufreq: CPU#%d Frequencies - Minimum %u.%03u MHz, " 121 - "Maximum %u.%03u MHz.\n", 122 - policy->cpu, policy->min / 1000, policy->min % 1000, 123 - policy->max / 1000, policy->max % 1000); 73 + dev_dbg(dev, "set frequency %lu Hz\n", freq); 124 74 125 75 return 0; 126 76 } 127 77 128 78 static int sh_cpufreq_verify(struct cpufreq_policy *policy) 129 79 { 80 + struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu); 81 + struct cpufreq_frequency_table *freq_table; 82 + 83 + freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; 84 + if (freq_table) 85 + return cpufreq_frequency_table_verify(policy, freq_table); 86 + 130 87 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, 131 88 policy->cpuinfo.max_freq); 89 + 90 + policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000; 91 + policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; 92 + 93 + cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, 94 + policy->cpuinfo.max_freq); 95 + 132 96 return 0; 133 97 } 134 98 135 - static int sh_cpufreq_exit(struct cpufreq_policy *policy) 99 + static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) 136 100 { 137 - clk_put(cpuclk); 101 + unsigned int cpu = policy->cpu; 102 + struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); 103 + struct cpufreq_frequency_table *freq_table; 104 + struct device *dev; 105 + 106 + if (!cpu_online(cpu)) 107 + return -ENODEV; 108 + 109 + dev = get_cpu_device(cpu); 110 + 111 + cpuclk = clk_get(dev, "cpu_clk"); 112 + if (IS_ERR(cpuclk)) { 113 + dev_err(dev, "couldn't get CPU clk\n"); 114 + return PTR_ERR(cpuclk); 115 + } 116 + 117 + policy->cur = policy->min = policy->max = sh_cpufreq_get(cpu); 118 + 119 + freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; 120 + if (freq_table) { 121 + int result; 122 + 123 + result = cpufreq_frequency_table_cpuinfo(policy, freq_table); 124 + if (!result) 125 + cpufreq_frequency_table_get_attr(freq_table, cpu); 126 + } else { 127 + dev_notice(dev, "no frequency table found, falling back " 128 + "to rate rounding.\n"); 129 + 130 + policy->cpuinfo.min_freq = 131 + (clk_round_rate(cpuclk, 1) + 500) / 1000; 132 + policy->cpuinfo.max_freq = 133 + (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; 134 + } 135 + 136 + policy->min = policy->cpuinfo.min_freq; 137 + policy->max = policy->cpuinfo.max_freq; 138 + 139 + policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 140 + 141 + dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " 142 + "Maximum %u.%03u MHz.\n", 143 + policy->min / 1000, policy->min % 1000, 144 + policy->max / 1000, policy->max % 1000); 145 + 138 146 return 0; 139 147 } 148 + 149 + static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) 150 + { 151 + unsigned int cpu = policy->cpu; 152 + struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); 153 + 154 + cpufreq_frequency_table_put_attr(cpu); 155 + clk_put(cpuclk); 156 + 157 + return 0; 158 + } 159 + 160 + static struct freq_attr *sh_freq_attr[] = { 161 + &cpufreq_freq_attr_scaling_available_freqs, 162 + NULL, 163 + }; 140 164 141 165 static struct cpufreq_driver sh_cpufreq_driver = { 142 166 .owner = THIS_MODULE, 143 167 .name = "sh", 144 - .init = sh_cpufreq_cpu_init, 145 - .verify = sh_cpufreq_verify, 146 - .target = sh_cpufreq_target, 147 168 .get = sh_cpufreq_get, 148 - .exit = sh_cpufreq_exit, 169 + .target = sh_cpufreq_target, 170 + .verify = sh_cpufreq_verify, 171 + .init = sh_cpufreq_cpu_init, 172 + .exit = sh_cpufreq_cpu_exit, 173 + .attr = sh_freq_attr, 149 174 }; 150 175 151 176 static int __init sh_cpufreq_module_init(void) 152 177 { 153 - printk(KERN_INFO "cpufreq: SuperH CPU frequency driver.\n"); 178 + pr_notice("SuperH CPU frequency driver.\n"); 154 179 return cpufreq_register_driver(&sh_cpufreq_driver); 155 180 } 156 181
+10 -25
arch/sh/kernel/signal_32.c
··· 57 57 unsigned long r5, unsigned long r6, unsigned long r7, 58 58 struct pt_regs __regs) 59 59 { 60 - mask &= _BLOCKABLE; 61 - spin_lock_irq(&current->sighand->siglock); 60 + sigset_t blocked; 61 + 62 62 current->saved_sigmask = current->blocked; 63 - siginitset(&current->blocked, mask); 64 - recalc_sigpending(); 65 - spin_unlock_irq(&current->sighand->siglock); 63 + 64 + mask &= _BLOCKABLE; 65 + siginitset(&blocked, mask); 66 + set_current_blocked(&blocked); 66 67 67 68 current->state = TASK_INTERRUPTIBLE; 68 69 schedule(); ··· 240 239 goto badframe; 241 240 242 241 sigdelsetmask(&set, ~_BLOCKABLE); 243 - 244 - spin_lock_irq(&current->sighand->siglock); 245 - current->blocked = set; 246 - recalc_sigpending(); 247 - spin_unlock_irq(&current->sighand->siglock); 242 + set_current_blocked(&set); 248 243 249 244 if (restore_sigcontext(regs, &frame->sc, &r0)) 250 245 goto badframe; ··· 270 273 goto badframe; 271 274 272 275 sigdelsetmask(&set, ~_BLOCKABLE); 273 - spin_lock_irq(&current->sighand->siglock); 274 - current->blocked = set; 275 - recalc_sigpending(); 276 - spin_unlock_irq(&current->sighand->siglock); 276 + set_current_blocked(&set); 277 277 278 278 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) 279 279 goto badframe; ··· 541 547 else 542 548 ret = setup_frame(sig, ka, oldset, regs); 543 549 544 - if (ka->sa.sa_flags & SA_ONESHOT) 545 - ka->sa.sa_handler = SIG_DFL; 546 - 547 - if (ret == 0) { 548 - spin_lock_irq(&current->sighand->siglock); 549 - sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 550 - if (!(ka->sa.sa_flags & SA_NODEFER)) 551 - sigaddset(&current->blocked,sig); 552 - recalc_sigpending(); 553 - spin_unlock_irq(&current->sighand->siglock); 554 - } 550 + if (ret == 0) 551 + block_sigmask(ka, sig); 555 552 556 553 return ret; 557 554 }
+10 -30
arch/sh/kernel/signal_64.c
··· 159 159 unsigned long r6, unsigned long r7, 160 160 struct pt_regs * regs) 161 161 { 162 - sigset_t saveset; 162 + sigset_t saveset, blocked; 163 + 164 + saveset = current->blocked; 163 165 164 166 mask &= _BLOCKABLE; 165 - spin_lock_irq(&current->sighand->siglock); 166 - saveset = current->blocked; 167 - siginitset(&current->blocked, mask); 168 - recalc_sigpending(); 169 - spin_unlock_irq(&current->sighand->siglock); 167 + siginitset(&blocked, mask); 168 + set_current_blocked(&blocked); 170 169 171 170 REF_REG_RET = -EINTR; 172 171 while (1) { ··· 197 198 if (copy_from_user(&newset, unewset, sizeof(newset))) 198 199 return -EFAULT; 199 200 sigdelsetmask(&newset, ~_BLOCKABLE); 200 - spin_lock_irq(&current->sighand->siglock); 201 201 saveset = current->blocked; 202 - current->blocked = newset; 203 - recalc_sigpending(); 204 - spin_unlock_irq(&current->sighand->siglock); 202 + set_current_blocked(&newset); 205 203 206 204 REF_REG_RET = -EINTR; 207 205 while (1) { ··· 404 408 goto badframe; 405 409 406 410 sigdelsetmask(&set, ~_BLOCKABLE); 407 - 408 - spin_lock_irq(&current->sighand->siglock); 409 - current->blocked = set; 410 - recalc_sigpending(); 411 - spin_unlock_irq(&current->sighand->siglock); 411 + set_current_blocked(&set); 412 412 413 413 if (restore_sigcontext(regs, &frame->sc, &ret)) 414 414 goto badframe; ··· 437 445 goto badframe; 438 446 439 447 sigdelsetmask(&set, ~_BLOCKABLE); 440 - spin_lock_irq(&current->sighand->siglock); 441 - current->blocked = set; 442 - recalc_sigpending(); 443 - spin_unlock_irq(&current->sighand->siglock); 448 + set_current_blocked(&set); 444 449 445 450 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ret)) 446 451 goto badframe; ··· 723 734 else 724 735 ret = setup_frame(sig, ka, oldset, regs); 725 736 726 - if (ka->sa.sa_flags & SA_ONESHOT) 727 - ka->sa.sa_handler = SIG_DFL; 728 - 729 - if (ret == 0) { 730 - spin_lock_irq(&current->sighand->siglock); 731 - sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 732 - if (!(ka->sa.sa_flags & SA_NODEFER)) 733 - sigaddset(&current->blocked,sig); 734 - recalc_sigpending(); 735 - spin_unlock_irq(&current->sighand->siglock); 736 - } 737 + if (ret == 0) 738 + block_sigmask(ka, sig); 737 739 738 740 return ret; 739 741 }
+4 -4
arch/sh/kernel/syscalls_32.S
··· 204 204 .long sys_capset /* 185 */ 205 205 .long sys_sigaltstack 206 206 .long sys_sendfile 207 - .long sys_ni_syscall /* streams1 */ 208 - .long sys_ni_syscall /* streams2 */ 207 + .long sys_ni_syscall /* getpmsg */ 208 + .long sys_ni_syscall /* putpmsg */ 209 209 .long sys_vfork /* 190 */ 210 210 .long sys_getrlimit 211 211 .long sys_mmap2 ··· 259 259 .long sys_futex /* 240 */ 260 260 .long sys_sched_setaffinity 261 261 .long sys_sched_getaffinity 262 - .long sys_ni_syscall 263 - .long sys_ni_syscall 262 + .long sys_ni_syscall /* reserved for set_thread_area */ 263 + .long sys_ni_syscall /* reserved for get_thread_area */ 264 264 .long sys_io_setup /* 245 */ 265 265 .long sys_io_destroy 266 266 .long sys_io_getevents
+4 -4
arch/sh/kernel/syscalls_64.S
··· 208 208 .long sys_capset /* 185 */ 209 209 .long sys_sigaltstack 210 210 .long sys_sendfile 211 - .long sys_ni_syscall /* streams1 */ 212 - .long sys_ni_syscall /* streams2 */ 211 + .long sys_ni_syscall /* getpmsg */ 212 + .long sys_ni_syscall /* putpmsg */ 213 213 .long sys_vfork /* 190 */ 214 214 .long sys_getrlimit 215 215 .long sys_mmap2 ··· 296 296 .long sys_futex 297 297 .long sys_sched_setaffinity 298 298 .long sys_sched_getaffinity /* 270 */ 299 - .long sys_ni_syscall 300 - .long sys_ni_syscall 299 + .long sys_ni_syscall /* reserved for set_thread_area */ 300 + .long sys_ni_syscall /* reserved for get_thread_area */ 301 301 .long sys_io_setup 302 302 .long sys_io_destroy 303 303 .long sys_io_getevents /* 275 */
+8 -29
drivers/sh/intc/chip.c
··· 2 2 * IRQ chip definitions for INTC IRQs. 3 3 * 4 4 * Copyright (C) 2007, 2008 Magnus Damm 5 - * Copyright (C) 2009, 2010 Paul Mundt 5 + * Copyright (C) 2009 - 2012 Paul Mundt 6 6 * 7 7 * This file is subject to the terms and conditions of the GNU General Public 8 8 * License. See the file "COPYING" in the main directory of this archive 9 9 * for more details. 10 10 */ 11 11 #include <linux/cpumask.h> 12 + #include <linux/bsearch.h> 12 13 #include <linux/io.h> 13 14 #include "internals.h" 14 15 ··· 59 58 } 60 59 } 61 60 62 - static int intc_set_wake(struct irq_data *data, unsigned int on) 63 - { 64 - return 0; /* allow wakeup, but setup hardware in intc_suspend() */ 65 - } 66 - 67 61 #ifdef CONFIG_SMP 68 62 /* 69 63 * This is held with the irq desc lock held, so we don't require any ··· 74 78 75 79 cpumask_copy(data->affinity, cpumask); 76 80 77 - return 0; 81 + return IRQ_SET_MASK_OK_NOCOPY; 78 82 } 79 83 #endif 80 84 ··· 118 122 unsigned int nr_hp, 119 123 unsigned int irq) 120 124 { 121 - int i; 125 + struct intc_handle_int key; 122 126 123 - /* 124 - * this doesn't scale well, but... 125 - * 126 - * this function should only be used for cerain uncommon 127 - * operations such as intc_set_priority() and intc_set_type() 128 - * and in those rare cases performance doesn't matter that much. 129 - * keeping the memory footprint low is more important. 130 - * 131 - * one rather simple way to speed this up and still keep the 132 - * memory footprint down is to make sure the array is sorted 133 - * and then perform a bisect to lookup the irq. 134 - */ 135 - for (i = 0; i < nr_hp; i++) { 136 - if ((hp + i)->irq != irq) 137 - continue; 127 + key.irq = irq; 128 + key.handle = 0; 138 129 139 - return hp + i; 140 - } 141 - 142 - return NULL; 130 + return bsearch(&key, hp, nr_hp, sizeof(*hp), intc_handle_int_cmp); 143 131 } 144 132 145 133 int intc_set_priority(unsigned int irq, unsigned int prio) ··· 203 223 .irq_mask_ack = intc_mask_ack, 204 224 .irq_enable = intc_enable, 205 225 .irq_disable = intc_disable, 206 - .irq_shutdown = intc_disable, 207 226 .irq_set_type = intc_set_type, 208 - .irq_set_wake = intc_set_wake, 209 227 #ifdef CONFIG_SMP 210 228 .irq_set_affinity = intc_set_affinity, 211 229 #endif 230 + .flags = IRQCHIP_SKIP_SET_WAKE, 212 231 };
+9 -2
drivers/sh/intc/core.c
··· 2 2 * Shared interrupt handling code for IPR and INTC2 types of IRQs. 3 3 * 4 4 * Copyright (C) 2007, 2008 Magnus Damm 5 - * Copyright (C) 2009, 2010 Paul Mundt 5 + * Copyright (C) 2009 - 2012 Paul Mundt 6 6 * 7 7 * Based on intc2.c and ipr.c 8 8 * ··· 31 31 #include <linux/spinlock.h> 32 32 #include <linux/radix-tree.h> 33 33 #include <linux/export.h> 34 + #include <linux/sort.h> 34 35 #include "internals.h" 35 36 36 37 LIST_HEAD(intc_list); 37 38 DEFINE_RAW_SPINLOCK(intc_big_lock); 38 - unsigned int nr_intc_controllers; 39 + static unsigned int nr_intc_controllers; 39 40 40 41 /* 41 42 * Default priority level ··· 268 267 k += save_reg(d, k, hw->prio_regs[i].set_reg, smp); 269 268 k += save_reg(d, k, hw->prio_regs[i].clr_reg, smp); 270 269 } 270 + 271 + sort(d->prio, hw->nr_prio_regs, sizeof(*d->prio), 272 + intc_handle_int_cmp, NULL); 271 273 } 272 274 273 275 if (hw->sense_regs) { ··· 281 277 282 278 for (i = 0; i < hw->nr_sense_regs; i++) 283 279 k += save_reg(d, k, hw->sense_regs[i].reg, 0); 280 + 281 + sort(d->sense, hw->nr_sense_regs, sizeof(*d->sense), 282 + intc_handle_int_cmp, NULL); 284 283 } 285 284 286 285 if (hw->subgroups)
+2 -3
drivers/sh/intc/handle.c
··· 172 172 return 0; 173 173 } 174 174 175 - static unsigned int __init intc_ack_data(struct intc_desc *desc, 176 - struct intc_desc_int *d, 177 - intc_enum enum_id) 175 + static unsigned int intc_ack_data(struct intc_desc *desc, 176 + struct intc_desc_int *d, intc_enum enum_id) 178 177 { 179 178 struct intc_mask_reg *mr = desc->hw.ack_regs; 180 179 unsigned int i, j, fn, mode;
+8 -1
drivers/sh/intc/internals.h
··· 108 108 #endif 109 109 } 110 110 111 + static inline int intc_handle_int_cmp(const void *a, const void *b) 112 + { 113 + const struct intc_handle_int *_a = a; 114 + const struct intc_handle_int *_b = b; 115 + 116 + return _a->irq - _b->irq; 117 + } 118 + 111 119 /* access.c */ 112 120 extern unsigned long 113 121 (*intc_reg_fns[])(unsigned long addr, unsigned long h, unsigned long data); ··· 165 157 /* core.c */ 166 158 extern struct list_head intc_list; 167 159 extern raw_spinlock_t intc_big_lock; 168 - extern unsigned int nr_intc_controllers; 169 160 extern struct bus_type intc_subsys; 170 161 171 162 unsigned int intc_get_dfl_prio_level(void);
+10 -5
drivers/tty/serial/sh-sci.c
··· 1229 1229 port->icount.tx += sg_dma_len(&s->sg_tx); 1230 1230 1231 1231 async_tx_ack(s->desc_tx); 1232 - s->cookie_tx = -EINVAL; 1233 1232 s->desc_tx = NULL; 1234 1233 1235 1234 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 1236 1235 uart_write_wakeup(port); 1237 1236 1238 1237 if (!uart_circ_empty(xmit)) { 1238 + s->cookie_tx = 0; 1239 1239 schedule_work(&s->work_tx); 1240 - } else if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { 1241 - u16 ctrl = sci_in(port, SCSCR); 1242 - sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); 1240 + } else { 1241 + s->cookie_tx = -EINVAL; 1242 + if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { 1243 + u16 ctrl = sci_in(port, SCSCR); 1244 + sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); 1245 + } 1243 1246 } 1244 1247 1245 1248 spin_unlock_irqrestore(&port->lock, flags); ··· 1504 1501 } 1505 1502 1506 1503 if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && 1507 - s->cookie_tx < 0) 1504 + s->cookie_tx < 0) { 1505 + s->cookie_tx = 0; 1508 1506 schedule_work(&s->work_tx); 1507 + } 1509 1508 #endif 1510 1509 1511 1510 if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) {