]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: fsl-mc: move mc-cmd.h contents in the public header
authorLaurentiu Tudor <laurentiu.tudor@nxp.com>
Tue, 27 Jun 2017 14:41:34 +0000 (17:41 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Jun 2017 14:38:53 +0000 (16:38 +0200)
mc-cmd.h contains some low level functions used to encode and decode
commands to the MC. They are used by the drivers so move them to the
public headers and get rid of the mc-cmd.h header.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-dpaa2/ethernet/dpni.c
drivers/staging/fsl-mc/bus/dpbp.c
drivers/staging/fsl-mc/bus/dpcon.c
drivers/staging/fsl-mc/bus/dpio/dpio.c
drivers/staging/fsl-mc/bus/dpmcp.c
drivers/staging/fsl-mc/bus/dprc.c
drivers/staging/fsl-mc/bus/fsl-mc-bus.c
drivers/staging/fsl-mc/bus/fsl-mc-msi.c
drivers/staging/fsl-mc/bus/mc-sys.c
drivers/staging/fsl-mc/include/mc-cmd.h [deleted file]
drivers/staging/fsl-mc/include/mc.h

index 160eaf88a3ae1b4d0ff104445077c2efbf649aa6..5b9d4424e4fbceb840deffa72bf74ce640f434e2 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include "../../fsl-mc/include/mc.h"
-#include "../../fsl-mc/include/mc-cmd.h"
 #include "dpni.h"
 #include "dpni-cmd.h"
 
index b71467391a59be326755498818c7b8a77b331d20..363730a80cbbbb64d76357eef13239c7c6f99b90 100644 (file)
@@ -31,7 +31,6 @@
  */
 #include <linux/kernel.h>
 #include "../include/mc.h"
-#include "../include/mc-cmd.h"
 #include "../include/dpbp.h"
 
 #include "dpbp-cmd.h"
index 2272a9c4552850d43ad33e71657f3ee73f8ef265..ca1da85c6dda159a859d651d9dae65e0549d146b 100644 (file)
@@ -31,7 +31,6 @@
  */
 #include <linux/kernel.h>
 #include "../include/mc.h"
-#include "../include/mc-cmd.h"
 #include "../include/dpcon.h"
 
 #include "dpcon-cmd.h"
index 48dce4af93637f2c691f25bb3014908321373954..00eb22186f42ffc7aa3c056da0e5b0cd8e612ba1 100644 (file)
@@ -32,7 +32,6 @@
  */
 #include <linux/kernel.h>
 #include "../../include/mc.h"
-#include "../../include/mc-cmd.h"
 
 #include "dpio.h"
 #include "dpio-cmd.h"
index 7b3dd19a46ef2e4c78e1d42187d6e0fe4eccdd16..eea42f61af867d7be256b1bc4d956d943fc5439b 100644 (file)
@@ -31,7 +31,6 @@
  */
 #include <linux/kernel.h>
 #include "../include/mc.h"
-#include "../include/mc-cmd.h"
 
 #include "dpmcp.h"
 #include "dpmcp-cmd.h"
index f93fe009fb18c66d3bc50edf42b89e8d19047c09..138fe80577d870269d812a53b29694f5f3b3e9c7 100644 (file)
@@ -31,7 +31,6 @@
  */
 #include <linux/kernel.h>
 #include "../include/mc.h"
-#include "../include/mc-cmd.h"
 #include "../include/dprc.h"
 
 #include "dprc-cmd.h"
index 166604e22952f18e05bf900a77d59a67977f2661..19606e8d25dddfb4c6037e56034624a73f22c53b 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/bitops.h>
 #include <linux/msi.h>
 #include <linux/dma-mapping.h>
-#include "../include/mc-cmd.h"
 
 #include "fsl-mc-private.h"
 #include "dprc-cmd.h"
index 81dca7a3a317415c7ed1f4a782575d6872b23e95..2b64651bea90f18a9d5b4f3c030ec38a7c6c6a84 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/msi.h>
-#include "../include/mc-cmd.h"
 #include "fsl-mc-private.h"
 
 /*
index c537bf8b56858db3e7368d7694b40848ae73245b..a1704c3a6a780567b7d72ecca41eb4aa7c7f5edd 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/ioport.h>
 #include <linux/device.h>
 #include <linux/io.h>
-#include "../include/mc-cmd.h"
 #include "../include/mc.h"
 
 #include "dpmcp.h"
diff --git a/drivers/staging/fsl-mc/include/mc-cmd.h b/drivers/staging/fsl-mc/include/mc-cmd.h
deleted file mode 100644 (file)
index 2e08aa3..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the above-listed copyright holders nor the
- * 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
- * later version.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef __FSL_MC_CMD_H
-#define __FSL_MC_CMD_H
-
-#define MC_CMD_NUM_OF_PARAMS   7
-
-struct mc_cmd_header {
-       u8 src_id;
-       u8 flags_hw;
-       u8 status;
-       u8 flags_sw;
-       __le16 token;
-       __le16 cmd_id;
-};
-
-struct mc_command {
-       u64 header;
-       u64 params[MC_CMD_NUM_OF_PARAMS];
-};
-
-struct mc_rsp_create {
-       __le32 object_id;
-};
-
-struct mc_rsp_api_ver {
-       __le16 major_ver;
-       __le16 minor_ver;
-};
-
-enum mc_cmd_status {
-       MC_CMD_STATUS_OK = 0x0, /* Completed successfully */
-       MC_CMD_STATUS_READY = 0x1, /* Ready to be processed */
-       MC_CMD_STATUS_AUTH_ERR = 0x3, /* Authentication error */
-       MC_CMD_STATUS_NO_PRIVILEGE = 0x4, /* No privilege */
-       MC_CMD_STATUS_DMA_ERR = 0x5, /* DMA or I/O error */
-       MC_CMD_STATUS_CONFIG_ERR = 0x6, /* Configuration error */
-       MC_CMD_STATUS_TIMEOUT = 0x7, /* Operation timed out */
-       MC_CMD_STATUS_NO_RESOURCE = 0x8, /* No resources */
-       MC_CMD_STATUS_NO_MEMORY = 0x9, /* No memory available */
-       MC_CMD_STATUS_BUSY = 0xA, /* Device is busy */
-       MC_CMD_STATUS_UNSUPPORTED_OP = 0xB, /* Unsupported operation */
-       MC_CMD_STATUS_INVALID_STATE = 0xC /* Invalid state */
-};
-
-/*
- * MC command flags
- */
-
-/* High priority flag */
-#define MC_CMD_FLAG_PRI                0x80
-/* Command completion flag */
-#define MC_CMD_FLAG_INTR_DIS   0x01
-
-static inline u64 mc_encode_cmd_header(u16 cmd_id,
-                                      u32 cmd_flags,
-                                      u16 token)
-{
-       u64 header = 0;
-       struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header;
-
-       hdr->cmd_id = cpu_to_le16(cmd_id);
-       hdr->token  = cpu_to_le16(token);
-       hdr->status = MC_CMD_STATUS_READY;
-       if (cmd_flags & MC_CMD_FLAG_PRI)
-               hdr->flags_hw = MC_CMD_FLAG_PRI;
-       if (cmd_flags & MC_CMD_FLAG_INTR_DIS)
-               hdr->flags_sw = MC_CMD_FLAG_INTR_DIS;
-
-       return header;
-}
-
-static inline u16 mc_cmd_hdr_read_token(struct mc_command *cmd)
-{
-       struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header;
-       u16 token = le16_to_cpu(hdr->token);
-
-       return token;
-}
-
-static inline u32 mc_cmd_read_object_id(struct mc_command *cmd)
-{
-       struct mc_rsp_create *rsp_params;
-
-       rsp_params = (struct mc_rsp_create *)cmd->params;
-       return le32_to_cpu(rsp_params->object_id);
-}
-
-static inline void mc_cmd_read_api_version(struct mc_command *cmd,
-                                          u16 *major_ver,
-                                          u16 *minor_ver)
-{
-       struct mc_rsp_api_ver *rsp_params;
-
-       rsp_params = (struct mc_rsp_api_ver *)cmd->params;
-       *major_ver = le16_to_cpu(rsp_params->major_ver);
-       *minor_ver = le16_to_cpu(rsp_params->minor_ver);
-}
-
-#endif /* __FSL_MC_CMD_H */
index 33bb3b8b641c2095b585847dff9fda06913b3af8..38f87144324ab16b66046171bcf5a38b16b94d56 100644 (file)
@@ -23,7 +23,6 @@ struct msi_domain_info;
 
 struct fsl_mc_device;
 struct fsl_mc_io;
