From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932174AbbIWV0a (ORCPT ); Wed, 23 Sep 2015 17:26:30 -0400 Received: from mail-bl2on0139.outbound.protection.outlook.com ([65.55.169.139]:44919 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753386AbbIWVZM (ORCPT ); Wed, 23 Sep 2015 17:25:12 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; From: "J. German Rivera" To: , , , CC: , , , , , , , , , , , "J. German Rivera" Subject: [PATCH v3 3/6] staging: fsl-mc: up-rev dpbp binary interface to v2.0 Date: Wed, 23 Sep 2015 16:11:00 -0500 Message-ID: <1443042663-21580-4-git-send-email-German.Rivera@freescale.com> X-Mailer: git-send-email 2.3.3 In-Reply-To: <1443042663-21580-1-git-send-email-German.Rivera@freescale.com> References: <1443042663-21580-1-git-send-email-German.Rivera@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD012;1:Sp0soBYYrGeIip1NB2lcwwqN1AHxO7W7GnJm2v2GRtK7J7FzEa20hMPUv5wtihxKgTKqLz3b/xFd4eTILHOdHs6kW05bDHn9UQyAIv9KTLjVYdUwowiWSulnBSs1/PVGpqK/7hPycNRddv/RjfGVt3oJ4gc17Vilz5GDd1G5gNw6NonkgH6Ox9hrw/8gKrGTOPHcVoQ8MEBLEePeY43EwiZiyBZn0k7vD682V7hECM0Gr40wBnrF20uT+pd75kc52ZAQz+XrP90QlMsmKkF4AD6+ypGSKPcHMNy3NC79nXhcU4rKHxCC/mC7FTd47lKbPTYQ4puRzJ0akuNH5M3BKwD9k8kON02CJYTxowj+7Z7/tpGFZNo31SYsC1LQ/Ny1i5YgzKl0Uq/umbLK9Lxp3A== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(45074003)(189002)(199003)(106466001)(50986999)(19580405001)(92566002)(189998001)(105606002)(36756003)(229853001)(76176999)(107886002)(5001960100002)(68736005)(5003940100001)(62966003)(5007970100001)(6806005)(77156002)(104016004)(77096005)(11100500001)(50226001)(48376002)(50466002)(86362001)(47776003)(87936001)(19580395003)(2201001)(46102003)(97736004)(5001830100001)(81156007)(5001860100001)(64706001)(2950100001)(5001770100001)(85426001)(4001540100001)(4001430100001)(473944003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR0301MB1304;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY1PR0301MB1304;2:yVWTJ+83SNaUrBCEHlFkk5B3m5YdrbO9mfgkaFer8ikOKHlFR2kntCjKISV8gdnahfKfwcAx5LxWmuOIJqGSFL21IDtgxhnbCFSnKmDsLa5ydSL5Jq/itAvFPc3a3YqCyflim5M3d40PwIvQD8+owdJlIXULm5xPOOazyZDis9I=;3:UxWQ10Lmkku9F4upK3XDnwVntTnYUt6rW1VU66K/lNkYLFuVbpripgYB3Ng8F2UMvIqDbOC82ZZf6V+GsnZB4lHvDDZVtwblQEIN3KEecwo/B9swvSgkTIFaWssR+qIVvsLz45C7awS/OKb370QBSNu6DvxolPz4Ztv81WD5ItNABm4FGqEWkTAWl4nuEv3nxCcAlusn807qMRdHriJ2lFa/DKQNOtrc+LdfU3AntEw=;25:5W8erJ6rBEXXZvwgNbS/+x/pFu/jsloMCYL/h+pD/rhRMkGY8oqD8M0Aje1Z04GcunbUP/04k+pRfAnJ21U6CxF+g1tVuLe7GFo4QM3dzjbb4ZZT4ta3mA1ZLh5KEWPFm291dHv05Jw091PQS0NoLgLjNO+hPsCLW3CXr0Zs0CkJeqKEDiGIZg4fZKxdyAlkc0EemGgbu6hFqn+ymBDT8hXqQ+kZllJOvBmV0HdsKfv7ma4OEF7p4V5MnIiOf5Rv X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1304; X-Microsoft-Exchange-Diagnostics: 1;BY1PR0301MB1304;20:qluQH3CmkbTikbUfQ3TawvfQDwRSpd2ejk5Aw26qUhCej2YQUlK1WyE8w3eIIFnHyAy88ymWw73cnlqUfbHIcwXv16SFOIMoIERgHMjxM8OjolVtfJX8lR58zS1zLOX2LrT66oblAky1IsHb6+aqOW0mfqI56dpgzA5tIEi3XM9G+0sqbjEwr2M1Ef3o6RkVbRSfuhFTiUejckDzz7uqcQhOCWHRYbM/03UkNPGch1an/hnN5METmHpMqoydMHFWXe9fzMSfAyWdEHu8fuqwI55xWdgfC5uf5Ykd0gk0wjJ+XToC7vxNey2htm3t7gGg5/77Lofv0CicHBlYGRHem9KtsrAgjRymZFQWCVA1cwo=;4:ZmIYe2cjK1fUzJweLwg4Hq195jouVAawcqXDqjtXL4LiOsoXagz4gSivPUR0HSYRsQhU5+7SbAEoKvVY6j6LcJn6iRYuvy3J3xI3fick6vR51cuYQuo4+hwHif2L47iu+GqkhwGW7Kq3RBdQL9TmUodg5bfJeH7wcAoMjLi0C3b7wyfJvDkmaRqALY6lYuqfR0g1nc/kQUyWEOVirjrSwqJ4z6YZGxoGAAWbHU+Zo9+mLBk3RQsGuyKXo/pT3Mi1KXETXVDgYwvBDRoM5fqAOtSZqTtTLfvKyx8jtbN6nqkjBQcTfY/eJxbt6tyNe1d+mc3s8r/kZRpUTvj6AKmCBL1T5dHlAhNgAsfBTQA8I00= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001);SRVR:BY1PR0301MB1304;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1304; X-Forefront-PRVS: 07083FF734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR0301MB1304;23:Eav5sdqYzBOgHUYUsbCiX8qggrZKWH7sG9N9edh?= =?us-ascii?Q?/zNLpFc+NNJfWxzU7ofIS984BNn7qzoy8OjeGNNl7IJ5rnhQIqxqZUJMrTDN?= =?us-ascii?Q?j0sdGaIEKrfLjuBnvEVGv4qrK9G+W441wBsnKrkQtGUNuCuKq0UEywNenZt1?= =?us-ascii?Q?14cVX8nsdt4h+JuKyyVtdd7FN+LzddopOBfR36PX9lGWwoaREwWlXT0wrRXa?= =?us-ascii?Q?AU8X9j6uqmRCfVsYf+QQBRmz0cVXacvvAKDn9/nvjEJLpAYXF7ScSHpNGlGt?= =?us-ascii?Q?QZjQ3PI/kPBX/Dr8gcx+1zJegkAmltAuqInL0PMKX6ewc6Je36LiyckyVZAO?= =?us-ascii?Q?H5mNfER3FBiu2yl6S+tXeo+y7cCiZPHJlv4E9W8xtXx7WM1zW+dFTy1aW3NT?= =?us-ascii?Q?MYM+9lz2vkteHM3XUO0aoZdC/+XsKQoPxZAMh91CtLgMl37CJbah7naAckr4?= =?us-ascii?Q?moWF+i49GMsihnST/8+qjcWC8eymTdRgkOWVuug7CMQBas6ok3Z94qZr/RtD?= =?us-ascii?Q?XccJHEm98ebvbgQE3Sb5etjHGatV2WVe+eIjBbntcqnI4rzPKvbvUF1QVxdb?= =?us-ascii?Q?6DQt9m2ntnr1ntEdPLIzwBvrURGwQMOuqUHY13vz9DM8QGOqOr9IEatZvYB8?= =?us-ascii?Q?uCj63fJuD+pmO8p6O6LIRh/mXS7HeYnEFpEFaqHduB0nx61gjj7zrSa0Xl54?= =?us-ascii?Q?Fom/sdfp9EjG8ld4grlraVOmlGQcUrO2YNvqt6/nNDDV8XEW6JmYiCvtuPu6?= =?us-ascii?Q?2QlrB9N16WdKDMJGsEIL1FlIX2UpNGfiQW4OAuINWlpIkff9Mc5/Qc1WrHRX?= =?us-ascii?Q?mZKAZoKq9PGXKdlv72EU6DgnKauAUFDLr0ICPyU5aDyKUHHFRWxY9mNSytm8?= =?us-ascii?Q?OeqJ+Mvziy42GTZLItBIGxgMSrKu6E18qm2cQlWiBVWMuwS/oEZpqz+HI8Ni?= =?us-ascii?Q?/YCOokNB2yw7PITeWajdF6Ov/eZYUU960foBiGltAnDkCjfmJW114QbyqP5C?= =?us-ascii?Q?BIiVHkI/nJ23hs1JdHihwjTK0HuKRGH2K5nzAEl8fo3RS2EznuN2/RUwAcZ+?= =?us-ascii?Q?BC1Q+Z6FWQXdLgS6iat0GzQ2P5LRyooBQEJeyV6711wyUtqdxyElUD9S5OE/?= =?us-ascii?Q?QDOCWVi7f99rJb+ga65AN0xjquDtb0LaNCwliChPCG6xhoVzzCjS4fYiiWD3?= =?us-ascii?Q?nuB8ULgtF6iIyIMrMbPjrew0qdUWXhyOJVzfXTFV9Ib07HvY7kkZ6FEhwMmR?= =?us-ascii?Q?BRgSGwTe0NJ3NOGoakh2bbcOEzpiy5cYZ5Jb93gQ86vpwobKZ2aKlaRdY8W1?= =?us-ascii?Q?2LA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY1PR0301MB1304;5:sfFdGekv3DODeZIJr4oLk0Ovm5ivVYG+gEq9Os7CXMRLnSFutjse/tl5BtJemu2UbbN1S2e06zGQwRCjW/lW07O34bBlK0btv8POIaQrC1FefdzgC7S3QTNAazYrZGexGX6LVRUdqiYgrtBIi4W5zQ==;24:zzWyECEbW/Fl+XSgZAKwq3nqhy8drSCB9U3S2dJlgP/GDIBkfdYOvjmAbTpZS/lVdPJccpaUnDETjAeFGjkSyOU4YRoBp6KQAdDDBAKFxww=;20:3/p1KWBL4A52EmwUP3bcxlyiOPPaDJgcvsOJINXAnLj++VJH2HqcVi8wgM5b/4asZsoSZZ57gN6/R7iRCP/x2Q== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2015 21:25:04.6142 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB1304 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add cmd_flags parameter to all dpbp APIs to comply with the dpbp 2.0 MC interface. Updated MC version major number. Pass irq args in struct instead of separate args. Signed-off-by: J. German Rivera --- drivers/staging/fsl-mc/bus/dpbp.c | 94 +++++++++++++++++++------------ drivers/staging/fsl-mc/include/dpbp-cmd.h | 2 +- drivers/staging/fsl-mc/include/dpbp.h | 91 ++++++++++++++++++++++-------- 3 files changed, 127 insertions(+), 60 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/staging/fsl-mc/bus/dpbp.c index d99ab6d..bdc1aca 100644 --- a/drivers/staging/fsl-mc/bus/dpbp.c +++ b/drivers/staging/fsl-mc/bus/dpbp.c @@ -34,14 +34,17 @@ #include "../include/dpbp.h" #include "../include/dpbp-cmd.h" -int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token) +int dpbp_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpbp_id, + uint16_t *token) { struct mc_command cmd = { 0 }; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_OPEN, - MC_CMD_PRI_LOW, 0); + cmd_flags, 0); cmd.params[0] |= mc_enc(0, 32, dpbp_id); /* send command to mc*/ @@ -56,12 +59,14 @@ int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token) } EXPORT_SYMBOL(dpbp_open); -int dpbp_close(struct fsl_mc_io *mc_io, uint16_t token) +int dpbp_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(DPBP_CMDID_CLOSE, MC_CMD_PRI_HIGH, + cmd.header = mc_encode_cmd_header(DPBP_CMDID_CLOSE, cmd_flags, token); /* send command to mc*/ @@ -70,6 +75,7 @@ int dpbp_close(struct fsl_mc_io *mc_io, uint16_t token) EXPORT_SYMBOL(dpbp_close); int dpbp_create(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, const struct dpbp_cfg *cfg, uint16_t *token) { @@ -80,7 +86,7 @@ int dpbp_create(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_CREATE, - MC_CMD_PRI_LOW, 0); + cmd_flags, 0); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -93,24 +99,28 @@ int dpbp_create(struct fsl_mc_io *mc_io, return 0; } -int dpbp_destroy(struct fsl_mc_io *mc_io, uint16_t token) +int dpbp_destroy(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(DPBP_CMDID_DESTROY, - MC_CMD_PRI_LOW, token); + cmd_flags, token); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } -int dpbp_enable(struct fsl_mc_io *mc_io, uint16_t token) +int dpbp_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(DPBP_CMDID_ENABLE, MC_CMD_PRI_LOW, + cmd.header = mc_encode_cmd_header(DPBP_CMDID_ENABLE, cmd_flags, token); /* send command to mc*/ @@ -118,25 +128,30 @@ int dpbp_enable(struct fsl_mc_io *mc_io, uint16_t token) } EXPORT_SYMBOL(dpbp_enable); -int dpbp_disable(struct fsl_mc_io *mc_io, uint16_t token) +int dpbp_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(DPBP_CMDID_DISABLE, - MC_CMD_PRI_LOW, token); + cmd_flags, token); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } EXPORT_SYMBOL(dpbp_disable); -int dpbp_is_enabled(struct fsl_mc_io *mc_io, uint16_t token, int *en) +int dpbp_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(DPBP_CMDID_IS_ENABLED, MC_CMD_PRI_LOW, + cmd.header = mc_encode_cmd_header(DPBP_CMDID_IS_ENABLED, cmd_flags, token); /* send command to mc*/ @@ -150,53 +165,53 @@ int dpbp_is_enabled(struct fsl_mc_io *mc_io, uint16_t token, int *en) return 0; } -int dpbp_reset(struct fsl_mc_io *mc_io, uint16_t token) +int dpbp_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(DPBP_CMDID_RESET, - MC_CMD_PRI_LOW, token); + cmd_flags, token); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } int dpbp_set_irq(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, - uint64_t irq_paddr, - uint32_t irq_val, - int user_irq_id) + struct dpbp_irq_cfg *irq_cfg) { struct mc_command cmd = { 0 }; /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_SET_IRQ, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(0, 8, irq_index); - cmd.params[0] |= mc_enc(32, 32, irq_val); - cmd.params[1] |= mc_enc(0, 64, irq_paddr); - cmd.params[2] |= mc_enc(0, 32, user_irq_id); + cmd.params[0] |= mc_enc(32, 32, irq_cfg->val); + cmd.params[1] |= mc_enc(0, 64, irq_cfg->addr); + cmd.params[2] |= mc_enc(0, 32, irq_cfg->user_irq_id); /* send command to mc*/ return mc_send_command(mc_io, &cmd); } int dpbp_get_irq(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, int *type, - uint64_t *irq_paddr, - uint32_t *irq_val, - int *user_irq_id) + struct dpbp_irq_cfg *irq_cfg) { struct mc_command cmd = { 0 }; int err; /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_IRQ, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(32, 8, irq_index); /* send command to mc*/ @@ -205,14 +220,15 @@ int dpbp_get_irq(struct fsl_mc_io *mc_io, return err; /* retrieve response parameters */ - *irq_val = (uint32_t)mc_dec(cmd.params[0], 0, 32); - *irq_paddr = (uint64_t)mc_dec(cmd.params[1], 0, 64); - *user_irq_id = (int)mc_dec(cmd.params[2], 0, 32); + irq_cfg->val = (uint32_t)mc_dec(cmd.params[0], 0, 32); + irq_cfg->addr = (uint64_t)mc_dec(cmd.params[1], 0, 64); + irq_cfg->user_irq_id = (int)mc_dec(cmd.params[2], 0, 32); *type = (int)mc_dec(cmd.params[2], 32, 32); return 0; } int dpbp_set_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint8_t en) @@ -221,7 +237,7 @@ int dpbp_set_irq_enable(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_SET_IRQ_ENABLE, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(0, 8, en); cmd.params[0] |= mc_enc(32, 8, irq_index); @@ -230,6 +246,7 @@ int dpbp_set_irq_enable(struct fsl_mc_io *mc_io, } int dpbp_get_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint8_t *en) @@ -239,7 +256,7 @@ int dpbp_get_irq_enable(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_IRQ_ENABLE, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(32, 8, irq_index); /* send command to mc*/ @@ -253,6 +270,7 @@ int dpbp_get_irq_enable(struct fsl_mc_io *mc_io, } int dpbp_set_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t mask) @@ -261,7 +279,7 @@ int dpbp_set_irq_mask(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_SET_IRQ_MASK, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(0, 32, mask); cmd.params[0] |= mc_enc(32, 8, irq_index); @@ -270,6 +288,7 @@ int dpbp_set_irq_mask(struct fsl_mc_io *mc_io, } int dpbp_get_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t *mask) @@ -279,7 +298,7 @@ int dpbp_get_irq_mask(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_IRQ_MASK, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(32, 8, irq_index); /* send command to mc*/ @@ -293,6 +312,7 @@ int dpbp_get_irq_mask(struct fsl_mc_io *mc_io, } int dpbp_get_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t *status) @@ -302,7 +322,7 @@ int dpbp_get_irq_status(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_IRQ_STATUS, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(32, 8, irq_index); /* send command to mc*/ @@ -316,6 +336,7 @@ int dpbp_get_irq_status(struct fsl_mc_io *mc_io, } int dpbp_clear_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t status) @@ -324,7 +345,7 @@ int dpbp_clear_irq_status(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_CLEAR_IRQ_STATUS, - MC_CMD_PRI_LOW, token); + cmd_flags, token); cmd.params[0] |= mc_enc(0, 32, status); cmd.params[0] |= mc_enc(32, 8, irq_index); @@ -333,6 +354,7 @@ int dpbp_clear_irq_status(struct fsl_mc_io *mc_io, } int dpbp_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpbp_attr *attr) { @@ -341,7 +363,7 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_ATTR, - MC_CMD_PRI_LOW, token); + cmd_flags, token); /* send command to mc*/ err = mc_send_command(mc_io, &cmd); diff --git a/drivers/staging/fsl-mc/include/dpbp-cmd.h b/drivers/staging/fsl-mc/include/dpbp-cmd.h index 1fd70a21..efa9bf3 100644 --- a/drivers/staging/fsl-mc/include/dpbp-cmd.h +++ b/drivers/staging/fsl-mc/include/dpbp-cmd.h @@ -34,7 +34,7 @@ /* DPBP Version */ #define DPBP_VER_MAJOR 2 -#define DPBP_VER_MINOR 0 +#define DPBP_VER_MINOR 1 /* Command IDs */ #define DPBP_CMDID_CLOSE 0x800 diff --git a/drivers/staging/fsl-mc/include/dpbp.h b/drivers/staging/fsl-mc/include/dpbp.h index 5f3c8e7..4a4b575 100644 --- a/drivers/staging/fsl-mc/include/dpbp.h +++ b/drivers/staging/fsl-mc/include/dpbp.h @@ -41,6 +41,7 @@ struct fsl_mc_io; /** * dpbp_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_' * @dpbp_id: DPBP unique ID * @token: Returned token; use in subsequent API calls * @@ -54,11 +55,15 @@ struct fsl_mc_io; * * Return: '0' on Success; Error code otherwise. */ -int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token); +int dpbp_open(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + int dpbp_id, + uint16_t *token); /** * dpbp_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 DPBP object * * After this function is called, no further operations are @@ -66,10 +71,12 @@ int dpbp_open(struct fsl_mc_io *mc_io, int dpbp_id, uint16_t *token); * * Return: '0' on Success; Error code otherwise. */ -int dpbp_close(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_close(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** - * struct dpbp_cfg() - Structure representing DPBP configuration + * struct dpbp_cfg - Structure representing DPBP configuration * @options: place holder */ struct dpbp_cfg { @@ -79,6 +86,7 @@ struct dpbp_cfg { /** * dpbp_create() - Create the DPBP object. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @cfg: Configuration structure * @token: Returned token; use in subsequent API calls * @@ -97,99 +105,123 @@ struct dpbp_cfg { * Return: '0' on Success; Error code otherwise. */ int dpbp_create(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, const struct dpbp_cfg *cfg, uint16_t *token); /** * dpbp_destroy() - Destroy the DPBP object and release all its resources. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * Return: '0' on Success; error code otherwise. */ -int dpbp_destroy(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_destroy(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpbp_enable() - Enable the DPBP. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * Return: '0' on Success; Error code otherwise. */ -int dpbp_enable(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpbp_disable() - Disable the DPBP. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * * Return: '0' on Success; Error code otherwise. */ -int dpbp_disable(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_disable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); /** * dpbp_is_enabled() - Check if the DPBP 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 DPBP object * @en: Returns '1' if object is enabled; '0' otherwise * * Return: '0' on Success; Error code otherwise. */ -int dpbp_is_enabled(struct fsl_mc_io *mc_io, uint16_t token, int *en); +int dpbp_is_enabled(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); /** * dpbp_reset() - Reset the DPBP, 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 DPBP object * * Return: '0' on Success; Error code otherwise. */ -int dpbp_reset(struct fsl_mc_io *mc_io, uint16_t token); +int dpbp_reset(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token); + +/** + * struct dpbp_irq_cfg - IRQ configuration + * @addr: Address that must be written to signal a message-based interrupt + * @val: Value to write into irq_addr address + * @user_irq_id: A user defined number associated with this IRQ + */ +struct dpbp_irq_cfg { + uint64_t addr; + uint32_t val; + int user_irq_id; +}; /** * dpbp_set_irq() - Set IRQ information for the DPBP to trigger an interrupt. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @irq_index: Identifies the interrupt index to configure - * @irq_addr: Address that must be written to - * signal a message-based interrupt - * @irq_val: Value to write into irq_addr address - * @user_irq_id: A user defined number associated with this IRQ + * @irq_cfg: IRQ configuration * * Return: '0' on Success; Error code otherwise. */ int dpbp_set_irq(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, - uint64_t irq_addr, - uint32_t irq_val, - int user_irq_id); + struct dpbp_irq_cfg *irq_cfg); /** * dpbp_get_irq() - Get IRQ information from the DPBP. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @irq_index: The interrupt index to configure * @type: Interrupt type: 0 represents message interrupt - * type (both irq_addr and irq_val are valid) - * @irq_addr: Returned address that must be written to - * signal the message-based interrupt - * @irq_val: Value to write into irq_addr address - * @user_irq_id: A user defined number associated with this IRQ + * type (both irq_addr and irq_val are valid) + * @irq_cfg: IRQ attributes * * Return: '0' on Success; Error code otherwise. */ int dpbp_get_irq(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, int *type, - uint64_t *irq_addr, - uint32_t *irq_val, - int *user_irq_id); + struct dpbp_irq_cfg *irq_cfg); /** * dpbp_set_irq_enable() - Set overall interrupt 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 DPBP object * @irq_index: The interrupt index to configure * @en: Interrupt state - enable = 1, disable = 0 @@ -202,6 +234,7 @@ int dpbp_get_irq(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpbp_set_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint8_t en); @@ -209,6 +242,7 @@ int dpbp_set_irq_enable(struct fsl_mc_io *mc_io, /** * dpbp_get_irq_enable() - Get overall interrupt 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 DPBP object * @irq_index: The interrupt index to configure * @en: Returned interrupt state - enable = 1, disable = 0 @@ -216,6 +250,7 @@ int dpbp_set_irq_enable(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpbp_get_irq_enable(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint8_t *en); @@ -223,6 +258,7 @@ int dpbp_get_irq_enable(struct fsl_mc_io *mc_io, /** * dpbp_set_irq_mask() - Set interrupt mask. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @irq_index: The interrupt index to configure * @mask: Event mask to trigger interrupt; @@ -236,6 +272,7 @@ int dpbp_get_irq_enable(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpbp_set_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t mask); @@ -243,6 +280,7 @@ int dpbp_set_irq_mask(struct fsl_mc_io *mc_io, /** * dpbp_get_irq_mask() - Get interrupt mask. * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @irq_index: The interrupt index to configure * @mask: Returned event mask to trigger interrupt @@ -253,6 +291,7 @@ int dpbp_set_irq_mask(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpbp_get_irq_mask(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t *mask); @@ -261,6 +300,7 @@ int dpbp_get_irq_mask(struct fsl_mc_io *mc_io, * dpbp_get_irq_status() - Get the current status of any pending interrupts. * * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @irq_index: The interrupt index to configure * @status: Returned interrupts status - one bit per cause: @@ -270,6 +310,7 @@ int dpbp_get_irq_mask(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpbp_get_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t *status); @@ -278,6 +319,7 @@ int dpbp_get_irq_status(struct fsl_mc_io *mc_io, * dpbp_clear_irq_status() - Clear a pending interrupt's status * * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPBP object * @irq_index: The interrupt index to configure * @status: Bits to clear (W1C) - one bit per cause: @@ -287,6 +329,7 @@ int dpbp_get_irq_status(struct fsl_mc_io *mc_io, * Return: '0' on Success; Error code otherwise. */ int dpbp_clear_irq_status(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, uint8_t irq_index, uint32_t status); @@ -316,12 +359,14 @@ struct dpbp_attr { * dpbp_get_attributes - Retrieve DPBP 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 DPBP object * @attr: Returned object's attributes * * Return: '0' on Success; Error code otherwise. */ int dpbp_get_attributes(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, uint16_t token, struct dpbp_attr *attr); -- 2.3.3