diff options
author | Russell Robinson Jr <rrobinson@phytec.com> | 2013-08-06 12:09:24 -0700 |
---|---|---|
committer | Anthony Felice <tony.felice@timesys.com> | 2013-08-28 18:26:24 -0400 |
commit | 7ab6000bddf33858ee1137932e7cb92278d7da5b (patch) | |
tree | 3605a7753a6d72a70f9c3cb26e5a9f657152722e | |
parent | 09ddcf195980d3126556f29174f14e79bbcd0fbe (diff) |
pcm052: add pwm backlight support; enable uart2
additional changes: enabled ADC and updated QSPI parts
-rw-r--r-- | arch/arm/configs/pcm052_defconfig | 23 | ||||
-rw-r--r-- | arch/arm/mach-mvf/board-pcm052.c | 107 | ||||
-rw-r--r-- | arch/arm/mach-mvf/devices-mvf.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/iomux-mvf.h | 4 |
4 files changed, 84 insertions, 51 deletions
diff --git a/arch/arm/configs/pcm052_defconfig b/arch/arm/configs/pcm052_defconfig index cf5c67f75198..a7f8d1d96565 100644 --- a/arch/arm/configs/pcm052_defconfig +++ b/arch/arm/configs/pcm052_defconfig @@ -3,6 +3,7 @@ # Linux/arm 3.0.15 Kernel Configuration # CONFIG_ARM=y +CONFIG_HAVE_PWM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_HAVE_SCHED_CLOCK=y CONFIG_GENERIC_GPIO=y @@ -293,7 +294,8 @@ CONFIG_SOC_MVFA5=y CONFIG_MACH_PCM052=y CONFIG_ISP1504_MXC=y # CONFIG_MXC_IRQ_PRIOR is not set -# CONFIG_MXC_PWM is not set +CONFIG_MXC_PWM=y +# CONFIG_MXC_PWM_CPWM is not set # CONFIG_MXC_DEBUG_BOARD is not set CONFIG_HAVE_PIT=y CONFIG_MXC_USE_PIT=y @@ -679,7 +681,7 @@ CONFIG_MISC_DEVICES=y # CONFIG_DS1682 is not set # CONFIG_TI_DAC7512 is not set # CONFIG_BMP085 is not set -# CONFIG_MVF_ADC is not set +CONFIG_MVF_ADC=y # CONFIG_C2PORT is not set # @@ -918,6 +920,7 @@ CONFIG_INPUT_MISC=y # CONFIG_INPUT_CM109 is not set CONFIG_INPUT_UINPUT=y # CONFIG_INPUT_PCF8574 is not set +# CONFIG_INPUT_PWM_BEEPER is not set # CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set # CONFIG_INPUT_ADXL34X is not set # CONFIG_INPUT_CMA3000 is not set @@ -1206,7 +1209,21 @@ CONFIG_FB_MVF_DCU=y # CONFIG_FB_VIRTUAL is not set # CONFIG_FB_METRONOME is not set # CONFIG_FB_BROADSHEET is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_LCD_CLASS_DEVICE=m +# CONFIG_LCD_L4F00242T03 is not set +# CONFIG_LCD_LMS283GF05 is not set +# CONFIG_LCD_LTV350QV is not set +# CONFIG_LCD_TDO24M is not set +# CONFIG_LCD_VGG2432A4 is not set +# CONFIG_LCD_PLATFORM is not set +# CONFIG_LCD_S6E63M0 is not set +# CONFIG_LCD_LD9040 is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_GENERIC=m +CONFIG_BACKLIGHT_PWM=y +# CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set # # Display device support diff --git a/arch/arm/mach-mvf/board-pcm052.c b/arch/arm/mach-mvf/board-pcm052.c index b73afc0028c5..c45e7c669834 100644 --- a/arch/arm/mach-mvf/board-pcm052.c +++ b/arch/arm/mach-mvf/board-pcm052.c @@ -15,7 +15,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include <linux/types.h> #include <linux/sched.h> #include <linux/delay.h> @@ -49,7 +48,6 @@ #include <linux/mxcfb.h> #include <linux/phy.h> #include <linux/pwm_backlight.h> -#include <linux/leds_pwm.h> #include <linux/fec.h> #include <linux/memblock.h> #include <linux/gpio.h> @@ -93,6 +91,10 @@ #define KSZ8051_PHY_CTRL2 0x1F // SP: PHY Ctrl2 reg addr #define KSZ8051_50MHZ_CLK_MODE (1 << 7) // SP: PHY Ctrl2 reg val for 50 MHz clk +#define MVF_BACKLIGHT_MAX_BRIGHTNESS 100 +#define MVF_BACKLIGHT_DEFAULT_BRIGHTNESS 100 +#define MVF_PWM_PERIOD_NANO_SECONDS 100000 + #ifdef PCM952_REV0 #undef PCM952_REV0 #endif @@ -156,11 +158,8 @@ static iomux_v3_cfg_t pcm052_pads[] = { MVF600_PAD6_PTA16_SAI2_TX_BCLK, MVF600_PAD8_PTA18_SAI2_TX_DATA, MVF600_PAD9_PTA19_SAI2_TX_SYNC, -// MVF600_PAD11_PTA21_SAI2_RX_BCLK, - MVF600_PAD23_PTB1_SAI2_RX_DATA, // originally PAD12_PTA22 -// MVF600_PAD24_PTB2_SAI2_RX_SYNC, // originally PAD13_PTA23 -// MVF600_PAD40_PTB18_EXT_AUDIO_MCLK, // UNUSED - MVF600_PAD33_PTB11__CKO2, // phyCORE MCLK + MVF600_PAD23_PTB1_SAI2_RX_DATA, + MVF600_PAD33_PTB11__CKO2, /*DCU0*/ MVF600_PAD25_PTB3_LCD_ENABLE, @@ -205,20 +204,8 @@ static iomux_v3_cfg_t pcm052_pads[] = { #endif MVF600_PAD7_PTA17__USB_OC_N, - /* - * FlexTimer PWM channels - * FTM0 CH0~3 are connected to demo LED0~3 - * PAD30 mux with LCD enable signal - */ -// MVF600_PAD22_PTB0_FTM0CH0, -// MVF600_PAD23_PTB1_FTM0CH1, -// MVF600_PAD24_PTB2_FTM0CH2, -// MVF600_PAD25_PTB3_FTM0CH3, - -// MVF600_PAD28_PTB6_FTM0CH6, -// MVF600_PAD29_PTB7_FTM0CH7, - /*MVF600_PAD30_PTB8_FTM1CH0,*/ -// MVF600_PAD31_PTB9_FTM1CH1, + /* Display Brightness PWM */ + MVF600_PAD22_PTB0_FTM0CH0, /* Touch Screen */ MVF600_PAD32_PTB10_TS_IRQ, @@ -267,9 +254,16 @@ static struct imxuart_platform_data mvf_uart1_pdata = { .dma_req_tx = DMA_MUX03_UART1_TX, }; +static struct imxuart_platform_data mvf_uart2_pdata = { + .flags = IMXUART_FIFO | IMXUART_EDMA, + .dma_req_rx = DMA_MUX03_UART2_RX, + .dma_req_tx = DMA_MUX03_UART2_TX, +}; + static inline void pcm052_init_uart(void) { mvf_add_imx_uart(1, &mvf_uart1_pdata); + mvf_add_imx_uart(2, &mvf_uart2_pdata); } static struct fec_platform_data fec_data __initdata = { @@ -289,6 +283,8 @@ static int mvf_fec1_phy_fixup(struct phy_device *phydev){ regval = phy_read(phydev, KSZ8051_PHY_CTRL2); regval |= KSZ8051_50MHZ_CLK_MODE; phy_write(phydev, KSZ8051_PHY_CTRL2, regval); + + return 0; } static int pcm052_spi_cs[] = { @@ -315,19 +311,35 @@ static const struct spi_mvf_master pcm052_qspi_data __initconst = { }; #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) -static struct mtd_partition n25q128_partitions[] = { +static struct mtd_partition n25q128_qspi0a_partitions[] = { { - .name = "n25q128", - .size = (1024 * 64 * 128), + .name = "qspi0_a", + .size = MTDPART_SIZ_FULL, .offset = 0x00000000, .mask_flags = 0, } }; -static struct flash_platform_data n25q128_spi_flash_data = { - .name = "Micron n25q128 SPI Flash chip", - .parts = n25q128_partitions, - .nr_parts = ARRAY_SIZE(n25q128_partitions), +static struct mtd_partition n25q128_qspi0b_partitions[] = { + { + .name = "qspi0_b", + .size = MTDPART_SIZ_FULL, + .offset = 0x00000000, + .mask_flags = 0, + } +}; + +static struct flash_platform_data n25q128_spi_flash_data_0 = { + .name = "n25q128.0", + .parts = n25q128_qspi0a_partitions, + .nr_parts = ARRAY_SIZE(n25q128_qspi0a_partitions), + .type = "n25q128", +}; + +static struct flash_platform_data n25q128_spi_flash_data_1 = { + .name = "n25q128.1", + .parts = n25q128_qspi0b_partitions, + .nr_parts = ARRAY_SIZE(n25q128_qspi0b_partitions), .type = "n25q128", }; @@ -336,18 +348,18 @@ static struct spi_board_info mvf_spi_board_info[] __initdata = { { /* The modalias must be the same as spi device driver name */ .modalias = "m25p80", - .max_speed_hz = 30000000, + .max_speed_hz = 50000000, .bus_num = 0, .chip_select = 0, - .platform_data = &n25q128_spi_flash_data, + .platform_data = &n25q128_spi_flash_data_0, }, { /* The modalias must be the same as spi device driver name */ .modalias = "m25p80", - .max_speed_hz = 30000000, + .max_speed_hz = 50000000, .bus_num = 0, .chip_select = 1, - .platform_data = &n25q128_spi_flash_data, + .platform_data = &n25q128_spi_flash_data_1, }, #endif }; @@ -369,6 +381,7 @@ static void pcm052_suspend_exit(void) { /* resmue resore */ } + static const struct pm_platform_data pcm052_pm_data __initconst = { .name = "mvf_pm", .suspend_enter = pcm052_suspend_enter, @@ -376,6 +389,13 @@ static const struct pm_platform_data pcm052_pm_data __initconst = { }; #endif +static struct platform_pwm_backlight_data mvf_backlight_data = { + .pwm_id = 1, + .max_brightness = MVF_BACKLIGHT_MAX_BRIGHTNESS, + .dft_brightness = MVF_BACKLIGHT_DEFAULT_BRIGHTNESS, + .pwm_period_ns = MVF_PWM_PERIOD_NANO_SECONDS, +}; + static struct mvf_dcu_platform_data mvf_dcu_pdata = { .mode_str = "pm070wl4", .default_bpp = 24, @@ -459,17 +479,9 @@ static struct mxc_nand_platform_data mvf_data __initdata = { .width = 2, }; -static struct led_pwm mvf_led __initdata = { - .name = "mvf_leds", - .pwm_id = 1, - .active_low = 0, - .max_brightness = 6, - .pwm_period_ns = 100000000, -}; - -static struct led_pwm_platform_data mvf_led_data __initdata = { - .num_leds = 1, - .leds = &mvf_led, +static struct imx_asrc_platform_data imx_asrc_data = { + .channel_bits = 4, + .clk_map_ver = 3, }; #define USB_VBUS_ENABLE_PIN 134 @@ -524,9 +536,12 @@ static void __init pcm052_board_init(void) mvf_add_nand(&mvf_data); -// mvf_add_mxc_pwm(0); -// mvf_add_pwm_leds(&mvf_led_data); + mvf_add_mxc_pwm(0); + mvf_add_mxc_pwm_backlight(0, &mvf_backlight_data); + imx_asrc_data.asrc_core_clk = clk_get(NULL, "asrc_clk"); + imx_asrc_data.asrc_audio_clk = clk_get(NULL, "asrc_serial_clk"); + mvf_add_asrc(&imx_asrc_data); } static void __init mvf_timer_init(void) @@ -547,7 +562,7 @@ static struct sys_timer pcm052_timer = { * initialize __mach_desc_ data structure. */ MACHINE_START(PCM052, "PHYTEC phyCORE-Vybrid Board") - /* Maintainer: Freescale Semiconductor, Inc. */ + /* Maintainer: PHYTEC America, LLC */ .boot_params = MVF_PHYS_OFFSET + 0x100, .fixup = fixup_mxc_board, .map_io = mvf_map_io, diff --git a/arch/arm/mach-mvf/devices-mvf.h b/arch/arm/mach-mvf/devices-mvf.h index f4ec88b062ac..f04630cd0a9b 100644 --- a/arch/arm/mach-mvf/devices-mvf.h +++ b/arch/arm/mach-mvf/devices-mvf.h @@ -102,6 +102,7 @@ const struct imx_fsl_usb2_wakeup_data mvf_fsl_hs_wakeup_data[] __initconst; #ifdef CONFIG_MACH_PCM052 #define mvf_add_fsl_usb2_hs_wakeup(id, pdata) \ imx_add_fsl_usb2_wakeup(&mvf_fsl_hs_wakeup_data[id], pdata) +#else #define mvf_add_fsl_usb2_hs_wakeup(id, pdata) \ imx_add_fsl_usb2_wakeup(&mvf_fsl_hs_wakeup_data[id - 1], pdata) #endif diff --git a/arch/arm/plat-mxc/include/mach/iomux-mvf.h b/arch/arm/plat-mxc/include/mach/iomux-mvf.h index bde7e316433a..89eb0a87f21c 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-mvf.h +++ b/arch/arm/plat-mxc/include/mach/iomux-mvf.h @@ -70,8 +70,8 @@ typedef enum iomux_config { #define MVF600_GPIO_GENERAL_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_SPEED_MED | PAD_CTL_PUS_47K_UP | \ PAD_CTL_DSE_25ohm) -#define MVF600_FTM0_CH_CTRL (PAD_CTL_SPEED_LOW | PAD_CTL_OBE_ENABLE | \ - PAD_CTL_ODE | PAD_CTL_DSE_25ohm) +#define MVF600_FTM0_CH_CTRL (PAD_CTL_SPEED_HIGH | PAD_CTL_OBE_ENABLE | \ + PAD_CTL_DSE_25ohm) #define MVF600_FTM1_CH_CTRL (PAD_CTL_SPEED_LOW | PAD_CTL_OBE_ENABLE | \ PAD_CTL_DSE_25ohm) /*SDHC1*/ |