summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl-mc
AgeCommit message (Collapse)Author
2015-10-27staging: fsl-mc: section mismatch bug fixLijun Pan
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-17staging: fsl-mc: Added serialization to mc_send_command()J. German Rivera
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-17staging: fsl-mc:Added support for atomic portalsJ. German Rivera
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-17staging: fsl-mc: refactored mc_send_command()J. German Rivera
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-17staging: fsl-mc: changed timeout units for MC cmd completionJ. German Rivera
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-17staging: fsl-mc: Added missing initializer in fsl_mc_bus_driverJ. German Rivera
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-17staging: fsl-mc: fixed bug in uninitialized root dprc irq countJ. German Rivera
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-17staging: fsl-mc: Fixed WARN_ON() in fsl_mc_resource_pool_remove_deviceJ. German Rivera
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-17staging: fsl-mc: refactored error exit in allocator probe/removeJ. German Rivera
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-17staging: fsl-mc: Fixed bug in fsl_mc_allocator_removeJ. German Rivera
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-17staging: fsl-mc: Fixed alignment of copyright commentJ. German Rivera
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-17staging: fsl-mc: Removed unused DPMCP macrosJ. German Rivera
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-17staging: fsl-mc: Changed types of flags, portal size inJ. German Rivera
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-17staging: fsl-mc: Changed dev_info() calls to dev_dbg()J. German Rivera
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-17staging: fsl-mc: dpmcp opening/closing refactoringJ. German Rivera
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-17staging: fsl-mc: fsl_mc_io object refactoringJ. German Rivera
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-17staging: fsl-mc: Naming cleanup in fsl_mc-portal_allocateJ. German Rivera
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-04staging: fsl-mc: remove references to dev_rootItai Katz
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-04staging: fsl-mc: add counter to track number of root DPRCsItai Katz
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-04staging: fsl-mc: add function to return pointer to root dprcItai Katz
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-04staging: fsl-mc: abstract test for whether a dprc is a root dprcItai Katz
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-04staging: fsl-mc: abstract test for existence of fsl-mc busItai Katz
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-09-29staging: fsl-mc: Fixed uintX_t CHECK checkpatch warningsJ. German Rivera
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-29staging: fsl-mc: Moved kernel-doc comments to .c filesJ. German Rivera
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-29staging: fsl-mc: up-rev dprc binary interface to v4.0J. German Rivera
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-29staging: fsl-mc: up-rev dpcon binary interface to v2.0J. German Rivera
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-29staging: fsl-mc: up-rev dpmcp binary interface to v2.0J. German Rivera
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-29staging: fsl-mc: up-rev dpbp binary interface to v2.0J. German Rivera
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-29staging: fsl-mc: uprev dpmng binary interface to v8.0J. German Rivera
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-29staging: fsl-mc: Add new flags field to MC command headerJ. German Rivera
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-12Staging: fsl-mc/bus: mc-bus.c: Fixed coding style issuesNayeemahmed Badebade
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-08-07staging: fsl-mc: add DPAA2 overview readmeStuart Yoder
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-07-22staging: fsl-mc: update TODO listStuart Yoder
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-05-08staging: fsl-mc: Remove redundant initalization of the .owner fieldGujulan Elango, Hari Prasath (H.)
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-04-03staging: fsl-mc: Changed version matching rules for MC object driversJ. German Rivera
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-03staging: fsl-mc: Refactored fsl_mc_object_allocator driver init/exitJ. German Rivera
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-03staging: fsl-mc: Fix crash in fsl_mc_device_remove()J. German Rivera
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-03staging: fsl-mc: Bind/unbind driver when MC object is plugged/unpluggedJ. German Rivera
Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03staging: fsl-mc: Removed reordering of MC objects during bus scanJ. German Rivera
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-03staging: fsl-mc: Name MC object devices using decimal numbersJ. German Rivera
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-03-20staging: fsl-mc: Corrected email addresses in TODO fileJ. German Rivera
Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: fsl-mc: fsl-mc object allocator driverJ. German Rivera
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-06staging: fsl-mc: Device driver for FSL-MC DPRC devicesJ. German Rivera
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-06staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driverJ. German Rivera
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-06staging: fsl-mc: Added Freescale Management Complex APIsJ. German Rivera
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>