Commit Graph

236 Commits

Author SHA1 Message Date
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
Stuart Yoder fde867d308 staging: fsl-mc: make fsl_mc_is_root_dprc() global
make fsl_mc_is_root_dprc() global so that the dprc driver
can use it

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 ec8d35d430 staging: fsl-mc: export mc_get_version
some drivers (built as modules) rely on mc_get_version()

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 0afef45654 staging: fsl-mc: add support for device table matching
Move the definition of fsl_mc_device_id to its proper location in
mod_devicetable.h, and add fsl-mc bus support to devicetable-offsets.c
and file2alias.c to enable device table matching.  With this patch udev
based module loading of fsl-mc drivers is supported.

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 57538afb42 staging: fsl-mc: clean up the device id struct
-rename the struct used for fsl-mc device ids to be more
 consistent with other busses
-remove the now obsolete and unused version fields

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 d568b7679f staging: fsl-mc: implement uevent callback and set the modalias
Replace placeholder code in the uevent callback to properly
set the MODALIAS env variable.

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 3d579c3508 staging: fsl-mc: add support for the modalias sysfs attribute
In order to support uevent based module loading implement modalias support
for the fsl-mc bus driver. Aliases are based on vendor and object/device
id and are of the form "fsl-mc:vNdN".

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
Matthias Brugger 33ea58a910 staging: fsl-mc: bus: Drop warning
When updating the irq_chip and msi_domain_ops, the code checkes for
already present functions.
When more then one ITS controller are present in the system,
irq_chip and msi_domain_ops got already set and a warning is invoked.

This patch deletes the warning, as the funtions are just already set to
the needed callbacks.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:02:23 -07:00
Horia Geantă 633440505f staging: fsl-mc: return -EINVAL for all fsl_mc_portal_allocate() failures
There are some error paths that allow for a NULL new_mc_io and err = 0
return code. Return -EINVAL instead.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 01f9330846 staging: fsl-mc: add dpmcp version check
The dpmcp driver supports dpmcp version 3.0 and above.
This patch adds the code to check the version.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>

 drivers/staging/fsl-mc/bus/dpmcp-cmd.h    |    6 +++---
 drivers/staging/fsl-mc/bus/mc-allocator.c |   11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Horia Geanta ae014c23d5 staging: fsl-mc: add quirk handling for dpseci objects < 4.0
dpseci objects < 4.0 are not coherent-- in spite of the fact
that the MC reports them to be coherent in certain versions.
Add a special case to set the no shareability flag for dpseci
objects < 4.0.

Signed-off-by: Horia Geanta <horia.geanta@nxp.com>
(Stuart: reworded commit message, updated comment in patch)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 1716cb4c65 staging: fsl-mc: add dprc version check
The dprc driver supports dprc version 5.0 and above.
This patch adds the code to check the version.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
(Stuart: resolved merge conflicts, split dpseci quirk into separate patch)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 9529d166f3 staging: fsl-mc: get version of root dprc from MC hardware
The root dprc is discovered as a platform device in the device tree.  The
version of that dprc was previously set using hardcoded values from the API
header in the kernel).  This patch removes the use of the hardcoded version
numbers and instead reads the actual dprc version from the hardware.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
(Stuart: resolved merge conflict, updated commit subject/log)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz b3721fc1e0 staging: fsl-mc: set cacheable flag for added devices if applicable
Some DPAA2 devices have mmio regions that should be mapped as
cacheable by drivers.  Set IORESOURCE_CACHEABLE in the region's
flags if applicable.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
[Stuart: update subject and commit message]
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 0f90f25b8f staging: fsl-mc: set up coherent dma ops for added devices
Unless discovered devices have the no shareability flag set,
set up coherent dma ops for them.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 9787d4e05e staging: fsl-mc: don't use object versions to make binding decisions
Up until now if the object version expected by a driver (in the API header
file) did not match the actual object version in the MC hardware the bus
driver refused to bind the object to the driver or printed out WARN_ON
dumps.

This patch removes those checks, and the responsibility of object version
checking should now be done in the object drivers themselves.  If the actual
version discovered is not supported, the driver's probe function should fail.
Drivers should use version checks to support new features and provide
backwards compatibility if at all possible.