-struct mc_command;
 
 /**
  * struct fsl_mc_driver - MC object device driver object
@@ -202,6 +201,100 @@ struct fsl_mc_device {
 #define to_fsl_mc_device(_dev) \
        container_of(_dev, struct fsl_mc_device, dev)
 
+#define MC_CMD_NUM_OF_PARAMS   7
+
+struct mc_cmd_header {
+       u8 src_id;
+       u8 flags_hw;
+       u8 status;
+       u8 flags_sw;
+       __le16 token;
+       __le16 cmd_id;
+};
+
+struct mc_command {
+       u64 header;
+       u64 params[MC_CMD_NUM_OF_PARAMS];
+};
+
+enum mc_cmd_status {
+       MC_CMD_STATUS_OK = 0x0, /* Completed successfully */
+       MC_CMD_STATUS_READY = 0x1, /* Ready to be processed */
+       MC_CMD_STATUS_AUTH_ERR = 0x3, /* Authentication error */
+       MC_CMD_STATUS_NO_PRIVILEGE = 0x4, /* No privilege */
+       MC_CMD_STATUS_DMA_ERR = 0x5, /* DMA or I/O error */
+       MC_CMD_STATUS_CONFIG_ERR = 0x6, /* Configuration error */
+       MC_CMD_STATUS_TIMEOUT = 0x7, /* Operation timed out */
+       MC_CMD_STATUS_NO_RESOURCE = 0x8, /* No resources */
+       MC_CMD_STATUS_NO_MEMORY = 0x9, /* No memory available */
+       MC_CMD_STATUS_BUSY = 0xA, /* Device is busy */
+       MC_CMD_STATUS_UNSUPPORTED_OP = 0xB, /* Unsupported operation */
+       MC_CMD_STATUS_INVALID_STATE = 0xC /* Invalid state */
+};
+
+/*
+ * MC command flags
+ */
+
+/* High priority flag */
+#define MC_CMD_FLAG_PRI                0x80
+/* Command completion flag */
+#define MC_CMD_FLAG_INTR_DIS   0x01
+
+static inline u64 mc_encode_cmd_header(u16 cmd_id,
+                                      u32 cmd_flags,
+                                      u16 token)
+{
+       u64 header = 0;
+       struct mc_cmd_header *hdr = (struct mc_cmd_header *)&header;
+
+       hdr->cmd_id = cpu_to_le16(cmd_id);
+       hdr->token  = cpu_to_le16(token);
+       hdr->status = MC_CMD_STATUS_READY;
+       if (cmd_flags & MC_CMD_FLAG_PRI)
+               hdr->flags_hw = MC_CMD_FLAG_PRI;
+       if (cmd_flags & MC_CMD_FLAG_INTR_DIS)
+               hdr->flags_sw = MC_CMD_FLAG_INTR_DIS;
+
+       return header;
+}
+
+static inline u16 mc_cmd_hdr_read_token(struct mc_command *cmd)
+{
+       struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header;
+       u16 token = le16_to_cpu(hdr->token);
+
+       return token;
+}
+
+struct mc_rsp_create {
+       __le32 object_id;
+};
+
+struct mc_rsp_api_ver {
+       __le16 major_ver;
+       __le16 minor_ver;
+};
+
+static inline u32 mc_cmd_read_object_id(struct mc_command *cmd)
+{
+       struct mc_rsp_create *rsp_params;
+
+       rsp_params = (struct mc_rsp_create *)cmd->params;
+       return le32_to_cpu(rsp_params->object_id);
+}
+
+static inline void mc_cmd_read_api_version(struct mc_command *cmd,
+                                          u16 *major_ver,
+                                          u16 *minor_ver)
+{
+       struct mc_rsp_api_ver *rsp_params;
+
+       rsp_params = (struct mc_rsp_api_ver *)cmd->params;
+       *major_ver = le16_to_cpu(rsp_params->major_ver);
+       *minor_ver = le16_to_cpu(rsp_params->minor_ver);
+}
+
 /**
  * Bit masks for a MC I/O object (struct fsl_mc_io) flags
  */