drivers/bus: Freescale Management Complex object allocator driver
Subsystems (2)
cover drivers/bus: Freescale Management Complex object allocator driver
This patch series introduces the object allocator driver for the Freescale Management Complex (fsl-mc) of QorIQ Ls2 SoCs This patch series is dependent on the patch series "drivers/bus: Freescale Management Complex bus driver patch series"
Besides adding the object allocator functionality, this patch also serves as an example of a driver for a child device of the fsl-mc bus.
Patch 1 contains the object allocator driver
CHANGE HISTORY
Changes in RFC v1:
- Initial version posted.
RFC PATCH 1/1 drivers/bus: 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.
--- drivers/bus/fsl-mc/Makefile | 6 +- drivers/bus/fsl-mc/dpbp.c | 358 ++++++++++++++++++++++++ drivers/bus/fsl-mc/dpmcp-cmd.h | 137 +++++++++ drivers/bus/fsl-mc/dpmcp.c | 309 +++++++++++++++++++++ drivers/bus/fsl-mc/dpmcp.h | 309 +++++++++++++++++++++ drivers/bus/fsl-mc/dprc-driver.c | 212 +++++++++++++- drivers/bus/fsl-mc/mc-allocator.c | 568 ++++++++++++++++++++++++++++++++++++++ drivers/bus/fsl-mc/mc-bus.c | 56 +++- drivers/bus/fsl-mc/mc-sys.c | 2 + include/linux/fsl/dpbp-cmd.h | 60 ++++ include/linux/fsl/dpbp.h | 346 +++++++++++++++++++++++ include/linux/fsl/dpcon-cmd.h | 62 +++++ include/linux/fsl/mc-private.h | 41 +++ include/linux/fsl/mc-sys.h | 6 + include/linux/fsl/mc.h | 63 +++++ 15 files changed, 2518 insertions(+), 17 deletions(-) create mode 100644 drivers/bus/fsl-mc/dpbp.c create mode 100644 drivers/bus/fsl-mc/dpmcp-cmd.h create mode 100644 drivers/bus/fsl-mc/dpmcp.c create mode 100644 drivers/bus/fsl-mc/dpmcp.h create mode 100644 drivers/bus/fsl-mc/mc-allocator.c create mode 100644 include/linux/fsl/dpbp-cmd.h create mode 100644 include/linux/fsl/dpbp.h create mode 100644 include/linux/fsl/dpcon-cmd.h
drivers/bus/fsl-mc/Makefile +5 -1
@@ -5,7 +5,8 @@ # # This file is released under the GPLv2 # -obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o +obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o \ + mc-allocator-driver.o mc-bus-driver-objs := mc-bus.o \ mc-sys.o \
@@ -13,3 +14,6 @@ mc-bus-driver-objs := mc-bus.o \ dpmng.o \ dprc-driver.o +mc-allocator-driver-objs := mc-allocator.o \ + dpbp.o \ + dpcon.o
drivers/bus/fsl-mc/dpbp.c new file +358 -0
358 lines not on this page · raw message
drivers/bus/fsl-mc/dpmcp-cmd.h new file +137 -0
137 lines not on this page · raw message
drivers/bus/fsl-mc/dpmcp.c new file +309 -0
309 lines not on this page · raw message
drivers/bus/fsl-mc/dpmcp.h new file +309 -0
309 lines not on this page · raw message
drivers/bus/fsl-mc/dprc-driver.c +210 -2
248 lines not on this page · raw message
drivers/bus/fsl-mc/mc-allocator.c new file +568 -0
568 lines not on this page · raw message
drivers/bus/fsl-mc/mc-bus.c +42 -14
98 lines not on this page · raw message
drivers/bus/fsl-mc/mc-sys.c +2 -0
@@ -68,6 +68,7 @@int __must_check fsl_create_mc_io (struct device *dev,phys_addr_t mc_portal_phys_addr,uint32_t mc_portal_size, +struct fsl_mc_resource *resource,uint32_t flags,struct fsl_mc_io **new_mc_io) {struct fsl_mc_io *mc_io;
@@ -82,6 +83,7 @@ int __must_check fsl_create_mc_io(struct device *dev, mc_io->flags = flags; mc_io->portal_phys_addr = mc_portal_phys_addr; mc_io->portal_size = mc_portal_size; + mc_io->resource = resource; res = devm_request_mem_region(dev, mc_portal_phys_addr, mc_portal_size,
include/linux/fsl/dpbp-cmd.h new file +60 -0
60 lines not on this page · raw message
include/linux/fsl/dpbp.h new file +346 -0
346 lines not on this page · raw message
include/linux/fsl/dpcon-cmd.h new file +62 -0
62 lines not on this page · raw message
include/linux/fsl/mc-private.h +41 -0
51 lines not on this page · raw message
include/linux/fsl/mc-sys.h +6 -0
@@ -40,6 +40,7 @@#include <linux/io.h> #include <linux/dma-mapping.h> +struct fsl_mc_resource ;struct mc_command ;/**
@@ -49,6 +50,9 @@ struct mc_command;* @portal_size: MC command portal size in bytes * @portal_phys_addr: MC command portal physical address * @portal_virt_addr: MC command portal virtual address +* @resource: generic resource associated with the MC portal if +* the MC portal came from a resource pool, or NULL if the MC portal +* is permanently bound to a device (e.g., a DPRC) */ struct fsl_mc_io {struct device *dev;
@@ -56,11 +60,13 @@ struct fsl_mc_io {uint32_t portal_size;phys_addr_t portal_phys_addr;void __iomem *portal_virt_addr; +struct fsl_mc_resource *resource; };int __must_check fsl_create_mc_io (struct device *dev,phys_addr_t mc_portal_phys_addr,uint32_t mc_portal_size, +struct fsl_mc_resource *resource,uint32_t flags,struct fsl_mc_io **new_mc_io);void fsl_destroy_mc_io (struct fsl_mc_io *mc_io);
include/linux/fsl/mc.h +63 -0
93 lines not on this page · raw message
--
2.2.2