aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-03 18:53:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-03 18:53:23 -0400
commitcd4ecf877a4d629c38571405fd649077c12dec50 (patch)
treeac0c5a72b503e1debbc06a10682f4a551bc304ac /arch
parent1f3bd0f2ac870c9eb29590f193ee3d94e2d35514 (diff)
parent816af7422f5bdbb74a0c9bb09735a9aeb9522c30 (diff)
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
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c56
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c78
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c7
3 files changed, 141 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 08acb6ec8139..f6b687f61c28 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -249,6 +249,29 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
249{ 249{
250 return !gpio_get_value(GPIO_PORT41); 250 return !gpio_get_value(GPIO_PORT41);
251} 251}
252/* MERAM */
253static struct sh_mobile_meram_info meram_info = {
254 .addr_mode = SH_MOBILE_MERAM_MODE1,
255};
256
257static struct resource meram_resources[] = {
258 [0] = {
259 .name = "MERAM",
260 .start = 0xe8000000,
261 .end = 0xe81fffff,
262 .flags = IORESOURCE_MEM,
263 },
264};
265
266static 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/* SH_MMCIF */ 276/* SH_MMCIF */
254static struct resource sh_mmcif_resources[] = { 277static struct resource sh_mmcif_resources[] = {
@@ -447,13 +470,29 @@ const static struct fb_videomode ap4evb_lcdc_modes[] = {
447#endif 470#endif
448 }, 471 },
449}; 472};
473static struct sh_mobile_meram_cfg lcd_meram_cfg = {
474 .icb[0] = {
475 .marker_icb = 28,
476 .cache_icb = 24,
477 .meram_offset = 0x0,
478 .meram_size = 0x40,
479 },
480 .icb[1] = {
481 .marker_icb = 29,
482 .cache_icb = 25,
483 .meram_offset = 0x40,
484 .meram_size = 0x40,
485 },
486};
450 487
451static struct sh_mobile_lcdc_info lcdc_info = { 488static struct sh_mobile_lcdc_info lcdc_info = {
489 .meram_dev = &meram_info,
452 .ch[0] = { 490 .ch[0] = {
453 .chan = LCDC_CHAN_MAINLCD, 491 .chan = LCDC_CHAN_MAINLCD,
454 .bpp = 16, 492 .bpp = 16,
455 .lcd_cfg = ap4evb_lcdc_modes, 493 .lcd_cfg = ap4evb_lcdc_modes,
456 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes), 494 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
495 .meram_cfg = &lcd_meram_cfg,
457 } 496 }
458}; 497};
459 498
@@ -724,15 +763,31 @@ static struct platform_device fsi_device = {
724static struct platform_device fsi_ak4643_device = { 763static struct platform_device fsi_ak4643_device = {
725 .name = "sh_fsi2_a_ak4643", 764 .name = "sh_fsi2_a_ak4643",
726}; 765};
766static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
767 .icb[0] = {
768 .marker_icb = 30,
769 .cache_icb = 26,
770 .meram_offset = 0x80,
771 .meram_size = 0x100,
772 },
773 .icb[1] = {
774 .marker_icb = 31,
775 .cache_icb = 27,
776 .meram_offset = 0x180,
777 .meram_size = 0x100,
778 },
779};
727 780
728static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = { 781static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
729 .clock_source = LCDC_CLK_EXTERNAL, 782 .clock_source = LCDC_CLK_EXTERNAL,
783 .meram_dev = &meram_info,
730 .ch[0] = { 784 .ch[0] = {
731 .chan = LCDC_CHAN_MAINLCD, 785 .chan = LCDC_CHAN_MAINLCD,
732 .bpp = 16, 786 .bpp = 16,
733 .interface_type = RGB24, 787 .interface_type = RGB24,
734 .clock_divider = 1, 788 .clock_divider = 1,
735 .flags = LCDC_FLAGS_DWPOL, 789 .flags = LCDC_FLAGS_DWPOL,
790 .meram_cfg = &hdmi_meram_cfg,
736 } 791 }
737}; 792};
738 793
@@ -961,6 +1016,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
961 &csi2_device, 1016 &csi2_device,
962 &ceu_device, 1017 &ceu_device,
963 &ap4evb_camera, 1018 &ap4evb_camera,
1019 &meram_device,
964}; 1020};
965 1021
966static void __init hdmi_init_pm_clock(void) 1022static void __init hdmi_init_pm_clock(void)
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 448ddbe43335..776f20560e72 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -39,6 +39,7 @@
39#include <linux/mtd/mtd.h> 39#include <linux/mtd/mtd.h>
40#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
41#include <linux/mtd/physmap.h> 41#include <linux/mtd/physmap.h>
42#include <linux/pm_runtime.h>
42#include <linux/smsc911x.h> 43#include <linux/smsc911x.h>
43#include <linux/sh_intc.h> 44#include <linux/sh_intc.h>
44#include <linux/tca6416_keypad.h> 45#include <linux/tca6416_keypad.h>
@@ -314,6 +315,30 @@ static struct platform_device smc911x_device = {
314 }, 315 },
315}; 316};
316 317
318/* MERAM */
319static struct sh_mobile_meram_info mackerel_meram_info = {
320 .addr_mode = SH_MOBILE_MERAM_MODE1,
321};
322
323static struct resource meram_resources[] = {
324 [0] = {
325 .name = "MERAM",
326 .start = 0xe8000000,
327 .end = 0xe81fffff,
328 .flags = IORESOURCE_MEM,
329 },
330};
331
332static struct platform_device meram_device = {
333 .name = "sh_mobile_meram",
334 .id = 0,
335 .num_resources = ARRAY_SIZE(meram_resources),
336 .resource = meram_resources,
337 .dev = {
338 .platform_data = &mackerel_meram_info,
339 },
340};
341
317/* LCDC */ 342/* LCDC */
318static struct fb_videomode mackerel_lcdc_modes[] = { 343static struct fb_videomode mackerel_lcdc_modes[] = {
319 { 344 {
@@ -342,7 +367,23 @@ static int mackerel_get_brightness(void *board_data)
342 return gpio_get_value(GPIO_PORT31); 367 return gpio_get_value(GPIO_PORT31);
343} 368}
344 369
370static struct sh_mobile_meram_cfg lcd_meram_cfg = {
371 .icb[0] = {
372 .marker_icb = 28,
373 .cache_icb = 24,
374 .meram_offset = 0x0,
375 .meram_size = 0x40,
376 },
377 .icb[1] = {
378 .marker_icb = 29,
379 .cache_icb = 25,
380 .meram_offset = 0x40,
381 .meram_size = 0x40,
382 },
383};
384
345static struct sh_mobile_lcdc_info lcdc_info = { 385static struct sh_mobile_lcdc_info lcdc_info = {
386 .meram_dev = &mackerel_meram_info,
346 .clock_source = LCDC_CLK_BUS, 387 .clock_source = LCDC_CLK_BUS,
347 .ch[0] = { 388 .ch[0] = {
348 .chan = LCDC_CHAN_MAINLCD, 389 .chan = LCDC_CHAN_MAINLCD,
@@ -362,6 +403,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
362 .name = "sh_mobile_lcdc_bl", 403 .name = "sh_mobile_lcdc_bl",
363 .max_brightness = 1, 404 .max_brightness = 1,
364 }, 405 },
406 .meram_cfg = &lcd_meram_cfg,
365 } 407 }
366}; 408};
367 409
@@ -388,8 +430,23 @@ static struct platform_device lcdc_device = {
388 }, 430 },
389}; 431};
390 432
433static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
434 .icb[0] = {
435 .marker_icb = 30,
436 .cache_icb = 26,
437 .meram_offset = 0x80,
438 .meram_size = 0x100,
439 },
440 .icb[1] = {
441 .marker_icb = 31,
442 .cache_icb = 27,
443 .meram_offset = 0x180,
444 .meram_size = 0x100,
445 },
446};
391/* HDMI */ 447/* HDMI */
392static struct sh_mobile_lcdc_info hdmi_lcdc_info = { 448static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
449 .meram_dev = &mackerel_meram_info,
393 .clock_source = LCDC_CLK_EXTERNAL, 450 .clock_source = LCDC_CLK_EXTERNAL,
394 .ch[0] = { 451 .ch[0] = {
395 .chan = LCDC_CHAN_MAINLCD, 452 .chan = LCDC_CHAN_MAINLCD,
@@ -397,6 +454,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
397 .interface_type = RGB24, 454 .interface_type = RGB24,
398 .clock_divider = 1, 455 .clock_divider = 1,
399 .flags = LCDC_FLAGS_DWPOL, 456 .flags = LCDC_FLAGS_DWPOL,
457 .meram_cfg = &hdmi_meram_cfg,
400 } 458 }
401}; 459};
402 460
@@ -856,6 +914,17 @@ static int slot_cn7_get_cd(struct platform_device *pdev)
856} 914}
857 915
858/* SDHI0 */ 916/* SDHI0 */
917static irqreturn_t mackerel_sdhi0_gpio_cd(int irq, void *arg)
918{
919 struct device *dev = arg;
920 struct sh_mobile_sdhi_info *info = dev->platform_data;
921 struct tmio_mmc_data *pdata = info->pdata;
922
923 tmio_mmc_cd_wakeup(pdata);
924
925 return IRQ_HANDLED;
926}
927
859static struct sh_mobile_sdhi_info sdhi0_info = { 928static struct sh_mobile_sdhi_info sdhi0_info = {
860 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 929 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
861 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 930 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
@@ -1150,6 +1219,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
1150 &mackerel_camera, 1219 &mackerel_camera,
1151 &hdmi_lcdc_device, 1220 &hdmi_lcdc_device,
1152 &hdmi_device, 1221 &hdmi_device,
1222 &meram_device,
1153}; 1223};
1154 1224
1155/* Keypad Initialization */ 1225/* Keypad Initialization */
@@ -1238,6 +1308,7 @@ static void __init mackerel_init(void)
1238{ 1308{
1239 u32 srcr4; 1309 u32 srcr4;
1240 struct clk *clk; 1310 struct clk *clk;
1311 int ret;
1241 1312
1242 sh7372_pinmux_init(); 1313 sh7372_pinmux_init();
1243 1314
@@ -1343,6 +1414,13 @@ static void __init mackerel_init(void)
1343 gpio_request(GPIO_FN_SDHID0_1, NULL); 1414 gpio_request(GPIO_FN_SDHID0_1, NULL);
1344 gpio_request(GPIO_FN_SDHID0_0, NULL); 1415 gpio_request(GPIO_FN_SDHID0_0, NULL);
1345 1416
1417 ret = request_irq(evt2irq(0x3340), mackerel_sdhi0_gpio_cd,
1418 IRQF_TRIGGER_FALLING, "sdhi0 cd", &sdhi0_device.dev);
1419 if (!ret)
1420 sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD;
1421 else
1422 pr_err("Cannot get IRQ #%d: %d\n", evt2irq(0x3340), ret);
1423
1346#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1424#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1347 /* enable SDHI1 */ 1425 /* enable SDHI1 */
1348 gpio_request(GPIO_FN_SDHICMD1, NULL); 1426 gpio_request(GPIO_FN_SDHICMD1, NULL);
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index d17eb66f4ac2..c0800d83971e 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -509,6 +509,7 @@ enum { MSTP001,
509 MSTP118, MSTP117, MSTP116, MSTP113, 509 MSTP118, MSTP117, MSTP116, MSTP113,
510 MSTP106, MSTP101, MSTP100, 510 MSTP106, MSTP101, MSTP100,
511 MSTP223, 511 MSTP223,
512 MSTP218, MSTP217, MSTP216,
512 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 513 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
513 MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, 514 MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312,
514 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403, 515 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403,
@@ -534,6 +535,9 @@ static struct clk mstp_clks[MSTP_NR] = {
534 [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */ 535 [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */
535 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ 536 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
536 [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */ 537 [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */
538 [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */
539 [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */
540 [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */
537 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 541 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
538 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 542 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
539 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ 543 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
@@ -626,6 +630,9 @@ static struct clk_lookup lookups[] = {
626 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 630 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
627 CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */ 631 CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */
628 CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */ 632 CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */
633 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */
634 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */
635 CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */
629 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 636 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
630 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ 637 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */
631 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ 638 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */