From patchwork Thu Jan 25 05:20:04 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: 766172 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2087.outbound.protection.outlook.com [40.107.249.87]) (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 4868710A22; Thu, 25 Jan 2024 05:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706159763; cv=fail; b=SeBS5u6hTBjSvCf9ssLJkAwOZIp4aKGmK701GIKQiENZOzZ5W5SH5NFixcRtoQKlfp7X2QchFj+MapJCJeuCPLpTD2B1xFCPcXUIYF6rbbmQjIHewCKGFGrWkP4AWFGxlRPogir6opFCVovtnaFb4yQyLgT1o5GjCHolewCyT2Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706159763; c=relaxed/simple; bh=LDN7O/dpGg31VW4DZx50TL7inOfSwn3xUBm8mLyixjA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=reqsdkKbX2s9xbLwmF8IQYRxTPN97NOi5/BhTc5av3I1RvuNrPG/9hofQueMxhSHwkoT5y6y7G8bFdo9oXTZ999zLBw1Sojm9RFcnS9iAWG4UIk7F4hNqw5b2Zh36rdXgHp5g/uREgaRHXgyaG3oIQEVKBflEq1d48WBsne7h7s= 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=aiY0npBn; arc=fail smtp.client-ip=40.107.249.87 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="aiY0npBn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2Gi5Oi9DIQ/cUmUNXFtKVLA8Z+KR/x+pQdgEvzqvtfjNnCWGevthEPS4ZoPK/uO46DpyfCkzkfwD/9xp8xwNyDZFa5f9NOffgZUyA5Ewc0d1vOqOt5+0TzznHhBpBJgyCXMZqDaYSgqbdLjD0ofuvKP4KK5MwS32gHn/SOy4jsIqBBS3OWMLjncg5sv0t9Np2JQvsrYb4MUxg628rnCTHu/FOtw3yVFwVVXil0e4B/kXdiFbIcVYqUy1akNRpOY60H7HeCKkHPZfCRda5NzwKCKCNAm9qI0hIDWM21QfClfkKcpNNkrIhH9FDM+d8O/O9q59rOU7EE1Y+LP14z67Q== 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=YAdkZsl8gftGwXDX233yB2UPKe3ACyxCNvKntmsX1dKmqTUXdTFx35mvgHwPxZtfCQW2VQAYDzra1s8jpsOO7NZ2t/dPwhD1qsUz8h0vC7hhDn7TSNG4IsXS8IrLUHm0IjUV+ob6XckiwKsWA0fXBqwEUmy++GnqB5PCaHj0rYHIVEGVcJfY1sKeoWPoVlUIsouE17LVTGXRnO9o/rN7go/X1S3KPkc8mEI8+OR+PoAvQaaT+vLOpeCEXXe2acH+1kpnvemC2Jbj0hhdKahlmds7pvQDmT7Z3wX4PBkeUBQqcW+8zQN3eh+LZlfP2HwBXy0KiYpM59vLHeX5rqjpCg== 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=aiY0npBnoP+HnXAgmHH4I1MkN9VffurUBsUxhd7I7chuxpsHbB2vTCuFeyIALnbjO2RU4A+tiVEeW+p2SYvyIymwm9iEPsljcbgLcqxJKlVepwDO08NW0SCo1/AzsyKcKKl4k7nPhk71vsp4t6lw/QLl8RaItODzWTn2HRiJ2Mo= 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 AM9PR04MB8275.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Thu, 25 Jan 2024 05:15:58 +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.7228.022; Thu, 25 Jan 2024 05:15:58 +0000 From: "Peng Fan (OSS)" Date: Thu, 25 Jan 2024 13:20:04 +0800 Subject: [PATCH v4 2/4] mailbox: imx: support return value of init Message-Id: <20240125-imx-mailbox-v4-2-800be5383c20@nxp.com> References: <20240125-imx-mailbox-v4-0-800be5383c20@nxp.com> In-Reply-To: <20240125-imx-mailbox-v4-0-800be5383c20@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=1706160018; l=3343; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=+Gd+/hMaY4KbnLg+mAxCKcpz6HM1MVsMqwBCKUxGXc0=; b=jrGwXVeZrCtbYrIpbRKhaIScl3XUdA+WXHE/EacTeNle57CnLCZIKACIFeDK89AvN3fHwe9tI 4MDYljwA7q8A3JhGUFzit8fMhXe/JFzTG4Cg/wkmuRPNPOYK8fbwNH+ X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR01CA0036.apcprd01.prod.exchangelabs.com (2603:1096:4:192::22) 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_|AM9PR04MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: fd8404d7-f91a-4935-e6bd-08dc1d64b6bb 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: 0XLVHGm0TQtfyZ+GRaHKsRhGF+/pMX3u1nP3TzZaDYXL7xiHEbibeFl335IbROGydLawBqisWyADKxFrTYcDT5hnegbj3DGNwSICZ63BVLnm+UlN6vz3HHsewpljDIu9lTA+Wr0+vMfpC22E3sJv7TLae2gr7BHBcOCDYV5NfJYKQ74KbwLEBs9SY1NakFG3OQtzp4mwmd7O6tZdZ40dCQEm+fHjJhSkRoJJjJCZLELLvU1DwF1g6w7Z6FK5BplsJDLTBSTcT8lyRJ6Yjw0+oFXe3QzEwJ6zS8r/nasKHN49qfVKU1gWFWWm6EpASPdpQBIzjahN4W/bPPdBTnH3Twq1ioJvD2ZEiMI4wpU9gOmNYYh9yitcgZpqyrte+q3naHdcKD3jmy4eyl6/mREgD0OpUVgzGrHqqCrd945wFZG/MYxfO4uKEHDGB8ocIBE6UTkAKsQcGEeXgjf+AIGxF1obfaKhZ/6T9Z8nuucj2lBC5B/QJuLA4iG6hOvjKOHs/r60GzGzwVRQk+/r7eUxeDHl6r3qKAoo6BpHq+eHPr+cEMRjl9bEV8U8YOnGNzJLav5kEnZkV/iiGs2/ufDGnA92rm37GsgcN2ZszN6CykDpHXUzlf5kTzKqDWLUVOji 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)(136003)(346002)(396003)(39860400002)(366004)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(921011)(41300700001)(26005)(38350700005)(36756003)(9686003)(52116002)(6512007)(6506007)(6666004)(478600001)(6486002)(83380400001)(38100700002)(316002)(5660300002)(66476007)(15650500001)(66556008)(66946007)(7416002)(86362001)(110136005)(2906002)(4326008)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PhfkqOxQvIwRB6MA3Mc5zA2vXNVz?= =?utf-8?q?3Oxv+uvrElotAlPISuh2G0MnNJ67TD7Qe0wIUMSq9JJhgKOYbWf9OB77zwWR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D8S5IU?= =?utf-8?q?7f/BwE7q1jeRDC9jHwWeymlTYJqbM9MVTyrc9D148QH5flz60++X6ifB1d+l8bYaD?= =?utf-8?q?5tuh46BEqLP22e+1KoCUdxfKxDJBHrUJgwcnckQNH7sM8hlIWtA3H3CLNmIC3oOZg?= =?utf-8?q?x92X57UdkqUz5pH5ZVF9Oq1i2h7uLa+CEce9J8oOruoFffWWy7/uxP400G8v0ano0?= =?utf-8?q?gbQvqEjRfZime5TjFVkBsTrP5Oq3lj/LuPC0rPXeN2jbWXyvowd+o0jmvXCWkDqt7?= =?utf-8?q?rOMVCml/a4e+9VQV2c+XEGrga3ouB2Z7K1oK/eWQyPdpBbmPb7JgIAvJrvdtryDc/?= =?utf-8?q?jajC6s7cHAGDnajSE0jNFQPjOVJkeR7r4BfltjI51SWck8ID25O4GxUrW8wGAU04G?= =?utf-8?q?BYGzmfscDDCw8plbVPbjh+LDUoRP9X2YPuRPf2dH00MoKvi3bl2Yi0jLSWwpu3PIm?= =?utf-8?q?wZ1BmAeoEl2RuIXrEcmO09+W+5y6Ih3fsUUDCWISm01vsLjMrMDgO6FMcL+wig3VI?= =?utf-8?q?6fD4yzCI2dDeBSOdBMbHa84L0nuJui7WHTfJgorbs89HG+qITPaJrLFHTxfHuoavM?= =?utf-8?q?YmUfUKT4DjGx?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd8404d7-f91a-4935-e6bd-08dc1d64b6bb X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 05:15:58.0460 (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: pcxfgHzifFWKwc4xx7I5CJuTBUDhoEF4auJ4qkPLuTGTmGcfVbKVgT6rieC5BAEBYVUA/CsUI0+5aENyrCyhlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8275 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 Thu Jan 25 05:20:06 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: 766171 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) (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 85E4D101E2; Thu, 25 Jan 2024 05:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706159770; cv=fail; b=llbckHNoLqbtJYXqT+jiOWVWLptB7Ily5LwqLJhooVJVXRKPVSrYQg6xTyM9YJoTwZBgAUycRWr77WSOrOWsilcsodZEAIbY+P+34El9Js/dgxMaLq8KaNgJ76D5NvQYMr7wbod5MZJnkucTe88xz5lZ2BvN3Bn5xCIeeBBf1Cs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706159770; 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=XTl1Eeu7A0Az0h/x4K5JB4ZWFuxuJ6RMJuqu8BvRldEHQW2hnCIny26aCzyHX7KEjpEhG74xEqfLrqPh2rCMwoyf3Nkx3wX2a8QCkEWbc+Kf/fUPO7CMmDjRZErQVg0oC4vBqcHsFYHBlX3gxGzCr90laWM0gyVBt/zyxJgWto4= 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=gbx53IES; arc=fail smtp.client-ip=40.107.21.47 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="gbx53IES" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DmSfyqRCXJS3xTxd3Ov862jIrhIR1pW4yQc2x3KBWosanzJ+jmPiEgjDpOhaptrOhe8lq/85MdlhSU45bi4qWOWXTh66WlYLuSOUiTohFJxpZhJfXliDiLmtFtDI2nv2qH+dHpQG+EGFuTtClyN0UWOhMJpee0bS/K1tyOV4YkMVHFC0e8nsMq9YW0KIyADcX4OBedzi/AE7a1rB2LRNAoieYfdyFG+1tq0uXIMVapsDFjGZwLXaySUuaW4hTUTCCpsDx+Qy085pGEFwqLPMlb9cT5TZJWZUGgIxrs64mUhAIxlRcw3AFiOpVMX+eKb3zws8NFqnBGxKsrbbLS9pug== 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=fcqxEt33TibWvjcS/BHp8eoTaeR3D+xpStrOcI2wsUGZxC3HtYfzbj2r7Cpz21YUODj1nY/1Lzaa10h9V7NBPXgNprv2br4MbQ1wurbM9SO14+kG1QU+g0nGlkOqwxA5wu9CLBjXjcLw/FAuyg5hov/o3p0fHtdDZ2qu1Bz5LXdGut/c7WcfkRZV1GYcvLWM4d3ReDKX5Xds+iAwODt9T/3nFRrJ2RRz4OkQVB1sXuj6Pk2veITYGevTagGtwlRJY6///6TW/2x8cYjJk8XncLrG3ZEm2zpvg+KFGh6ieiHHsogdDkdIOwcJfuemidUNAir8XEhnP069zwU0cZgc9Q== 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=gbx53IESBR9/gUXHGl83nwoHWK9bHg7qT4n6wCJ7G8KNQMDU0O8de7/34UH+toERtzoADlceX9a7JAp0MZO0OstKa+iZzRDd8JSCi7U5EnIoo4JlPA5VlwlImmQMmEhiDnYu3/0x5KVOJ5+d20MzgYSZuKSpr4/aNh0Kv0PlDm0= 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 AM9PR04MB8275.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Thu, 25 Jan 2024 05:16:06 +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.7228.022; Thu, 25 Jan 2024 05:16:06 +0000 From: "Peng Fan (OSS)" Date: Thu, 25 Jan 2024 13:20:06 +0800 Subject: [PATCH v4 4/4] mailbox: imx: support i.MX95 ELE/V2X MU Message-Id: <20240125-imx-mailbox-v4-4-800be5383c20@nxp.com> References: <20240125-imx-mailbox-v4-0-800be5383c20@nxp.com> In-Reply-To: <20240125-imx-mailbox-v4-0-800be5383c20@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=1706160018; l=1973; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=lkPMpPy6UalcvetyTqhwBLnqDq8ONTaWTu9sur2v8yE=; b=sKmTvNHtaxOL1fzrDSRxh6YTKrjr6sD9nWt/6AC/y8NZv589HRitd4ANJ3Dc0/SQXi55wNTGT 8+Li1inJ38TDG1BlqKurbW80YMCZKHXx8Wks4x+PyjfNqF8Kyb/awZv X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR01CA0036.apcprd01.prod.exchangelabs.com (2603:1096:4:192::22) 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_|AM9PR04MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: ea6ba22e-d817-4799-5d63-08dc1d64bbef 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: Hisa21zJ6QbjE64kH7JVF60nTvI4DOSt2nHUX09KMnusNp7F9JajCIKAEGn1YGhhJVeRXPD1XAAg83HoRGIpo1MmY60ThoNxgodk7InqUf1Jqh2VsefCiUN+oPMC6qZAMOutS7orYzKyeNqhgxBLYFYjZqqbrSYeLw8lsW72o9QELfbCmjVrwl0ke7r/EUYojuXeT0e0ZLhdumkgGwGzE9Qi5f2E5O//s80TW3rP9gZy1s+42W/tOftTDSyedwi1pOJqSksTPtAefBowKe3kMSQRPsN+Vsf3OBaNo6hr1Hz3qeaTTqSm+GsalB6a5vdI5lZA3KF2eII3GdhNjthzeYaa95+MWdDFIDat+/LWo7WSGr23TCYeqWceDYLBLqkHSN3ZrK316MfgmP5dWzkO7/L/wWc6DiLry+wS4xjEitt8rq1DYbNL66u69e2iRzK2bsi9VtHL7lWkeWIFTxunwLVVVvY2AG439AjzkaIjb7Z8x96jW5qmUseq8I/I2fbAAasXP7a9c6unZDKfcx1wzUhYg3PVX99t6noKJrO+8s4m2SlBjoi7KkaQL9Q74qnQu7UQ45vntmkjL1CSoB71cnqE20dQVIEOVRO2+5KBr/Oeur0C/kLHDSLNUV/PWOsmx/zbh4ONNaK5Q+3ZLkCjRg== 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)(136003)(346002)(396003)(39860400002)(366004)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(921011)(41300700001)(26005)(38350700005)(36756003)(9686003)(52116002)(6512007)(6506007)(478600001)(6486002)(83380400001)(38100700002)(316002)(5660300002)(66476007)(15650500001)(66556008)(66946007)(7416002)(86362001)(110136005)(2906002)(4326008)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?u6wTk4M8H2yh5zCrswcz0apXivuH?= =?utf-8?q?T7Wktn/qcZ7b/Ug9SPA6Cjrx/FhMRw9z9TuXdszAtK08QGOHFfzjLg+vfuNHCtsBo?= =?utf-8?q?eCkYWrpOhcGFs5RoEhAydCtRzGZoppp4Sf5brCjnce5gtZR7nfdS45KXTR7qKeH5w?= =?utf-8?q?o/CJavaHvV3eu5fpJnfhKMc8jBD2cCAD3MAEUkzbpaudnYdujfxuhTV3J7KWC/Zuq?= =?utf-8?q?4M/nRMePWzjQAwFbHBjtuER5FpJWx/d3DP1PraZYIeZB3BpY9G/gAsY8hQe1+RD6L?= =?utf-8?q?TaGqBM+59xbsSi2WtQwb5xtWejhadrjmp4Uo1QeYtc2cUSclQfIeUv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OY0SdH3Va0zodEpj7r4BdK?= =?utf-8?q?ktWHmCiYShBc81k5hIN//jKiOtPWKDUY6ynUGUkTrRbo5GJA0cEKhRWyS22g0Soct?= =?utf-8?q?q0nZeQz2D2KYksPbqWJM2BMTFp2Sf1dKOpUv9pwCOHYZ9fxuBt/X6TvPbAp15F+Q2?= =?utf-8?q?57zXv6o3VHqdhfdLX6dj+PgA8CdSh/SZ/T5ZPw5sEtbVHMBO8pS6CcUfDWK4cUxxh?= =?utf-8?q?ukopIZePRZKOvU4qj+5TWCm8WPmELBjJVUNIwcDykNBBc+xdxx22q6jqc0/v5gUhw?= =?utf-8?q?o7tZWSl90wECdGrB3Gw0QJFSUA2Fl02fXKJ2C/tbDrZmSl2weuSOPS24sGnt5VOIx?= =?utf-8?q?aVAU+ELTroIz?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea6ba22e-d817-4799-5d63-08dc1d64bbef X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 05:16:06.7790 (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: MbvgiRrlEUKCf3Sqx8Ke3EbvXmeniBYdoKaRCwo0InLf1JaAjPcpzL4Dgu/8UnEFIkXbT4n/8NeQa0L79hXQ9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8275 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 }, { },