dm: usb: Adjust usb_storage to work with sandbox
authorSimon Glass <sjg@chromium.org>
Wed, 25 Mar 2015 18:22:14 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2015 17:11:22 +0000 (11:11 -0600)
With a few tweaks we can compile this code with sandbox and enable testing
of the USB storage layer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
common/usb_storage.c

index 2955b325b8f05076766853c9cacc3f2745424b63..f190d8a6c40bad11a9831183e8ae0df5aa6e5661 100644 (file)
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <command.h>
 #include <inttypes.h>
+#include <mapmem.h>
 #include <asm/byteorder.h>
 #include <asm/processor.h>
 
@@ -306,8 +307,9 @@ static int us_one_transfer(struct us_data *us, int pipe, char *buf, int length)
                /* set up the transfer loop */
                do {
                        /* transfer the data */
-                       debug("Bulk xfer %p(%d) try #%d\n",
-                             buf, this_xfer, 11 - maxtry);
+                       debug("Bulk xfer 0x%lx(%d) try #%d\n",
+                             (ulong)map_to_sysmem(buf), this_xfer,
+                             11 - maxtry);
                        result = usb_bulk_msg(us->pusb_dev, pipe, buf,
                                              this_xfer, &partial,
                                              USB_CNTL_TIMEOUT * 5);