From patchwork Mon Apr 29 06:28:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 793157 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2082.outbound.protection.outlook.com [40.107.14.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D47D614005; Mon, 29 Apr 2024 06:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.14.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714372299; cv=fail; b=GCaozbvUpMZi8SxJrT5mvntehfiYy5TvshtXodOEyMzdujkqJeQFPgYmyS1tuDk4W4MUsT9Ujd4JATw86aNc5ZuEmBq1NzRjDedB0FNg3HPECXtdoFX/Gsp7qMVNAVipWJkCBM0dBA+fZeB58nchBQSwh+/LZ45zBPAoVYKRhPs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714372299; c=relaxed/simple; bh=HZjnpdqoTXPEKvzwBPW1pKQHoSOt5dasS5atxl0MdOs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=l4UUhZODouQNwNPhLggW5lbNtIghM63bfwwcTEkvi6wZnGU4NdsRr1BsLyexQlGsPTClDd6b2KW4oVjncwF+5MQ6vqQm6k5UQ1vspD22qwaMeOtzfj7I1ai5OBM64Ktd+qFk0Tf0xOxgjSHZzP0+h7D2dob/IZ11msBGAMMgEk0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=DG5QgFq2; arc=fail smtp.client-ip=40.107.14.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="DG5QgFq2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cCCn/93S1nWNPO2Vdxr44vy8b3YObSqlFMEoWNAuJoNK4pG0aq6GcxgB4noBcR6FggNcgjWAWvllBpASCoKIfGdAJR2CUhKpYyC+JIOBLhxcQJAQbwITJlxNLhNY7aSXxivKrECdAFVvE8KV6Ice0DAfpSIUtTwaO6puu1OPvlL+pZckem4jQKAdIOwErd+KRqmfMpPxzr1qTL4XEQkmL2fNOQB0HA02nNFgofgGZIiZo7q1nxVZ2nlRYoLtVAIzWwHu37LMDh2ofhYBBsmN9ZrDkrlEpkl9Vx9CyC/a/qIl++NTy2pV6sh4vLT2tr1mLVmu3ti7655NXN/++ihndA== 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=908o77j8T4UJZ1C/rwaUWC06rj/MZNwWxqT9RoT1sSA=; b=DSMQ9+p2npZ6sPm51iZGBo4Eu0HVUERNMbDNZ1xUVIVc+jcgw0z9MgTetGqGZzHiuD1wqhRF1Qp4KrYhF2czoOhXbP7dWabnRxCQ2PABxoEqEHyNnu8/AvRpZKb2IoGkISZRPeG3TAGdkgU5Nm138btxm65OXRvjRLfQ7ArwbIAZs5d+NS/fNmDd4p1kG3GrHWFcR+37xb2J4QFR8jcrlpqEHr56fPWtPA20hEjALOVJArK4pRWAL9fgfOBMsIsOBGSyf8H3g8HkA2aX30AiYvnugrc/VFM407FzqQZfZPprkF+fMJ9gcdByoqXE5vbM/IgDfVd33jBqeEbJ6pMPTQ== 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=908o77j8T4UJZ1C/rwaUWC06rj/MZNwWxqT9RoT1sSA=; b=DG5QgFq2gvYb+wYprOqhJVZPQF3lP4q/hHydMDfzJNpyBmDfAK2pVbLz149y7V+ouyDOwRkn51w/t3pSz59lyxnanadhLnXtu0YJMC6TxXH6VZocR3iCn6zAn2mAN2XmBWZ0Jr7spLImJCWEALL9T89MF8n1IQ0bR0LgdWzanpQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) by DUZPR04MB9919.eurprd04.prod.outlook.com (2603:10a6:10:4d9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 06:31:34 +0000 Received: from AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::33cc:db75:c850:63a4]) by AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::33cc:db75:c850:63a4%2]) with mapi id 15.20.7519.031; Mon, 29 Apr 2024 06:31:34 +0000 From: Pankaj Gupta To: gaurav.jain@nxp.com, horia.geanta@nxp.com, V.Sethi@nxp.com, herbert@gondor.apana.org.au, davem@davemloft.net, iuliana.prodan@nxp.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Cc: Pankaj Gupta Subject: [PATCH v4 1/2] caam: init-clk based on caam-page0-access Date: Mon, 29 Apr 2024 11:58:52 +0530 Message-Id: <20240429062855.923595-3-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429062855.923595-1-pankaj.gupta@nxp.com> References: <20240429062855.923595-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR01CA0008.apcprd01.prod.exchangelabs.com (2603:1096:4:191::10) To AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8604:EE_|DUZPR04MB9919:EE_ X-MS-Office365-Filtering-Correlation-Id: 26355f26-3b23-4f37-e80b-08dc681603e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: asfsM4KmqE+Id5OdNRZDHSV1wmkGqv/rcOK6ZGi50TLmeFu2ICmt2pMlgDZ3J4U3G2+xyFuQCXC1kKaJ4aRgGf0jOIwOPdcTC86jWlzaGfSDb7l3lIERLZhhiAwAuHRErffq9DtPn2vVIfuxVx6ecC0gjEH1yP15iLNsfvVDHaEWzEmmQQQjE1AlRIoXsTggLIWgGJHoTCxioHxfUz/JoXQIRmD+ZrXYVut4vZRNDBhlDURSOygi57t9wAZkPO59cFfdhQFnr4cs9uNQGzi0Z4avVH6iU+ET4RmRt1ZtYg3d8PYIIMH018pukKT9nm2WtEDavx8hm46BzICG1jXJcs0wA5iJUECng/tr6/pNTt2crrxTbYZVq4QqTN42UCy8HBwC+DrFcycDvvAKpv/BlPzxbQELppB8LLt78fCIaQ8UASHy6zUaI1nB5s44Kid8MhXc7dk1xfZFyOU3t1wIVmI1IWstgFJM6mvLPlbVibEkbzrPOrU+63JjMvMVcxiaL0d9sM0l+UqhE8FL9fIF4P4EtmaG9JEtDchX4MjrroqgdUOrURUf111mlmTrQV+Nuv1Z6wtI6FvmfDqIOB6wVYKvgSoLXR9/xGcFeUXoe4drs+leDfMVF7QRkYhqYr3KcxVZtnHvJ+BusScn+m+zVhLkAB/U4tADyCpZ9pmseZ88l7LUdzYr6IF/fXXHe47admGe2F1AW8y7JZOKkioL15niev0/r77gj+AmxKpgaV0nnsRhIS4uXk1VlUO/cU+/21YHJd/igv2TSh7KsLvMGFGWDsfZkCGGidV00Juola8Y2IcWQBaQyPLK7NnD5H0LAjLLVjGuR/aSeIUp1NIghfUyz57Q1f69IJNr49hDcixxWSYVzndmVbAymbaG60/oEQ/wTh9WuS8FzYTX53S+NMqbX3FB0pnmuLPcirfP/Fqkv26NGxWbYmDjE99f9RXoFEsOcNXqA+Z2+3yLMiySnJn8HWON+vMmbVI0qgpTEnlVshJYzWF2eLu1goub+hZkgMW4OU62qPL0JjVtArErcm8CLAldBFplJjxsssF1qbfbImyEzu952x/NoAJFdXJ5HY06MV+URgvU5i09JBVsrxtq9l1cNa1E/zJvcA0V5DQFNZRO4XdNOt6sWrS8CtvF1wB+G/Z309xCvgufwdDo5fd03kUnNvefHZYANvy6sRE+V2+LFglBBPFTPWjCDr3HLAp8k6twQJGlNH35SLUwCgCgdUthcjKFnILj++zyjkKMA6bMpyfn5/PN2jJnf9Dfm/ikUPsShwWhRMz8pdQY7sDLfDlipyGyBKVATV5JaMy1TuzxKLyBOMMGxHgqMEOaF9Jig/rqiv7iXdbXNankbA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8604.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E5Z4jiNGsn/t1Kfnd5t7HrI+qY+m80iT8PmG+76M2DPDzPxlCItcP4yeIKdSH1kUD0NL36B1wM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yoLEYomv7wIXlWS0ufgrjrFctwoRc+MbhPnQovM8NsLa6pWDqPFpEoZlxVqOYV5EvFsrDhDpzhSj9dH4QFDrklbSC2BefrWwR5shF0BcNz0Y3bJkQJwgp9e0Ep7ALCEMZo8UkbX7Acss3/R2Q6GeIIX7cSuHH1KLaFouOsiVG1q17UpVEcppfGBfNovxOAN9/IXnyYJ3ivkIoKnsJjW1YxoxZTlamzRwuwkDjnPqglHtoGJfusM4wqEmjrm+YxWuijGa9XX11275ClVQgs3Wft/uCI8HlIwXRE7A6pGKdnZb6M9PaSNAVguJ7260iY3pSXdzkuBt2atXlUwqC03DoijoPvIF7dTVqT5W5YyQ1UeGL0W10ax9UTOkgsMt1bSyuepxwbGI0PpKRHyYNs+1MSLWjFia6eNjNmJ/rbawtReOpgleX21HQSPDV/Aj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26355f26-3b23-4f37-e80b-08dc681603e2 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8604.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 06:31:34.8272 (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: ttUqLv5opveEYOl6dAJIQKnIt8Zj0lMDGZ/8Y8ONq8cTra2rNKe4yDrr3cLXAHbk8tzopuD5cB0YeOdhivgxAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9919 CAAM clock initializat is done based on the basis of soc specific info stored in struct caam_imx_data: - caam-page0-access flag - num_clks CAAM driver needs to be aware of access rights to CAAM control page i.e., page0, to do things differently. Signed-off-by: Pankaj Gupta Reviewed-by: Gaurav Jain --- drivers/crypto/caam/ctrl.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index bdf367f3f679..02363c467cf3 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -512,6 +512,7 @@ static const struct of_device_id caam_match[] = { MODULE_DEVICE_TABLE(of, caam_match); struct caam_imx_data { + bool page0_access; const struct clk_bulk_data *clks; int num_clks; }; @@ -524,6 +525,7 @@ static const struct clk_bulk_data caam_imx6_clks[] = { }; static const struct caam_imx_data caam_imx6_data = { + .page0_access = true, .clks = caam_imx6_clks, .num_clks = ARRAY_SIZE(caam_imx6_clks), }; @@ -534,6 +536,7 @@ static const struct clk_bulk_data caam_imx7_clks[] = { }; static const struct caam_imx_data caam_imx7_data = { + .page0_access = true, .clks = caam_imx7_clks, .num_clks = ARRAY_SIZE(caam_imx7_clks), }; @@ -545,6 +548,7 @@ static const struct clk_bulk_data caam_imx6ul_clks[] = { }; static const struct caam_imx_data caam_imx6ul_data = { + .page0_access = true, .clks = caam_imx6ul_clks, .num_clks = ARRAY_SIZE(caam_imx6ul_clks), }; @@ -554,6 +558,7 @@ static const struct clk_bulk_data caam_vf610_clks[] = { }; static const struct caam_imx_data caam_vf610_data = { + .page0_access = true, .clks = caam_vf610_clks, .num_clks = ARRAY_SIZE(caam_vf610_clks), }; @@ -860,6 +865,7 @@ static int caam_probe(struct platform_device *pdev) int pg_size; int BLOCK_OFFSET = 0; bool reg_access = true; + const struct caam_imx_data *imx_soc_data; ctrlpriv = devm_kzalloc(&pdev->dev, sizeof(*ctrlpriv), GFP_KERNEL); if (!ctrlpriv) @@ -894,12 +900,20 @@ static int caam_probe(struct platform_device *pdev) return -EINVAL; } + imx_soc_data = imx_soc_match->data; + reg_access = reg_access && imx_soc_data->page0_access; + /* + * CAAM clocks cannot be controlled from kernel. + */ + if (!imx_soc_data->num_clks) + goto iomap_ctrl; + ret = init_clocks(dev, imx_soc_match->data); if (ret) return ret; } - +iomap_ctrl: /* Get configuration properties from device tree */ /* First, get register page */ ctrl = devm_of_iomap(dev, nprop, 0, NULL); From patchwork Mon Apr 29 06:28:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 793156 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2070.outbound.protection.outlook.com [40.107.14.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD8F71758C; Mon, 29 Apr 2024 06:31:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.14.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714372307; cv=fail; b=Tg0dOa7/tBJaSKVFHtQnk791twQAb5h/d4ZnEyWvD+VT1lX5r7ZrW1ZSvJrxZUPVrPATdvxVgnojJQyvDGGNFUYMSG/Cljeetb/s/fqT9u7P9CslBVaf2FXKp3yGqKaHReYp2zO0hP0s9/bGe+NrL1oyMMTCyGdT+vIT+WZmJ14= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714372307; c=relaxed/simple; bh=ILCWX4RI5bLypu+q7jOillTXLN9PM6fM5Bjf9Hqihzo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=CrmbEBlJGaCgyx/9uIIjKW8uxcHNTKbvd65BWXUQLeQQ1LGiUBu2AylwnPdKTstvQJT1+EDMUWnQkJBczEvwevzjuRRLjRvs/agistgJ0gPmoTmb6kJ57T8yybwEHB/dFxQ8RFcXpQO8+zgPP8fnaSMmtarkFsSyW87y/kt4Mao= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=eaeTOZdl; arc=fail smtp.client-ip=40.107.14.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="eaeTOZdl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZS2FlQmmGv3C7x6n0jUk/lfaM5T2VgqFe+ZyYbiaCfr3rYuqQmsJG77kk2raAKr3RhW6NTNUMkiGi0+UMgkfSQvpD6iQ4mbALHNOGysanWoFTlEjoJlX4g8qCryd7n350upTbVwWtHuTAGWv9Ef/j/PuXGcq3xRzHRVYkrRzRXXSpMw6iSH2rbl42PZvBecQ9s8VpzMWNT3eBdKuM5wWsA7U/zsSTMHFULjFBvZkCHDMoNKSIrIYcWr8DRfja/I2+TDtbv1QU+TmvYCsMJTIF3E7+tR+cKGDY5JXMvGxDyHkf/rz11PRyl33N69q3ef/oVTDF7sxurn7uMv6uL6IA== 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=tWHZk3m8zovg7GLehv8w9ehZe3UBbtoFImeKn+T3wcE=; b=HxIHsDRBWnpo7+015IIgbQ6xTNuXTHMcX4yNlVG4sawpHTdRQvHwYk3gj2Gqmp74TAEp2XQswxDjgdWWn66mUeSL3yT6d0zJdTh/JEh6se9ekURp8usebZwWK0FeR7SZOcp87PUF3v/p0XVE8fUMEC90lucZoaHiTwt4YdaejHuLUyMnN0jMbYGBeMfhMNu8OYvnqG0i7fnDGF487KsD4Jpvb0IVbQNNG/MTDU+9T+xi+N6FmikJ8+KLgKnbgr7rllz1OYEoxbH9vRxLsqpCez5B/kz6vNtEI46qJQhlG2cB2iuL7UixK22VDodV+nrtbQPjYUdl5pWRBvNfBqwY4A== 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=tWHZk3m8zovg7GLehv8w9ehZe3UBbtoFImeKn+T3wcE=; b=eaeTOZdlDN056p4LDNJtVGWxGlcmKDF3dbb55mSd4RnA4MSZKIz1rqABAQsI0l12JuMKbXCcCVr8XBuD9CGCW3cGJ6yQYqopGKtcNMaa0BooLDmCRl9h+cyW8xKt6dVRvaEXmoUJrJM8mGg1UgDuJNpakEhcGnu2oP2wiobsd60= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) by DUZPR04MB9919.eurprd04.prod.outlook.com (2603:10a6:10:4d9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 06:31:42 +0000 Received: from AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::33cc:db75:c850:63a4]) by AM9PR04MB8604.eurprd04.prod.outlook.com ([fe80::33cc:db75:c850:63a4%2]) with mapi id 15.20.7519.031; Mon, 29 Apr 2024 06:31:42 +0000 From: Pankaj Gupta To: gaurav.jain@nxp.com, horia.geanta@nxp.com, V.Sethi@nxp.com, herbert@gondor.apana.org.au, davem@davemloft.net, iuliana.prodan@nxp.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Cc: Pankaj Gupta Subject: [PATCH v4 2/2] drivers: crypto: caam: i.MX8ULP donot have CAAM page0 access Date: Mon, 29 Apr 2024 11:58:54 +0530 Message-Id: <20240429062855.923595-5-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429062855.923595-1-pankaj.gupta@nxp.com> References: <20240429062855.923595-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR01CA0008.apcprd01.prod.exchangelabs.com (2603:1096:4:191::10) To AM9PR04MB8604.eurprd04.prod.outlook.com (2603:10a6:20b:43b::21) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8604:EE_|DUZPR04MB9919:EE_ X-MS-Office365-Filtering-Correlation-Id: 4677a5ce-f89f-4bc1-afad-08dc6816089d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: vw5t76QsUehL0grWk8848Q5Ag6iGt9WtOPcubuiVlWt/tLzoNyivV5+JG9dAypmbBgSYq4Bfbq4FNBGaIGGjkaU5iufXlLgMh+h/76gw2qeH04MbLInAbydCnZ5cQBUfZR3F3k3KRVhAzvtGzZGrwq77OR4RVaDuJ7lxOAde0sN8G22sEZ7R410q8NDDeBznsxk/gTrUKurCDtpU5yHNO7eJumUIsAhhriEcgrs+S/Pu71F87oEDXX7nSp6tkfxeahZKd8WJOhfsX+XJX+scJVICbeQFx5HkvocMTCaSRHjfzrar9yG6wHkVCxVzDweRtg1WBpXTtQ30GIHWYmMLLJGQd05gupjLTPCQ0+aEnoDOhCpqB+C2RFbuMze+wwmihmZlZ120s916C2X4npsFXNbUvhMho6+OIMC6Jk/s370iNq3gQYJ1qZxbTNK43C67ROH6gTnGHjIGiFEExZjj+/tl/rOLNCTs2arYSm7DSJHcOhaG1FggkPh6exujb3JJ9PQkepC+fxurqzypZYzwAZJp2ebEXYb2DISE0nH9rrvGjWItJkrOIHUnVpVjep3tYlaLv44PUP0dayz2FLKsuLZWPAq3FZWieBmXO3dJVPT2L1klKZ0QNQhkyBdANE6BDKgOlmeiZxP5PvJFvw+mJFoYzUN7Z7EEG3nYMpalWlpFYlONAMkQ3KFUOYO8LwOV/AEpFhwGXXvqHFsQXOUbSu2sRPP65sHsCPJ9q/2HaG7SLsdqU8PLnycCFNKGzv2uXDXb5pBHRtHz4hPkDs5H8D+XkP6XA3/6gBLn6srmJGYRmR5ss4xXWkCLg4ELcZLphyuGM5E9fsQJPpj9xrRi57QDaNaNcCFjG8poP2CTm1Li5EdUC0KzBLMdI36fv7LiM4gkDjcQepVkU+F/v3P8R55btA+ZM3oEKNrC2sw3LvTFNrToj9j0yBnVI3E4MKAdS/pI6PbhpQ8URwSuglzJ1EdwjoMFLzUqP7qLg8+dfs5swBwY36yX2A/loh6nJ+a+19Mb9J3opyBShO32MzZAEIE9qXwIWQ5dWtfi7kpDiTS9u8R6H9trN07/F+jsYFUsX9WyFlqKc1cOc+fWMUeuugEIWc785E5RfIgWnygcAaujqipu6dxBkBFDiI9nH8f8M2Jl4rp96phnXXLqrgyiFeMN/Ukb8CJ63BDD1fSnei62kFdDV95qi1vwnxr73+EotTwom4ZLWfoXcTDK0E/rHDgCzJWZLv7jnTl1sGdU7J36eI5uMN7mvYAp2WG4WXccRLqKdp6UlFyZ6F9hEloV2sfQdUAQwXr9IWFlODZY+9buLggQfsXZZTnaRGxge9jM14KszEEYlNCgT5qtSRNPhg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8604.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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UbWIOjNcx+NFKte0HQsS4wsfrhWgwDT6U7qFAle3lCiDPUTQ3sFOggd87VZKkGVAlHbCd4FO92XMkHTQYpUYiWwsS5pV7d1z1uVIkuDSCrJ+WPFplJsToAJ668WAZVcrBeGO+xVff2mHZPUSrH5TvvIYKcvuC7NlF4R1EXTIvpZOlI6lKVYzDCT8CfnA/Ha9MTxTfz7bSlKsLqCeedRtA+pL+kytbjuY9SbVUqLbzE/tXMmKzjlpDJbg9ArFpsuvUFjzN7f9X9Mm+UFVmLFe8RfMPFR6LflFH78XCbtB7DZKQFpnawrKTFAuldkvvXN61hiRzVkMEbpNjWvgZHmyN5YSUu+7nMKGe1k1iFvHAQHg3Eb7wd1P5pZjjDeNZkyjMHKZ/ggEIzO04m8On9vFOnN522LkVoEEss5+2gcTrD91VG6Iv60rkOY83Oq3F8yZ/dM0gidAibFYwSDUSnoNuS97CTYg0Jor/KIqKefObOFMDB8n3N+qvhqMF6oNjSo0x3xZhHp41m4stwy5/XVDyI9kGv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4677a5ce-f89f-4bc1-afad-08dc6816089d X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8604.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 06:31:42.4576 (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: 4LQVceg/6jNIgztsw1eubob0IVMhIdArmzx/0B8/3G+bJEkEJWBR54BmOyRgeXBzZTcEojkTCrrhxYi769KrmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9919 iMX8ULP have a secure-enclave hardware IP called EdgeLock Enclave(ELE), that control access to caam controller's register page, i.e., page0. At all, if the ELE release access to CAAM controller's register page, it will release to secure-world only. Clocks are turned on automatically for iMX8ULP. There exists the caam clock gating bit, but it is not advised to gate the clock at linux, as optee-os or any other entity might be using it. Signed-off-by: Pankaj Gupta Reviewed-by: Gaurav Jain Reviewed-by: Horia Geanta --- drivers/crypto/caam/ctrl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 02363c467cf3..bd418dea586d 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -563,11 +563,14 @@ static const struct caam_imx_data caam_vf610_data = { .num_clks = ARRAY_SIZE(caam_vf610_clks), }; +static const struct caam_imx_data caam_imx8ulp_data; + static const struct soc_device_attribute caam_imx_soc_table[] = { { .soc_id = "i.MX6UL", .data = &caam_imx6ul_data }, { .soc_id = "i.MX6*", .data = &caam_imx6_data }, { .soc_id = "i.MX7*", .data = &caam_imx7_data }, { .soc_id = "i.MX8M*", .data = &caam_imx7_data }, + { .soc_id = "i.MX8ULP", .data = &caam_imx8ulp_data }, { .soc_id = "VF*", .data = &caam_vf610_data }, { .family = "Freescale i.MX" }, { /* sentinel */ }