static void __init pca100_init(void) { int ret; imx27_soc_init(); /* SSI unit */ mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ MXC_AUDMUX_V1_PCR_TFCSEL(3) | MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */ MXC_AUDMUX_V1_PCR_RXDSEL(3)); mxc_audmux_v1_configure_port(3, MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ MXC_AUDMUX_V1_PCR_TFCSEL(0) | MXC_AUDMUX_V1_PCR_TFSDIR | MXC_AUDMUX_V1_PCR_RXDSEL(0)); ret = mxc_gpio_setup_multiple_pins(pca100_pins, ARRAY_SIZE(pca100_pins), "PCA100"); if (ret) printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); imx27_add_imx_ssi(0, &pca100_ssi_pdata); imx27_add_imx_uart0(&uart_pdata); imx27_add_mxc_mmc(1, &sdhc_pdata); imx27_add_mxc_nand(&pca100_nand_board_info); /* only the i2c master 1 is used on this CPU card */ i2c_register_board_info(1, pca100_i2c_devices, ARRAY_SIZE(pca100_i2c_devices)); imx27_add_imx_i2c(1, &pca100_i2c1_data); mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN); mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN); spi_register_board_info(pca100_spi_board_info, ARRAY_SIZE(pca100_spi_board_info)); imx27_add_spi_imx0(&pca100_spi0_data); gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs"); gpio_direction_output(OTG_PHY_CS_GPIO, 1); gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs"); gpio_direction_output(USBH2_PHY_CS_GPIO, 1); if (otg_mode_host) { otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); if (otg_pdata.otg) imx27_add_mxc_ehci_otg(&otg_pdata); } else { gpio_set_value(OTG_PHY_CS_GPIO, 0); imx27_add_fsl_usb2_udc(&otg_device_pdata); } usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); if (usbh2_pdata.otg) imx27_add_mxc_ehci_hs(2, &usbh2_pdata); imx27_add_imx_fb(&pca100_fb_data); imx27_add_fec(NULL); imx27_add_imx2_wdt(NULL); imx27_add_mxc_w1(NULL); }
/* * Board specific initialization. */ static void __init mxc_board_init(void) { int ret; u32 tmp; mxc_iomux_set_gpr(MUX_PGP_UH2, 1); mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins), "pcm037"); #define H2_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS \ | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, H2_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, H2_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, H2_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_USBH2_STP, H2_PAD_CFG); mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, H2_PAD_CFG); /* USBH2_DATA0 */ mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, H2_PAD_CFG); /* USBH2_DATA1 */ mxc_iomux_set_pad(MX31_PIN_SRXD6, H2_PAD_CFG); /* USBH2_DATA2 */ mxc_iomux_set_pad(MX31_PIN_STXD6, H2_PAD_CFG); /* USBH2_DATA3 */ mxc_iomux_set_pad(MX31_PIN_SFS3, H2_PAD_CFG); /* USBH2_DATA4 */ mxc_iomux_set_pad(MX31_PIN_SCK3, H2_PAD_CFG); /* USBH2_DATA5 */ mxc_iomux_set_pad(MX31_PIN_SRXD3, H2_PAD_CFG); /* USBH2_DATA6 */ mxc_iomux_set_pad(MX31_PIN_STXD3, H2_PAD_CFG); /* USBH2_DATA7 */ if (pcm037_variant() == PCM037_EET) mxc_iomux_setup_multiple_pins(pcm037_uart1_pins, ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1"); else mxc_iomux_setup_multiple_pins(pcm037_uart1_handshake_pins, ARRAY_SIZE(pcm037_uart1_handshake_pins), "pcm037_uart1"); platform_add_devices(devices, ARRAY_SIZE(devices)); mxc_register_device(&mxc_uart_device0, &uart_pdata); mxc_register_device(&mxc_uart_device1, &uart_pdata); mxc_register_device(&mxc_uart_device2, &uart_pdata); mxc_register_device(&mxc_w1_master_device, NULL); /* LAN9217 IRQ pin */ ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1), "lan9217-irq"); if (ret) pr_warning("could not get LAN irq gpio\n"); else { gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); platform_device_register(&pcm037_eth); } /* I2C adapters and devices */ i2c_register_board_info(1, pcm037_i2c_devices, ARRAY_SIZE(pcm037_i2c_devices)); mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data); mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); mxc_register_device(&mx3_ipu, &mx3_ipu_data); mxc_register_device(&mx3_fb, &mx3fb_pdata); /* CSI */ /* Camera power: default - off */ ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power"); if (!ret) gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1); else iclink_mt9t031.power = NULL; if (!pcm037_camera_alloc_dma(4 * 1024 * 1024)) mxc_register_device(&mx3_camera, &camera_pdata); platform_device_register(&pcm970_sja1000); #if defined(CONFIG_USB_ULPI) if (otg_mode_host) { otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); mxc_register_device(&mxc_otg_host, &otg_pdata); } usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); mxc_register_device(&mxc_usbh2, &usbh2_pdata); #endif if (!otg_mode_host) mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); }
static void __init pca100_init(void) { int ret; /* SSI unit */ mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ MXC_AUDMUX_V1_PCR_TFCSEL(3) | MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */ MXC_AUDMUX_V1_PCR_RXDSEL(3)); mxc_audmux_v1_configure_port(3, MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */ MXC_AUDMUX_V1_PCR_TFCSEL(0) | MXC_AUDMUX_V1_PCR_TFSDIR | MXC_AUDMUX_V1_PCR_RXDSEL(0)); ret = mxc_gpio_setup_multiple_pins(pca100_pins, ARRAY_SIZE(pca100_pins), "PCA100"); if (ret) printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata); mxc_register_device(&mxc_uart_device0, &uart_pdata); mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN); mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); mxc_register_device(&imx27_nand_device, &pca100_nand_board_info); /* only the i2c master 1 is used on this CPU card */ i2c_register_board_info(1, pca100_i2c_devices, ARRAY_SIZE(pca100_i2c_devices)); mxc_register_device(&mxc_i2c_device1, &pca100_i2c_1_data); mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_OUT); /* GPIO0_IRQ */ mxc_gpio_mode(GPIO_PORTC | 31 | GPIO_GPIO | GPIO_IN); /* GPIO1_IRQ */ mxc_gpio_mode(GPIO_PORTC | 25 | GPIO_GPIO | GPIO_IN); /* GPIO2_IRQ */ mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_IN); #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) spi_register_board_info(pca100_spi_board_info, ARRAY_SIZE(pca100_spi_board_info)); mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data); #endif gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs"); gpio_direction_output(OTG_PHY_CS_GPIO, 1); gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs"); gpio_direction_output(USBH2_PHY_CS_GPIO, 1); #if defined(CONFIG_USB_ULPI) if (otg_mode_host) { otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); mxc_register_device(&mxc_otg_host, &otg_pdata); } usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT); mxc_register_device(&mxc_usbh2, &usbh2_pdata); #endif if (!otg_mode_host) { gpio_set_value(OTG_PHY_CS_GPIO, 0); mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); } platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); }