This patch also removes the checks that caused bus driver probing to fail
if the overall MC version discovered did not match the firmware version
from the API header...this was too strict.  The overall MC version is
informational like a release number, and continues to be printed in the
boot log.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
(Stuart: reworded commit log)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder ac0619981d staging: fsl-mc: update dprc binary interface to v5.1
The meaning of the "status" parameter in dprc_get_irq_status
has changed, and this patch updates the flib and caller
of the API.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 6606c073a5 staging: fsl-mc: update dpbp binary interface to v2.2
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder f8274454bc staging: fsl-mc: update dpmcp binary interface to v3.0
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 7dc0818367 staging: fsl-mc: DPAA2 overview readme update
incorporated feedback from review comments, other misc cleanup/tweaks

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 71bd14e3ec staging: fsl-mc: TODO updates
remove 3 of the remaining TODO items:

   -multiple root fsl-mc buses-- done in patch series starting with
    commit 14f928054a ("staging: fsl-mc: abstract test for existence
    of fsl-mc bus")

   -interrupt support-- done in patch series starting with
    commit 9b1b282ccd ("irqdomain: Added domain bus token
    DOMAIN_BUS_FSL_MC_MSI")

   -MC command serialization-- done in commit 63f2be5c3b ("staging:
    fsl-mc: Added serialization to mc_send_command()")

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Cihangir Akturk 6ffdc7b954 staging: fsl-mc: get rid of mutex_locked variables
Remove mutex_locked variables which are used to determine whether mutex is
locked, instead add another label to unlock mutex on premature exits due to
an error.

This patch also addresses the folowing warnings reported by coccinelle:

drivers/staging/fsl-mc/bus/mc-allocator.c:237:1-7: preceding lock on line 204
drivers/staging/fsl-mc/bus/mc-allocator.c:89:1-7: preceding lock on line 57
drivers/staging/fsl-mc/bus/mc-allocator.c:157:1-7: preceding lock on line 124

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:55:54 -07:00
Cihangir Akturk 2e11590171 staging: fsl-mc: fix incorrect type passed to dev_err macros
dev_err macros expect const struct device ** as its second
argument, but here the argument we are passing is of typ
struct device **. This patch fixes this error.

Fixes: 454b0ec8bf ("Staging: fsl-mc: Replace pr_err with dev_err")
Cc: Bhumika Goyal <bhumirks@gmail.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-22 22:22:13 -04:00
Cihangir Akturk e79e344a3d staging: fsl-mc: fix incorrect type passed to dev_dbg macros
dev_dbg macros expect const struct device ** as its second
argument but here the argument we are passing is of type
struct device ** this patch fixes this error.

Fixes: de71daf5c8 ("Staging: fsl-mc: Replace pr_debug with dev_dbg")
Cc: Bhumika Goyal <bhumirks@gmail.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-22 22:22:13 -04:00
Bhumika Goyal 454b0ec8bf Staging: fsl-mc: Replace pr_err with dev_err
This patch replaces pr_err calls with dev_err when the device structure
is available as dev_* prints identifying information about the struct device.
Done using coccinelle:

@r exists@
identifier f, s;
identifier x;
position p;
@@
f(...,struct s *x,...) {
<+...
when != x == NULL
\(pr_err@p\|pr_debug@p\|pr_info\)(...);
...+>
}

@r2@
identifier fld2;
identifier r.s;
@@

struct s {
        ...
        struct device *fld2;
        ...
};

@@
identifier r.x,r2.fld2;
position r.p;
@@

(
-pr_err@p
+dev_err
   (
+ &x->fld2,
...)
|
- pr_debug@p
+ dev_dbg
   (
+ &x->fld2,
...)
|
- pr_info@p
+ dev_info
   (
+ &x->fld2,
...)
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhumika Goyal de71daf5c8 Staging: fsl-mc: Replace pr_debug with dev_dbg
This patch replaces pr_debug calls with dev_dbg when the device structure
is available as dev_* prints identifying information about the struct
device.
Done using coccinelle:

@r exists@
identifier f, s;
identifier x;
position p;
@@
f(...,struct s *x,...) {
<+...
when != x == NULL
\(pr_err@p\|pr_debug@p\|pr_info\)(...);
...+>
}

@r2@
identifier fld2;
identifier r.s;
@@

struct s {
        ...
        struct device *fld2;
        ...
};

@@
identifier r.x,r2.fld2;
position r.p;
@@

(
-pr_err@p
+dev_err
   (
+ &x->fld2,
...)
|
- pr_debug@p
+ dev_dbg
   (
+ &x->fld2,
...)
|
- pr_info@p
+ dev_info
   (
+ &x->fld2,
...)
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar eb66b2d301 staging: fsl-mc: bus: Eliminate double function call
A call to irq_find_matching_host was already made and the result
has been stored in mc_msi_domain. mc_msi_domain is again reassigned
using the same function call which is redundant.

irq_find_matching_host returns/locates a domain for a given fwnode.
The domain is identified using device node and bus_token(if several
domains have same device node but different purposes they can be
distinguished using bus-specific token).
http://www.bricktou.com/include/linux/irqdomain_irq_find_matching_host_en.html

Also, of_property_read_bool finds and reads a boolean from a property
device node from which the property value is to be read. It doesn't
alter the device node.
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/083698.html

Since, both  the function calls have the same device node and bus_token,
the return values shall be the same. Hence, the second call has been
removed.

This was done using Coccinelle:

@r@
idexpression *x;
identifier f;
position p1,p2;
@@

x@p1 = f(...)
... when != x
(
x@p2 = f(...)
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].line == p2[0].line):
  cocci.include_match(False)

@@
idexpression *x;
identifier f;
position r.p1,r.p2;
@@

*x@p1 = f(...)
...
*x@p2 = f(...)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Janani Ravichandran 36b64670fa staging: fsl-mc: Drop unneeded void pointer cast
Void pointers need not be cast to other pointer types.
Semantic patch used:

@r@
expression x;
void *e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x) [...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Janani Ravichandran 9397ce2104 staging: fsl-mc: Remove unneeded else following a return
Remove unnecessary else when there is a return statement in the
corresponding if block. Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-       }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
               s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:59 -08:00
Bhumika Goyal 453dd922c4 Staging: fsl-mc: bus: Drop owner assignment from platform_driver
For platform_driver, we don't need to set .owner field as is set by
platform driver core. The semantic patch used here first checks whether
platform_driver struct was actually used in a call to set the .owner
field.
The coccinelle script that generated the patch can be found here:
http://www.spinics.net/lists/kernel/msg2029903.html

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:59 -08:00
Thierry Reding 5336060737 staging: fsl-mc: Avoid section mismatch
The fsl_mc_allocator_driver_exit() function is marked __exit, but is
called by the error handling code in fsl_mc_allocator_driver_init().
This results in a section mismatch, which in turn could lead to
executing random code.

Remove the __exit annotation to fix this.

Cc: J. German Rivera <German.Rivera@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-18 20:28:20 -08:00
Thierry Reding dfb11fe228 staging: fsl-mc: Do not allow building as a module
This driver uses functionality (MSI IRQ domain) whose symbols aren't
exported, and hence the modular build fails. While arguably there might
be reasons to make these symbols available to modules, that change would
be fairly involved and the set of exported functions should be carefully
auditioned. Fix the build failure for now by marking the driver boolean.

Cc: J. German Rivera <German.Rivera@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-18 20:28:20 -08:00
Janani Ravichandran 2cdb82c7ff staging: fsl-mc: Remove unneeded parentheses
Remove unneeded parentheses on the right hand side of assignment
statements.
Semantic patch:

@@
expression a, b, c;
@@

(
  a = (b == c)
|
  a =
- (
  b
- )
)

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:05:35 -08:00
J. German Rivera 660a24bf60 staging: fsl-mc: Added MSI support to the MC bus driver
Initialize/Cleanup ITS-MSI support for the MC bus driver at driver
init/exit time. Associate an MSI domain with each DPAA2 child device.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera f52dee5ccd staging: fsl-mc: Added DPRC interrupt handler
The interrupt handler for DPRC IRQs is added. DPRC IRQs are
generated for hot plug events related to DPAA2 objects in a given
DPRC. These events include, creating/destroying DPAA2 objects in
the DPRC, changing the "plugged" state of DPAA2 objects and moving
objects between DPRCs.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 8804f9fc5c staging: fsl-mc: Fixed bug in dprc_probe() error path
Destroy mc_io in error path in dprc_probe() only if the mc_io was
created in this function.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 232ae8f249 staging: fsl-mc: set MSI domain for DPRC objects
THE MSI domain associated with a root DPRC object is
obtained form the device tree. Child DPRCs inherit
the parent DPRC MSI domain.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 1e4aa42aa9 staging: fsl-mc: Populate the IRQ pool for an MC bus instance
Scan the corresponding DPRC container to get total count
of IRQs needed by all its child DPAA2 objects. Then,
preallocate a set of MSI IRQs with the DPRC's ICID
(GIT-ITS device Id) to populate the the DPRC's IRQ pool.
Each child DPAA2 object in the DPRC and the DPRC object itself
will allocate their necessary MSI IRQs from the DPRC's IRQ pool,
in their driver probe function.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 1129cde59d staging: fsl-mc: Changed DPRC built-in portal's mc_io to be atomic
The DPRC built-in portal's mc_io is used to send commands to the MC
to program MSIs for MC objects. This is done by the
fsl_mc_msi_write_msg() callback, which is invoked by the generic MSI
layer with interrupts disabled. As a result, the mc_io used in
fsl_mc_msi_write_msg needs to be an atomic mc_io.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 89f067df92 staging: fsl-mc: Extended MC bus allocator to include IRQs
All the IRQs for DPAA2 objects in the same DPRC must use
the ICID of that DPRC, as their device Id in the GIC-ITS.
Thus, all these IRQs must share the same ITT table in the GIC.
As a result, a pool of IRQs with the same device Id must be
preallocated per DPRC (fsl-mc bus instance). So, the fsl-mc
bus object allocator is extended to also provide services
to allocate IRQs to DPAA2 devices, from their parent fsl-mc bus
IRQ pool.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 3a288fd51b staging: fsl-mc: Added GICv3-ITS support for FSL-MC MSIs
Added platform-specific MSI support layer for FSL-MC devices.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
J. German Rivera 679c2c758c staging: fsl-mc: Added generic MSI support for FSL-MC devices
Created an MSI domain for the fsl-mc bus-- including functions
to create a domain, find a domain, alloc/free domain irqs, and
bus specific overrides for domain and irq_chip ops.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:10:12 -08:00
Lijun Pan 3c7b67f906 staging: fsl-mc: section mismatch bug fix
WARNING: drivers/staging/built-in.o(.init.text+0xdc): Section mismatch in reference from the function fsl_mc_bus_driver_init() to the function .exit.text:dprc_driver_exit()
The function __init fsl_mc_bus_driver_init() references
a function __exit dprc_driver_exit().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __exit annotation of
dprc_driver_exit() so it may be used outside an exit section.

Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:40:14 +09:00
J. German Rivera 63f2be5c3b staging: fsl-mc: Added serialization to mc_send_command()
When the same portal is used to call mc_send_command() from two
different threads or a thread and an interrupt handler, serialization
is required, as the MC only supports one outstanding command per MC
portal. Thus, a new command should not be sent to the MC until the
last command sent has been responded by the MC.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:54:46 -07:00
J. German Rivera 3f95ad2185 staging: fsl-mc:Added support for atomic portals
Refactored mc_send_command() to support two flavors of polling:
- preemptible (for non-atomic portals), which was already supported.
  It calls usleep_range() between polling iterations.
- non-preemptible (for atomic portals), which is needed when
  mc_send_command() is called with interrupts disabled.
  It calls udelay() between polling iterations.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:54:46 -07:00
J. German Rivera 140305e77a staging: fsl-mc: refactored mc_send_command()
Moved wait logic in mc_send_command() to its own function

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:54:46 -07:00
J. German Rivera c6a3363c13 staging: fsl-mc: changed timeout units for MC cmd completion
Changed units for the timeout to wait for completion
of MC command, from jiffies to milliseconds.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:54:46 -07:00
J. German Rivera 4e65f46aba staging: fsl-mc: Added missing initializer in fsl_mc_bus_driver
owner needs to be initialized as THIS_MOUDLE.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera a17f4aa627 staging: fsl-mc: fixed bug in uninitialized root dprc irq count
When initializing the object attributes for the root dprc, the
irq_count was uninitialized. Initialize it to 1.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 2379bdbc6c staging: fsl-mc: Fixed WARN_ON() in fsl_mc_resource_pool_remove_device
Check that resource is not NULL before de-referencing it.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 09a38ab0b1 staging: fsl-mc: refactored error exit in allocator probe/remove
Replaced error gotos with direct returns in fsl_mc_allocator_probe()
and fsl_mc_allocator_remove(), since the only error handling done
in those functions is to exit.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 6958cd4483 staging: fsl-mc: Fixed bug in fsl_mc_allocator_remove
Call fsl_mc_resource_pool_remove_device() only if mc_dev->resource
is not NULL.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 95e9a09af4 staging: fsl-mc: Fixed alignment of copyright comment
Whitespace cleanup-- add missing spaces in column 1 of copyright

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 770417bb85 staging: fsl-mc: Removed unused DPMCP macros
The macros were a left-over from a previous implementation
of the dpmcp APIs and are no longer used.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera eceebf8bb3 staging: fsl-mc: Changed types of flags, portal size in
Changed these two fields from 32-bit integers to 16-bit integers in
struct fsl_mc_io, as 32 bits is too much for these fields. This
change does not affect other components since fsl_mc_io is an opaque
type.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 6998d6ba8c staging: fsl-mc: Changed dev_info() calls to dev_dbg()
Changed dev_info() calls to dev_dbg() in
fsl_mc_allocator_probe/fsl_mc_allocator_remove, as they
are useful only for debugging.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera d2f8499153 staging: fsl-mc: dpmcp opening/closing refactoring
Before, we were opening and closing a mc_io's dpmcp object
in fsl_mc_portal_reset(), since that was the only function that was
calling dpmcp MC operations. However, it is better for maintainability
to open the dpmcp object when it gets associated with an mc_io object,
and close it when this association is terminated. This way, we are free
to call dpmcp operations on a mc_io's dpmcp object at any time, without
having to check if the dpmcp object is opened or not.

Consequently, the creation/teardown of the association between
an mc_io object and a dpmcp is now encapsulated in two functions:
fsl_mc_io_set_dpmcp()/fsl_mc_io_unset_dpmcp(). Besides, setting
the corresponding pointers for the association, these functions
open and close the dpmcp object respectively.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera ffcd52ef09 staging: fsl-mc: fsl_mc_io object refactoring
Each fsl_mc_io object is associated with an fsl_mc_device object
of type "dpmcp" representing the MC portal associated with the
fsl_mc_io object. Before, we were representing this association with
an fsl_mc_resource pointer. To enhance code clarity, it is more
straight forward to use an fsl_mc_device pointer instead.
So, this change replaces the 'resource' field in the fsl_mc_io
object with 'dpmcp_dev'. Also, it changes parameter 'resource' of
fsl_create_mc_io() to be an fsl_mc_device pointer instead.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
J. German Rivera 724e50f7c2 staging: fsl-mc: Naming cleanup in fsl_mc-portal_allocate
mc_adev is a local variable for the allocated dpmcp object.
Renamed mc_adev as dpmcp_dev for clarity.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17 20:53:38 -07:00
Itai Katz 757e0cb5f1 staging: fsl-mc: remove references to dev_root
The dev_root field in the bus type struct has been replaced by a
new mechanism to identify the root dprc.  Remove all references
to dev_root.

Signed-off-by: Itai Katz <itai.katz@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:55:45 +01:00
Itai Katz 565b94506f staging: fsl-mc: add counter to track number of root DPRCs
Add a counter to track the number of root DPRCs.
When this counter is greater then 0 it means that at least
one root DPRC device exists.

Signed-off-by: Itai Katz <itai.katz@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:55:45 +01:00
Itai Katz e4ea40f98d staging: fsl-mc: add function to return pointer to root dprc
To support multiple root dprcs, instead of relying on the
dev_root field of the bus type struct, instead create a
function to traverse to the root dprc and return a pointer
to the device struct

Signed-off-by: Itai Katz <itai.katz@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:55:45 +01:00
Itai Katz b55f00c6ed staging: fsl-mc: abstract test for whether a dprc is a root dprc
Instead of relying on assumptions about fields in data
structures, abstract the test for whether a dprc is a root
dprc into a function.

Signed-off-by: Itai Katz <itai.katz@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:55:45 +01:00
Itai Katz 14f928054a staging: fsl-mc: abstract test for existence of fsl-mc bus
Add function to test for existence of an fsl-mc bus instance
instead of doing this by looking directly at a field in the
bus type struct.

Signed-off-by: Itai Katz <itai.katz@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 09:55:45 +01:00
J. German Rivera ba72f25b25 staging: fsl-mc: Fixed uintX_t CHECK checkpatch warnings
Replaced all uses of uintX_t types to uX types, to be
checkpatch clean.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:24:20 +02:00
J. German Rivera e9bf3f206b staging: fsl-mc: Moved kernel-doc comments to .c files
Moved kernel-doc comments for non-inline functions
from header files to .c files.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:24:20 +02:00
J. German Rivera 1ee695fab3 staging: fsl-mc: up-rev dprc binary interface to v4.0
Add cmd_flags parameter to all dprc APIs to comply
with the dprc 4.0 MC interface. Updated MC version
major number.  Pass irq args in struct instead of
separate args.

dprc 4.0 uses MC-relative offsets to specify object regions,
instead of physical addresses. So, translate_mc_addr() and
struct fsl_mc_addr_translation_range need to be updated
accordingly.

Update commands for 4.0: add new commands 'set/get
obj irq', 'set obj label', 'get obj descriptor'.
Remove 'get portal paddr'.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:23:40 +02:00
J. German Rivera e1135cb669 staging: fsl-mc: up-rev dpcon binary interface to v2.0
dpcon object minor version number updated to match latest
MC firmware. This change is needed because the dpcon
object binds to the allocator and the current driver match
logic uses object version numbers.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:23:40 +02:00
J. German Rivera 7a9a56be67 staging: fsl-mc: up-rev dpmcp binary interface to v2.0
Add cmd_flags parameter to all dpbp APIs to comply
with the dpmcp 2.0 MC interface. Updated version
major number. Pass irq args in struct instead of
separate args.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:23:40 +02:00
J. German Rivera c4d887219c staging: fsl-mc: up-rev dpbp binary interface to v2.0
Add cmd_flags parameter to all dpbp APIs to comply
with the dpbp 2.0 MC interface. Updated MC version
major number. Pass irq args in struct instead of
separate args.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:23:40 +02:00
J. German Rivera 4057743564 staging: fsl-mc: uprev dpmng binary interface to v8.0
Add cmd_flags parameter to all dpmng APIs to comply
with 8.0 MC firmware interface. Updated MC version
major number.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:23:40 +02:00
J. German Rivera e860466906 staging: fsl-mc: Add new flags field to MC command header
The Management Complex (MC) binary interface added a new "flags"
field to the command header.
Add the definitions for this field in preparation for adding the
new cmd_flags parameter to all MC interface APIs.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:23:39 +02:00
Nayeemahmed Badebade a2f9ff6c75 Staging: fsl-mc/bus: mc-bus.c: Fixed coding style issues
Fixed coding style issues where kernel types u16,u64,u32 should
be preferred over uint16_t,uint64_t,uint32_t

Signed-off-by: Nayeemahmed Badebade <itachi.opsrc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:52 -07:00
Stuart Yoder c9eda12565 staging: fsl-mc: add DPAA2 overview readme
add README file providing an overview of the DPAA2 architecture
and how it is integrated in Linux

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:10:58 -07:00
Stuart Yoder b20691652b staging: fsl-mc: update TODO list
update TODO list to provide more detail on remaining work

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-22 21:05:21 -07:00
Gujulan Elango, Hari Prasath (H.) 2b9a9d49b3 staging: fsl-mc: Remove redundant initalization of the .owner field
This patch removes the redundant static initialization of the .owner field from
this driver as it is being overidden by the call from the platform driver register

Signed-off-by: Hari Prasath <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:11 +02:00
J. German Rivera 3b0a9b1037 staging: fsl-mc: Changed version matching rules for MC object drivers
Before this change, we were requiring a complete version match (major and
minor version numbers) between MC objects and corresponding drivers, to
allow MC objects to be bound to their drivers. We realized that a mismatch
in minor version numbers should be tolerated, as long as the major version
numbers match. This allows the driver to decide what to do in the minor
version mismatch case. For example, a driver may decide to run with
downgraded functionality if the MC firmware object has older minor version
number than the driver. Also, a driver with older minor version than the
MC firmware object may decide to run even though it cannot use newer
functionality of the MC object.

As part of this change, the dpmng Flib version was also updated
to match the latest MC firmware version.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:55:03 +02:00
J. German Rivera e91ffa9ec1 staging: fsl-mc: Refactored fsl_mc_object_allocator driver init/exit
The fsl_mc_allocator driver does not need to be its own module
 as it is tightly integrated into the MC bus main driver. It is really
 just a sub-component of the MC bus driver. By not making fsl_mc_allocator
 its own module, we can have more control of when its initialization happens
 and we want it to happen before any driver that depends on the MC bus
 driver gets initialized.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:55:03 +02:00
J. German Rivera 2bdc55d94f staging: fsl-mc: Fix crash in fsl_mc_device_remove()
Only call fsl_mc_io_destroy() if the DPRC being removed
actually had an mc_io object associated with. Child DPRCs
that have not been bound to the DPRC driver or the VFIO driver
will not have an mc_io associated with them.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:55:03 +02:00
J. German Rivera 1663e80982 staging: fsl-mc: Bind/unbind driver when MC object is plugged/unplugged
Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:55:03 +02:00
J. German Rivera 0b52877594 staging: fsl-mc: Removed reordering of MC objects during bus scan
MC objects discovered during an MC bus scan were being reordered
to ensure that all allocatable objects are probed before all
non-allocatable objects. However, this is not necessary, as
drivers of non-allocatable objects, that allocate allocatable
objects in their probe function, can return -EPROBE_DEFER
if such allocations fail.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:55:03 +02:00
J. German Rivera 77371fbd44 staging: fsl-mc: Name MC object devices using decimal numbers
MC object devices were being named using hexadecimaal numbers.
This was not consistent with the object naming conventions used
by MC DPLs and the MC restool.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:55:03 +02:00
J. German Rivera 11dd0360cf staging: fsl-mc: Corrected email addresses in TODO file
Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 14:11:29 +01:00
J. German Rivera 197f4d6a4a staging: fsl-mc: fsl-mc object allocator driver
The fsl-mc object allocator driver manages "allocatable" fsl-mc
objects such as DPBPs, DPMCPs and DPCONs. It provides services to
other fsl-mc drivers to allocate/deallocate these types of objects.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 17:29:10 -08:00
J. German Rivera f2f2726b62 staging: fsl-mc: Device driver for FSL-MC DPRC devices
A DPRC (Data Path Resource Container) is an isolation device
that contains a set of DPAA networking devices to be
assigned to an isolation domain (e.g., a virtual machine).

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 17:28:33 -08:00
J. German Rivera bbf9d17d98 staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driver
Platform device driver that sets up the basic bus infrastructure
for the fsl-mc bus type, including support for adding/removing
fsl-mc devices, register/unregister of fsl-mc drivers, and bus
match support to bind devices to drivers.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 17:28:09 -08:00
J. German Rivera 31c889653c staging: fsl-mc: Added Freescale Management Complex APIs
APIs to access the Management Complex (MC) hardware
module of Freescale LS2 SoCs. This patch includes
APIs to check the MC firmware version and to manipulate
DPRC objects in the MC.

Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 17:28:09 -08:00