9
0
Fork 0
Commit Graph

219 Commits

Author SHA1 Message Date
Marc Kleine-Budde 0d98114eb2 usb: gadget: enable for MXS
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:28 +02:00
Sascha Hauer 1240a7b0f6 usb gadget: Enable gadget support only when a driver is available
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer 73801faf43 usb gadget at91: Use correct include
include gpio.h instead of mach/gpio.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer 47548c90b1 gpio: add static inlines for gpio_request/gpio_free
Some drivers use gpio_request/gpio_free. Currently no architecture
has code behind these functions. Provide static inline functions
for these and remvoe the at91 specific inline functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer 15caba7771 mfd TWL4030: Fix Kconfig dependencies
The twl core does not depend on the twl usb support. It's the other
way round.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Sascha Hauer 97ba7671fe USB: Fix typo tranceiver -> transceiver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Conflicts:

	drivers/usb/otg/Kconfig

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:26 +02:00
Sascha Hauer 1510c57e93 Merge branch 'for-next/resource-size'
Conflicts:
	drivers/base/resource.c
	fs/fs.c
2012-07-02 11:05:57 +02:00
Sascha Hauer f22d4e2778 Merge branch 'for-next/sparse' 2012-07-02 10:59:37 +02:00
Sascha Hauer 5f03074ea9 resource: store 'end' instead of 'size' in struct resource
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-01 08:18:53 +02:00
Sascha Hauer 7712070e3e USB gadget fsl: Put registers into iomem space
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 22:34:55 +02:00
Sascha Hauer 3af2266149 USB ohci: Fix sparse warnings
- put registers into iomem space
- do not use 0 as NULL pointer
- use dev_request_mem_region()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 22:34:54 +02:00
Sascha Hauer 40faf584cd USB ehci: rework cache handling
We do not need to invalidate the cache in the poll loop anymore
since the corresponding bit is now in a dma coherent area. Instead,
flush cache before hardware operation and invalidate afterwards. Put
the corresponding code inline since it's shorter.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 9ca0e573af USB storage: use dma_alloc where appropriate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 787fa164dd USB ehci: put fields of struct qTD directly into struct QH
This allows us to extend struct qTD with non hardware specific
fields.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 0128d99352 USB ehci: Use dma coherent buffers for qh/qtd
There's no point in syncing them manually. Instead, use
dma_alloc_coherent and skip the manual flushing/invalidating.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 0c35d2210e USB core: Allocate tmpbuf using dma_alloc
This needs to be dma save.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 95aea88175 USB core: device descriptor using dma_alloc
The device descriptor needs to be dma save.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer fc52e7e480 USB core: allocate setup_packet using dma_alloc
The setup packet needs to be dma save.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 887c7d5c38 USB gadget: Fix dma memory allocations
This is another variant of:

    USB gadget fsl: request cacheline aligned buffer

    The fsl udc driver allocates a buffer for small requests. The
    driver then calls dma_inv_range later on it. This buffer happens
    to be not cacheline aligned which means that a dma_inv_range can
    corrupt other memory around the buffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[mkl: use dma_alloc]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer 3f7987af96 USB gadget fsl: request cacheline aligned buffer
The fsl udc driver allocates a buffer for small requests. The
driver then calls dma_inv_range later on it. This buffer happens
to be not cacheline aligned which means that a dma_inv_range can
corrupt other memory around the buffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[mkl: use dma_alloc]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Sascha Hauer c907114bd4 usb ehci: Use zalloc to allocate ehci structure
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-23 22:37:07 +02:00
Sascha Hauer bd14edecaf usb storage: fix driver name
We have to set the name in struct usb_driver, not the one
in struct driver_d which gets overwritten with usb_driver->name
during registration.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-23 22:37:01 +02:00
Jan Luebbe 1503fe67d1 ohci-hcd: use dma_flush/inv_range to allow using the driver with enabled MMU
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 19:42:42 +02:00
Jean-Christophe PLAGNIOL-VILLARD 8e6f45f54f complete: add empty complete support
for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo,
reset, true, usb, version

for mach-imx and mach-mxs: dump_clocks
for u_serial: mycdev

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-30 20:37:40 +08:00
Jean-Christophe PLAGNIOL-VILLARD 800f181e7a usb: fix driver name
use the usb_driver name

otherwise we will have a NULL driver entry in devinfo

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-04-23 19:51:05 +08:00
Sascha Hauer abe4560c8a Use DEVICE_ID_DYNAMIC where applicable
We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids,
Use it where applicable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-16 09:43:02 +02:00
Sascha Hauer f70ebb28a2 USB ehci: speed up initialization
This is based on the following U-Boot commit:

commit 5f4b4f2fed3ab8590c8c06b78642f8c1467acacf
Author: Vincent Palatin <vpalatin@chromium.org>
Date:   Mon Dec 5 14:52:22 2011 -0800

    ehci: speed up initialization

    According to EHCI specification v1.0, the controller should stabilize
    the power on a port at most 20 ms after the port power bit transition.
    So, we put this setting in the virtual descriptor corresponding field,
    (bPwrOn2PwrGood = 10 => 10 x 2ms = 20ms), this saves about 500ms at each
    controller initialization/enumeration.

    Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-12 21:38:19 +02:00
Sascha Hauer 1db7717f6b USB ehci: make cache handling simpler
for chache handling the ehci driver iterates over the hardware lists
of QHs/TDs. As we have a fixed number of maximum entries in this lists
we can allocate them as arrays and and clean/invalidate the arrays
instead which is much simpler. While at it, move the allocation to
ehci_probe so that we do not lose memory each time ehci_init is called.
Also, use memalign to allocate the QHs/TDs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-12 21:38:15 +02:00
Sascha Hauer 2a6460cbb6 Merge branch 'next' 2012-04-05 11:09:58 +02:00
Sascha Hauer 3ed06ffde9 USB gadget pxa: Fix compiler warning
Fixes:

