Commit Graph

33 Commits

Author SHA1 Message Date
Eli Billauer 44909e658e staging: xillybus: Removed outdated part in README
The dedicated memory management routines have been replaced with devres API,
so the related part is removed from the doc.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 17:18:44 -07:00
Eli Billauer 84590b1aa9 staging: xillybus: Fix if-else coding style errors
According to Documentation/CodingStyle, when one branch of an if-else
statement has multiple statements, both branches should be enclosed in curly
brackets.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 17:18:44 -07:00
Vincent Bernat 91d421945b staging: xillybus: fix some coding style errors
This includes:
 - keep "else" on the same line as the closing brace
 - don't use "else" after "return"
 - don't issue a message for an out-of-memory error
 - blank line after a declaration

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-16 13:27:06 -07:00
Eli Billauer 539889ee49 staging: xillybus: Register's address offset notation update
In iowrite32() calls, the address of registers was expressed as e.g.
&ep->registers[fpga_msg_ctrl_reg]. This changes to the more common format
e.g. ep->registers + fpga_msg_ctrl_reg.

There is no functional change.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:20:37 -07:00
Eli Billauer 049c1fb4fc staging: xillybus: Reorganizing xilly_setupchannels()
Duplicate code in this function was moved into a new function,
xilly_get_dma_buffers().

There is no change in functionality.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:20:37 -07:00
Eli Billauer cc6289fa14 staging: xillybus: Add sanity check in interrupt handler
Data arriving from the hardware is verified prior to its use. The lack of
this check has never been reported to cause a problem, but it's necessary
nevertheless.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:19:37 -07:00
Eli Billauer 525be905dc staging: xillybus: Use devm_ API for memory allocation and DMA mapping
Managed device resource API replaces code that reinvents it for memory
allocation, page allocation and DMA mapping.

devm_add_action() is used for unwinding DMA mappings, since there is no
devm_* API for dma_map_single(). A recent patch that introduces such API
was rejected, mainly on the grounds that it may cause an unnecessary waste of
resources.

Suggested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:19:25 -04:00
Eli Billauer 9267462e6c staging: xillybus: Use devm_ API on probe and remove
Suggested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 02:11:48 +09:00
Eli Billauer 94debda324 staging: xillybus: XILLYBUS_PCIE depends on PCI_MSI
xillybus_pcie.c will compile and load properly on PCI only, but will do
nothing useful without PCI_MSI.

PCI_MSI depends on PCI, so depending on PCI_MSI covers both.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-21 12:24:09 -07:00
Eli Billauer 87b92503c1 staging: xillybus: Added "select CRC32" for XILLYBUS in Kconfig
Reason: xillybus_core.c uses crc32_le()

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-21 12:24:09 -07:00
Richard Weinberger 3e67dee2f6 staging/xillybus: Handle OOM in xillybus_init()
alloc_workqueue() can fail and returns NULL in case of
OOM.
Handle this case and undo class_create().

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 16:22:27 -07:00
Eli Billauer cc212550ee staging: xillybus: Open Firmware driver supporting coherent DMA
If the "dma-coherent" property is present in the device tree, the driver will
not perform cache invalidations. This feature significantly improves data
throughput and reduces CPU load.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:42:36 -08:00
Eli Billauer 24b33c909e staging: xillybus: Changed Open Firmware "compatible" property
The previous "compatible" string was poorly chosen, but remains in the
match list to support existing DTBs. There is no risk for a naming clash.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 10:42:35 -08:00
Eli Billauer 9340e9dc9d staging: xillybus: Return -EIO if *_iomap fails, instead of 0
This patch replicates the correction made by Wei Yongjun on a second
occurrence of the same bug.

The first correction was in commit 8eec455551.

Bug fixed: The error code was not set, so the error condition wasn't reflected
in the return value.

