mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* imx-usb-image write to usb error
@ 2013-09-05  1:04 Jason Cooper
  2013-09-05  6:46 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Cooper @ 2013-09-05  1:04 UTC (permalink / raw)
  To: barebox

All,

This is the first I've messed with i.MX, so I'm a little lost. :)

I'm putting together a patch to add support for the SanDisk Connect
Wireless Media Drive [1], code dump from SanDisk is here [2].  It turns
out when you unplug the battery, it'll show up as the Freescale hid.

Here's what I get:

$ ./scripts/imx/imx-image -c \
arch/arm/boards/sandisk-connect-wmd/flash-header-lpddr1.imxcfg -f \
barebox.bin -o barebox.imx
$ sudo ./scripts/imx/imx-usb-loader -vvvvv ./barebox.imx 
found i.MX50 USB device [15a2:0052]
report=1
report 1, wrote 0 bytes, err=0
report=3
report 3, read 0 bytes, err=-7
read=00 00 00 00
report=1
report 1, wrote 0 bytes, err=0
report=3
report 3, read 0 bytes, err=-7
read=00 00 00 00
report=1
report 1, wrote 0 bytes, err=0
report=3
report 3, read 0 bytes, err=-7
read=00 00 00 00
report=1
report 1, wrote 0 bytes, err=0
report=3
report 3, read 0 bytes, err=-7
read=00 00 00 00
report=1
report 1, wrote 0 bytes, err=0
report=3
report 3, read 0 bytes, err=-7
read=00 00 00 00
report=1
report 1, wrote 0 bytes, err=0
report=3
report 3, read 0 bytes, err=-7
read=00 00 00 00
report=4
4 in err=-7, last_trans=0  00 00 00 00
status failed

Looking at the code, it looks like transfer() is always returning 0
bytes in last_trans.  Has anyone seen this before?  $searchengine came
up blank.  What simple thing am I missing?

thx,

Jason.

[1] http://www.sandisk.com/products/wireless/media-drive/
[2] http://www.sandisk.com/products/connect/disclaimer/

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: imx-usb-image write to usb error
  2013-09-05  1:04 imx-usb-image write to usb error Jason Cooper
@ 2013-09-05  6:46 ` Sascha Hauer
  2013-09-09 17:41   ` Jason Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2013-09-05  6:46 UTC (permalink / raw)
  To: Jason Cooper; +Cc: barebox

Hi Jason,

On Wed, Sep 04, 2013 at 09:04:36PM -0400, Jason Cooper wrote:
> All,
> 
> This is the first I've messed with i.MX, so I'm a little lost. :)
> 
> I'm putting together a patch to add support for the SanDisk Connect
> Wireless Media Drive [1], code dump from SanDisk is here [2].  It turns
> out when you unplug the battery, it'll show up as the Freescale hid.
> 
> Here's what I get:
> 
> $ ./scripts/imx/imx-image -c \
> arch/arm/boards/sandisk-connect-wmd/flash-header-lpddr1.imxcfg -f \
> barebox.bin -o barebox.imx
> $ sudo ./scripts/imx/imx-usb-loader -vvvvv ./barebox.imx 
> found i.MX50 USB device [15a2:0052]

I never tested this on an i.MX50 due to lack of hardware. Have a look
at scripts/imx/imx-usb-loader.c at imx_ids. i.MX50 is very similar to
i.MX51. The i.MX51 has:

	{
		.vid = 0x15a2,
		.pid = 0x0041,
		.name = "i.MX51",
		.header_type = HDR_MX51,
		.mode = MODE_BULK,
		.max_transfer = 64,
	},

The header_type, mode and max_transfer fields are missing for i.MX50. I
assume that's the problem.

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] 4+ messages in thread

* Re: imx-usb-image write to usb error
  2013-09-05  6:46 ` Sascha Hauer
@ 2013-09-09 17:41   ` Jason Cooper
  2013-09-11  7:00     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Cooper @ 2013-09-09 17:41 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Thu, Sep 05, 2013 at 08:46:39AM +0200, Sascha Hauer wrote:
> Hi Jason,
> 
> On Wed, Sep 04, 2013 at 09:04:36PM -0400, Jason Cooper wrote:
> > All,
> > 
> > This is the first I've messed with i.MX, so I'm a little lost. :)
> > 
> > I'm putting together a patch to add support for the SanDisk Connect
> > Wireless Media Drive [1], code dump from SanDisk is here [2].  It turns
> > out when you unplug the battery, it'll show up as the Freescale hid.
> > 
> > Here's what I get:
> > 
> > $ ./scripts/imx/imx-image -c \
> > arch/arm/boards/sandisk-connect-wmd/flash-header-lpddr1.imxcfg -f \
> > barebox.bin -o barebox.imx
> > $ sudo ./scripts/imx/imx-usb-loader -vvvvv ./barebox.imx 
> > found i.MX50 USB device [15a2:0052]
> 
> I never tested this on an i.MX50 due to lack of hardware. Have a look
> at scripts/imx/imx-usb-loader.c at imx_ids. i.MX50 is very similar to
> i.MX51. The i.MX51 has:
> 
> 	{
> 		.vid = 0x15a2,
> 		.pid = 0x0041,
> 		.name = "i.MX51",
> 		.header_type = HDR_MX51,
> 		.mode = MODE_BULK,
> 		.max_transfer = 64,
> 	},
> 
> The header_type, mode and max_transfer fields are missing for i.MX50. I
> assume that's the problem.

