void __init archos_usb_ehci_init(void) { const struct archos_usb_config *usb_cfg; usb_cfg = omap_get_config( ARCHOS_TAG_USB, struct archos_usb_config ); if (usb_cfg == NULL) { printk(KERN_DEBUG "%s: no board configuration found\n", __FUNCTION__); return; } if ( hardware_rev >= usb_cfg->nrev ) { printk(KERN_DEBUG "%s: hardware_rev (%i) >= nrev (%i)\n", __FUNCTION__, hardware_rev, usb_cfg->nrev); return; } if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_usb_hub) != 0 ) { gio_hub_enable = usb_cfg->rev[hardware_rev].enable_usb_hub; archos_gpio_init_output(&gio_hub_enable, "hub enable"); } if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_5v) != 0 ) { gio_5v_enable = usb_cfg->rev[hardware_rev].enable_5v; archos_gpio_init_output(&gio_5v_enable, "5v enable"); } if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_usb_ehci) != 0 ) { gio_ehci_enable = usb_cfg->rev[hardware_rev].enable_usb_ehci; archos_gpio_init_output(&gio_ehci_enable, "ehci enable"); archos_enable_ehci( 0 ); setup_ehci_io_mux(); } #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE) if (platform_device_register(&ehci_device) < 0) { printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n"); return; } #endif if (platform_device_register(&archos_ehci_device) < 0) printk(KERN_ERR "Unable to register Archos EHCI device\n"); device_create_file(&archos_ehci_device.dev, &dev_attr_ehci_enable); device_create_file(&archos_ehci_device.dev, &dev_attr_hub_enable); platform_driver_register(&archos_ehci_driver); }
void __init usb_ehci_init(void) { const struct archos_usb_config *usb_cfg; usb_cfg = omap_get_config( ARCHOS_TAG_USB, struct archos_usb_config ); if (usb_cfg == NULL) { printk(KERN_DEBUG "archos_usb_init: no board configuration found\n"); return; } if ( hardware_rev >= usb_cfg->nrev ) { printk(KERN_DEBUG "archos_usb_init: hardware_rev (%i) >= nrev (%i)\n", hardware_rev, usb_cfg->nrev); return; } if ( GPIO_PIN (usb_cfg->rev[hardware_rev].enable_usb_ehci) != 0 ) { gio_ehci_enable = usb_cfg->rev[hardware_rev].enable_usb_ehci; GPIO_INIT_OUTPUT( gio_ehci_enable ); #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE) ehci_plat.usb_enable_pin = GPIO_PIN( gio_ehci_enable ); ehci_plat.usb_enable_delay = 10; #endif /* reset the PHY */ archos_enable_ehci( 0 ); // udelay(2); // archos_enable_ehci( 1 ); if ( machine_is_archos_a5h() || machine_is_archos_a5s() || machine_is_archos_a5hg() || machine_is_archos_a5sg() || machine_is_archos_a5hgw() || machine_is_archos_a5sgw() || machine_is_archos_a5sc() || machine_is_archos_a5st() || machine_is_archos_a5gcam() ) { /* pin mux for EHCI Port 1 */ omap_cfg_reg(AE10_3430_USB1HS_PHY_CLK); omap_cfg_reg(AF10_3430_USB1HS_PHY_STP); omap_cfg_reg(AF9_3430_USB1HS_PHY_DIR); omap_cfg_reg(AG9_3430_USB1HS_PHY_NXT); omap_cfg_reg(AF11_3430_USB1HS_PHY_DATA0); omap_cfg_reg(AG12_3430_USB1HS_PHY_DATA1); omap_cfg_reg(AH12_3430_USB1HS_PHY_DATA2); omap_cfg_reg(AH14_3430_USB1HS_PHY_DATA3); omap_cfg_reg(AE11_3430_USB1HS_PHY_DATA4); omap_cfg_reg(AH9_3430_USB1HS_PHY_DATA5); omap_cfg_reg(AF13_3430_USB1HS_PHY_DATA6); omap_cfg_reg(AE13_3430_USB1HS_PHY_DATA7); } else { // gen6 /* pin mux for EHCI Port 2 */ omap_cfg_reg(AE7_3430_USB2HS_PHY_CLK); omap_cfg_reg(AF7_3430_USB2HS_PHY_STP); omap_cfg_reg(AG7_3430_USB2HS_PHY_DIR); omap_cfg_reg(AH7_3430_USB2HS_PHY_NXT); omap_cfg_reg(AG8_3430_USB2HS_PHY_DATA0); omap_cfg_reg(AH8_3430_USB2HS_PHY_DATA1); omap_cfg_reg(AB2_3430_USB2HS_PHY_DATA2); omap_cfg_reg(V3_3430_USB2HS_PHY_DATA3); omap_cfg_reg(Y2_3430_USB2HS_PHY_DATA4); omap_cfg_reg(Y3_3430_USB2HS_PHY_DATA5); omap_cfg_reg(Y4_3430_USB2HS_PHY_DATA6); omap_cfg_reg(AA3_3430_USB2HS_PHY_DATA7); } } #if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE) if (platform_device_register(&ehci_device) < 0) { printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n"); return; } #endif if (platform_device_register(&archos_ehci_device) < 0) printk(KERN_ERR "Unable to register Archos EHCI device\n"); platform_driver_register(&archos_ehci_driver); }