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: se/7724: Remove FSI/B of GPIO init code
sh: se/7724: Update clock framework of FSI clock to non-legacy
sh: Assume new page cache pages have dirty dcache lines.
sh: boards: mach-se: use IS_ERR() instead of NULL check
sh: Add div6_reparent_clks to clock framework for FSI
dma: shdma: add a MODULE_ALIAS() to allow module autoloading

+66 -87
+4 -30
arch/sh/boards/mach-ecovec24/setup.c
··· 720 720 }; 721 721 722 722 /* FSI */ 723 - /* 724 - * FSI-B use external clock which came from da7210. 725 - * So, we should change parent of fsi 726 - */ 727 - #define FCLKBCR 0xa415000c 728 - static void fsimck_init(struct clk *clk) 729 - { 730 - u32 status = __raw_readl(clk->enable_reg); 731 - 732 - /* use external clock */ 733 - status &= ~0x000000ff; 734 - status |= 0x00000080; 735 - 736 - __raw_writel(status, clk->enable_reg); 737 - } 738 - 739 - static struct clk_ops fsimck_clk_ops = { 740 - .init = fsimck_init, 741 - }; 742 - 743 - static struct clk fsimckb_clk = { 744 - .ops = &fsimck_clk_ops, 745 - .enable_reg = (void __iomem *)FCLKBCR, 746 - .rate = 0, /* unknown */ 747 - }; 748 - 749 723 static struct sh_fsi_platform_info fsi_info = { 750 724 .portb_flags = SH_FSI_BRS_INV | 751 725 SH_FSI_OUT_SLAVE_MODE | ··· 1238 1264 /* change parent of FSI B */ 1239 1265 clk = clk_get(NULL, "fsib_clk"); 1240 1266 if (!IS_ERR(clk)) { 1241 - clk_register(&fsimckb_clk); 1242 - clk_set_parent(clk, &fsimckb_clk); 1243 - clk_set_rate(clk, 11000); 1244 - clk_set_rate(&fsimckb_clk, 11000); 1267 + /* 48kHz dummy clock was used to make sure 1/1 divide */ 1268 + clk_set_rate(&sh7724_fsimckb_clk, 48000); 1269 + clk_set_parent(clk, &sh7724_fsimckb_clk); 1270 + clk_set_rate(clk, 48000); 1245 1271 clk_put(clk); 1246 1272 } 1247 1273
+7 -40
arch/sh/boards/mach-se/7724/setup.c
··· 283 283 }; 284 284 285 285 /* FSI */ 286 - /* 287 - * FSI-A use external clock which came from ak464x. 288 - * So, we should change parent of fsi 289 - */ 290 - #define FCLKACR 0xa4150008 291 - static void fsimck_init(struct clk *clk) 292 - { 293 - u32 status = __raw_readl(clk->enable_reg); 294 - 295 - /* use external clock */ 296 - status &= ~0x000000ff; 297 - status |= 0x00000080; 298 - __raw_writel(status, clk->enable_reg); 299 - } 300 - 301 - static struct clk_ops fsimck_clk_ops = { 302 - .init = fsimck_init, 303 - }; 304 - 305 - static struct clk fsimcka_clk = { 306 - .ops = &fsimck_clk_ops, 307 - .enable_reg = (void __iomem *)FCLKACR, 308 - .rate = 0, /* unknown */ 309 - }; 310 - 311 286 /* change J20, J21, J22 pin to 1-2 connection to use slave mode */ 312 287 static struct sh_fsi_platform_info fsi_info = { 313 288 .porta_flags = SH_FSI_BRS_INV | ··· 827 852 gpio_request(GPIO_FN_KEYOUT0, NULL); 828 853 829 854 /* enable FSI */ 830 - gpio_request(GPIO_FN_FSIMCKB, NULL); 831 855 gpio_request(GPIO_FN_FSIMCKA, NULL); 856 + gpio_request(GPIO_FN_FSIIASD, NULL); 832 857 gpio_request(GPIO_FN_FSIOASD, NULL); 833 858 gpio_request(GPIO_FN_FSIIABCK, NULL); 834 859 gpio_request(GPIO_FN_FSIIALRCK, NULL); 835 860 gpio_request(GPIO_FN_FSIOABCK, NULL); 836 861 gpio_request(GPIO_FN_FSIOALRCK, NULL); 837 862 gpio_request(GPIO_FN_CLKAUDIOAO, NULL); 838 - gpio_request(GPIO_FN_FSIIBSD, NULL); 839 - gpio_request(GPIO_FN_FSIOBSD, NULL); 840 - gpio_request(GPIO_FN_FSIIBBCK, NULL); 841 - gpio_request(GPIO_FN_FSIIBLRCK, NULL); 842 - gpio_request(GPIO_FN_FSIOBBCK, NULL); 843 - gpio_request(GPIO_FN_FSIOBLRCK, NULL); 844 - gpio_request(GPIO_FN_CLKAUDIOBO, NULL); 845 - gpio_request(GPIO_FN_FSIIASD, NULL); 846 863 847 864 /* set SPU2 clock to 83.4 MHz */ 848 865 clk = clk_get(NULL, "spu_clk"); 849 - if (clk) { 866 + if (!IS_ERR(clk)) { 850 867 clk_set_rate(clk, clk_round_rate(clk, 83333333)); 851 868 clk_put(clk); 852 869 } 853 870 854 871 /* change parent of FSI A */ 855 872 clk = clk_get(NULL, "fsia_clk"); 856 - if (clk) { 857 - clk_register(&fsimcka_clk); 858 - clk_set_parent(clk, &fsimcka_clk); 859 - clk_set_rate(clk, 11000); 860 - clk_set_rate(&fsimcka_clk, 11000); 873 + if (!IS_ERR(clk)) { 874 + /* 48kHz dummy clock was used to make sure 1/1 divide */ 875 + clk_set_rate(&sh7724_fsimcka_clk, 48000); 876 + clk_set_parent(clk, &sh7724_fsimcka_clk); 877 + clk_set_rate(clk, 48000); 861 878 clk_put(clk); 862 879 } 863 880
+1 -1
arch/sh/include/asm/cacheflush.h
··· 96 96 void *kmap_coherent(struct page *page, unsigned long addr); 97 97 void kunmap_coherent(void *kvaddr); 98 98 99 - #define PG_dcache_dirty PG_arch_1 99 + #define PG_dcache_clean PG_arch_1 100 100 101 101 void cpu_cache_init(void); 102 102
+3
arch/sh/include/cpu-sh4/cpu/sh7724.h
··· 303 303 SHDMA_SLAVE_SDHI1_RX, 304 304 }; 305 305 306 + extern struct clk sh7724_fsimcka_clk; 307 + extern struct clk sh7724_fsimckb_clk; 308 + 306 309 #endif /* __ASM_SH7724_H__ */
+39 -5
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
··· 111 111 .parent = &pll_clk, 112 112 }; 113 113 114 + /* External input clock (pin name: FSIMCKA/FSIMCKB ) */ 115 + struct clk sh7724_fsimcka_clk = { 116 + }; 117 + 118 + struct clk sh7724_fsimckb_clk = { 119 + }; 120 + 114 121 static struct clk *main_clks[] = { 115 122 &r_clk, 116 123 &extal_clk, 117 124 &fll_clk, 118 125 &pll_clk, 119 126 &div3_clk, 127 + &sh7724_fsimcka_clk, 128 + &sh7724_fsimckb_clk, 120 129 }; 121 130 122 131 static void div4_kick(struct clk *clk) ··· 163 154 [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), 164 155 }; 165 156 166 - enum { DIV6_V, DIV6_FA, DIV6_FB, DIV6_I, DIV6_S, DIV6_NR }; 157 + enum { DIV6_V, DIV6_I, DIV6_S, DIV6_NR }; 167 158 168 159 static struct clk div6_clks[DIV6_NR] = { 169 160 [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), 170 - [DIV6_FA] = SH_CLK_DIV6(&div3_clk, FCLKACR, 0), 171 - [DIV6_FB] = SH_CLK_DIV6(&div3_clk, FCLKBCR, 0), 172 161 [DIV6_I] = SH_CLK_DIV6(&div3_clk, IRDACLKCR, 0), 173 162 [DIV6_S] = SH_CLK_DIV6(&div3_clk, SPUCLKCR, CLK_ENABLE_ON_INIT), 163 + }; 164 + 165 + enum { DIV6_FA, DIV6_FB, DIV6_REPARENT_NR }; 166 + 167 + /* Indices are important - they are the actual src selecting values */ 168 + static struct clk *fclkacr_parent[] = { 169 + [0] = &div3_clk, 170 + [1] = NULL, 171 + [2] = &sh7724_fsimcka_clk, 172 + [3] = NULL, 173 + }; 174 + 175 + static struct clk *fclkbcr_parent[] = { 176 + [0] = &div3_clk, 177 + [1] = NULL, 178 + [2] = &sh7724_fsimckb_clk, 179 + [3] = NULL, 180 + }; 181 + 182 + static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { 183 + [DIV6_FA] = SH_CLK_DIV6_EXT(&div3_clk, FCLKACR, 0, 184 + fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2), 185 + [DIV6_FB] = SH_CLK_DIV6_EXT(&div3_clk, FCLKBCR, 0, 186 + fclkbcr_parent, ARRAY_SIZE(fclkbcr_parent), 6, 2), 174 187 }; 175 188 176 189 static struct clk mstp_clks[HWBLK_NR] = { ··· 271 240 272 241 /* DIV6 clocks */ 273 242 CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), 274 - CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]), 275 - CLKDEV_CON_ID("fsib_clk", &div6_clks[DIV6_FB]), 243 + CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FA]), 244 + CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FB]), 276 245 CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), 277 246 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), 278 247 ··· 405 374 406 375 if (!ret) 407 376 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 377 + 378 + if (!ret) 379 + ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR); 408 380 409 381 if (!ret) 410 382 ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR);
+2 -2
arch/sh/mm/cache-sh4.c
··· 114 114 struct address_space *mapping = page_mapping(page); 115 115 116 116 if (mapping && !mapping_mapped(mapping)) 117 - set_bit(PG_dcache_dirty, &page->flags); 117 + clear_bit(PG_dcache_clean, &page->flags); 118 118 else 119 119 #endif 120 120 flush_cache_one(CACHE_OC_ADDRESS_ARRAY | ··· 239 239 * another ASID than the current one. 240 240 */ 241 241 map_coherent = (current_cpu_data.dcache.n_aliases && 242 - !test_bit(PG_dcache_dirty, &page->flags) && 242 + test_bit(PG_dcache_clean, &page->flags) && 243 243 page_mapped(page)); 244 244 if (map_coherent) 245 245 vaddr = kmap_coherent(page, address);
+1 -1
arch/sh/mm/cache-sh7705.c
··· 139 139 struct address_space *mapping = page_mapping(page); 140 140 141 141 if (mapping && !mapping_mapped(mapping)) 142 - set_bit(PG_dcache_dirty, &page->flags); 142 + clear_bit(PG_dcache_clean, &page->flags); 143 143 else 144 144 __flush_dcache_page(__pa(page_address(page))); 145 145 }
+7 -7
arch/sh/mm/cache.c
··· 60 60 unsigned long len) 61 61 { 62 62 if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && 63 - !test_bit(PG_dcache_dirty, &page->flags)) { 63 + test_bit(PG_dcache_clean, &page->flags)) { 64 64 void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); 65 65 memcpy(vto, src, len); 66 66 kunmap_coherent(vto); 67 67 } else { 68 68 memcpy(dst, src, len); 69 69 if (boot_cpu_data.dcache.n_aliases) 70 - set_bit(PG_dcache_dirty, &page->flags); 70 + clear_bit(PG_dcache_clean, &page->flags); 71 71 } 72 72 73 73 if (vma->vm_flags & VM_EXEC) ··· 79 79 unsigned long len) 80 80 { 81 81 if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && 82 - !test_bit(PG_dcache_dirty, &page->flags)) { 82 + test_bit(PG_dcache_clean, &page->flags)) { 83 83 void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); 84 84 memcpy(dst, vfrom, len); 85 85 kunmap_coherent(vfrom); 86 86 } else { 87 87 memcpy(dst, src, len); 88 88 if (boot_cpu_data.dcache.n_aliases) 89 - set_bit(PG_dcache_dirty, &page->flags); 89 + clear_bit(PG_dcache_clean, &page->flags); 90 90 } 91 91 } 92 92 ··· 98 98 vto = kmap_atomic(to, KM_USER1); 99 99 100 100 if (boot_cpu_data.dcache.n_aliases && page_mapped(from) && 101 - !test_bit(PG_dcache_dirty, &from->flags)) { 101 + test_bit(PG_dcache_clean, &from->flags)) { 102 102 vfrom = kmap_coherent(from, vaddr); 103 103 copy_page(vto, vfrom); 104 104 kunmap_coherent(vfrom); ··· 141 141 142 142 page = pfn_to_page(pfn); 143 143 if (pfn_valid(pfn)) { 144 - int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); 144 + int dirty = !test_and_set_bit(PG_dcache_clean, &page->flags); 145 145 if (dirty) 146 146 __flush_purge_region(page_address(page), PAGE_SIZE); 147 147 } ··· 153 153 154 154 if (pages_do_alias(addr, vmaddr)) { 155 155 if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && 156 - !test_bit(PG_dcache_dirty, &page->flags)) { 156 + test_bit(PG_dcache_clean, &page->flags)) { 157 157 void *kaddr; 158 158 159 159 kaddr = kmap_coherent(page, vmaddr);
+1 -1
arch/sh/mm/kmap.c
··· 34 34 enum fixed_addresses idx; 35 35 unsigned long vaddr; 36 36 37 - BUG_ON(test_bit(PG_dcache_dirty, &page->flags)); 37 + BUG_ON(!test_bit(PG_dcache_clean, &page->flags)); 38 38 39 39 pagefault_disable(); 40 40
+1
drivers/dma/shdma.c
··· 1213 1213 MODULE_AUTHOR("Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>"); 1214 1214 MODULE_DESCRIPTION("Renesas SH DMA Engine driver"); 1215 1215 MODULE_LICENSE("GPL"); 1216 + MODULE_ALIAS("platform:sh-dma-engine");