Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbeAPNVK (ORCPT + 1 other); Tue, 16 Jan 2018 08:21:10 -0500 Received: from mail-by2nam01on0080.outbound.protection.outlook.com ([104.47.34.80]:23200 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751319AbeAPNT1 (ORCPT ); Tue, 16 Jan 2018 08:19:27 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=fail action=none header.from=nxp.com; From: Bogdan Purcareata To: , , CC: , , , , , , , , , , , , , Subject: [PATCH 2/8] staging: fsl-mc: Consolidate bus core header files Date: Tue, 16 Jan 2018 15:19:04 +0200 Message-ID: <1516108750-24938-3-git-send-email-bogdan.purcareata@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516108750-24938-1-git-send-email-bogdan.purcareata@nxp.com> References: <1516108750-24938-1-git-send-email-bogdan.purcareata@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605823656093736;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(39380400002)(376002)(396003)(346002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(2906002)(7416002)(305945005)(51416003)(4326008)(39060400002)(104016004)(6636002)(2950100002)(6666003)(356003)(5660300001)(105606002)(8676002)(47776003)(498600001)(50466002)(8936002)(106466001)(68736007)(50226002)(81166006)(81156014)(76176011)(8656006)(54906003)(110136005)(16586007)(48376002)(316002)(36756003)(59450400001)(77096006)(85426001)(53936002)(53946003)(97736004)(49486002)(86362001)(2201001)(575784001)(26005)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB2363;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC012;1:j7OxrlX3iMar5IuhtDsygIoK+OfVEdxXdrZz+Hf2XSF8je+bTD70eAulsHr4fWrLj8/g2wX5a2zYT95irbwgHZGOzxUBqVKuFN6GdeYq7T5x4FOnxJ2UOSb2Sx2kwjg6 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d947f7ab-f86d-41bd-e828-08d55ce3c3db X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(5600026)(4604075)(2017052603307);SRVR:CY1PR03MB2363; X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB2363;3:uGVSWgVKruAfZvKwK3WtnGegX3berPE9kT3sVptVOZVp+SiiybjgiXkrXJQD2sWhICzKY+jaJmXYjhPUJ6rZ1ZimiZLFJpIoCGTpYIrgNbC0Pg+tWk8Ng55DTzXdVi1jvP540bbjW7jRk/4Shc8cuBF54PeRaLZoe012rCRKt0Hr+CdMDqen6nRqz1mlyEzNyM4UFLugBjb3pj+omzNyETfCqKPYLRz1aQL2jID2qlPku47H5/hknTS4Yctfu4mV95JUu/tsWfkji7rNP3BqHr4icbv4oCM96eJSMxuWhmTIVpOoQzJG8C5uQyNQ6dN8foZFHoRQeKM5yC8n5bQ8Wn5SUKvmqDR42+hu4e9BZh8=;25:IBHkZFvuQErjg+pUIdITOoATFavP+7nQlF8DsUqCv+qaJaGBGQZL7bd+LhkBwCWHhVJUv2o32zkZaLZ3Bjj+/FtqXosoB10n6YPqPuWszAoBVawDIL/UJSohVqkhnrxsJZaOZW+LfXrqMAGa88H5EmAGxILG8UiC9+ph1JZvLbp0mklqHPej7zuWA+g/eAnfgf7HqCwqKwmKVS+Re+DCsVEJ+hMD80ll6+J/eDB/LMppeCMphM+cVvOQn2skPZYXplEkOetUJ8rYtVMvvxQnan1ql6MNbXlgdeUHIGfxsBz+DCwwqZhNv9iRsbwKeTkRgdE9SpPqtcZc2DOe9uAKwA== X-MS-TrafficTypeDiagnostic: CY1PR03MB2363: X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB2363;31:RW93UNIymHNHXUDYJ/6Aqe10fPUY3Pnr37vdFJ9ns0moBRvo5TB7W0DGJkX4r6GHcLjvrRxsK68V8koOO/dF0uXgwPsaX0DX1MuzB7EWclELZuGkCMUHH2yS+BdCPh98sBl0Eyh3vbfuF59kpQ+rst0Tikd0t3GoxArgyUuQt6pmoDbR4d9Y7eKlias2XhOTM7GHG6z/yR6oCdHrOxRmSm0nCzTAnFGEvl2VtQuy80E=;4:HFvJCvdmkSg6f5y5a6yFkqEg4zI8xSH80EbXne/P80WwLuhXVGvIvuMEbjulYri6LYgF5eLI6Ab3tl+uHJc45xcTwQwoyBMmAHxmNnQllIZe5/oE+2nx8olnEhuNL0RwoUgc3d2GC6L2vv3Hd3uZTcIRfqz7B2ePycsqO6PUvOxobXBOFCjyI6KJIvHdOi0iUQNFCo22tF2htg1+WDFzgPhhqmp6p7sFhNl5Ii1EeJvpt4H0oqngcDg6w8QrEYK6OoGVR4nq/DWpvtYaHcHduECr9oC2mJc7vK4ULUR7A+NyD15b8cMdAdTGYvg4HFQMPyZURx6nUz1Lzg42op78FotvqleaKxdGFVWxO+O6W9mMpkqsInoR9nmejPtyKcHQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(944501161)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123565025)(20161123563025)(20161123561025)(20161123556025)(201708071742011);SRVR:CY1PR03MB2363;BCL:0;PCL:0;RULEID:(100000803101)(100110400095)(400006);SRVR:CY1PR03MB2363; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR03MB2363;23:J3/nh+avv40a7HAsXLM4HdM7XRb90eMQmjeFcP/1P?= =?us-ascii?Q?2yuInVviR4+kYJCIGUUVq0OGarJk7PFF8d7UiOMlFMqbP5QYmcupSXmII3N0?= =?us-ascii?Q?FQe4mHk+8KJ9vC3OxzmAUDnS/kk/2kwDZqOraY8f53NS2r5hwm2urc4Feyh9?= =?us-ascii?Q?Xkrfg5jVhXZPz/2XU/T5iF69MtM5lBHGS9qQ3wtRTpWCZopZMhDpp7u+pp4m?= =?us-ascii?Q?Jc/+iWVpGeoE0uIu6DHem+rY98m5R3Fwd2uUPMt3+HjAjOyqqHLEZB2Gl3N/?= =?us-ascii?Q?/Di8X0EglYkhXP36xz7MD+h97DS6087fFCnHCwxxW8nynG7AHud/CJ5Au+Du?= =?us-ascii?Q?7iQycJiYZ4J9efQNTz3Rni6UTYX3IpDVBhF5BcIpr7n4s4v5yVL1zguZf68N?= =?us-ascii?Q?ysQxrgS1tWIU2lWxjkY8UwJWWxIMBxsmh2tFNYTTjmetNuipfOGUbFE0ATX1?= =?us-ascii?Q?7LLt/WnloQy1sNRo4tzw+QVik5BFAHTPEL5eCjDOfaeqXVFCY4YtUDiD13Qi?= =?us-ascii?Q?IQCbwTgigHiAsTbslio/JcZ4DSTXeh4zsjv8wg/odSfnI6YJNTAPnOXjuiFd?= =?us-ascii?Q?AhRkJd4PMJHJ372TF2bcd71X930/IZ68n4efW+kg4DRRcTHLe37tzJ1Nmk6X?= =?us-ascii?Q?OBte7rfHVAvPFWvHTgBxsov687RVk5IKTpLLBe2iNE1u9b9hQM3LLaE38krV?= =?us-ascii?Q?0xN9CZkMbPj3ZZbFykMmjgun0hIzmKLyhOBdOXicHHH7PKVp0PRKeL2TpRCY?= =?us-ascii?Q?VOqVgGeWSZpcFN/TE+LiI6Q/eH+35el1OFx6BMwY1TANBE7TJ1PZE4XjxW1+?= =?us-ascii?Q?VHJ7h8lURHD4w26AoquKtl3iqxG3WWN2/d1RdRCiG6FV9BCW7MFR+QyC0g0i?= =?us-ascii?Q?4ZGb13R49/jP/icCevq7bO0lP+J8PAeRas92Wf+zZVvJNXH0b/q7xqi6cXkb?= =?us-ascii?Q?iP3F/7CZxrUW90T2pN0TiUbf3Th9NIlpBPX+4V5pybZajCpoebmO0RAzW5Ul?= =?us-ascii?Q?AH+Qe/tai/rnAJ8I+Y89feevvW0zwyYAwE9n65Q1kbNXkPIDU7x+WjPTVb21?= =?us-ascii?Q?mDkeQsjCwX1GVZgehZZXRQp+y/QW2n4ErKjlG/FOMPp9kGvpS+3l3VXhkE7C?= =?us-ascii?Q?+1Y8JV3b6WP0VHBBn+a2mSpVkc0Dg1Bk+Qlv1GdZjilBjM/1Df310jcdshsd?= =?us-ascii?Q?k7Wd3DaYrL98htuHS7wwcypJ/gr3vb1KBZB6LkhlESdYbw4wN5ohsARwBnS3?= =?us-ascii?Q?SKjhEl1XgrwjeRX51Z8A1Yh16KPnLsrRDp+He+M?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB2363;6:Q5s4kzkDNPOe5NWnu7+SsF6mY3Qsthe7/03SYSU1zxtJ60GcPD47jpybETKh3mqMpgdKzsZucZ/3e/OBvhW9p/w0jL97GrqC749Ts9veJB/hDw6N3TYRvQrA8JOBaWrBxO0BLXpsQi/z/Tyf06V/IxHIVstB3HHtLv9/sa+RAcNwRsxmN6bWw+a0bHZgwlOuMkRrvUjF+ttu+3j1oYNEzTsZc1MBRAC0mnsQkjnEJvIyV5kb9vzYQD1VI7EUEebJze/mPuj593M/GwdRB1zhg8pnRFuF9/NaHDATHnvciJKE1ic7UvOXr/FjaCul1ds42p/bkEElTkKJimO5jda7MlS8F6gTy/hMcLMdmv3d528=;5:WVYNjERSb4vPW0sNMeneZ77/e1VM2vg1GZI3MrUmQGeUnsuOpiYpVBhSCp8xNuDIq2KJiC4fbTlMea4+gp3dM+rEaNpBCvrB2DddUg/TRN/XUaGObnPFHxRrSDoEDC5PgFS+kpa+4Tb5YxOOx2xfz1+ibGHPYyMfQ9IvOBwTD6Y=;24:I5mamCEHBDkO53YZeR2nw6HObsKh0aA53NKnbPRKIGzgVMXW12xfYJnHzMJl0B2nYhpjtjicvkOdl1cPgeo8YFKEIRCPQJvdrfcd7Tj+O8w=;7:HawZ7WSy4ZkLDJnj2+dthNSjxTXmqGrPOp5i959ux0Kkau0SMTJRj7YQq43Likdzfgs1gxJd47kPW0yyQF7tIbAywCnSoM4haO3rlVuJ0zXigBp3rV86VTC2wEtlE++2qmk9NOJtg4BmoTc/ElW1m+UzhWpJ+0DlYjDL124Yscg96K5b1Gt24ULkXcgSlqMtZUt20b8J5JCwvtFAAidapl2M4GG0m/uULFGPMz5Ww+NWKOCSpmEWZxxzW+COYJqG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 13:19:25.3129 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d947f7ab-f86d-41bd-e828-08d55ce3c3db 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: CY1PR03MB2363 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: The DPAA2 objects involved (DPMNG, DPMCP, DPRC) are used by the fsl-mc bus infrastructure only, so group the APIs and structs into fsl-mc-private.h. Signed-off-by: Bogdan Purcareata Reviewed-by: Laurentiu Tudor --- drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 54 ---- drivers/staging/fsl-mc/bus/dpmcp.c | 3 +- drivers/staging/fsl-mc/bus/dpmcp.h | 55 ----- drivers/staging/fsl-mc/bus/dpmng-cmd.h | 58 ----- drivers/staging/fsl-mc/bus/dprc-cmd.h | 188 -------------- drivers/staging/fsl-mc/bus/dprc-driver.c | 1 - drivers/staging/fsl-mc/bus/dprc.c | 4 +- drivers/staging/fsl-mc/bus/dprc.h | 203 --------------- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 2 - drivers/staging/fsl-mc/bus/fsl-mc-private.h | 369 +++++++++++++++++++++++++++- drivers/staging/fsl-mc/bus/mc-io.c | 2 - drivers/staging/fsl-mc/bus/mc-sys.c | 2 +- 12 files changed, 371 insertions(+), 570 deletions(-) delete mode 100644 drivers/staging/fsl-mc/bus/dpmcp-cmd.h delete mode 100644 drivers/staging/fsl-mc/bus/dpmcp.h delete mode 100644 drivers/staging/fsl-mc/bus/dpmng-cmd.h delete mode 100644 drivers/staging/fsl-mc/bus/dprc-cmd.h delete mode 100644 drivers/staging/fsl-mc/bus/dprc.h diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h deleted file mode 100644 index 60fff6f..0000000 --- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the above-listed copyright holders nor the - * names of any contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef _FSL_DPMCP_CMD_H -#define _FSL_DPMCP_CMD_H - -/* Minimal supported DPMCP Version */ -#define DPMCP_MIN_VER_MAJOR 3 -#define DPMCP_MIN_VER_MINOR 0 - -/* Command versioning */ -#define DPMCP_CMD_BASE_VERSION 1 -#define DPMCP_CMD_ID_OFFSET 4 - -#define DPMCP_CMD(id) (((id) << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION) - -/* Command IDs */ -#define DPMCP_CMDID_CLOSE DPMCP_CMD(0x800) -#define DPMCP_CMDID_OPEN DPMCP_CMD(0x80b) -#define DPMCP_CMDID_RESET DPMCP_CMD(0x005) - -struct dpmcp_cmd_open { - __le32 dpmcp_id; -}; - -#endif /* _FSL_DPMCP_CMD_H */ diff --git a/drivers/staging/fsl-mc/bus/dpmcp.c b/drivers/staging/fsl-mc/bus/dpmcp.c index 2989cc4..63b967c 100644 --- a/drivers/staging/fsl-mc/bus/dpmcp.c +++ b/drivers/staging/fsl-mc/bus/dpmcp.c @@ -32,8 +32,7 @@ #include #include "../include/mc.h" -#include "dpmcp.h" -#include "dpmcp-cmd.h" +#include "fsl-mc-private.h" /** * dpmcp_open() - Open a control session for the specified object. diff --git a/drivers/staging/fsl-mc/bus/dpmcp.h b/drivers/staging/fsl-mc/bus/dpmcp.h deleted file mode 100644 index 873a4d0..0000000 --- a/drivers/staging/fsl-mc/bus/dpmcp.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the above-listed copyright holders nor the - * names of any contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef __FSL_DPMCP_H -#define __FSL_DPMCP_H - -/* - * Data Path Management Command Portal API - * Contains initialization APIs and runtime control APIs for DPMCP - */ - -struct fsl_mc_io; - -int dpmcp_open(struct fsl_mc_io *mc_io, - u32 cmd_flags, - int dpmcp_id, - u16 *token); - -int dpmcp_close(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token); - -int dpmcp_reset(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token); - -#endif /* __FSL_DPMCP_H */ diff --git a/drivers/staging/fsl-mc/bus/dpmng-cmd.h b/drivers/staging/fsl-mc/bus/dpmng-cmd.h deleted file mode 100644 index d1f04ac..0000000 --- a/drivers/staging/fsl-mc/bus/dpmng-cmd.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the above-listed copyright holders nor the - * names of any contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * dpmng-cmd.h - * - * defines portal commands - * - */ - -#ifndef __FSL_DPMNG_CMD_H -#define __FSL_DPMNG_CMD_H - -/* Command versioning */ -#define DPMNG_CMD_BASE_VERSION 1 -#define DPMNG_CMD_ID_OFFSET 4 - -#define DPMNG_CMD(id) (((id) << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION) - -/* Command IDs */ -#define DPMNG_CMDID_GET_VERSION DPMNG_CMD(0x831) - -struct dpmng_rsp_get_version { - __le32 revision; - __le32 version_major; - __le32 version_minor; -}; - -#endif /* __FSL_DPMNG_CMD_H */ diff --git a/drivers/staging/fsl-mc/bus/dprc-cmd.h b/drivers/staging/fsl-mc/bus/dprc-cmd.h deleted file mode 100644 index ab13175..0000000 --- a/drivers/staging/fsl-mc/bus/dprc-cmd.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the above-listed copyright holders nor the - * names of any contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * dprc-cmd.h - * - * defines dprc portal commands - * - */ - -#ifndef _FSL_DPRC_CMD_H -#define _FSL_DPRC_CMD_H - -/* Minimal supported DPRC Version */ -#define DPRC_MIN_VER_MAJOR 6 -#define DPRC_MIN_VER_MINOR 0 - -/* Command versioning */ -#define DPRC_CMD_BASE_VERSION 1 -#define DPRC_CMD_ID_OFFSET 4 - -#define DPRC_CMD(id) (((id) << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION) - -/* Command IDs */ -#define DPRC_CMDID_CLOSE DPRC_CMD(0x800) -#define DPRC_CMDID_OPEN DPRC_CMD(0x805) -#define DPRC_CMDID_GET_API_VERSION DPRC_CMD(0xa05) - -#define DPRC_CMDID_GET_ATTR DPRC_CMD(0x004) - -#define DPRC_CMDID_SET_IRQ DPRC_CMD(0x010) -#define DPRC_CMDID_SET_IRQ_ENABLE DPRC_CMD(0x012) -#define DPRC_CMDID_SET_IRQ_MASK DPRC_CMD(0x014) -#define DPRC_CMDID_GET_IRQ_STATUS DPRC_CMD(0x016) -#define DPRC_CMDID_CLEAR_IRQ_STATUS DPRC_CMD(0x017) - -#define DPRC_CMDID_GET_CONT_ID DPRC_CMD(0x830) -#define DPRC_CMDID_GET_OBJ_COUNT DPRC_CMD(0x159) -#define DPRC_CMDID_GET_OBJ DPRC_CMD(0x15A) -#define DPRC_CMDID_GET_OBJ_REG DPRC_CMD(0x15E) -#define DPRC_CMDID_SET_OBJ_IRQ DPRC_CMD(0x15F) - -struct dprc_cmd_open { - __le32 container_id; -}; - -struct dprc_cmd_set_irq { - /* cmd word 0 */ - __le32 irq_val; - u8 irq_index; - u8 pad[3]; - /* cmd word 1 */ - __le64 irq_addr; - /* cmd word 2 */ - __le32 irq_num; -}; - -#define DPRC_ENABLE 0x1 - -struct dprc_cmd_set_irq_enable { - u8 enable; - u8 pad[3]; - u8 irq_index; -}; - -struct dprc_cmd_set_irq_mask { - __le32 mask; - u8 irq_index; -}; - -struct dprc_cmd_get_irq_status { - __le32 status; - u8 irq_index; -}; - -struct dprc_rsp_get_irq_status { - __le32 status; -}; - -struct dprc_cmd_clear_irq_status { - __le32 status; - u8 irq_index; -}; - -struct dprc_rsp_get_attributes { - /* response word 0 */ - __le32 container_id; - __le16 icid; - __le16 pad; - /* response word 1 */ - __le32 options; - __le32 portal_id; -}; - -struct dprc_rsp_get_obj_count { - __le32 pad; - __le32 obj_count; -}; - -struct dprc_cmd_get_obj { - __le32 obj_index; -}; - -struct dprc_rsp_get_obj { - /* response word 0 */ - __le32 pad0; - __le32 id; - /* response word 1 */ - __le16 vendor; - u8 irq_count; - u8 region_count; - __le32 state; - /* response word 2 */ - __le16 version_major; - __le16 version_minor; - __le16 flags; - __le16 pad1; - /* response word 3-4 */ - u8 type[16]; - /* response word 5-6 */ - u8 label[16]; -}; - -struct dprc_cmd_get_obj_region { - /* cmd word 0 */ - __le32 obj_id; - __le16 pad0; - u8 region_index; - u8 pad1; - /* cmd word 1-2 */ - __le64 pad2[2]; - /* cmd word 3-4 */ - u8 obj_type[16]; -}; - -struct dprc_rsp_get_obj_region { - /* response word 0 */ - __le64 pad; - /* response word 1 */ - __le64 base_addr; - /* response word 2 */ - __le32 size; -}; - -struct dprc_cmd_set_obj_irq { - /* cmd word 0 */ - __le32 irq_val; - u8 irq_index; - u8 pad[3]; - /* cmd word 1 */ - __le64 irq_addr; - /* cmd word 2 */ - __le32 irq_num; - __le32 obj_id; - /* cmd word 3-4 */ - u8 obj_type[16]; -}; - -#endif /* _FSL_DPRC_CMD_H */ diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index c449e74..638a2dc 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -15,7 +15,6 @@ #include #include "../include/mc.h" -#include "dprc-cmd.h" #include "fsl-mc-private.h" #define FSL_MC_DPRC_DRIVER_NAME "fsl_mc_dprc" diff --git a/drivers/staging/fsl-mc/bus/dprc.c b/drivers/staging/fsl-mc/bus/dprc.c index 094f151..093a464 100644 --- a/drivers/staging/fsl-mc/bus/dprc.c +++ b/drivers/staging/fsl-mc/bus/dprc.c @@ -31,9 +31,7 @@ */ #include #include "../include/mc.h" -#include "dprc.h" - -#include "dprc-cmd.h" +#include "fsl-mc-private.h" /** * dprc_open() - Open DPRC object for use diff --git a/drivers/staging/fsl-mc/bus/dprc.h b/drivers/staging/fsl-mc/bus/dprc.h deleted file mode 100644 index 1fd0df8..0000000 --- a/drivers/staging/fsl-mc/bus/dprc.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2013-2016 Freescale Semiconductor Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the above-listed copyright holders nor the - * names of any contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef _FSL_DPRC_H -#define _FSL_DPRC_H - -/* - * Data Path Resource Container API - * Contains DPRC API for managing and querying DPAA resources - */ - -struct fsl_mc_io; -struct fsl_mc_obj_desc; - -int dprc_open(struct fsl_mc_io *mc_io, - u32 cmd_flags, - int container_id, - u16 *token); - -int dprc_close(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token); - -/* DPRC IRQ events */ - -/* IRQ event - Indicates that a new object added to the container */ -#define DPRC_IRQ_EVENT_OBJ_ADDED 0x00000001 -/* IRQ event - Indicates that an object was removed from the container */ -#define DPRC_IRQ_EVENT_OBJ_REMOVED 0x00000002 -/* - * IRQ event - Indicates that one of the descendant containers that opened by - * this container is destroyed - */ -#define DPRC_IRQ_EVENT_CONTAINER_DESTROYED 0x00000010 - -/* - * IRQ event - Indicates that on one of the container's opened object is - * destroyed - */ -#define DPRC_IRQ_EVENT_OBJ_DESTROYED 0x00000020 - -/* Irq event - Indicates that object is created at the container */ -#define DPRC_IRQ_EVENT_OBJ_CREATED 0x00000040 - -/** - * struct dprc_irq_cfg - IRQ configuration - * @paddr: Address that must be written to signal a message-based interrupt - * @val: Value to write into irq_addr address - * @irq_num: A user defined number associated with this IRQ - */ -struct dprc_irq_cfg { - phys_addr_t paddr; - u32 val; - int irq_num; -}; - -int dprc_set_irq(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - u8 irq_index, - struct dprc_irq_cfg *irq_cfg); - -int dprc_set_irq_enable(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - u8 irq_index, - u8 en); - -int dprc_set_irq_mask(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - u8 irq_index, - u32 mask); - -int dprc_get_irq_status(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - u8 irq_index, - u32 *status); - -int dprc_clear_irq_status(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - u8 irq_index, - u32 status); - -/** - * struct dprc_attributes - Container attributes - * @container_id: Container's ID - * @icid: Container's ICID - * @portal_id: Container's portal ID - * @options: Container's options as set at container's creation - */ -struct dprc_attributes { - int container_id; - u16 icid; - int portal_id; - u64 options; -}; - -int dprc_get_attributes(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - struct dprc_attributes *attributes); - -int dprc_get_obj_count(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - int *obj_count); - -int dprc_get_obj(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - int obj_index, - struct fsl_mc_obj_desc *obj_desc); - -int dprc_set_obj_irq(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - char *obj_type, - int obj_id, - u8 irq_index, - struct dprc_irq_cfg *irq_cfg); - -/* Region flags */ -/* Cacheable - Indicates that region should be mapped as cacheable */ -#define DPRC_REGION_CACHEABLE 0x00000001 - -/** - * enum dprc_region_type - Region type - * @DPRC_REGION_TYPE_MC_PORTAL: MC portal region - * @DPRC_REGION_TYPE_QBMAN_PORTAL: Qbman portal region - */ -enum dprc_region_type { - DPRC_REGION_TYPE_MC_PORTAL, - DPRC_REGION_TYPE_QBMAN_PORTAL -}; - -/** - * struct dprc_region_desc - Mappable region descriptor - * @base_offset: Region offset from region's base address. - * For DPMCP and DPRC objects, region base is offset from SoC MC portals - * base address; For DPIO, region base is offset from SoC QMan portals - * base address - * @size: Region size (in bytes) - * @flags: Region attributes - * @type: Portal region type - */ -struct dprc_region_desc { - u32 base_offset; - u32 size; - u32 flags; - enum dprc_region_type type; -}; - -int dprc_get_obj_region(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 token, - char *obj_type, - int obj_id, - u8 region_index, - struct dprc_region_desc *region_desc); - -int dprc_get_api_version(struct fsl_mc_io *mc_io, - u32 cmd_flags, - u16 *major_ver, - u16 *minor_ver); - -int dprc_get_container_id(struct fsl_mc_io *mc_io, - u32 cmd_flags, - int *container_id); - -#endif /* _FSL_DPRC_H */ - diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 664cc8c..e7de8c5 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -22,8 +22,6 @@ #include #include "fsl-mc-private.h" -#include "dprc-cmd.h" -#include "dpmng-cmd.h" /** * Default DMA mask for devices on a fsl-mc bus diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-private.h b/drivers/staging/fsl-mc/bus/fsl-mc-private.h index 62d3989..ba31f90 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-private.h +++ b/drivers/staging/fsl-mc/bus/fsl-mc-private.h @@ -11,9 +11,376 @@ #define _FSL_MC_PRIVATE_H_ #include "../include/mc.h" -#include "dprc.h" #include +/* + * Data Path Management Complex (DPMNG) General API + */ + +/* DPMNG command versioning */ +#define DPMNG_CMD_BASE_VERSION 1 +#define DPMNG_CMD_ID_OFFSET 4 + +#define DPMNG_CMD(id) (((id) << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION) + +/* DPMNG command IDs */ +#define DPMNG_CMDID_GET_VERSION DPMNG_CMD(0x831) + +struct dpmng_rsp_get_version { + __le32 revision; + __le32 version_major; + __le32 version_minor; +}; + +/* + * Data Path Management Command Portal (DPMCP) API + */ + +/* Minimal supported DPMCP Version */ +#define DPMCP_MIN_VER_MAJOR 3 +#define DPMCP_MIN_VER_MINOR 0 + +/* DPMCP command versioning */ +#define DPMCP_CMD_BASE_VERSION 1 +#define DPMCP_CMD_ID_OFFSET 4 + +#define DPMCP_CMD(id) (((id) << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION) + +/* DPMCP command IDs */ +#define DPMCP_CMDID_CLOSE DPMCP_CMD(0x800) +#define DPMCP_CMDID_OPEN DPMCP_CMD(0x80b) +#define DPMCP_CMDID_RESET DPMCP_CMD(0x005) + +struct dpmcp_cmd_open { + __le32 dpmcp_id; +}; + +/* + * Initialization and runtime control APIs for DPMCP + */ +int dpmcp_open(struct fsl_mc_io *mc_io, + u32 cmd_flags, + int dpmcp_id, + u16 *token); + +int dpmcp_close(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token); + +int dpmcp_reset(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token); + +/* + * Data Path Resource Container (DPRC) API + */ + +/* Minimal supported DPRC Version */ +#define DPRC_MIN_VER_MAJOR 6 +#define DPRC_MIN_VER_MINOR 0 + +/* DPRC command versioning */ +#define DPRC_CMD_BASE_VERSION 1 +#define DPRC_CMD_ID_OFFSET 4 + +#define DPRC_CMD(id) (((id) << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION) + +/* DPRC command IDs */ +#define DPRC_CMDID_CLOSE DPRC_CMD(0x800) +#define DPRC_CMDID_OPEN DPRC_CMD(0x805) +#define DPRC_CMDID_GET_API_VERSION DPRC_CMD(0xa05) + +#define DPRC_CMDID_GET_ATTR DPRC_CMD(0x004) + +#define DPRC_CMDID_SET_IRQ DPRC_CMD(0x010) +#define DPRC_CMDID_SET_IRQ_ENABLE DPRC_CMD(0x012) +#define DPRC_CMDID_SET_IRQ_MASK DPRC_CMD(0x014) +#define DPRC_CMDID_GET_IRQ_STATUS DPRC_CMD(0x016) +#define DPRC_CMDID_CLEAR_IRQ_STATUS DPRC_CMD(0x017) + +#define DPRC_CMDID_GET_CONT_ID DPRC_CMD(0x830) +#define DPRC_CMDID_GET_OBJ_COUNT DPRC_CMD(0x159) +#define DPRC_CMDID_GET_OBJ DPRC_CMD(0x15A) +#define DPRC_CMDID_GET_OBJ_REG DPRC_CMD(0x15E) +#define DPRC_CMDID_SET_OBJ_IRQ DPRC_CMD(0x15F) + +struct dprc_cmd_open { + __le32 container_id; +}; + +struct dprc_cmd_set_irq { + /* cmd word 0 */ + __le32 irq_val; + u8 irq_index; + u8 pad[3]; + /* cmd word 1 */ + __le64 irq_addr; + /* cmd word 2 */ + __le32 irq_num; +}; + +#define DPRC_ENABLE 0x1 + +struct dprc_cmd_set_irq_enable { + u8 enable; + u8 pad[3]; + u8 irq_index; +}; + +struct dprc_cmd_set_irq_mask { + __le32 mask; + u8 irq_index; +}; + +struct dprc_cmd_get_irq_status { + __le32 status; + u8 irq_index; +}; + +struct dprc_rsp_get_irq_status { + __le32 status; +}; + +struct dprc_cmd_clear_irq_status { + __le32 status; + u8 irq_index; +}; + +struct dprc_rsp_get_attributes { + /* response word 0 */ + __le32 container_id; + __le16 icid; + __le16 pad; + /* response word 1 */ + __le32 options; + __le32 portal_id; +}; + +struct dprc_rsp_get_obj_count { + __le32 pad; + __le32 obj_count; +}; + +struct dprc_cmd_get_obj { + __le32 obj_index; +}; + +struct dprc_rsp_get_obj { + /* response word 0 */ + __le32 pad0; + __le32 id; + /* response word 1 */ + __le16 vendor; + u8 irq_count; + u8 region_count; + __le32 state; + /* response word 2 */ + __le16 version_major; + __le16 version_minor; + __le16 flags; + __le16 pad1; + /* response word 3-4 */ + u8 type[16]; + /* response word 5-6 */ + u8 label[16]; +}; + +struct dprc_cmd_get_obj_region { + /* cmd word 0 */ + __le32 obj_id; + __le16 pad0; + u8 region_index; + u8 pad1; + /* cmd word 1-2 */ + __le64 pad2[2]; + /* cmd word 3-4 */ + u8 obj_type[16]; +}; + +struct dprc_rsp_get_obj_region { + /* response word 0 */ + __le64 pad; + /* response word 1 */ + __le64 base_addr; + /* response word 2 */ + __le32 size; +}; + +struct dprc_cmd_set_obj_irq { + /* cmd word 0 */ + __le32 irq_val; + u8 irq_index; + u8 pad[3]; + /* cmd word 1 */ + __le64 irq_addr; + /* cmd word 2 */ + __le32 irq_num; + __le32 obj_id; + /* cmd word 3-4 */ + u8 obj_type[16]; +}; + +/* + * DPRC API for managing and querying DPAA resources + */ +int dprc_open(struct fsl_mc_io *mc_io, + u32 cmd_flags, + int container_id, + u16 *token); + +int dprc_close(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token); + +/* DPRC IRQ events */ + +/* IRQ event - Indicates that a new object added to the container */ +#define DPRC_IRQ_EVENT_OBJ_ADDED 0x00000001 +/* IRQ event - Indicates that an object was removed from the container */ +#define DPRC_IRQ_EVENT_OBJ_REMOVED 0x00000002 +/* + * IRQ event - Indicates that one of the descendant containers that opened by + * this container is destroyed + */ +#define DPRC_IRQ_EVENT_CONTAINER_DESTROYED 0x00000010 + +/* + * IRQ event - Indicates that on one of the container's opened object is + * destroyed + */ +#define DPRC_IRQ_EVENT_OBJ_DESTROYED 0x00000020 + +/* Irq event - Indicates that object is created at the container */ +#define DPRC_IRQ_EVENT_OBJ_CREATED 0x00000040 + +/** + * struct dprc_irq_cfg - IRQ configuration + * @paddr: Address that must be written to signal a message-based interrupt + * @val: Value to write into irq_addr address + * @irq_num: A user defined number associated with this IRQ + */ +struct dprc_irq_cfg { + phys_addr_t paddr; + u32 val; + int irq_num; +}; + +int dprc_set_irq(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + u8 irq_index, + struct dprc_irq_cfg *irq_cfg); + +int dprc_set_irq_enable(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + u8 irq_index, + u8 en); + +int dprc_set_irq_mask(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + u8 irq_index, + u32 mask); + +int dprc_get_irq_status(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + u8 irq_index, + u32 *status); + +int dprc_clear_irq_status(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + u8 irq_index, + u32 status); + +/** + * struct dprc_attributes - Container attributes + * @container_id: Container's ID + * @icid: Container's ICID + * @portal_id: Container's portal ID + * @options: Container's options as set at container's creation + */ +struct dprc_attributes { + int container_id; + u16 icid; + int portal_id; + u64 options; +}; + +int dprc_get_attributes(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + struct dprc_attributes *attributes); + +int dprc_get_obj_count(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + int *obj_count); + +int dprc_get_obj(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + int obj_index, + struct fsl_mc_obj_desc *obj_desc); + +int dprc_set_obj_irq(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + char *obj_type, + int obj_id, + u8 irq_index, + struct dprc_irq_cfg *irq_cfg); + +/* Region flags */ +/* Cacheable - Indicates that region should be mapped as cacheable */ +#define DPRC_REGION_CACHEABLE 0x00000001 + +/** + * enum dprc_region_type - Region type + * @DPRC_REGION_TYPE_MC_PORTAL: MC portal region + * @DPRC_REGION_TYPE_QBMAN_PORTAL: Qbman portal region + */ +enum dprc_region_type { + DPRC_REGION_TYPE_MC_PORTAL, + DPRC_REGION_TYPE_QBMAN_PORTAL +}; + +/** + * struct dprc_region_desc - Mappable region descriptor + * @base_offset: Region offset from region's base address. + * For DPMCP and DPRC objects, region base is offset from SoC MC portals + * base address; For DPIO, region base is offset from SoC QMan portals + * base address + * @size: Region size (in bytes) + * @flags: Region attributes + * @type: Portal region type + */ +struct dprc_region_desc { + u32 base_offset; + u32 size; + u32 flags; + enum dprc_region_type type; +}; + +int dprc_get_obj_region(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 token, + char *obj_type, + int obj_id, + u8 region_index, + struct dprc_region_desc *region_desc); + +int dprc_get_api_version(struct fsl_mc_io *mc_io, + u32 cmd_flags, + u16 *major_ver, + u16 *minor_ver); + +int dprc_get_container_id(struct fsl_mc_io *mc_io, + u32 cmd_flags, + int *container_id); + /** * Maximum number of total IRQs that can be pre-allocated for an MC bus' * IRQ pool diff --git a/drivers/staging/fsl-mc/bus/mc-io.c b/drivers/staging/fsl-mc/bus/mc-io.c index 3cbf92d..563cf22 100644 --- a/drivers/staging/fsl-mc/bus/mc-io.c +++ b/drivers/staging/fsl-mc/bus/mc-io.c @@ -34,8 +34,6 @@ #include "../include/mc.h" #include "fsl-mc-private.h" -#include "dpmcp.h" -#include "dpmcp-cmd.h" static int fsl_mc_io_set_dpmcp(struct fsl_mc_io *mc_io, struct fsl_mc_device *dpmcp_dev) diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c b/drivers/staging/fsl-mc/bus/mc-sys.c index db3636d..147214a 100644 --- a/drivers/staging/fsl-mc/bus/mc-sys.c +++ b/drivers/staging/fsl-mc/bus/mc-sys.c @@ -40,7 +40,7 @@ #include #include "../include/mc.h" -#include "dpmcp.h" +#include "fsl-mc-private.h" /** * Timeout in milliseconds to wait for the completion of an MC command -- 2.7.4