void __init mx28evk_pins_init(void) { mx28evk_init_pin_group(mx28evk_fixed_pins, ARRAY_SIZE(mx28evk_fixed_pins)); if (enable_ssp1) { pr_info("Initializing SSP1 pins\n"); mx28evk_init_pin_group(mx28evk_ssp1_pins, ARRAY_SIZE(mx28evk_ssp1_pins)); } else if (enable_gpmi) { pr_info("Initializing GPMI pins\n"); mx28evk_init_pin_group(mx28evk_gpmi_pins, ARRAY_SIZE(mx28evk_gpmi_pins)); } #if defined(CONFIG_SPI_MXS) || defined(CONFIG_SPI_MXS_MODULE) mx28evk_init_pin_group(mx28evk_spi_pins, ARRAY_SIZE(mx28evk_spi_pins)); #endif #if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)\ || defined(CONFIG_FEC_L2SWITCH) mx28evk_init_pin_group(mx28evk_eth_pins, ARRAY_SIZE(mx28evk_eth_pins)); #endif }
int mx28evk_enet_gpio_init(void) { /* pwr */ //gpio_request(MXS_PIN_TO_GPIO(PINID_SSP1_DATA3), "ENET_PWR"); //gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP1_DATA3), 0); for (i = 0; i < ARRAY_SIZE(mx28evk_eth_mode_pins); i++) { mxs_release_pin(mx28evk_eth_mode_pins[i].id, mx28evk_eth_mode_pins[i].name); } mx28evk_init_pin_group(mx28evk_eth_mode_pins, ARRAY_SIZE(mx28evk_eth_mode_pins)); /* reset phy */ gpio_request(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), "PHY_RESET"); gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), 0); mdelay(1); gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), 1); /* Most a reset should last from switch chip is 14ms */ mdelay(20); for (i = 0; i < ARRAY_SIZE(mx28evk_eth_mode_pins); i++) { mxs_release_pin(mx28evk_eth_mode_pins[i].id, mx28evk_eth_mode_pins[i].name); } mx28evk_init_pin_group(mx28evk_eth_pins, ARRAY_SIZE(mx28evk_eth_pins)); return 0; }
void __init mx28evk_pins_init(void) { mx28evk_init_pin_group(mx28evk_fixed_pins, ARRAY_SIZE(mx28evk_fixed_pins)); if (enable_ssp1) { pr_info("Initializing SSP1 pins\n"); mx28evk_init_pin_group(mx28evk_ssp1_pins, ARRAY_SIZE(mx28evk_ssp1_pins)); } else if (enable_gpmi) { pr_info("Initializing GPMI pins\n"); mx28evk_init_pin_group(mx28evk_gpmi_pins, ARRAY_SIZE(mx28evk_gpmi_pins)); } #if defined(CONFIG_SPI_MXS) || defined(CONFIG_SPI_MXS_MODULE) mx28evk_init_pin_group(mx28evk_spi_pins, ARRAY_SIZE(mx28evk_spi_pins)); #endif #if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)\ || defined(CONFIG_FEC_L2SWITCH) #ifdef CONFIG_MX28_ENET_ISSUE gpio_request(MXS_PIN_TO_GPIO(PINID_ENET0_RX_CLK), "PHY_RESET"); gpio_direction_output(MXS_PIN_TO_GPIO(PINID_ENET0_RX_CLK), 1); #endif mx28evk_init_pin_group(mx28evk_eth_pins, ARRAY_SIZE(mx28evk_eth_pins)); #endif }
int mx28evk_enet_gpio_init(void) { int i; printk("Configure external PHY pins...\n"); for (i = 0; i < ARRAY_SIZE(mx28evk_eth_mode_pins); i++) { mxs_release_pin(mx28evk_eth_mode_pins[i].id, mx28evk_eth_mode_pins[i].name); } mx28evk_init_pin_group(mx28evk_eth_mode_pins, ARRAY_SIZE(mx28evk_eth_mode_pins)); /* pwr */ if (mxs_get_type(PINID_GPMI_RDY1) == PIN_GPIO) { gpio_request(MXS_PIN_TO_GPIO(PINID_GPMI_RDY1), "ENET_PWR"); gpio_direction_output(MXS_PIN_TO_GPIO(PINID_GPMI_RDY1), 0); } else if (mxs_get_type(PINID_LCD_D10) == PIN_GPIO) { gpio_request(MXS_PIN_TO_GPIO(PINID_LCD_D10), "ENET_PWR"); gpio_direction_output(MXS_PIN_TO_GPIO(PINID_LCD_D10), 0); } else { printk(KERN_ERR "Unable to determine correct EN_ENET_3.3V pin\n"); } /* reset phy */ // gpio_request(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), "PHY_RESET"); // gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), 0); // mdelay(1); printk("Release external PHY reset...\n"); gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP0_DETECT), 1); mdelay(20); for (i = 0; i < ARRAY_SIZE(mx28evk_eth_mode_pins); i++) { mxs_release_pin(mx28evk_eth_mode_pins[i].id, mx28evk_eth_mode_pins[i].name); } mx28evk_init_pin_group(mx28evk_eth_pins, ARRAY_SIZE(mx28evk_eth_pins)); return 0; }
void __init mx28evk_pins_init(void) { int iRet = 0; mx28evk_init_pin_group(mx28evk_fixed_pins, ARRAY_SIZE(mx28evk_fixed_pins)); if (enable_ssp1) { pr_info("Initializing SSP1 pins\n"); mx28evk_init_pin_group(mx28evk_ssp1_pins, ARRAY_SIZE(mx28evk_ssp1_pins)); } else if (enable_gpmi) { pr_info("Initializing GPMI pins\n"); mx28evk_init_pin_group(mx28evk_gpmi_pins, ARRAY_SIZE(mx28evk_gpmi_pins)); } #if defined(CONFIG_SPI_MXS) || defined(CONFIG_SPI_MXS_MODULE) mx28evk_init_pin_group(mx28evk_spi_pins, ARRAY_SIZE(mx28evk_spi_pins)); #endif #if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)\ || defined(CONFIG_FEC_L2SWITCH) mx28evk_init_pin_group(mx28evk_eth_pins, ARRAY_SIZE(mx28evk_eth_pins)); #endif /* 初始化是蜂鸣器的定时器中断处理函数 */ iRet = request_irq(IRQ_TIMER3,beep_timer_handler,IRQF_DISABLED | IRQF_TIMER,"beeptimer", NULL); if(iRet != 0) { printk("timer irq for beep install fails,ret:%d\n",iRet); } __raw_writel(1 << 2,int_base +HW_ICOLL_INTERRUPTn_CLR(IRQ_TIMER3));//关闭中断 beeptimer.flag = BEEP_TIMER_OFF; }
void __init mx28evk_pins_init(int boardid) { switch(boardid) { case 0x0: //TS-7400 Rev A mx28evk_init_pin_group(ts7400_pins, ARRAY_SIZE(ts7400_pins)); mx28evk_init_pin_group(sd2spi_pins, ARRAY_SIZE(sd2spi_pins)); mx28evk_init_pin_group(mx28evk_gpmi_pins, ARRAY_SIZE(mx28evk_gpmi_pins)); break; case 0x1: //TS-7670 Rev A mx28evk_init_pin_group(ts767080_pins, ARRAY_SIZE(ts767080_pins)); mx28evk_init_pin_group(sd2spi_pins, ARRAY_SIZE(sd2spi_pins)); mx28evk_init_pin_group(ts7670_pins, ARRAY_SIZE(ts7670_pins)); mx28evk_init_pin_group(mx28evk_gpmi_pins, ARRAY_SIZE(mx28evk_gpmi_pins)); break; case 0x2: //TS-7680 mx28evk_init_pin_group(ts767080_pins, ARRAY_SIZE(ts767080_pins)); mx28evk_init_pin_group(ts7680_mmcwifi, ARRAY_SIZE(ts7680_mmcwifi)); mx28evk_init_pin_group(mx28evk_gpmi_pins, ARRAY_SIZE(mx28evk_gpmi_pins)); break; case 0x3: //TS-7670 Rev C mx28evk_init_pin_group(ts767080_pins, ARRAY_SIZE(ts767080_pins)); mx28evk_init_pin_group(sd2spi_pins, ARRAY_SIZE(sd2spi_pins)); mx28evk_init_pin_group(ts7670_pins, ARRAY_SIZE(ts7670_pins)); mx28evk_init_pin_group(ssp1_emmc_pins, ARRAY_SIZE(ssp1_emmc_pins)); break; case 0x4: //TS-7400-V2 Rev B mx28evk_init_pin_group(ts7400_pins, ARRAY_SIZE(ts7400_pins)); mx28evk_init_pin_group(sd2spi_pins, ARRAY_SIZE(sd2spi_pins)); mx28evk_init_pin_group(ssp1_emmc_pins, ARRAY_SIZE(ssp1_emmc_pins)); break; } mx28evk_init_pin_group(common_pins, ARRAY_SIZE(common_pins)); #if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)\ || defined(CONFIG_FEC_L2SWITCH) mx28evk_init_pin_group(mx28evk_eth_pins, ARRAY_SIZE(mx28evk_eth_pins)); #endif }