aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-shmobile/Kconfig2
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c2
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c372
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c2
4 files changed, 373 insertions, 5 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 285dbbd4ad2c..4d1b4c5c9389 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -86,8 +86,8 @@ config MEMORY_SIZE
86 hex "Physical memory size" 86 hex "Physical memory size"
87 default "0x08000000" if MACH_G3EVM 87 default "0x08000000" if MACH_G3EVM
88 default "0x08000000" if MACH_G4EVM 88 default "0x08000000" if MACH_G4EVM
89 default "0x10000000" if MACH_AP4EVB
90 default "0x20000000" if MACH_AG5EVM 89 default "0x20000000" if MACH_AG5EVM
90 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
91 default "0x04000000" 91 default "0x04000000"
92 help 92 help
93 This sets the default memory size assumed by your kernel. It can 93 This sets the default memory size assumed by your kernel. It can
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 5b079529c948..f59e93919e26 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1191,7 +1191,7 @@ static void __init ap4evb_init(void)
1191 gpio_request(GPIO_FN_OVCN2_1, NULL); 1191 gpio_request(GPIO_FN_OVCN2_1, NULL);
1192 1192
1193 /* setup USB phy */ 1193 /* setup USB phy */
1194 __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ 1194 __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */
1195 1195
1196 /* enable FSI2 port A (ak4643) */ 1196 /* enable FSI2 port A (ak4643) */
1197 gpio_request(GPIO_FN_FSIAIBT, NULL); 1197 gpio_request(GPIO_FN_FSIAIBT, NULL);
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 3e30a5250414..42f7c0d67b53 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -31,6 +31,10 @@
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/i2c.h> 32#include <linux/i2c.h>
33#include <linux/leds.h> 33#include <linux/leds.h>
34#include <linux/mfd/sh_mobile_sdhi.h>
35#include <linux/mfd/tmio.h>
36#include <linux/mmc/host.h>
37#include <linux/mmc/sh_mmcif.h>
34#include <linux/mtd/mtd.h> 38#include <linux/mtd/mtd.h>
35#include <linux/mtd/partitions.h> 39#include <linux/mtd/partitions.h>
36#include <linux/mtd/physmap.h> 40#include <linux/mtd/physmap.h>
@@ -40,7 +44,9 @@
40#include <linux/usb/r8a66597.h> 44#include <linux/usb/r8a66597.h>
41 45
42#include <video/sh_mobile_lcdc.h> 46#include <video/sh_mobile_lcdc.h>
43 47#include <media/sh_mobile_ceu.h>
48#include <media/soc_camera.h>
49#include <media/soc_camera_platform.h>
44#include <sound/sh_fsi.h> 50#include <sound/sh_fsi.h>
45 51
46#include <mach/common.h> 52#include <mach/common.h>
@@ -139,6 +145,42 @@
139 */ 145 */
140 146
141/* 147/*
148 * SDHI0 (CN12)
149 *
150 * SW56 : OFF
151 *
152 */
153
154/* MMC /SDHI1 (CN7)
155 *
156 * I/O voltage : 1.8v
157 *
158 * Power voltage : 1.8v or 3.3v
159 * J22 : select power voltage *1
160 * 1-2 pin : 1.8v
161 * 2-3 pin : 3.3v
162 *
163 * *1
164 * Please change J22 depends the card to be used.
165 * MMC's OCR field set to support either voltage for the card inserted.
166 *
167 * SW1 | SW33
168 * | bit1 | bit2 | bit3 | bit4
169 * -------------+------+------+------+-------
170 * MMC0 OFF | OFF | ON | ON | X
171 * MMC1 ON | OFF | ON | X | ON
172 * SDHI1 OFF | ON | X | OFF | ON
173 *
174 */
175
176/*
177 * SDHI2 (CN23)
178 *
179 * microSD card sloct
180 *
181 */
182
183/*
142 * FIXME !! 184 * FIXME !!
143 * 185 *
144 * gpio_no_direction 186 * gpio_no_direction
@@ -404,6 +446,262 @@ static struct platform_device fsi_ak4643_device = {
404 .name = "sh_fsi2_a_ak4643", 446 .name = "sh_fsi2_a_ak4643",
405}; 447};
406 448
449/*
450 * The card detect pin of the top SD/MMC slot (CN7) is active low and is
451 * connected to GPIO A22 of SH7372 (GPIO_PORT41).
452 */
453static int slot_cn7_get_cd(struct platform_device *pdev)
454{
455 if (gpio_is_valid(GPIO_PORT41))
456 return !gpio_get_value(GPIO_PORT41);
457 else
458 return -ENXIO;
459}
460
461/* SDHI0 */
462static struct sh_mobile_sdhi_info sdhi0_info = {
463 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
464 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
465 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
466};
467
468static struct resource sdhi0_resources[] = {
469 [0] = {
470 .name = "SDHI0",
471 .start = 0xe6850000,
472 .end = 0xe68501ff,
473 .flags = IORESOURCE_MEM,
474 },
475 [1] = {
476 .start = evt2irq(0x0e00) /* SDHI0 */,
477 .flags = IORESOURCE_IRQ,
478 },
479};
480
481static struct platform_device sdhi0_device = {
482 .name = "sh_mobile_sdhi",
483 .num_resources = ARRAY_SIZE(sdhi0_resources),
484 .resource = sdhi0_resources,
485 .id = 0,
486 .dev = {
487 .platform_data = &sdhi0_info,
488 },
489};
490
491#if !defined(CONFIG_MMC_SH_MMCIF)
492/* SDHI1 */
493static struct sh_mobile_sdhi_info sdhi1_info = {
494 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
495 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
496 .tmio_ocr_mask = MMC_VDD_165_195,
497 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
498 .tmio_caps = MMC_CAP_SD_HIGHSPEED |
499 MMC_CAP_NEEDS_POLL,
500 .get_cd = slot_cn7_get_cd,
501};
502
503static struct resource sdhi1_resources[] = {
504 [0] = {
505 .name = "SDHI1",
506 .start = 0xe6860000,
507 .end = 0xe68601ff,
508 .flags = IORESOURCE_MEM,
509 },
510 [1] = {
511 .start = evt2irq(0x0e80),
512 .flags = IORESOURCE_IRQ,
513 },
514};
515
516static struct platform_device sdhi1_device = {
517 .name = "sh_mobile_sdhi",
518 .num_resources = ARRAY_SIZE(sdhi1_resources),
519 .resource = sdhi1_resources,
520 .id = 1,
521 .dev = {
522 .platform_data = &sdhi1_info,
523 },
524};
525#endif
526
527/* SDHI2 */
528static struct sh_mobile_sdhi_info sdhi2_info = {
529 .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX,
530 .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX,
531 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
532 .tmio_caps = MMC_CAP_SD_HIGHSPEED |
533 MMC_CAP_NEEDS_POLL,
534};
535
536static struct resource sdhi2_resources[] = {
537 [0] = {
538 .name = "SDHI2",
539 .start = 0xe6870000,
540 .end = 0xe68701ff,
541 .flags = IORESOURCE_MEM,
542 },
543 [1] = {
544 .start = evt2irq(0x1200),
545 .flags = IORESOURCE_IRQ,
546 },
547};
548
549static struct platform_device sdhi2_device = {
550 .name = "sh_mobile_sdhi",
551 .num_resources = ARRAY_SIZE(sdhi2_resources),
552 .resource = sdhi2_resources,
553 .id = 2,
554 .dev = {
555 .platform_data = &sdhi2_info,
556 },
557};
558
559/* SH_MMCIF */
560static struct resource sh_mmcif_resources[] = {
561 [0] = {
562 .name = "MMCIF",
563 .start = 0xE6BD0000,
564 .end = 0xE6BD00FF,
565 .flags = IORESOURCE_MEM,
566 },
567 [1] = {
568 /* MMC ERR */
569 .start = evt2irq(0x1ac0),
570 .flags = IORESOURCE_IRQ,
571 },
572 [2] = {
573 /* MMC NOR */
574 .start = evt2irq(0x1ae0),
575 .flags = IORESOURCE_IRQ,
576 },
577};
578
579static struct sh_mmcif_plat_data sh_mmcif_plat = {
580 .sup_pclk = 0,
581 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
582 .caps = MMC_CAP_4_BIT_DATA |
583 MMC_CAP_8_BIT_DATA |
584 MMC_CAP_NEEDS_POLL,
585 .get_cd = slot_cn7_get_cd,
586};
587
588static struct platform_device sh_mmcif_device = {
589 .name = "sh_mmcif",
590 .id = 0,
591 .dev = {
592 .dma_mask = NULL,
593 .coherent_dma_mask = 0xffffffff,
594 .platform_data = &sh_mmcif_plat,
595 },
596 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
597 .resource = sh_mmcif_resources,
598};
599
600
601static int mackerel_camera_add(struct soc_camera_link *icl, struct device *dev);
602static void mackerel_camera_del(struct soc_camera_link *icl);
603
604static int camera_set_capture(struct soc_camera_platform_info *info,
605 int enable)
606{
607 return 0; /* camera sensor always enabled */
608}
609
610static struct soc_camera_platform_info camera_info = {
611 .format_name = "UYVY",
612 .format_depth = 16,
613 .format = {
614 .code = V4L2_MBUS_FMT_UYVY8_2X8,
615 .colorspace = V4L2_COLORSPACE_SMPTE170M,
616 .field = V4L2_FIELD_NONE,
617 .width = 640,
618 .height = 480,
619 },
620 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
621 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8 |
622 SOCAM_DATA_ACTIVE_HIGH,
623 .set_capture = camera_set_capture,
624};
625
626static struct soc_camera_link camera_link = {
627 .bus_id = 0,
628 .add_device = mackerel_camera_add,
629 .del_device = mackerel_camera_del,
630 .module_name = "soc_camera_platform",
631 .priv = &camera_info,
632};
633
634static void dummy_release(struct device *dev)
635{
636}
637
638static struct platform_device camera_device = {
639 .name = "soc_camera_platform",
640 .dev = {
641 .platform_data = &camera_info,
642 .release = dummy_release,
643 },
644};
645
646static int mackerel_camera_add(struct soc_camera_link *icl,
647 struct device *dev)
648{
649 if (icl != &camera_link)
650 return -ENODEV;
651
652 camera_info.dev = dev;
653
654 return platform_device_register(&camera_device);
655}
656
657static void mackerel_camera_del(struct soc_camera_link *icl)
658{
659 if (icl != &camera_link)
660 return;
661
662 platform_device_unregister(&camera_device);
663 memset(&camera_device.dev.kobj, 0,
664 sizeof(camera_device.dev.kobj));
665}
666
667static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
668 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
669};
670
671static struct resource ceu_resources[] = {
672 [0] = {
673 .name = "CEU",
674 .start = 0xfe910000,
675 .end = 0xfe91009f,
676 .flags = IORESOURCE_MEM,
677 },
678 [1] = {
679 .start = intcs_evt2irq(0x880),
680 .flags = IORESOURCE_IRQ,
681 },
682 [2] = {
683 /* place holder for contiguous memory */
684 },
685};
686
687static struct platform_device ceu_device = {
688 .name = "sh_mobile_ceu",
689 .id = 0, /* "ceu0" clock */
690 .num_resources = ARRAY_SIZE(ceu_resources),
691 .resource = ceu_resources,
692 .dev = {
693 .platform_data = &sh_mobile_ceu_info,
694 },
695};
696
697static struct platform_device mackerel_camera = {
698 .name = "soc-camera-pdrv",
699 .id = 0,
700 .dev = {
701 .platform_data = &camera_link,
702 },
703};
704
407static struct platform_device *mackerel_devices[] __initdata = { 705static struct platform_device *mackerel_devices[] __initdata = {
408 &nor_flash_device, 706 &nor_flash_device,
409 &smc911x_device, 707 &smc911x_device,
@@ -412,6 +710,14 @@ static struct platform_device *mackerel_devices[] __initdata = {
412 &leds_device, 710 &leds_device,
413 &fsi_device, 711 &fsi_device,
414 &fsi_ak4643_device, 712 &fsi_ak4643_device,
713 &sdhi0_device,
714#if !defined(CONFIG_MMC_SH_MMCIF)
715 &sdhi1_device,
716#endif
717 &sdhi2_device,
718 &sh_mmcif_device,
719 &ceu_device,
720 &mackerel_camera,
415}; 721};
416 722
417/* Keypad Initialization */ 723/* Keypad Initialization */
@@ -542,7 +848,7 @@ static void __init mackerel_init(void)
542 gpio_request(GPIO_FN_OVCN2_1, NULL); 848 gpio_request(GPIO_FN_OVCN2_1, NULL);
543 849
544 /* setup USB phy */ 850 /* setup USB phy */
545 __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ 851 __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */
546 852
547 /* enable FSI2 port A (ak4643) */ 853 /* enable FSI2 port A (ak4643) */
548 gpio_request(GPIO_FN_FSIAIBT, NULL); 854 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -567,6 +873,68 @@ static void __init mackerel_init(void)
567 gpio_request(GPIO_FN_IRQ21, NULL); 873 gpio_request(GPIO_FN_IRQ21, NULL);
568 set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH); 874 set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH);
569 875
876 /* enable SDHI0 */
877 gpio_request(GPIO_FN_SDHICD0, NULL);
878 gpio_request(GPIO_FN_SDHIWP0, NULL);
879 gpio_request(GPIO_FN_SDHICMD0, NULL);
880 gpio_request(GPIO_FN_SDHICLK0, NULL);
881 gpio_request(GPIO_FN_SDHID0_3, NULL);
882 gpio_request(GPIO_FN_SDHID0_2, NULL);
883 gpio_request(GPIO_FN_SDHID0_1, NULL);
884 gpio_request(GPIO_FN_SDHID0_0, NULL);
885
886#if !defined(CONFIG_MMC_SH_MMCIF)
887 /* enable SDHI1 */
888 gpio_request(GPIO_FN_SDHICMD1, NULL);
889 gpio_request(GPIO_FN_SDHICLK1, NULL);
890 gpio_request(GPIO_FN_SDHID1_3, NULL);
891 gpio_request(GPIO_FN_SDHID1_2, NULL);
892 gpio_request(GPIO_FN_SDHID1_1, NULL);
893 gpio_request(GPIO_FN_SDHID1_0, NULL);
894#endif
895 /* card detect pin for MMC slot (CN7) */
896 gpio_request(GPIO_PORT41, NULL);
897 gpio_direction_input(GPIO_PORT41);
898
899 /* enable SDHI2 */
900 gpio_request(GPIO_FN_SDHICMD2, NULL);
901 gpio_request(GPIO_FN_SDHICLK2, NULL);
902 gpio_request(GPIO_FN_SDHID2_3, NULL);
903 gpio_request(GPIO_FN_SDHID2_2, NULL);
904 gpio_request(GPIO_FN_SDHID2_1, NULL);
905 gpio_request(GPIO_FN_SDHID2_0, NULL);
906
907 /* MMCIF */
908 gpio_request(GPIO_FN_MMCD0_0, NULL);
909 gpio_request(GPIO_FN_MMCD0_1, NULL);
910 gpio_request(GPIO_FN_MMCD0_2, NULL);
911 gpio_request(GPIO_FN_MMCD0_3, NULL);
912 gpio_request(GPIO_FN_MMCD0_4, NULL);
913 gpio_request(GPIO_FN_MMCD0_5, NULL);
914 gpio_request(GPIO_FN_MMCD0_6, NULL);
915 gpio_request(GPIO_FN_MMCD0_7, NULL);
916 gpio_request(GPIO_FN_MMCCMD0, NULL);
917 gpio_request(GPIO_FN_MMCCLK0, NULL);
918
919 /* enable GPS module (GT-720F) */
920 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
921 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
922
923 /* CEU */
924 gpio_request(GPIO_FN_VIO_CLK, NULL);
925 gpio_request(GPIO_FN_VIO_VD, NULL);
926 gpio_request(GPIO_FN_VIO_HD, NULL);
927 gpio_request(GPIO_FN_VIO_FIELD, NULL);
928 gpio_request(GPIO_FN_VIO_CKO, NULL);
929 gpio_request(GPIO_FN_VIO_D7, NULL);
930 gpio_request(GPIO_FN_VIO_D6, NULL);
931 gpio_request(GPIO_FN_VIO_D5, NULL);
932 gpio_request(GPIO_FN_VIO_D4, NULL);
933 gpio_request(GPIO_FN_VIO_D3, NULL);
934 gpio_request(GPIO_FN_VIO_D2, NULL);
935 gpio_request(GPIO_FN_VIO_D1, NULL);
936 gpio_request(GPIO_FN_VIO_D0, NULL);
937
570 i2c_register_board_info(0, i2c0_devices, 938 i2c_register_board_info(0, i2c0_devices,
571 ARRAY_SIZE(i2c0_devices)); 939 ARRAY_SIZE(i2c0_devices));
572 i2c_register_board_info(1, i2c1_devices, 940 i2c_register_board_info(1, i2c1_devices,
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 419581854a80..c196a288f222 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -191,7 +191,7 @@ static void div4_kick(struct clk *clk)
191} 191}
192 192
193static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 193static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
194 24, 0, 36, 48 }; 194 24, 0, 36, 48, 7 };
195 195
196static struct clk_div_mult_table div4_div_mult_table = { 196static struct clk_div_mult_table div4_div_mult_table = {
197 .divisors = divisors, 197 .divisors = divisors,