Skip to contentSkip to conversation

staging: fsl-mc: cleanup and uprev to MC v10.x

PATCH New Stuart Yoder 1 participant 13 messages Oct 26, 2016 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: fsl-mc: cleanup and uprev to MC v10.x

This patch does miscellaneous minor cleanup and uprevs the supported MC firmware version to 10.x.

version 2 changes
-move MAINTAINERS change so it's sorted properly -split whitespace cleanup into separate patches -split message cleanup into separate patches -use pr_fmt to set a message prefix -some commit message updates

Ioana Ciornei (3):
staging: fsl-mc: whitespace cleanup: align function args
staging: fsl-mc: whitespace cleanup: improve alignment in prototypes
staging: fsl-mc: uprev binary interface to match MC v10.x

Stuart Yoder (9):
staging: fsl-mc: update MAINTAINERS
staging: fsl-mc: whitespace cleanup: remove blank lines
staging: fsl-mc: whitespace cleanup: remove extraenous tabs
staging: fsl-mc: cleanup comment style
staging: fsl-mc: improve pr_* messages
staging: fsl-mc: improve message clarity by adding __func__
staging: fsl-mc: cleanup: improve clarity of messages
staging: fsl-mc: improve wording in comments
staging: fsl-mc: update copyright dates

 MAINTAINERS                                        |  13 +-
 drivers/staging/fsl-mc/bus/dpbp-cmd.h              |  61 ++--
 drivers/staging/fsl-mc/bus/dpbp.c                  |  71 +++-
 drivers/staging/fsl-mc/bus/dpcon-cmd.h             |   4 +-
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h             |  49 ++-
 drivers/staging/fsl-mc/bus/dpmcp.c                 |  70 +++-
 drivers/staging/fsl-mc/bus/dpmcp.h                 | 127 +++----
 drivers/staging/fsl-mc/bus/dpmng-cmd.h             |  14 +-
 drivers/staging/fsl-mc/bus/dpmng.c                 |  37 +-
 drivers/staging/fsl-mc/bus/dprc-cmd.h              |  90 ++---
 drivers/staging/fsl-mc/bus/dprc-driver.c           |  21 +-
 drivers/staging/fsl-mc/bus/dprc.c                  |  69 +++-
 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c      |  74 ++--
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c            |  68 ++--
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c            |   2 +-
 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |   2 +-
 drivers/staging/fsl-mc/bus/mc-io.c                 |   4 +-
 drivers/staging/fsl-mc/bus/mc-sys.c                |  12 +-
 drivers/staging/fsl-mc/include/dpbp.h              | 169 +++++----
 drivers/staging/fsl-mc/include/dpmng.h             |  18 +-
 drivers/staging/fsl-mc/include/dprc.h              | 402 +++++++++++----------
 drivers/staging/fsl-mc/include/mc-bus.h            |   2 +-
 drivers/staging/fsl-mc/include/mc-cmd.h            |  44 ++-
 drivers/staging/fsl-mc/include/mc-sys.h            |   3 +-
 drivers/staging/fsl-mc/include/mc.h                |   2 +-
 25 files changed, 783 insertions(+), 645 deletions(-)
Signature · 1 line
1.9.0
#1 lore raw

PATCH v2 1/12 staging: fsl-mc: update MAINTAINERS

-German has moved on to other things and wished to be
removed as a maintainer
-cleanup the driver description to use the proper name
of the driver (i.e. the fsl-mc bus driver) and remove incorrect references to Freescale

---
v2
-move updated entry so file is properly sorted

 MAINTAINERS | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
MAINTAINERS +6 -7
index 8d9392a..5adc5ba 100644
@@ -5098,13 +5098,6 @@ F:	sound/soc/fsl/fsl*
 F:	sound/soc/fsl/imx*
 F:	sound/soc/fsl/mpc8610_hpcd.c
 
-FREESCALE QORIQ MANAGEMENT COMPLEX DRIVER
-M:	"J. German Rivera" <[email protected]>
-M:	Stuart Yoder <[email protected]>
-L:	[email protected]
-S:	Maintained
-F:	drivers/staging/fsl-mc/
-
 FREEVXFS FILESYSTEM
 M:	Christoph Hellwig <[email protected]>
 W:	ftp://ftp.openlinux.org/pub/people/hch/vxfs
@@ -9936,6 +9929,12 @@ F:	fs/qnx4/
 F:	include/uapi/linux/qnx4_fs.h
 F:	include/uapi/linux/qnxtypes.h
 
+QORIQ DPAA2 FSL-MC BUS DRIVER
+M:	Stuart Yoder <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/staging/fsl-mc/
+
 QT1010 MEDIA DRIVER
 M:	Antti Palosaari <[email protected]>
 L:	[email protected]
Signature · 1 line
1.9.0
#2 lore raw

PATCH v2 2/12 staging: fsl-mc: whitespace cleanup: remove blank lines

In reply to Stuart Yoder

remove instances of multiple blank lines in comments

---
-v2
-patch is result of split of original patch, updated
commit messasge and author to reflect the change

 drivers/staging/fsl-mc/bus/dpbp-cmd.h  | 1 -
 drivers/staging/fsl-mc/bus/dpbp.c      | 1 -
 drivers/staging/fsl-mc/bus/dpcon-cmd.h | 1 -
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 1 -
 drivers/staging/fsl-mc/bus/dpmcp.c     | 1 -
 drivers/staging/fsl-mc/bus/dpmcp.h     | 1 -
 drivers/staging/fsl-mc/bus/dpmng-cmd.h | 1 -
 drivers/staging/fsl-mc/bus/dpmng.c     | 1 -
 drivers/staging/fsl-mc/bus/dprc-cmd.h  | 1 -
 drivers/staging/fsl-mc/bus/dprc.c      | 1 -
 drivers/staging/fsl-mc/bus/mc-io.c     | 1 -
 drivers/staging/fsl-mc/bus/mc-sys.c    | 1 -
 12 files changed, 12 deletions(-)
drivers/staging/fsl-mc/bus/dpbp-cmd.h +0 -1
index 2860411..489c27f 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpbp.c +0 -1
index b392745..0b2064e 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpcon-cmd.h +0 -1
index 536b2ef..c89b305 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpmcp-cmd.h +0 -1
index d098a6d..b77c902 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpmcp.c +0 -1
index 55766f7..865572d4 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpmcp.h +0 -1
index 5434e09..c40253a 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpmng-cmd.h +0 -1
index a7b77d5..d42d977 100644
@@ -12,7 +12,6 @@
  *       names of any contributors may be used to endorse or promote products
  *       derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dpmng.c +0 -1
index 96b1d67..13bec9e 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dprc-cmd.h +0 -1
index 009d656..154ce2f 100644
@@ -12,7 +12,6 @@
  *       names of any contributors may be used to endorse or promote products
  *       derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/dprc.c +0 -1
index 9fea3de..24c8dfb 100644
@@ -11,7 +11,6 @@
  * names of any contributors may be used to endorse or promote products
  * derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/mc-io.c +0 -1
index 798c965..fbfda4c 100644
@@ -11,7 +11,6 @@
  *       names of any contributors may be used to endorse or promote products
  *       derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
drivers/staging/fsl-mc/bus/mc-sys.c +0 -1
index 285917c..b55a53e 100644
@@ -13,7 +13,6 @@
  *       names of any contributors may be used to endorse or promote products
  *       derived from this software without specific prior written permission.
  *
- *
  * ALTERNATIVELY, this software may be distributed under the terms of the
  * GNU General Public License ("GPL") as published by the Free Software
  * Foundation, either version 2 of that License or (at your option) any
Signature · 1 line
1.9.0
#3 lore raw

PATCH v2 3/12 staging: fsl-mc: whitespace cleanup: remove extraenous tabs

In reply to Stuart Yoder

use one tab to separate name and value in #define definitions

---
-v2
-patch is result of split of original patch, updated
commit messasge and author to reflect the change

 drivers/staging/fsl-mc/include/dprc.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/fsl-mc/include/dprc.h +5 -5
