Commit Graph

236 Commits

Author SHA1 Message Date
Laurentiu Tudor 5776aad3fe staging: fsl-mc: fix a few implicit includes
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-23 18:44:01 +02:00
Laurentiu Tudor b065307fe0 staging: fsl-mc: remove dpmng API files
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-23 18:44:01 +02:00
Laurentiu Tudor af4376710c staging: fsl-mc: move rest of mc-bus.h to private header
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-23 18:44:00 +02:00
Laurentiu Tudor 7eba570ece staging: fsl-mc: move couple of definitions to public header
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-23 18:44:00 +02:00
Laurentiu Tudor b32cdde14e staging: fsl-mc: move irq domain creation prototype to public header
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-23 18:44:00 +02:00
Laurentiu Tudor 10a8593a76 staging: fsl-mc: turn several exported functions static
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-23 18:44:00 +02:00
Laurentiu Tudor be6faff74c staging: fsl-mc: delete prototype of unimplemented function
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-23 18:44:00 +02:00
Laurentiu Tudor 48d3cfb318 staging: fsl-mc: delete duplicated function prototypes
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-23 18:44:00 +02:00
Laurentiu Tudor c6ce019edb staging: fsl-mc: decouple the mc-bus public headers from dprc.h
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-23 18:44:00 +02:00
Laurentiu Tudor bb4a64b79f staging: fsl-mc: drop useless #includes
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-23 18:44:00 +02:00
Laurentiu Tudor 410ab9b5f8 staging: fsl-mc: drop macros with possible side effects
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-23 18:44:00 +02:00
Ioana Radulescu 30c9dbf317 staging: fsl-mc/dpio: Propagate error code
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-23 18:41:33 +02:00
Marc Zyngier 96f0d93a48 irqchip/MSI: Use irq_domain_update_bus_token instead of an open coded access
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-22 18:29:17 +02:00
Gabriel L. Somlo 1802d96eb6 staging: fsl-mc: fix typo in comment
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-14 12:26:42 +02:00
Laurentiu Tudor 5ebf8d2d87 staging: fsl-mc: add reference to mc-bus DT binding
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-13 12:14:12 +02:00
Laurentiu Tudor 49df58e927 staging: fsl-mc: drop reference to restool
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-13 12:14:12 +02:00
Laurentiu Tudor b5d5740a00 staging: fsl-mc: drop unused forward declaration
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-13 12:14:12 +02:00
Laurentiu Tudor 6e0556cc93 staging: fsl-mc: remove extra blank line
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-13 12:14:12 +02:00
Laurentiu Tudor 4506386173 staging: fsl-mc: drop a few useless #includes
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-13 12:14:12 +02:00
Laurentiu Tudor a042fbed02 staging: fsl-mc: simplify couple of deallocations
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-13 12:14:12 +02:00
Laurentiu Tudor 72f3415f81 staging: fsl-mc: enclose macro params in parens
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-06-13 12:14:12 +02:00
Brett Hitchcock 814f3be22e staging: fsl-mc: Fix code alignment style issues
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-05-15 12:51:20 +02:00
Horia Geantă 11270059e8 staging: fsl-mc/dpio: add cpu <--> LE conversion for dpaa2_fd
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: d3269bdc7e ("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-28 17:51:54 +02:00
Ioana Radulescu 24999f3338 staging: fsl-mc: bus: add DPCON object APIs
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-28 14:25:17 +02:00
Horia Geantă c96d886d7b staging: fsl-mc: bus: dpio: fix alter FQ state command
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: 321eecb06b ("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-28 14:21:50 +02:00
Ioana Radulescu 141a10aead staging: fsl-mc/dpio: Fix early writing of valid bit
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-04-08 17:05:59 +02:00
Roy Pledge 993fec7e11 bus: fsl-mc: dpio: add the DPAA2 DPIO object driver
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-14 11:19:52 +08:00
Roy Pledge 780b626323 bus: fsl-mc: dpio: add the DPAA2 DPIO service interface
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-14 11:19:52 +08:00
Roy Pledge 321eecb06b bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2
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-14 11:19:52 +08:00
Roy Pledge ba8005b989 bus: fsl-mc: dpio: add global dpaa2 definitions
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-14 11:19:52 +08:00
Roy Pledge d3269bdc7e bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs
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-14 11:19:52 +08:00
Ioana Radulescu 2704aedb5c bus: fsl-mc: dpio: add APIs for DPIO objects
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-14 11:19:52 +08:00
Stuart Yoder 0e6437941e bus: fsl-mc: dpio: add DPIO driver overview document
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-14 11:19:52 +08:00
Lucian Zala e65a60e5cd staging: fsl-mc: fix coding style warning
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-06 09:16:59 +01:00
Arnd Bergmann a45e47f4b3 staging: fsl-mc: fix warning in DT ranges parser
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-03-01 09:23:56 +01:00
Bogdan Purcareata 07e9ef1460 staging: fsl-mc: Add missing header
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-14 09:14:28 -08:00
Jess Frazelle 76b94eb1eb staging: set msi_domain_ops as __ro_after_init
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-12 13:26:15 +01:00
Laurentiu Tudor db17c640e7 staging: fsl-mc: dprc: drop unused APIs
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-09 13:26:02 +01:00
Laurentiu Tudor 5e62af8835 staging: fsl-mc: dpbp: add a few missing EXPORT_SYMBOL()s
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-09 13:26:02 +01:00
Laurentiu Tudor 7337013473 staging: fsl-mc: dpbp: drop unused APIs
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-09 13:26:02 +01:00
Laurentiu Tudor 58acb3875b staging: fsl-mc: dpmng: drop unused prototype
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-09 13:26:01 +01:00
Laurentiu Tudor ee9d06064e staging: fsl-mc: dpmcp: drop unused APIs
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-09 13:26:01 +01:00
Laurentiu Tudor 9b65332e0e staging: fsl-mc: remove slab cache for mc devices
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-09 13:26:01 +01:00
Laurentiu Tudor dc341c4ec2 staging: fsl-mc: don't use devres api for refcounted objects
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-09 13:26:01 +01:00
Laurentiu Tudor 95b3523b72 staging: fsl-mc: add device release callback
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-09 13:26:01 +01:00
Laurentiu Tudor 95b5daf532 staging: fsl-mc: fix device ref counting
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-09 13:26:01 +01:00
Laurentiu Tudor 0e724ba37e staging: fsl-mc: drop root dprc counting
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>
2017-02-09 13:26:01 +01:00
Stuart Yoder 3c87f653af staging: fsl-mc: remove unnecessary info prints from bus driver
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-12-08 21:00:08 +01:00
Shiva Kerdel cbafdc9816 Staging: fsl-mc: include: mc: Kernel type 'int' preferred over 's16'
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-15 11:01:54 +01:00
Shiva Kerdel e273d54380 Staging: fsl-mc: include: mc: Kernel type 's32' preferred over 'int32_t'
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>
2016-11-14 15:51:15 +01:00
Shiva Kerdel 04d5b9f79c Staging: fsl-mc: include: mc: Kernel type 's16' preferred over 'int16_t'
Follow the kernel type preferrences of using 's16' over 'int16_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>
2016-11-14 15:51:15 +01:00
Ioana Ciornei decd3d0cfd staging: fsl-mc: uprev binary interface to match MC v10.x
DPAA2 will not support MC firmware versions prior to MC v10.x.
Update the MC interface code and drivers to reflect this.
   -update the object .h files and code that builds commands to include
    the new command version in the command header
   -object versions are no longer available in the object attributes,
    so remove references to them and instead get the version from the
    new get_api_version() command
   -create/destroy commands for all objects have new arguments
   -dpmng_get_container_id() is replaced by dprc_get_container_id()

This supports a hardware ABI change and thus to match the new ABI
all the above changes need to happen in a single patch.

All MC firmware versions >= 10 will be supported going forward.

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>
2016-10-27 15:15:11 +02:00
Stuart Yoder 6466dac79c staging: fsl-mc: update copyright dates
Many source files have evolved without copyright date
updates.  Update the dates to reflect work through
2016.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Stuart Yoder 58caaac1f5 staging: fsl-mc: improve wording in comments
improve and clarify miscellaneous comments in the bus driver
and allocator

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Stuart Yoder e3494af5ce staging: fsl-mc: cleanup: improve clarity of messages
improve some messages by shortening and rewording

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Stuart Yoder 66fcc741ed staging: fsl-mc: improve message clarity by adding __func__
clarify some error messages by printing the actual function name
involved

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Stuart Yoder a673783771 staging: fsl-mc: improve pr_* messages
define pr_fmt so non dev_* messages will have an fsl-mc prefix
and remove "fsl-mc" from messages where it would now be redundant

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Stuart Yoder 363b0cbf3d staging: fsl-mc: cleanup comment style
Be consistent and use kernel-preferred multi-line comment style
everywhere.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Ioana Ciornei fea9a0f51f staging: fsl-mc: whitespace cleanup: improve alignment in prototypes
To improve readability for structs and function definitions, separate type
and variable name by a single space, instead of an inconsistent number of
tabs.

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>
2016-10-27 15:15:11 +02:00
Ioana Ciornei 7eef98273d staging: fsl-mc: whitespace cleanup: align function args
align function arguments that were not aligned to the starting parenthesis

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>
2016-10-27 15:15:11 +02:00
Stuart Yoder eacaebdd52 staging: fsl-mc: whitespace cleanup: remove extraenous tabs
use one tab to separate name and value in #define definitions

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:11 +02:00
Stuart Yoder b4cdc91602 staging: fsl-mc: whitespace cleanup: remove blank lines
remove instances of multiple blank lines in comments

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-27 15:15:10 +02:00
Ioana Ciornei 3e93e354de staging: fsl-mc: cleanup: convert uintX_t types to uX
Replace all uses of uintX_t types with uX types in order to comply with
kernel coding style and resolve checkpatch warnings.

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>
2016-10-25 09:48:55 +02:00
Stuart Yoder dffeacd95e staging: fsl-mc: dprc: shorten DPRC interrupt name
improve readibility of the DPRC interrupt name in sysfs by
shortening this and just using the device name.  There is only
one interrupt DPRC used, so no further differentiation is needed.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:48:55 +02:00
Stuart Yoder d64c28a313 staging: fsl-mc: irq: shorten name of interrupt name
For /proc/interrupts readability, platform bus MSIs are named
"ITS-pMSI" in the GIC ITS implementation for that bus.  Follow
a similar naming convention and call fsl-mc bus MSIs
"ITS-fMSI".

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:48:55 +02:00
Stuart Yoder 3642b8ea38 staging: fsl-mc: update Kconfig dependency
The Kconfig dependency previously included ARM64, which is not
strictly correct.  Change it to ARCH_LAYERSCAPE which is the
SoC platform that includes the DPAA2 hardware.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:48:55 +02:00
Stuart Yoder 8431dc5d8d staging: fsl-mc: clean up Kconfig description
Except for copyrights we are avoiding all references
to Freescale, which no longer exists as a brand.  Cleanup
Freescale references and simplify the Kconfig description
of the fsl-mc bus.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:48:55 +02:00
Stuart Yoder 8cf6630534 staging: fsl-mc: add missing includes to fsl-mc-private.h
fsl-mc-private.h references several definitions that it does not explicitly
have includes for. Up until now we've gotten lucky due to include ordering
that things compile.  Add the missing includes.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:48:55 +02:00
Stuart Yoder 824ebf182d staging: fsl-mc: cleanup: move dpbp and dpcon cmd headers
The dpbp and dpcon cmd header files should not be in the public
include directory but should be private to the bus driver.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:48:54 +02:00
Linus Torvalds 41844e3620 Staging/IIO patches for 4.9-rc1
Here is the big staging and IIO driver pull request for 4.9-rc1.
 
 There are a lot of patches in here, the majority due to the
 drivers/staging/greybus/ subsystem being merged in with full development
 history that went back a few years, in order to preserve the work that
 those developers did over time.  This was done the same way that btrfs
 was merged into the tree, so all should be ok there.
 
 Lots and lots of tiny cleanups happened in the tree as well, due to the
 Outreachy application process and lots of other developers showing up
 for the first time to clean code up.  Along with those changes, we
 deleted a wireless driver, and added a raspberrypi driver (currently
 marked broken), and lots of new iio drivers.
 
 Overall the tree still shrunk with more lines removed than added, about
 10 thousand lines removed in total.  Full details are in the very long
 shortlog below.
 
 All of this has been in the linux-next tree with no issues.  There will
 be some merge problems with other subsystem trees, but those are all
 minor problems and shouldn't be hard to work out when they happen
 (MAINTAINERS and some lustre build problems with the IB tree.)
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iFYEABECABYFAlf0qWIPHGdyZWdAa3JvYWguY29tAAoJEDFH1A3bLfsp9GkAoLMa
 Dl/S8W02azDtKP893es5GXh3AJ4k8J9JlHgTS0RlzVJMvzkSZ2x7Vg==
 =j18s
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO updates from Greg KH:
 "Here is the big staging and IIO driver pull request for 4.9-rc1.

  There are a lot of patches in here, the majority due to the
  drivers/staging/greybus/ subsystem being merged in with full
  development history that went back a few years, in order to preserve
  the work that those developers did over time.

  Lots and lots of tiny cleanups happened in the tree as well, due to
  the Outreachy application process and lots of other developers showing
  up for the first time to clean code up.  Along with those changes, we
  deleted a wireless driver, and added a raspberrypi driver (currently
  marked broken), and lots of new iio drivers.

  Overall the tree still shrunk with more lines removed than added,
  about 10 thousand lines removed in total. Full details are in the very
  long shortlog below.

  All of this has been in the linux-next tree with no issues. There will
  be some merge problems with other subsystem trees, but those are all
  minor problems and shouldn't be hard to work out when they happen
  (MAINTAINERS and some lustre build problems with the IB tree)"

And furter from me asking for clarification about greybus:
 "Right now there is a phone from Motorola shipping with this code (a
  slightly older version, but the same tree), so even though Ara is not
  alive in the same form, the functionality is happening. We are working
  with the developers of that phone to merge the newer stuff in with
  their fork so they can use the upstream version in future versions of
  their phone product line.

  Toshiba has at least one chip shipping in their catalog that
  needs/uses this protocol over a Unipro link, and rumor has it that
  there might be more in the future.

  There are also other users of the greybus protocols, there is a talk
  next week at ELC that shows how it is being used across a network
  connection to control a device, and previous ELC talks have showed the
  protocol stack being used over USB to drive embedded Linux boards.
  I've also talked to some people who are starting to work to add a host
  controller driver to control arduinos as the greybus PHY protocols are
  very useful to control a serial/i2c/spio/whatever device across a
  random physical link, as it is a way to have a self-describing device
  be attached to a host without needing manual configuration.

  So yes, people are using it, and there is still the chance that it
  will show up in a phone/laptop/tablet/whatever from Google in the
  future as well, the tech isn't dead, even if the original large phone
  project happens to be"

* tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (3703 commits)
  Staging: fbtft: Fix bug in fbtft-core
  staging: rtl8188eu: fix double unlock error in rtw_resume_process()
  staging:r8188eu: remove GEN_MLME_EXT_HANDLER macro
  staging:r8188eu: remove GEN_DRV_CMD_HANDLER macro
  staging:r8188eu: remove GEN_EVT_CODE macro
  staging:r8188eu: remove GEN_CMD_CODE macro
  staging:r8188eu: remove pkt_newalloc member of the recv_buf structure
  staging:r8188eu: remove rtw_handle_dualmac declaration
  staging:r8188eu: remove (RGTRY|BSSID)_(OFT|SZ) macros
  staging:r8188eu: change rtl8188e_process_phy_info function argument type
  Staging: fsl-mc: Remove blank lines
  Staging: fsl-mc: Fix unaligned * in block comments
  Staging: comedi: Align the * in block comments
  Staging : ks7010 : Fix block comments warninig
  Staging: vt6655: Remove explicit NULL comparison using Coccinelle
  staging: rtl8188eu: core: rtw_xmit: Use macros instead of constants
  staging: rtl8188eu: core: rtw_xmit: Move constant of the right side
  staging: dgnc: Fix lines longer than 80 characters
  Staging: dgnc: constify attribute_group structures
  Staging: most: hdm-dim2: constify attribute_group structures
  ...
2016-10-05 14:50:51 -07:00
Ramiro Oliveira cb0b65556e Staging: fsl-mc: Remove blank lines
Remove multiple blank lines as reported by checkpatch

Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:29:11 +02:00
Ramiro Oliveira f86a180868 Staging: fsl-mc: Fix unaligned * in block comments
Align the * in some block comments as reported by checkpatch.

Signed-off-by: Ramiro Oliveira <roliveir@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:29:11 +02:00
Sandhya Bankar 905a672a2f Staging: fsl-mc: Use !x instead of x == NULL.
Use !x instead of x == NULL. This issue was found by checkpatch.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:52:51 +02:00
Wei Yongjun 053ead2202 staging: fsl-mc: remove .owner field for driver
Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:22:35 +02:00
Wei Yongjun 9f4feef54d staging: fsl-mc: use list_del_init instead of list_del/INIT_LIST_HEAD
Using list_del_init() instead of list_del() + INIT_LIST_HEAD().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16 10:22:35 +02:00
Thomas Gleixner 28f4b04143 genirq/msi: Add cpumask allocation to alloc_msi_entry
For irq spreading want to store affinity masks in the msi_entry. Add the
infrastructure for it.

We allocate an array of cpumasks with an array size of the number of used
vectors in the entry, so we can hand in the information per linux interrupt
later.

As we hand in the number of used vectors, we assign them right
away. Convert all the call sites.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: axboe@fb.com
Cc: keith.busch@intel.com
Cc: agordeev@redhat.com
Cc: linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/1473862739-15032-2-git-send-email-hch@lst.de
2016-09-14 22:11:08 +02:00
Wei Yongjun a71a6d96a4 staging: fsl-mc: convert to use ATTRIBUTE_GROUPS macro
Use ATTRIBUTE_GROUPS macro to reduce the number of lines of code.

Generated by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:59:20 +02:00
Anson Jacob be1edb857e staging: fsl-mc: dprc-cmd: Fix checkpatch warning
Fix checkpatch.pl warning:
Block comments use * on subsequent lines

Fix Commenting Style

Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:58:59 +02:00
Anson Jacob 695b4adc32 staging: fsl-mc: dpmng-cmd: Fix checkpatch warning
Fix checkpatch.pl warning:
Block comments use * on subsequent lines

Fix Commenting Style

Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:58:59 +02:00
Stuart Yoder d4e75132bd staging: fsl-mc: make order of includes consistent
There are 3 kinds of headers included in the bus driver components--
misc linux/include files, public bus driver includes, and includes
private to the bus driver.

Cleanup the order and formatting of includes in the bus driver to be
consistent:
    #include <linux/include/[file].h>
    #include ../include/[file].h  // public bus driver includes (eventually
                                  // destined for: linux/include/fsl)
    [blank line]
    #include "[file].h"           // private bus driver includes

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder 5143ecf6db staging: fsl-mc: explicitly include files where they are needed
Instead of relying on mc-sys.h to include misc system headers, have
the source files that need them explicitly do it themselves.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder 7f59f4c71d staging: fsl-mc: split mc-io definitions into a separate file
An mc-io is a software abstraction of a dpmcp object (an MC portal).
Routines to create/initialize/reset this portal abstraction were split
between the allocator and mc-sys.c (MC command interface).  Move
mc-io/portal related definitions into one source file.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder 693c5a9d43 staging: fsl-mc: remove unneeded includes
Over time we've accumulated some includes that are no longer
needed.  Remove them.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder e744e45ab9 staging: fsl-mc: move bus definitions from mc.h to mc-bus.h
move public bus-related definitions to the proper mc-bus.h header.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder c7743b4233 staging: fsl-mc: remove unneeded forward declarations
Remove unneeded and duplicated forward declarations.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder 27365d85cf staging: fsl-mc: make fsl_mc_get_root_dprc public
fsl_mc_get_root_dprc is needed by other components (e.g. vfio) to find
the root dprc

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder e730d86d74 staging: fsl-mc: move bus private definitions into fsl-mc-bus.c
Move definitions that are private to fsl-mc-bus.c out of the
public mc-bus.h and mc.h headers.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:26 +02:00
Stuart Yoder 2b0011d2bf staging: fsl-mc: move dprc-driver private definitions out of mc-bus.h
Move definitions that are private to dprc-driver.c out of the
public mc-bus.h header.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:25 +02:00
Stuart Yoder 243444fb8c staging: fsl-mc: create private include for fsl-mc bus components
The mc-bus.h header file is intended to be public for system related
drivers that may need to make fsl-mc bus specific calls-- gic its,
smmu, vfio.  But, currently it contains definitions private/internal
to the fsl-mc bus itself.  Split those definitions out into a new
fsl-mc bus private header.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:25 +02:00
Stuart Yoder 3640695569 staging: fsl-mc: move resource pool init/cleanup into allocator
The resource pool init/cleanup functions logically belong in the
allocator.  Move them to the allocator and rename to reflect the
move out of the dprc-driver.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:25 +02:00
Stuart Yoder e267dddd21 staging: fsl-mc: move allocator private definitions out of mc-bus.h
move definitions private to the allocator out of mc-bus.h and into
allocator.c

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:25 +02:00
Stuart Yoder 46d669daa3 staging: fsl-mc: improve naming of source files
The mc- prefix on the source files names of some internal components
of the fsl-mc bus driver makes things less clear that they could be.
The string "mc" generally refers to hardware-- the physical DPAA
'management complex'.  Names like "mc-allocator.c" have nothing to
with the "MC" hardware per se.  Improve clarity by using the prefix
string "fsl-mc" instead which is what we are calling this bus.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:25 +02:00
Stuart Yoder c37ebf8c3d staging: fsl-mc: rename mc-private.h to mc-bus.h
The definitions in mc-private.h are not strictly speaking
'private', they are bus-related definitions expected to be
referenced by bus driver components as well as system components
(gic, smmu, vfio).  Rename mc-private.h to mc-bus.h to more
accurately reflect expected use.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:57:25 +02:00
Paul Gortmaker 37f144008a staging: fsl-mc: make bus/mc-bus explicitly non-modular
The Kconfig currently controlling compilation of this code is:

config FSL_MC_BUS
        bool "Freescale Management Complex (MC) bus driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since the code was already not using module_init, we don't have to change
the initcall and the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

We don't replace module.h with init.h since the file does make some
references to "struct *module" for processing other modules.

Cc: "J. German Rivera" <German.Rivera@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:32:26 +02:00
Nipun Gupta df5e9b5fbc fsl-mc: add helper macro to determine if a device is of fsl_mc type
Add a helper macro to return if a device has a bus type of fsl_mc.
This makes the bus driver code more readable and provides a way for
drivers like the SMMU driver to easily check the bus type.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Bharat Bhushan <bharat.bhushan@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 18:32:26 +02:00
Ioana Radulescu 9989b59961 staging: fsl-mc: convert mc command build/parse to use C structs
The layer abstracting the building of commands and extracting
responses is currently based on macros that shift and mask the command
fields and requires exposing offset/size values as macro parameters
and makes the code harder to read.

For clarity and maintainability, instead use an implementation based on
mapping the MC command definitions to C structures. These structures
contain the hardware command fields (which are naturally-aligned)
and individual fields are little-endian ordering (the byte ordering
of the hardware).

As such, there is no need to perform the conversion between core and
hardware (LE) endianness in mc_send_command(), but instead each
individual field in a command will be converted separately if needed
by the function building the command or extracting the response.

This patch does not introduce functional changes, both the hardware
ABIs and the APIs exposed for the DPAA2 objects remain the same.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26 17:14:03 -07:00
Stuart Yoder adf72b5ba3 staging: fsl-mc: properly set hwirq in msi set_desc
For an MSI domain the hwirq is an arbitrary but unique
id to identify an interrupt.  Previously the hwirq was set to
the MSI index of the interrupt, but that only works if there is
one DPRC.  Additional DPRCs require an expanded namespace.  Use
both the ICID (which is unique per DPRC) and the MSI index to
compose a hwirq value.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26 17:14:03 -07:00
Stuart Yoder a137fc8058 staging: fsl-mc: dprc: fix ordering problem freeing resources in remove of dprc
When unbinding a dprc from the dprc driver the cleanup of
the resource pools must happen after irq pool cleanup
is done.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26 17:14:03 -07:00
Stuart Yoder ae34934f9c staging: fsl-mc: dprc: add missing irq free
add missing free of the Linux irq when tearing down interrupts

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26 17:14:03 -07:00
Bharat Bhushan f93627146f staging: fsl-mc: fix asymmetry in destroy of mc_io
An mc_io represents a mapped MC portal.  Previously, an mc_io was
created for the root dprc in fsl_mc_bus_probe() and for child dprcs
in dprc_probe().  But the free of that data structure happened in the
general bus remove callback.  This asymmetry resulted in some bugs due
to unwanted destroys of mc_io object in some scenarios (e.g. vfio).

Fix this bug by making things symmetric-- mc_io created in
fsl_mc_bus_probe() is freed in fsl_mc_bus_remove().  The mc_io created
in dprc_probe() is freed in dprc_remove().

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
[Stuart: added check for root dprc and reworded commit message]
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26 17:14:03 -07:00