Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: clkfwk: Build fix for non-legacy CPG changes.
sh: Use GCC __builtin_prefetch() to implement prefetch().
sh: fix vsyscall compilation due to .eh_frame issue
sh: avoid to flush all cache in sys_cacheflush
sh: clkfwk: Disable init clk op for non-legacy clocks.
sh: clkfwk: Kill off now unused algo_id in set_rate op.
sh: clkfwk: Kill off unused clk_set_rate_ex().

+22 -90
-4
Documentation/DocBook/sh.tmpl
··· 79 79 </sect2> 80 80 </sect1> 81 81 </chapter> 82 - <chapter id="clk"> 83 - <title>Clock Framework Extensions</title> 84 - !Iinclude/linux/sh_clk.h 85 - </chapter> 86 82 <chapter id="mach"> 87 83 <title>Machine Specific Interfaces</title> 88 84 <sect1 id="dreamcast">
-32
Documentation/sh/clk.txt
··· 1 - Clock framework on SuperH architecture 2 - 3 - The framework on SH extends existing API by the function clk_set_rate_ex, 4 - which prototype is as follows: 5 - 6 - clk_set_rate_ex (struct clk *clk, unsigned long rate, int algo_id) 7 - 8 - The algo_id parameter is used to specify algorithm used to recalculate clocks, 9 - adjanced to clock, specified as first argument. It is assumed that algo_id==0 10 - means no changes to adjanced clock 11 - 12 - Internally, the clk_set_rate_ex forwards request to clk->ops->set_rate method, 13 - if it is present in ops structure. The method should set the clock rate and adjust 14 - all needed clocks according to the passed algo_id. 15 - Exact values for algo_id are machine-dependent. For the sh7722, the following 16 - values are defined: 17 - 18 - NO_CHANGE = 0, 19 - IUS_N1_N1, /* I:U = N:1, U:Sh = N:1 */ 20 - IUS_322, /* I:U:Sh = 3:2:2 */ 21 - IUS_522, /* I:U:Sh = 5:2:2 */ 22 - IUS_N11, /* I:U:Sh = N:1:1 */ 23 - SB_N1, /* Sh:B = N:1 */ 24 - SB3_N1, /* Sh:B3 = N:1 */ 25 - SB3_32, /* Sh:B3 = 3:2 */ 26 - SB3_43, /* Sh:B3 = 4:3 */ 27 - SB3_54, /* Sh:B3 = 5:4 */ 28 - BP_N1, /* B:P = N:1 */ 29 - IP_N1 /* I:P = N:1 */ 30 - 31 - Each of these constants means relation between clocks that can be set via the FRQCR 32 - register
+2 -4
arch/arm/mach-shmobile/clock-sh7372.c
··· 220 220 __raw_writel(__raw_readl(PLLC2CR) & ~0x80000000, PLLC2CR); 221 221 } 222 222 223 - static int pllc2_set_rate(struct clk *clk, 224 - unsigned long rate, int algo_id) 223 + static int pllc2_set_rate(struct clk *clk, unsigned long rate) 225 224 { 226 225 unsigned long value; 227 226 int idx; ··· 462 463 return 0; 463 464 } 464 465 465 - static int fsidiv_set_rate(struct clk *clk, 466 - unsigned long rate, int algo_id) 466 + static int fsidiv_set_rate(struct clk *clk, unsigned long rate) 467 467 { 468 468 int idx; 469 469
+5 -2
arch/sh/include/asm/processor_32.h
··· 199 199 #define ARCH_HAS_PREFETCHW 200 200 static inline void prefetch(void *x) 201 201 { 202 - __asm__ __volatile__ ("pref @%0\n\t" : : "r" (x) : "memory"); 202 + __builtin_prefetch(x, 0, 3); 203 203 } 204 204 205 - #define prefetchw(x) prefetch(x) 205 + static inline void prefetchw(void *x) 206 + { 207 + __builtin_prefetch(x, 1, 3); 208 + } 206 209 #endif 207 210 208 211 #endif /* __KERNEL__ */
+1 -1
arch/sh/kernel/cpu/sh4/clock-sh4-202.c
··· 110 110 return 0; 111 111 } 112 112 113 - static int shoc_clk_set_rate(struct clk *clk, unsigned long rate, int algo_id) 113 + static int shoc_clk_set_rate(struct clk *clk, unsigned long rate) 114 114 { 115 115 unsigned long frqcr3; 116 116 unsigned int tmp;
+1 -1
arch/sh/kernel/sys_sh.c
··· 88 88 } 89 89 90 90 if (op & CACHEFLUSH_I) 91 - flush_cache_all(); 91 + flush_icache_range(addr, addr+len); 92 92 93 93 up_read(&current->mm->mmap_sem); 94 94 return 0;
+1 -1
arch/sh/kernel/vsyscall/vsyscall-trapa.S
··· 8 8 * fill out .eh_frame -- PFM. */ 9 9 .LEND_vsyscall: 10 10 .size __kernel_vsyscall,.-.LSTART_vsyscall 11 - .previous 12 11 13 12 .section .eh_frame,"a",@progbits 13 + .previous 14 14 .LCIE: 15 15 .ualong .LCIE_end - .LCIE_start 16 16 .LCIE_start:
+6 -10
drivers/sh/clk/core.c
··· 418 418 list_add(&clk->sibling, &root_clks); 419 419 420 420 list_add(&clk->node, &clock_list); 421 + 422 + #ifdef CONFIG_SH_CLK_CPG_LEGACY 421 423 if (clk->ops && clk->ops->init) 422 424 clk->ops->init(clk); 425 + #endif 423 426 424 427 out_unlock: 425 428 mutex_unlock(&clock_list_sem); ··· 458 455 459 456 int clk_set_rate(struct clk *clk, unsigned long rate) 460 457 { 461 - return clk_set_rate_ex(clk, rate, 0); 462 - } 463 - EXPORT_SYMBOL_GPL(clk_set_rate); 464 - 465 - int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) 466 - { 467 458 int ret = -EOPNOTSUPP; 468 459 unsigned long flags; 469 460 470 461 spin_lock_irqsave(&clock_lock, flags); 471 462 472 463 if (likely(clk->ops && clk->ops->set_rate)) { 473 - ret = clk->ops->set_rate(clk, rate, algo_id); 464 + ret = clk->ops->set_rate(clk, rate); 474 465 if (ret != 0) 475 466 goto out_unlock; 476 467 } else { ··· 482 485 483 486 return ret; 484 487 } 485 - EXPORT_SYMBOL_GPL(clk_set_rate_ex); 488 + EXPORT_SYMBOL_GPL(clk_set_rate); 486 489 487 490 int clk_set_parent(struct clk *clk, struct clk *parent) 488 491 { ··· 650 653 clkp->ops->set_parent(clkp, 651 654 clkp->parent); 652 655 if (likely(clkp->ops->set_rate)) 653 - clkp->ops->set_rate(clkp, 654 - rate, NO_CHANGE); 656 + clkp->ops->set_rate(clkp, rate); 655 657 else if (likely(clkp->ops->recalc)) 656 658 clkp->rate = clkp->ops->recalc(clkp); 657 659 }
+3 -4
drivers/sh/clk/cpg.c
··· 110 110 return 0; 111 111 } 112 112 113 - static int sh_clk_div6_set_rate(struct clk *clk, 114 - unsigned long rate, int algo_id) 113 + static int sh_clk_div6_set_rate(struct clk *clk, unsigned long rate) 115 114 { 116 115 unsigned long value; 117 116 int idx; ··· 131 132 unsigned long value; 132 133 int ret; 133 134 134 - ret = sh_clk_div6_set_rate(clk, clk->rate, 0); 135 + ret = sh_clk_div6_set_rate(clk, clk->rate); 135 136 if (ret == 0) { 136 137 value = __raw_readl(clk->enable_reg); 137 138 value &= ~0x100; /* clear stop bit to enable clock */ ··· 252 253 return 0; 253 254 } 254 255 255 - static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate, int algo_id) 256 + static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate) 256 257 { 257 258 struct clk_div4_table *d4t = clk->priv; 258 259 unsigned long value;
+3 -31
include/linux/sh_clk.h
··· 19 19 }; 20 20 21 21 struct clk_ops { 22 + #ifdef CONFIG_SH_CLK_CPG_LEGACY 22 23 void (*init)(struct clk *clk); 24 + #endif 23 25 int (*enable)(struct clk *clk); 24 26 void (*disable)(struct clk *clk); 25 27 unsigned long (*recalc)(struct clk *clk); 26 - int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); 28 + int (*set_rate)(struct clk *clk, unsigned long rate); 27 29 int (*set_parent)(struct clk *clk, struct clk *parent); 28 30 long (*round_rate)(struct clk *clk, unsigned long rate); 29 31 }; ··· 68 66 int clk_register(struct clk *); 69 67 void clk_unregister(struct clk *); 70 68 void clk_enable_init_clocks(void); 71 - 72 - /** 73 - * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter 74 - * @clk: clock source 75 - * @rate: desired clock rate in Hz 76 - * @algo_id: algorithm id to be passed down to ops->set_rate 77 - * 78 - * Returns success (0) or negative errno. 79 - */ 80 - int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id); 81 - 82 - enum clk_sh_algo_id { 83 - NO_CHANGE = 0, 84 - 85 - IUS_N1_N1, 86 - IUS_322, 87 - IUS_522, 88 - IUS_N11, 89 - 90 - SB_N1, 91 - 92 - SB3_N1, 93 - SB3_32, 94 - SB3_43, 95 - SB3_54, 96 - 97 - BP_N1, 98 - 99 - IP_N1, 100 - }; 101 69 102 70 struct clk_div_mult_table { 103 71 unsigned int *divisors;