index 593b2bb..07a11b3 100644
@@ -139,7 +139,7 @@ int dprc_reset_container(struct fsl_mc_io *mc_io,
 #define DPRC_IRQ_INDEX          0
 
 /* Number of dprc's IRQs */
-#define DPRC_NUM_OF_IRQS		1
+#define DPRC_NUM_OF_IRQS	1
 
 /* DPRC IRQ events */
 
@@ -274,20 +274,20 @@ int dprc_get_res_quota(struct fsl_mc_io	*mc_io,
  * are explicit and sequential (in case of resources).
  * The base ID is given at res_req at base_align field
  */
-#define DPRC_RES_REQ_OPT_EXPLICIT		0x00000001
+#define DPRC_RES_REQ_OPT_EXPLICIT	0x00000001
 
 /* Aligned resources request - Relevant only for resources
  * request (and not objects). Indicates that resources base ID should be
  * sequential and aligned to the value given at dprc_res_req base_align field
  */
-#define DPRC_RES_REQ_OPT_ALIGNED		0x00000002
+#define DPRC_RES_REQ_OPT_ALIGNED	0x00000002
 
 /* Plugged Flag - Relevant only for object assignment request.
  * Indicates that after all objects assigned. An interrupt will be invoked at
  * the relevant GPP. The assigned object will be marked as plugged.
  * plugged objects can't be assigned from their container
  */
-#define DPRC_RES_REQ_OPT_PLUGGED		0x00000004
+#define DPRC_RES_REQ_OPT_PLUGGED	0x00000004
 
 /**
  * struct dprc_res_req - Resource request descriptor, to be used in assignment
@@ -353,7 +353,7 @@ int dprc_get_obj_count(struct fsl_mc_io *mc_io,
  * masters;
  * user is responsible for proper memory handling through IOMMU configuration.
  */
-#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY		0x0001
+#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY	0x0001
 
 /**
  * struct dprc_obj_desc - Object descriptor, returned from dprc_get_obj()
Signature · 1 line
1.9.0
#4 lore raw

PATCH v2 4/12 staging: fsl-mc: whitespace cleanup: align function args

In reply to Stuart Yoder

From: Ioana Ciornei <[email protected]>

align function arguments that were not aligned to the starting parenthesis

---
-v2
-patch is result of split of original patch, updated
commit messasge to reflect the change

 drivers/staging/fsl-mc/bus/dpmcp.h    | 32 ++++++++++++++++----------------
 drivers/staging/fsl-mc/include/dprc.h |  8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)
drivers/staging/fsl-mc/bus/dpmcp.h +16 -16
index c40253a..0a24c37 100644
@@ -61,7 +61,7 @@ struct dpmcp_cfg {
 int dpmcp_create(struct fsl_mc_io	*mc_io,
 		 u32		cmd_flags,
 		 const struct dpmcp_cfg	*cfg,
-		u16		*token);
+		 u16		*token);
 
 int dpmcp_destroy(struct fsl_mc_io *mc_io,
 		  u32 cmd_flags,
@@ -92,45 +92,45 @@ struct dpmcp_irq_cfg {
 int dpmcp_set_irq(struct fsl_mc_io	*mc_io,
 		  u32		cmd_flags,
 		  u16		token,
-		 u8		irq_index,
+		  u8		irq_index,
 		  struct dpmcp_irq_cfg	*irq_cfg);
 
 int dpmcp_get_irq(struct fsl_mc_io	*mc_io,
 		  u32		cmd_flags,
 		  u16		token,
-		 u8		irq_index,
-		 int			*type,
-		 struct dpmcp_irq_cfg	*irq_cfg);
+		  u8		irq_index,
+		  int			*type,
+		  struct dpmcp_irq_cfg	*irq_cfg);
 
 int dpmcp_set_irq_enable(struct fsl_mc_io	*mc_io,
 			 u32		cmd_flags,
 			 u16		token,
-			u8			irq_index,
-			u8			en);
+			 u8			irq_index,
+			 u8			en);
 
 int dpmcp_get_irq_enable(struct fsl_mc_io	*mc_io,
 			 u32		cmd_flags,
 			 u16		token,
-			u8			irq_index,
-			u8			*en);
+			 u8			irq_index,
+			 u8			*en);
 
 int dpmcp_set_irq_mask(struct fsl_mc_io	*mc_io,
 		       u32	cmd_flags,
 		       u16		token,
-		      u8		irq_index,
-		      u32		mask);
+		       u8		irq_index,
+		       u32		mask);
 
 int dpmcp_get_irq_mask(struct fsl_mc_io	*mc_io,
 		       u32	cmd_flags,
 		       u16		token,
-		      u8		irq_index,
-		      u32		*mask);
+		       u8		irq_index,
+		       u32		*mask);
 
 int dpmcp_get_irq_status(struct fsl_mc_io	*mc_io,
 			 u32		cmd_flags,
 			 u16		token,
-			u8			irq_index,
-			u32		*status);
+			 u8			irq_index,
+			 u32		*status);
 
 /**
  * struct dpmcp_attr - Structure representing DPMCP attributes
@@ -153,6 +153,6 @@ struct dpmcp_attr {
 int dpmcp_get_attributes(struct fsl_mc_io	*mc_io,
 			 u32		cmd_flags,
 			 u16		token,
-			struct dpmcp_attr	*attr);
+			 struct dpmcp_attr	*attr);
 
 #endif /* __FSL_DPMCP_H */
drivers/staging/fsl-mc/include/dprc.h +4 -4
index 07a11b3..c40abcd 100644
@@ -389,10 +389,10 @@ int dprc_get_obj(struct fsl_mc_io	*mc_io,
 
 int dprc_get_obj_desc(struct fsl_mc_io		*mc_io,
 		      u32		cmd_flags,
-			u16		token,
-			char			*obj_type,
-			int			obj_id,
-			struct dprc_obj_desc	*obj_desc);
+		      u16		token,
+		      char			*obj_type,
+		      int			obj_id,
+		      struct dprc_obj_desc	*obj_desc);
 
 int dprc_set_obj_irq(struct fsl_mc_io		*mc_io,
 		     u32			cmd_flags,
Signature · 1 line
1.9.0
#5 lore raw

PATCH v2 5/12 staging: fsl-mc: whitespace cleanup: improve alignment in prototypes

In reply to Stuart Yoder

From: Ioana Ciornei <[email protected]>

To improve readability for structs and function definitions, separate type and variable name by a single space, instead of an inconsistent number of tabs.

---
-v2
-patch is result of split of original patch, updated
commit messasge to reflect the change

 drivers/staging/fsl-mc/bus/dpmcp.h     | 104 +++++-----
 drivers/staging/fsl-mc/include/dpbp.h  | 144 +++++++-------
 drivers/staging/fsl-mc/include/dpmng.h |  12 +-
 drivers/staging/fsl-mc/include/dprc.h  | 342 ++++++++++++++++-----------------
 4 files changed, 301 insertions(+), 301 deletions(-)
drivers/staging/fsl-mc/bus/dpmcp.h +52 -52
index 0a24c37..c0e6017 100644
@@ -58,10 +58,10 @@ struct dpmcp_cfg {
 	int portal_id;
 };
 
-int dpmcp_create(struct fsl_mc_io	*mc_io,
-		 u32		cmd_flags,
+int dpmcp_create(struct fsl_mc_io *mc_io,
+		 u32 cmd_flags,
 		 const struct dpmcp_cfg	*cfg,
-		 u16		*token);
+		 u16 *token);
 
 int dpmcp_destroy(struct fsl_mc_io *mc_io,
 		  u32 cmd_flags,
@@ -84,53 +84,53 @@ int dpmcp_reset(struct fsl_mc_io *mc_io,
  * @irq_num: A user defined number associated with this IRQ
  */
 struct dpmcp_irq_cfg {
-	     u64		paddr;
-	     u32		val;
-	     int		irq_num;
+	     u64 paddr;
+	     u32 val;
+	     int irq_num;
 };
 
-int dpmcp_set_irq(struct fsl_mc_io	*mc_io,
-		  u32		cmd_flags,
-		  u16		token,
-		  u8		irq_index,
-		  struct dpmcp_irq_cfg	*irq_cfg);
-
-int dpmcp_get_irq(struct fsl_mc_io	*mc_io,
-		  u32		cmd_flags,
-		  u16		token,
-		  u8		irq_index,
-		  int			*type,
-		  struct dpmcp_irq_cfg	*irq_cfg);
-
-int dpmcp_set_irq_enable(struct fsl_mc_io	*mc_io,
-			 u32		cmd_flags,
-			 u16		token,
-			 u8			irq_index,
-			 u8			en);
-
-int dpmcp_get_irq_enable(struct fsl_mc_io	*mc_io,
-			 u32		cmd_flags,
-			 u16		token,
-			 u8			irq_index,
-			 u8			*en);
-
-int dpmcp_set_irq_mask(struct fsl_mc_io	*mc_io,
-		       u32	cmd_flags,
-		       u16		token,
-		       u8		irq_index,
-		       u32		mask);
-
-int dpmcp_get_irq_mask(struct fsl_mc_io	*mc_io,
-		       u32	cmd_flags,
-		       u16		token,
-		       u8		irq_index,
-		       u32		*mask);
-
-int dpmcp_get_irq_status(struct fsl_mc_io	*mc_io,
-			 u32		cmd_flags,
-			 u16		token,
-			 u8			irq_index,
-			 u32		*status);
+int dpmcp_set_irq(struct fsl_mc_io *mc_io,
+		  u32 cmd_flags,
+		  u16 token,
+		  u8 irq_index,
+		  struct dpmcp_irq_cfg *irq_cfg);
+
+int dpmcp_get_irq(struct fsl_mc_io *mc_io,
+		  u32 cmd_flags,
+		  u16 token,
+		  u8 irq_index,
+		  int *type,
+		  struct dpmcp_irq_cfg *irq_cfg);
+
+int dpmcp_set_irq_enable(struct fsl_mc_io *mc_io,
+			 u32 cmd_flags,
+			 u16 token,
+			 u8 irq_index,
+			 u8 en);
+
+int dpmcp_get_irq_enable(struct fsl_mc_io *mc_io,
+			 u32 cmd_flags,
+			 u16 token,
+			 u8 irq_index,
+			 u8 *en);
+
+int dpmcp_set_irq_mask(struct fsl_mc_io *mc_io,
+		       u32 cmd_flags,
+		       u16 token,
+		       u8 irq_index,
+		       u32 mask);
+
+int dpmcp_get_irq_mask(struct fsl_mc_io *mc_io,
+		       u32 cmd_flags,
+		       u16 token,
+		       u8 irq_index,
+		       u32 *mask);
+
+int dpmcp_get_irq_status(struct fsl_mc_io *mc_io,
+			 u32 cmd_flags,
+			 u16 token,
+			 u8 irq_index,
+			 u32 *status);
 
 /**
  * struct dpmcp_attr - Structure representing DPMCP attributes
@@ -150,9 +150,9 @@ struct dpmcp_attr {
 	} version;
 };
 
-int dpmcp_get_attributes(struct fsl_mc_io	*mc_io,
-			 u32		cmd_flags,
-			 u16		token,
-			 struct dpmcp_attr	*attr);
+int dpmcp_get_attributes(struct fsl_mc_io *mc_io,
+			 u32 cmd_flags,
+			 u16 token,
+			 struct dpmcp_attr *attr);
 
 #endif /* __FSL_DPMCP_H */
drivers/staging/fsl-mc/include/dpbp.h +72 -72

183 lines not on this page · raw message

drivers/staging/fsl-mc/include/dpmng.h +6 -6
index e5cfd01..5034317 100644
@@ -58,12 +58,12 @@ struct mc_version {
 	u32 revision;
 };
 
-int mc_get_version(struct fsl_mc_io	*mc_io,
-		   u32		cmd_flags,
-		   struct mc_version	*mc_ver_info);
+int mc_get_version(struct fsl_mc_io *mc_io,
+		   u32 cmd_flags,
+		   struct mc_version *mc_ver_info);
 
-int dpmng_get_container_id(struct fsl_mc_io	*mc_io,
-			   u32		cmd_flags,
-			   int			*container_id);
+int dpmng_get_container_id(struct fsl_mc_io *mc_io,
+			   u32 cmd_flags,
+			   int *container_id);
 
 #endif /* __FSL_DPMNG_H */
drivers/staging/fsl-mc/include/dprc.h +171 -171

400 lines not on this page · raw message

Signature · 1 line
1.9.0
#6 lore raw

PATCH v2 6/12 staging: fsl-mc: cleanup comment style

In reply to Stuart Yoder

Be consistent and use kernel-preferred multi-line comment style everywhere.

---
-v2
-no changes

 drivers/staging/fsl-mc/bus/dpbp-cmd.h   |  3 ++-
 drivers/staging/fsl-mc/bus/dpbp.c       |  3 ++-
 drivers/staging/fsl-mc/bus/dpcon-cmd.h  |  3 ++-
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h  |  3 ++-
 drivers/staging/fsl-mc/bus/dpmcp.c      |  3 ++-
 drivers/staging/fsl-mc/bus/dpmcp.h      |  6 ++++--
 drivers/staging/fsl-mc/bus/dpmng.c      |  3 ++-
 drivers/staging/fsl-mc/bus/dprc.c       |  3 ++-
 drivers/staging/fsl-mc/bus/mc-io.c      |  3 ++-
 drivers/staging/fsl-mc/bus/mc-sys.c     |  3 ++-
 drivers/staging/fsl-mc/include/dpbp.h   |  6 ++++--
 drivers/staging/fsl-mc/include/dpmng.h  |  6 ++++--
 drivers/staging/fsl-mc/include/dprc.h   | 33 ++++++++++++++++++++++-----------
 drivers/staging/fsl-mc/include/mc-cmd.h |  3 ++-
 drivers/staging/fsl-mc/include/mc-sys.h |  3 ++-
 15 files changed, 56 insertions(+), 28 deletions(-)
drivers/staging/fsl-mc/bus/dpbp-cmd.h +2 -1
index 489c27f..4cc2918 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dpbp.c +2 -1
index 0b2064e..122c40d 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dpcon-cmd.h +2 -1
index c89b305..4ebb3fc 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2015 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dpmcp-cmd.h +2 -1
index b77c902..1073ca2 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dpmcp.c +2 -1
index 865572d4..faade1e 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dpmcp.h +4 -2
index c0e6017..3cd1e3a 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2015 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -31,7 +32,8 @@
 #ifndef __FSL_DPMCP_H
 #define __FSL_DPMCP_H
 
-/* Data Path Management Command Portal API
+/*
+ * Data Path Management Command Portal API
  * Contains initialization APIs and runtime control APIs for DPMCP
  */
 
drivers/staging/fsl-mc/bus/dpmng.c +2 -1
index 13bec9e..831c6ed 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dprc.c +2 -1
index 24c8dfb..ace3441 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/mc-io.c +2 -1
index fbfda4c..d66b87f 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2016 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/mc-sys.c +2 -1
index b55a53e..7114064 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2014 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2014 Freescale Semiconductor Inc.
  *
  * I/O services to send MC commands to the MC hardware
  *
drivers/staging/fsl-mc/include/dpbp.h +4 -2
index 3ae6405..2520bf8 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2015 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -32,7 +33,8 @@
 #ifndef __FSL_DPBP_H
 #define __FSL_DPBP_H
 
-/* Data Path Buffer Pool API
+/*
+ * Data Path Buffer Pool API
  * Contains initialization APIs and runtime control APIs for DPBP
  */
 
drivers/staging/fsl-mc/include/dpmng.h +4 -2
index 5034317..8cd206e 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2015 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -32,7 +33,8 @@
 #ifndef __FSL_DPMNG_H
 #define __FSL_DPMNG_H
 
-/* Management Complex General API
+/*
+ * Management Complex General API
  * Contains general API for the Management Complex firmware
  */
 
drivers/staging/fsl-mc/include/dprc.h +22 -11
index a3aa6f9..6784418 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2015 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -34,7 +35,8 @@
 
 #include "mc-cmd.h"
 
-/* Data Path Resource Container API
+/*
+ * Data Path Resource Container API
  * Contains DPRC API for managing and querying DPAA resources
  */
 
@@ -70,12 +72,14 @@ int dprc_close(struct fsl_mc_io *mc_io,
  * and can be retrieved using dprc_get_attributes()
  */
 
-/* Spawn Policy Option allowed - Indicates that the new container is allowed
+/*
+ * Spawn Policy Option allowed - Indicates that the new container is allowed
  * to spawn and have its own child containers.
  */
 #define DPRC_CFG_OPT_SPAWN_ALLOWED		0x00000001
 
-/* General Container allocation policy - Indicates that the new container is
+/*
+ * General Container allocation policy - Indicates that the new container is
  * allowed to allocate requested resources from its parent container; if not
  * set, the container is only allowed to use resources in its own pools; Note
  * that this is a container's global policy, but the parent container may
@@ -83,12 +87,14 @@ int dprc_close(struct fsl_mc_io *mc_io,
  */
 #define DPRC_CFG_OPT_ALLOC_ALLOWED		0x00000002
 
-/* Object initialization allowed - software context associated with this
+/*
+ * Object initialization allowed - software context associated with this
  * container is allowed to invoke object initialization operations.
  */
 #define DPRC_CFG_OPT_OBJ_CREATE_ALLOWED	0x00000004
 
-/* Topology change allowed - software context associated with this
+/*
+ * Topology change allowed - software context associated with this
  * container is allowed to invoke topology operations, such as attach/detach
  * of network objects.
  */
@@ -151,12 +157,14 @@ int dprc_reset_container(struct fsl_mc_io *mc_io,
 #define DPRC_IRQ_EVENT_RES_ADDED		0x00000004
 /* IRQ event - Indicates that resources removed from the container */
 #define DPRC_IRQ_EVENT_RES_REMOVED		0x00000008
-/* IRQ event - Indicates that one of the descendant containers that opened by
+/*
+ * IRQ event - Indicates that one of the descendant containers that opened by
  * this container is destroyed
  */
 #define DPRC_IRQ_EVENT_CONTAINER_DESTROYED	0x00000010
 
-/* IRQ event - Indicates that on one of the container's opened object is
+/*
+ * IRQ event - Indicates that on one of the container's opened object is
  * destroyed
  */
 #define DPRC_IRQ_EVENT_OBJ_DESTROYED		0x00000020
@@ -270,19 +278,22 @@ int dprc_get_res_quota(struct fsl_mc_io	*mc_io,
 
 /* Resource request options */
 
-/* Explicit resource ID request - The requested objects/resources
+/*
+ * Explicit resource ID request - The requested objects/resources
  * are explicit and sequential (in case of resources).
  * The base ID is given at res_req at base_align field
  */
 #define DPRC_RES_REQ_OPT_EXPLICIT	0x00000001
 
-/* Aligned resources request - Relevant only for resources
+/*
+ * Aligned resources request - Relevant only for resources
  * request (and not objects). Indicates that resources base ID should be
  * sequential and aligned to the value given at dprc_res_req base_align field
  */
 #define DPRC_RES_REQ_OPT_ALIGNED	0x00000002
 
-/* Plugged Flag - Relevant only for object assignment request.
+/*
+ * Plugged Flag - Relevant only for object assignment request.
  * Indicates that after all objects assigned. An interrupt will be invoked at
  * the relevant GPP. The assigned object will be marked as plugged.
  * plugged objects can't be assigned from their container
drivers/staging/fsl-mc/include/mc-cmd.h +2 -1
index 5decb98..b07f831 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2015 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2015 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/include/mc-sys.h +2 -1
index 89ad0cf..7276ae3 100644
@@ -1,4 +1,5 @@
-/* Copyright 2013-2014 Freescale Semiconductor Inc.
+/*
+ * Copyright 2013-2014 Freescale Semiconductor Inc.
  *
  * Interface of the I/O services to send MC commands to the MC hardware
  *
Signature · 1 line
1.9.0
#7 lore raw

PATCH v2 7/12 staging: fsl-mc: improve pr_* messages

In reply to Stuart Yoder

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

---
-v2
-patch is result of split of original patch, updated
commit messasge to reflect the change

 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +4 -2
index 44f64b6..245acbf 100644
@@ -9,6 +9,8 @@
  * warranty of any kind, whether express or implied.
  */
 
+#define pr_fmt(fmt) "fsl-mc: " fmt
+
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_address.h>
@@ -875,11 +877,11 @@ static int __init fsl_mc_bus_driver_init(void)
 
 	error = bus_register(&fsl_mc_bus_type);
 	if (error < 0) {
-		pr_err("fsl-mc bus type registration failed: %d\n", error);
+		pr_err("bus type registration failed: %d\n", error);
 		goto error_cleanup_cache;
 	}
 
-	pr_info("fsl-mc bus type registered\n");
+	pr_info("bus type registered\n");
 
 	error = platform_driver_register(&fsl_mc_bus_driver);
 	if (error < 0) {
Signature · 1 line
1.9.0
#8 lore raw

PATCH v2 8/12 staging: fsl-mc: improve message clarity by adding __func__

In reply to Stuart Yoder

clarify some error messages by printing the actual function name involved

---
-v2
-patch is result of split of original patch, updated
commit messasge to reflect the change

 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +2 -5
index 245acbf..5267c503 100644
@@ -166,8 +166,7 @@ static int fsl_mc_driver_probe(struct device *dev)
 
 	error = mc_drv->probe(mc_dev);
 	if (error < 0) {
-		dev_err(dev, "MC object device probe callback failed: %d\n",
-			error);
+		dev_err(dev, "%s failed: %d\n", __func__, error);
 		return error;
 	}
 
@@ -185,9 +184,7 @@ static int fsl_mc_driver_remove(struct device *dev)
 
 	error = mc_drv->remove(mc_dev);
 	if (error < 0) {
-		dev_err(dev,
-			"MC object device remove callback failed: %d\n",
-			error);
+		dev_err(dev, "%s failed: %d\n", __func__, error);
 		return error;
 	}
 
Signature · 1 line
1.9.0
#9 lore raw

PATCH v2 9/12 staging: fsl-mc: cleanup: improve clarity of messages

In reply to Stuart Yoder

improve some messages by shortening and rewording

---
-v2
-patch is result of split of original patch, updated
commit messasge to reflect the change

 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c |  4 ++--
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c       | 13 +++++--------
 2 files changed, 7 insertions(+), 10 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +2 -2
index cf10148..e92c780 100644
@@ -605,7 +605,7 @@ static int fsl_mc_allocator_probe(struct fsl_mc_device *mc_dev)
 		return error;
 
 	dev_dbg(&mc_dev->dev,
-		"Allocatable MC object device bound to fsl_mc_allocator driver");
+		"Allocatable fsl-mc device bound to fsl_mc_allocator driver");
 	return 0;
 }
 
@@ -627,7 +627,7 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev)
 	}
 
 	dev_dbg(&mc_dev->dev,
-		"Allocatable MC object device unbound from fsl_mc_allocator driver");
+		"Allocatable fsl-mc device unbound from fsl_mc_allocator driver");
 	return 0;
 }
 
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +5 -8
index 5267c503..fb062d3 100644
@@ -231,8 +231,7 @@ int __fsl_mc_driver_register(struct fsl_mc_driver *mc_driver,
 		return error;
 	}
 
-	pr_info("MC object device driver %s registered\n",
-		mc_driver->driver.name);
+	pr_info("driver %s registered\n", mc_driver->driver.name);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(__fsl_mc_driver_register);
@@ -571,8 +570,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
 	}
 
 	(void)get_device(&mc_dev->dev);
-	dev_dbg(parent_dev, "Added MC object device %s\n",
-		dev_name(&mc_dev->dev));
+	dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev));
 
 	*new_mc_dev = mc_dev;
 	return 0;
