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

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

* 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
ARM: mach-shmobile: add DMAC clock definitions on SH7372
ARM: arch-shmobile: support SDHI card detection on mackerel, using a GPIO
sh_mobile_meram: MERAM platform data for LCDC

+141
+56
arch/arm/mach-shmobile/board-ap4evb.c
··· 249 249 { 250 250 return !gpio_get_value(GPIO_PORT41); 251 251 } 252 + /* MERAM */ 253 + static struct sh_mobile_meram_info meram_info = { 254 + .addr_mode = SH_MOBILE_MERAM_MODE1, 255 + }; 256 + 257 + static struct resource meram_resources[] = { 258 + [0] = { 259 + .name = "MERAM", 260 + .start = 0xe8000000, 261 + .end = 0xe81fffff, 262 + .flags = IORESOURCE_MEM, 263 + }, 264 + }; 265 + 266 + static struct platform_device meram_device = { 267 + .name = "sh_mobile_meram", 268 + .id = 0, 269 + .num_resources = ARRAY_SIZE(meram_resources), 270 + .resource = meram_resources, 271 + .dev = { 272 + .platform_data = &meram_info, 273 + }, 274 + }; 252 275 253 276 /* SH_MMCIF */ 254 277 static struct resource sh_mmcif_resources[] = { ··· 470 447 #endif 471 448 }, 472 449 }; 450 + static struct sh_mobile_meram_cfg lcd_meram_cfg = { 451 + .icb[0] = { 452 + .marker_icb = 28, 453 + .cache_icb = 24, 454 + .meram_offset = 0x0, 455 + .meram_size = 0x40, 456 + }, 457 + .icb[1] = { 458 + .marker_icb = 29, 459 + .cache_icb = 25, 460 + .meram_offset = 0x40, 461 + .meram_size = 0x40, 462 + }, 463 + }; 473 464 474 465 static struct sh_mobile_lcdc_info lcdc_info = { 466 + .meram_dev = &meram_info, 475 467 .ch[0] = { 476 468 .chan = LCDC_CHAN_MAINLCD, 477 469 .bpp = 16, 478 470 .lcd_cfg = ap4evb_lcdc_modes, 479 471 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), 472 + .meram_cfg = &lcd_meram_cfg, 480 473 } 481 474 }; 482 475 ··· 763 724 static struct platform_device fsi_ak4643_device = { 764 725 .name = "sh_fsi2_a_ak4643", 765 726 }; 727 + static struct sh_mobile_meram_cfg hdmi_meram_cfg = { 728 + .icb[0] = { 729 + .marker_icb = 30, 730 + .cache_icb = 26, 731 + .meram_offset = 0x80, 732 + .meram_size = 0x100, 733 + }, 734 + .icb[1] = { 735 + .marker_icb = 31, 736 + .cache_icb = 27, 737 + .meram_offset = 0x180, 738 + .meram_size = 0x100, 739 + }, 740 + }; 766 741 767 742 static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { 768 743 .clock_source = LCDC_CLK_EXTERNAL, 744 + .meram_dev = &meram_info, 769 745 .ch[0] = { 770 746 .chan = LCDC_CHAN_MAINLCD, 771 747 .bpp = 16, 772 748 .interface_type = RGB24, 773 749 .clock_divider = 1, 774 750 .flags = LCDC_FLAGS_DWPOL, 751 + .meram_cfg = &hdmi_meram_cfg, 775 752 } 776 753 }; 777 754 ··· 1016 961 &csi2_device, 1017 962 &ceu_device, 1018 963 &ap4evb_camera, 964 + &meram_device, 1019 965 }; 1020 966 1021 967 static void __init hdmi_init_pm_clock(void)
+78
arch/arm/mach-shmobile/board-mackerel.c
··· 39 39 #include <linux/mtd/mtd.h> 40 40 #include <linux/mtd/partitions.h> 41 41 #include <linux/mtd/physmap.h> 42 + #include <linux/pm_runtime.h> 42 43 #include <linux/smsc911x.h> 43 44 #include <linux/sh_intc.h> 44 45 #include <linux/tca6416_keypad.h> ··· 315 314 }, 316 315 }; 317 316 317 + /* MERAM */ 318 + static struct sh_mobile_meram_info mackerel_meram_info = { 319 + .addr_mode = SH_MOBILE_MERAM_MODE1, 320 + }; 321 + 322 + static struct resource meram_resources[] = { 323 + [0] = { 324 + .name = "MERAM", 325 + .start = 0xe8000000, 326 + .end = 0xe81fffff, 327 + .flags = IORESOURCE_MEM, 328 + }, 329 + }; 330 + 331 + static struct platform_device meram_device = { 332 + .name = "sh_mobile_meram", 333 + .id = 0, 334 + .num_resources = ARRAY_SIZE(meram_resources), 335 + .resource = meram_resources, 336 + .dev = { 337 + .platform_data = &mackerel_meram_info, 338 + }, 339 + }; 340 + 318 341 /* LCDC */ 319 342 static struct fb_videomode mackerel_lcdc_modes[] = { 320 343 { ··· 367 342 return gpio_get_value(GPIO_PORT31); 368 343 } 369 344 345 + static struct sh_mobile_meram_cfg lcd_meram_cfg = { 346 + .icb[0] = { 347 + .marker_icb = 28, 348 + .cache_icb = 24, 349 + .meram_offset = 0x0, 350 + .meram_size = 0x40, 351 + }, 352 + .icb[1] = { 353 + .marker_icb = 29, 354 + .cache_icb = 25, 355 + .meram_offset = 0x40, 356 + .meram_size = 0x40, 357 + }, 358 + }; 359 + 370 360 static struct sh_mobile_lcdc_info lcdc_info = { 361 + .meram_dev = &mackerel_meram_info, 371 362 .clock_source = LCDC_CLK_BUS, 372 363 .ch[0] = { 373 364 .chan = LCDC_CHAN_MAINLCD, ··· 403 362 .name = "sh_mobile_lcdc_bl", 404 363 .max_brightness = 1, 405 364 }, 365 + .meram_cfg = &lcd_meram_cfg, 406 366 } 407 367 }; 408 368 ··· 430 388 }, 431 389 }; 432 390 391 + static struct sh_mobile_meram_cfg hdmi_meram_cfg = { 392 + .icb[0] = { 393 + .marker_icb = 30, 394 + .cache_icb = 26, 395 + .meram_offset = 0x80, 396 + .meram_size = 0x100, 397 + }, 398 + .icb[1] = { 399 + .marker_icb = 31, 400 + .cache_icb = 27, 401 + .meram_offset = 0x180, 402 + .meram_size = 0x100, 403 + }, 404 + }; 433 405 /* HDMI */ 434 406 static struct sh_mobile_lcdc_info hdmi_lcdc_info = { 407 + .meram_dev = &mackerel_meram_info, 435 408 .clock_source = LCDC_CLK_EXTERNAL, 436 409 .ch[0] = { 437 410 .chan = LCDC_CHAN_MAINLCD, ··· 454 397 .interface_type = RGB24, 455 398 .clock_divider = 1, 456 399 .flags = LCDC_FLAGS_DWPOL, 400 + .meram_cfg = &hdmi_meram_cfg, 457 401 } 458 402 }; 459 403 ··· 914 856 } 915 857 916 858 /* SDHI0 */ 859 + static irqreturn_t mackerel_sdhi0_gpio_cd(int irq, void *arg) 860 + { 861 + struct device *dev = arg; 862 + struct sh_mobile_sdhi_info *info = dev->platform_data; 863 + struct tmio_mmc_data *pdata = info->pdata; 864 + 865 + tmio_mmc_cd_wakeup(pdata); 866 + 867 + return IRQ_HANDLED; 868 + } 869 + 917 870 static struct sh_mobile_sdhi_info sdhi0_info = { 918 871 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 919 872 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, ··· 1219 1150 &mackerel_camera, 1220 1151 &hdmi_lcdc_device, 1221 1152 &hdmi_device, 1153 + &meram_device, 1222 1154 }; 1223 1155 1224 1156 /* Keypad Initialization */ ··· 1308 1238 { 1309 1239 u32 srcr4; 1310 1240 struct clk *clk; 1241 + int ret; 1311 1242 1312 1243 sh7372_pinmux_init(); 1313 1244 ··· 1413 1342 gpio_request(GPIO_FN_SDHID0_2, NULL); 1414 1343 gpio_request(GPIO_FN_SDHID0_1, NULL); 1415 1344 gpio_request(GPIO_FN_SDHID0_0, NULL); 1345 + 1346 + ret = request_irq(evt2irq(0x3340), mackerel_sdhi0_gpio_cd, 1347 + IRQF_TRIGGER_FALLING, "sdhi0 cd", &sdhi0_device.dev); 1348 + if (!ret) 1349 + sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD; 1350 + else 1351 + pr_err("Cannot get IRQ #%d: %d\n", evt2irq(0x3340), ret); 1416 1352 1417 1353 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1418 1354 /* enable SDHI1 */
+7
arch/arm/mach-shmobile/clock-sh7372.c
··· 509 509 MSTP118, MSTP117, MSTP116, MSTP113, 510 510 MSTP106, MSTP101, MSTP100, 511 511 MSTP223, 512 + MSTP218, MSTP217, MSTP216, 512 513 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 513 514 MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, 514 515 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403, ··· 535 534 [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */ 536 535 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ 537 536 [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */ 537 + [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ 538 + [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ 539 + [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ 538 540 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 539 541 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 540 542 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ ··· 630 626 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 631 627 CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */ 632 628 CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */ 629 + CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ 630 + CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ 631 + CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ 633 632 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 634 633 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ 635 634 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */