Skip to contentSkip to conversation

i.MX25 3-stack - over-current change on port 1 - USB host port not working

DISCUSSION Teemu Peltola 4 participants 6 messages Mar 16, 2011 – Mar 30, 2011 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

Hi,

I have Freescale i.MX25 3-stack development board + debug board attached to it. I have built barebox-2011.03.0 using freescale_mx25_3stack_defconfig with some modifications to support NAND booting (see below). I have used buildroot-2011.02 to create 2.6.38 kernel (CONFIG_MACH_MX25_3DS=y etc.) and rootfs images.

When I boot these images from barebox, dmesg displays the following error message constantly and USB host port does not work:

mxc-ehci mxc-ehci.1: GetStatus port:1 status cc001020 102 ACK POWER sig=se0 OCC hub 1-0:1.0: over-current change on port 1
hub 1-0:1.0: enabling power on all ports
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

If I try to use Freescale RedBoot (mx25_3stack_redboot_TO1_1.bin from L2.6.31_09.12.00_SDK_images_MX25 package) with the same kernel and rootfs, USB works. Is there some initialization that is missing from barebox?

Here is my barebox diff to freescale_mx25_3stack_defconfig:

--- a/barebox-2011.03.0/arch/arm/configs/freescale_mx25_3stack_defconfig

 2011-03-03 16:59:35.000000000 +0200
+++ b/barebox-2011.03.0/arch/arm/configs/freescale_mx25_3stack_defconfig 
  2011-03-14 15:30:01.911346340 +0200

@@ -1,4 +1,5 @@
CONFIG_ARCH_IMX=y
+CONFIG_ARCH_IMX_INTERNAL_BOOT=y
CONFIG_ARCH_IMX25=y
CONFIG_MACH_FREESCALE_MX25_3STACK=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -16,9 +17,14 @@
CONFIG_CMD_EXPORT=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_READLINE=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_LOADB=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_CRC=y
CONFIG_CMD_FLASH=y
+CONFIG_CMD_BOOTM_ZLIB=y
+CONFIG_CMD_BOOTM_BZLIB=y
+CONFIG_CMD_BOOTM_SHOW_TYPE=y
CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
CONFIG_CMD_TIMEOUT=y
@@ -30,5 +36,10 @@
CONFIG_NET_TFTP=y
CONFIG_DRIVER_NET_FEC_IMX=y
# CONFIG_SPI is not set
+CONFIG_I2C=y
+CONFIG_I2C_IMX=y
+CONFIG_MTD=y
+CONFIG_NAND=y
+CONFIG_NAND_IMX=y
CONFIG_USB=y
CONFIG_USB_EHCI=y

BR,

Teemu

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

Hi,

Quoted 9 lines · Teemu Peltola

I have Freescale i.MX25 3-stack development board + debug board attached to it. I have built barebox-2011.03.0 using freescale_mx25_3stack_defconfig with some modifications to support NAND booting (see below). I have used buildroot-2011.02 to create 2.6.38 kernel (CONFIG_MACH_MX25_3DS=y etc.) and rootfs images.

When I boot these images from barebox, dmesg displays the following error message constantly and USB host port does not work:

Quoted 9 lines

mxc-ehci mxc-ehci.1: GetStatus port:1 status cc001020 102 ACK POWER sig=se0 OCC hub 1-0:1.0: over-current change on port 1
hub 1-0:1.0: enabling power on all ports
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

If I try to use Freescale RedBoot (mx25_3stack_redboot_TO1_1.bin from L2.6.31_09.12.00_SDK_images_MX25 package) with the same kernel and rootfs, USB works. Is there some initialization that is missing from barebox?

if you don't need USB in barebox don't enable it. I also have problems with OTG port under Linux when it's enabled under barebox. I didn't yet found time to investigate.

Eric

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw
Quoted 21 lines · Eric Bénard

Hi,

Quoted 18 lines · Teemu Peltola

I have Freescale i.MX25 3-stack development board + debug board attached to
it. I have built barebox-2011.03.0 using freescale_mx25_3stack_defconfig with
some modifications to support NAND booting (see below). I have used buildroot-2011.02 to create 2.6.38 kernel (CONFIG_MACH_MX25_3DS=y etc.) and
rootfs images.

When I boot these images from barebox, dmesg displays the following error message constantly and USB host port does not work:

mxc-ehci mxc-ehci.1: GetStatus port:1 status cc001020 102 ACK POWER sig=se0 OCC
hub 1-0:1.0: over-current change on port 1
hub 1-0:1.0: enabling power on all ports
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

Quoted 8 lines
Quoted 5 lines

If I try to use Freescale RedBoot (mx25_3stack_redboot_TO1_1.bin from L2.6.31_09.12.00_SDK_images_MX25 package) with the same kernel and rootfs, USB
works. Is there some initialization that is missing from barebox?

if you don't need USB in barebox don't enable it. I also have problems with OTG port under Linux when it's enabled under barebox. I didn't yet found time to investigate.

Disabling USB in barebox did not help.

--
Teemu

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw

Re: Atmel status

Dimitry,

Quoted 2 lines · Dvorkin Dmitry

what is the status of the barebox for Atmel? Anyone tested it with any SAM* devkits?

Yes.

Quoted 2 lines

I see a big potential of barebox, I like it's structure and design and I'm interested in sam9m10g45ek support.

We have Barebox running on the G45 and on several other older AT91SAM9 chips. Note that not all features might be supported, but it boots :-)