@@ -748,7 +746,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 	struct mc_version mc_version;
 	struct resource res;
 
-	dev_info(&pdev->dev, "Root MC bus device probed");
+	dev_info(&pdev->dev, "root DPRC probed");
 
 	mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL);
 	if (!mc)
@@ -782,8 +780,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 		goto error_cleanup_mc_io;
 	}
 
-	dev_info(&pdev->dev,
-		 "Freescale Management Complex Firmware version: %u.%u.%u\n",
+	dev_info(&pdev->dev, "MC firmware version: %u.%u.%u\n",
 		 mc_version.major, mc_version.minor, mc_version.revision);
 
 	error = get_mc_addr_translation_ranges(&pdev->dev,
@@ -839,7 +836,7 @@ static int fsl_mc_bus_remove(struct platform_device *pdev)
 	fsl_destroy_mc_io(mc->root_mc_bus_dev->mc_io);
 	mc->root_mc_bus_dev->mc_io = NULL;
 
-	dev_info(&pdev->dev, "Root MC bus device removed");
+	dev_info(&pdev->dev, "root DPRC removed");
 	return 0;
 }
 
Signature · 1 line
1.9.0
#10 lore raw

PATCH v2 10/12 staging: fsl-mc: improve wording in comments

In reply to Stuart Yoder

improve and clarify miscellaneous comments in the bus driver and allocator

---
-v2
-update/improve commit message

 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 68 +++++++++++++--------------
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c       | 18 +++----
 2 files changed, 42 insertions(+), 44 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +33 -35
index e92c780..4a7ac97 100644
@@ -1,5 +1,5 @@
 /*
- * Freescale MC object device allocator driver
+ * fsl-mc object allocator driver
  *
  * Copyright (C) 2013 Freescale Semiconductor, Inc.
  *
@@ -23,15 +23,12 @@
 	 strcmp(_obj_type, "dpcon") == 0)
 
 /**
- * fsl_mc_resource_pool_add_device - add allocatable device to a resource
- * pool of a given MC bus
+ * fsl_mc_resource_pool_add_device - add allocatable object to a resource
+ * pool of a given fsl-mc bus
  *
- * @mc_bus: pointer to the MC bus
- * @pool_type: MC bus pool type
- * @mc_dev: Pointer to allocatable MC object device
- *
- * It adds an allocatable MC object device to a container's resource pool of
- * the given resource type
+ * @mc_bus: pointer to the fsl-mc bus
+ * @pool_type: pool type
+ * @mc_dev: pointer to allocatable fsl-mc device
  */
 static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus
 								*mc_bus,
@@ -95,10 +92,10 @@ static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus
  * fsl_mc_resource_pool_remove_device - remove an allocatable device from a
  * resource pool
  *
- * @mc_dev: Pointer to allocatable MC object device
+ * @mc_dev: pointer to allocatable fsl-mc device
  *
- * It permanently removes an allocatable MC object device from the resource
- * pool, the device is currently in, as long as it is in the pool's free list.
+ * It permanently removes an allocatable fsl-mc device from the resource
+ * pool. It's an error if the device is in use.
  */
 static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device
 								   *mc_dev)
