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 8B173A0093; Fri, 22 Apr 2022 05:52:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8F0842807; Fri, 22 Apr 2022 05:51:48 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20078.outbound.protection.outlook.com [40.107.2.78]) by mails.dpdk.org (Postfix) with ESMTP id 7173C4280E for ; Fri, 22 Apr 2022 05:51:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KhZggIs4wf3S6FDsQ0La6sxnqAWzYaVrmpFiiLwbH2PSLYV8NBDLf/GpfbhUMAp/lytrQZn5iTW+/433WACgMgRrBcINq/OTHNK4f6In/SeglQEw4J8js6yRolVRowCXUPICXlZjm+xX5tTsrGyotHnG5Et6HBVnLFGsSRM1Lkf4E0JrButtDilIAWUrqpMTqbfQSYVm5EQZljNLXrwGYVAMRu3WJ3+OJHH0yV6iGBY3MAb4UhXUrTPusrfJz62OE2yDcyb0MXiyN3jOtLz/Cc4yMgW9tedLhqhMxixmDiJE9aQ+MNcUrvofZHXlfl0V9c5hPutl6nrQlP5N9PD32w== 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=KneDxkJyiv5RSvTRrhspuhOL29+nLxSB1NF3Q8xNyRscry3PSU6OajlwN8HAuPb8etYXWrUtKRP6LthQjQDcVke9ZkXM6Lj52cMNvbg5p96MS5lk7x1wlmoHhScEcS//knjPcOXN9br0B3YR6LUrwpUqbTOeRhU4ORfkj/Nur92Lln/GPrF8uORckZjfKLg0DHGr7A32Dam8teBuPEWX1d+sn64jIAjVcXIL56H+Swm2tTE0pAfVtdFcQn3UBKfMbS87BhTAXKClm3OKivAM0BpJ6HPyRlsP2RyrD2USXmzVgENexX+43ZespLM6ZDs/E5GgNOw1JETf7bGAVwA1Ew== 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=dgSljKFUzZjUjNYnIW8xPc6ZOhlnjf0VTdAJIoFJaM1SzcPyloHcOcWY02U4eVjoZhRIvVBUGlTdzYi31HHOtlJp1Hwfw6cRchfbyC2HN7iNtPivlyRQixnERC0NN26ojQGZpXjViLjdBz8+RoPbFIbaMA/J9by7w0O7BATwmLw= 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 DB7PR04MB4393.eurprd04.prod.outlook.com (2603:10a6:5:32::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Fri, 22 Apr 2022 03:51:46 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::8cf1:93b:c340:3be2%7]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 03:51:46 +0000 From: Gagandeep Singh To: gakhil@marvell.com, dev@dpdk.org Cc: Gagandeep Singh Subject: [PATCH 07/14] dpaax/caamflib: remove obsolete code Date: Fri, 22 Apr 2022 09:20:53 +0530 Message-Id: <20220422035100.3180870-7-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220422035100.3180870-1-g.singh@nxp.com> References: <20220422035100.3180870-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) 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: b3f0ba49-9e62-4bfe-1cae-08da24136ba7 X-MS-TrafficTypeDiagnostic: DB7PR04MB4393: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: /tJwirlH8aGJZ/UC4uCYMHa4YMZ70nw6gN/vdEYqzXy6CPd+QBO/E0KkSH0TcsXbSg2H/dVMdIQQhyE2evLs+kbM1m0bnMU2lMi+6esGO2yp3T0fwgECw+fXlkAdp+EklcTe7rml6bft0NNZWhAM/pJyAOmC0i6+euPzshj1dvxVATsvlXCAyRkuKEyUZcMT8GQRoOtryVm8a/dnbnWl7cVR+tTJp2EwM53edKwFlPFYP7UlLmeGodc3u4TafDn9np/iFV+/TOlYWjFHgsUs/FMKhqCv2w5ZEDI87mNn9LG6/qNridmiYehQGB65c1Tj2naKClDO8nG6gRfcT1C3DqoJG08Ijk5oYtYwTlAF7Od5jeTV/ONN5faMnbMbQ0IGS9pL57uJeTFQDFU/ZRPYRDocvkH0R2jZX+RYvzMUTrPrFBPBSV4gV45S/nmhD2woR5RgZ7hX0ZcRqxrRO5e61+yL09gvhSr8wZmzTOsnEbA92CM+q/gdqH0lfmBA/MsaqiDq/2cQOHDHvXWDpeCT571CAc+4MKBnP4J7+03hoQVPMR+YgsNF8Zjil112OkBbDLrtZrkopGtGJCx+BjWoUda8+x/zRWSYURBU+JlPSNrAPtSOFANvN+UchVbNSMrDdvzPa23X2BS/JVpSlpXh9WIZO/VtyuXoGs8FgLFF/SC7cIqpfQgqsAj7jby8QaFP2B5iiqkaghCm7JmPrcB27A== 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)(5660300002)(36756003)(2616005)(6486002)(30864003)(1076003)(8936002)(86362001)(316002)(52116002)(66946007)(26005)(6506007)(6512007)(186003)(66556008)(6666004)(66476007)(83380400001)(38350700002)(38100700002)(508600001)(4326008)(55236004)(2906002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?b9rZ6JWvJuThLtw+pAh2C9jdCJkXdWMUvtJIQ0WjDmQo7+sUdzGTTR6tS8T4?= =?us-ascii?Q?JqIzlumM4qYRlhKgsSlAmd4gnr8bGwzmfH7Jba88mKt4fabQ8llD3/sMnYSf?= =?us-ascii?Q?QHrzgj/E1GzCnYhVai7qdlrKsvRLZNcfvCpJ5OGKbBVOSH/bj+hr6G8UDiwl?= =?us-ascii?Q?50iVSVTo5LKB9+wiHLZ0tqOuSugzb+yr6GCLJaiRyiFlLp/kVJh3wRLaHojw?= =?us-ascii?Q?i16syUwc1SAbticzL/S/yyhCOu5tyVuDcSqm2u/HXv0ArcfVj3IhRJG4Uvqk?= =?us-ascii?Q?Xtbu3dpx3g9kvM7nEsy0B6RqYLbe2AUcOmc76zEQyhwZEbhModIKPGCmIB63?= =?us-ascii?Q?rOHBXpiPfOO0HtLokzL4q5Y65JzJY13pXoT5VAmB++lH527RrDlzEecnb4X4?= =?us-ascii?Q?PQY9lcQxTOt0z9En7WxwyKZEQT8etRVDyjvrra/V00teBx37X9AdNvkw4XkH?= =?us-ascii?Q?eC2XuPQSf7tnjXrJjW9GvHMpsG4zQN1ke8sc7DD0x/pcIct2uwlnkl1IbmdY?= =?us-ascii?Q?oVz2nxJP7Dv7yoOcGJPKZ1FJQJgOuhTHe9LFpDzy26NcCbtg1KB9upWqaLxB?= =?us-ascii?Q?JDAcdqrGQfHZyLzG90Z9jszdKz975nE5jGgUw5vEzJMD++YUcXqm1RiACgk4?= =?us-ascii?Q?Hm4OzRE2jMGGvjn/pSlXrQ/Lb5DFRlu1IMB5+q5qUQMWhuQm/QfvzfWeYx+G?= =?us-ascii?Q?o+mLOhPm7WzrP8ZzKuZYLJQDOSt1ronfE7pzeH6wjA9rzDQf1SQT53zlI9cA?= =?us-ascii?Q?TN7iuWEK+aQyDMsPBudlcis0Bk0vxAqtrwk0a7sWnHvWBCv1Y7aR3UlBJ+6V?= =?us-ascii?Q?jnDPQxJypueGbooESMTZRHJ85e4DgfThVHQKDJlDdNinkUi/xvYQjFcwFCaI?= =?us-ascii?Q?YSgYDWTJeyPX5VsY8/eqiOYlIHwfDr1w/jJkZt66vZK2DXXMa+8vDqc9Yftc?= =?us-ascii?Q?n7G1Y+UC9UTAfSU4/yROvx9qbn2p9HKkMLBZxZdfHxV8U8v/E8dFN1XTWvSa?= =?us-ascii?Q?8S3vcNcS94gCwXR4sGKmL2TBh10WuQ+EGeCtwzF+8CEWufQ/pb+aNJHA2EkN?= =?us-ascii?Q?AqKcb5suW/jsbH+vjay+/azerCGEtLtRrKqbGSCwVQ0kZC6FONfd2ptpEb4I?= =?us-ascii?Q?yGn56wGrcVicmWYjmUhYqkC/c9d48kLjKce8BrnrVqABlf3m5/X5yEDLCOTn?= =?us-ascii?Q?cgQPm87fsAjoGiexubxA77WrRZSKA7HiwJZdE9Ghlcq22JivLjl9rET/dD2s?= =?us-ascii?Q?8mKavwJzvMqGhRgA67MrnRl+j5sU20U7t+Smp6rJDF9EpU4hz6XrX+RPjfXe?= =?us-ascii?Q?vhhETTDuag1Z0aubomp9GjJqkJxo7vu5VR39vnGRJcwcE94I3avyM+pdsSWg?= =?us-ascii?Q?b+OrDT3VulzB1tSC0OwK2LJmFSvaNwwfzS95Byw/Wz7I0G6b3LoJds6w1IbY?= =?us-ascii?Q?c9bBCJe/Z7YdCDW0th128aV0D7uz1OPsq2lmWQmLh8mhSXjkYyS3t2e2lBPA?= =?us-ascii?Q?gCR9ejUf61+Ka5k3GE3+1+/jaFH8ck5MebdqXbff/AmemH23qQDhNqaAU7Hn?= =?us-ascii?Q?qqI9of6lktXcZy5YNKJsW7gkzqSjQUw1KGIhTU03cdiVOJR/mN0b/RPkgOPn?= =?us-ascii?Q?n/eM+KB15mxx0MzdgkJnIvnHl82ArMi5mWuXEOyBE3/Ymqsqeith4g4CiRAn?= =?us-ascii?Q?oMIoX3MGMnhy7CDIGFflYcdqLcG10htvWYygn34JxbPaHrFcslcU+O+Hdkik?= =?us-ascii?Q?uPK8Szk/LA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3f0ba49-9e62-4bfe-1cae-08da24136ba7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 03:51:45.9813 (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: l75Yd2LwVmUCOyt+uzIYfXoJ0MO0kFTvRiEVxlEG3igE1GyflbWZRzQQ/kfkkXx9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4393 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