From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0063.outbound.protection.outlook.com [104.47.41.63]) by dpdk.org (Postfix) with ESMTP id CD7E35A98 for ; Thu, 15 Jun 2017 10:59:59 +0200 (CEST) Received: from BN6PR03CA0085.namprd03.prod.outlook.com (10.164.122.151) by CY1PR03MB2393.namprd03.prod.outlook.com (10.167.8.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 15 Jun 2017 08:59:58 +0000 Received: from BN1BFFO11FD019.protection.gbl (2a01:111:f400:7c10::1:107) by BN6PR03CA0085.outlook.office365.com (2603:10b6:405:6f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Thu, 15 Jun 2017 08:59:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD019.mail.protection.outlook.com (10.58.144.82) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Thu, 15 Jun 2017 08:59:57 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5F8xWSY012830; Thu, 15 Jun 2017 01:59:54 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 15 Jun 2017 14:28:40 +0530 Message-ID: <1497517136-11824-5-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> References: <1495735361-4840-1-git-send-email-nipun.gupta@nxp.com> <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131419907974956662; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39840400002)(39450400003)(39400400002)(39850400002)(39410400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(189998001)(81166006)(48376002)(105606002)(2351001)(50466002)(106466001)(53936002)(33646002)(4326008)(50226002)(5660300001)(8676002)(8656002)(498600001)(38730400002)(110136004)(8936002)(77096006)(104016004)(2906002)(54906002)(47776003)(50986999)(6666003)(76176999)(305945005)(6916009)(2950100002)(5003940100001)(85426001)(36756003)(356003)(86362001)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2393; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD019; 1:XV12EDU4VotW+tmmi7tXHpckUfbUe/5bW3mz1yn5CjWrQcnukgtzF6cePqQamE66PFA56bX1zyqdxCWv5VW8FVIPS8QZZ0KZg3EXml9zbT5U9BulKDQPpsG0HgX882qKTvT6+MqaaUi9qXwRVLxe8a33iTX6VTF5RNt16ecNBaZeT+o4ep63hl/XUYuN8E/P5bwd3ABmJrTCuSntOPCyMrWDl9jHDfpF15V+wKvy/VDzWgRNhBEvsVDapEVvC8FuKV+J6JVS5XWRQ4xI5gExQIm38qJ5P2RAV1OMEuqPymgIMUOI7dEMKCB6saIW0sAxnWBM2fMpbkmmheYeEiQ25rcRO0+Z40pZkA9pVT0C44XjTEbSHwE2XbSB7sOKiAjBDkfOunGf6+5cDaYQAEbwHJ/FKBhpj1uznOmj6aCc5e1yMcEj3a05RjAd4o/pO25/h0lDsFOS+Q1Si9FLjVOgV7PHvsnxnNIR3UPcnTaG5up2jman5nZY8fWCUPeriqJwlm06XVJ2zMzgOlv/lhv+HuIBEPSyfcnBXuax/1QmTyq1z2NvgcfdtWcJtLVYIVvDfYBTrcFEG2eCnt7WbG/c8aUWZde8YBEpGvSerbdk3Kys0acQgr9S9CewK4wHq5c/gEV4t6b7tQ2p5GE3mRsAkxY0sZ+qsIq/sdSSdFTEbxz+q/QHQiH8txnxgevqMweamN20nPzuxE+U5LvMuACBbwIBPOndo5GhCtSQi4Q4cxA= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR03MB2393: X-MS-Office365-Filtering-Correlation-Id: 9937d4ed-baf8-4281-fb7e-08d4b3cce5a6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:CY1PR03MB2393; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2393; 3:KL1c9YPcPDX6tTO/ixMsbbzf3clZNhbQy+RFsYCsI3vB/MTYFjYsw2fdpfTCRjDNTk/jRYnX9AEOIrZaBiPnW5T4ezZQxRMSl+jzLAY4OqNQCoFRw0QbSu2q9o2rawlpdfKeEZLWtmxEy+Tb9RyZFWHABD6eNiMCwCy93jbHiE4ECprRtxskl4IV+eOj8F03ve2INivVcgWpDc5b9ymVEPAgYLX+7DYLXppZE9gCKV7anyOEQQW7mQwV2PVLhD2F+mr9OsEkVLLlfZCSUBryLKar/N24wybTUMYn76LDpAyw/F6XRR2bwSXnxPCm4zU8kSOLqwI7mxnlJi064um1KrP6bXQkJIWRaAV6geN778Abvd/C9ulgXzCUTmSiOozXhFSQRlYR4fcFvXfL9zgcEbtAe3wQloq0S5HTciRVr0yjQj0zIg35edC7DVLLZkOS; 25:XuW7XUk66J99sDInPcNNxqVfsctEf1iPvOWOc8WKTDIGzSbiZEASxiibT9iU49QluYSKyvSuzfUR0GyHPFsBV6SdDnyzojxixt2Rtbs5o5885S3d1U3xgChMngomc8s6VdSqwDvwVHQuPyxbuEhSMykYQ3uA0emNL1+Uqz8gI/4YAH4K6NdU4FlpIuXxm8JoWpTdVfII9ihiEgomwNtSscNJ4ge7lPccAM2MzM9ORiaJmE1dNMl3sMVrdI09p2OEU1EdzXT0+EPWGnq234rcE7UhvVbn6WvEMv1t0/uCbi2WMZY5wVvQSn7Qqjwu28fx7XHKByQ2HC5ZNp2mSpc1YICG2nId0+LrS/hM8xJM3QkEWyyWkkr26l0kdwGSB7Js5TtnZFFpfYGinmn4l1fE8kvGSgS3nekS7FEjeiOAtpvX6oRxKzUEL1iYw3C4zCftuiU0TKuQi8zqTh/BMUSagaDSwycnM8GsTU35AROyQ/4= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2393; 31:sMVxgutrnCumiWPdZh0F0wIVseAZTc8+Le2a/lxXy/LtPybJzAvWPeXd7IGmKiM96SD1iC3QYeguX9BrPmeAfQNRVyC6W3WvjTk0VO+TYaSD0S8rFG4GzZgb6fG7ixeU9/iU7PE/w3luYE7CfiLh9qAq6PBdXp/SCRWJpdJCwtuuMjyLcP90+ECY/Okfj89Mg7KA9SjqSs9L4DEOuZde0OxdEGacVeFrxukIep20WFEdSp3flNxmxZz/HFs0wTGFlOwi/DB3k2x6q2WOZJOo7A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123559100)(20161123563025)(20161123565025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2393; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2393; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2393; 4:4YSo7oyKNsXbeiLjd7BtTA2Qc0+2o0LsQdA08qolcA?= =?us-ascii?Q?RdAXJtV3IhS7KIGJQnJ0xGGGsOOgETYH3eccL7UhX75KqF5FmrYI5Tav2MWK?= =?us-ascii?Q?0HbpFv/9aRt8u4/S6M6peRwBkSQ7pCwLGVYoZODTTdqON+4ejC8vJ+8uQQOH?= =?us-ascii?Q?zgHwc+9t8ws2W2uiecXjgigPtYbH49U7p11YoP2p65zANCxjAcOAIyaEJ+sz?= =?us-ascii?Q?cEWb6uZ9AGzZg39xrj6UYNYQmu4bbjO2kTTO4lKS5FR5CTVV40XqVV0km9/a?= =?us-ascii?Q?k+t/yZ4/jaQNUgwxkmNHdnpgZXl9qznzX2v32gg2fmR+U3DwphF4QlihOMLV?= =?us-ascii?Q?11ZB43tMgTW9NUWBILNdRBUXgcOzSSW8u8O6BdqFgAvEnFA5BMXlSYgsDAXu?= =?us-ascii?Q?xxyxRpv4sAI1E2/mqHRX9PvpdYi/xEFkor1VrDQWsjkXaO2mg/zS0GSLMNSN?= =?us-ascii?Q?FfLzSlpRUscskEVbN0v8YQbkUAc9R6O2jJGwqjv0Laq7wBHZlsLR83ZvrXLE?= =?us-ascii?Q?BU2OMF1ZamgSkVlq6B68ZfakbbepxzL7XJoah0R0w/icRlVnjXlMslg36if4?= =?us-ascii?Q?quja0ctne3wJQmNWUazwR6eI2naavh4MwbrOnkbLdaJ/giX4M+K0J1mDN/jl?= =?us-ascii?Q?l8NuQiYaotANvcX+wkKJe+76XuT/MxLMuAOF471O7jr2wlA6WTz4HvlNAOW5?= =?us-ascii?Q?vr2lyQNi3n/GBEeEyiB12Uz35zMQkfu2p9+OxaWL3vIdXeh5y4n11JIXBfWu?= =?us-ascii?Q?YztUS+RZFBb646pjcVlG0DiCvNg1NfOiTvSK1AjrlwUglq9GEc+4AetgTXsL?= =?us-ascii?Q?ZchgdbJT4/+3hAE5z9gZuKb8FNsacRHzOrRgslsCWkK0jsqIZ8KJmq856clN?= =?us-ascii?Q?1wGnLD9+mTX4UH8Zntfzb/bJSol901GfiscS/NN9ql9mC2xseeU8FDjD8ww+?= =?us-ascii?Q?6741JBSrQLLxcd6a182tBLLarVTWvylOnqSuCHZMYhNeR+nc3IeBWGmGL2Pp?= =?us-ascii?Q?MZSgo8uoeHM/Hcvlo52cjnjfGPaiw9EAuG/D5Kbi2C2OKJSq2gpFO6Vsw3bZ?= =?us-ascii?Q?d0IFz2ui1eSKzHH7lPJIILGCyRIPSWpMXWY06/EoG1U+lzRAeAN6HMizKF7R?= =?us-ascii?Q?7tYaa29eXcIc9oF/JfvGAOcAYHxmPP2vpho3ZNSrA8ZL4iq76DAuqtVC7eXN?= =?us-ascii?Q?6ZSXEK7+fzDhZMJlbJdb1RPlCUpcxkEHbbHtQ3SaHXAo2PKwiydXjyD1nMZE?= =?us-ascii?Q?/Bi7/BdR7cyB3SHZwf+qkgGcA4Yy9j75bNdq92vgoltezOo4oD1oOX8EdCYg?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 0339F89554 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2393; 23:umq03EKvIO2ZuadHTPvT/Q7E4QC2twp8QQLeUfXk1?= =?us-ascii?Q?pKhf0xV22+orO/etcFz8yqxZ9mSRevt1ilRIW0/PlPsf/TOdTX5T/dwE+hCB?= =?us-ascii?Q?NW3rktddxfZWLZnaiSOriyZoRo25Tklo3pXPZqtk0GyqkPUzfhK7z620kv6d?= =?us-ascii?Q?PgdhANJZV2DjRSt0sWPQpjajgB+hofUcJk5DiBHJpLCP91D72vbpmb0ARucq?= =?us-ascii?Q?XhSfKWSD+3+0Xm/5g/KGKLJqu18z35hEYhT1BfKKwLV+P+RZtAvXT9cUQrbU?= =?us-ascii?Q?yCU1HJlR1NhvzPSSZ17CnmfkLHpwO6+DDL4/azL2diJr0N116mPLKj5aB1Rj?= =?us-ascii?Q?uNhBtTSr/ql32bPDI95JTD8V6iDdiaNXuwO4gTjQPvkAUBWnSqVzP+rHond8?= =?us-ascii?Q?ul+AoZmsMlcYTlgwXhuep+bIzCQyKWlf53NxM1lFljG8vDx+UwGkhnii1Uje?= =?us-ascii?Q?n4fNq4wLtZORiQEDjK4xVOGc3HxT197RBaGhR6oZoUUCAMwhw9PGlPyeYP8a?= =?us-ascii?Q?AtfdbF6O265axx6aupaCNHi+H2RDyeGAGobesHTUgMaP5+zlGoGz3mU/1vSh?= =?us-ascii?Q?AwfBL751oZiYSUJkr+kn3G2zjHH7fyMLby9WkL89AzTOt78i+I83pTaOqg23?= =?us-ascii?Q?/K8ROis53Ij2043Nn30UMOQ1lgBZQ7rXrEiGJmRnX2R2yoC2Bv/bJsTocQgM?= =?us-ascii?Q?BDWh9eHKHK4nND15fq9zxdremTH9J6jJ8eEAoBgRtjeeri+gDjGqDhbw/rb9?= =?us-ascii?Q?56qcHvDZxOTSBImCIdbm1VbBldPkwRU3ELLhEUQsATyoj1FnnKZUN1JkuXwb?= =?us-ascii?Q?z2FbLz37KkIXwBioqIDPjR+coBCiznKzAJW7AyiAuR4MMNuldadpEdKwt1+k?= =?us-ascii?Q?CsujwbYj7r+ScbbtZRmJKCuCQ3jsrAN6E8V+n0wDWu10BvrV0PpcTX236ATH?= =?us-ascii?Q?Lz7Dw/ADKRfXSKpPIBWIcSaMAXELnyxfHCcWA0+V/KTFTsgou5cO1pQ/ncI0?= =?us-ascii?Q?PSIG9+oQY+jrPARuD1wiqz2fyrW5yVj4qhsCvK0BJYdq1Oibe6WyFVmXJXHl?= =?us-ascii?Q?cGV8+oQV9ra4LqqpZ0Q+QxHEUSTy8PDxj1qus0woM+ZJo1z00C55vw4P7Y58?= =?us-ascii?Q?E3fqWUJFO4LEnFWlSBQ/+UXpo6ZRR2Wm14ieOQAP2tHy28EyC+nZhxYgiF2F?= =?us-ascii?Q?3Hj21f8BWjVBf8++v/oAUtPVI1tXTGw5Mq1IzpvJix1KSFZ0HkQgL7VJ1W1D?= =?us-ascii?Q?cTW5c5l0mu+Kti3yTQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2393; 6:hCMBQgqxQiHjGa2PNOjKDg1Mq8diwzpXM++jmxce+iqjWPE2gRGbUnCsrMVTpTPu5V0BADHcuN9pjcnmT5e0oC+l8iruo3aTJA1qJGKR69G2DfefMMhrkoritVTdypA1NceY8x2eftER0mR0PXQCnWtUQrCEr6aDFfT5uHWLsfrmF6kpsYRiF0quR+HgMsaOGu688U/s44PZ/iN0pU0+e4UxIlAwrigbnqwd32/ld5JF1ISyZWCh7IBOzTaz5QH96Dy3eYrKOmb2tT4CcSMxesQ+OIV0D5PApHAYNSk5VWilmFDmPHxN89AzEc4u7YvCOyzxmIk3KmnZ5uKNO9eycWt91Kbgpg3/eDIyBrMkqg+dLvj4ns4XlfpE1jFuGSzfeg1YQVM5f29Df06s0z8GN8w9rK5nf1UNanLwQnLkRAbR5hePSdWQgfhvsINhoTwSOORRN2FFD9uRnLselyybnBU0NRXyNqpaYZXk8a323J1VTCcDE710Ljf/NaiH9e8jry/GgtQu++mC8JH8vXAotQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2393; 5:K+tB4QAuJaU84Lxs2eIPX2WzU3t3/RAEZGLlC24ro7/gVe2Zu98pWreVyU/irO5ThlZpnZkJgUrjkiXqBlZQv8YdyJglRQwYAjQd7sZmcKfoRERAo0YgToJsbFU2PbOcYHU4YgkLE/0Va9loffpOHHmmbpG1s2yonxDCVpC4EmVF/7SA2MZRTd81Zs94Il1rGswXu7r5yIC/pkcMOoX2+GbM4V0MiT1GBf84PgOyNKVEHSkgpXZDnNNQagMj7cBaXmP/yq1PmA+3Si/oa6708JGeiCjZrbRRp3eZ1qhFA8kNwPt/zS9wr6e0T1gC0MLmOWuMB/07cS52zaPrHIITY9DTVgLHE54o/btbLWyx8o12FZk3VIoA9H+0rh4W15TU37rU58udIYhdDfoL6PvV1qqS7tAaEdDx32AdsoqKCWSvuBRymNxvtlDYHLnYFfEOMV93hGBM3CZE1Bx4n47/MmVpXfNrqBUW7LpmYLIlv4MFl2zUf2qTscA7abY3ZFQfXetOwsSVPJBlMaligRY7SQ==; 24:xvf/AK08G8KooNB5YLIppug7gMIfGFAfAg+R0KcNHC2iOnP62wwCREEdJDPtqgGilQviMiebD1xUDZ/rL0sLCRoqNOjT43O/GXQO4bWqRPM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2393; 7:jUlsdFJM6PGabIjMVRRlTHmFd9uFJhaFhqNST5TAXppoBQWt6juYKBToNUeU5XAp9QMvTH0mXjhwtKKhKiI2v3mqAhw5ZwxzYsJGPMM9WoA41l8SPgiqAs5QTI0s4WeC/526nxVTM32RRLwc4Ryprtq6x1V51XDfU+HTImA9hz6zHT4s94az0viJTdsIurU+TRkWctfcW+2P4JmBnn9gtA1wzCC5J2V7hfNyOjmfPd1Ue6LfWHCu882qiuwhXZPMSYmEydtajKJXOUxfY7/d4ohh1ICIKAoP8SB5p1B615ZJ+u6fWkNLoNnxf2M9oR+3uDKVLUUcnRgBN0Sz3zdtLQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 08:59:57.1992 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2393 Subject: [dpdk-dev] [PATCH 04/20 v2] bus/fslmc: adding basic dpcon support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2017 09:00:00 -0000 Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/Makefile | 3 +- drivers/bus/fslmc/fslmc_vfio.h | 1 + drivers/bus/fslmc/mc/dpcon.c | 230 +++++++++++++++++++++++++++ drivers/bus/fslmc/mc/fsl_dpcon.h | 238 ++++++++++++++++++++++++++++ drivers/bus/fslmc/mc/fsl_dpcon_cmd.h | 175 ++++++++++++++++++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 2 + 6 files changed, 648 insertions(+), 1 deletion(-) create mode 100644 drivers/bus/fslmc/mc/dpcon.c create mode 100644 drivers/bus/fslmc/mc/fsl_dpcon.h create mode 100644 drivers/bus/fslmc/mc/fsl_dpcon_cmd.h diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index 973d279..7ef805b 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -65,7 +65,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ mc/dpbp.c \ mc/dpio.c \ - mc/mc_sys.c + mc/mc_sys.c \ + mc/dpcon.c \ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += portal/dpaa2_hw_dpio.c SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += portal/dpaa2_hw_dpbp.c diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index ffed62e..eddce31 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -39,6 +39,7 @@ #define DPAA2_VENDOR_ID 0x1957 #define DPAA2_MC_DPNI_DEVID 7 #define DPAA2_MC_DPSECI_DEVID 3 +#define DPAA2_MC_DPCON_DEVID 5 #define DPAA2_MC_DPIO_DEVID 9 #define DPAA2_MC_DPBP_DEVID 10 diff --git a/drivers/bus/fslmc/mc/dpcon.c b/drivers/bus/fslmc/mc/dpcon.c new file mode 100644 index 0000000..b078dff --- /dev/null +++ b/drivers/bus/fslmc/mc/dpcon.c @@ -0,0 +1,230 @@ +/* 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. + */ +#include +#include +#include +#include + +int dpcon_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpcon_id, + uint16_t *token) +{ + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_OPEN, + cmd_flags, + 0); + DPCON_CMD_OPEN(cmd, dpcon_id); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + *token = MC_CMD_HDR_READ_TOKEN(cmd.header); + + return 0; +} + +int dpcon_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_CLOSE, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +int dpcon_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpcon_cfg *cfg, + uint32_t *obj_id) +{ + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_CREATE, + cmd_flags, + dprc_token); + DPCON_CMD_CREATE(cmd, cfg); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + CMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id); + + return 0; +} + +int dpcon_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_DESTROY, + cmd_flags, + dprc_token); + /* set object id to destroy */ + CMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id); + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +int dpcon_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_ENABLE, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +int dpcon_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_DISABLE, + cmd_flags, + token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +int dpcon_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en) +{ + struct mc_command cmd = { 0 }; + int err; + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_IS_ENABLED, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + DPCON_RSP_IS_ENABLED(cmd, *en); + + return 0; +} + +int dpcon_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_RESET, + cmd_flags, token); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +int dpcon_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpcon_attr *attr) +{ + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPCON_CMDID_GET_ATTR, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + DPCON_RSP_GET_ATTR(cmd, attr); + + return 0; +} + +int dpcon_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver) +{ + struct mc_command cmd = { 0 }; + int err; + + cmd.header = mc_encode_cmd_header(DPCON_CMDID_GET_API_VERSION, + cmd_flags, + 0); + + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + DPCON_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver); + + return 0; +} diff --git a/drivers/bus/fslmc/mc/fsl_dpcon.h b/drivers/bus/fslmc/mc/fsl_dpcon.h new file mode 100644 index 0000000..0ed9db5 --- /dev/null +++ b/drivers/bus/fslmc/mc/fsl_dpcon.h @@ -0,0 +1,238 @@ +/*- + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * BSD LICENSE + * + * 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. + * + * GPL LICENSE SUMMARY + * + * 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_DPCON_H +#define __FSL_DPCON_H + +/* Data Path Concentrator API + * Contains initialization APIs and runtime control APIs for DPCON + */ + +struct fsl_mc_io; + +/** General DPCON macros */ + +/** + * Use it to disable notifications; see dpcon_set_notification() + */ +#define DPCON_INVALID_DPIO_ID (int)(-1) + +/** + * dpcon_open() - Open a control session for the specified object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @dpcon_id: DPCON unique ID + * @token: Returned token; use in subsequent API calls + * + * This function can be used to open a control session for an + * already created object; an object may have been declared in + * the DPL or by calling the dpcon_create() function. + * This function returns a unique authentication token, + * associated with the specific object ID and the specific MC + * portal; this token must be used in all subsequent commands for + * this specific object. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpcon_id, + uint16_t *token); + +/** + * dpcon_close() - Close the control session of the object + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * After this function is called, no further operations are + * allowed on the object without opening a new control session. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * struct dpcon_cfg - Structure representing DPCON configuration + * @num_priorities: Number of priorities for the DPCON channel (1-8) + */ +struct dpcon_cfg { + uint8_t num_priorities; +}; + +/** + * dpcon_create() - Create the DPCON object. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @cfg: Configuration structure + * @obj_id: returned object id + * + * Create the DPCON object, allocate required resources and + * perform required initialization. + * + * The object can be created either by declaring it in the + * DPL file, or by calling this function. + * + * The function accepts an authentication token of a parent + * container that this object should be assigned to. The token + * can be '0' so the object will be assigned to the default container. + * The newly created object can be opened with the returned + * object id and using the container's associated tokens and MC portals. + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_create(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + const struct dpcon_cfg *cfg, + uint32_t *obj_id); + +/** + * dpcon_destroy() - Destroy the DPCON object and release all its resources. + * @mc_io: Pointer to MC portal's I/O object + * @dprc_token: Parent container token; '0' for default container + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @object_id: The object id; it must be a valid id within the container that + * created this object; + * + * The function accepts the authentication token of the parent container that + * created the object (not the one that currently owns the object). The object + * is searched within parent using the provided 'object_id'. + * All tokens to the object must be closed before calling destroy. + * + * Return: '0' on Success; error code otherwise. + */ +int dpcon_destroy(struct fsl_mc_io *mc_io, + uint16_t dprc_token, + uint32_t cmd_flags, + uint32_t object_id); + +/** + * dpcon_enable() - Enable the DPCON + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * Return: '0' on Success; Error code otherwise + */ +int dpcon_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * dpcon_disable() - Disable the DPCON + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * Return: '0' on Success; Error code otherwise + */ +int dpcon_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * dpcon_is_enabled() - Check if the DPCON is enabled. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * @en: Returns '1' if object is enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); + +/** + * dpcon_reset() - Reset the DPCON, returns the object to initial state. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * struct dpcon_attr - Structure representing DPCON attributes + * @id: DPCON object ID + * @qbman_ch_id: Channel ID to be used by dequeue operation + * @num_priorities: Number of priorities for the DPCON channel (1-8) + */ +struct dpcon_attr { + int id; + uint16_t qbman_ch_id; + uint8_t num_priorities; +}; + +/** + * dpcon_get_attributes() - Retrieve DPCON attributes. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPCON object + * @attr: Object's attributes + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + struct dpcon_attr *attr); + +/** + * dpcon_get_api_version() - Get Data Path Concentrator API version + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @major_ver: Major version of data path concentrator API + * @minor_ver: Minor version of data path concentrator API + * + * Return: '0' on Success; Error code otherwise. + */ +int dpcon_get_api_version(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t *major_ver, + uint16_t *minor_ver); + +#endif /* __FSL_DPCON_H */ diff --git a/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h b/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h new file mode 100644 index 0000000..f7f7690 --- /dev/null +++ b/drivers/bus/fslmc/mc/fsl_dpcon_cmd.h @@ -0,0 +1,175 @@ +/*- + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * BSD LICENSE + * + * 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. + * + * GPL LICENSE SUMMARY + * + * 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_DPCON_CMD_H +#define _FSL_DPCON_CMD_H + +/* DPCON Version */ +#define DPCON_VER_MAJOR 3 +#define DPCON_VER_MINOR 2 + +/* Command IDs */ +#define DPCON_CMDID_CLOSE ((0x800 << 4) | (0x1)) +#define DPCON_CMDID_OPEN ((0x808 << 4) | (0x1)) +#define DPCON_CMDID_CREATE ((0x908 << 4) | (0x1)) +#define DPCON_CMDID_DESTROY ((0x988 << 4) | (0x1)) +#define DPCON_CMDID_GET_API_VERSION ((0xa08 << 4) | (0x1)) + +#define DPCON_CMDID_ENABLE ((0x002 << 4) | (0x1)) +#define DPCON_CMDID_DISABLE ((0x003 << 4) | (0x1)) +#define DPCON_CMDID_GET_ATTR ((0x004 << 4) | (0x1)) +#define DPCON_CMDID_RESET ((0x005 << 4) | (0x1)) +#define DPCON_CMDID_IS_ENABLED ((0x006 << 4) | (0x1)) + +#define DPCON_CMDID_SET_IRQ ((0x010 << 4) | (0x1)) +#define DPCON_CMDID_GET_IRQ ((0x011 << 4) | (0x1)) +#define DPCON_CMDID_SET_IRQ_ENABLE ((0x012 << 4) | (0x1)) +#define DPCON_CMDID_GET_IRQ_ENABLE ((0x013 << 4) | (0x1)) +#define DPCON_CMDID_SET_IRQ_MASK ((0x014 << 4) | (0x1)) +#define DPCON_CMDID_GET_IRQ_MASK ((0x015 << 4) | (0x1)) +#define DPCON_CMDID_GET_IRQ_STATUS ((0x016 << 4) | (0x1)) +#define DPCON_CMDID_CLEAR_IRQ_STATUS ((0x017 << 4) | (0x1)) + +#define DPCON_CMDID_SET_NOTIFICATION ((0x100 << 4) | (0x1)) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_OPEN(cmd, dpcon_id) \ + MC_CMD_OP(cmd, 0, 0, 32, int, dpcon_id) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_CREATE(cmd, cfg) \ + MC_CMD_OP(cmd, 0, 0, 8, uint8_t, cfg->num_priorities) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_IS_ENABLED(cmd, en) \ + MC_RSP_OP(cmd, 0, 0, 1, int, en) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_SET_IRQ(cmd, irq_index, irq_cfg) \ +do { \ + MC_CMD_OP(cmd, 0, 0, 8, uint8_t, irq_index);\ + MC_CMD_OP(cmd, 0, 32, 32, uint32_t, irq_cfg->val);\ + MC_CMD_OP(cmd, 1, 0, 64, uint64_t, irq_cfg->addr);\ + MC_CMD_OP(cmd, 2, 0, 32, int, irq_cfg->irq_num); \ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_GET_IRQ(cmd, irq_index) \ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_GET_IRQ(cmd, type, irq_cfg) \ +do { \ + MC_RSP_OP(cmd, 0, 0, 32, uint32_t, irq_cfg->val);\ + MC_RSP_OP(cmd, 1, 0, 64, uint64_t, irq_cfg->addr);\ + MC_RSP_OP(cmd, 2, 0, 32, int, irq_cfg->irq_num); \ + MC_RSP_OP(cmd, 2, 32, 32, int, type);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_SET_IRQ_ENABLE(cmd, irq_index, en) \ +do { \ + MC_CMD_OP(cmd, 0, 0, 8, uint8_t, en); \ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_GET_IRQ_ENABLE(cmd, irq_index) \ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_GET_IRQ_ENABLE(cmd, en) \ + MC_RSP_OP(cmd, 0, 0, 8, uint8_t, en) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_SET_IRQ_MASK(cmd, irq_index, mask) \ +do { \ + MC_CMD_OP(cmd, 0, 0, 32, uint32_t, mask); \ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_GET_IRQ_MASK(cmd, irq_index) \ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_GET_IRQ_MASK(cmd, mask) \ + MC_RSP_OP(cmd, 0, 0, 32, uint32_t, mask) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_GET_IRQ_STATUS(cmd, irq_index, status) \ +do { \ + MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status);\ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_GET_IRQ_STATUS(cmd, status) \ + MC_RSP_OP(cmd, 0, 0, 32, uint32_t, status) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_CLEAR_IRQ_STATUS(cmd, irq_index, status) \ +do { \ + MC_CMD_OP(cmd, 0, 0, 32, uint32_t, status); \ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, irq_index);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_GET_ATTR(cmd, attr) \ +do { \ + MC_RSP_OP(cmd, 0, 0, 32, int, attr->id);\ + MC_RSP_OP(cmd, 0, 32, 16, uint16_t, attr->qbman_ch_id);\ + MC_RSP_OP(cmd, 0, 48, 8, uint8_t, attr->num_priorities);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_CMD_SET_NOTIFICATION(cmd, cfg) \ +do { \ + MC_CMD_OP(cmd, 0, 0, 32, int, cfg->dpio_id);\ + MC_CMD_OP(cmd, 0, 32, 8, uint8_t, cfg->priority);\ + MC_CMD_OP(cmd, 1, 0, 64, uint64_t, cfg->user_ctx);\ +} while (0) + +/* cmd, param, offset, width, type, arg_name */ +#define DPCON_RSP_GET_API_VERSION(cmd, major, minor) \ +do { \ + MC_RSP_OP(cmd, 0, 0, 16, uint16_t, major);\ + MC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\ +} while (0) + +#endif /* _FSL_DPCON_CMD_H */ diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 4c03e67..92a7342 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -53,5 +53,7 @@ DPDK_17.05 { DPDK_17.08 { global: + dpcon_open; + dpcon_get_attributes; rte_fslmc_object_register; } DPDK_17.05; -- 1.9.1