@@ -255,17 +252,18 @@ void fsl_mc_resource_free(struct fsl_mc_resource *resource)
 EXPORT_SYMBOL_GPL(fsl_mc_resource_free);
 
 /**
- * fsl_mc_object_allocate - Allocates a MC object device of the given
- * pool type from a given MC bus
+ * fsl_mc_object_allocate - Allocates an fsl-mc object of the given
+ * pool type from a given fsl-mc bus instance
  *
- * @mc_dev: MC device for which the MC object device is to be allocated
- * @pool_type: MC bus resource pool type
- * @new_mc_dev: Pointer to area where the pointer to the allocated
- * MC object device is to be returned
+ * @mc_dev: fsl-mc device which is used in conjunction with the
+ * allocated object
+ * @pool_type: pool type
+ * @new_mc_dev: pointer to area where the pointer to the allocated device
+ * is to be returned
  *
- * This function allocates a MC object device from the device's parent DPRC,
- * from the corresponding MC bus' pool of allocatable MC object devices of
- * the given resource type. mc_dev cannot be a DPRC itself.
+ * Allocatable objects are always used in conjunction with some functional
+ * device.  This function allocates an object of the specified type from
+ * the DPRC containing the functional device.
  *
  * NOTE: pool_type must be different from FSL_MC_POOL_MCP, since MC
  * portals are allocated using fsl_mc_portal_allocate(), instead of
@@ -312,10 +310,9 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
 EXPORT_SYMBOL_GPL(fsl_mc_object_allocate);
 
 /**
- * fsl_mc_object_free - Returns an allocatable MC object device to the
- * corresponding resource pool of a given MC bus.
- *
- * @mc_adev: Pointer to the MC object device
+ * fsl_mc_object_free - Returns an fsl-mc object to the resource
+ * pool where it came from.
+ * @mc_adev: Pointer to the fsl-mc device
  */
 void fsl_mc_object_free(struct fsl_mc_device *mc_adev)
 {
@@ -332,8 +329,14 @@ void fsl_mc_object_free(struct fsl_mc_device *mc_adev)
 EXPORT_SYMBOL_GPL(fsl_mc_object_free);
 
 /*
- * Initialize the interrupt pool associated with a MC bus.
- * It allocates a block of IRQs from the GIC-ITS
+ * A DPRC and the devices in the DPRC all share the same GIC-ITS device
+ * ID.  A block of IRQs is pre-allocated and maintained in a pool
+ * from which devices can allocate them when needed.
+ */
+
+/*
+ * Initialize the interrupt pool associated with an fsl-mc bus.
+ * It allocates a block of IRQs from the GIC-ITS.
  */
 int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 			     unsigned int irq_count)
