diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-02-02 01:57:55 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-02-02 04:40:17 -0500 |
commit | 7f14a78713e0b4517f785402accaccca22df93c1 (patch) | |
tree | 09f654c9de9222e2a33d1bfcfe6a0ca7b02177ae /arch | |
parent | 4a697e83cf8b20b35942c93b873fe17e54d7e6c5 (diff) |
[ARM] pxa: add eXeda platform support
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/em-x270.c | 149 |
2 files changed, 132 insertions, 21 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index a2ed2aa731b6..ffd28e48d75f 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -254,6 +254,10 @@ config MACH_EM_X270 | |||
254 | bool "CompuLab EM-x270 platform" | 254 | bool "CompuLab EM-x270 platform" |
255 | select PXA27x | 255 | select PXA27x |
256 | 256 | ||
257 | config MACH_EXEDA | ||
258 | bool "CompuLab eXeda platform" | ||
259 | select PXA27x | ||
260 | |||
257 | config MACH_COLIBRI | 261 | config MACH_COLIBRI |
258 | bool "Toradex Colibri PX27x" | 262 | bool "Toradex Colibri PX27x" |
259 | select PXA27x | 263 | select PXA27x |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index ea099183773d..9f15a7c9cc5f 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/irq.h> | 12 | #include <linux/irq.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/delay.h> | ||
14 | 15 | ||
15 | #include <linux/dm9000.h> | 16 | #include <linux/dm9000.h> |
16 | #include <linux/rtc-v3020.h> | 17 | #include <linux/rtc-v3020.h> |
@@ -47,18 +48,21 @@ | |||
47 | #include "generic.h" | 48 | #include "generic.h" |
48 | #include "devices.h" | 49 | #include "devices.h" |
49 | 50 | ||
50 | /* GPIO IRQ usage */ | 51 | /* EM-X270 specific GPIOs */ |
51 | #define GPIO41_ETHIRQ (41) | ||
52 | #define GPIO13_MMC_CD (13) | 52 | #define GPIO13_MMC_CD (13) |
53 | #define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) | 53 | #define GPIO95_MMC_WP (95) |
54 | #define GPIO56_NAND_RB (56) | ||
54 | 55 | ||
55 | /* NAND control GPIOs */ | 56 | /* eXeda specific GPIOs */ |
56 | #define GPIO11_NAND_CS (11) | 57 | #define GPIO114_MMC_CD (114) |
57 | #define GPIO56_NAND_RB (56) | 58 | #define GPIO20_NAND_RB (20) |
59 | #define GPIO38_SD_PWEN (38) | ||
58 | 60 | ||
59 | /* Miscelaneous GPIOs */ | 61 | /* common GPIOs */ |
62 | #define GPIO11_NAND_CS (11) | ||
60 | #define GPIO93_CAM_RESET (93) | 63 | #define GPIO93_CAM_RESET (93) |
61 | #define GPIO95_MMC_WP (95) | 64 | #define GPIO41_ETHIRQ (41) |
65 | #define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) | ||
62 | 66 | ||
63 | static int mmc_cd; | 67 | static int mmc_cd; |
64 | static int nand_rb; | 68 | static int nand_rb; |
@@ -190,6 +194,12 @@ static unsigned long em_x270_pin_config[] = { | |||
190 | GPIO95_GPIO, /* MMC Write protect */ | 194 | GPIO95_GPIO, /* MMC Write protect */ |
191 | }; | 195 | }; |
192 | 196 | ||
197 | static unsigned long exeda_pin_config[] = { | ||
198 | GPIO20_GPIO, /* NAND Ready/Busy */ | ||
199 | GPIO38_GPIO | MFP_LPM_DRIVE_LOW, /* SD slot power */ | ||
200 | GPIO114_GPIO, /* MMC card detect */ | ||
201 | }; | ||
202 | |||
193 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) | 203 | #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) |
194 | static struct resource em_x270_dm9000_resource[] = { | 204 | static struct resource em_x270_dm9000_resource[] = { |
195 | [0] = { | 205 | [0] = { |
@@ -500,14 +510,24 @@ static int em_x270_mci_init(struct device *dev, | |||
500 | goto err_irq; | 510 | goto err_irq; |
501 | } | 511 | } |
502 | 512 | ||
503 | err = gpio_request(GPIO95_MMC_WP, "MMC WP"); | 513 | if (machine_is_em_x270()) { |
504 | if (err) { | 514 | err = gpio_request(GPIO95_MMC_WP, "MMC WP"); |
505 | dev_err(dev, "can't request MMC write protect: %d\n", err); | 515 | if (err) { |
506 | goto err_gpio_wp; | 516 | dev_err(dev, "can't request MMC write protect: %d\n", |
517 | err); | ||
518 | goto err_gpio_wp; | ||
519 | } | ||
520 | gpio_direction_input(GPIO95_MMC_WP); | ||
521 | } else { | ||
522 | err = gpio_request(GPIO38_SD_PWEN, "sdio power"); | ||
523 | if (err) { | ||
524 | dev_err(dev, "can't request MMC power control : %d\n", | ||
525 | err); | ||
526 | goto err_gpio_wp; | ||
527 | } | ||
528 | gpio_direction_output(GPIO38_SD_PWEN, 1); | ||
507 | } | 529 | } |
508 | 530 | ||
509 | gpio_direction_input(GPIO95_MMC_WP); | ||
510 | |||
511 | return 0; | 531 | return 0; |
512 | 532 | ||
513 | err_gpio_wp: | 533 | err_gpio_wp: |
@@ -535,6 +555,12 @@ static void em_x270_mci_setpower(struct device *dev, unsigned int vdd) | |||
535 | static void em_x270_mci_exit(struct device *dev, void *data) | 555 | static void em_x270_mci_exit(struct device *dev, void *data) |
536 | { | 556 | { |
537 | free_irq(gpio_to_irq(mmc_cd), data); | 557 | free_irq(gpio_to_irq(mmc_cd), data); |
558 | regulator_put(em_x270_sdio_ldo); | ||
559 | |||
560 | if (machine_is_em_x270()) | ||
561 | gpio_free(GPIO95_MMC_WP); | ||
562 | else | ||
563 | gpio_free(GPIO38_SD_PWEN); | ||
538 | } | 564 | } |
539 | 565 | ||
540 | static int em_x270_mci_get_ro(struct device *dev) | 566 | static int em_x270_mci_get_ro(struct device *dev) |
@@ -549,12 +575,14 @@ static struct pxamci_platform_data em_x270_mci_platform_data = { | |||
549 | MMC_VDD_30_31|MMC_VDD_31_32, | 575 | MMC_VDD_30_31|MMC_VDD_31_32, |
550 | .init = em_x270_mci_init, | 576 | .init = em_x270_mci_init, |
551 | .setpower = em_x270_mci_setpower, | 577 | .setpower = em_x270_mci_setpower, |
552 | .get_ro = em_x270_mci_get_ro, | ||
553 | .exit = em_x270_mci_exit, | 578 | .exit = em_x270_mci_exit, |
554 | }; | 579 | }; |
555 | 580 | ||
556 | static void __init em_x270_init_mmc(void) | 581 | static void __init em_x270_init_mmc(void) |
557 | { | 582 | { |
583 | if (machine_is_em_x270()) | ||
584 | em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro; | ||
585 | |||
558 | em_x270_mci_platform_data.detect_delay = msecs_to_jiffies(250); | 586 | em_x270_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
559 | pxa_set_mci_info(&em_x270_mci_platform_data); | 587 | pxa_set_mci_info(&em_x270_mci_platform_data); |
560 | } | 588 | } |
@@ -651,23 +679,76 @@ static inline void em_x270_init_ac97(void) {} | |||
651 | #endif | 679 | #endif |
652 | 680 | ||
653 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) | 681 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
654 | static unsigned int em_x270_matrix_keys[] = { | 682 | static unsigned int em_x270_module_matrix_keys[] = { |
655 | KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B), | 683 | KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B), |
656 | KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT), | 684 | KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT), |
657 | KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D), | 685 | KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D), |
658 | }; | 686 | }; |
659 | 687 | ||
660 | struct pxa27x_keypad_platform_data em_x270_keypad_info = { | 688 | struct pxa27x_keypad_platform_data em_x270_module_keypad_info = { |
661 | /* code map for the matrix keys */ | 689 | /* code map for the matrix keys */ |
662 | .matrix_key_rows = 3, | 690 | .matrix_key_rows = 3, |
663 | .matrix_key_cols = 3, | 691 | .matrix_key_cols = 3, |
664 | .matrix_key_map = em_x270_matrix_keys, | 692 | .matrix_key_map = em_x270_module_matrix_keys, |
665 | .matrix_key_map_size = ARRAY_SIZE(em_x270_matrix_keys), | 693 | .matrix_key_map_size = ARRAY_SIZE(em_x270_module_matrix_keys), |
694 | }; | ||
695 | |||
696 | static unsigned int em_x270_exeda_matrix_keys[] = { | ||
697 | KEY(0, 0, KEY_RIGHTSHIFT), KEY(0, 1, KEY_RIGHTCTRL), | ||
698 | KEY(0, 2, KEY_RIGHTALT), KEY(0, 3, KEY_SPACE), | ||
699 | KEY(0, 4, KEY_LEFTALT), KEY(0, 5, KEY_LEFTCTRL), | ||
700 | KEY(0, 6, KEY_ENTER), KEY(0, 7, KEY_SLASH), | ||
701 | |||
702 | KEY(1, 0, KEY_DOT), KEY(1, 1, KEY_M), | ||
703 | KEY(1, 2, KEY_N), KEY(1, 3, KEY_B), | ||
704 | KEY(1, 4, KEY_V), KEY(1, 5, KEY_C), | ||
705 | KEY(1, 6, KEY_X), KEY(1, 7, KEY_Z), | ||
706 | |||
707 | KEY(2, 0, KEY_LEFTSHIFT), KEY(2, 1, KEY_SEMICOLON), | ||
708 | KEY(2, 2, KEY_L), KEY(2, 3, KEY_K), | ||
709 | KEY(2, 4, KEY_J), KEY(2, 5, KEY_H), | ||
710 | KEY(2, 6, KEY_G), KEY(2, 7, KEY_F), | ||
711 | |||
712 | KEY(3, 0, KEY_D), KEY(3, 1, KEY_S), | ||
713 | KEY(3, 2, KEY_A), KEY(3, 3, KEY_TAB), | ||
714 | KEY(3, 4, KEY_BACKSPACE), KEY(3, 5, KEY_P), | ||
715 | KEY(3, 6, KEY_O), KEY(3, 7, KEY_I), | ||
716 | |||
717 | KEY(4, 0, KEY_U), KEY(4, 1, KEY_Y), | ||
718 | KEY(4, 2, KEY_T), KEY(4, 3, KEY_R), | ||
719 | KEY(4, 4, KEY_E), KEY(4, 5, KEY_W), | ||
720 | KEY(4, 6, KEY_Q), KEY(4, 7, KEY_MINUS), | ||
721 | |||
722 | KEY(5, 0, KEY_0), KEY(5, 1, KEY_9), | ||
723 | KEY(5, 2, KEY_8), KEY(5, 3, KEY_7), | ||
724 | KEY(5, 4, KEY_6), KEY(5, 5, KEY_5), | ||
725 | KEY(5, 6, KEY_4), KEY(5, 7, KEY_3), | ||
726 | |||
727 | KEY(6, 0, KEY_2), KEY(6, 1, KEY_1), | ||
728 | KEY(6, 2, KEY_ENTER), KEY(6, 3, KEY_END), | ||
729 | KEY(6, 4, KEY_DOWN), KEY(6, 5, KEY_UP), | ||
730 | KEY(6, 6, KEY_MENU), KEY(6, 7, KEY_F1), | ||
731 | |||
732 | KEY(7, 0, KEY_LEFT), KEY(7, 1, KEY_RIGHT), | ||
733 | KEY(7, 2, KEY_BACK), KEY(7, 3, KEY_HOME), | ||
734 | KEY(7, 4, 0), KEY(7, 5, 0), | ||
735 | KEY(7, 6, 0), KEY(7, 7, 0), | ||
736 | }; | ||
737 | |||
738 | struct pxa27x_keypad_platform_data em_x270_exeda_keypad_info = { | ||
739 | /* code map for the matrix keys */ | ||
740 | .matrix_key_rows = 8, | ||
741 | .matrix_key_cols = 8, | ||
742 | .matrix_key_map = em_x270_exeda_matrix_keys, | ||
743 | .matrix_key_map_size = ARRAY_SIZE(em_x270_exeda_matrix_keys), | ||
666 | }; | 744 | }; |
667 | 745 | ||
668 | static void __init em_x270_init_keypad(void) | 746 | static void __init em_x270_init_keypad(void) |
669 | { | 747 | { |
670 | pxa_set_keypad_info(&em_x270_keypad_info); | 748 | if (machine_is_em_x270()) |
749 | pxa_set_keypad_info(&em_x270_module_keypad_info); | ||
750 | else | ||
751 | pxa_set_keypad_info(&em_x270_exeda_keypad_info); | ||
671 | } | 752 | } |
672 | #else | 753 | #else |
673 | static inline void em_x270_init_keypad(void) {} | 754 | static inline void em_x270_init_keypad(void) {} |
@@ -921,6 +1002,7 @@ static void __init em_x270_init_da9030(void) | |||
921 | 1002 | ||
922 | static void __init em_x270_module_init(void) | 1003 | static void __init em_x270_module_init(void) |
923 | { | 1004 | { |
1005 | pr_info("%s\n", __func__); | ||
924 | pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config)); | 1006 | pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config)); |
925 | 1007 | ||
926 | mmc_cd = GPIO13_MMC_CD; | 1008 | mmc_cd = GPIO13_MMC_CD; |
@@ -928,11 +1010,26 @@ static void __init em_x270_module_init(void) | |||
928 | dm9000_flags = DM9000_PLATF_32BITONLY; | 1010 | dm9000_flags = DM9000_PLATF_32BITONLY; |
929 | } | 1011 | } |
930 | 1012 | ||
1013 | static void __init em_x270_exeda_init(void) | ||
1014 | { | ||
1015 | pr_info("%s\n", __func__); | ||
1016 | pxa2xx_mfp_config(ARRAY_AND_SIZE(exeda_pin_config)); | ||
1017 | |||
1018 | mmc_cd = GPIO114_MMC_CD; | ||
1019 | nand_rb = GPIO20_NAND_RB; | ||
1020 | dm9000_flags = DM9000_PLATF_16BITONLY; | ||
1021 | } | ||
1022 | |||
931 | static void __init em_x270_init(void) | 1023 | static void __init em_x270_init(void) |
932 | { | 1024 | { |
933 | pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config)); | 1025 | pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config)); |
934 | 1026 | ||
935 | em_x270_module_init(); | 1027 | if (machine_is_em_x270()) |
1028 | em_x270_module_init(); | ||
1029 | else if (machine_is_exeda()) | ||
1030 | em_x270_exeda_init(); | ||
1031 | else | ||
1032 | panic("Unsupported machine: %d\n", machine_arch_type); | ||
936 | 1033 | ||
937 | em_x270_init_da9030(); | 1034 | em_x270_init_da9030(); |
938 | em_x270_init_dm9000(); | 1035 | em_x270_init_dm9000(); |
@@ -958,3 +1055,13 @@ MACHINE_START(EM_X270, "Compulab EM-X270") | |||
958 | .timer = &pxa_timer, | 1055 | .timer = &pxa_timer, |
959 | .init_machine = em_x270_init, | 1056 | .init_machine = em_x270_init, |
960 | MACHINE_END | 1057 | MACHINE_END |
1058 | |||
1059 | MACHINE_START(EXEDA, "Compulab eXeda") | ||
1060 | .boot_params = 0xa0000100, | ||
1061 | .phys_io = 0x40000000, | ||
1062 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
1063 | .map_io = pxa_map_io, | ||
1064 | .init_irq = pxa27x_init_irq, | ||
1065 | .timer = &pxa_timer, | ||
1066 | .init_machine = em_x270_init, | ||
1067 | MACHINE_END | ||