9
0
Fork 0
Commit Graph

219 Commits

Author SHA1 Message Date
Robert Jarzmik 58c2526c9d usb/gadget: add special treatment for PXA cpus
As PXA cpus suffer from a silicon bug which prevents them
from being compound devices, forbid use_acm=1 for PXAs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-21 11:15:31 +01:00
Jean-Christophe PLAGNIOL-VILLARD bd96e89099 at91: add udc usb device controller support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-14 12:41:15 +01:00
Michael Grzeschik 35c0475a6d storage/usb.c: fix test_unit_ready
This is needed for the ohci-at91 to work.

In u-boot this function was transmitting a cmdlen of 12, by the initial
commit. There are similar functions like usb_request_sense,
usb_read_capacity nearby which also transmit 12 byte per default on
u-boot, which probably also need a fix.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-07 09:39:12 +01:00
Robert Jarzmik 699a4a1eca usb/gadget: make serial gadget resistant to cable unplug
As USB can have its cable plugged out anytime, make the
serial gadget reliable in case of unplugging :
 - unregister the gadget_serial provided console
 - don't stay forever in the read loop if connection was cut

This behaviour relies on correct implementation of
usb_gadget_poll(), which should return an error if the USB
cable was removed.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:59:02 +01:00
Robert Jarzmik 8173427d8d usb/gadget: add USB serial connect and disconnect
The serial gadget can only work if the serial function is
properly connected on USB trigger (ie. on SET_CONFIGURATION
or SET_INTERFACE USB message triggering set_alt() in
composite.c).

Make this connection and handle also the disconnection in
f_serial.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:59:02 +01:00
Robert Jarzmik 34e5b6029f usb/gadget: use generic usb_gadget_poll() in u_serial
Use the generic gadget polling function instead of the
specific fsl function. This is a fix from a leftover in
gadget development.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:59:02 +01:00
Robert Jarzmik 75139ca334 usb/gadget: add pxa27x_udc driver
Adapt mainline kernel pxa27x_udc driver to barebox :
 - remove function header comments as they are in mainline
 - test it with serial gadget

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:59:02 +01:00
Sascha Hauer e0f4fb2c98 Merge branch 'master' into next
Conflicts:
	drivers/ata/disk_drive.c

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:45:23 +01:00
Juergen Beisert 82db23d3f4 Use generic block layer to access the drives and do partition parsing
Change all relevant blockdevice users to the simplified interface.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-28 09:23:24 +01:00
Juergen Beisert 0c871d19dd USB Mass Storage driver: Fix compile time warning
drivers/usb/storage/usb.c: In function 'usb_stor_blk_io':
drivers/usb/storage/usb.c:257:16: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-28 09:23:24 +01:00
Hubert Feurstein 7bb009c744 commands/cp: add verbose mode which displays progress bar
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-22 21:13:05 +01:00
Hubert Feurstein 8ee4b29f84 at91: add config option for ohci driver
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-10 09:09:24 +01:00
Antony Pavlov 1487daabf9 usb: ehci-hcd.c: fix 'value computed is not used' warning
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-26 13:53:13 +02:00
Sascha Hauer 597da1b76e Merge branch 'next' 2011-10-09 03:58:49 +02:00
Sascha Hauer d25d8fe2a7 Merge branch 'usb-massstorage' into next 2011-09-28 09:14:01 +02:00
Rosen Kolev 637b3aa727 USB mass storage device driver initial implementation
Implemented an initial version of USB mass storage device driver,
supporting USB mass storage devices with SCSI interface and BBB
protocol.  It implements the ATA interface and registers diskovered
LUNs with the disk driver.
2011-09-23 08:53:22 +02:00
Rosen Kolev 108b029b68 Extended USB device matching.
Extended the USB device matching, adding checks for interface class,
interface subclass, and interface protocol.
2011-09-23 08:53:22 +02:00
Rosen Kolev 98e43c5b30 Modified timeout in the ehci-hcd USB host driver.
Increased the asynchronous message timeout for bulk endpoints.
2011-09-23 08:53:21 +02:00
Sascha Hauer 3ee7877a48 introduce io.h
To allow for some generic io accessors introduce io.h and use
this instead of asm/io.h throughout the tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-22 19:03:05 +02:00
Jean-Christophe PLAGNIOL-VILLARD 413c5a9f07 at91: add ohci support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 21:12:46 +02:00
Sascha Hauer 6a24579000 initial ohci support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 21:12:46 +02:00
Sascha Hauer 06031b3342 usb: honour timeout fields
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 21:12:46 +02:00
Jean-Christophe PLAGNIOL-VILLARD 8026b62dc4 usb/core: make print dev like linux lsusb
and busnum start at 1

