From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 17023A034C; Thu, 28 Apr 2022 13:48:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CB1D42849; Thu, 28 Apr 2022 13:48:14 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2068.outbound.protection.outlook.com [40.107.20.68]) by mails.dpdk.org (Postfix) with ESMTP id 7F59342849 for ; Thu, 28 Apr 2022 13:48:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EIuNpm+POCRRq+F6Db1VlaZ469EXJCFDuZNV+BsrYmsCfOb0MRmih07coPSyeaOKEgtxu0qIS6MU31nDo/PmnenuSgV64W9jlFguldX1wonzbLnAA2GyYBnsURMk3PZCx2qOoxS0wjxNpDerd4/Iz4UqyBKKYXYIWB8Lcil/+geuZ9aINaJvEtMsPkRNiAWNm1GNYcWk3oNtck92mslRNnXiQuk6khG+v5Z/2lX41jyPGUIDs+AYiH1wBjvVuKIdffxzRWPNnRBi9gLPJwgF/AfRtCeWkD8d0t9K8bwpkr3HpVDBSVLi5TI48ykjAA9LgoaKHP7qYw6XV0jWe33KHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gh1P/DLnH9sjJu/kSGFhEpawSoKWTo95HhMLXQicCGQ=; b=XYZwMpVSl7KAaUbRC7bQf+OJBDxtTiWmXQake2QxQIlBs2HIsyBFfuKii/s/RH+Agaqn9K9uDDy+88j8krjB6QSdb86KOyxR91rUoMdZnF8nauR7xQAXaHUYG+Z4TLOncyubLSVH5PegB2y2cNoYIxH9Jk75OvQ+jaE0SrDXEAWgeq7a/9cGsHPYSZaCt+heTsl923pvQRW30zuycIrG70hXZO735S1IQvqZLvLUaijVv1mkbrEEMCa8lovNanCWPDVh6/Rh7T8LUv/RefgxsJ2rsKTVzewuRTBu7Aez5+l0imnZFoFdt5ZQqrF5Dk8DIEBOMZiEFFcUhbC5aQSuuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gh1P/DLnH9sjJu/kSGFhEpawSoKWTo95HhMLXQicCGQ=; b=aYR4EbK2w0IgZ/o48P8AufWvSHT1/2NjSAcYVFsoSImfe5m9zbMjdwbakRU3ggUaPskZbKV49TwM2dlcx/+0+UeLHBx2etSWEUQiz/k0yQ0osBmXR+02dK1EJ9XDdKu3Ju9v/socJTaFi37yIfJU7OhOV0WqEt1nmkEz1g6hHbs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by AM9PR04MB8162.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Thu, 28 Apr 2022 11:48:12 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2%9]) with mapi id 15.20.5206.014; Thu, 28 Apr 2022 11:48:12 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH v2 07/14] common/dpaax: remove obsolete code Date: Thu, 28 Apr 2022 17:17:26 +0530 Message-Id: <20220428114733.1419957-8-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220428114733.1419957-1-g.singh@nxp.com> References: <20220422035100.3180870-1-g.singh@nxp.com> <20220428114733.1419957-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:194::22) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c47b089d-f7f7-4b10-da25-08da290cf8b6 X-MS-TrafficTypeDiagnostic: AM9PR04MB8162:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xd05jJdandx6Zyk8MZrTHHi2xT7Su8UjJuoUzmzINHLyp6QE+TrNCoSg0+Na5ZJ/2kCrehZ4fVymLJaTTdgh+gUqTE8fkW1GEwLoh/jllF9FD/QWKc1GTIlsklKDL76EfGP3FthIoPA/GFUCZltUo440jREKXzHZZk+3OjW6mVHQlzJdaIAjLFX/8kFzC45QHfu3gbYHBHFNDtZ16d999aNDeQQz0sKQQ6GS++IetTAsUz+AyIFNvol9juy1OIHJuJjyL/GnywmDnhXFJubikROaEzRW2vODM1XgRyGzsvaLilLvFfE/+x3efIb9oTxMW7J2eJfvPZIlLZusWPUxk5lLexdoFkIfSrjDMKYWmNyu8WAWADxp8S0RFrKujNb2SkMLhxAFdPFt1VUf0NUjfD3A9MLCkgTCSLsmkHjcrkWdHTqpUVLjPgfudq+qqe5HJiBlBcUrTvgiHfF9ovJld/QhSI4PcLZkfM8QdbWrFhh1/YB58iJrHCRA4Cna/N3WPsecqCpDc2Y/afWgYYjjOoM3WV6nXUoeS8NS/GrmyUjlkY4EyKM0yu2gACEK5mrBVEN8kx8itONF19jFTWV8WhsG/IgiGaB4uxrEG2gJF5kXyI0bm+NOWGeOwMnFDWsiacSPfUDie7ozj9eftW55f1heTmGmy8eI9PXsPIOXmC5duZM7K9GthWsmSwKDEXLTUiNjoa+gVjLsfbmv0WlXyThT8Id12eyO8bhJkX8AfGgQbfJHrnnXUf1zGL4JV+Pz X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(508600001)(8676002)(4326008)(66476007)(66556008)(86362001)(66946007)(316002)(55236004)(2906002)(38100700002)(6512007)(30864003)(38350700002)(26005)(6666004)(6506007)(52116002)(5660300002)(2616005)(1076003)(186003)(83380400001)(8936002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DwiX8FFfaGzJdJEAccYggCCy78ETFIFKJ8YEqRDFYbQH+60y4ifi4J1Y87HJ?= =?us-ascii?Q?dzdPkapi02jk727udz9OjpgLAWOc4vXdzG18vVx4/Gyos9q1/VF9SnrFi/6i?= =?us-ascii?Q?MUs7C9AfwJM5W9IdYVMyWOqZr+vVUPWl2HgC1qKG0DcI10n9YpE1U+rBk/mD?= =?us-ascii?Q?7MWl0hMYkHfuw+Sm5qPQF+DW8JrYfrwwa/gfNhZij24Es4SJv2YoK5cG8S8R?= =?us-ascii?Q?NxeWMMAGE2hMiqxqv5+MBU4VNNhYgvv4IVofd0thGdl9h9MUNGof6Ysz/pyj?= =?us-ascii?Q?oWBK9SYgDSZK29xwgbkr3Cq8pRPTzCI+kWWIDSZOdYKp2rXFUXgLaxco3eI+?= =?us-ascii?Q?L+1g8ZbipCUe4Obxi8fv0q7Mx9tvwilx3T/MTlqGNsHFK2tmI1omqIQK/BQz?= =?us-ascii?Q?CvTliNNUVW1P8k2IJzA7MGLgl/cqtsW/fEXfy5oJv/GrIuGTgm7BL+jDCisG?= =?us-ascii?Q?OArW37JOp9dO653i3J7J8S5idXAmgWx85Th9EZXKHA7DpNhrfgd06nM5xxsW?= =?us-ascii?Q?rZec9MqRavpdVxmMLmA8W1Zp56OMjgvDEnwo0ZJd5587jbu0CnZLLBsnTirE?= =?us-ascii?Q?m2BAZ2Umn5pr82TU7xLuOWk8UT6rtlDvchqUvuXf6gKpQOIeYJBk4yeXES5X?= =?us-ascii?Q?IccHitVJqonqdx5hfbvjXPbaeSpNaMa3GxUd08HkhhNDOENlJahlYWB5rLgE?= =?us-ascii?Q?qC9MCKtJG1RuA84IeXJGrrTFA5cS1gktqEz2oTEf4Bo5rrZyX9gzCb/F6/pk?= =?us-ascii?Q?nN1uKQAqIj4sKx5C+sWhhs2LTZwVsLlH3Yz/nmWr3Wmrg/2XtdPlnzqSP8JF?= =?us-ascii?Q?ssK4Ty+0mJMAI3vNcoFBjG2WTmx6LzC1RvHzW5jhkPpiB04oaMKFu92oGvhM?= =?us-ascii?Q?m1p5X5KRFC6kTDA9fTQlxCou1WBe+pGgOWSPDuQbhKfvTvgToWIj6Nsf/NIz?= =?us-ascii?Q?DnjHNumjy6u98Nu+pNf4sU7FvR178voXevfEFQbQG1hfsh8pfKJEe7DoaGNO?= =?us-ascii?Q?UBtNo2WlQ84eo6pEZYjB0UQGCSzZzPDOkIk3B5JaVtZ7kX+IF5RFx15qCkkB?= =?us-ascii?Q?DDrpQ7LJRm7U03dv75Rso0rstwPgSpwW/8CANyi+Af6shSzx4fBuaxBQRmUV?= =?us-ascii?Q?wzg0ejy3IYZyeGcJc5iWoppcpHVZWgavy+609P1H2hcMwCm0NV4zNqvJswfT?= =?us-ascii?Q?F74ZNTrP9DCCaAguBxUBOobHYynAtyBxMGFcY+N49U7F7ZQHW7ohq0lDZmYN?= =?us-ascii?Q?EOJNt5SQ1s47tZSkVjjM7oHNKAq2xlA1eI/afIIYS34FWHI37eKdAGdOUkmP?= =?us-ascii?Q?dutFdZxeWCrSbhwnH5NuzOiAMaEXrzjXSrAA79/FWNNniZtLgpCCsHi2fDDj?= =?us-ascii?Q?jVJVo6hkHVAgqmR+txomSDhqTxGOZ7sHAIWQXxT7quua9UPQDBXu9PmLkesr?= =?us-ascii?Q?WIAqWI4Ycixzm1C/K6a8R7R+xSOfzhmpstLpyIT734GY+DtHbvlhtTWjkRPO?= =?us-ascii?Q?QJbL6I1gKOnVN1n5BXhl2a3TjWy3ioC53svJdLj0sYT2MkeW+Prua0aLbBvZ?= =?us-ascii?Q?IQt9yI4iq882PnFDXhT9pl2jzfkxitbugQiaPNsWjSne6QH3ZQ09yePg0To0?= =?us-ascii?Q?jSv5dJcgBfm6gOjOruupJ5LMpmYB8l3ne5x5j6SvbF5uAv2A+GSudOrVTsFp?= =?us-ascii?Q?1ofQy1G53TMl6IwmVN2Zvg8cZAVXWIEpIpcUdAYkvbMXe+Mqdwo9lT6++Tjl?= =?us-ascii?Q?1tFz3xq/fQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c47b089d-f7f7-4b10-da25-08da290cf8b6 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 11:48:11.9423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ltnrv6twiZpYILfHkWf7ROP79kf51FjObZzfLg/S1ngEs8DgBtJ18aABcu0IfLfo X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8162 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Remove sec era 1 to 7 IPsec and caam operations code as none of the NXP platform use it. Signed-off-by: Gagandeep Singh --- drivers/common/dpaax/caamflib/desc/ipsec.h | 34 +++------------- .../dpaax/caamflib/rta/fifo_load_store_cmd.h | 15 ------- .../common/dpaax/caamflib/rta/header_cmd.h | 15 +------ drivers/common/dpaax/caamflib/rta/jump_cmd.h | 16 -------- drivers/common/dpaax/caamflib/rta/key_cmd.h | 12 ------ drivers/common/dpaax/caamflib/rta/math_cmd.h | 29 -------------- drivers/common/dpaax/caamflib/rta/move_cmd.h | 39 ++++--------------- drivers/common/dpaax/caamflib/rta/nfifo_cmd.h | 6 --- .../common/dpaax/caamflib/rta/operation_cmd.h | 20 ---------- .../common/dpaax/caamflib/rta/protocol_cmd.h | 29 -------------- 10 files changed, 15 insertions(+), 200 deletions(-) diff --git a/drivers/common/dpaax/caamflib/desc/ipsec.h b/drivers/common/dpaax/caamflib/desc/ipsec.h index 668d21649d..8ec6aac915 100644 --- a/drivers/common/dpaax/caamflib/desc/ipsec.h +++ b/drivers/common/dpaax/caamflib/desc/ipsec.h @@ -774,14 +774,9 @@ cnstr_shdsc_ipsec_encap(uint32_t *descbuf, bool ps, bool swap, COPY_DATA(p, pdb->ip_hdr, pdb->ip_hdr_len); SET_LABEL(p, hdr); pkeyjmp = JUMP(p, keyjmp, LOCAL_JUMP, ALL_TRUE, BOTH|SHRD); - if (authdata->keylen) { - if (rta_sec_era < RTA_SEC_ERA_6) - KEY(p, MDHA_SPLIT_KEY, authdata->key_enc_flags, - authdata->key, authdata->keylen, - INLINE_KEY(authdata)); - else - __gen_auth_key(p, authdata); - } + if (authdata->keylen) + __gen_auth_key(p, authdata); + if (cipherdata->keylen) KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key, cipherdata->keylen, INLINE_KEY(cipherdata)); @@ -841,14 +836,9 @@ cnstr_shdsc_ipsec_decap(uint32_t *descbuf, bool ps, bool swap, __rta_copy_ipsec_decap_pdb(p, pdb, cipherdata->algtype); SET_LABEL(p, hdr); pkeyjmp = JUMP(p, keyjmp, LOCAL_JUMP, ALL_TRUE, BOTH|SHRD); - if (authdata->keylen) { - if (rta_sec_era < RTA_SEC_ERA_6) - KEY(p, MDHA_SPLIT_KEY, authdata->key_enc_flags, - authdata->key, authdata->keylen, - INLINE_KEY(authdata)); - else - __gen_auth_key(p, authdata); - } + if (authdata->keylen) + __gen_auth_key(p, authdata); + if (cipherdata->keylen) KEY(p, KEY1, cipherdata->key_enc_flags, cipherdata->key, cipherdata->keylen, INLINE_KEY(cipherdata)); @@ -1248,12 +1238,6 @@ cnstr_shdsc_ipsec_new_encap(uint32_t *descbuf, bool ps, LABEL(l2copy); REFERENCE(pl2copy); - if (rta_sec_era < RTA_SEC_ERA_8) { - pr_err("IPsec new mode encap: available only for Era %d or above\n", - USER_SEC_ERA(RTA_SEC_ERA_8)); - return -ENOTSUP; - } - PROGRAM_CNTXT_INIT(p, descbuf, 0); if (swap) PROGRAM_SET_BSWAP(p); @@ -1363,12 +1347,6 @@ cnstr_shdsc_ipsec_new_decap(uint32_t *descbuf, bool ps, LABEL(hdr); REFERENCE(phdr); - if (rta_sec_era < RTA_SEC_ERA_8) { - pr_err("IPsec new mode decap: available only for Era %d or above\n", - USER_SEC_ERA(RTA_SEC_ERA_8)); - return -ENOTSUP; - } - PROGRAM_CNTXT_INIT(p, descbuf, 0); if (swap) PROGRAM_SET_BSWAP(p); diff --git a/drivers/common/dpaax/caamflib/rta/fifo_load_store_cmd.h b/drivers/common/dpaax/caamflib/rta/fifo_load_store_cmd.h index 287e09cd75..51d54deb16 100644 --- a/drivers/common/dpaax/caamflib/rta/fifo_load_store_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/fifo_load_store_cmd.h @@ -68,11 +68,6 @@ rta_fifo_load(struct program *program, uint32_t src, pr_err("SEQ FIFO LOAD: Invalid command\n"); goto err; } - if ((rta_sec_era <= RTA_SEC_ERA_5) && (flags & AIDF)) { - pr_err("SEQ FIFO LOAD: Flag(s) not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } if ((flags & VLF) && ((flags & EXT) || (length >> 16))) { pr_err("SEQ FIFO LOAD: Invalid usage of VLF\n"); goto err; @@ -244,11 +239,6 @@ rta_fifo_store(struct program *program, uint32_t src, goto err; } } - if ((rta_sec_era == RTA_SEC_ERA_7) && (src == AFHA_SBOX)) { - pr_err("FIFO STORE: AFHA S-box not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } /* write output data type field */ ret = __rta_map_opcode(src, fifo_store_table, @@ -263,11 +253,6 @@ rta_fifo_store(struct program *program, uint32_t src, if (encrypt_flags & TK) opcode |= (0x1 << FIFOST_TYPE_SHIFT); if (encrypt_flags & EKT) { - if (rta_sec_era == RTA_SEC_ERA_1) { - pr_err("FIFO STORE: AES-CCM source types not supported\n"); - ret = -EINVAL; - goto err; - } opcode |= (0x10 << FIFOST_TYPE_SHIFT); opcode &= (uint32_t)~(0x20 << FIFOST_TYPE_SHIFT); } diff --git a/drivers/common/dpaax/caamflib/rta/header_cmd.h b/drivers/common/dpaax/caamflib/rta/header_cmd.h index 45aefa04c1..779f84ebcb 100644 --- a/drivers/common/dpaax/caamflib/rta/header_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/header_cmd.h @@ -155,12 +155,6 @@ rta_job_header(struct program *program, goto err; } - if ((rta_sec_era < RTA_SEC_ERA_7) && (flags & MTD) && !(flags & TD)) { - pr_err("JOB_DESC: Trying to MTD a descriptor that is not a TD. SEC Program Line: %d\n", - program->current_pc); - goto err; - } - if ((flags & EXT) && !(flags & SHR) && (start_idx < 2)) { pr_err("JOB_DESC: Start index must be >= 2 in case of no SHR and EXT. SEC Program Line: %d\n", program->current_pc); @@ -183,15 +177,8 @@ rta_job_header(struct program *program, hdr_ext |= ext_flags & DSEL_MASK; } - if (ext_flags & FTD) { - if (rta_sec_era <= RTA_SEC_ERA_5) { - pr_err("JOB_DESC: Fake trusted descriptor not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } - + if (ext_flags & FTD) hdr_ext |= HDR_EXT_FTD; - } } if (flags & RSMS) opcode |= HDR_RSLS; diff --git a/drivers/common/dpaax/caamflib/rta/jump_cmd.h b/drivers/common/dpaax/caamflib/rta/jump_cmd.h index 18f781e373..0ce5a3e7c6 100644 --- a/drivers/common/dpaax/caamflib/rta/jump_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/jump_cmd.h @@ -7,8 +7,6 @@ #ifndef __RTA_JUMP_CMD_H__ #define __RTA_JUMP_CMD_H__ -extern enum rta_sec_era rta_sec_era; - static const uint32_t jump_test_cond[][2] = { { NIFP, JUMP_COND_NIFP }, { NIP, JUMP_COND_NIP }, @@ -59,20 +57,6 @@ rta_jump(struct program *program, uint64_t address, unsigned int start_pc = program->current_pc; int ret = -EINVAL; - if (((jump_type == GOSUB) || (jump_type == RETURN)) && - (rta_sec_era < RTA_SEC_ERA_4)) { - pr_err("JUMP: Jump type not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } - - if (((jump_type == LOCAL_JUMP_INC) || (jump_type == LOCAL_JUMP_DEC)) && - (rta_sec_era <= RTA_SEC_ERA_5)) { - pr_err("JUMP_INCDEC: Jump type not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } - switch (jump_type) { case (LOCAL_JUMP): /* diff --git a/drivers/common/dpaax/caamflib/rta/key_cmd.h b/drivers/common/dpaax/caamflib/rta/key_cmd.h index ec3fbcaf61..714918e18b 100644 --- a/drivers/common/dpaax/caamflib/rta/key_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/key_cmd.h @@ -54,12 +54,6 @@ rta_key(struct program *program, uint32_t key_dst, program->current_instruction); goto err; } - if ((rta_sec_era <= RTA_SEC_ERA_5) && - ((flags & VLF) || (flags & AIDF))) { - pr_err("SEQKEY: Flag(s) not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } } else { if ((flags & AIDF) || (flags & VLF)) { pr_err("KEY: Invalid flag. SEC PC: %d; Instr: %d\n", @@ -84,12 +78,6 @@ rta_key(struct program *program, uint32_t key_dst, } if (key_dst == AFHA_SBOX) { - if (rta_sec_era == RTA_SEC_ERA_7) { - pr_err("KEY: AFHA S-box not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } - if (flags & IMMED) { pr_err("KEY: Invalid flag. SEC PC: %d; Instr: %d\n", program->current_pc, diff --git a/drivers/common/dpaax/caamflib/rta/math_cmd.h b/drivers/common/dpaax/caamflib/rta/math_cmd.h index cca70f7e04..532c70c518 100644 --- a/drivers/common/dpaax/caamflib/rta/math_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/math_cmd.h @@ -85,22 +85,7 @@ rta_math(struct program *program, uint64_t operand1, int ret = -EINVAL; unsigned int start_pc = program->current_pc; - if (((op == MATH_FUN_BSWAP) && (rta_sec_era < RTA_SEC_ERA_4)) || - ((op == MATH_FUN_ZBYT) && (rta_sec_era < RTA_SEC_ERA_2))) { - pr_err("MATH: operation not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), program->current_pc, - program->current_instruction); - goto err; - } - if (options & SWP) { - if (rta_sec_era < RTA_SEC_ERA_7) { - pr_err("MATH: operation not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), program->current_pc, - program->current_instruction); - goto err; - } - if ((options & IFB) || (!(options & IMMED) && !(options & IMMED2)) || ((options & IMMED) && (options & IMMED2))) { @@ -258,26 +243,12 @@ rta_mathi(struct program *program, uint64_t operand, int ret = -EINVAL; unsigned int start_pc = program->current_pc; - if (rta_sec_era < RTA_SEC_ERA_6) { - pr_err("MATHI: Command not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), program->current_pc, - program->current_instruction); - goto err; - } - if (((op == MATH_FUN_FBYT) && (options & SSEL))) { pr_err("MATHI: Illegal combination - FBYT and SSEL. SEC PC: %d; Instr: %d\n", program->current_pc, program->current_instruction); goto err; } - if ((options & SWP) && (rta_sec_era < RTA_SEC_ERA_7)) { - pr_err("MATHI: SWP not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), program->current_pc, - program->current_instruction); - goto err; - } - /* Write first operand field */ if (!(options & SSEL)) ret = __rta_map_opcode((uint32_t)operand, math_op1, diff --git a/drivers/common/dpaax/caamflib/rta/move_cmd.h b/drivers/common/dpaax/caamflib/rta/move_cmd.h index d2151c6dd7..ac1280c23a 100644 --- a/drivers/common/dpaax/caamflib/rta/move_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/move_cmd.h @@ -95,26 +95,12 @@ rta_move(struct program *program, int cmd_type, uint64_t src, bool is_move_len_cmd = false; unsigned int start_pc = program->current_pc; - if ((rta_sec_era < RTA_SEC_ERA_7) && (cmd_type != __MOVE)) { - pr_err("MOVE: MOVEB / MOVEDW not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), program->current_pc, - program->current_instruction); - goto err; - } - /* write command type */ if (cmd_type == __MOVEB) { opcode = CMD_MOVEB; } else if (cmd_type == __MOVEDW) { opcode = CMD_MOVEDW; } else if (!(flags & IMMED)) { - if (rta_sec_era < RTA_SEC_ERA_3) { - pr_err("MOVE: MOVE_LEN not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), program->current_pc, - program->current_instruction); - goto err; - } - if ((length != MATH0) && (length != MATH1) && (length != MATH2) && (length != MATH3)) { pr_err("MOVE: MOVE_LEN length must be MATH[0-3]. SEC PC: %d; Instr: %d\n", @@ -153,24 +139,15 @@ rta_move(struct program *program, int cmd_type, uint64_t src, else offset = dst_offset; - if (rta_sec_era < RTA_SEC_ERA_6) { - if (offset) - pr_debug("MOVE: Offset not supported by SEC Era %d. SEC PC: %d; Instr: %d\n", - USER_SEC_ERA(rta_sec_era), - program->current_pc, - program->current_instruction); - /* nothing to do for offset = 0 */ - } else { - ret = math_offset(offset); - if (ret < 0) { - pr_err("MOVE: Invalid offset in MATH register. SEC PC: %d; Instr: %d\n", - program->current_pc, - program->current_instruction); - goto err; - } - - opcode |= (uint32_t)ret; + ret = math_offset(offset); + if (ret < 0) { + pr_err("MOVE: Invalid offset in MATH register. SEC PC: %d; Instr: %d\n", + program->current_pc, + program->current_instruction); + goto err; } + + opcode |= (uint32_t)ret; } /* write source field */ diff --git a/drivers/common/dpaax/caamflib/rta/nfifo_cmd.h b/drivers/common/dpaax/caamflib/rta/nfifo_cmd.h index 85092d9612..8131acd9e4 100644 --- a/drivers/common/dpaax/caamflib/rta/nfifo_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/nfifo_cmd.h @@ -102,12 +102,6 @@ rta_nfifo_load(struct program *program, uint32_t src, LDST_SRCDST_WORD_INFO_FIFO; unsigned int start_pc = program->current_pc; - if ((data == AFHA_SBOX) && (rta_sec_era == RTA_SEC_ERA_7)) { - pr_err("NFIFO: AFHA S-box not supported by SEC Era %d\n", - USER_SEC_ERA(rta_sec_era)); - goto err; - } - /* write source field */ ret = __rta_map_opcode(src, nfifo_src, nfifo_src_sz[rta_sec_era], &val); if (ret < 0) { diff --git a/drivers/common/dpaax/caamflib/rta/operation_cmd.h b/drivers/common/dpaax/caamflib/rta/operation_cmd.h index 3d339cb0a0..fe1ac37ee8 100644 --- a/drivers/common/dpaax/caamflib/rta/operation_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/operation_cmd.h @@ -19,8 +19,6 @@ __rta_alg_aai_aes(uint16_t aai) uint16_t aes_mode = aai & OP_ALG_AESA_MODE_MASK; if (aai & OP_ALG_AAI_C2K) { - if (rta_sec_era < RTA_SEC_ERA_5) - return -1; if ((aes_mode != OP_ALG_AAI_CCM) && (aes_mode != OP_ALG_AAI_GCM)) return -EINVAL; @@ -30,9 +28,6 @@ __rta_alg_aai_aes(uint16_t aai) case OP_ALG_AAI_CBC_CMAC: case OP_ALG_AAI_CTR_CMAC_LTE: case OP_ALG_AAI_CTR_CMAC: - if (rta_sec_era < RTA_SEC_ERA_2) - return -EINVAL; - /* no break */ case OP_ALG_AAI_CTR: case OP_ALG_AAI_CBC: case OP_ALG_AAI_ECB: @@ -72,9 +67,6 @@ __rta_alg_aai_md5(uint16_t aai) { switch (aai) { case OP_ALG_AAI_HMAC: - if (rta_sec_era < RTA_SEC_ERA_2) - return -EINVAL; - /* no break */ case OP_ALG_AAI_SMAC: case OP_ALG_AAI_HASH: case OP_ALG_AAI_HMAC_PRECOMP: @@ -89,9 +81,6 @@ __rta_alg_aai_sha(uint16_t aai) { switch (aai) { case OP_ALG_AAI_HMAC: - if (rta_sec_era < RTA_SEC_ERA_2) - return -EINVAL; - /* no break */ case OP_ALG_AAI_HASH: case OP_ALG_AAI_HMAC_PRECOMP: return 0; @@ -115,15 +104,6 @@ __rta_alg_aai_rng(uint16_t aai) return -EINVAL; } - /* State Handle bits are valid only for SEC Era >= 5 */ - if ((rta_sec_era < RTA_SEC_ERA_5) && rng_sh) - return -EINVAL; - - /* PS, AI, SK bits are also valid only for SEC Era >= 5 */ - if ((rta_sec_era < RTA_SEC_ERA_5) && (aai & - (OP_ALG_AAI_RNG4_PS | OP_ALG_AAI_RNG4_AI | OP_ALG_AAI_RNG4_SK))) - return -EINVAL; - switch (rng_sh) { case OP_ALG_AAI_RNG4_SH_0: case OP_ALG_AAI_RNG4_SH_1: diff --git a/drivers/common/dpaax/caamflib/rta/protocol_cmd.h b/drivers/common/dpaax/caamflib/rta/protocol_cmd.h index e9f20703f2..ac5c8af716 100644 --- a/drivers/common/dpaax/caamflib/rta/protocol_cmd.h +++ b/drivers/common/dpaax/caamflib/rta/protocol_cmd.h @@ -32,9 +32,6 @@ __rta_ssl_proto(uint16_t protoinfo) case OP_PCL_TLS_ECDHE_RSA_WITH_RC4_128_SHA: case OP_PCL_TLS_ECDH_anon_WITH_RC4_128_SHA: case OP_PCL_TLS_ECDHE_PSK_WITH_RC4_128_SHA: - if (rta_sec_era == RTA_SEC_ERA_7) - return -EINVAL; - /* fall through if not Era 7 */ case OP_PCL_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA: case OP_PCL_TLS_RSA_WITH_DES_CBC_SHA: case OP_PCL_TLS_RSA_WITH_3DES_EDE_CBC_SHA: @@ -215,9 +212,6 @@ __rta_ipsec_proto(uint16_t protoinfo) switch (proto_cls1) { case OP_PCL_IPSEC_AES_NULL_WITH_GMAC: - if (rta_sec_era < RTA_SEC_ERA_2) - return -EINVAL; - /* no break */ case OP_PCL_IPSEC_AES_CCM8: case OP_PCL_IPSEC_AES_CCM12: case OP_PCL_IPSEC_AES_CCM16: @@ -229,9 +223,6 @@ __rta_ipsec_proto(uint16_t protoinfo) return 0; return -EINVAL; case OP_PCL_IPSEC_NULL: - if (rta_sec_era < RTA_SEC_ERA_2) - return -EINVAL; - /* no break */ case OP_PCL_IPSEC_DES_IV64: case OP_PCL_IPSEC_DES: case OP_PCL_IPSEC_3DES: @@ -351,9 +342,6 @@ __rta_blob_proto(uint16_t protoinfo) switch (protoinfo & OP_PCL_BLOB_REG_MASK) { case OP_PCL_BLOB_AFHA_SBOX: - if (rta_sec_era < RTA_SEC_ERA_3) - return -EINVAL; - /* no break */ case OP_PCL_BLOB_REG_MEMORY: case OP_PCL_BLOB_REG_KEY1: case OP_PCL_BLOB_REG_KEY2: @@ -368,12 +356,6 @@ __rta_blob_proto(uint16_t protoinfo) static inline int __rta_dlc_proto(uint16_t protoinfo) { - if ((rta_sec_era < RTA_SEC_ERA_2) && - (protoinfo & (OP_PCL_PKPROT_DSA_MSG | OP_PCL_PKPROT_HASH_MASK | - OP_PCL_PKPROT_EKT_Z | OP_PCL_PKPROT_DECRYPT_Z | - OP_PCL_PKPROT_DECRYPT_PRI))) - return -EINVAL; - switch (protoinfo & OP_PCL_PKPROT_HASH_MASK) { case OP_PCL_PKPROT_HASH_MD5: case OP_PCL_PKPROT_HASH_SHA1: @@ -482,9 +464,6 @@ __rta_dkp_proto(uint16_t protoinfo) static inline int __rta_3g_dcrc_proto(uint16_t protoinfo) { - if (rta_sec_era == RTA_SEC_ERA_7) - return -EINVAL; - switch (protoinfo) { case OP_PCL_3G_DCRC_CRC7: case OP_PCL_3G_DCRC_CRC11: @@ -497,9 +476,6 @@ __rta_3g_dcrc_proto(uint16_t protoinfo) static inline int __rta_3g_rlc_proto(uint16_t protoinfo) { - if (rta_sec_era == RTA_SEC_ERA_7) - return -EINVAL; - switch (protoinfo) { case OP_PCL_3G_RLC_NULL: case OP_PCL_3G_RLC_KASUMI: @@ -513,13 +489,8 @@ __rta_3g_rlc_proto(uint16_t protoinfo) static inline int __rta_lte_pdcp_proto(uint16_t protoinfo) { - if (rta_sec_era == RTA_SEC_ERA_7) - return -EINVAL; - switch (protoinfo) { case OP_PCL_LTE_ZUC: - if (rta_sec_era < RTA_SEC_ERA_5) - break; case OP_PCL_LTE_NULL: case OP_PCL_LTE_SNOW: case OP_PCL_LTE_AES: -- 2.25.1