Best Regards,
Robert Schwebel

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw
In reply to Teemu Peltola
Quoted 28 lines · Teemu Peltola
Quoted 27 lines · Eric Bénard

Hi,

Quoted 24 lines · Teemu Peltola

I have Freescale i.MX25 3-stack development board + debug board attached to
it. I have built barebox-2011.03.0 using freescale_mx25_3stack_defconfig with
some modifications to support NAND booting (see below). I have used buildroot-2011.02 to create 2.6.38 kernel (CONFIG_MACH_MX25_3DS=y etc.) and
rootfs images.

When I boot these images from barebox, dmesg displays the following error
message constantly and USB host port does not work:

mxc-ehci mxc-ehci.1: GetStatus port:1 status cc001020 102 ACK POWER sig=se0 OCC
hub 1-0:1.0: over-current change on port 1
hub 1-0:1.0: enabling power on all ports
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002

If I try to use Freescale RedBoot (mx25_3stack_redboot_TO1_1.bin from L2.6.31_09.12.00_SDK_images_MX25 package) with the same kernel and rootfs, USB
works. Is there some initialization that is missing from barebox?

Quoted 5 lines
Quoted 3 lines

if you don't need USB in barebox don't enable it. I also have problems with OTG port under Linux when it's enabled under barebox. I didn't yet found time to investigate.

Disabling USB in barebox did not help.

It seems that USBH2_PWR signal is not powered. The following patch for barebox-2011.03.0 seems to work, using it as GPIO:

barebox-2011.03.0/arch/arm/boards/freescale-mx25-3-stack/3stack.c 2011-03-29 09:18:53.675014266 +0300 renamed from barebox-2011.03.0/arch/arm/boards/freescale-mx25-3-stack/3stack.c 2011-03-29 09:16:54.247015588 +0300 +8 -14
@@ -168,6 +168,11 @@
        /* Set to Host mode */
        tmp = readl(IMX_OTG_BASE + 0x5a8);
        writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
+
+/* usb_top_USBH2_PWR, gpio4_GPIO[11] */
+#define USB_PWR_GPIO 107
+
+       gpio_direction_output(USB_PWR_GPIO, 1);
 }
 
 static struct device_d usbh2_dev = {
@@ -288,20 +293,9 @@
        MX25_PAD_UART1_RTS__RTS,
        MX25_PAD_UART1_CTS__CTS,
        /* USBH2 */
-       MX25_PAD_D9__USBH2_PWR,
-       MX25_PAD_D8__USBH2_OC,
-       MX25_PAD_LD0__USBH2_CLK,
-       MX25_PAD_LD1__USBH2_DIR,
-       MX25_PAD_LD2__USBH2_STP,
-       MX25_PAD_LD3__USBH2_NXT,
-       MX25_PAD_LD4__USBH2_DATA0,
-       MX25_PAD_LD5__USBH2_DATA1,
-       MX25_PAD_LD6__USBH2_DATA2,
-       MX25_PAD_LD7__USBH2_DATA3,
-       MX25_PAD_HSYNC__USBH2_DATA4,
-       MX25_PAD_VSYNC__USBH2_DATA5,
-       MX25_PAD_LSCLK__USBH2_DATA6,
-       MX25_PAD_OE_ACD__USBH2_DATA7,
+#ifdef CONFIG_USB
+       MX25_PAD_D9__GPIO11,
+#endif
        /* i2c */
        MX25_PAD_I2C1_CLK__SCL,
        MX25_PAD_I2C1_DAT__SDA,

And for Linux 2.6.38.2:

linux-2.6.38.2/arch/arm/mach-imx/mach-mx25_3ds.c 2011-03-29 10:49:33.574515896 +0300 renamed from linux-2.6.38.2/arch/arm/mach-imx/mach-mx25_3ds.c.orig 2011-03-27 21:37:20.000000000 +0300 +12 -0
@@ -103,6 +103,9 @@
        MX25_PAD_SD1_DATA1__SD1_DATA1,
        MX25_PAD_SD1_DATA2__SD1_DATA2,
        MX25_PAD_SD1_DATA3__SD1_DATA3,
+
+       /* Use USBH2_PWR signal as gpio to enable USB */
+       MX25_PAD_D9__GPIO_4_11
 };
 
 static const struct fec_platform_data mx25_fec_pdata __initconst = {
@@ -126,6 +129,14 @@
        gpio_set_value(FEC_RESET_B_GPIO, 1);
 }
 
+#define USBH2_PWR_GPIO         IMX_GPIO_NR(4,11)
+
+static void __init imx25_usb_h2_powerup(void)
+{
+       gpio_request(USBH2_PWR_GPIO, "USBH2 PWR");
+       gpio_direction_output(USBH2_PWR_GPIO, 1);  /* Power up */
+}
+
 static const struct mxc_nand_platform_data
 mx25pdk_nand_board_info __initconst = {
        .width          = 1,
@@ -203,6 +214,7 @@
        imx25_add_imx_uart0(&uart_pdata);
        imx25_add_fsl_usb2_udc(&otg_device_pdata);
        imx25_add_mxc_ehci_hs(&usbh2_pdata);
+       imx25_usb_h2_powerup();
        imx25_add_mxc_nand(&mx25pdk_nand_board_info);
        imx25_add_imxdi_rtc(NULL);
        imx25_add_imx_fb(&mx25pdk_fb_pdata);

BR,

Teemu

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox