From a4553358d94b4a1f3e6f24aacfd076022ac14855 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Wed, 24 Nov 2010 11:54:19 +0800 Subject: ARM: pxa: support pxa95x The core of PXA955 is PJ4. Add new PJ4 support. And add new macro CONFIG_PXA95x. Signed-off-by: Haojian Zhuang Signed-off-by: Eric Miao --- arch/arm/mach-pxa/Kconfig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index dd235ecc9d6..d4076594af4 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -651,11 +651,17 @@ config CPU_PXA935 help PXA935 (codename Tavor-P65) -config CPU_PXA950 +config PXA95x bool - select CPU_PXA930 + select CPU_PJ4 + help + Select code specific to PXA95x variants + +config CPU_PXA955 + bool + select PXA95x help - PXA950 (codename Tavor-PV2) + PXA950 (codename MG1) config PXA_SHARP_C7xx bool -- cgit v1.2.3-70-g09d2 From c9b5ef47dc9d154a79f320eeaddc4bc9684ae1ea Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Wed, 24 Nov 2010 11:54:20 +0800 Subject: ARM: pxa: support saarb platform Saarb platform is a handheld platform that supports Marvell PXA955 silicon. Signed-off-by: Haojian Zhuang Signed-off-by: Eric Miao --- arch/arm/mach-pxa/Kconfig | 4 ++ arch/arm/mach-pxa/Makefile | 1 + arch/arm/mach-pxa/saarb.c | 114 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 arch/arm/mach-pxa/saarb.c (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index d4076594af4..e912b2c8881 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -50,6 +50,10 @@ config MACH_SAAR select PXA3xx select CPU_PXA930 +config MACH_SAARB + bool "PXA955 Handheld Platform (aka SAARB)" + select CPU_PXA955 + comment "Third Party Dev Platforms (sorted by vendor name)" config ARCH_PXA_IDP diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index d7f359240d2..26e4c87ba07 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_MACH_LITTLETON) += littleton.o obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o obj-$(CONFIG_MACH_SAAR) += saar.o +obj-$(CONFIG_MACH_SAARB) += saarb.o # 3rd Party Dev Platforms obj-$(CONFIG_ARCH_PXA_IDP) += idp.o diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c new file mode 100644 index 00000000000..e497922f761 --- /dev/null +++ b/arch/arm/mach-pxa/saarb.c @@ -0,0 +1,114 @@ +/* + * linux/arch/arm/mach-pxa/saarb.c + * + * Support for the Marvell Handheld Platform (aka SAARB) + * + * Copyright (C) 2007-2010 Marvell International Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publishhed by the Free Software Foundation. + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "generic.h" + +#define SAARB_NR_IRQS (IRQ_BOARD_START + 40) + +static struct pm860x_touch_pdata saarb_touch = { + .gpadc_prebias = 1, + .slot_cycle = 1, + .tsi_prebias = 6, + .pen_prebias = 16, + .pen_prechg = 2, + .res_x = 300, +}; + +static struct pm860x_backlight_pdata saarb_backlight[] = { + { + .id = PM8606_ID_BACKLIGHT, + .iset = PM8606_WLED_CURRENT(24), + .flags = PM8606_BACKLIGHT1, + }, + {}, +}; + +static struct pm860x_led_pdata saarb_led[] = { + { + .id = PM8606_ID_LED, + .iset = PM8606_LED_CURRENT(12), + .flags = PM8606_LED1_RED, + }, { + .id = PM8606_ID_LED, + .iset = PM8606_LED_CURRENT(12), + .flags = PM8606_LED1_GREEN, + }, { + .id = PM8606_ID_LED, + .iset = PM8606_LED_CURRENT(12), + .flags = PM8606_LED1_BLUE, + }, { + .id = PM8606_ID_LED, + .iset = PM8606_LED_CURRENT(12), + .flags = PM8606_LED2_RED, + }, { + .id = PM8606_ID_LED, + .iset = PM8606_LED_CURRENT(12), + .flags = PM8606_LED2_GREEN, + }, { + .id = PM8606_ID_LED, + .iset = PM8606_LED_CURRENT(12), + .flags = PM8606_LED2_BLUE, + }, +}; + +static struct pm860x_platform_data saarb_pm8607_info = { + .touch = &saarb_touch, + .backlight = &saarb_backlight[0], + .led = &saarb_led[0], + .companion_addr = 0x10, + .irq_mode = 0, + .irq_base = IRQ_BOARD_START, + + .i2c_port = GI2C_PORT, +}; + +static struct i2c_board_info saarb_i2c_info[] = { + { + .type = "88PM860x", + .addr = 0x34, + .platform_data = &saarb_pm8607_info, + .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)), + }, +}; + +static void __init saarb_init(void) +{ + pxa_set_ffuart_info(NULL); + pxa_set_i2c_info(NULL); + i2c_register_board_info(0, ARRAY_AND_SIZE(saarb_i2c_info)); +} + +MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)") + .boot_params = 0xa0000100, + .map_io = pxa_map_io, + .nr_irqs = SAARB_NR_IRQS, + .init_irq = pxa95x_init_irq, + .timer = &pxa_timer, + .init_machine = saarb_init, +MACHINE_END + -- cgit v1.2.3-70-g09d2 From 9b6956f45132f9bf696e9f6c2e457bdfa8e08721 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 12 Aug 2010 01:18:38 +0200 Subject: ARM: pxa: Push Colibri evalboard MFP into module files This change -- pushing the MFP configuration back into Module files -- is necessary because some evalboards can be used with multiple modules, where MFP differs from module to module. Therefore MFP isn't board-specific, but module-specific and the module should preconfigure itself for the board. (And there is also the C preprocesor limitation and conflicting #define-s) Signed-off-by: Marek Vasut Acked-by: Daniel Mack Signed-off-by: Eric Miao --- arch/arm/mach-pxa/Kconfig | 8 +- arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 61 ++++----------- arch/arm/mach-pxa/colibri-pxa270-income.c | 47 ----------- arch/arm/mach-pxa/colibri-pxa270.c | 96 +++++++++++++++++++++++ arch/arm/mach-pxa/colibri-pxa300.c | 61 ++++++--------- arch/arm/mach-pxa/colibri-pxa320.c | 112 ++++++++++----------------- arch/arm/mach-pxa/colibri-pxa3xx.c | 49 ------------ arch/arm/mach-pxa/include/mach/colibri.h | 6 ++ 8 files changed, 188 insertions(+), 252 deletions(-) (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index e912b2c8881..4c31e3dee70 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -236,10 +236,6 @@ config MACH_COLIBRI bool "Toradex Colibri PXA270" select PXA27x -config MACH_COLIBRI_PXA270_EVALBOARD - bool "Toradex Colibri Evaluation Carrier Board support (PXA270)" - depends on MACH_COLIBRI - config MACH_COLIBRI_PXA270_INCOME bool "Income s.r.o. PXA270 SBC" depends on MACH_COLIBRI @@ -257,6 +253,10 @@ config MACH_COLIBRI320 select PXA3xx select CPU_PXA320 +config MACH_COLIBRI_PXA270_EVALBOARD + bool "Toradex Colibri Evaluation Carrier Board support" + depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320 + config MACH_VPAC270 bool "Voipac PXA270" select PXA27x diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c index 6177ff5ecbc..e1a2b52a9d2 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c @@ -29,48 +29,6 @@ #include "generic.h" #include "devices.h" -/****************************************************************************** - * Pin configuration - ******************************************************************************/ -static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { - /* MMC */ - GPIO32_MMC_CLK, - GPIO92_MMC_DAT_0, - GPIO109_MMC_DAT_1, - GPIO110_MMC_DAT_2, - GPIO111_MMC_DAT_3, - GPIO112_MMC_CMD, - GPIO0_GPIO, /* SD detect */ - - /* FFUART */ - GPIO39_FFUART_TXD, - GPIO34_FFUART_RXD, - - /* UHC */ - GPIO88_USBH1_PWR, - GPIO89_USBH1_PEN, - GPIO119_USBH2_PWR, - GPIO120_USBH2_PEN, - - /* PCMCIA */ - GPIO85_nPCE_1, - GPIO54_nPCE_2, - GPIO55_nPREG, - GPIO50_nPIOR, - GPIO51_nPIOW, - GPIO49_nPWE, - GPIO48_nPOE, - GPIO57_nIOIS16, - GPIO56_nPWAIT, - GPIO104_PSKTSEL, - GPIO53_GPIO, /* RESET */ - GPIO83_GPIO, /* BVD1 */ - GPIO82_GPIO, /* BVD2 */ - GPIO1_GPIO, /* READY */ - GPIO84_GPIO, /* DETECT */ - GPIO107_GPIO, /* PPEN */ -}; - /****************************************************************************** * SD/MMC card controller ******************************************************************************/ @@ -78,13 +36,22 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, .gpio_power = -1, - .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT, .gpio_card_ro = -1, .detect_delay_ms = 200, }; static void __init colibri_pxa270_mmc_init(void) { + if (machine_is_colibri()) /* PXA270 Colibri */ + colibri_pxa270_mci_platform_data.gpio_card_detect = + GPIO0_COLIBRI_PXA270_SD_DETECT; + if (machine_is_colibri300()) /* PXA300 Colibri */ + colibri_pxa270_mci_platform_data.gpio_card_detect = + GPIO39_COLIBRI_PXA300_SD_DETECT; + else /* PXA320 Colibri */ + colibri_pxa270_mci_platform_data.gpio_card_detect = + GPIO28_COLIBRI_PXA320_SD_DETECT; + pxa_set_mci_info(&colibri_pxa270_mci_platform_data); } #else @@ -103,13 +70,17 @@ static int colibri_pxa270_ohci_init(struct device *dev) static struct pxaohci_platform_data colibri_pxa270_ohci_info = { .port_mode = PMM_PERPORT_MODE, - .flags = ENABLE_PORT1 | ENABLE_PORT2 | + .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, .init = colibri_pxa270_ohci_init, }; static void __init colibri_pxa270_uhc_init(void) { + /* Colibri PXA270 has two usb ports, TBA for 320 */ + if (machine_is_colibri()) + colibri_pxa270_ohci_info.flags |= ENABLE_PORT2; + pxa_set_ohci_info(&colibri_pxa270_ohci_info); } #else @@ -118,7 +89,6 @@ static inline void colibri_pxa270_uhc_init(void) {} void __init colibri_pxa270_evalboard_init(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); @@ -126,4 +96,3 @@ void __init colibri_pxa270_evalboard_init(void) colibri_pxa270_mmc_init(); colibri_pxa270_uhc_init(); } - diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 37f0f3ed7c6..07b62a096f1 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c @@ -45,52 +45,6 @@ #define GPIO55_INCOME_LED_B (55) #define GPIO113_INCOME_TS_IRQ (113) -/****************************************************************************** - * Pin configuration - ******************************************************************************/ -static mfp_cfg_t income_pin_config[] __initdata = { - /* MMC */ - GPIO32_MMC_CLK, - GPIO92_MMC_DAT_0, - GPIO109_MMC_DAT_1, - GPIO110_MMC_DAT_2, - GPIO111_MMC_DAT_3, - GPIO112_MMC_CMD, - GPIO0_GPIO, /* SD detect */ - GPIO1_GPIO, /* SD read-only */ - - /* FFUART */ - GPIO39_FFUART_TXD, - GPIO34_FFUART_RXD, - - /* BFUART */ - GPIO42_BTUART_RXD, - GPIO43_BTUART_TXD, - GPIO45_BTUART_RTS, - - /* STUART */ - GPIO46_STUART_RXD, - GPIO47_STUART_TXD, - - /* UHC */ - GPIO88_USBH1_PWR, - GPIO89_USBH1_PEN, - - /* LCD */ - GPIOxx_LCD_TFT_16BPP, - - /* PWM */ - GPIO16_PWM0_OUT, - - /* I2C */ - GPIO117_I2C_SCL, - GPIO118_I2C_SDA, - - /* LED */ - GPIO54_GPIO, /* LED A */ - GPIO55_GPIO, /* LED B */ -}; - /****************************************************************************** * SD/MMC card controller ******************************************************************************/ @@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {} void __init colibri_pxa270_income_boardinit(void) { - pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); pxa_set_ffuart_info(NULL); pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index 73205bc4a13..e940004eac1 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c @@ -32,6 +32,99 @@ #include "devices.h" #include "generic.h" +/****************************************************************************** + * Evaluation board MFP + ******************************************************************************/ +#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { + /* MMC */ + GPIO32_MMC_CLK, + GPIO92_MMC_DAT_0, + GPIO109_MMC_DAT_1, + GPIO110_MMC_DAT_2, + GPIO111_MMC_DAT_3, + GPIO112_MMC_CMD, + GPIO0_GPIO, /* SD detect */ + + /* FFUART */ + GPIO39_FFUART_TXD, + GPIO34_FFUART_RXD, + + /* UHC */ + GPIO88_USBH1_PWR, + GPIO89_USBH1_PEN, + GPIO119_USBH2_PWR, + GPIO120_USBH2_PEN, + + /* PCMCIA */ + GPIO85_nPCE_1, + GPIO54_nPCE_2, + GPIO55_nPREG, + GPIO50_nPIOR, + GPIO51_nPIOW, + GPIO49_nPWE, + GPIO48_nPOE, + GPIO57_nIOIS16, + GPIO56_nPWAIT, + GPIO104_PSKTSEL, + GPIO53_GPIO, /* RESET */ + GPIO83_GPIO, /* BVD1 */ + GPIO82_GPIO, /* BVD2 */ + GPIO1_GPIO, /* READY */ + GPIO84_GPIO, /* DETECT */ + GPIO107_GPIO, /* PPEN */ +}; +#else +static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {}; +#endif + +#ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME +static mfp_cfg_t income_pin_config[] __initdata = { + /* MMC */ + GPIO32_MMC_CLK, + GPIO92_MMC_DAT_0, + GPIO109_MMC_DAT_1, + GPIO110_MMC_DAT_2, + GPIO111_MMC_DAT_3, + GPIO112_MMC_CMD, + GPIO0_GPIO, /* SD detect */ + GPIO1_GPIO, /* SD read-only */ + + /* FFUART */ + GPIO39_FFUART_TXD, + GPIO34_FFUART_RXD, + + /* BFUART */ + GPIO42_BTUART_RXD, + GPIO43_BTUART_TXD, + GPIO45_BTUART_RTS, + + /* STUART */ + GPIO46_STUART_RXD, + GPIO47_STUART_TXD, + + /* UHC */ + GPIO88_USBH1_PWR, + GPIO89_USBH1_PEN, + + /* LCD */ + GPIOxx_LCD_TFT_16BPP, + + /* PWM */ + GPIO16_PWM0_OUT, + + /* I2C */ + GPIO117_I2C_SCL, + GPIO118_I2C_SDA, + + /* LED */ + GPIO54_GPIO, /* LED A */ + GPIO55_GPIO, /* LED B */ +}; +#else +static mfp_cfg_t income_pin_config[] __initdata = {}; +#endif + /****************************************************************************** * Pin configuration ******************************************************************************/ @@ -185,9 +278,12 @@ static void __init colibri_pxa270_init(void) switch (colibri_pxa270_baseboard) { case COLIBRI_PXA270_EVALBOARD: + pxa2xx_mfp_config(ARRAY_AND_SIZE( + colibri_pxa270_evalboard_pin_config)); colibri_pxa270_evalboard_init(); break; case COLIBRI_PXA270_INCOME: + pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); colibri_pxa270_income_boardinit(); break; default: diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index d039bd1e2e4..649c83c427c 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c @@ -31,9 +31,28 @@ #include "generic.h" #include "devices.h" + +#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = { + /* MMC */ + GPIO7_MMC1_CLK, + GPIO14_MMC1_CMD, + GPIO3_MMC1_DAT0, + GPIO4_MMC1_DAT1, + GPIO5_MMC1_DAT2, + GPIO6_MMC1_DAT3, + GPIO39_GPIO, /* SD detect */ + + /* UHC */ + GPIO0_2_USBH_PEN, + GPIO1_2_USBH_PWR, +}; +#else +static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {}; +#endif + #if defined(CONFIG_AX88796) #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) - /* * Asix AX88796 Ethernet */ @@ -80,35 +99,6 @@ static void __init colibri_pxa300_init_eth(void) static inline void __init colibri_pxa300_init_eth(void) {} #endif /* CONFIG_AX88796 */ -#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) -static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = { - GPIO0_2_USBH_PEN, - GPIO1_2_USBH_PWR, -}; - -static struct pxaohci_platform_data colibri_pxa300_ohci_info = { - .port_mode = PMM_GLOBAL_MODE, - .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, -}; - -void __init colibri_pxa300_init_ohci(void) -{ - pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config)); - pxa_set_ohci_info(&colibri_pxa300_ohci_info); -} -#else -static inline void colibri_pxa300_init_ohci(void) {} -#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ - -static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = { - GPIO7_MMC1_CLK, - GPIO14_MMC1_CMD, - GPIO3_MMC1_DAT0, - GPIO4_MMC1_DAT1, - GPIO5_MMC1_DAT2, - GPIO6_MMC1_DAT3, -}; - #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { GPIO54_LCD_LDD_0, @@ -171,18 +161,15 @@ static inline void colibri_pxa310_init_ac97(void) {} void __init colibri_pxa300_init(void) { - pxa_set_ffuart_info(NULL); - pxa_set_btuart_info(NULL); - pxa_set_stuart_info(NULL); - colibri_pxa300_init_eth(); - colibri_pxa300_init_ohci(); colibri_pxa3xx_init_nand(); colibri_pxa300_init_lcd(); colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); colibri_pxa310_init_ac97(); - colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), - mfp_to_gpio(MFP_PIN_GPIO13)); + + /* Evalboard init */ + pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config)); + colibri_pxa270_evalboard_init(); } MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index ccb2c59b2a3..6f15f2acf0c 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c @@ -35,9 +35,47 @@ #include "generic.h" #include "devices.h" +#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = { + /* MMC */ + GPIO22_MMC1_CLK, + GPIO23_MMC1_CMD, + GPIO18_MMC1_DAT0, + GPIO19_MMC1_DAT1, + GPIO20_MMC1_DAT2, + GPIO21_MMC1_DAT3, + GPIO28_GPIO, /* SD detect */ + + /* UART 1 configuration (may be set by bootloader) */ + GPIO99_UART1_CTS, + GPIO104_UART1_RTS, + GPIO97_UART1_RXD, + GPIO98_UART1_TXD, + GPIO101_UART1_DTR, + GPIO103_UART1_DSR, + GPIO100_UART1_DCD, + GPIO102_UART1_RI, + + /* UART 2 configuration */ + GPIO109_UART2_CTS, + GPIO112_UART2_RTS, + GPIO110_UART2_RXD, + GPIO111_UART2_TXD, + + /* UART 3 configuration */ + GPIO30_UART3_RXD, + GPIO31_UART3_TXD, + + /* UHC */ + GPIO2_2_USBH_PEN, + GPIO3_2_USBH_PWR, +}; +#else +static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {}; +#endif + #if defined(CONFIG_AX88796) #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) - /* * Asix AX88796 Ethernet */ @@ -84,26 +122,6 @@ static void __init colibri_pxa320_init_eth(void) static inline void __init colibri_pxa320_init_eth(void) {} #endif /* CONFIG_AX88796 */ -#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) -static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = { - GPIO2_2_USBH_PEN, - GPIO3_2_USBH_PWR, -}; - -static struct pxaohci_platform_data colibri_pxa320_ohci_info = { - .port_mode = PMM_GLOBAL_MODE, - .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, -}; - -void __init colibri_pxa320_init_ohci(void) -{ - pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config)); - pxa_set_ohci_info(&colibri_pxa320_ohci_info); -} -#else -static inline void colibri_pxa320_init_ohci(void) {} -#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ - #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), @@ -140,15 +158,6 @@ static void __init colibri_pxa320_init_udc(void) static inline void colibri_pxa320_init_udc(void) {} #endif -static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { - GPIO22_MMC1_CLK, - GPIO23_MMC1_CMD, - GPIO18_MMC1_DAT0, - GPIO19_MMC1_DAT1, - GPIO20_MMC1_DAT2, - GPIO21_MMC1_DAT3 -}; - #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { GPIO6_2_LCD_LDD_0, @@ -205,53 +214,18 @@ static inline void __init colibri_pxa320_init_ac97(void) static inline void colibri_pxa320_init_ac97(void) {} #endif -/* - * The following configuration is verified to work with the Toradex Orchid - * carrier board - */ -static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = { - /* UART 1 configuration (may be set by bootloader) */ - GPIO99_UART1_CTS, - GPIO104_UART1_RTS, - GPIO97_UART1_RXD, - GPIO98_UART1_TXD, - GPIO101_UART1_DTR, - GPIO103_UART1_DSR, - GPIO100_UART1_DCD, - GPIO102_UART1_RI, - - /* UART 2 configuration */ - GPIO109_UART2_CTS, - GPIO112_UART2_RTS, - GPIO110_UART2_RXD, - GPIO111_UART2_TXD, - - /* UART 3 configuration */ - GPIO30_UART3_RXD, - GPIO31_UART3_TXD, -}; - -static void __init colibri_pxa320_init_uart(void) -{ - pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config)); -} - void __init colibri_pxa320_init(void) { - pxa_set_ffuart_info(NULL); - pxa_set_btuart_info(NULL); - pxa_set_stuart_info(NULL); - colibri_pxa320_init_eth(); - colibri_pxa320_init_ohci(); colibri_pxa3xx_init_nand(); colibri_pxa320_init_lcd(); colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); colibri_pxa320_init_ac97(); - colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), - mfp_to_gpio(MFP_PIN_GPIO28)); - colibri_pxa320_init_uart(); colibri_pxa320_init_udc(); + + /* Evalboard init */ + pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config)); + colibri_pxa270_evalboard_init(); } MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c index 199afa2ae30..96b2d9fbfef 100644 --- a/arch/arm/mach-pxa/colibri-pxa3xx.c +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c @@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data) } #endif -#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) -static int mmc_detect_pin; - -static int colibri_pxa3xx_mci_init(struct device *dev, - irq_handler_t colibri_mmc_detect_int, - void *data) -{ - int ret; - - ret = gpio_request(mmc_detect_pin, "mmc card detect"); - if (ret) - return ret; - - gpio_direction_input(mmc_detect_pin); - ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int, - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, - "MMC card detect", data); - if (ret) { - gpio_free(mmc_detect_pin); - return ret; - } - - return 0; -} - -static void colibri_pxa3xx_mci_exit(struct device *dev, void *data) -{ - free_irq(mmc_detect_pin, data); - gpio_free(gpio_to_irq(mmc_detect_pin)); -} - -static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { - .detect_delay_ms = 200, - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, - .init = colibri_pxa3xx_mci_init, - .exit = colibri_pxa3xx_mci_exit, - .gpio_card_detect = -1, - .gpio_card_ro = -1, - .gpio_power = -1, -}; - -void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) -{ - pxa3xx_mfp_config(pins, len); - mmc_detect_pin = detect_pin; - pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data); -} -#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ - #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) static int lcd_bl_pin; diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h index 58dada11054..63a948aaed8 100644 --- a/arch/arm/mach-pxa/include/mach/colibri.h +++ b/arch/arm/mach-pxa/include/mach/colibri.h @@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {} #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 +/* GPIO definitions for Colibri PXA300/310 */ +#define GPIO39_COLIBRI_PXA300_SD_DETECT 39 + +/* GPIO definitions for Colibri PXA320 */ +#define GPIO28_COLIBRI_PXA320_SD_DETECT 28 + #endif /* _COLIBRI_H_ */ -- cgit v1.2.3-70-g09d2 From a3172e5413a06af772c6ad34c0f68a2ebbdbcf86 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 12 Aug 2010 01:45:05 +0200 Subject: ARM: pxa: Rename Colibri evalboard Rename colibri-pxa270-evalboard to colibri-evalboard as this board is used with all Colibri modules. Signed-off-by: Marek Vasut Acked-by: Daniel Mack Signed-off-by: Eric Miao --- arch/arm/mach-pxa/Kconfig | 2 +- arch/arm/mach-pxa/Makefile | 2 +- arch/arm/mach-pxa/colibri-evalboard.c | 121 +++++++++++++++++++++++++++ arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 121 --------------------------- arch/arm/mach-pxa/colibri-pxa270.c | 6 +- arch/arm/mach-pxa/colibri-pxa300.c | 4 +- arch/arm/mach-pxa/colibri-pxa320.c | 4 +- arch/arm/mach-pxa/include/mach/colibri.h | 8 +- 8 files changed, 134 insertions(+), 134 deletions(-) create mode 100644 arch/arm/mach-pxa/colibri-evalboard.c delete mode 100644 arch/arm/mach-pxa/colibri-pxa270-evalboard.c (limited to 'arch/arm/mach-pxa/Kconfig') diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 4c31e3dee70..1df6db6a136 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -253,7 +253,7 @@ config MACH_COLIBRI320 select PXA3xx select CPU_PXA320 -config MACH_COLIBRI_PXA270_EVALBOARD +config MACH_COLIBRI_EVALBOARD bool "Toradex Colibri Evaluation Carrier Board support" depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320 diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 26e4c87ba07..cc39d17b2e0 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile @@ -62,7 +62,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o obj-$(CONFIG_MACH_PCM027) += pcm027.o obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o -obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o +obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) += colibri-evalboard.o obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c new file mode 100644 index 00000000000..6b2c800a113 --- /dev/null +++ b/arch/arm/mach-pxa/colibri-evalboard.c @@ -0,0 +1,121 @@ +/* + * linux/arch/arm/mach-pxa/colibri-evalboard.c + * + * Support for Toradex Colibri Evaluation Carrier Board + * Daniel Mack + * Marek Vasut + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "generic.h" +#include "devices.h" + +/****************************************************************************** + * SD/MMC card controller + ******************************************************************************/ +#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) +static struct pxamci_platform_data colibri_mci_platform_data = { + .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, + .gpio_power = -1, + .gpio_card_ro = -1, + .detect_delay_ms = 200, +}; + +static void __init colibri_mmc_init(void) +{ + if (machine_is_colibri()) /* PXA270 Colibri */ + colibri_mci_platform_data.gpio_card_detect = + GPIO0_COLIBRI_PXA270_SD_DETECT; + if (machine_is_colibri300()) /* PXA300 Colibri */ + colibri_mci_platform_data.gpio_card_detect = + GPIO39_COLIBRI_PXA300_SD_DETECT; + else /* PXA320 Colibri */ + colibri_mci_platform_data.gpio_card_detect = + GPIO28_COLIBRI_PXA320_SD_DETECT; + + pxa_set_mci_info(&colibri_mci_platform_data); +} +#else +static inline void colibri_mmc_init(void) {} +#endif + +/****************************************************************************** + * USB Host + ******************************************************************************/ +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) +static int colibri_ohci_init(struct device *dev) +{ + UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; + return 0; +} + +static struct pxaohci_platform_data colibri_ohci_info = { + .port_mode = PMM_PERPORT_MODE, + .flags = ENABLE_PORT1 | + POWER_CONTROL_LOW | POWER_SENSE_LOW, + .init = colibri_ohci_init, +}; + +static void __init colibri_uhc_init(void) +{ + /* Colibri PXA270 has two usb ports, TBA for 320 */ + if (machine_is_colibri()) + colibri_ohci_info.flags |= ENABLE_PORT2; + + pxa_set_ohci_info(&colibri_ohci_info); +} +#else +static inline void colibri_uhc_init(void) {} +#endif + +/****************************************************************************** + * I2C RTC + ******************************************************************************/ +#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) +static struct i2c_board_info __initdata colibri_i2c_devs[] = { + { + I2C_BOARD_INFO("m41t00", 0x68), + }, +}; + +static void __init colibri_rtc_init(void) +{ + pxa_set_i2c_info(NULL); + i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs)); +} +#else +static inline void colibri_rtc_init(void) {} +#endif + +void __init colibri_evalboard_init(void) +{ + pxa_set_ffuart_info(NULL); + pxa_set_btuart_info(NULL); + pxa_set_stuart_info(NULL); + + colibri_mmc_init(); + colibri_uhc_init(); + colibri_rtc_init(); +} diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c deleted file mode 100644 index 7f27aecc7e0..00000000000 --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c - * - * Support for Toradex PXA270 based Colibri Evaluation Carrier Board - * Daniel Mack - * Marek Vasut - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include "generic.h" -#include "devices.h" - -/****************************************************************************** - * SD/MMC card controller - ******************************************************************************/ -#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) -static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { - .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, - .gpio_power = -1, - .gpio_card_ro = -1, - .detect_delay_ms = 200, -}; - -static void __init colibri_pxa270_mmc_init(void) -{ - if (machine_is_colibri()) /* PXA270 Colibri */ - colibri_pxa270_mci_platform_data.gpio_card_detect = - GPIO0_COLIBRI_PXA270_SD_DETECT; - if (machine_is_colibri300()) /* PXA300 Colibri */ - colibri_pxa270_mci_platform_data.gpio_card_detect = - GPIO39_COLIBRI_PXA300_SD_DETECT; - else /* PXA320 Colibri */ - colibri_pxa270_mci_platform_data.gpio_card_detect = - GPIO28_COLIBRI_PXA320_SD_DETECT; - - pxa_set_mci_info(&colibri_pxa270_mci_platform_data); -} -#else -static inline void colibri_pxa270_mmc_init(void) {} -#endif - -/****************************************************************************** - * USB Host - ******************************************************************************/ -#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) -static int colibri_pxa270_ohci_init(struct device *dev) -{ - UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; - return 0; -} - -static struct pxaohci_platform_data colibri_pxa270_ohci_info = { - .port_mode = PMM_PERPORT_MODE, - .flags = ENABLE_PORT1 | - POWER_CONTROL_LOW | POWER_SENSE_LOW, - .init = colibri_pxa270_ohci_init, -}; - -static void __init colibri_pxa270_uhc_init(void) -{ - /* Colibri PXA270 has two usb ports, TBA for 320 */ - if (machine_is_colibri()) - colibri_pxa270_ohci_info.flags |= ENABLE_PORT2; - - pxa_set_ohci_info(&colibri_pxa270_ohci_info); -} -#else -static inline void colibri_pxa270_uhc_init(void) {} -#endif - -/****************************************************************************** - * I2C RTC - ******************************************************************************/ -#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) -static struct i2c_board_info __initdata colibri_pxa270_i2c_devs[] = { - { - I2C_BOARD_INFO("m41t00", 0x68), - }, -}; - -static void __init colibri_pxa270_rtc_init(void) -{ - pxa_set_i2c_info(NULL); - i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_pxa270_i2c_devs)); -} -#else -static inline void colibri_pxa270_rtc_init(void) {} -#endif - -void __init colibri_pxa270_evalboard_init(void) -{ - pxa_set_ffuart_info(NULL); - pxa_set_btuart_info(NULL); - pxa_set_stuart_info(NULL); - - colibri_pxa270_mmc_init(); - colibri_pxa270_uhc_init(); - colibri_pxa270_rtc_init(); -} diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index eecbb8bc453..6fc5d328ba7 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c @@ -35,7 +35,7 @@ /****************************************************************************** * Evaluation board MFP ******************************************************************************/ -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { /* MMC */ GPIO32_MMC_CLK, @@ -281,10 +281,10 @@ static void __init colibri_pxa270_init(void) colibri_pxa270_tsc_init(); switch (colibri_pxa270_baseboard) { - case COLIBRI_PXA270_EVALBOARD: + case COLIBRI_EVALBOARD: pxa2xx_mfp_config(ARRAY_AND_SIZE( colibri_pxa270_evalboard_pin_config)); - colibri_pxa270_evalboard_init(); + colibri_evalboard_init(); break; case COLIBRI_PXA270_INCOME: pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index 9b8d72de294..b5bb248ffb8 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c @@ -32,7 +32,7 @@ #include "devices.h" -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = { /* MMC */ GPIO7_MMC1_CLK, @@ -173,7 +173,7 @@ void __init colibri_pxa300_init(void) /* Evalboard init */ pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config)); - colibri_pxa270_evalboard_init(); + colibri_evalboard_init(); } MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index 0d8faf85a50..3d2c944b16e 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c @@ -35,7 +35,7 @@ #include "generic.h" #include "devices.h" -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = { /* MMC */ GPIO22_MMC1_CLK, @@ -229,7 +229,7 @@ void __init colibri_pxa320_init(void) /* Evalboard init */ pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config)); - colibri_pxa270_evalboard_init(); + colibri_evalboard_init(); } MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h index 63a948aaed8..388a96f1ef9 100644 --- a/arch/arm/mach-pxa/include/mach/colibri.h +++ b/arch/arm/mach-pxa/include/mach/colibri.h @@ -9,14 +9,14 @@ */ enum { - COLIBRI_PXA270_EVALBOARD = 0, + COLIBRI_EVALBOARD = 0, COLIBRI_PXA270_INCOME, }; -#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) -extern void colibri_pxa270_evalboard_init(void); +#if defined(CONFIG_MACH_COLIBRI_EVALBOARD) +extern void colibri_evalboard_init(void); #else -static inline void colibri_pxa270_evalboard_init(void) {} +static inline void colibri_evalboard_init(void) {} #endif #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME) -- cgit v1.2.3-70-g09d2