aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-mc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-06-23staging: fsl-mc: fix a few implicit includesLaurentiu Tudor5-0/+5
Few files using byte order macros but did not explicitly included the required kernel header, so add it. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: remove dpmng API filesLaurentiu Tudor3-142/+52
dpmng.h & dpmng.c files expose an API of just one function which is only used by the bus driver. Move that single API in the bus source as static and remove the two files. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: move rest of mc-bus.h to private headerLaurentiu Tudor8-83/+61
All the mc-bus.h contents is only used privately in the bus driver so move everything to the private header and get rid of the mc-bus.h header file. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: move couple of definitions to public headerLaurentiu Tudor2-9/+9
Define dev_is_fsl_mc() and the bus type definition (fsl_mc_bus_type) are used externally so move them to the public header. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: move irq domain creation prototype to public headerLaurentiu Tudor2-7/+7
fsl_mc_msi_create_irq_domain() will is used from the irqchip glue code so it needs to be in the public headers. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: turn several exported functions staticLaurentiu Tudor3-16/+5
They are never used outside the source they are implemented in and very likely never will, so it's safe to make them static. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: delete prototype of unimplemented functionLaurentiu Tudor1-2/+0
The function fsl_mc_bus_exists() has a prototype but is never implemented so delete it from the header file. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: delete duplicated function prototypesLaurentiu Tudor1-8/+0
These functions already have their prototypes in fsl-mc-private.h header file so delete them from mc-bus.h. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: decouple the mc-bus public headers from dprc.hLaurentiu Tudor6-71/+71
In its current form, the public headers of the mc-bus depend only on a structure "dprc_obj_desc" defined in dprc.h. Move it to the bus public header together with its associated defines and, in order to keep the naming prefixes consistent rename it to "fsl_mc_obj_desc". This will allow making dprc.h private in future patches. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: drop useless #includesLaurentiu Tudor1-2/+0
These couple of header files are not needed in the source so remove them. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc: drop macros with possible side effectsLaurentiu Tudor2-14/+19
Several macros were triggering this checkpatch.pl warning: "Macro argument reuse '$arg' - possible side-effects?" Fix the warning by turning them into real functions. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-23staging: fsl-mc/dpio: Propagate error codeIoana Radulescu1-3/+3
dpaa2_io_service_register() returns zero even if qbman_swp_CDAN_set() encountered an error. Fix this by propagating the error code so the caller is informed data availability notifications are not properly set for a channel. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Acked-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-22irqchip/MSI: Use irq_domain_update_bus_token instead of an open coded accessMarc Zyngier1-1/+1
Now that we have irq_domain_update_bus_token(), switch everyone over to it. The debugfs code thanks you for your continued support. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2017-06-14staging: fsl-mc: fix typo in commentGabriel L. Somlo1-1/+1
Resolving checkpatch issue: CHECK: 'successfuly' may be misspelled - perhaps 'successfully'? Signed-off-by: Gabriel Somlo <gsomlo@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: add reference to mc-bus DT bindingLaurentiu Tudor1-0/+2
Update README to reference the mc-bus device tree node binding. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: drop reference to restoolLaurentiu Tudor1-3/+1
Drop reference to user space restool utility from the README. It will be added back together with the actual support in the bus driver. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: drop unused forward declarationLaurentiu Tudor1-1/+0
This forward declaration of "struct fsl_mc_resource" is of no use so drop it. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: remove extra blank lineLaurentiu Tudor1-1/+0
Remove extra blank line reported by checkpatch.pl. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: drop a few useless #includesLaurentiu Tudor3-3/+1
Some #includes were needlessly done from header files. Drop them from there and update the only .c file that implicitly needed one of those #includes. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: simplify couple of deallocationsLaurentiu Tudor1-9/+3
Simplify a couple of deallocations code paths. This also fixes these checkpatch.pl false positives: "WARNING: kfree(NULL) is safe and this check is probably not required" Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13staging: fsl-mc: enclose macro params in parensLaurentiu Tudor4-4/+4
Several macros didn't had macro params enclosed in parens. Fix them to avoid precedence issues. Found with checkpatch.pl who was issuing this message: "Macro argument 'id' may be better as '(id)' to avoid precedence issues" Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: fsl-mc: Fix code alignment style issuesBrett Hitchcock2-6/+6
Fixing recommendation from checkpatch.pl: "CHECK: Alignment should match open parenthesis" Signed-off-by: Brett Hitchcock <bretth256@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: fsl-mc/dpio: add cpu <--> LE conversion for dpaa2_fdHoria Geantă1-21/+24
While dpaa2_fd.simple structure fields are marked __leXX, corresponding cpu_to_leXX / leXX_to_cpu conversions are missing. While here, fix dpaa2_fd_{get,set}_bpid such that BMT, IVP bits sharing the 16-bit field with BPID are not affected. Fixes: d3269bdc7ebc ("bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs") Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: fsl-mc: bus: add DPCON object APIsIoana Radulescu4-24/+480
This patch adds the command building/parsing wrapper functions for the DPCON object. The binary interface version is v3.2. A DPCON (DataPath Concentrator) is an aggregator object that allows ingress frames from multiple hardware queues to be seen as coming from a single source, from the CPU point of view. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: fsl-mc: bus: dpio: fix alter FQ state commandHoria Geantă1-1/+1
When checking the response verb, the valid bit should be masked out, since its value flips depending on what Response Register (RR0 /RR1) it's been read from. Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2") Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08staging: fsl-mc/dpio: Fix early writing of valid bitIoana Radulescu1-4/+6
Commands written to the QMan software portals have a valid bit in the "verb" field of the command that, when set with the right value, notifies the hardware that the command is fully written and ready to be processed. The "verb" field should be the last one to be written in the swp command registers, after all other fields are filled in. The current implementation doesn't follow this rule for all commands, which may result in an incompletely configured command being processed by the hardware. Enforce the correct order of writes to avoid this situation. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add the DPAA2 DPIO object driverRoy Pledge2-1/+297
The DPIO driver registers with the fsl-mc bus to handle bus-related events for DPIO objects. Key responsibility is mapping I/O regions, setting up interrupt handlers, and calling the DPIO service initialization during probe. Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Haiying Wang <haiying.wang@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add the DPAA2 DPIO service interfaceRoy Pledge3-1/+758
The DPIO service interface handles initialization of DPIO objects and exports APIs to be used by other DPAA2 object drivers to perform queuing and buffer management related operations. The service allows registration of callbacks when frames or notifications are received. Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Haiying Wang <haiying.wang@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2Roy Pledge3-1/+1503
Add QBman APIs for frame queue and buffer pool operations. Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Haiying Wang <haiying.wang@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add global dpaa2 definitionsRoy Pledge1-0/+202
Create header for global dpaa2 definitions. Add definitions for dequeue results. Signed-off-by: Roy Pledge <Roy.Pledge@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIsRoy Pledge1-0/+448
Add global definitions for DPAA2 frame descriptors and scatter gather entries. Signed-off-by: Roy Pledge <Roy.Pledge@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add APIs for DPIO objectsIoana Radulescu6-0/+430
Add the command build/parse APIs for operating on DPIO objects through the DPAA2 Management Complex. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-14bus: fsl-mc: dpio: add DPIO driver overview documentStuart Yoder1-0/+135
add document describing the dpio driver and it's role, components and major interfaces Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Roy Pledge <roy.pledge@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06staging: fsl-mc: fix coding style warningLucian Zala1-2/+2
Fix for "WARNING: Avoid multiple line dereference - prefer 'mc_msi_domain->host_data'" found by checkpatch.pl in bus/irq-gic-v3-its-fsl-mc-msi.c. Signed-off-by: Lucian Zala <zala.lucian@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-01staging: fsl-mc: fix warning in DT ranges parserArnd Bergmann1-13/+9
The fsl-mc-bus driver in staging contains a copy of the standard 'ranges' property parsing algorithm with a hack to treat a missing property the same way as an empty one. This code produces false-positive warnings for me in an allmodconfig build: drivers/staging/fsl-mc/bus/fsl-mc-bus.c: In function 'fsl_mc_bus_probe': drivers/staging/fsl-mc/bus/fsl-mc-bus.c:645:6: error: 'mc_size_cells' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/staging/fsl-mc/bus/fsl-mc-bus.c:682:8: error: 'mc_addr_cells' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/staging/fsl-mc/bus/fsl-mc-bus.c:644:6: note: 'mc_addr_cells' was declared here drivers/staging/fsl-mc/bus/fsl-mc-bus.c:684:8: error: 'paddr_cells' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/staging/fsl-mc/bus/fsl-mc-bus.c:643:6: note: 'paddr_cells' was declared here To avoid the warnings, I'm simplifying the argument handling to pass the number of valid ranges in the property as the function return code rather than passing it by reference. With this change, gcc can see that we don't evaluate the cell numbers for an missing ranges property. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-14staging: fsl-mc: Add missing headerBogdan Purcareata2-0/+2
Compiling the fsl-mc bus driver will yield a couple of static analysis errors: warning: symbol 'fsl_mc_msi_domain_alloc_irqs' was not declared warning: symbol 'fsl_mc_msi_domain_free_irqs' was not declared. warning: symbol 'its_fsl_mc_msi_init' was not declared. warning: symbol 'its_fsl_mc_msi_cleanup' was not declared. Since these are properly declared, but the header is not included, add it in the source files. This way the symbol is properly exported. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: set msi_domain_ops as __ro_after_initJess Frazelle1-1/+1
Marked msi_domain_ops structs as __ro_after_init when called only during init. This protects the data structure from accidental corruption. Suggested-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jess Frazelle <me@jessfraz.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: dprc: drop unused APIsLaurentiu Tudor3-927/+0
Leave only APIs that area actually used in the bus driver. The patch is mostly mechanical, with a couple exceptions: - getters/setters were not removed even if only one of them is being used - versioning API was also left in place They will be added back on an as-needed basis. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: dpbp: add a few missing EXPORT_SYMBOL()sLaurentiu Tudor1-0/+3
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: dpbp: drop unused APIsLaurentiu Tudor3-694/+0
Leave only APIs that will be used in upcomming drivers. The patch is mostly mechanical, with a couple exceptions: - getters/setters were not removed even if only one of them is being used - versioning API was also left in place They will be added back on an as-needed basis. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: dpmng: drop unused prototypeLaurentiu Tudor2-5/+1
The implementation was removed in commit: decd3d0cf (staging: fsl-mc: uprev binary interface to match MC v10.x) but the prototype was left behind. Also fix a message that was wrongly mentioning it. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: dpmcp: drop unused APIsLaurentiu Tudor3-573/+4
These APIs are not used yet, so drop the dead code. The patch is mostly mechanical, with a couple exceptions: - getters/setters were not removed even if only one of them is being used - versioning API was also left in place Also in this patch, add missing prototype for version query function. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: remove slab cache for mc devicesLaurentiu Tudor1-14/+3
Let's drop the slab cache for objects until we actually have proof that it improves performance. This makes the code cleaner. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: don't use devres api for refcounted objectsLaurentiu Tudor1-3/+3
Mixing two memory management systems, in this case managed device resource api and refcounted objects is a bad idea. Lifetime of an object is controlled by its refcount so allocating it with other apis that have their own lifetime control is not ok. Drop devm_*() apis in favor of plain allocations. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: add device release callbackLaurentiu Tudor1-12/+17
When hot unplugging a mc-bus device the kernel displays this pertinent message, followed by a stack dump: "Device 'foo.N' does not have a release() function, it is broken and must be fixed." Add the required callback to fix and drop the now uneeded explicit freeing. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: fix device ref countingLaurentiu Tudor2-1/+1
Drop unneeded get_device() call at device creation and, as per documentation, drop reference count after using device_find_child() return. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: fsl-mc: drop root dprc countingLaurentiu Tudor1-25/+1
It was used just to sanity check some obscure cases that are unlikely to ever happen. Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-08staging: fsl-mc: remove unnecessary info prints from bus driverStuart Yoder1-6/+0
remove pr_info/dev_info prints that add unnecessary verbosity Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-15Staging: fsl-mc: include: mc: Kernel type 'int' preferred over 's16'Shiva Kerdel1-2/+2
After following a discussion about the used integer types Dan Carpenter pointed out that 'int' types should be used over the current change to 's16'. The reason for this is to have an upper bound instead of overflowing the 's16' so we could still remove devices. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Suggested-by: Stuart Yoder <stuart.yoder@nxp.com> Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-14Staging: fsl-mc: include: mc: Kernel type 's32' preferred over 'int32_t'Shiva Kerdel1-1/+1
Follow the kernel type preferrences of using 's32' over 'int32_t'. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Acked-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>