summaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon-usb
Commit message (Collapse)AuthorAgeFilesLines
...
* staging: octeon-usb: prevent memory corruptionAaro Koskinen2014-03-201-0/+108
| | | | | | | | | | | | | | | | | | octeon-hcd will crash the kernel when SLOB is used. This usually happens after the 18-byte control transfer when a device descriptor is read. The DMA engine is always transfering full 32-bit words and if the transfer is shorter, some random garbage appears after the buffer. The problem is not visible with SLUB since it rounds up the allocations to word boundary, and the extra bytes will go undetected. Fix by providing quirk functions for DMA map/unmap that allocate a bigger temporary buffer when necessary. Tested by booting EdgeRouter Lite to USB stick root file system with SLAB, SLOB and SLUB kernels. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=72121 Reported-by: Sergey Popov <pinkbyte@gentoo.org> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: octeon-usb: Remove unnecessary bracketsRaluca Oncioiu2014-03-081-3/+3
| | | | | | | | | Remove brackets from single line branches of if statements. Break long lines. Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: octeon-usb: Break up long linesRaluca Oncioiu2014-03-081-202/+436
| | | | | | | Break up long lines. Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: Probe via device tree populated platform device.David Daney2014-02-071-157/+116Star
| | | | | | | | | | Extract clocking parameters from the device tree, and remove now dead code and types. Signed-off-by: David Daney <david.daney@cavium.com> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: hcd: move controller wakeup setting initialization to individual driverPeter Chen2013-12-091-0/+1
| | | | | | | | | | | | | | | Individual controller driver has different requirement for wakeup setting, so move it from core to itself. In order to align with current etting the default wakeup setting is enabled (except for chipidea host). Pass compile test with below commands: make O=outout/all allmodconfig make -j$CPU_NUM O=outout/all drivers/usb Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list.h for transactionsAaro Koskinen2013-10-121-41/+36Star
| | | | | | | Use list.h helpers for transactions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list.h for pipesAaro Koskinen2013-10-121-81/+24Star
| | | | | | | Use list.h helpers for pipes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list_for_each_entry_safe()Aaro Koskinen2013-10-121-2/+3
| | | | | | | Use list_for_each_entry_safe() when deleting all list items. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list_del_init()Aaro Koskinen2013-10-121-8/+3Star
| | | | | | | Replace list_del() + INIT_LIST_HEAD() with list_del_init(). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use dynamic allocation for pipesAaro Koskinen2013-10-121-37/+3Star
| | | | | | | Use dynamic memory allocation for pipes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use dynamic allocation for transactionsAaro Koskinen2013-10-121-73/+2Star
| | | | | | | Use dynamic memory allocation for transactions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use a single .h fileAaro Koskinen2013-10-123-365/+312Star
| | | | | | | | | Merge USBC and USBN register definitions into a single header file. Although all HW definitions are purely internal to the driver, it's better to keep them separate due to the large size of the file. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: CN3xxx: program p_xenbn and p_rclk through p_rtypeAaro Koskinen2013-10-122-108/+25Star
| | | | | | | | Do the clock setup through p_rtype on all OCTEONs. This enables to get rid of duplicated register definitions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete cvmx_usbnx_clk_ctl_cn50xxAaro Koskinen2013-10-122-98/+15Star
| | | | | | | | Add the missing bits to common clk ctl definition, and we can delete duplicated definitions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete unused cvmx_usbnx_usbp_ctl_status definitionsAaro Koskinen2013-10-121-382/+0Star
| | | | | | | | cvmx_usbnx_usbp_ctl_status was multiplied for different OCTEONS and all those definitions are unused. Delete them. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: refactor __cvmx_usb_pipe_needs_splitAaro Koskinen2013-10-071-1/+2
| | | | | | | Split a long line and remove redundant parenthesis. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate submit_handleAaro Koskinen2013-10-071-142/+90Star
| | | | | | | Eliminate submit_handle, use a direct reference instead. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate pipe_handleAaro Koskinen2013-10-071-129/+92Star
| | | | | | | Eliminate pipe_handle, use a direct reference instead. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: clean up hcpriv usageAaro Koskinen2013-10-071-6/+6
| | | | | | | | Use ep->hcpriv for pipe handle and urb->hcpriv for submit handle, instead of packing both into the same field. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_control: get params from urbAaro Koskinen2013-10-071-46/+10Star
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_interrupt: get params from urbAaro Koskinen2013-10-071-21/+5Star
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_control: get params from urbAaro Koskinen2013-10-071-27/+6Star
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_bulk: get params from urbAaro Koskinen2013-10-071-20/+4Star
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: replace generic transfer callback data with urbAaro Koskinen2013-10-071-24/+19Star
| | | | | | | URB is always passed, so we can use strong typing here. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: call transfer completion callback directlyAaro Koskinen2013-10-071-243/+111Star
| | | | | | | The callback is always the same, we can just call it directly. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: call port change callback directlyAaro Koskinen2013-10-071-101/+31Star
| | | | | | | Call port change callback directly. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: inline cvmx_usb_set_statusAaro Koskinen2013-10-071-27/+5Star
| | | | | | | Inline a trivial function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate cvmx_usb_internal_stateAaro Koskinen2013-10-071-133/+77Star
| | | | | | | | | Eliminate cvmx_usb_internal_state, just use cvmx_usb_state everywhere. This also enables to allocate only the needed amount of data for the USB internal state, instead of always allocating 64 KB. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: merge cvmx-usb into octeon-hcdAaro Koskinen2013-10-074-3711/+3417Star
| | | | | | | | | | cvmx-usb module provided Cavium "OS abstraction layer" for USB functionality. To make this driver a proper Linux driver, we need to refactor this layer out. By making all the code internal to the HCD driver makes this task easier. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx-usb.h: make comments to fit into 80 columnsAaro Koskinen2013-10-031-7/+7
| | | | | | | Make comments to fit into 80 columns. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx-usb.c: make comments to fit into 80 columnsAaro Koskinen2013-10-031-41/+108
| | | | | | | Make comments to fit into 80 columns. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx-usb: delete unused macrosAaro Koskinen2013-10-031-8/+0Star
| | | | | | | Delete unused cvmx_read_csr / cvmx_write_csr macros. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate CVMX_PREFETCH_PREFXAaro Koskinen2013-10-031-3/+2Star
| | | | | | | Eliminate CVMX_PREFETCH_PREFX. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate CVMX_PREFETCH_PREF0Aaro Koskinen2013-10-031-3/+1Star
| | | | | | | Eliminate CVMX_PREFETCH_PREF0. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete CVMX_PREFETCH128Aaro Koskinen2013-10-031-1/+0Star
| | | | | | | Delete unused macro. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: inline CVMX_PREFETCH0Aaro Koskinen2013-10-031-2/+1Star
| | | | | | | Inline CVMX_PREFETCH0 macro. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: replace CVMX_CLZ with __fls()Aaro Koskinen2013-10-031-5/+3Star
| | | | | | | Replace CVMX_CLZ macro with __fls(). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete redundant flags from cvmx_usb_open_pipe()Aaro Koskinen2013-10-033-8/+3Star
| | | | | | | Delete redudant flags parameter. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete redundant flags from __cvmx_usb_submit_transaction()Aaro Koskinen2013-10-031-7/+0Star
| | | | | | | Delete redundant flags parameter. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete cvmx_usb_isochronous_flagsAaro Koskinen2013-10-033-24/+3Star
| | | | | | | Delete unused flags. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete redundant flags from cvmx_usb_initialize()Aaro Koskinen2013-10-033-39/+25Star
| | | | | | | | The function will always figure out the used clock internally, so delete a redudant parameter and the flag. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: Cocci spatch "noderef"Thomas Meyer2013-09-261-1/+1
| | | | | | | | | sizeof when applied to a pointer typed expression gives the size of the pointer. Found by coccinelle spatch "misc/noderef.cocci" Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate remaining typedef unionsAaro Koskinen2013-08-013-93/+68Star
| | | | | | | | | Remaining typedef unions can be trivially eliminated with the pattern: foo_t -> union foo Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_control_header_t -> union cvmx_usb_control_headerAaro Koskinen2013-08-012-17/+26
| | | | | | | Replace cvmx_usb_control_header_t with union cvmx_usb_control_header. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_internal_state_t -> struct cvmx_usb_internal_stateAaro Koskinen2013-08-011-59/+79
| | | | | | | Replace cvmx_usb_internal_state_t with struct cvmx_usb_internal_state. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_tx_fifo_t -> struct cvmx_usb_tx_fifoAaro Koskinen2013-08-011-6/+6
| | | | | | | Replace cvmx_usb_tx_fifo_t with struct cvmx_usb_tx_fifo_t. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_pipe_list_t -> struct cvmx_usb_pipe_listAaro Koskinen2013-08-011-10/+16
| | | | | | | Replace cvmx_usb_pipe_list_t with struct cvmx_usb_pipe_list. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_pipe_t -> struct cvmx_usb_pipeAaro Koskinen2013-08-011-45/+69
| | | | | | | Replace cvmx_usb_pipe_t with struct cvmx_usb_pipe. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_transaction_t -> struct cvmx_usb_transactionAaro Koskinen2013-08-011-36/+53
| | | | | | | Replace cvmx_usb_transaction_t with struct cvmx_usb_transaction. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_state_t -> struct cvmx_usb_stateAaro Koskinen2013-08-013-52/+51Star
| | | | | | | Replace cvmx_usb_state_t with struct cvmx_usb_state. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>