int omap_xhci_board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); #ifdef CONFIG_USB_DWC3 switch (index) { case 0: if (init == USB_INIT_DEVICE) { usb_otg_ss1.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; dwc3_omap_uboot_init(&usb_otg_ss1_glue); ti_usb_phy_uboot_init(&usb_phy1_device); dwc3_uboot_init(&usb_otg_ss1); } break; case 1: if (init == USB_INIT_DEVICE) { usb_otg_ss2.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; ti_usb_phy_uboot_init(&usb_phy2_device); dwc3_omap_uboot_init(&usb_otg_ss2_glue); dwc3_uboot_init(&usb_otg_ss2); } break; default: printf("Invalid Controller Index\n"); } #endif return 0; }
int board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); switch (index) { case 0: if (init == USB_INIT_DEVICE) { printf("port %d can't be used as device\n", index); disable_usb_clocks(index); return -EINVAL; } break; case 1: if (init == USB_INIT_DEVICE) { #ifdef CONFIG_USB_DWC3 usb_otg_ss2.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; ti_usb_phy_uboot_init(&usb_phy2_device); dwc3_omap_uboot_init(&usb_otg_ss2_glue); dwc3_uboot_init(&usb_otg_ss2); #endif } else { printf("port %d can't be used as host\n", index); disable_usb_clocks(index); return -EINVAL; } break; default: printf("Invalid Controller Index\n"); } return 0; }
int board_late_init(void) { #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG char *name = "unknown"; if (is_dra72x()) { if (board_is_dra72x_revc_or_later()) name = "dra72x-revc"; else if (board_is_dra71x_evm()) name = "dra71x"; else name = "dra72x"; } else if (is_dra76x_abz()) { name = "dra76x_abz"; } else if (is_dra76x_acd()) { name = "dra76x_acd"; } else { name = "dra7xx"; } set_board_info_env(name); /* * Default FIT boot on HS devices. Non FIT images are not allowed * on HS devices. */ if (get_device_type() == HS_DEVICE) env_set("boot_fit", "1"); omap_die_id_serial(); omap_set_fastboot_vars(); /* * Hook the LDO1 regulator to EN pin. This applies only to LP8733 * Rest all regulators are hooked to EN Pin at reset. */ if (board_is_dra71x_evm()) palmas_i2c_write_u8(LP873X_I2C_SLAVE_ADDR, 0x9, 0x7); #endif #if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL) if (device_okay("/ocp/omap_dwc3_1@48880000")) enable_usb_clocks(0); if (device_okay("/ocp/omap_dwc3_2@488c0000")) enable_usb_clocks(1); #endif return 0; }
int board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); switch (index) { case 0: if (init == USB_INIT_DEVICE) { printf("port %d can't be used as device\n", index); disable_usb_clocks(index); return -EINVAL; } else { usb_otg_ss1.dr_mode = USB_DR_MODE_HOST; usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_ID_GROUND; setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl, OTG_SS_CLKCTRL_MODULEMODE_HW | OPTFCLKEN_REFCLK960M); } ti_usb_phy_uboot_init(&usb_phy1_device); dwc3_omap_uboot_init(&usb_otg_ss1_glue); dwc3_uboot_init(&usb_otg_ss1); break; case 1: if (init == USB_INIT_DEVICE) { usb_otg_ss2.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; } else { printf("port %d can't be used as host\n", index); disable_usb_clocks(index); return -EINVAL; } ti_usb_phy_uboot_init(&usb_phy2_device); dwc3_omap_uboot_init(&usb_otg_ss2_glue); dwc3_uboot_init(&usb_otg_ss2); break; default: printf("Invalid Controller Index\n"); } return 0; }
int board_usb_init(int index, enum usb_init_type init) { if (index) { printf("Invalid Controller Index\n"); return -EINVAL; } if (init == USB_INIT_DEVICE) { usb_otg_ss.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; } else { usb_otg_ss.dr_mode = USB_DR_MODE_HOST; usb_otg_ss_glue.vbus_id_status = OMAP_DWC3_ID_GROUND; } enable_usb_clocks(index); ti_usb_phy_uboot_init(&usb_phy_device); dwc3_omap_uboot_init(&usb_otg_ss_glue); dwc3_uboot_init(&usb_otg_ss); return 0; }
int board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); switch (index) { case 0: if (init == USB_INIT_DEVICE) { usb_otg_ss1.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; } else { usb_otg_ss1.dr_mode = USB_DR_MODE_HOST; usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_ID_GROUND; } ti_usb_phy_uboot_init(&usb_phy1_device); dwc3_omap_uboot_init(&usb_otg_ss1_glue); dwc3_uboot_init(&usb_otg_ss1); break; case 1: if (init == USB_INIT_DEVICE) { usb_otg_ss2.dr_mode = USB_DR_MODE_PERIPHERAL; usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; } else { usb_otg_ss2.dr_mode = USB_DR_MODE_HOST; usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_ID_GROUND; } ti_usb_phy_uboot_init(&usb_phy2_device); dwc3_omap_uboot_init(&usb_otg_ss2_glue); dwc3_uboot_init(&usb_otg_ss2); break; default: printf("Invalid Controller Index\n"); } return 0; }
__weak int omap_xhci_board_usb_init(int index, enum usb_init_type init) { enable_usb_clocks(index); return 0; }