My board mount a microprocessor imx6SX with two USB.
My goal is to use one of the USB as OTG if I force the boot from Serial Downloader by the pins BOOT_MODE[1:0],
in case of Boot From Fuses use this USB as HOST as the other one.
This does mean that I have two different file of u-boot. One to download by OTG and one to save in eMMC.
My setting in the U-BOOT are:
But the result is that one USB works always as OTG.
Do you have any suggestion ? Is correct the solution that I'm trying ?
Thanks in advanced.
My setting:
&usbotg1 {
vbus-supply = <®_usb_otg1_vbus>;
srp-disable;
hnp-disable;
adp-disable;
dr_mode = "host";
status = "okay";
};
&usbotg2 {
vbus-supply = <®_usb_otg2_vbus>;
dr_mode = "host";
status = "okay";
};
pinctrl_usb_otg1: usbotg1grp {
fsl,pins = <
MX6SX_PAD_GPIO1_IO09__GPIO1_IO_9 0x10b0
>;
};
pinctrl_usb_otg2: usbot2ggrp {
fsl,pins = <
MX6SX_PAD_GPIO1_IO12__GPIO1_IO_12 0x10b0
>;
}
static iomux_v3_cfg_t const usb_otg_pads[] = {
/* OGT1 */
MX6_PAD_GPIO1_IO09__USB_OTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), /* OTG1_PWR */
/* OTG2 */
MX6_PAD_GPIO1_IO12__USB_OTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL), /* OTG2_PWR */
};
static void setup_usb(void)
{
imx_iomux_v3_setup_multiple_pads(usb_otg_pads,
ARRAY_SIZE(usb_otg_pads));
}
Hi Antonio,
See my advice below, please!
1. USB OTG
OTG means Dual Role Port, this is the USB can work at Host mode OR device mode.
2. USB OTG should be supported by Hardware
--Host mode: USB OTG ID should be pulled down to LOW via 2.2K/3.3K etc.
--Device mode: USB OTG ID should be pulled up to High via a resistor(10k/4.7k etc)
So you should ask hardware engineer to help you support it on your board according above rules.
Hope above information is helpful for you.
Have a nice day!
BR,
Weidong