Skip to contentSkip to conversation

drivers/bus: fsl-mc object allocator driver

PATCH In review J. German Rivera 2 participants 4 messages Mar 6, 2015 Staging

lore
Share & tools
lore
#0 lore raw

v3 cover drivers/bus: fsl-mc 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".

CHANGE HISTORY
See patch

#1 lore raw

PATCH v3 1/1 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.

---
Changes in v3:
- Moved files to drivers/staging:

	drivers/bus/fsl-mc/dpbp.c -> drivers/staging/fsl-mc/bus/dpbp.c
        drivers/bus/fsl-mc/dpmcp-cmd.h -> drivers/staging/fsl-mc/bus/dpmcp-cmd.h
        drivers/bus/fsl-mc/dpmcp.c -> drivers/staging/fsl-mc/bus/dpmcp.c
        drivers/bus/fsl-mc/dpmcp.h -> drivers/staging/fsl-mc/bus/dpmcp.h
        drivers/bus/fsl-mc/mc-allocator.c -> drivers/staging/fsl-mc/bus/mc-allocator.c
        include/linux/fsl/dpbp-cmd.h -> drivers/staging/fsl-mc/include/dpbp-cmd.h
        include/linux/fsl/dpbp.h -> drivers/staging/fsl-mc/include/dpbp.h
        include/linux/fsl/dpcon-cmd.h -> drivers/staging/fsl-mc/include/dpcon-cmd.h

- Fixed dev_info message in fsl_mc_allocator_remove()

Changes in v2:
- Converted MC portal allocator to use DPMCP objects

 drivers/staging/fsl-mc/bus/Makefile         |   6 +-
 drivers/staging/fsl-mc/bus/dpbp.c           | 358 +++++++++++++++++
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h      | 136 +++++++
 drivers/staging/fsl-mc/bus/dpmcp.c          | 308 +++++++++++++++
 drivers/staging/fsl-mc/bus/dpmcp.h          | 311 +++++++++++++++
 drivers/staging/fsl-mc/bus/dprc-driver.c    | 104 ++++-
 drivers/staging/fsl-mc/bus/mc-allocator.c   | 569 ++++++++++++++++++++++++++++
 drivers/staging/fsl-mc/bus/mc-bus.c         |   2 +-
 drivers/staging/fsl-mc/bus/mc-sys.c         |   4 +
 drivers/staging/fsl-mc/include/dpbp-cmd.h   |  60 +++
 drivers/staging/fsl-mc/include/dpbp.h       | 330 ++++++++++++++++
 drivers/staging/fsl-mc/include/dpcon-cmd.h  |  62 +++
 drivers/staging/fsl-mc/include/mc-private.h |  61 ++-
 drivers/staging/fsl-mc/include/mc-sys.h     |   6 +
 drivers/staging/fsl-mc/include/mc.h         |  65 ++++
 15 files changed, 2366 insertions(+), 16 deletions(-)
 create mode 100644 drivers/staging/fsl-mc/bus/dpbp.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpmcp-cmd.h
 create mode 100644 drivers/staging/fsl-mc/bus/dpmcp.c
 create mode 100644 drivers/staging/fsl-mc/bus/dpmcp.h
 create mode 100644 drivers/staging/fsl-mc/bus/mc-allocator.c
 create mode 100644 drivers/staging/fsl-mc/include/dpbp-cmd.h
 create mode 100644 drivers/staging/fsl-mc/include/dpbp.h
 create mode 100644 drivers/staging/fsl-mc/include/dpcon-cmd.h
drivers/staging/fsl-mc/bus/Makefile +5 -1
index 424e58e..bd09fc8 100644
@@ -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 \
+			    dpmcp.o \
+			    dpbp.o
drivers/staging/fsl-mc/bus/dpbp.c new file +358 -0

358 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dpmcp-cmd.h new file +136 -0

136 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dpmcp.c new file +308 -0

308 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dpmcp.h new file +311 -0

311 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dprc-driver.c +103 -1

158 lines not on this page · raw message

drivers/staging/fsl-mc/bus/mc-allocator.c new file +569 -0

569 lines not on this page · raw message

drivers/staging/fsl-mc/bus/mc-bus.c +1 -1
index 72551e3..b4e9022 100644
@@ -604,7 +604,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 	mc_portal_phys_addr = res.start;
 	mc_portal_size = resource_size(&res);
 	error = fsl_create_mc_io(&pdev->dev, mc_portal_phys_addr,
-				 mc_portal_size, 0, &mc_io);
+				 mc_portal_size, NULL, 0, &mc_io);
 	if (error < 0)
 		return error;
 
drivers/staging/fsl-mc/bus/mc-sys.c +4 -0
index a07064a..5737f59 100644
@@ -60,6 +60,8 @@
  * @dev: device to be associated with the MC I/O object
  * @mc_portal_phys_addr: physical address of the MC portal to use
  * @mc_portal_size: size in bytes of the MC portal
+ * @resource: Pointer to MC bus object allocator resource associated
+ * with this MC I/O object or NULL if none.
  * @flags: flags for the new MC I/O object
  * @new_mc_io: Area to return pointer to newly created MC I/O object
  *
@@ -68,6 +70,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 +85,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,
drivers/staging/fsl-mc/include/dpbp-cmd.h new file +60 -0

60 lines not on this page · raw message

drivers/staging/fsl-mc/include/dpbp.h new file +330 -0

330 lines not on this page · raw message

drivers/staging/fsl-mc/include/dpcon-cmd.h new file +62 -0

62 lines not on this page · raw message

drivers/staging/fsl-mc/include/mc-private.h +48 -13

83 lines not on this page · raw message

drivers/staging/fsl-mc/include/mc-sys.h +6 -0
index abfd6a2..cb3b5a2 100644
@@ -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);
drivers/staging/fsl-mc/include/mc.h +65 -0

95 lines not on this page · raw message

--
2.3.0

Acked-by on v3 1/1
#2 lore raw

Re: [PATCH v3 1/1] staging: fsl-mc: fsl-mc object allocator driver

Quoted 6 lines · J. 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.

Alex

#3 lore raw
In reply to J. German Rivera
Quoted 5 lines · J. German Rivera

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".

When your patch set only contains a single patch, it's pretty useless to bloat it by 100% to add a cover letter. Just send the patch as a single patch :).

Alex