From patchwork Fri Jun 7 13:33:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13689946 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) (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 D93511993A9; Fri, 7 Jun 2024 13:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717766722; cv=fail; b=WP74EshXxgPjVC+jehY2Dw88kDF9TI73avJkgkPag70fRFxGH6CnA2tlCVGivB4/uaFwq0ojxoiJU+93uuLXpWfNzuOKsEt+LXJr+iLn3Bo1gs5gGzZRxNZu7aQZoEynrvFn9txznHBxHVFfWnGG6zp48kY36MwoRjDpDb5DMmM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717766722; c=relaxed/simple; bh=Bm1rzBizY8q83ZqDUOdoacNCvwxlIgVOhaalXYwx2jU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=TSAcTPwNw8jgCYlbobFm7hKP5Grf9lNGCoFEQlxMB5E7rOiieTJOKRwced7e7tuQmA4xOcrHwkZDWtTGhsBldSBiOh/I3BpPhSsF7tNexKtJCiViUyauNX6UQVF1iGK5WzBbXR78T2vs2cS3i3kS92wpt0dMvd52jt4+8aZAvfQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=kIQpiHIY; arc=fail smtp.client-ip=40.107.21.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="kIQpiHIY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HV8EbAtDNxN3/cm7vy2mZmNk82bvCM6wnHBfk67whGePHDzamfQGEw9SRt57KnK9PAovvcPhC60lETAIEmHcFrC4FAARibVgZR9QO++tDl7HpzEHFlJX56/+17rP9YdYkVWkN9ilrM1LFIS2y1EUKObc+k3SHryoSkKMXiZtFW/LGQn9ueOS2EFgO1joklnb9YzvonUow1iC+UrPk3X0AS6cRDn8dq3PHPPp9D4SVPMRYebcmgklP/0aSzSfhDPZuNoquvvyTAuqagrXV0LGMzJ8z2dG3fEUM0kTcWYxwKmgECZH9pHeMdXKgf3Mke3BfpIxjBUyq/dCkeAr+m0ARQ== 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=ONQWu0Z2SDPB1FF/NG9VETJX4nmn4NiTazYrjRxeENo=; b=W8vHywomR9+g63PDmUxv79vrxQXtNeegJ4DTGa8SNvnlQ+ra0eIRrlyruKxHa4TLXV+EyoTLlVMpZJxLHA2BssOceqkmjBJCwFRnodkg97ENEN/Vwbr7fVjEY4L4KA/wkAotf9Wbb8ySLAm0fJov6NT1gps8tv8Attt574Ubpw0Bak0gq4CffB4Kh7WMR7JC2/lkWBRvn5tmUchAznQVWp7eyf11v9f50eacRjVOt0uxmf25qPxRNdFarrTJiArLz/Q3iVR453okpA7kwxrLnC3a9Yeo3tgbA7xca/LTDkLkY+QmpFAcnk4HUojy7dTmNjqIpZAPD0uzaBvjQpR1qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ONQWu0Z2SDPB1FF/NG9VETJX4nmn4NiTazYrjRxeENo=; b=kIQpiHIYSjRom27rXK40BoeSO4urCyLsrm+3QfbV8zmB5uy/c0IW+6FcDtFDzXVO58cdj5VLKzOqUi5UCE6dow5XY8mmNaqy0Z3SlNYKqRJKTJTlDwsSMpStJG1wXHo4QAYwJgyd8C7KhAJwpn7gt39b6Xm+a0nfBtM08QnYJDE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM6PR04MB5941.eurprd04.prod.outlook.com (2603:10a6:20b:9e::16) by PAXPR04MB8944.eurprd04.prod.outlook.com (2603:10a6:102:20f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 13:25:16 +0000 Received: from AM6PR04MB5941.eurprd04.prod.outlook.com ([fe80::9f4e:b695:f5f0:5256]) by AM6PR04MB5941.eurprd04.prod.outlook.com ([fe80::9f4e:b695:f5f0:5256%5]) with mapi id 15.20.7611.030; Fri, 7 Jun 2024 13:25:16 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: imx@lists.linux.dev, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ye Li , Peng Fan Subject: [PATCH V3 03/15] clk: imx: composite-7ulp: Check the PCC present bit Date: Fri, 7 Jun 2024 21:33:35 +0800 Message-Id: <20240607133347.3291040-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240607133347.3291040-1-peng.fan@oss.nxp.com> References: <20240607133347.3291040-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI1PR02CA0046.apcprd02.prod.outlook.com (2603:1096:4:1f5::14) To DB7PR04MB5948.eurprd04.prod.outlook.com (2603:10a6:10:8b::21) Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB5941:EE_|PAXPR04MB8944:EE_ X-MS-Office365-Filtering-Correlation-Id: 416c5ddf-2682-4005-c67e-08dc86f544ee X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|52116005|376005|7416005|366007|38350700005; X-Microsoft-Antispam-Message-Info: uR6SjqfiTsiPZfDyHm93pbKp3i8F6KLPUgq2/6leTtITG+yeoNLrbpL6/5DBdoDrLpdelr0CGkTcjbPHpH7VsSzLAKap/lMEm77ILXKLGqtK7JdzOLoBy+vPZuM6vPa0arKWu82a/CA/w1Cahj4LHWahTR28auWB9eTrfxu9s9hl1+wIMXdQ6O6/SaykN0xgo28oQ2/xs1puymPTUGqU8MoCRbfwzBktIPv29X4a6MMUQrnaH8NyNxr4qyhRV1pDu2YtdjfJaUe0nPV8hjxyvwI4MBS6dRIMQNOdyArezmcjvf4l/MnzsNydflmq/kdz/4CUeArvDX72Q2Gv24NhW+ru6NLSuhg75v8fLbdCyU7jfvEBtgBbop+Ouvs08joVOD5Uz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od.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(52116005)(376005)(7416005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: px0OurrHXpbepEIeIVKpyRHpmmevUHC9AcVWEbA1PuC3U7nUjDruwf9U9UYgL5/ChfIfaI5xWS934vXC8twVL8dB09XPjCkspN4Gvkh1bwObTtuVVbRdfqiLbnL9TGVBIqBB12yUonhdiL+ZAGyofdb9Gy4BsLMHzcyy9e7H+D4x+PGoeqXv3ibwqgH+ntFSKdQaJMwTEJbv2wnhN83Q06cmR9KhWJAeQ2PHW4DqgVGrT3WBvFPgKXgE7ylVHwIBY9luhSDngv9s59CuO8zVw700VNL92N3rjZKnu8qdpm+DfXJ7IcKkukjjc+wE0f5iq/lbZMX2pJwOAVNTHcQBqhE2dVsd5hLOjLIazQcZ1ZXwZHxTjK4W3ELQEv3BCqk9nhS8I6d1kLpLoF1FXWNhnQGMXxvltRgOFl8/FT3ZRgvFueUPxVH7iGDpgqDmQBf6tkqfuFUEgLqu4hO52f5PKe2t28K9xqfbgVaxD+aYnvQepCLWqWwpi93B2EdbaHWtqgEuub5N3Xaf69OYNmkfZ1WDGY41ENJfwNKBUJMrGOQOg3ImtHWb1MhAfGqQcUkSoNTAyaEUV1R2goEJkIxYMhFby8DD29V79SVDh/g4+SpxBbCPBcoXkvXOUqBAABs4BPvEykXndFVBeEunr+K3gOWBeosbGpSv2h+yTpihzCs+uWZXJykk6U7yb7rB9XBF+zn8WzsH/MRlraKQRDVAmJKDhpR755dEsde5xIQS1lgS/xy0fTcGbwp44U4l6ClU4igLi6oKJXw/DdKGXa/1fxKyPZW2vnD3pHD5U4J84+Wui84ZsIfzyEtpDCbOAMp0Ugl57xpsbTSRHGu5/ushSIUDu4ckW4FT0XFAoYLUr87wO0195nF7UX66b4kJaVfkEoSfZargGuT6dU+WOAFO4POv/8Jtzfv2U6xBOoX7Hi88dWkN+hhxNUuRCrhe791lUVZ6e8XEWmZ5NBfanczjEF+LkyyUdqiGXAMPLuElfcUA2ZmCq4Sa/8hEn1PR+e5uqentDKyyJIoZYf2jzqzZ9WWtPcqkAXlUpMnlCn6duzmfoQd2JV/nmH7iWvba54XL7OF1sMcP+Y0l8+Z0iQTHUJ6DFUSvHI7a2PsZm3FuhFoH8aOHrkB3IuNXF4cEopJlX+zkJ6p/epwrFs6pIR9oY5iW9ia5ENLHPwhTWA6U9Sedq1h3sPP31KuY4vCPq6zHVj/wN41US3vdIPJnb+QdvpIy/X9531MMdma8pv89S2ks8cV+qhVYef+WeJr0GMUhZ5dyC0pk8IhXikFXY9rSGAZXeho3BX9juZkavUQlcJy2AT6GZ1AmcRsLAPRJL9GYKvFnBuwpT3h2bKAW72wCOc/vG799cCeaZefgTUGlgFCIzzaIl9oyTNQeFA5uk4qt5+qXt+VKhaR5gof4A5j024zl8HChnjOakyJals0WoV1wHUcqbOTKW7jK2q1EWECDj8bhXRssxxQQGZx3LadZvd7f0piSwEEEzmrl84r943wLqTr9U5l6i8HZ55AfQLYYhayhk2L4yvX9q2dQi0qoaXuS7PuojQlGmaUiC8aCQogJAzGISFLzvWfOe/3CN0RS X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 416c5ddf-2682-4005-c67e-08dc86f544ee X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB5948.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 13:25:16.6506 (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: b8z8BxDMZN7iuxR6r8nRj8+upIDLi418p4r+0JZFLUPshulz3f3g2ctAJ5yuZhclGpXOZNAEttmQ85Gj5vzuLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8944 From: Ye Li When some module is disabled by fuse, its PCC PR bit is default 0 and PCC is not operational. Any write to this PCC will cause SError. Fixes: b40ba8065347 ("clk: imx: Update the compsite driver to support imx8ulp") Reviewed-by: Peng Fan Signed-off-by: Ye Li Signed-off-by: Peng Fan --- drivers/clk/imx/clk-composite-7ulp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clk/imx/clk-composite-7ulp.c b/drivers/clk/imx/clk-composite-7ulp.c index e208ddc51133..db7f40b07d1a 100644 --- a/drivers/clk/imx/clk-composite-7ulp.c +++ b/drivers/clk/imx/clk-composite-7ulp.c @@ -14,6 +14,7 @@ #include "../clk-fractional-divider.h" #include "clk.h" +#define PCG_PR_MASK BIT(31) #define PCG_PCS_SHIFT 24 #define PCG_PCS_MASK 0x7 #define PCG_CGC_SHIFT 30 @@ -78,6 +79,12 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, struct clk_hw *hw; u32 val; + val = readl(reg); + if (!(val & PCG_PR_MASK)) { + pr_info("PCC PR is 0 for clk:%s, bypass\n", name); + return 0; + } + if (mux_present) { mux = kzalloc(sizeof(*mux), GFP_KERNEL); if (!mux)