9
0
Fork 0
Commit Graph

59 Commits

Author SHA1 Message Date
Alexander Shiyan 139a88a337 USB: Check init/post_init errors
Host with inoperable ULPI able to bring the system into an
infinite loop. The patch adds error checking during initialization
to avoid this.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 08:53:23 +02:00
Sascha Hauer eacd5e7cc3 usb: make usb devices children of the corresponding host
To be able to find usb devices in the hardware tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 18:38:22 +02:00
Sascha Hauer 12657cb99e Merge branch 'for-next/usb' 2013-07-01 10:14:40 +02:00
Sascha Hauer ff3c9fa7fb ARM: i.MX51 efikasb: Switch to devicetree probing
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:05 +02:00
Sascha Hauer cd79b13b13 usb: ehci: Fixup efika hack for devicetree
We used to distinguish which USB port to fixup by pdev->id. This
is < 0 for devicetree probed devices all the time, so this won't
work anymore once we switch to devicetree. Do the fixup on every
port instead, it doesn't hurt.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:05 +02:00
Sascha Hauer 706a47fa9c usb: ehci: implement detect callback
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-21 07:41:43 +02:00
Sascha Hauer bf617286d2 usb: ehci: initialize ehci_data
Without it fields of ehci_data may be unitialized and the driver
crashes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-08 08:24:21 +01:00
Sascha Hauer 678832e17a Merge branch 'for-next/usb' 2013-03-04 09:21:54 +01:00
Sascha Hauer 80a4c202dd USB ehci: Add platform specific init calls
Some USB cores need a platform specific init hook, add it to
the ehci driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-14 09:56:35 +01:00
Alexander Shiyan 6a256321b8 Use new device_platform_driver() macro for drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-13 09:23:28 +01:00
Sascha Hauer 22e2544809 Merge branch 'for-next/compile-log-level'
Conflicts:
	drivers/usb/host/ehci-hcd.c
2013-02-04 15:48:51 +01:00
Sascha Hauer 00c7c8ecab USB ehci: Use dev_* for messages
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 14:24:39 +01:00
Jean-Christophe PLAGNIOL-VILLARD 074964830b ehci: add atmel support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 08:57:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD e1bb118d0e ehci: if caps ressource is not provided discover it via cr_capbase
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 08:56:56 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3cb0138d40 usb: fix for USB_ST_STALLED status reporting in ehci_submit_async()
Checking the status field of the qTD token in the current code
do not take into acount cases where endpoint stall (halted) bit
is set together with XactErr status bit. As a result clearing
stall on an endpoint won't be done if this status bit was also
set. Check for halted bit and report USB_ST_STALLED status
if the host controller also indicates endpoit stall condition.

From u-boot by Anatolij Gustschin <agust@denx.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 08:56:56 +01:00
Jean-Christophe PLAGNIOL-VILLARD a25d9190fb ohci: only enable drivers if ohci is enabled
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 08:36:17 +01:00
Jean-Christophe PLAGNIOL-VILLARD 28981f775c ohci: make it depends on !MMU
the current mmu support is broken

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-23 08:36:17 +01:00
Sascha Hauer db31ccf293 Merge branch 'for-next/omap' 2013-01-09 10:29:08 +01:00
Sascha Hauer 95f4112191 ARM omap3: Add change OMAP_ prefix to OMAP3_ for registers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-20 11:43:05 +01:00
Sascha Hauer 9239281a5e USB ehci: Add powerup fixup for EfikaSB
The EfikaSB has a bug requiring to write to an ULPI register after
powerup. It doesn't seem that this this bug is present on any other
hardware, so add a workaround directly into the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 11:27:34 +01:00
Sascha Hauer 15fd89d0a4 USB ehci: Allow to register independently from device
The EHCI core often is part of a otg core. Allow it to be registered
separately from another driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 17:47:42 +01:00
Jean-Christophe PLAGNIOL-VILLARD 3c5327e660 switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-04 15:19:12 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +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 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 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 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
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
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
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
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
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 d25d8fe2a7 Merge branch 'usb-massstorage' into next 2011-09-28 09:14:01 +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
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
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 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 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
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