Reported-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 17:07:13 -08:00
Wei Yongjun 8eec455551 staging: xillybus: fix error return code in xilly_probe()
Fix to return negative error code -EIO from the error handling
case instead of 0.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 09:48:58 -08:00
Eli Billauer b774930e08 staging: xillybus: Removed force to be a module
The driver was forced to "module only" following a previous failure to build
into the kernel. The problem was resolved several months ago.

This has been successfully tested with "make allyesconfig" on x86_64.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-10 23:16:24 -08:00
Jingoo Han 41e043fcfa staging: remove DEFINE_PCI_DEVICE_TABLE macro
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-02 22:32:35 -08:00
Eli Billauer 35fcf7e3c0 staging: xillybus: Use dev_* functions instead of pr_* in xillybus_core
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:41:34 -07:00
Eli Billauer 1a2f9a9ea5 staging: xillybus: Use dev_* functions instead of pr_* in xillybus_of
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:41:34 -07:00
Eli Billauer 2cb85c0845 staging: xillybus: Use dev_* functions instead of pr_* in xillybus_pcie
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:41:34 -07:00
Eli Billauer 26a6fc93fc staging: xillybus: Remember device pointer for use with dev_* functions
This is necessary so that xillybus_core uses the correct device pointer
for PCIe devices in diagnostic message calls (dev_err, dev_warn and dev_info)

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19 13:41:34 -07:00
Sachin Kamat 7a620a650b staging: xillybus: Use module_platform_driver
module_platform_driver simplifies the code by removing the boilerplate.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:23:14 -07:00
Ebru Akagunduz ae1dd9bc55 Staging: xillybus: quoted strings split across lines
Fix checkpatch.pl issues with quoted strings split across lines in xillybus_core.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:11:31 -07:00
Baruch Siach f30bd6855c staging: xillybus: remove redundant Kconfig dependency
XILLYBUS_PCIE and XILLYBUS_OF are inside 'if XILLYBUS' already, so there is not
need to depend on XILLYBUS.

Cc: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-05 17:52:58 -07:00
Kees Cook e72b9da083 staging: xillybus: fix format string usage
Makes sure format string cannot leak into device_create() call.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-17 07:39:27 -07:00
Sachin Kamat aac6b82e89 staging: xillybus: Remove duplicate inclusion of list.h
list.h header file was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-22 10:07:49 -07:00
Masanari Iida 9379fd547e staging: xillybus: Fix typo in comment
Correct spelling typo in comments.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-19 15:31:58 -07:00
Eli Billauer 7ee9ded220 staging: xillybus: Fixed sparse errors
Changes:

* xillybus.h: __iomem added to struct xilly_endpoint -> registers to suppress
  "different address spaces" errors.

* xillybus_core.c: __user added as required for the same reason.

* The two member names of struct xilly_endpoint_hardware of the form
  sync_single_for_{cpu,device} were changed to something that won't look
  like the well-known functions.

* All *.c files: Variables and functions made static as required.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:41:56 -07:00
Eli Billauer 853a57f2d3 staging: xillybus: Removed dependency on OF_DEVICE in Kconfig
This variable was removed from the kernel a while ago.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:41:56 -07:00
Wei Yongjun fc4360d664 staging: xillybus: remove duplicated include from xillybus_core.c
Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:29:37 -07:00
Eli Billauer e71042f241 staging: xillybus: Multiple definition of xillyname resolved (bug fix)
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 15:01:49 -07:00
Greg Kroah-Hartman f6a6621e54 staging: xillybus: force to be a module
As reported, this driver causes problems when built into the kernel, so
force it to be a module until those issues are fixed.

Also delete the "default n" lines in the Kconfig, as they are not
needed.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-26 14:20:39 -07:00
Eli Billauer 48bae05074 staging: New driver: Xillybus generic interface for FPGA
This is the driver for Xillybus, which is a general-purpose interface for
data communication with FPGAs (programmable logic). Please refer to the
README included in this patch for a detailed explanation.

It was previously submitted for misc-devices, but it appears like noone's
willing to review the code (which I can understand, given its magnitude).
Hence submitted as a staging driver.

Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 13:49:19 -07:00