as this
Bus 001 Device 002: ID 0b95:7720 AX88772

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 21:12:46 +02:00
Antony Pavlov ede7b37392 ehci-hcd.c: handle EHCI_HAS_TT in ehci_reset() during startup
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-19 11:23:28 +02:00
Antony Pavlov a8af2ad4f1 usb.c: warning on USB_MAXINTERFACES overflow
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-13 09:29:34 +02:00
Sascha Hauer 8ba794abd4 ARM: pass size to dma_free_coherent
We'll need it later once we remap dma memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-01 21:49:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD 9d53f1193f fsl_udc: switch to resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-30 02:05:26 +08:00
Jean-Christophe PLAGNIOL-VILLARD ee80cbcd61 resource: introduce add_usb_ehci_device to register echi device
pass the hccr and hcor register base via resource

instroduce add_generic_usb_echi_device with hccr = base + 0x100 and
hcor = base + 0x140

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-29 14:05:22 +08:00
Sascha Hauer 7f72417c0c usb: make locally used functions static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-05-18 11:29:07 +02:00
Sascha Hauer fa9d86dfc9 usb ehci: fix wrong argument order for memset
Also, make locally used function ehci_submit_root static.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-05-18 11:27:41 +02:00
Sascha Hauer 7c15f466df commands: seperate usb command from usb core
This patch makes the USB command optional and makes usb_rescan a
global function. This way we can use USB in noninteractive
environments.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:26 +02:00
Sascha Hauer 203a5fd190 USB ehci: Set to host mode on tt capable controllers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-20 09:54:33 +01:00
Sascha Hauer 8a97bb978c Merge branch 'scb9328' into next 2011-01-08 13:09:26 +01:00
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Sanjeev Premi 1c267b02af omap: echi: fix compile error
This patch fixes the compiler error:
  CC      drivers/usb/host/ehci-omap.o
drivers/usb/host/ehci-omap.c: In function 'ehci_omap_init':
drivers/usb/host/ehci-omap.c:204: error: 'CPU_ES2P1' undeclar
ed (first use in this function)
drivers/usb/host/ehci-omap.c:204: error: (Each undeclared ide
ntifier is reported only once
drivers/usb/host/ehci-omap.c:204: error: for each function it
 appears in.)
make[3]: *** [drivers/usb/host/ehci-omap.o] Error 1

Problem reported by: Cory Walker (cwalker32@gmail.com)

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:14:02 +01:00
Eric Bénard a9cc5d079a fsl_udc: fix warning
this patch fix the following warning :
drivers/usb/gadget/fsl_udc.c: In function 'done':
drivers/usb/gadget/fsl_udc.c:566: warning: passing argument 1 of 'dma_inv_range' makes integer from pointer without a cast
arch/arm/include/asm/mmu.h:24: note: expected 'long unsigned int' but argument is of type 'void *'
drivers/usb/gadget/fsl_udc.c:566: warning: passing argument 2 of 'dma_inv_range' makes integer from pointer without a cast
arch/arm/include/asm/mmu.h:24: note: expected 'long unsigned int' but argument is of type 'void *'

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 21:08:22 +02:00
Eric Bénard 9f93d939ef epautoconf: fix compile error
this patch fix the following error :
  CC      drivers/usb/gadget/epautoconf.o
drivers/usb/gadget/epautoconf.c:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned'
drivers/usb/gadget/epautoconf.c: In function 'ep_matches':
drivers/usb/gadget/epautoconf.c:168: error: 'epnum' undeclared (first use in this function)
drivers/usb/gadget/epautoconf.c:168: error: (Each undeclared identifier is reported only once
drivers/usb/gadget/epautoconf.c:168: error: for each function it appears in.)
drivers/usb/gadget/epautoconf.c: In function 'usb_ep_autoconfig_reset':
drivers/usb/gadget/epautoconf.c:304: error: 'epnum' undeclared (first use in this function)

Signed-off-by: Eric Bénard <eric@eukrea.com>
2010-10-14 13:07:14 +02:00
Sascha Hauer 17f799e6ab move include files for mfd drivers to include/mfd
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-11 13:22:13 +02:00
Michael Grzeschik e503c22837 ehci: add omap support
with cm-regbits-34xx.h and codebase from linux kernel

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:17:45 +02:00
Michael Grzeschik f1329a1500 usb: add twl4030 phy support
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:17:36 +02:00
Michael Grzeschik b0e989f618 ehci: add remove function
and stop the ehci controller before the kernel is trying to restart it.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2010-08-06 19:17:32 +02:00
Sascha Hauer ac8066ae5e ehci: set CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS to 16
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2010-08-06 19:17:27 +02:00
Sascha Hauer 50c7d68dd8 ehci: Make has_tt configurable via platform data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
2010-08-06 19:17:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6f354bc067 drivers/usb: regorganisation
move to linux usb driver organisation

