Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754403AbcDKQtI (ORCPT ); Mon, 11 Apr 2016 12:49:08 -0400 Received: from mail-bn1bn0100.outbound.protection.outlook.com ([157.56.110.100]:26289 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753611AbcDKQtF (ORCPT ); Mon, 11 Apr 2016 12:49:05 -0400 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=none action=none header.from=nxp.com; From: Stuart Yoder To: , CC: , , , , , Stuart Yoder Subject: [PATCH 05/14] staging: fsl-mc: update dprc binary interface to v5.1 Date: Mon, 11 Apr 2016 11:48:59 -0500 Message-ID: <1460393339-15896-1-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.7.9.5 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131048669412108945;(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)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(48376002)(4326007)(87936001)(586003)(33646002)(77096005)(50466002)(15650500001)(1220700001)(106466001)(1096002)(5001770100001)(19580395003)(6806005)(19580405001)(5008740100001)(189998001)(11100500001)(86362001)(104016004)(36756003)(81166005)(2906002)(50986999)(105606002)(92566002)(50226001)(47776003)(7059030)(4720700001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB0715;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD014;1:Xzo5xf2DG+a+ac9n+fcQbsQnOhD9wmYUsPG9h5JU9gxaHSE/RO5kjVP2EtDvUKGWgU4Ls46J87jjjvNoEqNbpGgfMAlbXxTBSaSzNu+3vpJ495nLkaIlJagI8HN4LZT+C7nLMMjv7q3Myzl/sRiSjk5M//AFoAKGKIMrN7oI03BbyRVMH8ujX6w09uuWvD6nukCnN0t0fySEbyBNaW7xNiOwdf/Nt8DZ6Q6Nar85PmF6z3RMURnqD4RNVdEWzHgy3tYv56Nb6dVoZodIzIKZnKE74pNMRXPQPSYEZAdaT592Hlf4QT2rnNO2OhdkGpAjDDT5IxtADxowuR5RWqFwEHWXe/SEmA2+ohavfrQPzOKxUcjfo1zCC2LdPZiscCK4BvP2CksGpqIK9t6Jh/8HFoSPRgnub8GvGiTQr8icuuiczsDq9PRYYl3CMs23lHDFdTtdLKRN+E5a1kfiVVjeFUDy1bv9kqjwwi6qHlXFhlOsJM+tkpjU1RKu0iGUyuftDJhaFcaRfWR2gfBMf18BdZShan6nzM3xUL8Lr6XaS2jRe5oLdGCe/kmIEm3FfYZTXFEtE9pm7BUSP3rwbS7A/pZO5ar+uoAYiEqJSZFvKJVDGV8CdUbs0KXcCP8D1Dqr+R188e//EQrh1RdKAiBAlZp87+R3yUhQ2rOi525eHklcPlrkwFYYmw4WnL/tl5a3 MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 5d99452b-7e7c-4c19-4930-08d362292f0d X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0715;2:bGhJwYwbbHt5CfX65MCltFOkbQF+BXiPPfpSo+UNr7vJxgm3oTIyQHUL6FtKxG2NSoE0uuG6aAdLm1AktrKImSZTjcFOuhD3Dr7QiNqxWI73wqPiGkSOHAYoVQODUbprmfauKg/0vSLIsfcr9UrM/BhA4N5v1MiDkpuGgIugcuBVkMgmJUImmv6ctc9aneWv;3:K0fU8+R4e+1NSs4BwFCwkyXw/UaIowKgkMZYDkVgj/g7AbfMEgyOGtBGlbhvpeG0VAwhQQF4GS/TnlFmaBgZ4flEf2A9inFB5YYqY4z0O/LeVB2sRVmZNcCOwnntgWHy+VotnQ7it2AhS9XWvCBPTQVbrSgWbpB985RqNWRT5sMvGdomqqOwAxTRCbksRNom73aFxvOrBMcyi2FljldwHrCjmJeL6Nuy8xNEmB0tbp4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0715; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0715;25:lox9heH2Fr0osBJovE33OgdEfMrG+ppqf/S7qImwFZMVmrAXnUhTugZfZObYX6x8gOdQDMLeXNmEFxsG2WfLka4D5wd8mZ5flEDId7mvbqrCh2keZHpTw20tjkcjsxIJmn605EfHVdg/dQzUhPMtcxLYbdIplxknlhSSnY2PWw0q0xiLlFjqaEmBKLrlU8ON9soA4zmdz/9PG6vE4XEsko7LJHh0zKKJ64jO5D5okv4QSW9/EeFWvikzb+Bz8AfKy/KiQYu/Zzmdawlk0Atw88u9+UdFYpcFx9F1RfUKjUnhGUcvWoOzM7gkSNcXg6DxuDisFL7i30kO7j9hXbDPfstlEseh2Y9pc7fXWLZX/I38hQ+sH8NCo+dcZJTploN4KpLvG18x4DEgTKYVN8+gz2Ws+SUpyo4vV7KFseJoZrXilnMelD5RTiIjyWLMimlvsRkVQFbew7SkKUotcha7utmyB0rpFJN2HwhmS6y6uLjRInHBtrOjl8OPW2WK0uofoN7rTYrTuMvjYtgN5Kyfh88VmbNDy49EiMTD5ZoHRTQeD65OxbuFOlTZgQY1KwcZMMzPPFqS5wc3oGgClqELq7nJyVdwtYD1K7VJuGrAhzQtPY7+OU1JQYKvs+7MNrqjVNMSoTuVzmLbj2LNJEma6TEKtAcvAHDRp57kYFIyu/OnuNJW1OsfJ0VeDbr8vrJq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13018025)(13017025)(13015025)(13024025)(13023025)(8121501046)(10201501046)(3002001)(6055026);SRVR:CY1PR0301MB0715;BCL:0;PCL:0;RULEID:(400006);SRVR:CY1PR0301MB0715; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0715;4:RrEVliwOUHYNo1ZaaE8NDJ1VsCEB/2nT9JTOUTMUJ/LPDtkluW/PZ7PdwFgzegKgTTVrOfhG1mcXKNpFAlsqnNOc6Qr41fjdgtFOTN8RRd9DrZHhLHzIQqsV9v6ZmYyDRA9OOr1io/DdycI8i1hRmNtaw/zl5jRm0cFOSJ3jTpdvkkdI7lzvs9fXVt6qB7GUDdyw54tbt9TKYMUlkS1l94G+K/zWpR7je9xcV/4AhNnLL2vdILClIo51vjDQgO7BwAMooE7TnTg+ACs4u2OnQU6RkwMp+7EC2z6M5eHF3EFpzRqGFz6IBK5EdjvWNV9FJbRt4HNj8uN1m8vToO0jevRv0BUt+6w9qe2mx0HvAXZsneludKdG/q8hFYp09GMQ7vp29j271nS6FOiqUuUS2oyZV84fDGDQwxvZVBufG1a/q6aI96mlx4dSHpTAOGrMyOSu3X4bmLXNmVq6y8hEz9BqnrARHQXj2PPv3NTV+38= X-Forefront-PRVS: 09090B6B69 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB0715;23:f/Fef32QFMkw/UKXP+4EmlHquZ/QYd7R5KvamtX?= =?us-ascii?Q?nUeX2FSaK0Gn4DRndpamLf8ZsjS3/i65bojJIo8LJAn10+LIfmPACSE3wzis?= =?us-ascii?Q?pYdxFIpldtoUwFCESeemK+L8Srt5PM1orPgaQ0CtLzjJnXVGP+ONL+G4oY5S?= =?us-ascii?Q?ksFOdBhyKzcfIEldlimDmDWQbX4dm/HhU8yiaboBtTbmI8C3bPpfukZtLAcU?= =?us-ascii?Q?7IyIW+t3p1wHFHpodftOubrLrmWGIRqsnxPWXQPVFxCCl7OMXzLTmtSR5rbR?= =?us-ascii?Q?mr1yOrvPucFH+z4UmD8k/QY97FLOSOoHyCrYkKLA7eaEfFisBYPxqq/eHEI4?= =?us-ascii?Q?fYyDGFgUt0M8fTNhfajBqbx2CMgi0AwzlujM/kELUuG53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gwi6CLptUFRV/jYQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2016 16:49:01.0080 (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: CY1PR0301MB0715 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8552 Lines: 212 From: Stuart Yoder The meaning of the "status" parameter in dprc_get_irq_status has changed, and this patch updates the flib and caller of the API. Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/dprc-cmd.h | 4 ++-- drivers/staging/fsl-mc/bus/dprc-driver.c | 1 + drivers/staging/fsl-mc/bus/dprc.c | 26 +++++++++++++------------- drivers/staging/fsl-mc/bus/mc-msi.c | 2 +- drivers/staging/fsl-mc/include/dprc.h | 19 ++++++++++++------- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dprc-cmd.h b/drivers/staging/fsl-mc/bus/dprc-cmd.h index 6552c20..d0198f5 100644 --- a/drivers/staging/fsl-mc/bus/dprc-cmd.h +++ b/drivers/staging/fsl-mc/bus/dprc-cmd.h @@ -41,8 +41,8 @@ #define _FSL_DPRC_CMD_H /* DPRC Version */ -#define DPRC_VER_MAJOR 4 -#define DPRC_VER_MINOR 0 +#define DPRC_VER_MAJOR 5 +#define DPRC_VER_MINOR 1 /* Command IDs */ #define DPRC_CMDID_CLOSE 0x800 diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index 31488a7..4334f3c 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -423,6 +423,7 @@ static irqreturn_t dprc_irq0_handler_thread(int irq_num, void *arg) if (WARN_ON(!msi_desc || msi_desc->irq != (u32)irq_num)) goto out; + status = 0; error = dprc_get_irq_status(mc_io, 0, mc_dev->mc_handle, 0, &status); if (error < 0) { diff --git a/drivers/staging/fsl-mc/bus/dprc.c b/drivers/staging/fsl-mc/bus/dprc.c index 381b9a9..a2c4737 100644 --- a/drivers/staging/fsl-mc/bus/dprc.c +++ b/drivers/staging/fsl-mc/bus/dprc.c @@ -265,7 +265,7 @@ int dprc_get_irq(struct fsl_mc_io *mc_io, /* retrieve response parameters */ irq_cfg->val = mc_dec(cmd.params[0], 0, 32); irq_cfg->paddr = mc_dec(cmd.params[1], 0, 64); - irq_cfg->user_irq_id = mc_dec(cmd.params[2], 0, 32); + irq_cfg->irq_num = mc_dec(cmd.params[2], 0, 32); *type = mc_dec(cmd.params[2], 32, 32); return 0; @@ -296,7 +296,7 @@ int dprc_set_irq(struct fsl_mc_io *mc_io, cmd.params[0] |= mc_enc(32, 8, irq_index); cmd.params[0] |= mc_enc(0, 32, irq_cfg->val); cmd.params[1] |= mc_enc(0, 64, irq_cfg->paddr); - cmd.params[2] |= mc_enc(0, 32, irq_cfg->user_irq_id); + cmd.params[2] |= mc_enc(0, 32, irq_cfg->irq_num); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -466,6 +466,7 @@ int dprc_get_irq_status(struct fsl_mc_io *mc_io, /* prepare command */ cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_IRQ_STATUS, cmd_flags, token); + cmd.params[0] |= mc_enc(0, 32, *status); cmd.params[0] |= mc_enc(32, 8, irq_index); /* send command to mc*/ @@ -948,6 +949,7 @@ int dprc_get_obj(struct fsl_mc_io *mc_io, obj_desc->state = mc_dec(cmd.params[1], 32, 32); obj_desc->ver_major = mc_dec(cmd.params[2], 0, 16); obj_desc->ver_minor = mc_dec(cmd.params[2], 16, 16); + obj_desc->flags = mc_dec(cmd.params[2], 32, 16); obj_desc->type[0] = mc_dec(cmd.params[3], 0, 8); obj_desc->type[1] = mc_dec(cmd.params[3], 8, 8); obj_desc->type[2] = mc_dec(cmd.params[3], 16, 8); @@ -1042,6 +1044,7 @@ int dprc_get_obj_desc(struct fsl_mc_io *mc_io, obj_desc->state = (u32)mc_dec(cmd.params[1], 32, 32); obj_desc->ver_major = (u16)mc_dec(cmd.params[2], 0, 16); obj_desc->ver_minor = (u16)mc_dec(cmd.params[2], 16, 16); + obj_desc->flags = mc_dec(cmd.params[2], 32, 16); obj_desc->type[0] = (char)mc_dec(cmd.params[3], 0, 8); obj_desc->type[1] = (char)mc_dec(cmd.params[3], 8, 8); obj_desc->type[2] = (char)mc_dec(cmd.params[3], 16, 8); @@ -1108,7 +1111,7 @@ int dprc_set_obj_irq(struct fsl_mc_io *mc_io, cmd.params[0] |= mc_enc(32, 8, irq_index); cmd.params[0] |= mc_enc(0, 32, irq_cfg->val); cmd.params[1] |= mc_enc(0, 64, irq_cfg->paddr); - cmd.params[2] |= mc_enc(0, 32, irq_cfg->user_irq_id); + cmd.params[2] |= mc_enc(0, 32, irq_cfg->irq_num); cmd.params[2] |= mc_enc(32, 32, obj_id); cmd.params[3] |= mc_enc(0, 8, obj_type[0]); cmd.params[3] |= mc_enc(8, 8, obj_type[1]); @@ -1189,7 +1192,7 @@ int dprc_get_obj_irq(struct fsl_mc_io *mc_io, /* retrieve response parameters */ irq_cfg->val = (u32)mc_dec(cmd.params[0], 0, 32); irq_cfg->paddr = (u64)mc_dec(cmd.params[1], 0, 64); - irq_cfg->user_irq_id = (int)mc_dec(cmd.params[2], 0, 32); + irq_cfg->irq_num = (int)mc_dec(cmd.params[2], 0, 32); *type = (int)mc_dec(cmd.params[2], 32, 32); return 0; @@ -1437,14 +1440,8 @@ EXPORT_SYMBOL(dprc_set_obj_label); * @endpoint1: Endpoint 1 configuration parameters * @endpoint2: Endpoint 2 configuration parameters * @cfg: Connection configuration. The connection configuration is ignored for - * connections made to DPMAC objects, where rate is set according to - * MAC configuration. - * The committed rate is the guaranteed rate for the connection. - * The maximum rate is an upper limit allowed for the connection; it is - * expected to be equal or higher than the committed rate. - * When committed and maximum rates are both zero, the connection is set - * to "best effort" mode, having lower priority compared to connections - * with committed or maximum rates. + * connections made to DPMAC objects, where rate is retrieved from the + * MAC configuration. * * Return: '0' on Success; Error code otherwise. */ @@ -1555,7 +1552,10 @@ int dprc_disconnect(struct fsl_mc_io *mc_io, * @token: Token of DPRC object * @endpoint1: Endpoint 1 configuration parameters * @endpoint2: Returned endpoint 2 configuration parameters -* @state: Returned link state: 1 - link is up, 0 - link is down +* @state: Returned link state: +* 1 - link is up; +* 0 - link is down; +* -1 - no connection (endpoint2 information is irrelevant) * * Return: '0' on Success; -ENAVAIL if connection does not exist. */ diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/mc-msi.c index 3a8258f..ba48add 100644 --- a/drivers/staging/fsl-mc/bus/mc-msi.c +++ b/drivers/staging/fsl-mc/bus/mc-msi.c @@ -65,7 +65,7 @@ static void __fsl_mc_msi_write_msg(struct fsl_mc_device *mc_bus_dev, irq_cfg.paddr = ((u64)msi_desc->msg.address_hi << 32) | msi_desc->msg.address_lo; irq_cfg.val = msi_desc->msg.data; - irq_cfg.user_irq_id = msi_desc->irq; + irq_cfg.irq_num = msi_desc->irq; if (owner_mc_dev == mc_bus_dev) { /* diff --git a/drivers/staging/fsl-mc/include/dprc.h b/drivers/staging/fsl-mc/include/dprc.h index 94c4927..593b2bb 100644 --- a/drivers/staging/fsl-mc/include/dprc.h +++ b/drivers/staging/fsl-mc/include/dprc.h @@ -94,11 +94,6 @@ int dprc_close(struct fsl_mc_io *mc_io, */ #define DPRC_CFG_OPT_TOPOLOGY_CHANGES_ALLOWED 0x00000008 -/* IOMMU bypass - indicates whether objects of this container are permitted - * to bypass the IOMMU. - */ -#define DPRC_CFG_OPT_IOMMU_BYPASS 0x00000010 - /* AIOP - Indicates that container belongs to AIOP. */ #define DPRC_CFG_OPT_AIOP 0x00000020 @@ -173,12 +168,12 @@ int dprc_reset_container(struct fsl_mc_io *mc_io, * 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 - * @user_irq_id: A user defined number associated with this IRQ + * @irq_num: A user defined number associated with this IRQ */ struct dprc_irq_cfg { phys_addr_t paddr; u32 val; - int user_irq_id; + int irq_num; }; int dprc_set_irq(struct fsl_mc_io *mc_io, @@ -353,6 +348,14 @@ int dprc_get_obj_count(struct fsl_mc_io *mc_io, #define DPRC_OBJ_STATE_PLUGGED 0x00000002 /** + * Shareability flag - Object flag indicating no memory shareability. + * the object generates memory accesses that are non coherent with other + * masters; + * user is responsible for proper memory handling through IOMMU configuration. + */ +#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001 + +/** * struct dprc_obj_desc - Object descriptor, returned from dprc_get_obj() * @type: Type of object: NULL terminated string * @id: ID of logical object resource @@ -363,6 +366,7 @@ int dprc_get_obj_count(struct fsl_mc_io *mc_io, * @region_count: Number of mappable regions supported by the object * @state: Object state: combination of DPRC_OBJ_STATE_ states * @label: Object label + * @flags: Object's flags */ struct dprc_obj_desc { char type[16]; @@ -374,6 +378,7 @@ struct dprc_obj_desc { u8 region_count; u32 state; char label[16]; + u16 flags; }; int dprc_get_obj(struct fsl_mc_io *mc_io, -- 1.7.9.5