@@ -395,7 +398,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
 EXPORT_SYMBOL_GPL(fsl_mc_populate_irq_pool);
 
 /**
- * Teardown the interrupt pool associated with an MC bus.
+ * Teardown the interrupt pool associated with an fsl-mc bus.
  * It frees the IRQs that were allocated to the pool, back to the GIC-ITS.
  */
 void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus)
@@ -422,11 +425,7 @@ void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus)
 EXPORT_SYMBOL_GPL(fsl_mc_cleanup_irq_pool);
 
 /**
- * It allocates the IRQs required by a given MC object device. The
- * IRQs are allocated from the interrupt pool associated with the
- * MC bus that contains the device, if the device is not a DPRC device.
- * Otherwise, the IRQs are allocated from the interrupt pool associated
- * with the MC bus that represents the DPRC device itself.
+ * Allocate the IRQs required by a given fsl-mc device.
  */
 int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev)
 {
@@ -495,8 +494,7 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev)
 EXPORT_SYMBOL_GPL(fsl_mc_allocate_irqs);
 
 /*
- * It frees the IRQs that were allocated for a MC object device, by
- * returning them to the corresponding interrupt pool.
+ * Frees the IRQs that were allocated for an fsl-mc device.
  */
 void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev)
 {
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +9 -9
index fb062d3..6f148b2 100644
@@ -36,7 +36,7 @@
 
 /**
  * struct fsl_mc - Private data of a "fsl,qoriq-mc" platform device
- * @root_mc_bus_dev: MC object device representing the root DPRC
+ * @root_mc_bus_dev: fsl-mc device representing the root DPRC
  * @num_translation_ranges: number of entries in addr_translation_ranges
  * @translation_ranges: array of bus to system address translation ranges
  */
@@ -64,8 +64,8 @@ struct fsl_mc_addr_translation_range {
 
 /**
  * fsl_mc_bus_match - device to driver matching callback
- * @dev: the MC object device structure to match against
- * @drv: the device driver to search for matching MC object device id
+ * @dev: the fsl-mc device to match against
+ * @drv: the device driver to search for matching fsl-mc object type
  * structures
  *
  * Returns 1 on success, 0 otherwise.
@@ -93,7 +93,7 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv)
 
 	/*
 	 * Traverse the match_id table of the given driver, trying to find
-	 * a matching for the given MC object device.
+	 * a matching for the given device.
 	 */
 	for (id = mc_drv->match_id_table; id->vendor != 0x0; id++) {
 		if (id->vendor == mc_dev->obj_desc.vendor &&
@@ -450,7 +450,7 @@ bool fsl_mc_is_root_dprc(struct device *dev)
 }
 
 /**
- * Add a newly discovered MC object device to be visible in Linux
+ * Add a newly discovered fsl-mc device to be visible in Linux
  */
 int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
 		      struct fsl_mc_io *mc_io,
@@ -531,8 +531,8 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
 			goto error_cleanup_dev;
 	} else {
 		/*
-		 * A non-DPRC MC object device has to be a child of another
-		 * MC object (specifically a DPRC object)
+		 * A non-DPRC object has to be a child of a DPRC, use the
+		 * parent's ICID and interrupt domain.
 		 */
 		mc_dev->icid = parent_mc_dev->icid;
 		mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK;
@@ -587,10 +587,10 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
 EXPORT_SYMBOL_GPL(fsl_mc_device_add);
 
 /**
- * fsl_mc_device_remove - Remove a MC object device from being visible to
+ * fsl_mc_device_remove - Remove an fsl-mc device from being visible to
  * Linux
  *
- * @mc_dev: Pointer to a MC object device object
+ * @mc_dev: Pointer to an fsl-mc device
  */
 void fsl_mc_device_remove(struct fsl_mc_device *mc_dev)
 {
Signature · 1 line
1.9.0
#11 lore raw

PATCH v2 11/12 staging: fsl-mc: update copyright dates

In reply to Stuart Yoder

Many source files have evolved without copyright date updates. Update the dates to reflect work through 2016.

---
-v2
-no changes

 drivers/staging/fsl-mc/bus/dpcon-cmd.h                 | 2 +-
 drivers/staging/fsl-mc/bus/dpmcp.h                     | 2 +-
 drivers/staging/fsl-mc/bus/dprc-driver.c               | 2 +-
 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c          | 2 +-
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c                | 2 +-
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c                | 2 +-
 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 +-
 drivers/staging/fsl-mc/bus/mc-sys.c                    | 2 +-
 drivers/staging/fsl-mc/include/dpbp.h                  | 2 +-
 drivers/staging/fsl-mc/include/dpmng.h                 | 2 +-
 drivers/staging/fsl-mc/include/dprc.h                  | 2 +-
 drivers/staging/fsl-mc/include/mc-bus.h                | 2 +-
 drivers/staging/fsl-mc/include/mc-cmd.h                | 2 +-
 drivers/staging/fsl-mc/include/mc-sys.h                | 2 +-
 drivers/staging/fsl-mc/include/mc.h                    | 2 +-
 15 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/fsl-mc/bus/dpcon-cmd.h +1 -1
index 4ebb3fc..d0a5e19 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dpmcp.h +1 -1
index 3cd1e3a..ff97174 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/bus/dprc-driver.c +1 -1
index 6aa2915..b4e46fb 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale data path resource container (DPRC) driver
  *
- * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
  * Author: German Rivera <[email protected]>
  *
  * This file is licensed under the terms of the GNU General Public
drivers/staging/fsl-mc/bus/fsl-mc-allocator.c +1 -1
index 4a7ac97..ce07096 100644
@@ -1,7 +1,7 @@
 /*
  * fsl-mc object allocator driver
  *
- * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +1 -1
index 6f148b2..4588202 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale Management Complex (MC) bus driver
  *
- * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
  * Author: German Rivera <[email protected]>
  *
  * This file is licensed under the terms of the GNU General Public
drivers/staging/fsl-mc/bus/fsl-mc-msi.c +1 -1
index 3d46b1b..7975c6e 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale Management Complex (MC) bus driver MSI support
  *
- * Copyright (C) 2015 Freescale Semiconductor, Inc.
+ * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
  * Author: German Rivera <[email protected]>
  *
  * This file is licensed under the terms of the GNU General Public
drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c +1 -1
index 16b0d4a..6b1cd57 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale Management Complex (MC) bus driver MSI support
  *
- * Copyright (C) 2015 Freescale Semiconductor, Inc.
+ * Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
  * Author: German Rivera <[email protected]>
  *
  * This file is licensed under the terms of the GNU General Public
drivers/staging/fsl-mc/bus/mc-sys.c +1 -1
index 7114064..e47bd23 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2014 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * I/O services to send MC commands to the MC hardware
  *
drivers/staging/fsl-mc/include/dpbp.h +1 -1
index 2520bf8..550b5e1 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/include/dpmng.h +1 -1
index 8cd206e..7d8e255 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/include/dprc.h +1 -1
index 6784418..6365159 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/include/mc-bus.h +1 -1
index 170684a..e915574 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale Management Complex (MC) bus declarations
  *
- * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
  * Author: German Rivera <[email protected]>
  *
  * This file is licensed under the terms of the GNU General Public
drivers/staging/fsl-mc/include/mc-cmd.h +1 -1
index b07f831..f33ad17 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
drivers/staging/fsl-mc/include/mc-sys.h +1 -1
index 7276ae3..dca7f90 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2014 Freescale Semiconductor Inc.
+ * Copyright 2013-2016 Freescale Semiconductor Inc.
  *
  * Interface of the I/O services to send MC commands to the MC hardware
  *
drivers/staging/fsl-mc/include/mc.h +1 -1
index f6e720e..a781a36 100644
@@ -1,7 +1,7 @@
 /*
  * Freescale Management Complex (MC) bus public interface
  *
- * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
  * Author: German Rivera <[email protected]>
  *
  * This file is licensed under the terms of the GNU General Public
Signature · 1 line
1.9.0
#12 lore raw

PATCH v2 12/12 staging: fsl-mc: uprev binary interface to match MC v10.x

In reply to Stuart Yoder

From: Ioana Ciornei <[email protected]>

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.

---
-v2
-updated commit message to clarify why all changes must
happen at once

 drivers/staging/fsl-mc/bus/dpbp-cmd.h    | 57 +++++++++++---------
 drivers/staging/fsl-mc/bus/dpbp.c        | 67 ++++++++++++++++++------
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h   | 45 ++++++++++------
 drivers/staging/fsl-mc/bus/dpmcp.c       | 66 +++++++++++++++++------
 drivers/staging/fsl-mc/bus/dpmcp.h       | 18 ++-----
 drivers/staging/fsl-mc/bus/dpmng-cmd.h   | 13 ++---
 drivers/staging/fsl-mc/bus/dpmng.c       | 33 ------------
 drivers/staging/fsl-mc/bus/dprc-cmd.h    | 89 +++++++++++++++++---------------
 drivers/staging/fsl-mc/bus/dprc-driver.c | 19 +++++--
 drivers/staging/fsl-mc/bus/dprc.c        | 65 ++++++++++++++++++++++-
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c  | 22 ++------
 drivers/staging/fsl-mc/bus/mc-sys.c      |  8 +--
 drivers/staging/fsl-mc/include/dpbp.h    | 21 ++++----
 drivers/staging/fsl-mc/include/dprc.h    | 19 ++++---
 drivers/staging/fsl-mc/include/mc-cmd.h  | 41 +++++++++++----
 15 files changed, 356 insertions(+), 227 deletions(-)
drivers/staging/fsl-mc/bus/dpbp-cmd.h +34 -23
index 4cc2918..7d86539 100644
@@ -33,37 +33,48 @@
 #define _FSL_DPBP_CMD_H
 
 /* DPBP Version */
-#define DPBP_VER_MAJOR				2
+#define DPBP_VER_MAJOR				3
 #define DPBP_VER_MINOR				2
 
+/* Command versioning */
+#define DPBP_CMD_BASE_VERSION			1
+#define DPBP_CMD_ID_OFFSET			4
+
+#define DPBP_CMD(id)	((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
+
 /* Command IDs */
-#define DPBP_CMDID_CLOSE				0x800
-#define DPBP_CMDID_OPEN					0x804
-#define DPBP_CMDID_CREATE				0x904
-#define DPBP_CMDID_DESTROY				0x900
-
-#define DPBP_CMDID_ENABLE				0x002
-#define DPBP_CMDID_DISABLE				0x003
-#define DPBP_CMDID_GET_ATTR				0x004
-#define DPBP_CMDID_RESET				0x005
-#define DPBP_CMDID_IS_ENABLED				0x006
-
-#define DPBP_CMDID_SET_IRQ				0x010
-#define DPBP_CMDID_GET_IRQ				0x011
-#define DPBP_CMDID_SET_IRQ_ENABLE			0x012
-#define DPBP_CMDID_GET_IRQ_ENABLE			0x013
-#define DPBP_CMDID_SET_IRQ_MASK				0x014
-#define DPBP_CMDID_GET_IRQ_MASK				0x015
-#define DPBP_CMDID_GET_IRQ_STATUS			0x016
-#define DPBP_CMDID_CLEAR_IRQ_STATUS			0x017
-
-#define DPBP_CMDID_SET_NOTIFICATIONS		0x01b0
-#define DPBP_CMDID_GET_NOTIFICATIONS		0x01b1
+#define DPBP_CMDID_CLOSE		DPBP_CMD(0x800)
+#define DPBP_CMDID_OPEN			DPBP_CMD(0x804)
+#define DPBP_CMDID_CREATE		DPBP_CMD(0x904)
+#define DPBP_CMDID_DESTROY		DPBP_CMD(0x984)
+#define DPBP_CMDID_GET_API_VERSION	DPBP_CMD(0xa04)
+
+#define DPBP_CMDID_ENABLE		DPBP_CMD(0x002)
+#define DPBP_CMDID_DISABLE		DPBP_CMD(0x003)
+#define DPBP_CMDID_GET_ATTR		DPBP_CMD(0x004)
+#define DPBP_CMDID_RESET		DPBP_CMD(0x005)
+#define DPBP_CMDID_IS_ENABLED		DPBP_CMD(0x006)
+
+#define DPBP_CMDID_SET_IRQ		DPBP_CMD(0x010)
+#define DPBP_CMDID_GET_IRQ		DPBP_CMD(0x011)
+#define DPBP_CMDID_SET_IRQ_ENABLE	DPBP_CMD(0x012)
+#define DPBP_CMDID_GET_IRQ_ENABLE	DPBP_CMD(0x013)
+#define DPBP_CMDID_SET_IRQ_MASK		DPBP_CMD(0x014)
+#define DPBP_CMDID_GET_IRQ_MASK		DPBP_CMD(0x015)
+#define DPBP_CMDID_GET_IRQ_STATUS	DPBP_CMD(0x016)
+#define DPBP_CMDID_CLEAR_IRQ_STATUS	DPBP_CMD(0x017)
+
+#define DPBP_CMDID_SET_NOTIFICATIONS	DPBP_CMD(0x01b0)
+#define DPBP_CMDID_GET_NOTIFICATIONS	DPBP_CMD(0x01b1)
 
 struct dpbp_cmd_open {
 	__le32 dpbp_id;
 };
 
+struct dpbp_cmd_destroy {
+	__le32 object_id;
+};
+
 #define DPBP_ENABLE			0x1
 
 struct dpbp_rsp_is_enabled {
drivers/staging/fsl-mc/bus/dpbp.c +50 -17

123 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dpmcp-cmd.h +28 -17

59 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dpmcp.c +51 -15

121 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dpmcp.h +5 -13
index ff97174..98a100d 100644
@@ -61,13 +61,15 @@ struct dpmcp_cfg {
 };
 
 int dpmcp_create(struct fsl_mc_io *mc_io,
+		 u16 dprc_token,
 		 u32 cmd_flags,
-		 const struct dpmcp_cfg	*cfg,
-		 u16 *token);
+		 const struct dpmcp_cfg *cfg,
+		 u32 *obj_id);
 
 int dpmcp_destroy(struct fsl_mc_io *mc_io,
+		  u16 dprc_token,
 		  u32 cmd_flags,
-		  u16 token);
+		  u32 obj_id);
 
 int dpmcp_reset(struct fsl_mc_io *mc_io,
 		u32 cmd_flags,
@@ -137,19 +139,9 @@ int dpmcp_get_irq_status(struct fsl_mc_io *mc_io,
 /**
  * struct dpmcp_attr - Structure representing DPMCP attributes
  * @id:		DPMCP object ID
- * @version:	DPMCP version
  */
 struct dpmcp_attr {
 	int id;
-	/**
-	 * struct version - Structure representing DPMCP version
-	 * @major:	DPMCP major version
-	 * @minor:	DPMCP minor version
-	 */
-	struct {
-		u16 major;
-		u16 minor;
-	} version;
 };
 
 int dpmcp_get_attributes(struct fsl_mc_io *mc_io,
drivers/staging/fsl-mc/bus/dpmng-cmd.h +7 -6
index d42d977..cdddfb8 100644
@@ -40,13 +40,14 @@
 #ifndef __FSL_DPMNG_CMD_H
 #define __FSL_DPMNG_CMD_H
 
-/* Command IDs */
-#define DPMNG_CMDID_GET_CONT_ID			0x830
-#define DPMNG_CMDID_GET_VERSION			0x831
+/* Command versioning */
+#define DPMNG_CMD_BASE_VERSION		1
+#define DPMNG_CMD_ID_OFFSET		4
 
-struct dpmng_rsp_get_container_id {
-	__le32 container_id;
-};
+#define DPMNG_CMD(id)	((id << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION)
+
+/* Command IDs */
+#define DPMNG_CMDID_GET_VERSION		DPMNG_CMD(0x831)
 
 struct dpmng_rsp_get_version {
 	__le32 revision;
drivers/staging/fsl-mc/bus/dpmng.c +0 -33
index 831c6ed..ad5d5bb 100644
@@ -72,36 +72,3 @@ int mc_get_version(struct fsl_mc_io *mc_io,
 }
 EXPORT_SYMBOL(mc_get_version);
 
-/**
- * dpmng_get_container_id() - Get container ID associated with a given portal.
- * @mc_io:		Pointer to MC portal's I/O object
- * @cmd_flags:		Command flags; one or more of 'MC_CMD_FLAG_'
- * @container_id:	Requested container ID
- *
- * Return:	'0' on Success; Error code otherwise.
- */
-int dpmng_get_container_id(struct fsl_mc_io *mc_io,
-			   u32 cmd_flags,
-			   int *container_id)
-{
-	struct mc_command cmd = { 0 };
-	struct dpmng_rsp_get_container_id *rsp_params;
-	int err;
-
-	/* prepare command */
-	cmd.header = mc_encode_cmd_header(DPMNG_CMDID_GET_CONT_ID,
-					  cmd_flags,
-					  0);
-
-	/* send command to mc*/
-	err = mc_send_command(mc_io, &cmd);
-	if (err)
-		return err;
-
-	/* retrieve response parameters */
-	rsp_params = (struct dpmng_rsp_get_container_id *)cmd.params;
-	*container_id = le32_to_cpu(rsp_params->container_id);
-
-	return 0;
-}
-
drivers/staging/fsl-mc/bus/dprc-cmd.h +47 -42

104 lines not on this page · raw message

drivers/staging/fsl-mc/bus/dprc-driver.c +14 -5
index b4e46fb..4e416d8 100644
@@ -597,6 +597,7 @@ static int dprc_probe(struct fsl_mc_device *mc_dev)
 	struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev);
 	bool mc_io_created = false;
 	bool msi_domain_set = false;
+	u16 major_ver, minor_ver;
 
 	if (WARN_ON(strcmp(mc_dev->obj_desc.type, "dprc") != 0))
 		return -EINVAL;
@@ -669,13 +670,21 @@ static int dprc_probe(struct fsl_mc_device *mc_dev)
 		goto error_cleanup_open;
 	}
 
-	if (mc_bus->dprc_attr.version.major < DPRC_MIN_VER_MAJOR ||
-	   (mc_bus->dprc_attr.version.major == DPRC_MIN_VER_MAJOR &&
-	    mc_bus->dprc_attr.version.minor < DPRC_MIN_VER_MINOR)) {
+	error = dprc_get_api_version(mc_dev->mc_io, 0,
+				     &major_ver,
+				     &minor_ver);
+	if (error < 0) {
+		dev_err(&mc_dev->dev, "dprc_get_api_version() failed: %d\n",
+			error);
+		goto error_cleanup_open;
+	}
+
+	if (major_ver < DPRC_MIN_VER_MAJOR ||
+	   (major_ver == DPRC_MIN_VER_MAJOR &&
+	    minor_ver < DPRC_MIN_VER_MINOR)) {
 		dev_err(&mc_dev->dev,
 			"ERROR: DPRC version %d.%d not supported\n",
-			mc_bus->dprc_attr.version.major,
-			mc_bus->dprc_attr.version.minor);
+			major_ver, minor_ver);
 		error = -ENOTSUPP;
 		goto error_cleanup_open;
 	}
drivers/staging/fsl-mc/bus/dprc.c +63 -2

74 lines not on this page · raw message

drivers/staging/fsl-mc/bus/fsl-mc-bus.c +4 -18
index 4588202..f9fed63 100644
@@ -313,21 +313,6 @@ static int get_dprc_icid(struct fsl_mc_io *mc_io,
 	return error;
 }
 
-static int get_dprc_version(struct fsl_mc_io *mc_io,
-			    int container_id, u16 *major, u16 *minor)
-{
-	struct dprc_attributes attr;
-	int error;
-
-	error = get_dprc_attr(mc_io, container_id, &attr);
-	if (error == 0) {
-		*major = attr.version.major;
-		*minor = attr.version.minor;
-	}
-
-	return error;
-}
-
 static int translate_mc_addr(struct fsl_mc_device *mc_dev,
 			     enum dprc_region_type mc_region_type,
 			     u64 mc_offset, phys_addr_t *phys_addr)
@@ -789,7 +774,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 	if (error < 0)
 		goto error_cleanup_mc_io;
 
-	error = dpmng_get_container_id(mc_io, 0, &container_id);
+	error = dprc_get_container_id(mc_io, 0, &container_id);
 	if (error < 0) {
 		dev_err(&pdev->dev,
 			"dpmng_get_container_id() failed: %d\n", error);
@@ -797,8 +782,9 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 	}
 
 	memset(&obj_desc, 0, sizeof(struct dprc_obj_desc));
-	error = get_dprc_version(mc_io, container_id,
-				 &obj_desc.ver_major, &obj_desc.ver_minor);
+	error = dprc_get_api_version(mc_io, 0,
+				     &obj_desc.ver_major,
+				     &obj_desc.ver_minor);
 	if (error < 0)
 		goto error_cleanup_mc_io;
 
drivers/staging/fsl-mc/bus/mc-sys.c +4 -4
index e47bd23..4d82802 100644
@@ -67,7 +67,7 @@ static u16 mc_cmd_hdr_read_cmdid(struct mc_command *cmd)
 	struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header;
 	u16 cmd_id = le16_to_cpu(hdr->cmd_id);
 
-	return (cmd_id & MC_CMD_HDR_CMDID_MASK) >> MC_CMD_HDR_CMDID_SHIFT;
+	return cmd_id;
 }
 
 static int mc_status_to_error(enum mc_cmd_status status)
@@ -200,7 +200,7 @@ static int mc_polling_wait_preemptible(struct fsl_mc_io *mc_io,
 
 		if (time_after_eq(jiffies, jiffies_until_timeout)) {
 			dev_dbg(mc_io->dev,
-				"MC command timed out (portal: %#llx, obj handle: %#x, command: %#x)\n",
+				"MC command timed out (portal: %#llx, dprc handle: %#x, command: %#x)\n",
 				 mc_io->portal_phys_addr,
 				 (unsigned int)mc_cmd_hdr_read_token(cmd),
 				 (unsigned int)mc_cmd_hdr_read_cmdid(cmd));
@@ -240,7 +240,7 @@ static int mc_polling_wait_atomic(struct fsl_mc_io *mc_io,
 		timeout_usecs -= MC_CMD_COMPLETION_POLLING_MAX_SLEEP_USECS;
 		if (timeout_usecs == 0) {
 			dev_dbg(mc_io->dev,
-				"MC command timed out (portal: %#llx, obj handle: %#x, command: %#x)\n",
+				"MC command timed out (portal: %#llx, dprc handle: %#x, command: %#x)\n",
 				 mc_io->portal_phys_addr,
 				 (unsigned int)mc_cmd_hdr_read_token(cmd),
 				 (unsigned int)mc_cmd_hdr_read_cmdid(cmd));
@@ -294,7 +294,7 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)
 
 	if (status != MC_CMD_STATUS_OK) {
 		dev_dbg(mc_io->dev,
-			"MC command failed: portal: %#llx, obj handle: %#x, command: %#x, status: %s (%#x)\n",
+			"MC command failed: portal: %#llx, dprc handle: %#x, command: %#x, status: %s (%#x)\n",
 			 mc_io->portal_phys_addr,
 			 (unsigned int)mc_cmd_hdr_read_token(cmd),
 			 (unsigned int)mc_cmd_hdr_read_cmdid(cmd),
drivers/staging/fsl-mc/include/dpbp.h +9 -12
index 550b5e1..bf34b1e 100644
@@ -58,13 +58,15 @@ struct dpbp_cfg {
 };
 
 int dpbp_create(struct fsl_mc_io *mc_io,
+		u16 dprc_token,
 		u32 cmd_flags,
 		const struct dpbp_cfg *cfg,
-		u16 *token);
+		u32 *obj_id);
 
 int dpbp_destroy(struct fsl_mc_io *mc_io,
+		 u16 dprc_token,
 		 u32 cmd_flags,
-		 u16 token);
+		 u32 obj_id);
 
 int dpbp_enable(struct fsl_mc_io *mc_io,
 		u32 cmd_flags,
@@ -147,21 +149,11 @@ int dpbp_clear_irq_status(struct fsl_mc_io *mc_io,
 /**
  * struct dpbp_attr - Structure representing DPBP attributes
  * @id:		DPBP object ID
- * @version:	DPBP version
  * @bpid:	Hardware buffer pool ID; should be used as an argument in
  *		acquire/release operations on buffers
  */
 struct dpbp_attr {
 	int id;
-	/**
-	 * struct version - Structure representing DPBP version
-	 * @major:	DPBP major version
-	 * @minor:	DPBP minor version
-	 */
-	struct {
-		u16 major;
-		u16 minor;
-	} version;
 	u16 bpid;
 };
 
@@ -217,6 +209,11 @@ int dpbp_get_notifications(struct fsl_mc_io *mc_io,
 			   u16 token,
 			   struct dpbp_notification_cfg *cfg);
 
+int dpbp_get_api_version(struct fsl_mc_io *mc_io,
+			 u32 cmd_flags,
+			 u16 *major_ver,
+			 u16 *minor_ver);
+
 /** @} */
 
 #endif /* __FSL_DPBP_H */
drivers/staging/fsl-mc/include/dprc.h +9 -10
index 6365159..f9ea769 100644
@@ -239,22 +239,12 @@ int dprc_clear_irq_status(struct fsl_mc_io *mc_io,
  * @icid: Container's ICID
  * @portal_id: Container's portal ID
  * @options: Container's options as set at container's creation
- * @version: DPRC version
  */
 struct dprc_attributes {
 	int container_id;
 	u16 icid;
 	int portal_id;
 	u64 options;
-	/**
-	 * struct version - DPRC version
-	 * @major: DPRC major version
-	 * @minor: DPRC minor version
-	 */
-	struct {
-		u16 major;
-		u16 minor;
-	} version;
 };
 
 int dprc_get_attributes(struct fsl_mc_io *mc_io,
@@ -551,5 +541,14 @@ int dprc_get_connection(struct fsl_mc_io *mc_io,
 			struct dprc_endpoint *endpoint2,
 			int *state);
 
+int dprc_get_api_version(struct fsl_mc_io *mc_io,
+			 u32 cmd_flags,
+			 u16 *major_ver,
+			 u16 *minor_ver);
+
+int dprc_get_container_id(struct fsl_mc_io *mc_io,
+			  u32 cmd_flags,
+			  int *container_id);
+
 #endif /* _FSL_DPRC_H */
 
drivers/staging/fsl-mc/include/mc-cmd.h +31 -10

65 lines not on this page · raw message

Signature · 1 line
1.9.0