as following

drivers/usb/core
drivers/usb/gadget
drivers/usb/host
drivers/usb/otg

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-02 15:16:31 +02:00
Sascha Hauer 17ef55f6d6 ehci: remove unused code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:42:25 +02:00
Sascha Hauer 2f64aa66ab ehci: Force a ehci_halt before trying to reset
As observed on OMAP some controllers do not like being
resetted when running.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:42:20 +02:00
Sascha Hauer 0b863c83d0 ehci: use is_timeout for timeout instead of udelay counter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:42:06 +02:00
Sascha Hauer d99aa6b761 usb: Check return value of host controller init
And do not scan the bus if initialization failed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:41:36 +02:00
Sascha Hauer c8363b8f60 ehci: Handle hub port reset properly
This has been copied from the U-Boot ehci driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:41:31 +02:00
Sascha Hauer 57b56a989f ehci: Make has_tt configurable via platform data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-24 11:41:15 +02:00
Sascha Hauer ea343ab9e8 fsl_udc: make it work with MMU on
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:02:03 +02:00
Sascha Hauer 6f5a6b591a pass arguments to dma_* as unsigned long as the kernel does
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer 922bb41a47 remove typedef cmd_tbl_t and replace it with struct command
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-01 17:25:32 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
This has been done with the following script:

find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \
	-e 's/u2boot/barebox/g' \
	-e 's/U2Boot/barebox/g' \
	-e 's/U-boot V2/barebox/g' \
	-e 's/u-boot v2/barebox/g' \
	-e 's/U-Boot V2/barebox/g' \
	-e 's/U-Boot-v2/barebox/g' \
	-e 's/U_BOOT/BAREBOX/g' \
	-e 's/UBOOT/BAREBOX/g' \
	-e 's/uboot/barebox/g' \
	-e 's/u-boot/barebox/g' \
	-e 's/u_boot/barebox/g' \
	-e 's/U-Boot/barebox/g' \
	-e 's/U-boot/barebox/g' \
	-e 's/U-BOOT/barebox/g'

find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \
	xargs -0 -r rename 's/u[-_]?boot/barebox/'

It needs some manual fixup following in the next patch

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 10:18:30 +01:00
Sascha Hauer 420a3173f0 commands: remove maxargs
No need to check for maximum argument counts. The commands are
safe to be called with more arguments, so lets safe some bytes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-19 16:18:33 +02:00
Sascha Hauer 0cf03ba98d usb ehci: Fix braindamaged pointer-deref-cast-magic
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-12 15:26:51 +02:00
Sascha Hauer d9345607aa Add USB device support
This patch adds support for USB devices. It uses
the Linux Kernel gadget API. Along with this patch
comes driver support for the Freescale (arc) USB OTG
Core and USB Device Firmware Update (DFU)
The serial gadget support is not working at the moment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-25 14:31:26 +02:00
Sascha Hauer 3e4557a8b7 usb: remove unnecessary code
When usb_bulk_msg is done we have our result. No need
to poll for 'done' after this function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-09 11:51:22 +02:00
Sascha Hauer 38fb079e3f usb ehci driver: Add MMU support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-09 11:51:18 +02:00
Sascha Hauer 721975ba22 usb ehci driver: Get rid of echi_alloc/free
Instead, use static arrays

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-09 11:51:12 +02:00
Sascha Hauer 78df9a19ad usb: when unregistering usb devices, remove them from device list
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-08 12:42:55 +02:00
Sascha Hauer 77a3b6a96a ehci: Restore state after td timeout
Clear overlay token after TD timeout so that the
next transfer works.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-09-08 10:36:18 +02:00
Sascha Hauer 02ba8a0542 get rid of device ids
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:47 +02:00
Sascha Hauer 277b605eae USB support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-07 10:56:22 +02:00
Sascha Hauer 03c2189aa8 initial USB support imported from U-Boot-1
imported from commit bd76729bcbfd64b5d016a9b936f058931fc06eaf.
Only minor changes to make it compile.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-07 10:42:33 +02:00
Sascha Hauer 762019f198 remove unused drivers 2007-09-21 12:43:14 +02:00
Sascha Hauer 58c95d74ad svn_rev_563
unify menu style
2007-07-05 18:02:05 +02:00
Sascha Hauer bd77fd31d8 svn_rev_253
make it compile
2007-07-05 18:01:37 +02:00
Sascha Hauer c22c631e8d svn_rev_248
collect all usb related stuff and put it into drivers/usb
2007-07-05 18:01:36 +02:00