From patchwork Tue Jan 23 14:38:43 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: 765393 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2061.outbound.protection.outlook.com [40.107.105.61]) (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 75C0556777; Tue, 23 Jan 2024 14:34:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706020478; cv=fail; b=C+T3ZVfgXJeHMFWYuyHQIzWHgkmUIxZYhuWU1OiPwgEBbK05Cb3zGItc7A9J/b9gPfBx8/6NTgWlyzoqkNuiQcGECuhE09z4wH/c+dz5vZgYxvZ9okYdQVBGe3NZpcgD+qaVVWMnXtDnH6oL7JGfJdtaCkJHlGrK3vkN25UqefU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706020478; c=relaxed/simple; bh=LDN7O/dpGg31VW4DZx50TL7inOfSwn3xUBm8mLyixjA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=WMoR9004mGWrQ2MT1CNk0RpdJDKAbHcqKSPEtEjE6qevzcqkH8tUK9HFzPjrncmKNmP0le5/RSNSRCNajmEoFuhyDvlp7ihrS+virwlN3QC/AgxajrRA7bOdhY3fuQ5haibVzD+THR7naBeal/QLwkMp5Qp2dTsVBtoCwXLOFVk= 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=R8lLILfq; arc=fail smtp.client-ip=40.107.105.61 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="R8lLILfq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c/XEoqfJ4K8CgowLuLA6flobOamrpudz8zNDmmdjuAmIh2F/O1HfTM5+HsUTlMSCS96T35Evqy6WpJ9VegmPzgrmYjvMLt2PA6N8XhJSzwsZazi+2J+bh/zG6a1h6o8ngAe9BKI4fQLDK9lf0vLmzEjMkndk8jENOrI4MB+nQ0J2r1ZCaMKzZ1O9Rehrwj9VcM0RRSWOhr8I3wsdfjjy9v6/o9Hk3e7CW9D1u9AaZAryhiD6Kp6B1VDOcGU+YoQKv5+OYGrgXzXvbuHcmJMR9STZpnRrFpdOGE4xeDBpFPBQXI1Iu44WtiW6gLM7jy2EoRuUSKhjVHYYjkRq8CAx2w== 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=lVF+lIifocnKZkWBqalKhcjKGKvD/NfO5sSqA4z8S+g=; b=HeK0JFWxlehyat8N6Eati3Qn65pGs72ONPxg4TXV0LYJ7mPUjJUdeV0h21RwCPhP9skToeHb2qJTwu7WZp1CYOQrLTlKWEKcAahKbjdNj9CtY2qCaaU3Aq4T5r7p6KZzZ1Qm6uZvkKfZZJ0UU98oUWJ7wynvVbvku0oiCWk9ESimJFvwJN4cBP033ZE8R7mxRQKU2mu2EBOciTxU1zChrrueOOSsRJ8GlLfUe7x5O+SOYj9oQQ7Z7UhfhqGXZAo1RdSJAlCO9m1hzBRh0Yz/c4ZNUzz2xTplqgSOquJBi8exDVMXGXAPfFH/iW9mBqjWGL8j0XEP1UzsHaj1QCeVWg== 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=lVF+lIifocnKZkWBqalKhcjKGKvD/NfO5sSqA4z8S+g=; b=R8lLILfqPqT1SFKxgfCxRIcZ/Ug7XZ6utrM0t/S8dgBs3UgtRvdExuEQBx6wYaqQpRMspLOJ/yNYSD1oxHe7mpC8CG/C7riBjkKZYuOa2gkhHrrbpw036DghzISK7fhrsttef22m38SLBvJZ2RJikWRlUH+B0WW4KQEmupLh/Kc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBAPR04MB7304.eurprd04.prod.outlook.com (2603:10a6:10:1ab::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.36; Tue, 23 Jan 2024 14:34:33 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6%3]) with mapi id 15.20.7202.031; Tue, 23 Jan 2024 14:34:33 +0000 From: "Peng Fan (OSS)" Date: Tue, 23 Jan 2024 22:38:43 +0800 Subject: [PATCH v3 2/4] mailbox: imx: support return value of init Message-Id: <20240123-imx-mailbox-v3-2-ed932945e0bf@nxp.com> References: <20240123-imx-mailbox-v3-0-ed932945e0bf@nxp.com> In-Reply-To: <20240123-imx-mailbox-v3-0-ed932945e0bf@nxp.com> To: Jassi Brar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dong Aisheng , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706020734; l=3343; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=+Gd+/hMaY4KbnLg+mAxCKcpz6HM1MVsMqwBCKUxGXc0=; b=5O3LBUBookNT8VKge0bq0I+VPLg6GIEYtk4VRy9cu9QXhIqyVEPaLkgYaCoa4B+5wEULmof2T liTlsjuu8pgBynhMx+EbuWxO2p/PBTnjf1U3jZ+1wTZsWQiSf6RaXt2 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0125.apcprd02.prod.outlook.com (2603:1096:4:188::13) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: devicetree@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: DU0PR04MB9417:EE_|DBAPR04MB7304:EE_ X-MS-Office365-Filtering-Correlation-Id: b029d009-942a-465b-77a4-08dc1c206a88 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LxlJl92cpFpU6b5kcWcYp1mzc+mN++YuCquE7CHSNRcJkonVFk5wAei5otaS2nzqpa213hQRVYtlCVMxUWJxrdFJpO4h9zcwnykXPv93Mo+ek5+p5J7Xz2OcHYrKy13BjJcsS6VQfcG4ukmwr3an0KJzLX3Hg3m5T6frHnnB5ZiXD27909BBqc4EUhbpA2rIFfJsd/A511FK6rkBWcMUSqQ6LDVcLFn5++xhgJWoboW4ASsxVflF0SQmBNYswpxmC3K4fSFWZjjb0AanFvW4BVO7w4+FQC/UKxhxq91BmYhFQ5y8LkIcIugab0fiQ7clR2vf+h1lmkgh92QIEf3WQLESwizVl369HSY5avTTc6LnzW2QmYhJxFw1j11L7J0BAnVDAn78N+XYnOFihgAVKq2gVm7qC68Cj/w0kAQ6MFTWlFcTBNrgTjO9wbClSrsbCVNGlWMwbMpj5VtPV2hVWih+uacn3jpMQWa1XyqDPLLP2KZtnSR4DrZr8fpP63hk3OslZtM1cPNW8jtmFQnwOZ8f3hUxod+FFuoel8X0HPLdn3ta4SMOxrxxOxSzLCgemeYbQeD5ZlNMY1yILEr2kxQOimlM+a/c7E7om5nXh1iKhiLAv6tnN10/4eFC+kcm X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR04MB9417.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(366004)(346002)(39860400002)(136003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(5660300002)(66946007)(66476007)(66556008)(110136005)(316002)(26005)(6486002)(6512007)(6506007)(6666004)(9686003)(52116002)(478600001)(83380400001)(4326008)(2906002)(36756003)(86362001)(38100700002)(41300700001)(15650500001)(38350700005)(8936002)(8676002)(921011)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6edQka++5Q0OJX/w6Xo96bqUYguu?= =?utf-8?q?zY5phKyxxaS9Ux+nsFkKaCx9z/EoFXirCS3D+UapINRhsPDfeE2+nkWdX0QgjpRiJ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sWt?= =?utf-8?q?qXn/BdRQfEIJMdnV90eHXGK3IrVJaoWZJym9vM+FuV65XqL8eqvj43MDr/ExOb7Sn?= =?utf-8?q?DrjE3FW3JKrbbfeRvKm4seNhb/u+7FbltxqCEQf2rcm+WIEWWpaM+a9nH47llAf4v?= =?utf-8?q?fy0B33sm0I4mbilZKDfv/nvODBh0rXiOQ/1Wv0fqHiVBpV0GtGvQ/J0hDD2cESMU4?= =?utf-8?q?tWn+KMu6W760dRtL24I5AF5dYQe41oQMg4Uc9vfNuYkOcVnu80WzbgG1nX/UsttdR?= =?utf-8?q?QBucStLgm3rVTs+eCAcI6Z1cqiaqZsX5C7SVXRE+BY9RjTA2IfPIqoxETnLAw7tCm?= =?utf-8?q?6LtYn4b8Yel1A3jCAqFEMURaC2bL9kkHacbVEAPXAqetzE6ALPVATx9trwgpPyUYr?= =?utf-8?q?1rDsmr6xLqFmyrRKXXCsNjimP+GPds42qmkADyo+0XQIFXgVipfvyB13IYHWnD8G4?= =?utf-8?q?vVTcl2Wrs9D4WPTrxEswRhDgcU4bvCUxklBtqLU+nIRRopvej7jIM0/+EGHXVMZd3?= =?utf-8?q?fOoY9Ot2XWDOgB+10G41YpdPTPjAd3eWpaSX4+EkusmAYuMpU8+1r/X7ncCVt1QWQ?= =?utf-8?q?UUQ+/QvaKo8/?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b029d009-942a-465b-77a4-08dc1c206a88 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 14:34:33.2903 (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: umuEQoWJ9Ef/0q8LbmvLze1mRa1FwXnHhbAzEUZg0UfRmArLoHWytncbdTXZUk6sdeLrHlcvvbUD7AxHyEGLFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7304 From: Peng Fan There will be changes that init may fail, so adding return value for init function. Signed-off-by: Peng Fan --- drivers/mailbox/imx-mailbox.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 656171362fe9..dced4614065f 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -110,7 +110,7 @@ struct imx_mu_dcfg { int (*tx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp, void *data); int (*rx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp); int (*rxdb)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp); - void (*init)(struct imx_mu_priv *priv); + int (*init)(struct imx_mu_priv *priv); enum imx_mu_type type; u32 xTR; /* Transmit Register0 */ u32 xRR; /* Receive Register0 */ @@ -737,7 +737,7 @@ static struct mbox_chan *imx_mu_seco_xlate(struct mbox_controller *mbox, return imx_mu_xlate(mbox, sp); } -static void imx_mu_init_generic(struct imx_mu_priv *priv) +static int imx_mu_init_generic(struct imx_mu_priv *priv) { unsigned int i; unsigned int val; @@ -757,7 +757,7 @@ static void imx_mu_init_generic(struct imx_mu_priv *priv) priv->mbox.of_xlate = imx_mu_xlate; if (priv->side_b) - return; + return 0; /* Set default MU configuration */ for (i = 0; i < IMX_MU_xCR_MAX; i++) @@ -770,9 +770,11 @@ static void imx_mu_init_generic(struct imx_mu_priv *priv) /* Clear any pending RSR */ for (i = 0; i < IMX_MU_NUM_RR; i++) imx_mu_read(priv, priv->dcfg->xRR + (i % 4) * 4); + + return 0; } -static void imx_mu_init_specific(struct imx_mu_priv *priv) +static int imx_mu_init_specific(struct imx_mu_priv *priv) { unsigned int i; int num_chans = priv->dcfg->type & IMX_MU_V2_S4 ? IMX_MU_S4_CHANS : IMX_MU_SCU_CHANS; @@ -794,12 +796,20 @@ static void imx_mu_init_specific(struct imx_mu_priv *priv) /* Set default MU configuration */ for (i = 0; i < IMX_MU_xCR_MAX; i++) imx_mu_write(priv, 0, priv->dcfg->xCR[i]); + + return 0; } -static void imx_mu_init_seco(struct imx_mu_priv *priv) +static int imx_mu_init_seco(struct imx_mu_priv *priv) { - imx_mu_init_generic(priv); + int ret; + + ret = imx_mu_init_generic(priv); + if (ret) + return ret; priv->mbox.of_xlate = imx_mu_seco_xlate; + + return 0; } static int imx_mu_probe(struct platform_device *pdev) @@ -866,7 +876,11 @@ static int imx_mu_probe(struct platform_device *pdev) priv->side_b = of_property_read_bool(np, "fsl,mu-side-b"); - priv->dcfg->init(priv); + ret = priv->dcfg->init(priv); + if (ret) { + dev_err(dev, "Failed to init MU\n"); + goto disable_clk; + } spin_lock_init(&priv->xcr_lock); @@ -878,10 +892,8 @@ static int imx_mu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); ret = devm_mbox_controller_register(dev, &priv->mbox); - if (ret) { - clk_disable_unprepare(priv->clk); - return ret; - } + if (ret) + goto disable_clk; pm_runtime_enable(dev); @@ -899,6 +911,7 @@ static int imx_mu_probe(struct platform_device *pdev) disable_runtime_pm: pm_runtime_disable(dev); +disable_clk: clk_disable_unprepare(priv->clk); return ret; } From patchwork Tue Jan 23 14:38:45 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: 765392 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2089.outbound.protection.outlook.com [40.107.105.89]) (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 8C4425FDB0; Tue, 23 Jan 2024 14:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706020485; cv=fail; b=QXaulmdpMywLl65uRQMPHVHenhEStDx+Rm4oT1dM+EivY4HMyfLxrqu+wurtWWXzspvT3auN1X/GlQXnXmXe/Qc0rZXH94ZUWuqmMs/OTofk/SNB5xRs/VUlAYVuWum+VIXca1rf1m6fqtv0Q1A8h3ziKvu3VqCypSoGUbJr3FQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706020485; c=relaxed/simple; bh=kA/UZP7RBLxFNlKx/I6oIWRdtMjAl2kfHc9r/eFLYi4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=jMpvhUbSc/Ktor2F8gGKaG4t4oatl3ic94FWMXinKtd30+KgEjdQmpugDPf2v8bg1KEiEIqQdp88yuSzk1vnWpnX8EDOrG9cJy+ml/flUA7dFAMfi9N54C/Ejbs/Lh7Pg8gW2E8wEltb0UFwdFL0Cp/60jT4Nkn51Uuj19YYVBY= 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=GCljrsWv; arc=fail smtp.client-ip=40.107.105.89 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="GCljrsWv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RA1exWQImthHdxV1CqUcpb/cN0QecEYP/kwTfgeEaeAMSpwx4fhtGcbN3ToK1CQZkl8UltwdupOSbq21n4QDaIFAHk8Gec4f+LPitZm22s7bWMB7cwExqKgcdg+XLOqopwUqV9/eYrWJzP+oGhINNs5vwXU2s8H4TU8HhrnUpyjPYe7lrKj6e/O+byrDeJs6MPXtMGwGpP6gfmUVz//UZSSHbJantjy7v2KadYR2dP3r6yfkBcVaXZfs0522BFLuQV8oV7tFxwAAR60hFPIW2piUYTMdn8GpzVYBBUuJByYl2X8p0QJ1kq1MUDPhwqx4UBEzmNsx5tORAa26hd54rA== 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=E4/oDx+cC2vKsvoZaiTqgZpD/H+Cdwy5IDIRZoQ1eUY=; b=Q4Zr8VLlbuaN07YW78cGvDGZaaESJdZuW8nnv194+n/C8drv3CrILTrXlaatBVbNhjNzUpWYTsOArcLfpgGEeaQm0fYepa84WgBtp0rsSVVWtSi4/hzRml6K12hwkYmSP8i87bmreyS2ip2Tr641FIFzkER5oJGp2G7/ET1GjxOkTL7ACst8nC439FTHQrCdz/Qr359LhG8wo+aBjIhGDOU5F6+qasIKyj0TlvMcRRPYlhw5l65jb+41rRauvUVYg5WH1KWkBYZR75GcbuVeXTyRAd5EZVfdBxkndjoySjx3QaS/laZxAmCiHQKd2g3m1ATYRU4KY3hdPGSSZCqnfw== 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=E4/oDx+cC2vKsvoZaiTqgZpD/H+Cdwy5IDIRZoQ1eUY=; b=GCljrsWvhtPMQP3tPR4KQ39DvZWK5rp0nFDYSDp8jEY/cHpO23tYRKb8mYaqFUV0KfI1ihLhiHPYhJ7E3hIFd1nsvxbvMu4gisEt4JUJZFmedQhjxpVRYqD8VB6hVK+lYLSSKjDu63v8lDL/hAgYOS3FYA/tgFKTPK+QVBIttnU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by DBAPR04MB7304.eurprd04.prod.outlook.com (2603:10a6:10:1ab::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.36; Tue, 23 Jan 2024 14:34:41 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6%3]) with mapi id 15.20.7202.031; Tue, 23 Jan 2024 14:34:41 +0000 From: "Peng Fan (OSS)" Date: Tue, 23 Jan 2024 22:38:45 +0800 Subject: [PATCH v3 4/4] mailbox: imx: support i.MX95 ELE/V2X MU Message-Id: <20240123-imx-mailbox-v3-4-ed932945e0bf@nxp.com> References: <20240123-imx-mailbox-v3-0-ed932945e0bf@nxp.com> In-Reply-To: <20240123-imx-mailbox-v3-0-ed932945e0bf@nxp.com> To: Jassi Brar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dong Aisheng , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706020734; l=1973; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=lkPMpPy6UalcvetyTqhwBLnqDq8ONTaWTu9sur2v8yE=; b=iXhc8qJsSBjYUXXxziD+NU7sIZe5ZiIbff886vIYen1jwF7owmo8kpCizkGGNgWPMoPp8SNMX tDbmnFbFeV9CAg3VrPPkw/Ba1rvz0GhjsI4guZFUStZQqZEP6eolTtd X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0125.apcprd02.prod.outlook.com (2603:1096:4:188::13) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: devicetree@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: DU0PR04MB9417:EE_|DBAPR04MB7304:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ab2c8db-fb4e-4dc5-9af3-08dc1c206f95 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xqmwJpny/S/mR5Ch2G34PtprpVHuUucNJE1L9L/umg02bU8ecF9kSlm8QWFU2mczNudno3MqNItAd2PfgovGHMBccV7Uav3R//vzy8MvizSGos64//tHbkkR9h1Z5qMVp0Bd4t2SMaSb7vwxkAxhBUvIqFFDCRqYEhVWEoIzmAC4lsX3PxGvmSX3FK6l0pN41HyBhsuMcDzYYwHCZoJXU9KTmmx2S4tqC+0A4g2CJd7T2tflzKARGoi9XcsrLCDccQNwj4owXRJmeSY78dQVVV6HE+VVGasEjdrSG48shZM99nbONG4hNVkK4cm4bRqtq12XtHvONHX4NQPaftwMNUJ3IX23+d9V9wWi8NrHfI1NeIf/N9R1oukcENr2IlpH/TjBn+QBRewbhQLzXiS6Zz17Ga6RYb2frdfjxiElJZ19WvN7NX6HoO7n9456iQ6ofRv9h+/Wi1M+Vp+TbunXivLYJM8NScwASZrBiPziWpa1yBQipuoZyHj/EYubSEJIjQm9d996+MF3l/GOU2SsdfVWiOdhdZcAr5v1qkpYwfTc79eLF9MWCxMZLb9tAAeEtfK7DOz2wbT0CdfUqdBjCYviwnUikSst/u/YJlnVsxHRhQPFMn4TApSGZblBVk0JT94u944CEliMOw/AtGxhPg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR04MB9417.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(366004)(346002)(39860400002)(136003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(5660300002)(66946007)(66476007)(66556008)(110136005)(316002)(26005)(6486002)(6512007)(6506007)(9686003)(52116002)(478600001)(83380400001)(4326008)(2906002)(36756003)(86362001)(38100700002)(41300700001)(15650500001)(38350700005)(8936002)(8676002)(921011)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?F8Z5s+VODhoHwpT0gL0PB/mu9LAi?= =?utf-8?q?WBepgODiRuvGr4gqqZCTZHzinAaNSfrM1MrqRrT6OKVarHeyVU90vd1ILUyMOhFor?= =?utf-8?q?QmsMGP3WUj/KHNEKhiG13gMxdr4BWb6qUIoCyrhTxhCvgC/fAiugj3qRkThrt/RWZ?= =?utf-8?q?+z7V0F4Tc5zamTBq47SEfNkXuk0W6BEU3i6cGubgE2bHGBwhHDiyaL+Xygt90HVV4?= =?utf-8?q?WO/Iag5f1MFuvr4l/xc8V85Vo9EjneSadimOpJrxc4sf38pIrHYur1TLuTk2WM6Mn?= =?utf-8?q?zNqAkK7Da18fGMtmJzEsa1V6sQazVLSvK6nkdhh/gNvfNrCEHxAlUnm6yeMTODg/q?= =?utf-8?q?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8?q?FBn3snr1bdPC+lkbjaiXV2OIn79oGeDtCtRi/7r3NUiJLGUGldZ+KG6+eVhTVLlCb?= =?utf-8?q?dS4zLj17bY3tBZOOW3/4G0wTd4p6yccemMwQO5hS9E0C8s1B0PaFlTAYiBzv/Fr1W?= =?utf-8?q?PujU8j5mRYJTWKt/T6hoS8aij8zHzimxqo6YxMsAl4E8IlslQIRxaXyh+h6Rb6sSu?= =?utf-8?q?pQaf2UNxCb7lgX0sQZYtRkK8eSf9vjOKdmS6ZRMh1aJRYmva9L0Uvoi2bjBWwEDh4?= =?utf-8?q?2AoFqPjSwqfeJscBSSRUn1JFSh9FFkDznTkh72wIxByKqz5vwKdennzY4rxwZITfh?= =?utf-8?q?wvHFVHm7DuZN?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ab2c8db-fb4e-4dc5-9af3-08dc1c206f95 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 14:34:41.7625 (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: Fqxn8DCdYw5+sZdSnbPci0Zmky1cIkYVDWr22F7IqLASHz7wW3LV6qACIrR3AOhYVmaCwI9Opggg38kGZvtjXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7304 From: Peng Fan Add i.MX95 ELE/V2X MU support, its register layout is same as i.MX8ULP, but the Parameter registers would show different TR/RR. Since the driver already supports get TR/RR from Parameter registers, not hardcoding the number, this patch just add the compatible entry to reuse i.MX8ULP S4 cfg data. To use the internal SRAM, need populate its sub-nodes. Signed-off-by: Peng Fan --- drivers/mailbox/imx-mailbox.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 9e89f773d2f9..fff891d40f2f 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -4,6 +4,7 @@ * Copyright 2022 NXP, Peng Fan */ +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -919,6 +921,8 @@ static int imx_mu_probe(struct platform_device *pdev) if (ret) goto disable_clk; + of_platform_populate(dev->of_node, NULL, NULL, dev); + pm_runtime_enable(dev); ret = pm_runtime_resume_and_get(dev); @@ -1031,6 +1035,8 @@ static const struct of_device_id imx_mu_dt_ids[] = { { .compatible = "fsl,imx8ulp-mu", .data = &imx_mu_cfg_imx8ulp }, { .compatible = "fsl,imx8ulp-mu-s4", .data = &imx_mu_cfg_imx8ulp_s4 }, { .compatible = "fsl,imx93-mu-s4", .data = &imx_mu_cfg_imx93_s4 }, + { .compatible = "fsl,imx95-mu-ele", .data = &imx_mu_cfg_imx8ulp_s4 }, + { .compatible = "fsl,imx95-mu-v2x", .data = &imx_mu_cfg_imx8ulp_s4 }, { .compatible = "fsl,imx8-mu-scu", .data = &imx_mu_cfg_imx8_scu }, { .compatible = "fsl,imx8-mu-seco", .data = &imx_mu_cfg_imx8_seco }, { },