Well, it looks like it works, but I'm unable to get a barebox prompt on
the tty.  (patches to come once I get a prompt).  So I decided to try
tackling the problem from the other end for a bit.  Namely booting a
mainline kernel from the installed u-boot.

Something is confusing me though.  The part number on the chip is
MCIMX502CVK8B.  Which, iiuc, is an imx51.  The provided kernel spits out
this:

[    0.000000] MXC_Early serial console at MMIO 0x53fbc000 (options '115200')

However, the only imx SoCs using that address range are imx53 and imx25,
according to arch/arm/boot/dts/ in Linux, at least.

In addition, the docs for the imx50 clearly state that it uses DCD v2
(version = 0x40) [1] (Table 6-27, DCD Header), but the code in barebox's
imx-image.c says imx51 uses DCD v1...

Anyone with more experience with Freescale SoCs care to fill in the
blanks?  The first hint I'm on the wrong path is that I feel like I need
to write a whole dtsi file from scratch. :-/

thx,

Jason.

[1] http://cache.freescale.com/files/32bit/doc/ref_manual/IMX50RM.pdf

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: imx-usb-image write to usb error
  2013-09-09 17:41   ` Jason Cooper
@ 2013-09-11  7:00     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-09-11  7:00 UTC (permalink / raw)
  To: Jason Cooper; +Cc: barebox

On Mon, Sep 09, 2013 at 01:41:17PM -0400, Jason Cooper wrote:
> On Thu, Sep 05, 2013 at 08:46:39AM +0200, Sascha Hauer wrote:
> > Hi Jason,
> > 
> > On Wed, Sep 04, 2013 at 09:04:36PM -0400, Jason Cooper wrote:
> > > All,
> > > 
> > > This is the first I've messed with i.MX, so I'm a little lost. :)
> > > 
> > > I'm putting together a patch to add support for the SanDisk Connect
> > > Wireless Media Drive [1], code dump from SanDisk is here [2].  It turns
> > > out when you unplug the battery, it'll show up as the Freescale hid.
> > > 
> > > Here's what I get:
> > > 
> > > $ ./scripts/imx/imx-image -c \
> > > arch/arm/boards/sandisk-connect-wmd/flash-header-lpddr1.imxcfg -f \
> > > barebox.bin -o barebox.imx
> > > $ sudo ./scripts/imx/imx-usb-loader -vvvvv ./barebox.imx 
> > > found i.MX50 USB device [15a2:0052]
> > 
> > I never tested this on an i.MX50 due to lack of hardware. Have a look
> > at scripts/imx/imx-usb-loader.c at imx_ids. i.MX50 is very similar to
> > i.MX51. The i.MX51 has:
> > 
> > 	{
> > 		.vid = 0x15a2,
> > 		.pid = 0x0041,
> > 		.name = "i.MX51",
> > 		.header_type = HDR_MX51,
> > 		.mode = MODE_BULK,
> > 		.max_transfer = 64,
> > 	},
> > 
> > The header_type, mode and max_transfer fields are missing for i.MX50. I
> > assume that's the problem.
> 
> Well, it looks like it works, but I'm unable to get a barebox prompt on
> the tty.  (patches to come once I get a prompt).  So I decided to try
> tackling the problem from the other end for a bit.  Namely booting a
> mainline kernel from the installed u-boot.
> 
> Something is confusing me though.  The part number on the chip is
> MCIMX502CVK8B.  Which, iiuc, is an imx51.  The provided kernel spits out
> this:
> 
> [    0.000000] MXC_Early serial console at MMIO 0x53fbc000 (options '115200')
> 
> However, the only imx SoCs using that address range are imx53 and imx25,
> according to arch/arm/boot/dts/ in Linux, at least.
> 
> In addition, the docs for the imx50 clearly state that it uses DCD v2
> (version = 0x40) [1] (Table 6-27, DCD Header), but the code in barebox's
> imx-image.c says imx51 uses DCD v1...

The i.MX53 is not much more than a moderately improved i.MX51. The i.MX50
is somewhere in between. Maybe it already uses the v2 header format.
Have you tried copying the values from the i.MX53?

> 
> Anyone with more experience with Freescale SoCs care to fill in the
> blanks?  The first hint I'm on the wrong path is that I feel like I need
> to write a whole dtsi file from scratch. :-/

The i.MX51 and i.MX53 have a very similar memory map. Only the AIPS1/2
base addresses are different to allow for bigger SDRAM on the i.MX53.
The i.MX50 memory map seems to be a subset of the i.MX53.

What I'm afraid is really different between i.MX50 and i.MX53 is the
clock controller.

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] 4+ messages in thread

end of thread, other threads:[~2013-09-11  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05  1:04 imx-usb-image write to usb error Jason Cooper
2013-09-05  6:46 ` Sascha Hauer
2013-09-09 17:41   ` Jason Cooper
2013-09-11  7:00     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox