Skip to contentSkip to conversation

drivers/bus: fsl-mc object allocator driver

PATCH Superseded J. German Rivera 2 participants 4 messages Feb 24, 2015 – Feb 26, 2015

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover drivers/bus: fsl-mc object allocator driver

In-Reply-To:

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

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

#1 lore raw

PATCH v2 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.

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

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

136 lines not on this page · raw message

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

308 lines not on this page · raw message

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

311 lines not on this page · raw message

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

158 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 +1 -1
index f4dd466..5656c2d 100644
@@ -607,7 +607,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/bus/fsl-mc/mc-sys.c +4 -0
index 4476287..a5050ef 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,
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 +330 -0

330 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 +48 -13

83 lines not on this page · raw message

include/linux/fsl/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);
include/linux/fsl/mc.h +65 -0

95 lines not on this page · raw message

--
2.3.0

#2 lore raw
Quoted 2 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

I'd recommend to explain what these abbreviations mean. It's ridiculously hard to remember what they are about. So please put their full name at least into the patch description and into the headers of their respective handling files.

Also, can we maybe split the patches into the minimal set required to get one driver working? I hate to see lots of functions land in upstream that are never called from anywhere. At the end of the day, I care about vertical coverage, not horizontal. All of your patches so far are horizontal.

So please pick one driver, choose the subset required to make bus enumeration, DPRC handling and the few objects required for that one driver work and then let's try to push it upstream.

Once that's done we can easily extend the interface incrementally with every other new driver from that point on.

Alex

#3 lore raw
In reply to J. German Rivera
Quoted 3 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.

Oh sorry, what I forgot to mention in the other mail was that some times a bit of ASCII art in Documentation/ works miracles. For people not directly involved in DPAA development, it's incredibly hard to grasp all the connections between different things. It's up to you to make them obvious :).

Alex