aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537/boards/stamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/stamp.c')
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c280
1 files changed, 216 insertions, 64 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 8d394393201f..d812e2514a2f 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -46,6 +46,7 @@
46#include <linux/interrupt.h> 46#include <linux/interrupt.h>
47#include <linux/i2c.h> 47#include <linux/i2c.h>
48#include <linux/usb/sl811.h> 48#include <linux/usb/sl811.h>
49#include <linux/spi/mmc_spi.h>
49#include <asm/dma.h> 50#include <asm/dma.h>
50#include <asm/bfin5xx_spi.h> 51#include <asm/bfin5xx_spi.h>
51#include <asm/reboot.h> 52#include <asm/reboot.h>
@@ -55,57 +56,46 @@
55/* 56/*
56 * Name the Board for the /proc/cpuinfo 57 * Name the Board for the /proc/cpuinfo
57 */ 58 */
58const char bfin_board_name[] = "ADDS-BF537-STAMP"; 59const char bfin_board_name[] = "ADI BF537-STAMP";
59 60
60/* 61/*
61 * Driver needs to know address, irq and flag pin. 62 * Driver needs to know address, irq and flag pin.
62 */ 63 */
63 64
64#define ISP1761_BASE 0x203C0000
65#define ISP1761_IRQ IRQ_PF7
66
67#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 65#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
68static struct resource bfin_isp1761_resources[] = { 66#include <linux/usb/isp1760.h>
67static struct resource bfin_isp1760_resources[] = {
69 [0] = { 68 [0] = {
70 .name = "isp1761-regs", 69 .start = 0x203C0000,
71 .start = ISP1761_BASE + 0x00000000, 70 .end = 0x203C0000 + 0x000fffff,
72 .end = ISP1761_BASE + 0x000fffff,
73 .flags = IORESOURCE_MEM, 71 .flags = IORESOURCE_MEM,
74 }, 72 },
75 [1] = { 73 [1] = {
76 .start = ISP1761_IRQ, 74 .start = IRQ_PF7,
77 .end = ISP1761_IRQ, 75 .end = IRQ_PF7,
78 .flags = IORESOURCE_IRQ, 76 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
79 }, 77 },
80}; 78};
81 79
82static struct platform_device bfin_isp1761_device = { 80static struct isp1760_platform_data isp1760_priv = {
83 .name = "isp1761", 81 .is_isp1761 = 0,
84 .id = 0, 82 .port1_disable = 0,
85 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 83 .bus_width_16 = 1,
86 .resource = bfin_isp1761_resources, 84 .port1_otg = 0,
85 .analog_oc = 0,
86 .dack_polarity_high = 0,
87 .dreq_polarity_high = 0,
87}; 88};
88 89
89static struct platform_device *bfin_isp1761_devices[] = { 90static struct platform_device bfin_isp1760_device = {
90 &bfin_isp1761_device, 91 .name = "isp1760-hcd",
92 .id = 0,
93 .dev = {
94 .platform_data = &isp1760_priv,
95 },
96 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
97 .resource = bfin_isp1760_resources,
91}; 98};
92
93int __init bfin_isp1761_init(void)
94{
95 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
96
97 printk(KERN_INFO "%s(): registering device resources\n", __func__);
98 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
99
100 return platform_add_devices(bfin_isp1761_devices, num_devices);
101}
102
103void __exit bfin_isp1761_exit(void)
104{
105 platform_device_unregister(&bfin_isp1761_device);
106}
107
108arch_initcall(bfin_isp1761_init);
109#endif 99#endif
110 100
111#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 101#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
@@ -443,11 +433,11 @@ static struct mtd_partition stamp_partitions[] = {
443 .offset = 0, 433 .offset = 0,
444 }, { 434 }, {
445 .name = "linux kernel(nor)", 435 .name = "linux kernel(nor)",
446 .size = 0xE0000, 436 .size = 0x180000,
447 .offset = MTDPART_OFS_APPEND, 437 .offset = MTDPART_OFS_APPEND,
448 }, { 438 }, {
449 .name = "file system(nor)", 439 .name = "file system(nor)",
450 .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000, 440 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
451 .offset = MTDPART_OFS_APPEND, 441 .offset = MTDPART_OFS_APPEND,
452 }, { 442 }, {
453 .name = "MAC Address(nor)", 443 .name = "MAC Address(nor)",
@@ -490,7 +480,7 @@ static struct mtd_partition bfin_spi_flash_partitions[] = {
490 .mask_flags = MTD_CAP_ROM 480 .mask_flags = MTD_CAP_ROM
491 }, { 481 }, {
492 .name = "linux kernel(spi)", 482 .name = "linux kernel(spi)",
493 .size = 0xe0000, 483 .size = 0x180000,
494 .offset = MTDPART_OFS_APPEND, 484 .offset = MTDPART_OFS_APPEND,
495 }, { 485 }, {
496 .name = "file system(spi)", 486 .name = "file system(spi)",
@@ -503,7 +493,7 @@ static struct flash_platform_data bfin_spi_flash_data = {
503 .name = "m25p80", 493 .name = "m25p80",
504 .parts = bfin_spi_flash_partitions, 494 .parts = bfin_spi_flash_partitions,
505 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), 495 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
506 .type = "m25p64", 496 /* .type = "m25p64", */
507}; 497};
508 498
509/* SPI flash chip (m25p64) */ 499/* SPI flash chip (m25p64) */
@@ -537,9 +527,29 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
537}; 527};
538#endif 528#endif
539 529
540#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) 530#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
541static struct bfin5xx_spi_chip spi_mmc_chip_info = { 531#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
542 .enable_dma = 1, 532
533static int bfin_mmc_spi_init(struct device *dev,
534 irqreturn_t (*detect_int)(int, void *), void *data)
535{
536 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
537 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
538}
539
540static void bfin_mmc_spi_exit(struct device *dev, void *data)
541{
542 free_irq(MMC_SPI_CARD_DETECT_INT, data);
543}
544
545static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
546 .init = bfin_mmc_spi_init,
547 .exit = bfin_mmc_spi_exit,
548 .detect_delay = 100, /* msecs */
549};
550
551static struct bfin5xx_spi_chip mmc_spi_chip_info = {
552 .enable_dma = 0,
543 .bits_per_word = 8, 553 .bits_per_word = 8,
544}; 554};
545#endif 555#endif
@@ -613,6 +623,14 @@ static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
613}; 623};
614#endif 624#endif
615 625
626#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
627static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
628 .enable_dma = 1,
629 .bits_per_word = 8,
630 .cs_gpio = GPIO_PF10,
631};
632#endif
633
616#if defined(CONFIG_MTD_DATAFLASH) \ 634#if defined(CONFIG_MTD_DATAFLASH) \
617 || defined(CONFIG_MTD_DATAFLASH_MODULE) 635 || defined(CONFIG_MTD_DATAFLASH_MODULE)
618 636
@@ -624,7 +642,7 @@ static struct mtd_partition bfin_spi_dataflash_partitions[] = {
624 .mask_flags = MTD_CAP_ROM 642 .mask_flags = MTD_CAP_ROM
625 }, { 643 }, {
626 .name = "linux kernel(spi)", 644 .name = "linux kernel(spi)",
627 .size = 0xe0000, 645 .size = 0x180000,
628 .offset = MTDPART_OFS_APPEND, 646 .offset = MTDPART_OFS_APPEND,
629 }, { 647 }, {
630 .name = "file system(spi)", 648 .name = "file system(spi)",
@@ -703,23 +721,14 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
703 .controller_data = &ad9960_spi_chip_info, 721 .controller_data = &ad9960_spi_chip_info,
704 }, 722 },
705#endif 723#endif
706#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) 724#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
707 { 725 {
708 .modalias = "spi_mmc_dummy", 726 .modalias = "mmc_spi",
709 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 727 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
710 .bus_num = 0, 728 .bus_num = 0,
711 .chip_select = 0, 729 .chip_select = 4,
712 .platform_data = NULL, 730 .platform_data = &bfin_mmc_spi_pdata,
713 .controller_data = &spi_mmc_chip_info, 731 .controller_data = &mmc_spi_chip_info,
714 .mode = SPI_MODE_3,
715 },
716 {
717 .modalias = "spi_mmc",
718 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
719 .bus_num = 0,
720 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
721 .platform_data = NULL,
722 .controller_data = &spi_mmc_chip_info,
723 .mode = SPI_MODE_3, 732 .mode = SPI_MODE_3,
724 }, 733 },
725#endif 734#endif
@@ -783,6 +792,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
783 .mode = SPI_CPHA | SPI_CPOL, 792 .mode = SPI_CPHA | SPI_CPOL,
784 }, 793 },
785#endif 794#endif
795#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
796 {
797 .modalias = "enc28j60",
798 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
799 .irq = IRQ_PF6,
800 .bus_num = 0,
801 .chip_select = 0, /* GPIO controlled SSEL */
802 .controller_data = &enc28j60_spi_chip_info,
803 .mode = SPI_MODE_0,
804 },
805#endif
786}; 806};
787 807
788#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 808#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -885,30 +905,59 @@ static struct platform_device bfin_uart_device = {
885#endif 905#endif
886 906
887#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 907#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
888static struct resource bfin_sir_resources[] = {
889#ifdef CONFIG_BFIN_SIR0 908#ifdef CONFIG_BFIN_SIR0
909static struct resource bfin_sir0_resources[] = {
890 { 910 {
891 .start = 0xFFC00400, 911 .start = 0xFFC00400,
892 .end = 0xFFC004FF, 912 .end = 0xFFC004FF,
893 .flags = IORESOURCE_MEM, 913 .flags = IORESOURCE_MEM,
894 }, 914 },
915 {
916 .start = IRQ_UART0_RX,
917 .end = IRQ_UART0_RX+1,
918 .flags = IORESOURCE_IRQ,
919 },
920 {
921 .start = CH_UART0_RX,
922 .end = CH_UART0_RX+1,
923 .flags = IORESOURCE_DMA,
924 },
925};
926
927static struct platform_device bfin_sir0_device = {
928 .name = "bfin_sir",
929 .id = 0,
930 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
931 .resource = bfin_sir0_resources,
932};
895#endif 933#endif
896#ifdef CONFIG_BFIN_SIR1 934#ifdef CONFIG_BFIN_SIR1
935static struct resource bfin_sir1_resources[] = {
897 { 936 {
898 .start = 0xFFC02000, 937 .start = 0xFFC02000,
899 .end = 0xFFC020FF, 938 .end = 0xFFC020FF,
900 .flags = IORESOURCE_MEM, 939 .flags = IORESOURCE_MEM,
901 }, 940 },
902#endif 941 {
942 .start = IRQ_UART1_RX,
943 .end = IRQ_UART1_RX+1,
944 .flags = IORESOURCE_IRQ,
945 },
946 {
947 .start = CH_UART1_RX,
948 .end = CH_UART1_RX+1,
949 .flags = IORESOURCE_DMA,
950 },
903}; 951};
904 952
905static struct platform_device bfin_sir_device = { 953static struct platform_device bfin_sir1_device = {
906 .name = "bfin_sir", 954 .name = "bfin_sir",
907 .id = 0, 955 .id = 1,
908 .num_resources = ARRAY_SIZE(bfin_sir_resources), 956 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
909 .resource = bfin_sir_resources, 957 .resource = bfin_sir1_resources,
910}; 958};
911#endif 959#endif
960#endif
912 961
913#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 962#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
914static struct resource bfin_twi0_resource[] = { 963static struct resource bfin_twi0_resource[] = {
@@ -932,6 +981,93 @@ static struct platform_device i2c_bfin_twi_device = {
932}; 981};
933#endif 982#endif
934 983
984#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
985#include <linux/input.h>
986#include <linux/i2c/adp5588_keys.h>
987static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
988 [0] = KEY_GRAVE,
989 [1] = KEY_1,
990 [2] = KEY_2,
991 [3] = KEY_3,
992 [4] = KEY_4,
993 [5] = KEY_5,
994 [6] = KEY_6,
995 [7] = KEY_7,
996 [8] = KEY_8,
997 [9] = KEY_9,
998 [10] = KEY_0,
999 [11] = KEY_MINUS,
1000 [12] = KEY_EQUAL,
1001 [13] = KEY_BACKSLASH,
1002 [15] = KEY_KP0,
1003 [16] = KEY_Q,
1004 [17] = KEY_W,
1005 [18] = KEY_E,
1006 [19] = KEY_R,
1007 [20] = KEY_T,
1008 [21] = KEY_Y,
1009 [22] = KEY_U,
1010 [23] = KEY_I,
1011 [24] = KEY_O,
1012 [25] = KEY_P,
1013 [26] = KEY_LEFTBRACE,
1014 [27] = KEY_RIGHTBRACE,
1015 [29] = KEY_KP1,
1016 [30] = KEY_KP2,
1017 [31] = KEY_KP3,
1018 [32] = KEY_A,
1019 [33] = KEY_S,
1020 [34] = KEY_D,
1021 [35] = KEY_F,
1022 [36] = KEY_G,
1023 [37] = KEY_H,
1024 [38] = KEY_J,
1025 [39] = KEY_K,
1026 [40] = KEY_L,
1027 [41] = KEY_SEMICOLON,
1028 [42] = KEY_APOSTROPHE,
1029 [43] = KEY_BACKSLASH,
1030 [45] = KEY_KP4,
1031 [46] = KEY_KP5,
1032 [47] = KEY_KP6,
1033 [48] = KEY_102ND,
1034 [49] = KEY_Z,
1035 [50] = KEY_X,
1036 [51] = KEY_C,
1037 [52] = KEY_V,
1038 [53] = KEY_B,
1039 [54] = KEY_N,
1040 [55] = KEY_M,
1041 [56] = KEY_COMMA,
1042 [57] = KEY_DOT,
1043 [58] = KEY_SLASH,
1044 [60] = KEY_KPDOT,
1045 [61] = KEY_KP7,
1046 [62] = KEY_KP8,
1047 [63] = KEY_KP9,
1048 [64] = KEY_SPACE,
1049 [65] = KEY_BACKSPACE,
1050 [66] = KEY_TAB,
1051 [67] = KEY_KPENTER,
1052 [68] = KEY_ENTER,
1053 [69] = KEY_ESC,
1054 [70] = KEY_DELETE,
1055 [74] = KEY_KPMINUS,
1056 [76] = KEY_UP,
1057 [77] = KEY_DOWN,
1058 [78] = KEY_RIGHT,
1059 [79] = KEY_LEFT,
1060};
1061
1062static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1063 .rows = 8,
1064 .cols = 10,
1065 .keymap = adp5588_keymap,
1066 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1067 .repeat = 0,
1068};
1069#endif
1070
935#ifdef CONFIG_I2C_BOARDINFO 1071#ifdef CONFIG_I2C_BOARDINFO
936static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 1072static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
937#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1073#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
@@ -958,6 +1094,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
958 .platform_data = (void *)&bfin_ad7879_ts_info, 1094 .platform_data = (void *)&bfin_ad7879_ts_info,
959 }, 1095 },
960#endif 1096#endif
1097#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1098 {
1099 I2C_BOARD_INFO("adp5588-keys", 0x34),
1100 .irq = IRQ_PG0,
1101 .platform_data = (void *)&adp5588_kpad_data,
1102 },
1103#endif
961}; 1104};
962#endif 1105#endif
963 1106
@@ -1057,6 +1200,10 @@ static struct platform_device *stamp_devices[] __initdata = {
1057 &isp1362_hcd_device, 1200 &isp1362_hcd_device,
1058#endif 1201#endif
1059 1202
1203#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1204 &bfin_isp1760_device,
1205#endif
1206
1060#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 1207#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1061 &smc91x_device, 1208 &smc91x_device,
1062#endif 1209#endif
@@ -1098,7 +1245,12 @@ static struct platform_device *stamp_devices[] __initdata = {
1098#endif 1245#endif
1099 1246
1100#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1247#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1101 &bfin_sir_device, 1248#ifdef CONFIG_BFIN_SIR0
1249 &bfin_sir0_device,
1250#endif
1251#ifdef CONFIG_BFIN_SIR1
1252 &bfin_sir1_device,
1253#endif
1102#endif 1254#endif
1103 1255
1104#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1256#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)