aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c3
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c322
-rw-r--r--arch/sh/boards/mach-kfr2r09/lcd_wqvga.c6
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7722/irq.c7
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c17
6 files changed, 350 insertions, 6 deletions
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 7a9f69663f1a..1f5fa5c44f6d 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -323,7 +323,8 @@ static struct soc_camera_platform_info camera_info = {
323 .height = 480, 323 .height = 480,
324 }, 324 },
325 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | 325 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
326 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, 326 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8 |
327 SOCAM_DATA_ACTIVE_HIGH,
327 .set_capture = camera_set_capture, 328 .set_capture = camera_set_capture,
328}; 329};
329 330
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 826e62326d51..194aaca22d47 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -19,11 +19,18 @@
19#include <linux/usb/r8a66597.h> 19#include <linux/usb/r8a66597.h>
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <linux/i2c/tsc2007.h> 21#include <linux/i2c/tsc2007.h>
22#include <linux/spi/spi.h>
23#include <linux/spi/sh_msiof.h>
24#include <linux/spi/mmc_spi.h>
25#include <linux/mmc/host.h>
22#include <linux/input.h> 26#include <linux/input.h>
23#include <linux/input/sh_keysc.h> 27#include <linux/input/sh_keysc.h>
24#include <linux/mfd/sh_mobile_sdhi.h> 28#include <linux/mfd/sh_mobile_sdhi.h>
25#include <video/sh_mobile_lcdc.h> 29#include <video/sh_mobile_lcdc.h>
30#include <sound/sh_fsi.h>
26#include <media/sh_mobile_ceu.h> 31#include <media/sh_mobile_ceu.h>
32#include <media/tw9910.h>
33#include <media/mt9t112.h>
27#include <asm/heartbeat.h> 34#include <asm/heartbeat.h>
28#include <asm/sh_eth.h> 35#include <asm/sh_eth.h>
29#include <asm/clock.h> 36#include <asm/clock.h>
@@ -338,6 +345,12 @@ static struct platform_device ceu1_device = {
338}; 345};
339 346
340/* I2C device */ 347/* I2C device */
348static struct i2c_board_info i2c0_devices[] = {
349 {
350 I2C_BOARD_INFO("da7210", 0x1a),
351 },
352};
353
341static struct i2c_board_info i2c1_devices[] = { 354static struct i2c_board_info i2c1_devices[] = {
342 { 355 {
343 I2C_BOARD_INFO("r2025sd", 0x32), 356 I2C_BOARD_INFO("r2025sd", 0x32),
@@ -421,6 +434,7 @@ static struct i2c_board_info ts_i2c_clients = {
421 .irq = IRQ0, 434 .irq = IRQ0,
422}; 435};
423 436
437#ifdef CONFIG_MFD_SH_MOBILE_SDHI
424/* SHDI0 */ 438/* SHDI0 */
425static void sdhi0_set_pwr(struct platform_device *pdev, int state) 439static void sdhi0_set_pwr(struct platform_device *pdev, int state)
426{ 440{
@@ -493,6 +507,248 @@ static struct platform_device sdhi1_device = {
493 }, 507 },
494}; 508};
495 509
510#else
511
512static int mmc_spi_get_ro(struct device *dev)
513{
514 return gpio_get_value(GPIO_PTY6);
515}
516
517static int mmc_spi_get_cd(struct device *dev)
518{
519 return !gpio_get_value(GPIO_PTY7);
520}
521
522static void mmc_spi_setpower(struct device *dev, unsigned int maskval)
523{
524 gpio_set_value(GPIO_PTB6, maskval ? 1 : 0);
525}
526
527static struct mmc_spi_platform_data mmc_spi_info = {
528 .get_ro = mmc_spi_get_ro,
529 .get_cd = mmc_spi_get_cd,
530 .caps = MMC_CAP_NEEDS_POLL,
531 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3.3V only */
532 .setpower = mmc_spi_setpower,
533};
534
535static struct spi_board_info spi_bus[] = {
536 {
537 .modalias = "mmc_spi",
538 .platform_data = &mmc_spi_info,
539 .max_speed_hz = 5000000,
540 .mode = SPI_MODE_0,
541 .controller_data = (void *) GPIO_PTM4,
542 },
543};
544
545static struct sh_msiof_spi_info msiof0_data = {
546 .num_chipselect = 1,
547};
548
549static struct resource msiof0_resources[] = {
550 [0] = {
551 .name = "MSIOF0",
552 .start = 0xa4c40000,
553 .end = 0xa4c40063,
554 .flags = IORESOURCE_MEM,
555 },
556 [1] = {
557 .start = 84,
558 .flags = IORESOURCE_IRQ,
559 },
560};
561
562static struct platform_device msiof0_device = {
563 .name = "spi_sh_msiof",
564 .id = 0, /* MSIOF0 */
565 .dev = {
566 .platform_data = &msiof0_data,
567 },
568 .num_resources = ARRAY_SIZE(msiof0_resources),
569 .resource = msiof0_resources,
570 .archdata = {
571 .hwblk_id = HWBLK_MSIOF0,
572 },
573};
574
575#endif
576
577/* I2C Video/Camera */
578static struct i2c_board_info i2c_camera[] = {
579 {
580 I2C_BOARD_INFO("tw9910", 0x45),
581 },
582 {
583 /* 1st camera */
584 I2C_BOARD_INFO("mt9t112", 0x3c),
585 },
586 {
587 /* 2nd camera */
588 I2C_BOARD_INFO("mt9t112", 0x3c),
589 },
590};
591
592/* tw9910 */
593static int tw9910_power(struct device *dev, int mode)
594{
595 int val = mode ? 0 : 1;
596
597 gpio_set_value(GPIO_PTU2, val);
598 if (mode)
599 mdelay(100);
600
601 return 0;
602}
603
604static struct tw9910_video_info tw9910_info = {
605 .buswidth = SOCAM_DATAWIDTH_8,
606 .mpout = TW9910_MPO_FIELD,
607};
608
609static struct soc_camera_link tw9910_link = {
610 .i2c_adapter_id = 0,
611 .bus_id = 1,
612 .power = tw9910_power,
613 .board_info = &i2c_camera[0],
614 .module_name = "tw9910",
615 .priv = &tw9910_info,
616};
617
618/* mt9t112 */
619static int mt9t112_power1(struct device *dev, int mode)
620{
621 gpio_set_value(GPIO_PTA3, mode);
622 if (mode)
623 mdelay(100);
624
625 return 0;
626}
627
628static struct mt9t112_camera_info mt9t112_info1 = {
629 .flags = MT9T112_FLAG_PCLK_RISING_EDGE | MT9T112_FLAG_DATAWIDTH_8,
630 .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */
631};
632
633static struct soc_camera_link mt9t112_link1 = {
634 .i2c_adapter_id = 0,
635 .power = mt9t112_power1,
636 .bus_id = 0,
637 .board_info = &i2c_camera[1],
638 .module_name = "mt9t112",
639 .priv = &mt9t112_info1,
640};
641
642static int mt9t112_power2(struct device *dev, int mode)
643{
644 gpio_set_value(GPIO_PTA4, mode);
645 if (mode)
646 mdelay(100);
647
648 return 0;
649}
650
651static struct mt9t112_camera_info mt9t112_info2 = {
652 .flags = MT9T112_FLAG_PCLK_RISING_EDGE | MT9T112_FLAG_DATAWIDTH_8,
653 .divider = { 0x49, 0x6, 0, 6, 0, 9, 9, 6, 0 }, /* for 24MHz */
654};
655
656static struct soc_camera_link mt9t112_link2 = {
657 .i2c_adapter_id = 1,
658 .power = mt9t112_power2,
659 .bus_id = 1,
660 .board_info = &i2c_camera[2],
661 .module_name = "mt9t112",
662 .priv = &mt9t112_info2,
663};
664
665static struct platform_device camera_devices[] = {
666 {
667 .name = "soc-camera-pdrv",
668 .id = 0,
669 .dev = {
670 .platform_data = &tw9910_link,
671 },
672 },
673 {
674 .name = "soc-camera-pdrv",
675 .id = 1,
676 .dev = {
677 .platform_data = &mt9t112_link1,
678 },
679 },
680 {
681 .name = "soc-camera-pdrv",
682 .id = 2,
683 .dev = {
684 .platform_data = &mt9t112_link2,
685 },
686 },
687};
688
689/* FSI */
690/*
691 * FSI-B use external clock which came from da7210.
692 * So, we should change parent of fsi
693 */
694#define FCLKBCR 0xa415000c
695static void fsimck_init(struct clk *clk)
696{
697 u32 status = ctrl_inl(clk->enable_reg);
698
699 /* use external clock */
700 status &= ~0x000000ff;
701 status |= 0x00000080;
702
703 ctrl_outl(status, clk->enable_reg);
704}
705
706static struct clk_ops fsimck_clk_ops = {
707 .init = fsimck_init,
708};
709
710static struct clk fsimckb_clk = {
711 .name = "fsimckb_clk",
712 .id = -1,
713 .ops = &fsimck_clk_ops,
714 .enable_reg = (void __iomem *)FCLKBCR,
715 .rate = 0, /* unknown */
716};
717
718struct sh_fsi_platform_info fsi_info = {
719 .portb_flags = SH_FSI_BRS_INV |
720 SH_FSI_OUT_SLAVE_MODE |
721 SH_FSI_IN_SLAVE_MODE |
722 SH_FSI_OFMT(I2S) |
723 SH_FSI_IFMT(I2S),
724};
725
726static struct resource fsi_resources[] = {
727 [0] = {
728 .name = "FSI",
729 .start = 0xFE3C0000,
730 .end = 0xFE3C021d,
731 .flags = IORESOURCE_MEM,
732 },
733 [1] = {
734 .start = 108,
735 .flags = IORESOURCE_IRQ,
736 },
737};
738
739static struct platform_device fsi_device = {
740 .name = "sh_fsi",
741 .id = 0,
742 .num_resources = ARRAY_SIZE(fsi_resources),
743 .resource = fsi_resources,
744 .dev = {
745 .platform_data = &fsi_info,
746 },
747 .archdata = {
748 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
749 },
750};
751
496static struct platform_device *ecovec_devices[] __initdata = { 752static struct platform_device *ecovec_devices[] __initdata = {
497 &heartbeat_device, 753 &heartbeat_device,
498 &nor_flash_device, 754 &nor_flash_device,
@@ -503,8 +759,16 @@ static struct platform_device *ecovec_devices[] __initdata = {
503 &ceu0_device, 759 &ceu0_device,
504 &ceu1_device, 760 &ceu1_device,
505 &keysc_device, 761 &keysc_device,
762#ifdef CONFIG_MFD_SH_MOBILE_SDHI
506 &sdhi0_device, 763 &sdhi0_device,
507 &sdhi1_device, 764 &sdhi1_device,
765#else
766 &msiof0_device,
767#endif
768 &camera_devices[0],
769 &camera_devices[1],
770 &camera_devices[2],
771 &fsi_device,
508}; 772};
509 773
510#define EEPROM_ADDR 0x50 774#define EEPROM_ADDR 0x50
@@ -560,6 +824,8 @@ extern char ecovec24_sdram_leave_end;
560 824
561static int __init arch_setup(void) 825static int __init arch_setup(void)
562{ 826{
827 struct clk *clk;
828
563 /* register board specific self-refresh code */ 829 /* register board specific self-refresh code */
564 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, 830 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF,
565 &ecovec24_sdram_enter_start, 831 &ecovec24_sdram_enter_start,
@@ -773,7 +1039,8 @@ static int __init arch_setup(void)
773 gpio_direction_input(GPIO_PTR5); 1039 gpio_direction_input(GPIO_PTR5);
774 gpio_direction_input(GPIO_PTR6); 1040 gpio_direction_input(GPIO_PTR6);
775 1041
776 /* enable SDHI0 (needs DS2.4 set to ON) */ 1042#ifdef CONFIG_MFD_SH_MOBILE_SDHI
1043 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
777 gpio_request(GPIO_FN_SDHI0CD, NULL); 1044 gpio_request(GPIO_FN_SDHI0CD, NULL);
778 gpio_request(GPIO_FN_SDHI0WP, NULL); 1045 gpio_request(GPIO_FN_SDHI0WP, NULL);
779 gpio_request(GPIO_FN_SDHI0CMD, NULL); 1046 gpio_request(GPIO_FN_SDHI0CMD, NULL);
@@ -785,7 +1052,7 @@ static int __init arch_setup(void)
785 gpio_request(GPIO_PTB6, NULL); 1052 gpio_request(GPIO_PTB6, NULL);
786 gpio_direction_output(GPIO_PTB6, 0); 1053 gpio_direction_output(GPIO_PTB6, 0);
787 1054
788 /* enable SDHI1 (needs DS2.6,7 set to ON,OFF) */ 1055 /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
789 gpio_request(GPIO_FN_SDHI1CD, NULL); 1056 gpio_request(GPIO_FN_SDHI1CD, NULL);
790 gpio_request(GPIO_FN_SDHI1WP, NULL); 1057 gpio_request(GPIO_FN_SDHI1WP, NULL);
791 gpio_request(GPIO_FN_SDHI1CMD, NULL); 1058 gpio_request(GPIO_FN_SDHI1CMD, NULL);
@@ -799,8 +1066,59 @@ static int __init arch_setup(void)
799 1066
800 /* I/O buffer drive ability is high for SDHI1 */ 1067 /* I/O buffer drive ability is high for SDHI1 */
801 ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); 1068 ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1069#else
1070 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */
1071 gpio_request(GPIO_FN_MSIOF0_TXD, NULL);
1072 gpio_request(GPIO_FN_MSIOF0_RXD, NULL);
1073 gpio_request(GPIO_FN_MSIOF0_TSCK, NULL);
1074 gpio_request(GPIO_PTM4, NULL); /* software CS control of TSYNC pin */
1075 gpio_direction_output(GPIO_PTM4, 1); /* active low CS */
1076 gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */
1077 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
1078 gpio_request(GPIO_PTY6, NULL); /* write protect */
1079 gpio_direction_input(GPIO_PTY6);
1080 gpio_request(GPIO_PTY7, NULL); /* card detect */
1081 gpio_direction_input(GPIO_PTY7);
1082
1083 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
1084#endif
1085
1086 /* enable Video */
1087 gpio_request(GPIO_PTU2, NULL);
1088 gpio_direction_output(GPIO_PTU2, 1);
1089
1090 /* enable Camera */
1091 gpio_request(GPIO_PTA3, NULL);
1092 gpio_request(GPIO_PTA4, NULL);
1093 gpio_direction_output(GPIO_PTA3, 0);
1094 gpio_direction_output(GPIO_PTA4, 0);
1095
1096 /* enable FSI */
1097 gpio_request(GPIO_FN_FSIMCKB, NULL);
1098 gpio_request(GPIO_FN_FSIIBSD, NULL);
1099 gpio_request(GPIO_FN_FSIOBSD, NULL);
1100 gpio_request(GPIO_FN_FSIIBBCK, NULL);
1101 gpio_request(GPIO_FN_FSIIBLRCK, NULL);
1102 gpio_request(GPIO_FN_FSIOBBCK, NULL);
1103 gpio_request(GPIO_FN_FSIOBLRCK, NULL);
1104 gpio_request(GPIO_FN_CLKAUDIOBO, NULL);
1105
1106 /* change parent of FSI B */
1107 clk = clk_get(NULL, "fsib_clk");
1108 clk_register(&fsimckb_clk);
1109 clk_set_parent(clk, &fsimckb_clk);
1110 clk_set_rate(clk, 11000);
1111 clk_set_rate(&fsimckb_clk, 11000);
1112 clk_put(clk);
1113
1114 gpio_request(GPIO_PTU0, NULL);
1115 gpio_direction_output(GPIO_PTU0, 0);
1116 mdelay(20);
802 1117
803 /* enable I2C device */ 1118 /* enable I2C device */
1119 i2c_register_board_info(0, i2c0_devices,
1120 ARRAY_SIZE(i2c0_devices));
1121
804 i2c_register_board_info(1, i2c1_devices, 1122 i2c_register_board_info(1, i2c1_devices,
805 ARRAY_SIZE(i2c1_devices)); 1123 ARRAY_SIZE(i2c1_devices));
806 1124
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
index 8ccb1cc8b589..e9b970846c41 100644
--- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
+++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
@@ -273,6 +273,12 @@ int kfr2r09_lcd_setup(void *board_data, void *sohandle,
273 return 0; 273 return 0;
274} 274}
275 275
276void kfr2r09_lcd_start(void *board_data, void *sohandle,
277 struct sh_mobile_lcdc_sys_bus_ops *so)
278{
279 write_memory_start(sohandle, so);
280}
281
276#define CTRL_CKSW 0x10 282#define CTRL_CKSW 0x10
277#define CTRL_C10 0x20 283#define CTRL_C10 0x20
278#define CTRL_CPSW 0x80 284#define CTRL_CPSW 0x80
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 9038d768a525..5d7b5d92475e 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -150,6 +150,7 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
150 }, 150 },
151 .board_cfg = { 151 .board_cfg = {
152 .setup_sys = kfr2r09_lcd_setup, 152 .setup_sys = kfr2r09_lcd_setup,
153 .start_transfer = kfr2r09_lcd_start,
153 .display_on = kfr2r09_lcd_on, 154 .display_on = kfr2r09_lcd_on,
154 .display_off = kfr2r09_lcd_off, 155 .display_off = kfr2r09_lcd_off,
155 }, 156 },
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
index 4eb31acfafef..b221b6842b0d 100644
--- a/arch/sh/boards/mach-se/7722/irq.c
+++ b/arch/sh/boards/mach-se/7722/irq.c
@@ -57,15 +57,16 @@ static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
57 */ 57 */
58void __init init_se7722_IRQ(void) 58void __init init_se7722_IRQ(void)
59{ 59{
60 int i; 60 int i, irq;
61 61
62 ctrl_outw(0, IRQ01_MASK); /* disable all irqs */ 62 ctrl_outw(0, IRQ01_MASK); /* disable all irqs */
63 ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */ 63 ctrl_outw(0x2000, 0xb03fffec); /* mrshpc irq enable */
64 64
65 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) { 65 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) {
66 se7722_fpga_irq[i] = create_irq(); 66 irq = create_irq();
67 if (se7722_fpga_irq[i] < 0) 67 if (irq < 0)
68 return; 68 return;
69 se7722_fpga_irq[i] = irq;
69 70
70 set_irq_chip_and_handler_name(se7722_fpga_irq[i], 71 set_irq_chip_and_handler_name(se7722_fpga_irq[i],
71 &se7722_irq_chip, 72 &se7722_irq_chip,
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 4b0f0c0dc2b8..5d0f70b46c97 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -514,6 +514,13 @@ static struct platform_device *ms7724se_devices[] __initdata = {
514 &sdhi1_cn8_device, 514 &sdhi1_cn8_device,
515}; 515};
516 516
517/* I2C device */
518static struct i2c_board_info i2c0_devices[] = {
519 {
520 I2C_BOARD_INFO("ak4642", 0x12),
521 },
522};
523
517#define EEPROM_OP 0xBA206000 524#define EEPROM_OP 0xBA206000
518#define EEPROM_ADR 0xBA206004 525#define EEPROM_ADR 0xBA206004
519#define EEPROM_DATA 0xBA20600C 526#define EEPROM_DATA 0xBA20600C
@@ -575,6 +582,16 @@ extern char ms7724se_sdram_enter_end;
575extern char ms7724se_sdram_leave_start; 582extern char ms7724se_sdram_leave_start;
576extern char ms7724se_sdram_leave_end; 583extern char ms7724se_sdram_leave_end;
577 584
585
586static int __init arch_setup(void)
587{
588 /* enable I2C device */
589 i2c_register_board_info(0, i2c0_devices,
590 ARRAY_SIZE(i2c0_devices));
591 return 0;
592}
593arch_initcall(arch_setup);
594
578static int __init devices_setup(void) 595static int __init devices_setup(void)
579{ 596{
580 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ 597 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */