diff mbox

[U-Boot,2/2] mx6qsabrelite: add and enable USB Host 1 support

Message ID 1328714608-4888-3-git-send-email-wg@denx.de
State Accepted
Headers show

Commit Message

Wolfgang Grandegger Feb. 8, 2012, 3:23 p.m. UTC
Cc: Stefano Babic <sbabic@denx.de>
Cc: Jason Liu <jason.hui@linaro.org>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |   12 ++++++++++++
 include/configs/mx6qsabrelite.h               |   15 +++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

Comments

Fabio Estevam Feb. 8, 2012, 3:50 p.m. UTC | #1
On Wed, Feb 8, 2012 at 1:23 PM, Wolfgang Grandegger <wg@denx.de> wrote:

> --- a/include/configs/mx6qsabrelite.h
> +++ b/include/configs/mx6qsabrelite.h
> @@ -56,6 +56,21 @@
>  #define CONFIG_CMD_FAT
>  #define CONFIG_DOS_PARTITION
>
> +#if 1

Please remove this.

> +/* USB Configs */
> +#define CONFIG_CMD_USB
> +#define CONFIG_CMD_FAT
> +#define CONFIG_USB_EHCI
> +#define CONFIG_USB_EHCI_MX6
> +#define CONFIG_USB_STORAGE
> +#define CONFIG_USB_HOST_ETHER
> +#define CONFIG_USB_ETHER_ASIX
> +#define CONFIG_USB_ETHER_SMSC95XX
> +#define CONFIG_MXC_USB_PORT    1
> +#define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
> +#define CONFIG_MXC_USB_FLAGS   0
> +#endif
> +
>  /* allow to overwrite serial and ethaddr */
>  #define CONFIG_ENV_OVERWRITE
>  #define CONFIG_CONS_INDEX              1
> --
> 1.7.7.6
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Behme Dirk (CM/ESO2) Feb. 9, 2012, 7:18 a.m. UTC | #2
Hi Wolfgang,

On 08.02.2012 16:23, Wolfgang Grandegger wrote:
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Jason Liu <jason.hui@linaro.org>
> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
> ---
>  board/freescale/mx6qsabrelite/mx6qsabrelite.c |   12 ++++++++++++
>  include/configs/mx6qsabrelite.h               |   15 +++++++++++++++
>  2 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
> index 4028789..01ecec4 100644
> --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
> +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
> @@ -77,6 +77,18 @@ static void setup_iomux_uart(void)
>         imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
>  }
>  
> +#ifdef CONFIG_USB_EHCI_MX6
> +int board_ehci_hcd_init(int port)
> +{
> +	imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));

Where is the definition of 'usb_pads'?

mx6qsabrelite.c: error: 'usb_pads' undeclared (first use in this function)

> +	/* Reset USB hub */
> +	gpio_direction_output(204, 0); /* GPIO 7-12 */

With

http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=7861b0f3eb638df23b992f89229c3b416634b6fa

we might want to use something like

gpio_direction_output(GPIO_NUMBER(7, 12), 0);

?

Same below for gpio_set_value() ?

> +	mdelay(2);
> +	gpio_set_value(204, 1);
> +}

mx6qsabrelite.c: warning: no return statement in function returning non-void

Best regards

Dirk
Wolfgang Grandegger Feb. 9, 2012, 8:09 a.m. UTC | #3
Hi Dirk,

On 02/09/2012 08:18 AM, Dirk Behme wrote:
> Hi Wolfgang,
> 
> On 08.02.2012 16:23, Wolfgang Grandegger wrote:
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Jason Liu <jason.hui@linaro.org>
>> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
>> ---
>>  board/freescale/mx6qsabrelite/mx6qsabrelite.c |   12 ++++++++++++
>>  include/configs/mx6qsabrelite.h               |   15 +++++++++++++++
>>  2 files changed, 27 insertions(+), 0 deletions(-)
>>
>> diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
>> b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
>> index 4028789..01ecec4 100644
>> --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
>> +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
>> @@ -77,6 +77,18 @@ static void setup_iomux_uart(void)
>>         imx_iomux_v3_setup_multiple_pads(uart2_pads,
>> ARRAY_SIZE(uart2_pads));
>>  }
>>  
>> +#ifdef CONFIG_USB_EHCI_MX6
>> +int board_ehci_hcd_init(int port)
>> +{
>> +    imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
> 
> Where is the definition of 'usb_pads'?

Oops, that hunk gets lost when rebasing to head of u-boot-imx in a hurry:

@@ -122,6 +122,10 @@ iomux_v3_cfg_t enet_pads2[] = {
        MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL     | MUX_PAD_CTRL(ENET_PAD_CTRL),
 };
 
+iomux_v3_cfg_t usb_pads[] = {
+       MX6Q_PAD_GPIO_17__GPIO_7_12 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
 static void setup_iomux_enet(void)
 {
        gpio_direction_output(87, 0);  /* GPIO 3-23 */


Will be fixed in v2.

> 
> mx6qsabrelite.c: error: 'usb_pads' undeclared (first use in this function)
> 
>> +    /* Reset USB hub */
>> +    gpio_direction_output(204, 0); /* GPIO 7-12 */
> 
> With
> 
> http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=7861b0f3eb638df23b992f89229c3b416634b6fa
> 
> 
> we might want to use something like
> 
> gpio_direction_output(GPIO_NUMBER(7, 12), 0);

OK, unfortunately, that file is full of such calls using the
number directly ==> seperate patch.

> ?
> 
> Same below for gpio_set_value() ?
> 
>> +    mdelay(2);
>> +    gpio_set_value(204, 1);
>> +}
> 
> mx6qsabrelite.c: warning: no return statement in function returning
> non-void

Puh, v1 is obviously crap... will send v2 in a second, sorry.

Wolfgang.
diff mbox

Patch

diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index 4028789..01ecec4 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -77,6 +77,18 @@  static void setup_iomux_uart(void)
        imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
 }
 
+#ifdef CONFIG_USB_EHCI_MX6
+int board_ehci_hcd_init(int port)
+{
+	imx_iomux_v3_setup_multiple_pads(usb_pads, ARRAY_SIZE(usb_pads));
+
+	/* Reset USB hub */
+	gpio_direction_output(204, 0); /* GPIO 7-12 */
+	mdelay(2);
+	gpio_set_value(204, 1);
+}
+#endif
+
 #ifdef CONFIG_FSL_ESDHC
 struct fsl_esdhc_cfg usdhc_cfg[2] = {
        {USDHC3_BASE_ADDR, 1},
diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index 464f0ec..7e69734 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -56,6 +56,21 @@ 
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 
+#if 1
+/* USB Configs */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_MX6
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_MXC_USB_PORT	1
+#define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
+#define CONFIG_MXC_USB_FLAGS	0
+#endif
+
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX              1