* [U-Boot] [PATCH] pico-imx6ul: Add USB Host support
@ 2016-06-13 16:01 Vanessa Maegima
2016-06-13 16:49 ` Fabio Estevam
0 siblings, 1 reply; 4+ messages in thread
From: Vanessa Maegima @ 2016-06-13 16:01 UTC (permalink / raw)
To: u-boot
Add USB host support.
Tested by connecting a USB pen drive:
=> usb start
starting USB...
USB0: Port not available.
USB1: USB EHCI 1.00
scanning bus 1 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com>
---
board/technexion/pico-imx6ul/pico-imx6ul.c | 24 +++++++++++++++++++++++-
include/configs/pico-imx6ul.h | 2 +-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/board/technexion/pico-imx6ul/pico-imx6ul.c b/board/technexion/pico-imx6ul/pico-imx6ul.c
index c038d43..bdf32f4 100644
--- a/board/technexion/pico-imx6ul/pico-imx6ul.c
+++ b/board/technexion/pico-imx6ul/pico-imx6ul.c
@@ -59,6 +59,9 @@ static iomux_v3_cfg_t const usdhc1_pads[] = {
MX6_PAD_NAND_CLE__USDHC1_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
};
+#define USB_OTHERREGS_OFFSET 0x800
+#define UCTRL_PWR_POL (1 << 9)
+
static iomux_v3_cfg_t const usb_otg_pad[] = {
MX6_PAD_GPIO1_IO00__ANATOP_OTG1_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL),
};
@@ -98,7 +101,26 @@ int board_early_init_f(void)
int board_usb_phy_mode(int port)
{
- return USB_INIT_DEVICE;
+ if (port == 1)
+ return USB_INIT_HOST;
+ else
+ return USB_INIT_DEVICE;
+}
+
+int board_ehci_hcd_init(int port)
+{
+ u32 *usbnc_usb_ctrl;
+
+ if (port > 1)
+ return -EINVAL;
+
+ usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET +
+ port * 4);
+
+ /* Set Power polarity */
+ setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
+
+ return 0;
}
int board_init(void)
diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index d848ead..01edc03 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -42,7 +42,7 @@
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* Only OTG1 port enabled */
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_CI_UDC
#define CONFIG_USBD_HS
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [U-Boot] [PATCH] pico-imx6ul: Add USB Host support
2016-06-13 16:01 [U-Boot] [PATCH] pico-imx6ul: Add USB Host support Vanessa Maegima
@ 2016-06-13 16:49 ` Fabio Estevam
2016-07-11 12:41 ` Fabio Estevam
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2016-06-13 16:49 UTC (permalink / raw)
To: u-boot
On Mon, Jun 13, 2016 at 1:01 PM, Vanessa Maegima
<vanessa.maegima@nxp.com> wrote:
> Add USB host support.
>
> Tested by connecting a USB pen drive:
>
> => usb start
> starting USB...
> USB0: Port not available.
> USB1: USB EHCI 1.00
> scanning bus 1 for devices... 2 USB Device(s) found
> scanning usb for storage devices... 1 Storage Device(s) found
>
> Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] pico-imx6ul: Add USB Host support
2016-06-13 16:49 ` Fabio Estevam
@ 2016-07-11 12:41 ` Fabio Estevam
2016-07-11 13:46 ` Stefano Babic
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2016-07-11 12:41 UTC (permalink / raw)
To: u-boot
Hi Stefano,
On Mon, Jun 13, 2016 at 1:49 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Jun 13, 2016 at 1:01 PM, Vanessa Maegima
> <vanessa.maegima@nxp.com> wrote:
>> Add USB host support.
>>
>> Tested by connecting a USB pen drive:
>>
>> => usb start
>> starting USB...
>> USB0: Port not available.
>> USB1: USB EHCI 1.00
>> scanning bus 1 for devices... 2 USB Device(s) found
>> scanning usb for storage devices... 1 Storage Device(s) found
>>
>> Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com>
>
> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Looks like this one did not go into your -next branch yet.
Please consider applying it if you are happy with it.
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] pico-imx6ul: Add USB Host support
2016-07-11 12:41 ` Fabio Estevam
@ 2016-07-11 13:46 ` Stefano Babic
0 siblings, 0 replies; 4+ messages in thread
From: Stefano Babic @ 2016-07-11 13:46 UTC (permalink / raw)
To: u-boot
On 11/07/2016 14:41, Fabio Estevam wrote:
> Hi Stefano,
>
> On Mon, Jun 13, 2016 at 1:49 PM, Fabio Estevam <festevam@gmail.com> wrote:
>> On Mon, Jun 13, 2016 at 1:01 PM, Vanessa Maegima
>> <vanessa.maegima@nxp.com> wrote:
>>> Add USB host support.
>>>
>>> Tested by connecting a USB pen drive:
>>>
>>> => usb start
>>> starting USB...
>>> USB0: Port not available.
>>> USB1: USB EHCI 1.00
>>> scanning bus 1 for devices... 2 USB Device(s) found
>>> scanning usb for storage devices... 1 Storage Device(s) found
>>>
>>> Signed-off-by: Vanessa Maegima <vanessa.maegima@nxp.com>
>>
>> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
>
> Looks like this one did not go into your -next branch yet.
>
> Please consider applying it if you are happy with it.
>
Ok, thnaks - I will push it.
Regards,
Stefano
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-11 13:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 16:01 [U-Boot] [PATCH] pico-imx6ul: Add USB Host support Vanessa Maegima
2016-06-13 16:49 ` Fabio Estevam
2016-07-11 12:41 ` Fabio Estevam
2016-07-11 13:46 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox