static u32 __init omap2_usb2_init(unsigned nwires, unsigned alt_pingroup) { u32 syscon1 = 0; omap2_usb2_disable_5pinbitll(); alt_pingroup = 0; /* */ if (alt_pingroup || nwires == 0) return 0; omap_mux_init_signal("usb2_dat", 0); omap_mux_init_signal("usb2_se0", 0); if (nwires > 2) omap_mux_init_signal("usb2_txen", 0); if (nwires > 3) omap_mux_init_signal("usb2_rcv", 0); switch (nwires) { case 2: /* */ syscon1 = 1; omap2_usb_devconf_set(2, USB_BIDIR_TLL); break; case 3: syscon1 = 2; omap2_usb_devconf_set(2, USB_BIDIR); break; case 4: syscon1 = 1; omap2_usb_devconf_set(2, USB_BIDIR); break; case 5: /* */ syscon1 = 3; omap2_usb2_enable_5pinunitll(); break; case 6: default: printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", 2, nwires); } return syscon1 << 24; }
static u32 __init omap2_usb2_init(unsigned nwires, unsigned alt_pingroup) { u32 syscon1 = 0; omap2_usb2_disable_5pinbitll(); alt_pingroup = 0; /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */ if (alt_pingroup || nwires == 0) return 0; omap_mux_init_signal("usb2_dat", 0); omap_mux_init_signal("usb2_se0", 0); if (nwires > 2) omap_mux_init_signal("usb2_txen", 0); if (nwires > 3) omap_mux_init_signal("usb2_rcv", 0); switch (nwires) { case 2: /* NOTE: board-specific code must override this setting if * this TLL link is not using DP/DM */ syscon1 = 1; omap2_usb_devconf_set(2, USB_BIDIR_TLL); break; case 3: syscon1 = 2; omap2_usb_devconf_set(2, USB_BIDIR); break; case 4: syscon1 = 1; omap2_usb_devconf_set(2, USB_BIDIR); break; case 5: /* NOTE: board-specific code must mux this setting depending * on TLL link using DP/DM. Something must also * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED} * 2420: hdq_sio.usb2_tllse0 or vlynq_rx0.usb2_tllse0 * 2430: hdq_sio.usb2_tllse0 or sdmmc2_dat0.usb2_tllse0 */ syscon1 = 3; omap2_usb2_enable_5pinunitll(); break; case 6: default: printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", 2, nwires); } return syscon1 << 24; }
static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup) { u32 syscon1 = 0; if (cpu_is_omap24xx()) { omap2_usb2_disable_5pinbitll(); alt_pingroup = 0; } /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */ if (alt_pingroup || nwires == 0) return 0; if (cpu_class_is_omap1() && !cpu_is_omap15xx() && nwires != 6) { u32 l; l = omap_readl(USB_TRANSCEIVER_CTRL); l &= ~CONF_USB2_UNI_R; omap_writel(l, USB_TRANSCEIVER_CTRL); } /* external transceiver */ if (cpu_is_omap15xx()) { omap_cfg_reg(USB2_TXD); omap_cfg_reg(USB2_TXEN); omap_cfg_reg(USB2_SEO); if (nwires != 3) omap_cfg_reg(USB2_RCV); /* there is no USB2_SPEED */ } else if (cpu_is_omap16xx()) { omap_cfg_reg(V6_USB2_TXD); omap_cfg_reg(W9_USB2_TXEN); omap_cfg_reg(W5_USB2_SE0); if (nwires != 3) omap_cfg_reg(Y5_USB2_RCV); // FIXME omap_cfg_reg(USB2_SPEED); } else if (cpu_is_omap24xx()) { omap_cfg_reg(Y11_24XX_USB2_DAT); omap_cfg_reg(AA10_24XX_USB2_SE0); if (nwires > 2) omap_cfg_reg(AA12_24XX_USB2_TXEN); if (nwires > 3) omap_cfg_reg(AA6_24XX_USB2_RCV); } else { pr_debug("usb%d cpu unrecognized\n", 1); return 0; } // if (cpu_class_is_omap1()) omap_cfg_reg(USB2_SUSP); switch (nwires) { case 2: if (!cpu_is_omap24xx()) goto bad; /* NOTE: board-specific code must override this setting if * this TLL link is not using DP/DM */ syscon1 = 1; omap2_usb_devconf_set(2, USB_BIDIR_TLL); break; case 3: syscon1 = 2; if (cpu_is_omap24xx()) omap2_usb_devconf_set(2, USB_BIDIR); break; case 4: syscon1 = 1; if (cpu_is_omap24xx()) omap2_usb_devconf_set(2, USB_BIDIR); break; case 5: if (!cpu_is_omap24xx()) goto bad; omap_cfg_reg(AA4_24XX_USB2_TLLSE0); /* NOTE: board-specific code must override this setting if * this TLL link is not using DP/DM. Something must also * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED} */ syscon1 = 3; omap2_usb2_enable_5pinunitll(); break; case 6: if (cpu_is_omap24xx()) goto bad; syscon1 = 3; if (cpu_is_omap15xx()) { omap_cfg_reg(USB2_VP); omap_cfg_reg(USB2_VM); } else { u32 l; omap_cfg_reg(AA9_USB2_VP); omap_cfg_reg(R9_USB2_VM); l = omap_readl(USB_TRANSCEIVER_CTRL); l |= CONF_USB2_UNI_R; omap_writel(l, USB_TRANSCEIVER_CTRL); } break; default: bad: printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", 2, nwires); } return syscon1 << 24; }
static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup) { u32 syscon1 = 0; if (cpu_is_omap24xx()) { omap2_usb2_disable_5pinbitll(); alt_pingroup = 0; } if (alt_pingroup || nwires == 0) return 0; if (cpu_class_is_omap1() && !cpu_is_omap15xx() && nwires != 6) { u32 l; l = omap_readl(USB_TRANSCEIVER_CTRL); l &= ~CONF_USB2_UNI_R; omap_writel(l, USB_TRANSCEIVER_CTRL); } if (cpu_is_omap15xx()) { omap_cfg_reg(USB2_TXD); omap_cfg_reg(USB2_TXEN); omap_cfg_reg(USB2_SEO); if (nwires != 3) omap_cfg_reg(USB2_RCV); } else if (cpu_is_omap16xx()) { omap_cfg_reg(V6_USB2_TXD); omap_cfg_reg(W9_USB2_TXEN); omap_cfg_reg(W5_USB2_SE0); if (nwires != 3) omap_cfg_reg(Y5_USB2_RCV); } else if (cpu_is_omap24xx()) { omap_cfg_reg(Y11_24XX_USB2_DAT); omap_cfg_reg(AA10_24XX_USB2_SE0); if (nwires > 2) omap_cfg_reg(AA12_24XX_USB2_TXEN); if (nwires > 3) omap_cfg_reg(AA6_24XX_USB2_RCV); } else { pr_debug("usb%d cpu unrecognized\n", 1); return 0; } switch (nwires) { case 2: if (!cpu_is_omap24xx()) goto bad; syscon1 = 1; omap2_usb_devconf_set(2, USB_BIDIR_TLL); break; case 3: syscon1 = 2; if (cpu_is_omap24xx()) omap2_usb_devconf_set(2, USB_BIDIR); break; case 4: syscon1 = 1; if (cpu_is_omap24xx()) omap2_usb_devconf_set(2, USB_BIDIR); break; case 5: if (!cpu_is_omap24xx()) goto bad; omap_cfg_reg(AA4_24XX_USB2_TLLSE0); syscon1 = 3; omap2_usb2_enable_5pinunitll(); break; case 6: if (cpu_is_omap24xx()) goto bad; syscon1 = 3; if (cpu_is_omap15xx()) { omap_cfg_reg(USB2_VP); omap_cfg_reg(USB2_VM); } else { u32 l; omap_cfg_reg(AA9_USB2_VP); omap_cfg_reg(R9_USB2_VM); l = omap_readl(USB_TRANSCEIVER_CTRL); l |= CONF_USB2_UNI_R; omap_writel(l, USB_TRANSCEIVER_CTRL); } break; default: bad: printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", 2, nwires); } return syscon1 << 24; }