drivers/usb/gadget/pxa27x_udc.c:1263:13: warning: 'pxa27x_change_interface' defined but not used [-Wunused-function]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 08:48:54 +02:00
Alexander Shiyan 71cd4b22ce Select POLLER option for fsl_udc
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 10:07:48 +02:00
Alexander Shiyan c7641a1281 Cosmetic change name ISP1504 -> ISP150x
ISP150x product line have same identifier, we can print these
chips as ISP150x.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 09:32:54 +02:00
Alexander Shiyan 9d9724e178 Completely migrate option ISP1504 to ULPI
Since we do not have ISP1504-related functions, we migrated to ULPI.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 09:32:54 +02:00
Alexander Shiyan a2623f1712 Rename function ulpi_init to ulpi_detect
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 09:32:53 +02:00
Alexander Shiyan bafda33463 Move set_vbus_power code to ULPI driver
This is ULPI-specific, not ISP1504.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 09:32:53 +02:00
Alexander Shiyan 2079f13611 Add ULPI detection function.
Added ULPI detection function.
Same function from isp1504 driver removed.
Used implementation from Linux kernel.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 09:32:53 +02:00
Alexander Shiyan 9c01d10dab Rename definitions for ULPI registers
These registers can be used for any standart ULPI chip,
not only for ISP1504.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-02 09:32:53 +02:00
Marek Belisko 96a43caf5a pxa27x_udc: Fix compilation warning.
Fix following:
drivers/usb/gadget/pxa27x_udc.c:1482:1: warning: initialization from incompatible pointer type

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-23 09:30:07 +01:00
Sascha Hauer 33d1cc4bf2 commands: remove struct command pointer from commands
This is unused in all commands and thus can be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-27 20:28:07 +01:00
Sascha Hauer 456a52a6e5 USB storage: fix disconnect
USB storage support missed disconnect support. Implement this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-15 09:00:46 +01:00
Sascha Hauer 192d6fe9be Merge branch 'pu/debug' into next 2012-01-27 09:31:13 +01:00
Robert Jarzmik 8d6bfdaec7 usb/gadget: fix poller NPE in early polling
The timings of the poller calling have changed, digging out
a latent bug in pxa27x udc controller.
The polling routine is called before the probe function is
called, and the driver internal are not initialized at that
time. This triggers a NULL pointer exception.

Fix it by moving poller registration after driver probe.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-23 09:45:56 +01:00
Jason Kridner 5f77a0a812 USB: Remove __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor
cherry-picked from U-Boot.

commit 69716c1900274a89bd5cbd1b0bb276ceaaa04f61
Author: Jason Kridner <jkridner@beagleboard.org>
Date:   Wed Apr 20 08:54:16 2011 -0500

    USB: Remove __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor

    Remove __attribute__ ((packed)) to prevent byte access to soc
    registers in some gcc versions.

    Having patches to enable ehci for the BeagleBoard lying around for
    several months, this one was the show-stopper.

    Switched to align(4), rather than remove the attribute, per suggestion
    from Alexander.

    Credits have to go to Laine Walker-Avina <lwalkera@ieee.org> for
    finding the problem.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-18 09:47:49 +01:00
Eric Bénard 948300df54 u_serial: add setbrg to be able to use loadb & co
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-05 10:34:59 +01:00
Alexander Aring e3d1b99292 Kconfig: add missing dependencies.
Change dependencies in Kconfig for twl devices.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-05 09:34:08 +01:00
Eric Bénard f7aaa22493 serial gadget: enable/disable on request
- add a usbserial command to enable/disable the serial gadget
- allow dfu and usbserial to cohexist in the same barebox
- add a timeout in u_serial so that we don't get locked if the user
enable usbserial from a UART console but doesn't consume the data
on the usbserial port created on the PC
- remove debug or verbose printf
- tested on i.MX25 & i.MX35 & usb-a926x

Signed-off-by: Eric Bénard <eric@eukrea.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:18:46 +01:00
Eric Bénard eb98425068 dfu: fill bwPollTimeout and better handle detach
- bwPollTimeout is set to 10 ms, from the DFU spec, this
is the minimum time, in milliseconds, that the host should
wait before sending a subsequent DFU_GETSTATUS request.
Without this, I get 25 seconds value and dfu-util waits twice 25s
during download
- when in IDLE and receiving DETACH, first return 0 to make
dfu-util happy, then use a dfudetach variable to exit dfu
(without an USB reset as per the comment on line 425) and
return to runtime mode.
- tested on i.MX25 & i.MX35 & usb-a926x

Signed-off-by: Eric Bénard <eric@eukrea.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:18:46 +01:00
Eric Bénard 9350bcca01 fsl_udc: update and fix
- this patch sync fsl_udc.c with linux's driver,
- add a poller on usb_gadget_poll to get serial gadget working,
- return -EIO in usb_gadget_poll when udc is stopped (do detect
cable disonnection)
- tested on i.MX25 & i.MX35

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-04 14:18:46 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3bc0b7b2e6 at91_udc: update vbus param only if updated
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:08:25 +01:00
Alexander Aring 5c115f335e twl-core: abstract twl4030 and add twlcore driver
Add a general twl device driver twlcore to call i2c send/write
functions.
Abstract twl4030 to call twlcore functions.

Fixed some code-styling issues pointed out by checkpatch.

Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-21 12:46:01 +01:00
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