get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/20446/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20446,
    "url": "http://patchwork.dpdk.org/api/patches/20446/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1487205586-6785-6-git-send-email-hemant.agrawal@nxp.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1487205586-6785-6-git-send-email-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1487205586-6785-6-git-send-email-hemant.agrawal@nxp.com",
    "date": "2017-02-16T00:39:04",
    "name": "[dpdk-dev,PATCHv7,05/47] bus/fslmc: introduce MC object functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "95570734a13de0f77d6077eddb0caeb081249188",
    "submitter": {
        "id": 477,
        "url": "http://patchwork.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1487205586-6785-6-git-send-email-hemant.agrawal@nxp.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/20446/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/20446/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B0841F60E;\n\tWed, 15 Feb 2017 20:06:38 +0100 (CET)",
            "from NAM02-BL2-obe.outbound.protection.outlook.com\n\t(mail-bl2nam02on0058.outbound.protection.outlook.com [104.47.38.58])\n\tby dpdk.org (Postfix) with ESMTP id 66E132BA4\n\tfor <dev@dpdk.org>; Wed, 15 Feb 2017 20:06:05 +0100 (CET)",
            "from BY2PR03CA077.namprd03.prod.outlook.com (10.141.249.50) by\n\tBN1PR0301MB0723.namprd03.prod.outlook.com (10.160.78.142) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.888.16; Wed, 15 Feb 2017 19:06:01 +0000",
            "from BN1AFFO11FD020.protection.gbl (2a01:111:f400:7c10::165) by\n\tBY2PR03CA077.outlook.office365.com (2a01:111:e400:2c5d::50) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via\n\tFrontend Transport; Wed, 15 Feb 2017 19:06:01 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBN1AFFO11FD020.mail.protection.outlook.com (10.58.52.80) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16\n\tvia Frontend Transport; Wed, 15 Feb 2017 19:06:01 +0000",
            "from bf-netperf1.idc ([10.232.134.28])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv1FJ5fLZ020023; Wed, 15 Feb 2017 12:05:58 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; caviumnetworks.com;\n\tdkim=none (message not signed)\n\theader.d=none;caviumnetworks.com; dmarc=fail action=none\n\theader.from=nxp.com; caviumnetworks.com;\n\tdkim=none (message not signed) header.d=none;",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas.monjalon@6wind.com>, <bruce.richardson@intel.com>,\n\t<shreyansh.jain@nxp.com>, <john.mcnamara@intel.com>,\n\t<ferruh.yigit@intel.com>, <jerin.jacob@caviumnetworks.com>",
        "Date": "Thu, 16 Feb 2017 06:09:04 +0530",
        "Message-ID": "<1487205586-6785-6-git-send-email-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com>",
        "References": "<1485172803-17288-1-git-send-email-hemant.agrawal@nxp.com>\n\t<1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131316591614215398;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(336005)(7916002)(39840400002)(39850400002)(39380400002)(39860400002)(39400400002)(39450400003)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(5003940100001)(77096006)(626004)(106466001)(6916009)(2906002)(356003)(53936002)(389900002)(105606002)(8656002)(104016004)(81166006)(50986999)(81156014)(4326007)(92566002)(47776003)(85426001)(189998001)(8676002)(6666003)(97736004)(54906002)(38730400002)(2950100002)(5660300001)(86362001)(50466002)(68736007)(36756003)(8936002)(110136004)(33646002)(305945005)(76176999)(575784001)(50226002)(48376002)(2351001)(2004002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0723;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BN1AFFO11FD020;\n\t1:QS88Da/LzmhAL+xyCpmx1TtNu2F/FBSOHwFrZtVI/sugeEVXjS4VECCilTZpWNPBxRppdJq6fkQKTQUGIGqSFbkKmhY6HxnA8IVB4lcJwVErD4B4nTOs8w+IvAA/00TWzxdeimJmMcB2h6qzGywHHRLmdANBOQnw+oCncadvSGlI/+5Y3/vS8vsvSEkMuTusdEonrAVOBJ8NvUy5bvXYLz1qPtZHKTFHbBFgIpESqFj2zxUiKtP7R6xNQY2+owIysu5kj2UEmOsP0DhT93spsmnNX920DFmxwfPLm9QV0kEOJjg27yXB1EZ86xrUsxiJTIk/Z3SzyNa57Z4V0koHeL8xQCzSbHNXQxnB92QWNQskamjD2uiIkcl2WO/Qh717P+OAOy8DxiIRkV+qFZpBRSKiRRYc5dCWkiUC8l16O55ae1Pdud/nfHZN8tDtzikqTTDxgrCstMwle5YEu9IlMuYOTL+93ApQJR09KT67fJZyPIzfYMEEcsEQTOdTk0a9cpXAEr11Y8viGC8HJgv55NEYGl/8Ry2cJyBogMuuI7Tj0BJbx11t3lZZ+fUN6KqpSzkrzxedHvErZOnjf0FhmdjZUJ6axBZ5OODT1Koy8LLM2GE/xO1wNM4MsVISeCWKyAUE/2Ds142hU+miQ5pQ5w==",
            "1; BN1PR0301MB0723;\n\t3:wMNgI6iLneKpsAl+ozXDPoYm6jryPKb2C5eDntwnWL/QRzAhJQQeArkpjxz4AHzumql+ymo3PGjWsdJxn9MEkOAsatTIALX5EL91JlAdPAe7jbempoa3CDSVhr3647/usO7LcM1o3MFVcDSDLK8h/+CkajldJwET3815mO9bSvCwwEtPxM5hqAwm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bPkzhejg=="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "eb8cb04f-17c9-4d60-b9de-08d455d5aeab",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:BN1PR0301MB0723; ",
        "X-Microsoft-Antispam-PRVS": "<BN1PR0301MB0723F3D135BCE8F14DB33B81895B0@BN1PR0301MB0723.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197)(275809806118684); ",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6095060)(601004)(2401047)(13018025)(13024025)(13023025)(13015025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123556025)(20161123559025)(20161123563025)(20161123561025);\n\tSRVR:BN1PR0301MB0723; BCL:0; PCL:0; RULEID:(400006);\n\tSRVR:BN1PR0301MB0723; ",
        "X-Forefront-PRVS": "021975AE46",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "15 Feb 2017 19:06:01.1095\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BN1PR0301MB0723",
        "Subject": "[dpdk-dev] [PATCHv7 05/47] bus/fslmc: introduce MC object functions",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch intoduces the DPAA2 MC(Management complex Driver).\n\nThis is a minimal set of low level functions to send and\nreceive commands to the fsl-mc. It includes support for basic\nmanagement commands and commands to manipulate MC objects.\n\nThis is common to be used by various DPAA2 PMDs. e.g.net, crypto\nand other drivers.\n\nThis is a low level library also used in kernel.\n\nSigned-off-by: Cristian Sovaiala <cristian.sovaiala@nxp.com>\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/bus/fslmc/Makefile        |   7 ++\n drivers/bus/fslmc/mc/fsl_mc_cmd.h | 238 ++++++++++++++++++++++++++++++++++++++\n drivers/bus/fslmc/mc/fsl_mc_sys.h | 105 +++++++++++++++++\n drivers/bus/fslmc/mc/mc_sys.c     | 114 ++++++++++++++++++\n 4 files changed, 464 insertions(+)\n create mode 100644 drivers/bus/fslmc/mc/fsl_mc_cmd.h\n create mode 100644 drivers/bus/fslmc/mc/fsl_mc_sys.h\n create mode 100644 drivers/bus/fslmc/mc/mc_sys.c",
    "diff": "diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile\nindex 5a0fd61..1058f0f 100644\n--- a/drivers/bus/fslmc/Makefile\n+++ b/drivers/bus/fslmc/Makefile\n@@ -37,6 +37,10 @@ LIB = librte_bus_fslmc.a\n \n CFLAGS += -O3\n CFLAGS += $(WERROR_FLAGS)\n+CFLAGS += \"-Wno-strict-aliasing\"\n+\n+CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc\n+CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc\n \n # versioning export map\n EXPORT_MAP := rte_bus_fslmc_version.map\n@@ -44,6 +48,9 @@ EXPORT_MAP := rte_bus_fslmc_version.map\n # library version\n LIBABIVER := 1\n \n+SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \\\n+        mc/mc_sys.c\n+\n SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_bus.c\n \n # library dependencies\ndiff --git a/drivers/bus/fslmc/mc/fsl_mc_cmd.h b/drivers/bus/fslmc/mc/fsl_mc_cmd.h\nnew file mode 100644\nindex 0000000..bc41646\n--- /dev/null\n+++ b/drivers/bus/fslmc/mc/fsl_mc_cmd.h\n@@ -0,0 +1,238 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright (c) 2016 NXP.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#ifndef __FSL_MC_CMD_H\n+#define __FSL_MC_CMD_H\n+\n+#define MC_CMD_NUM_OF_PARAMS\t7\n+\n+#define MAKE_UMASK64(_width) \\\n+\t((uint64_t)((_width) < 64 ? ((uint64_t)1 << (_width)) - 1 : \\\n+\t\t       (uint64_t)-1))\n+\n+static inline uint64_t mc_enc(int lsoffset, int width, uint64_t val)\n+{\n+\treturn (uint64_t)(((uint64_t)val & MAKE_UMASK64(width)) << lsoffset);\n+}\n+\n+static inline uint64_t mc_dec(uint64_t val, int lsoffset, int width)\n+{\n+\treturn (uint64_t)((val >> lsoffset) & MAKE_UMASK64(width));\n+}\n+\n+struct mc_command {\n+\tuint64_t header;\n+\tuint64_t params[MC_CMD_NUM_OF_PARAMS];\n+};\n+\n+/**\n+ * enum mc_cmd_status - indicates MC status at command response\n+ * @MC_CMD_STATUS_OK: Completed successfully\n+ * @MC_CMD_STATUS_READY: Ready to be processed\n+ * @MC_CMD_STATUS_AUTH_ERR: Authentication error\n+ * @MC_CMD_STATUS_NO_PRIVILEGE: No privilege\n+ * @MC_CMD_STATUS_DMA_ERR: DMA or I/O error\n+ * @MC_CMD_STATUS_CONFIG_ERR: Configuration error\n+ * @MC_CMD_STATUS_TIMEOUT: Operation timed out\n+ * @MC_CMD_STATUS_NO_RESOURCE: No resources\n+ * @MC_CMD_STATUS_NO_MEMORY: No memory available\n+ * @MC_CMD_STATUS_BUSY: Device is busy\n+ * @MC_CMD_STATUS_UNSUPPORTED_OP: Unsupported operation\n+ * @MC_CMD_STATUS_INVALID_STATE: Invalid state\n+ */\n+enum mc_cmd_status {\n+\tMC_CMD_STATUS_OK = 0x0,\n+\tMC_CMD_STATUS_READY = 0x1,\n+\tMC_CMD_STATUS_AUTH_ERR = 0x3,\n+\tMC_CMD_STATUS_NO_PRIVILEGE = 0x4,\n+\tMC_CMD_STATUS_DMA_ERR = 0x5,\n+\tMC_CMD_STATUS_CONFIG_ERR = 0x6,\n+\tMC_CMD_STATUS_TIMEOUT = 0x7,\n+\tMC_CMD_STATUS_NO_RESOURCE = 0x8,\n+\tMC_CMD_STATUS_NO_MEMORY = 0x9,\n+\tMC_CMD_STATUS_BUSY = 0xA,\n+\tMC_CMD_STATUS_UNSUPPORTED_OP = 0xB,\n+\tMC_CMD_STATUS_INVALID_STATE = 0xC\n+};\n+\n+/*  MC command flags */\n+\n+/**\n+ * High priority flag\n+ */\n+#define MC_CMD_FLAG_PRI\t\t0x00008000\n+/**\n+ * Command completion flag\n+ */\n+#define MC_CMD_FLAG_INTR_DIS\t0x01000000\n+\n+/**\n+ * Command ID field offset\n+ */\n+#define MC_CMD_HDR_CMDID_O\t48\n+/**\n+ * Command ID field size\n+ */\n+#define MC_CMD_HDR_CMDID_S\t16\n+/**\n+ * Token field offset\n+ */\n+#define MC_CMD_HDR_TOKEN_O\t32\n+/**\n+ * Token field size\n+ */\n+#define MC_CMD_HDR_TOKEN_S\t16\n+/**\n+ * Status field offset\n+ */\n+#define MC_CMD_HDR_STATUS_O\t16\n+/**\n+ * Status field size\n+ */\n+#define MC_CMD_HDR_STATUS_S\t8\n+/**\n+ * Flags field offset\n+ */\n+#define MC_CMD_HDR_FLAGS_O\t0\n+/**\n+ * Flags field size\n+ */\n+#define MC_CMD_HDR_FLAGS_S\t32\n+/**\n+ *  Command flags mask\n+ */\n+#define MC_CMD_HDR_FLAGS_MASK\t0xFF00FF00\n+\n+#define MC_CMD_HDR_READ_STATUS(_hdr) \\\n+\t((enum mc_cmd_status)mc_dec((_hdr), \\\n+\t\tMC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S))\n+\n+#define MC_CMD_HDR_READ_TOKEN(_hdr) \\\n+\t((uint16_t)mc_dec((_hdr), MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S))\n+\n+#define MC_PREP_OP(_ext, _param, _offset, _width, _type, _arg) \\\n+\t((_ext)[_param] |= cpu_to_le64(mc_enc((_offset), (_width), _arg)))\n+\n+#define MC_EXT_OP(_ext, _param, _offset, _width, _type, _arg) \\\n+\t(_arg = (_type)mc_dec(cpu_to_le64(_ext[_param]), (_offset), (_width)))\n+\n+#define MC_CMD_OP(_cmd, _param, _offset, _width, _type, _arg) \\\n+\t((_cmd).params[_param] |= mc_enc((_offset), (_width), _arg))\n+\n+#define MC_RSP_OP(_cmd, _param, _offset, _width, _type, _arg) \\\n+\t(_arg = (_type)mc_dec(_cmd.params[_param], (_offset), (_width)))\n+\n+/* cmd, param, offset, width, type, arg_name */\n+#define CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, object_id) \\\n+\tMC_RSP_OP(cmd, 0, 0,  32, uint32_t, object_id)\n+\n+/* cmd, param, offset, width, type, arg_name */\n+#define CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id) \\\n+\tMC_CMD_OP(cmd, 0, 0,  32,  uint32_t,  object_id)\n+\n+static inline uint64_t mc_encode_cmd_header(uint16_t cmd_id,\n+\t\t\t\t\t    uint32_t cmd_flags,\n+\t\t\t\t\t    uint16_t token)\n+{\n+\tuint64_t hdr;\n+\n+\thdr = mc_enc(MC_CMD_HDR_CMDID_O, MC_CMD_HDR_CMDID_S, cmd_id);\n+\thdr |= mc_enc(MC_CMD_HDR_FLAGS_O, MC_CMD_HDR_FLAGS_S,\n+\t\t       (cmd_flags & MC_CMD_HDR_FLAGS_MASK));\n+\thdr |= mc_enc(MC_CMD_HDR_TOKEN_O, MC_CMD_HDR_TOKEN_S, token);\n+\thdr |= mc_enc(MC_CMD_HDR_STATUS_O, MC_CMD_HDR_STATUS_S,\n+\t\t       MC_CMD_STATUS_READY);\n+\n+\treturn hdr;\n+}\n+\n+/**\n+ * mc_write_command - writes a command to a Management Complex (MC) portal\n+ *\n+ * @portal: pointer to an MC portal\n+ * @cmd: pointer to a filled command\n+ */\n+static inline void mc_write_command(struct mc_command __iomem *portal,\n+\t\t\t\t    struct mc_command *cmd)\n+{\n+\tint i;\n+\tuint32_t word;\n+\n+\t/* copy command parameters into the portal */\n+\tfor (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)\n+\t\tiowrite64(cmd->params[i], &portal->params[i]);\n+\n+\t/* submit the command by writing the header */\n+\tword = (uint32_t)mc_dec(cmd->header, 32, 32);\n+\tiowrite32(word, (((uint32_t *)&portal->header) + 1));\n+\n+\tword = (uint32_t)mc_dec(cmd->header, 0, 32);\n+\tiowrite32(word, (uint32_t *)&portal->header);\n+}\n+\n+/**\n+ * mc_read_response - reads the response for the last MC command from a\n+ * Management Complex (MC) portal\n+ *\n+ * @portal: pointer to an MC portal\n+ * @resp: pointer to command response buffer\n+ *\n+ * Returns MC_CMD_STATUS_OK on Success; Error code otherwise.\n+ */\n+static inline enum mc_cmd_status mc_read_response(\n+\t\t\t\t\tstruct mc_command __iomem *portal,\n+\t\t\t\t\tstruct mc_command *resp)\n+{\n+\tint i;\n+\tenum mc_cmd_status status;\n+\n+\t/* Copy command response header from MC portal: */\n+\tresp->header = ioread64(&portal->header);\n+\tstatus = MC_CMD_HDR_READ_STATUS(resp->header);\n+\tif (status != MC_CMD_STATUS_OK)\n+\t\treturn status;\n+\n+\t/* Copy command response data from MC portal: */\n+\tfor (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)\n+\t\tresp->params[i] = ioread64(&portal->params[i]);\n+\n+\treturn status;\n+}\n+\n+#endif /* __FSL_MC_CMD_H */\ndiff --git a/drivers/bus/fslmc/mc/fsl_mc_sys.h b/drivers/bus/fslmc/mc/fsl_mc_sys.h\nnew file mode 100644\nindex 0000000..ebada60\n--- /dev/null\n+++ b/drivers/bus/fslmc/mc/fsl_mc_sys.h\n@@ -0,0 +1,105 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2015 Freescale Semiconductor Inc.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#ifndef _FSL_MC_SYS_H\n+#define _FSL_MC_SYS_H\n+\n+#ifdef __linux_driver__\n+\n+#include <linux/errno.h>\n+#include <asm/io.h>\n+#include <linux/slab.h>\n+\n+struct fsl_mc_io {\n+\tvoid *regs;\n+};\n+\n+#ifndef ENOTSUP\n+#define ENOTSUP\t\t95\n+#endif\n+\n+#define ioread64(_p)\t    readq(_p)\n+#define iowrite64(_v, _p)   writeq(_v, _p)\n+\n+#else /* __linux_driver__ */\n+\n+#include <stdio.h>\n+#include <libio.h>\n+#include <stdint.h>\n+#include <errno.h>\n+#include <sys/uio.h>\n+#include <linux/byteorder/little_endian.h>\n+\n+#define cpu_to_le64(x) __cpu_to_le64(x)\n+#ifndef dmb\n+#define dmb() {__asm__ __volatile__(\"\" : : : \"memory\"); }\n+#endif\n+#define __iormb()       dmb()\n+#define __iowmb()       dmb()\n+#define __arch_getq(a)                  (*(volatile unsigned long *)(a))\n+#define __arch_putq(v, a)                (*(volatile unsigned long *)(a) = (v))\n+#define __arch_putq32(v, a)                (*(volatile unsigned int *)(a) = (v))\n+#define readq(c)        \\\n+\t({ uint64_t __v = __arch_getq(c); __iormb(); __v; })\n+#define writeq(v, c)     \\\n+\t({ uint64_t __v = v; __iowmb(); __arch_putq(__v, c); __v; })\n+#define writeq32(v, c) \\\n+\t({ uint32_t __v = v; __iowmb(); __arch_putq32(__v, c); __v; })\n+#define ioread64(_p)\t    readq(_p)\n+#define iowrite64(_v, _p)   writeq(_v, _p)\n+#define iowrite32(_v, _p)   writeq32(_v, _p)\n+#define __iomem\n+\n+struct fsl_mc_io {\n+\tvoid *regs;\n+};\n+\n+#ifndef ENOTSUP\n+#define ENOTSUP\t\t95\n+#endif\n+\n+/*GPP is supposed to use MC commands with low priority*/\n+#define CMD_PRI_LOW          0 /*!< Low Priority command indication */\n+\n+struct mc_command;\n+\n+int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd);\n+\n+#endif /* __linux_driver__ */\n+\n+#endif /* _FSL_MC_SYS_H */\ndiff --git a/drivers/bus/fslmc/mc/mc_sys.c b/drivers/bus/fslmc/mc/mc_sys.c\nnew file mode 100644\nindex 0000000..4573165\n--- /dev/null\n+++ b/drivers/bus/fslmc/mc/mc_sys.c\n@@ -0,0 +1,114 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2015 Freescale Semiconductor Inc.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#include <fsl_mc_sys.h>\n+#include <fsl_mc_cmd.h>\n+\n+#include <rte_spinlock.h>\n+\n+/** User space framework uses MC Portal in shared mode. Following change\n+ * introduces lock in MC FLIB\n+ */\n+\n+/**\n+ * A static spinlock initializer.\n+ */\n+static rte_spinlock_t mc_portal_lock = RTE_SPINLOCK_INITIALIZER;\n+\n+static int mc_status_to_error(enum mc_cmd_status status)\n+{\n+\tswitch (status) {\n+\tcase MC_CMD_STATUS_OK:\n+\t\treturn 0;\n+\tcase MC_CMD_STATUS_AUTH_ERR:\n+\t\treturn -EACCES; /* Token error */\n+\tcase MC_CMD_STATUS_NO_PRIVILEGE:\n+\t\treturn -EPERM; /* Permission denied */\n+\tcase MC_CMD_STATUS_DMA_ERR:\n+\t\treturn -EIO; /* Input/Output error */\n+\tcase MC_CMD_STATUS_CONFIG_ERR:\n+\t\treturn -EINVAL; /* Device not configured */\n+\tcase MC_CMD_STATUS_TIMEOUT:\n+\t\treturn -ETIMEDOUT; /* Operation timed out */\n+\tcase MC_CMD_STATUS_NO_RESOURCE:\n+\t\treturn -ENAVAIL; /* Resource temporarily unavailable */\n+\tcase MC_CMD_STATUS_NO_MEMORY:\n+\t\treturn -ENOMEM; /* Cannot allocate memory */\n+\tcase MC_CMD_STATUS_BUSY:\n+\t\treturn -EBUSY; /* Device busy */\n+\tcase MC_CMD_STATUS_UNSUPPORTED_OP:\n+\t\treturn -ENOTSUP; /* Operation not supported by device */\n+\tcase MC_CMD_STATUS_INVALID_STATE:\n+\t\treturn -ENODEV; /* Invalid device state */\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n+\t/* Not expected to reach here */\n+\treturn -EINVAL;\n+}\n+\n+int mc_send_command(struct fsl_mc_io *mc_io, struct mc_command *cmd)\n+{\n+\tenum mc_cmd_status status;\n+\n+\tif (!mc_io || !mc_io->regs)\n+\t\treturn -EACCES;\n+\n+\t/* --- Call lock function here in case portal is shared --- */\n+\trte_spinlock_lock(&mc_portal_lock);\n+\n+\tmc_write_command(mc_io->regs, cmd);\n+\n+\t/* Spin until status changes */\n+\tdo {\n+\t\tstatus = MC_CMD_HDR_READ_STATUS(ioread64(mc_io->regs));\n+\n+\t\t/* --- Call wait function here to prevent blocking ---\n+\t\t * Change the loop condition accordingly to exit on timeout.\n+\t\t */\n+\t} while (status == MC_CMD_STATUS_READY);\n+\n+\t/* Read the response back into the command buffer */\n+\tmc_read_response(mc_io->regs, cmd);\n+\n+\t/* --- Call unlock function here in case portal is shared --- */\n+\trte_spinlock_unlock(&mc_portal_lock);\n+\n+\treturn mc_status_to_error(status);\n+}\n",
    "prefixes": [
        "dpdk-dev",
        "PATCHv7",
        "05/47"
    ]
}