get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 17634,
    "url": "https://patches.dpdk.org/api/patches/17634/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1480875447-23680-3-git-send-email-hemant.agrawal@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://patches.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": "<1480875447-23680-3-git-send-email-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1480875447-23680-3-git-send-email-hemant.agrawal@nxp.com",
    "date": "2016-12-04T18:16:57",
    "name": "[dpdk-dev,02/32] drivers/common: introducing dpaa2 mc driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "d90e8617ea5683ad104afe8e5bc62845c19cde69",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1480875447-23680-3-git-send-email-hemant.agrawal@nxp.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/17634/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/17634/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 99B9EFA3B;\n\tSun,  4 Dec 2016 13:44:15 +0100 (CET)",
            "from NAM01-BN3-obe.outbound.protection.outlook.com\n\t(mail-bn3nam01on0052.outbound.protection.outlook.com [104.47.33.52])\n\tby dpdk.org (Postfix) with ESMTP id CE9BE559C\n\tfor <dev@dpdk.org>; Sun,  4 Dec 2016 13:43:44 +0100 (CET)",
            "from BN6PR03CA0068.namprd03.prod.outlook.com (10.173.137.30) by\n\tBN1PR0301MB0739.namprd03.prod.outlook.com (10.160.78.146) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.747.13; Sun, 4 Dec 2016 12:43:43 +0000",
            "from BN1AFFO11FD025.protection.gbl (2a01:111:f400:7c10::140) by\n\tBN6PR03CA0068.outlook.office365.com (2603:10b6:404:4c::30) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13 via\n\tFrontend Transport; Sun, 4 Dec 2016 12:43:43 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBN1AFFO11FD025.mail.protection.outlook.com (10.58.52.85) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4\n\tvia Frontend Transport; Sun, 4 Dec 2016 12:43:42 +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\tuB4ChXb5032240; Sun, 4 Dec 2016 05:43:39 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com;\n\tnxp.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;",
        "X-IncomingTopHeaderMarker": "OriginalChecksum:; UpperCasedChecksum:;\n\tSizeAsReceived:773; Count:10",
        "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>, Cristian Sovaiala <cristian.sovaiala@nxp.com>, \n\tHemant Agrawal <hemant.agrawal@nxp.com>",
        "Date": "Sun, 4 Dec 2016 23:46:57 +0530",
        "Message-ID": "<1480875447-23680-3-git-send-email-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com>",
        "References": "<1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com>",
        "X-IncomingHeaderCount": "10",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131253290230423080;\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)(7916002)(2980300002)(1110001)(1109001)(339900001)(336004)(189002)(199003)(305945005)(2906002)(81156014)(97736004)(68736007)(626004)(50226002)(5660300001)(85426001)(8676002)(76176999)(50986999)(105606002)(110136003)(8936002)(104016004)(2351001)(38730400001)(106466001)(39400400001)(6666003)(189998001)(2950100002)(77096006)(6916009)(356003)(39450400002)(4326007)(33646002)(47776003)(36756003)(5003940100001)(92566002)(39410400001)(39380400001)(50466002)(48376002)(7846002)(8666005)(86362001)(81166006)(7059030)(2004002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0739;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BN1AFFO11FD025;\n\t1:uK/aoH2qZnqdEFEaKPy3PJMVbGqgJaUGbA5XyFtw+NQhd2PGJZWCP4A8riQSzw0FgO4Hv7Y7MJ2U3qJjqZClh9QVM0gur5eNn/hCo7nED2y7+2EUMPdzDuAFJROqZvFkooDC4jAlk/TUpvPCqX1Yk3kAs2jM8eaJmyOGwYHNN4jFKGDnlrQu9Px9XaaNVvf9V+/fseHQz1k82qkCCUYs1CU4jpBAcB8QDi1ISPRSfUttEpa0JsMGR6X8vnwJUaTv0U/juCPKvr+kKmQUvjpxaMf8FbdrzzAtl383re9Ow8kqCYV+UVpvX3uzmcV+u1i96z1rDAf69z9eeKeg1jUraZB/eBcU9oBLXAD+AAzP5OAA9zmt45ZPrdb1Ooki8sE4ADc2VBxKVt/s7MxAZxeeBvIrsWi4ceGX1DEdcLr/wMaFNu0PAWy5BeXfMmt4n/zGB/hcDabgFOIYeKHKQp9Euma2zBu8ux7BQ6A3KsbjKTl9hD8OQlMbP8Uns/c4Bwh787CTbmaLCq56xb+jTLjcFGT0UUpn4pqDixQY+G9old0Lvyg6cXvgOO/lbj5tt54Xyt5VMLe5VAbyvRQcsWLYSpe5ouKXseoy8oq75kx2N+ha//dKiTelgIsszUN6kbLWZAQpk8mTqUyUPpwwWnBg6OyfZ5COAb/yXdCuWEdJdnDTBBaQeaW8nOeRrfqE001vCe90niOTdlATeFtwi87WoVGwtiZ0JWfNhdtUnJUE4qDfeOKpvWr7q6UiIHqvwp+W8p92eBD6RRylSrka43eDZQ==",
            "1; BN1PR0301MB0739;\n\t3:0k4cQaR0yWFY7M2J2sV2KVX0IIADEzbjM4ysP9dI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T2CsjeKGxoGKswrUXoowF/NBmelP0xss2vfWfabW1uELm0MhT3cMBgo2Bx9Y5TLntatGzGbmVUm3Lrm7JIqnfyzG3318japzSVtIBoh92UBS3RzvcJIa88vtu37AJl//Cb365lBw==",
            "=?us-ascii?Q?1; BN1PR0301MB0739;\n\t23:96o1J8OMmSM2RnbD6xlSa/GZmqYxtlC2CtNX3Fv?=\n\t=?us-ascii?Q?qO83wM+8TVTjAYaZI5xWpuDD1IovZpjsL5R7QAlRt3HAxKL3B6rIUTgXlYWn?=\n\t=?us-ascii?Q?iqtpagn7CZ+BbWItQPG7HZiT5XXfN9t8x9CTcmBmHPErVbdQ/qcvir2z043d?=\n\t=?us-ascii?Q?IWMIDPCND9L+u09jgeHzyUpV/UJDQsHJHiScliigPmoWprT1gJOZPute9xXA?=\n\t=?us-ascii?Q?TbCLvb7wwjHZqQC3O3SZtBSr2Z1VnMIBcQ9ZsW6swM0RHNAGC57OxdrQdKIR?=\n\t=?us-ascii?Q?3VwK4gCRUgjkWxErrnj+09nQWPxjmaMLQrnAGTmZYGpkdzSArBUKqWFSPEah?=\n\t=?us-ascii?Q?aoffD5yN5aBai/iqTzWiKrOds3UargiEgk4e5655WBSNs/J3QTAAqs4o0OVf?=\n\t=?us-ascii?Q?RjMjle+Q8s8RjMyjkjv9yEM0DtJv6CxodAkkLk+TPAlF4CVd6QEx5f50DOvN?=\n\t=?us-ascii?Q?/j0t+XoMYzip5e584on8W6Mt0oMsYvQHRqKqdAhcShmmP8N5js0AzQ75GjmE?=\n\t=?us-ascii?Q?q+Lwe7PJ5ekadYElH7HpoCP3VIr07abdtBbIdq2BzTjO4ME5tkcMPZm/lkD4?=\n\t=?us-ascii?Q?iO+7HTAOPNM8awE5FgY2Eu+hqXmppDiafwGr8k51tO869CiBn1aOeQts51M3?=\n\t=?us-ascii?Q?jCh47e0Neu9a/+S2gPjwO/SAurT4KTISLB5EbqaNzXjJd51tph18JI3490G5?=\n\t=?us-ascii?Q?aWPKpsjXlEE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ecCF8p+64Nb3uA1+Yn84fIOZiehuQJC4cgsDnXUApi6pdEbMwOYsi5VEsQZrvHchYCDP22E9CW4cOYAw/IQeh+8W2eBNDzJ+4XSaVYXUUP;\n\t5:VihsWmEPxb2dOWxA1YyCS+XZPmyl0mRv0V7IBD+qyf72ki8b0cgSnjSUzzJfyAP6OxijbWTI5cQtJArwkg4UrwYlmHJeJZS+FzF0XcIldXERavfJsLIWsKRp5zp6I1/gViM6ILWQla0CcErngdeJFAu73atRWyoYiabBbRhuCbJePM8l4OUrOSxerFzHvIQb;\n\t24:tIv9hOSQY/gpX3MAwlPtFNgjLdDwF98TRal3alD1GZ2/i2tf5BnxEyI6goxvnBx89Ixfry3s61V3jaIQY1pj/5UHzV3D3jF44QwkLzfP8ZE=",
            "1; BN1PR0301MB0739;\n\t7:MMnSv26a7eswI0RnR21qMl4eyVNNQLYJXtj950MNBbDnNYqP9XJ+5WhxVrLdQHwkcvXm2qqnPhAhxXM1qldESNcJUXHgdG9sxCxlNLDvActtuCk/GoYYseML5/UU3yQroIXMkDDdva++OXtKDcqXDrdDmBWr9mKCkQt0K8YGk+K3irbKk+Fd37ldY/q6YnQ0tq1X/vVbJ7wPS8B3WHyq6grk2289f9hBCdKD8wWJt3OJvxjinqtm7RfthJzhd+1C+VVUpcestcDC6bcKbbLjAcu5iGGk6LCxNbqn9XsPAO3P3pdsj2jsWGY+varjzfRL9/CHq18dLX7Z/4Yf4PWBUD5IjWWoRGTl1amsmHH7a2lB2NgiBq+me6WyL1siXEp3RIn3KZPh0bYz6uX3kyHcwPr4XzpodfUaOpi01m4JyC8QQoh1btCxjKpYP0BGM0+89UFd+WmLzyLUrFBXClIIcA=="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "fbcafb69-3413-44d3-b1d1-08d41c432e2a",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:BN1PR0301MB0739; ",
        "X-Microsoft-Antispam-PRVS": "<BN1PR0301MB0739CEF2E1AD0E9FE1E1963989800@BN1PR0301MB0739.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)(13017025)(13023025)(13015025)(13024025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123565025)(20161123559025)(20161123556025)(20161123561025);\n\tSRVR:BN1PR0301MB0739; BCL:0; PCL:0; RULEID:(400006);\n\tSRVR:BN1PR0301MB0739; ",
        "X-Forefront-PRVS": "014617085B",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "04 Dec 2016 12:43:42.7147\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": "BN1PR0301MB0739",
        "Subject": "[dpdk-dev] [PATCH 02/32] drivers/common: introducing dpaa2 mc driver",
        "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 driver is common to be used by various DPAA2 net, crypto\nand other drivers\n\nSigned-off-by: Cristian Sovaiala <cristian.sovaiala@nxp.com>\n[Hemant:rebase and conversion to library for DPDK]\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n config/defconfig_arm64-dpaa2-linuxapp-gcc    |   7 +-\n drivers/Makefile                             |   1 +\n drivers/common/Makefile                      |  36 +++++\n drivers/common/dpaa2/Makefile                |  36 +++++\n drivers/common/dpaa2/mc/Makefile             |  53 ++++++\n drivers/common/dpaa2/mc/dpaa2_mc_version.map |   4 +\n drivers/common/dpaa2/mc/fsl_mc_cmd.h         | 231 +++++++++++++++++++++++++++\n drivers/common/dpaa2/mc/fsl_mc_sys.h         |  98 ++++++++++++\n drivers/common/dpaa2/mc/mc_sys.c             | 126 +++++++++++++++\n 9 files changed, 591 insertions(+), 1 deletion(-)\n create mode 100644 drivers/common/Makefile\n create mode 100644 drivers/common/dpaa2/Makefile\n create mode 100644 drivers/common/dpaa2/mc/Makefile\n create mode 100644 drivers/common/dpaa2/mc/dpaa2_mc_version.map\n create mode 100644 drivers/common/dpaa2/mc/fsl_mc_cmd.h\n create mode 100644 drivers/common/dpaa2/mc/fsl_mc_sys.h\n create mode 100644 drivers/common/dpaa2/mc/mc_sys.c",
    "diff": "diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc\nindex 66df54c..00f207e 100644\n--- a/config/defconfig_arm64-dpaa2-linuxapp-gcc\n+++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc\n@@ -1,6 +1,7 @@\n #   BSD LICENSE\n #\n-#   Copyright(c) 2016 Freescale Semiconductor, Inc. All rights reserved.\n+#   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.\n+#   Copyright (c) 2016 NXP. All rights reserved.\n #\n #   Redistribution and use in source and binary forms, with or without\n #   modification, are permitted provided that the following conditions\n@@ -40,3 +41,7 @@ CONFIG_RTE_ARCH_ARM_TUNE=\"cortex-a57+fp+simd\"\n #\n CONFIG_RTE_MAX_LCORE=8\n CONFIG_RTE_MAX_NUMA_NODES=1\n+\n+# Compile software PMD backed by NXP DPAA2 files\n+#\n+CONFIG_RTE_LIBRTE_DPAA2_PMD=y\ndiff --git a/drivers/Makefile b/drivers/Makefile\nindex 81c03a8..d5580f6 100644\n--- a/drivers/Makefile\n+++ b/drivers/Makefile\n@@ -31,6 +31,7 @@\n \n include $(RTE_SDK)/mk/rte.vars.mk\n \n+DIRS-y += common\n DIRS-y += net\n DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto\n \ndiff --git a/drivers/common/Makefile b/drivers/common/Makefile\nnew file mode 100644\nindex 0000000..0c3f35f\n--- /dev/null\n+++ b/drivers/common/Makefile\n@@ -0,0 +1,36 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2016 NXP. All rights reserved.\n+#   All rights reserved.\n+#\n+#   Redistribution and use in source and binary forms, with or without\n+#   modification, are permitted provided that the following conditions\n+#   are met:\n+#\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\n+#       the documentation and/or other materials provided with the\n+#       distribution.\n+#     * Neither the name of NXP nor the names of its\n+#       contributors may be used to endorse or promote products derived\n+#       from this software without specific prior written permission.\n+#\n+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2\n+\n+include $(RTE_SDK)/mk/rte.subdir.mk\ndiff --git a/drivers/common/dpaa2/Makefile b/drivers/common/dpaa2/Makefile\nnew file mode 100644\nindex 0000000..a4f80c1\n--- /dev/null\n+++ b/drivers/common/dpaa2/Makefile\n@@ -0,0 +1,36 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2016 NXP. All rights reserved.\n+#   All rights reserved.\n+#\n+#   Redistribution and use in source and binary forms, with or without\n+#   modification, are permitted provided that the following conditions\n+#   are met:\n+#\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\n+#       the documentation and/or other materials provided with the\n+#       distribution.\n+#     * Neither the name of NXP nor the names of its\n+#       contributors may be used to endorse or promote products derived\n+#       from this software without specific prior written permission.\n+#\n+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc\n+\n+include $(RTE_SDK)/mk/rte.subdir.mk\ndiff --git a/drivers/common/dpaa2/mc/Makefile b/drivers/common/dpaa2/mc/Makefile\nnew file mode 100644\nindex 0000000..9632168\n--- /dev/null\n+++ b/drivers/common/dpaa2/mc/Makefile\n@@ -0,0 +1,53 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2016 NXP. All rights reserved.\n+#   All rights reserved.\n+#\n+#   Redistribution and use in source and binary forms, with or without\n+#   modification, are permitted provided that the following conditions\n+#   are met:\n+#\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\n+#       the documentation and/or other materials provided with the\n+#       distribution.\n+#     * Neither the name of NXP nor the names of its\n+#       contributors may be used to endorse or promote products derived\n+#       from this software without specific prior written permission.\n+#\n+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+RTE_SDK_MC=$(RTE_SDK)/drivers/common/dpaa2\n+\n+#\n+# library name\n+#\n+LIB = libdpaa2_mc.a\n+\n+CFLAGS += -O3\n+CFLAGS += $(WERROR_FLAGS)\n+CFLAGS +=-Wno-strict-aliasing\n+\n+CFLAGS += -I$(RTE_SDK_MC)/mc\n+EXPORT_MAP := dpaa2_mc_version.map\n+\n+LIBABIVER := 1\n+\n+SRCS-y += \\\n+\tmc_sys.c\n+\n+\n+include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/drivers/common/dpaa2/mc/dpaa2_mc_version.map b/drivers/common/dpaa2/mc/dpaa2_mc_version.map\nnew file mode 100644\nindex 0000000..31eca32\n--- /dev/null\n+++ b/drivers/common/dpaa2/mc/dpaa2_mc_version.map\n@@ -0,0 +1,4 @@\n+DPDK_17.02 {\n+\n+\tlocal: *;\n+};\ndiff --git a/drivers/common/dpaa2/mc/fsl_mc_cmd.h b/drivers/common/dpaa2/mc/fsl_mc_cmd.h\nnew file mode 100644\nindex 0000000..cbd3995\n--- /dev/null\n+++ b/drivers/common/dpaa2/mc/fsl_mc_cmd.h\n@@ -0,0 +1,231 @@\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+ *\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/common/dpaa2/mc/fsl_mc_sys.h b/drivers/common/dpaa2/mc/fsl_mc_sys.h\nnew file mode 100644\nindex 0000000..d9d43e5\n--- /dev/null\n+++ b/drivers/common/dpaa2/mc/fsl_mc_sys.h\n@@ -0,0 +1,98 @@\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+ *\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/common/dpaa2/mc/mc_sys.c b/drivers/common/dpaa2/mc/mc_sys.c\nnew file mode 100644\nindex 0000000..e12a18b\n--- /dev/null\n+++ b/drivers/common/dpaa2/mc/mc_sys.c\n@@ -0,0 +1,126 @@\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+ *\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+/** User space framework uses MC Portal in shared mode. Following change\n+* introduces lock in MC FLIB\n+*/\n+\n+/**\n+* The mc_spinlock_t type.\n+*/\n+typedef struct {\n+\tvolatile int locked; /**< lock status 0 = unlocked, 1 = locked */\n+} mc_spinlock_t;\n+\n+/**\n+* A static spinlock initializer.\n+*/\n+static mc_spinlock_t mc_portal_lock = { 0 };\n+\n+static inline void mc_pause(void) {}\n+\n+static inline void mc_spinlock_lock(mc_spinlock_t *sl)\n+{\n+\twhile (__sync_lock_test_and_set(&sl->locked, 1))\n+\t\twhile (sl->locked)\n+\t\t\tmc_pause();\n+}\n+\n+static inline void mc_spinlock_unlock(mc_spinlock_t *sl)\n+{\n+\t__sync_lock_release(&sl->locked);\n+}\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+\tmc_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+\tmc_spinlock_unlock(&mc_portal_lock);\n+\n+\treturn mc_status_to_error(status);\n+}\n",
    "prefixes": [
        "dpdk-dev",
        "02/32"
    ]
}