From patchwork Mon Jun 12 08:26:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Meenakshi Aggarwal X-Patchwork-Id: 13275798 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06CA3C7EE2E for ; Mon, 12 Jun 2023 08:27:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232487AbjFLI13 (ORCPT ); Mon, 12 Jun 2023 04:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233236AbjFLI0p (ORCPT ); Mon, 12 Jun 2023 04:26:45 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2074.outbound.protection.outlook.com [40.107.105.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ED4CE64; Mon, 12 Jun 2023 01:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wka54C072L8Mzsi4FOpqq4GrL+krtB5/TeJeE/thcG2fjJIw5jbF6edD2gcjETAT7CrwUAqGr5foGT7mY6HuDa+4VGVAwoSTN2qFHkBI6qhORG3ONU8BSPc5rHiD/NTsP3no+Kkmox/IoN9npxIfCrQh+kjEdNHtUWjue2RmtjIG4HWEN3N/y9eJ4j6lCfJK/VLqmZAB4MQQyCbSL29Sf9/KCpPf4GVFNXJf6mtdfNc4e9tbQtCTTd1spWByrJpDN3+s10UYIyXv7mntOJZMPLd2C68CFWWKq8tEhglUrQKdEhOV91GFJefvNUlEjRhJ5iID46r2s2L1t9TObJTwIA== 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=2GUfq4DfF02m81H3rwkS5ZRgC/qEvG0Gr9SdoU6yEVc=; b=iGTBtnQ1Hng6rCM1NcZq4zSTpkMnGiwWwbHVlm0uQ56uY2bXXzkD5FeSg2XWr8XnPdDKk27G5PffswypDIltr9njWeRx4alafuiqOnuwrqeuYTfW0MboN1dr1x+8hYNTx+CqzXtEcc3yKm9fkY/T+GtdqqKLuabGth0wdk88TynFWhOs1B4+DAJhHmXyqKOdL9ii78fX/wlidA3uzmH0xl5F8hnI19S+YZhAZdy5by1+BEb33q9g1DF3GDMhdzmU4kTXu9hqDfXbiVNcHG+DNhuxF7ZkabSIxpaeJgPd2JgPu/zAgWJbIOcrstXfxT7OmZOKL7qP4WIsf4a76l0kwQ== 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=2GUfq4DfF02m81H3rwkS5ZRgC/qEvG0Gr9SdoU6yEVc=; b=a3IpqrWZvO3DyUsgzoaxSKqfClWqEZy0YS8kDXXBvFRVJoF9fd1MVXSn/qPCeI0CdWLtUox4khqMxYkCrbVQnHkS9XLZNv6Lk85jrK5v1j7yv8+LCBxgmm0hTvaEvrSoDyXXdN0b7WZdFHKurTXR1KBWCplN0ITymEw72eAVe9s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU0PR04MB9563.eurprd04.prod.outlook.com (2603:10a6:10:314::7) by AS1PR04MB9429.eurprd04.prod.outlook.com (2603:10a6:20b:4db::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 12 Jun 2023 08:26:40 +0000 Received: from DU0PR04MB9563.eurprd04.prod.outlook.com ([fe80::adc3:90c7:4b37:392c]) by DU0PR04MB9563.eurprd04.prod.outlook.com ([fe80::adc3:90c7:4b37:392c%5]) with mapi id 15.20.6477.028; Mon, 12 Jun 2023 08:26:40 +0000 From: meenakshi.aggarwal@nxp.com To: horia.geanta@nxp.com, V.sethi@nxp.com, pankaj.gupta@nxp.com, gaurav.jain@nxp.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Victoria Milhoan , Dan Douglass , Vipul Kumar Subject: [PATCH] crypto: caam - adjust RNG timing to support more devices Date: Mon, 12 Jun 2023 10:26:15 +0200 Message-Id: <20230612082615.1255357-1-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: AS4P190CA0014.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::18) To DU0PR04MB9563.eurprd04.prod.outlook.com (2603:10a6:10:314::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9563:EE_|AS1PR04MB9429:EE_ X-MS-Office365-Filtering-Correlation-Id: a316acff-5381-4344-3828-08db6b1ebf52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A08OUa4vPrUOCDWI3XmkvuGiQdAeFwHdV1b3QIkmcTvShg8ymQJipZ/2MPAu1pq8JGC1ygpAyPBjr9fBdqJc3JgbgcKYsHWx0KAo+bblGZgcQdtmPTyiW7OP2xXrgPXZV1d3YMwT92ks7AMgB3wEr/VS3ASSyk9NIM/PaznKM6VBxhE4P8/nkpqCvpCwq2jIwUrq+npg226M4Z6R8DUNXfXMmlvDUWn44utwDI98+SDhN8YIKkgeuyFeNSvepgQ4qg3T8JASPP/qUBfifU7ZzWjXozBzkbJxJfp8B1nnUfli1dQUBAF0bk9LR3owPwc/XQLkq4YKqCCmP9i6Csm3DyhdjHOQRvgWR4G1zaapUYas619bY3PgbBsvW3SW7U+V0W4fUD+07twvMddBSO+ZMSfsBbGLPYg27ti36g24vZmPQ3180vD75BiEfSX2HnLpUkwtf7Ks3MkcHCOyFLND6Iyhw2WKFCR9JksDZsqCihinMSTK67hRX2UzXc7XTsuXhfML698RtY5uwYWsxu2d14duW1AzDj+l+Gk++LuqwxVR5HZ8lvkpj5GtSltvcvCrS/pR4F8f8SaYBm6xsXsp492BwyTq7MhG7EXi+dm2lokEXADR8XVG8ac5P8xFcs2i X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9563.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(366004)(346002)(136003)(376002)(451199021)(36756003)(86362001)(6666004)(66556008)(54906003)(478600001)(4326008)(316002)(66946007)(66476007)(52116002)(6486002)(8936002)(8676002)(41300700001)(5660300002)(2906002)(38350700002)(38100700002)(2616005)(9686003)(6512007)(6506007)(1076003)(26005)(186003)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?L8neqYf5qP+tWxXS4+VNLutWmCZN?= =?utf-8?q?pKUNPB+pRc9ZNgfaPnvsE1ZVgVyiV6hFiouSz8n3DKGTpggwKf0GeMvgA67Z/IA9h?= =?utf-8?q?VrOOwf0kcBDiZjmw5EVVcqgLRgMkKAK5I3D3Zbc7l8NsaWLIwQDNJ3P4Jpfc+/oQF?= =?utf-8?q?UTIZMlH9YkU/hOZs6D13hyYRUyNa22WFJGLjJA5MoU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JGljM2oPrLCQtqmfs8/EFI?= =?utf-8?q?6zy+5/wsVYYfEGzvVJ+8HyD6Fo6fvLuxPneNnwiFPLaCKVV1oFywpzhU/o5V78Jlx?= =?utf-8?q?MTbNNUmWqrQn9QnvyF+ANl6Dq7bqFvRQ2W9mSz/FjdMjsoW475D6orxGWCSKWWI/f?= =?utf-8?q?RAC3+J0duLb6GVrnq6oIabYpHwAzwXSaWKp9o7Wvp6NErxXXML9ic1KP7O0MOjBj6?= =?utf-8?q?J0jkk905aV5Of3/2sIu3lVt22eFHRWLpwf1wO6ESi+zNgTqpzqnqpZL3FGuL0EKaF?= =?utf-8?q?LXlCzMGQnJXAx/5Rg1bnXHUMB/FtYGwUBIN+Cbx4/ywLP164s7Ydl9kt4k13tyFPN?= =?utf-8?q?JWauXDaVQC/SwPSqCTiQoDbJPPUIfHUS1sQ8PrMEi+ZS70GeIIuNE5dbFwD1pQ8wl?= =?utf-8?q?RQyIGGNXjWYLkLwgM6SMrL0JsiNPF/wVB8mkgDuvTZic09I/EY4UYz6oIHSz/48Wi?= =?utf-8?q?ON2KqjOtZ3GgV0HdAPp56BJYtO/aLSUbhQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a316acff-5381-4344-3828-08db6b1ebf52 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9563.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 08:26:40.7811 (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: sFAQJ6fwvfcHK3ZggkZE+kvPbr/mOfoPqH03rr5aiiJ8yPBdq7ECcw478Up/MW87cWa/tHecg9SetpZ1wRnh1+W4wJ1IEi60AHMm1Spr6Ok= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9429 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Victoria Milhoan Adjust RNG timing parameters to support more i.MX6 devices. Signed-off-by: Victoria Milhoan Signed-off-by: Dan Douglass Signed-off-by: Vipul Kumar Signed-off-by: Horia Geantă Reviewed-by: Gaurav Jain --- drivers/crypto/caam/ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 5fed3cf354c0..62dd069942e4 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -383,8 +383,8 @@ static void kick_trng(struct device *dev, int ent_delay) wr_reg32(&r4tst->rtsdctl, val); /* min. freq. count, equal to 1/4 of the entropy sample length */ wr_reg32(&r4tst->rtfrqmin, ent_delay >> 2); - /* disable maximum frequency count */ - wr_reg32(&r4tst->rtfrqmax, RTFRQMAX_DISABLE); + /* max. freq. count, equal to 16 times the entropy sample length */ + wr_reg32(&r4tst->rtfrqmax, ent_delay << 4); /* read the control register */ val = rd_reg32(&r4tst->rtmctl); start_rng: