* USB On PCM043?
@ 2012-07-19 15:37 Jerry Kirk
2012-07-19 16:11 ` Sascha Hauer
0 siblings, 1 reply; 11+ messages in thread
From: Jerry Kirk @ 2012-07-19 15:37 UTC (permalink / raw)
To: barebox
We have been attempting to get USB Host mode working under Barebox(2012-07-0) on
a PCM043 platform (i.mx35), but we are having a bit of trouble.
We have merged the CONFIG_USB specific code for "imx35_devices_init" and
"imx35_usb_init" from the Eukrea platform into pcm043.c, added the
"MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR" and "MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC"
pad definitions (as per the main kernel pcm043.c file), added the "tmp |= 0x3 <<
CCM_CGR2_USB_SHIFT" to enable the USB clock to "pcm043_core_setup", built
everything with the "usb" command enabled, and then loaded the new Barebox image
into our pcm043 board. We have USB_EHCI and USB_STORAGE enabled in the Barebox
config.
If I execute the "usb" command then it returns that it has found 1 EHCI
controller. If I plug in any device, the only one it has EVER detected has been
a USB mouse. It will be detected most of the time following a reset and after
unplugging/replugging the mouse -- but will never be detected again after this
unless I do a reset/replug operation (and never on a "usb -f" forced redetect).
Basically, our goal is to get USB flash drives working for use as a means of
upgrading our Linux kernel in the field -- but right now it won't even EVER
recognize a USB flash drive when it is plugged into the unit. We also know it is
not a hardware problem as all USB devices work just fine once the full kernel
finishes booting.
From what we have read, it looks like the Eukrea platform had USB working in it,
and we have attempted to use it as a guide, but we still aren't having any luck.
Does anyone know of any steps we might be missing? Or of anyone who has gotten
USB host mode working on a pcm043 under Barebox before?
I think we are close, but something (obviously) still isn't right.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: USB On PCM043?
2012-07-19 15:37 USB On PCM043? Jerry Kirk
@ 2012-07-19 16:11 ` Sascha Hauer
2012-07-19 20:56 ` Jerry Kirk
0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2012-07-19 16:11 UTC (permalink / raw)
To: Jerry Kirk; +Cc: barebox
On Thu, Jul 19, 2012 at 03:37:47PM +0000, Jerry Kirk wrote:
> We have been attempting to get USB Host mode working under Barebox(2012-07-0) on
> a PCM043 platform (i.mx35), but we are having a bit of trouble.
>
> We have merged the CONFIG_USB specific code for "imx35_devices_init" and
> "imx35_usb_init" from the Eukrea platform into pcm043.c, added the
> "MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR" and "MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC"
> pad definitions (as per the main kernel pcm043.c file), added the "tmp |= 0x3 <<
> CCM_CGR2_USB_SHIFT" to enable the USB clock to "pcm043_core_setup", built
> everything with the "usb" command enabled, and then loaded the new Barebox image
> into our pcm043 board. We have USB_EHCI and USB_STORAGE enabled in the Barebox
> config.
>
> If I execute the "usb" command then it returns that it has found 1 EHCI
> controller. If I plug in any device, the only one it has EVER detected has been
> a USB mouse. It will be detected most of the time following a reset and after
> unplugging/replugging the mouse -- but will never be detected again after this
> unless I do a reset/replug operation (and never on a "usb -f" forced redetect).
>
> Basically, our goal is to get USB flash drives working for use as a means of
> upgrading our Linux kernel in the field -- but right now it won't even EVER
> recognize a USB flash drive when it is plugged into the unit. We also know it is
> not a hardware problem as all USB devices work just fine once the full kernel
> finishes booting.
>
> From what we have read, it looks like the Eukrea platform had USB working in it,
> and we have attempted to use it as a guide, but we still aren't having any luck.
>
> Does anyone know of any steps we might be missing? Or of anyone who has gotten
> USB host mode working on a pcm043 under Barebox before?
>
> I think we are close, but something (obviously) still isn't right.
Could it be that the USB clock operates at the wrong rate? I think it
should be 60MHz.
Sascha
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: USB On PCM043?
2012-07-19 16:11 ` Sascha Hauer
@ 2012-07-19 20:56 ` Jerry Kirk
2012-07-20 8:04 ` Sascha Hauer
0 siblings, 1 reply; 11+ messages in thread
From: Jerry Kirk @ 2012-07-19 20:56 UTC (permalink / raw)
To: barebox
> > We have been attempting to get USB Host mode working under Barebox(2012-07-0)
> > a PCM043 platform (i.mx35), but we are having a bit of trouble.
>
> Could it be that the USB clock operates at the wrong rate? I think it
> should be 60MHz.
We're not certain how to verify the clock setting for USB in Barebox.
We have used "dump_clocks" but are not certain which of these clocks
the USB clock is derived from. We think we have it set to the same
settings as the Eukrea board.
Do you know of anyone that has used USB on the pcm043 board?
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: USB On PCM043?
2012-07-19 20:56 ` Jerry Kirk
@ 2012-07-20 8:04 ` Sascha Hauer
2012-08-01 13:33 ` [RFC][PATCH] pcm043: usb support --not working-- Christoph Fritz
0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2012-07-20 8:04 UTC (permalink / raw)
To: Jerry Kirk; +Cc: barebox
On Thu, Jul 19, 2012 at 08:56:35PM +0000, Jerry Kirk wrote:
> > > We have been attempting to get USB Host mode working under Barebox(2012-07-0)
> > > a PCM043 platform (i.mx35), but we are having a bit of trouble.
> >
> > Could it be that the USB clock operates at the wrong rate? I think it
> > should be 60MHz.
>
> We're not certain how to verify the clock setting for USB in Barebox.
> We have used "dump_clocks" but are not certain which of these clocks
> the USB clock is derived from. We think we have it set to the same
> settings as the Eukrea board.
The i.MX SoCs have a clko pin which can be muxed to different clocks. I
don't know if this is accessible on the pcm043, but if yes, you could
switch it to the USB clock and measure the clock.
Otherwise it might be good to run a current -rc kernel, you can then
see the complete clock tree in debugfs
Sascha
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* [RFC][PATCH] pcm043: usb support --not working--
2012-07-20 8:04 ` Sascha Hauer
@ 2012-08-01 13:33 ` Christoph Fritz
2012-08-01 16:56 ` Eric Bénard
0 siblings, 1 reply; 11+ messages in thread
From: Christoph Fritz @ 2012-08-01 13:33 UTC (permalink / raw)
To: Sascha Hauer, Eric Bénard; +Cc: barebox, Jerry Kirk
Hi,
with the patch below I get the same behavior as Jerry: Only once after
reset command "usb" shows HI-Devices (Joystick, Mouse, ...). Jerry, do
you have made any progress on this?
The clock settings seems to be the same as for eukrea_cpuimx35. Eric:
Does USB work for you on your board?
Sascha, I currently have no working config for kernel >=3.5 to check for
clocks in debugfs.
Any thoughts on this?
Thanks
-- Christoph
From 2cec5266d1ae9ea141c6743accab9d1cb0ced7fc Mon Sep 17 00:00:00 2001
From: Christoph Fritz <chf.fritz@googlemail.com>
Date: Wed, 1 Aug 2012 11:32:17 +0200
Subject: [PATCH] pcm043: usb support --not working--
---
arch/arm/boards/pcm043/lowlevel.c | 6 ++++++
arch/arm/boards/pcm043/pcm043.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boards/pcm043/lowlevel.c b/arch/arm/boards/pcm043/lowlevel.c
index efb5441..cec25b2 100644
--- a/arch/arm/boards/pcm043/lowlevel.c
+++ b/arch/arm/boards/pcm043/lowlevel.c
@@ -196,6 +196,12 @@ void __bare_init __naked board_init_lowlevel(void)
r |= 0x00000003;
writel(r, ccm_base + CCM_CGR1);
+ /* enable USBOTG clock */
+ r = readl(ccm_base + CCM_CGR2);
+ r |= 0x3 << CCM_CGR2_USB_SHIFT;
+ r |= 0x3 << 26;
+ writel(r, ccm_base + CCM_CGR2);
+
r = readl(IMX_L2CC_BASE + L2X0_AUX_CTRL);
r |= 0x1000;
writel(r, IMX_L2CC_BASE + L2X0_AUX_CTRL);
diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c
index 9136bb3..06bf36b 100644
--- a/arch/arm/boards/pcm043/pcm043.c
+++ b/arch/arm/boards/pcm043/pcm043.c
@@ -46,6 +46,7 @@
#include <mach/imx-pll.h>
#include <mach/iomux-mx35.h>
#include <mach/devices-imx35.h>
+#include <mach/usb.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
@@ -94,6 +95,30 @@ static struct fb_videomode pcm043_fb_mode[] = {
}
};
+#ifdef CONFIG_USB
+static void imx35_usb_init(void)
+{
+ unsigned int tmp;
+
+ /* Host 1 */
+ tmp = readl(IMX_OTG_BASE + 0x600);
+ tmp &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
+ MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT);
+ tmp |= (MXC_EHCI_INTERFACE_SINGLE_UNI) << MX35_H1_SIC_SHIFT;
+ tmp |= MX35_H1_USBTE_BIT;
+ tmp |= MX35_H1_IPPUE_DOWN_BIT;
+ writel(tmp, IMX_OTG_BASE + 0x600);
+
+ tmp = readl(IMX_OTG_BASE + 0x584);
+ tmp |= 3 << 30;
+ writel(tmp, IMX_OTG_BASE + 0x584);
+
+ /* Set to Host mode */
+ tmp = readl(IMX_OTG_BASE + 0x5a8);
+ writel(tmp | 0x3, IMX_OTG_BASE + 0x5a8);
+}
+#endif
+
static struct imx_ipu_fb_platform_data ipu_fb_data = {
.mode = pcm043_fb_mode,
.num_modes = ARRAY_SIZE(pcm043_fb_mode),
@@ -101,6 +126,7 @@ static struct imx_ipu_fb_platform_data ipu_fb_data = {
.bpp = 16,
};
+
static int pcm043_mem_init(void)
{
arm_add_mem_device("ram0", IMX_SDRAM_CS0, SZ_128M);
@@ -173,6 +199,11 @@ static int imx35_devices_init(void)
imx35_add_fb(&ipu_fb_data);
+#ifdef CONFIG_USB
+ imx35_usb_init();
+ add_generic_usb_ehci_device(DEVICE_ID_DYNAMIC, IMX_OTG_BASE + 0x400, NULL);
+#endif
+
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_PCM043);
@@ -209,6 +240,8 @@ static iomux_v3_cfg_t pcm043_pads[] = {
MX35_PAD_I2C1_CLK__I2C1_SCL,
MX35_PAD_I2C1_DAT__I2C1_SDA,
MX35_PAD_ATA_CS0__GPIO2_6, /* LED */
+ MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR,
+ MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC,
};
static int imx35_console_init(void)
--
1.7.2.5
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC][PATCH] pcm043: usb support --not working--
2012-08-01 13:33 ` [RFC][PATCH] pcm043: usb support --not working-- Christoph Fritz
@ 2012-08-01 16:56 ` Eric Bénard
2012-08-01 21:04 ` Christoph Fritz
0 siblings, 1 reply; 11+ messages in thread
From: Eric Bénard @ 2012-08-01 16:56 UTC (permalink / raw)
To: Christoph Fritz; +Cc: barebox, Jerry Kirk
Hi Christoph,
Le Wed, 01 Aug 2012 15:33:08 +0200,
Christoph Fritz <chf.fritz@googlemail.com> a écrit :
> Hi,
>
> with the patch below I get the same behavior as Jerry: Only once after
> reset command "usb" shows HI-Devices (Joystick, Mouse, ...). Jerry, do
> you have made any progress on this?
>
> The clock settings seems to be the same as for eukrea_cpuimx35. Eric:
> Does USB work for you on your board?
>
thanks for the heads up : now it works.
> Sascha, I currently have no working config for kernel >=3.5 to check for
> clocks in debugfs.
>
> Any thoughts on this?
>
try to copy the config in that patch I just sent ;-)
Eric
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC][PATCH] pcm043: usb support --not working--
2012-08-01 16:56 ` Eric Bénard
@ 2012-08-01 21:04 ` Christoph Fritz
2012-08-02 7:08 ` Eric Bénard
2012-08-02 8:15 ` Sascha Hauer
0 siblings, 2 replies; 11+ messages in thread
From: Christoph Fritz @ 2012-08-01 21:04 UTC (permalink / raw)
To: Eric Bénard; +Cc: barebox, Jerry Kirk
On Wed, 2012-08-01 at 18:56 +0200, Eric Bénard wrote:
> > The clock settings seems to be the same as for eukrea_cpuimx35. Eric:
> > Does USB work for you on your board?
> >
> thanks for the heads up : now it works.
great :-)
> > Sascha, I currently have no working config for kernel >=3.5 to check for
> > clocks in debugfs.
> >
> > Any thoughts on this?
> >
> try to copy the config in that patch I just sent ;-)
I did - without success. I suppose the external phy needs to be
configured properly.
When you type the command "usb", you are getting a list of connected
devices. Can you execute command "usb" a second and third time with the
same result?
If yes, I think the clocks on pcm043 aren't set properly.
Thanks,
-- Christoph
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC][PATCH] pcm043: usb support --not working--
2012-08-01 21:04 ` Christoph Fritz
@ 2012-08-02 7:08 ` Eric Bénard
2012-08-02 8:15 ` Sascha Hauer
1 sibling, 0 replies; 11+ messages in thread
From: Eric Bénard @ 2012-08-02 7:08 UTC (permalink / raw)
To: Christoph Fritz; +Cc: barebox, Jerry Kirk
Hi Christoph,
Le Wed, 01 Aug 2012 23:04:38 +0200,
Christoph Fritz <chf.fritz@googlemail.com> a écrit :
> I did - without success. I suppose the external phy needs to be
> configured properly.
>
I'm using the internal PHY.
> When you type the command "usb", you are getting a list of connected
> devices. Can you execute command "usb" a second and third time with the
> same result?
>
didn't try but at least the 1st time the USB storage was detected and I
could mount it and list the files it contains.
Eric
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC][PATCH] pcm043: usb support --not working--
2012-08-01 21:04 ` Christoph Fritz
2012-08-02 7:08 ` Eric Bénard
@ 2012-08-02 8:15 ` Sascha Hauer
2012-08-02 13:59 ` Jerry Kirk
2012-11-06 19:48 ` Michael Burkey
1 sibling, 2 replies; 11+ messages in thread
From: Sascha Hauer @ 2012-08-02 8:15 UTC (permalink / raw)
To: Christoph Fritz; +Cc: barebox, Jerry Kirk
On Wed, Aug 01, 2012 at 11:04:38PM +0200, Christoph Fritz wrote:
> On Wed, 2012-08-01 at 18:56 +0200, Eric Bénard wrote:
> > > The clock settings seems to be the same as for eukrea_cpuimx35. Eric:
> > > Does USB work for you on your board?
> > >
> > thanks for the heads up : now it works.
>
> great :-)
>
> > > Sascha, I currently have no working config for kernel >=3.5 to check for
> > > clocks in debugfs.
> > >
> > > Any thoughts on this?
> > >
> > try to copy the config in that patch I just sent ;-)
>
> I did - without success. I suppose the external phy needs to be
> configured properly.
>
> When you type the command "usb", you are getting a list of connected
> devices. Can you execute command "usb" a second and third time with the
> same result?
By default 'usb' now only probes once. That is because the USB stack is
too silly to just keep already enumarated devices, but instead just
removes all devices and reenumarates them. Bad things happen if one of
your devices was a mounted USB mass storage device for example.
If you want to probe multiple times try the -f aka force aka I know what
I'm doing option.
Sascha
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC][PATCH] pcm043: usb support --not working--
2012-08-02 8:15 ` Sascha Hauer
@ 2012-08-02 13:59 ` Jerry Kirk
2012-11-06 19:48 ` Michael Burkey
1 sibling, 0 replies; 11+ messages in thread
From: Jerry Kirk @ 2012-08-02 13:59 UTC (permalink / raw)
To: barebox
Sascha Hauer <s.hauer@...> writes:
> By default 'usb' now only probes once. That is because the USB stack is
> too silly to just keep already enumarated devices, but instead just
> removes all devices and reenumarates them. Bad things happen if one of
> your devices was a mounted USB mass storage device for example.
> If you want to probe multiple times try the -f aka force aka I know what
> I'm doing option.
In our case, we have been using the "usb -f" command but it still only
finds HID type devices on the first probe after reset. On later
"usb -f" it only finds the hub. We are using the external Phy module
which is likely the problem. We have verified the clocks are at 60
mhz. We plan to readdress this issue in a couple of weeks when our
final hardware arrives.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC][PATCH] pcm043: usb support --not working--
2012-08-02 8:15 ` Sascha Hauer
2012-08-02 13:59 ` Jerry Kirk
@ 2012-11-06 19:48 ` Michael Burkey
1 sibling, 0 replies; 11+ messages in thread
From: Michael Burkey @ 2012-11-06 19:48 UTC (permalink / raw)
To: barebox
Sascha Hauer <s.hauer@...> writes:
>
> On Wed, Aug 01, 2012 at 11:04:38PM +0200, Christoph Fritz wrote:
> > On Wed, 2012-08-01 at 18:56 +0200, Eric Bénard wrote:
> > > > The clock settings seems to be the same as for eukrea_cpuimx35. Eric:
> > > > Does USB work for you on your board?
> > > >
> > > thanks for the heads up : now it works.
> >
> > great
> >
> > > > Sascha, I currently have no working config for kernel >=3.5 to check for
> > > > clocks in debugfs.
> > > >
> > > > Any thoughts on this?
> > > >
> > > try to copy the config in that patch I just sent
> >
> > I did - without success. I suppose the external phy needs to be
> > configured properly.
> >
> > When you type the command "usb", you are getting a list of connected
> > devices. Can you execute command "usb" a second and third time with the
> > same result?
>
> By default 'usb' now only probes once. That is because the USB stack is
> too silly to just keep already enumarated devices, but instead just
> removes all devices and reenumarates them. Bad things happen if one of
> your devices was a mounted USB mass storage device for example.
> If you want to probe multiple times try the -f aka force aka I know what
> I'm doing option.
>
> Sascha
>
Sascha,
I work with Jerry and I've been doing a lot more testing with USB lately and
we are still having issues under Barebox. We are on new hardware that now
uses the internal Phy and everything seems to work find under Linux itself.
However,under Barebox I am still seeing the following behaviour:
1) The first time after reset, when I do the "USB" command it detects the
built-in hub device and any HID devices I have tested without issue.
2) Any additional times I do "USB -F" after that it ONLY detects the
internal hub.
3) USB Mass Storage devices (flash drives, hard drives, et al) are NEVER
detected -- and I've tried a LOT of different ones. The vast majority are
never even detected at all, but I have one really old one that it will at
least say "2 devices detected" on the probe but never shows any description
of the device.
We are using a PCM043 SOM on a custom carrier board -- and to the best of
my knowledge everything is setup properly. I've also checked the USB clock
and it is correct. I have so far tried this with both Barebox 9 and Barebox
10, with no success. I have made sure that USB support is compiled in, as
well as mass storage support and FAT support.
Do you have any ideas as to what might be going on or what we should be
looking at?
Thanks,
Michael Burkey
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-11-06 19:50 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 15:37 USB On PCM043? Jerry Kirk
2012-07-19 16:11 ` Sascha Hauer
2012-07-19 20:56 ` Jerry Kirk
2012-07-20 8:04 ` Sascha Hauer
2012-08-01 13:33 ` [RFC][PATCH] pcm043: usb support --not working-- Christoph Fritz
2012-08-01 16:56 ` Eric Bénard
2012-08-01 21:04 ` Christoph Fritz
2012-08-02 7:08 ` Eric Bénard
2012-08-02 8:15 ` Sascha Hauer
2012-08-02 13:59 ` Jerry Kirk
2012-11-06 19:48 ` Michael Burkey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox