Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5659038rdb; Sun, 17 Sep 2023 06:47:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkfXFde6Xo95lUpwIFoWG7q4JicNyGBJOFkSvyJhEC1LCmmDkRZMBT32rNiyla97k/9RV8 X-Received: by 2002:a05:6358:341d:b0:140:ecf2:4c7e with SMTP id h29-20020a056358341d00b00140ecf24c7emr6600553rwd.1.1694958461248; Sun, 17 Sep 2023 06:47:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694958461; cv=pass; d=google.com; s=arc-20160816; b=XAYwsvLmGRyqyCtLSo5vy3UrHbyLyk/DBN4tmRUm79iexGqIiP9PCaTK3ykPs96ClL 78vcRAqj5vKnA2x30IQfzKUz/FRi4HaRSqTXfudkx3G7kBxQuEmxi3bDoHvabwpOwUFc yuYrPv9PK6REVEtC2ZAosSFDZXGnWV47fE9vXuTW/sjAXflpvbN15kf1lnnumw4DMGMz 4hBJALUBlVQ4PQ3ppTGvUlTL0XaMJtmaxMq3t4yleX1cZ73swlYvDJdYOhacPoBj+CJc ujLWX1pCgu0RcL9+dOGqNTWY/UhkhA+6xI0V9E3tDgsgq3BNNdFVcaQ+Ej/SD33Sfm0F ZVng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:cc:to:in-reply-to:references :message-id:content-transfer-encoding:subject:date:from :dkim-signature; bh=DY6QVPJC/JetWcsFl7H8Aar/2lMjxonTEiOUMmgDHVg=; fh=VNZ1D5W3j6uiR7iRIAC9FyrBeJJkeoBNqYrp9ebTDoQ=; b=YtUY/Ynp22S0uJzvuMF2tFce7F+p8GR5UmKzQj3r+bDD2PduwHbsQwO3rOSNrXaecz kjjf8A/9t6Y6KBGQ709MaJ7NEge4a/cPp0PyuHap6xtg/Sy7QwZ8h2wiDcTfzGFkI/fK 0FomIFO7PuxRBc7Q8tTrlKrj/Ab6siymL1xMbv1NwkC+lONLyk3uidl01YS+2jNhvJkT 4kK/7KZycjk9va7lTN7mxiVFE/7cjD1HJBHlMtHgiIHtrzNlupQVcwRFR96VjVU7iVcK 93W/Zl7xolmVlo63GDE9zvutywYE4f0fgT+eL6dcf+jvmVYv+ThbE44zcWRnpxW17G5Y tM4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=CuiGdYVa; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b4-20020a056a0002c400b0068ffeb6a94bsi6302886pft.56.2023.09.17.06.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 06:47:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=CuiGdYVa; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6973981A6E55; Sun, 17 Sep 2023 05:40:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233750AbjIQMjq (ORCPT + 99 others); Sun, 17 Sep 2023 08:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbjIQMja (ORCPT ); Sun, 17 Sep 2023 08:39:30 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2084.outbound.protection.outlook.com [40.107.22.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09EF2186; Sun, 17 Sep 2023 05:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pu/cWJslb/TKOaQLaByCVNSEZ6h0uu45ONNp7ZLwr6v0ryASXIk4unaFBKCrJarLoUrYT9sBtCvm7jt6qB9MMJKiD+Al4ksGc2gcNg4kyLzlPx7TW8HG1pQ0SA/lnfiADmhEnaxnS05xSo4/ceHHleJg4kynaJYxoxvAhWN86JvkQUKoM8wB830f1zeIj3Mnu8pAt5s/Rp76OnsStgHr09Gud1CXLel4/5QmWguNqzOukyHc5EvoFfmBvIGAikTOeLB6Cgk638JD5lQDnBctqRt2zMB4X4wHu4OHK0GXm4+8ELi6cSY5TB/tXr6xWwGaHCk+y0bxs2NhmnGkZzTC8w== 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=DY6QVPJC/JetWcsFl7H8Aar/2lMjxonTEiOUMmgDHVg=; b=cb1AqEPtmtxbvH+4fpWkThhDT9tZqrNQGJFvjI9Z6GoDNmuN5jdjl7UY0vY+NsrbW1DTRpkJY1iUAPEkPuu5IGHOQqFFr5tK4B/4F8y/yNW+mvczdgReZYHB9CUpHG0KUAWAxXej7WqkQrqhRKN2aGqh3d1vAaNZyt/OTXwIgIphTSc1WMvs2F7wCf3GVZZISqf8l6ABc5b4q3Snw+REeCAajb9JixWZvnqGE8UGmTBZg42rRu7XZQO5HJ+2KrIZgJgrt1BkrrPLfb2f5wDhkk5LxzPbJgUI4bz7dIJptfB9n9GXazLix7Bb+9oHE7rosvlJS6wvOA2fIXXxxG5nAw== 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=DY6QVPJC/JetWcsFl7H8Aar/2lMjxonTEiOUMmgDHVg=; b=CuiGdYVa513taMzd0hh5AD4L25jN5g4jL6jbRE5nCgqZbcLo+tQJ44V8nnuGH4Kmfkq/9Y80uSjgfvO8SiIvNceq2vLtjaTVXOG14rkqZkFF55xtYDFzfkIqh4kT0xGFex3Kdn0B2rrG1pIGLLiDO/mts+1kHcvqJEJWf6Z6/1Y= 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 PAXPR04MB8928.eurprd04.prod.outlook.com (2603:10a6:102:20f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.24; Sun, 17 Sep 2023 12:39:21 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::2b3:d8de:95c8:b28b]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::2b3:d8de:95c8:b28b%3]) with mapi id 15.20.6792.024; Sun, 17 Sep 2023 12:39:21 +0000 From: "Peng Fan (OSS)" Date: Sun, 17 Sep 2023 20:43:51 +0800 Subject: [PATCH 2/2] mailbox: imx: support channel type tx doorbell v2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230917-imx95-mbox-v1-2-440245287356@nxp.com> References: <20230917-imx95-mbox-v1-0-440245287356@nxp.com> In-Reply-To: <20230917-imx95-mbox-v1-0-440245287356@nxp.com> To: Jassi Brar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dong Aisheng Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694954643; l=3536; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=IpDDsV2srMT5yXNKgZuFQNd3N7MPTACoYyXGGcM5Up8=; b=zusOE48DuB03Zn5FyRzsggOAEAgjgJx4w9mBwAMvdpmP4uO9l1bcePGwpNiCXBpff7ua8Z7Ty ZSIgzYWbLX2ByC1Msb3v0BoXSZfrRCcIKqIolIQt6mCuZILpIK8H3ci X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0093.apcprd02.prod.outlook.com (2603:1096:4:90::33) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PAXPR04MB8928:EE_ X-MS-Office365-Filtering-Correlation-Id: e7236897-b78b-40f6-a41b-08dbb77b1db4 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: tE1PFlLS9bFYpn6WK/WCD+btfL89DPof9bk082bCa9QWJTDcx6rtFQg1aEhhERIIsTbGYM4wl5srfOr5j8WHDKwicCOTHqJRBflQqTFHCF8jEq/5yOVffcXMtONf319K7qvJjzEBRW3xqDQcu/HdlDseeKMbVqRWBnEPieM1pnmif1kf591gl4VJ5DyAwQ0+hXKqSTw8NIlABT4GS/A4rxBRnZ0W8l3SUaXUt1HmquFKGknfOywq858jPctkLMRhxf4yUeUS3ujCNECPdYZx5nmdOMn+G4LQZ6PyWMHYmE8jLAAHH1MCulUyb/cMK8EggH47Ep0ToPQEqLlsGFNl4LJFDIr0etN+XwpyZp3W0uxoKhK4kwgudPvCUwtkeXpPGOdc73LDS95rhElLZXHaNFXG2tLDeGYdaJi3NVof/jU9bX5Fr5Oc7gU4BDBlgi6skxUBJPHWWUgrcRggjqfeAdA/S5/4aWSoFcT04je3gq0yIhI/Y1cC5deiI0xF85RRuMiqkv2YpG+wo/x9dntlCTd11wOXIvJ/bNeZeix3L5gXpgiq5kkBEWHFJuG8/Q1dhE863PnqUVPiAZSr857EovRuwMXxS84qxhyK+22fyQZIIpC/JyqEGH2q15i+aYkLiDZ9Xhueco9lhdgAaSKOcQ== 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)(396003)(39860400002)(136003)(376002)(366004)(346002)(186009)(1800799009)(451199024)(921005)(36756003)(38350700002)(86362001)(38100700002)(6486002)(6506007)(52116002)(478600001)(66946007)(66476007)(5660300002)(66556008)(2906002)(6666004)(8676002)(4326008)(8936002)(9686003)(6512007)(83380400001)(41300700001)(7416002)(110136005)(15650500001)(316002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSp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gwbnZkRnVWMkd3RFE1?= =?utf-8?B?TUFaY21SSUF4Vm44Vk1TaDlxNWFIUHZZTW5zWjdsVlJoSy9BS013QUIzNk5p?= =?utf-8?B?VStjSUNpUDBjanVveXo4czA4UWZ5YklZZy91SnRLY3d6eDlMbHkwZGRtR3pO?= =?utf-8?B?VStJVXF1cGNmd2JiaEpLc1NkaXRJUVhLbm1MdDNzWittWUw3TVJSRzZzVWFF?= =?utf-8?B?QlIybWFobzlKQ29Qd3VocVdYWmF4WXZ6OUs2NTlST3RGeHFmMGVGc3I3bmNJ?= =?utf-8?B?UzhLYlpwWGVpd0FlODRHM0tXQXF2blZncG5ZamdaT0tHK1NYdEpHVFpDbFFO?= =?utf-8?B?aTVrdTRvTndhcytHTTQ4S3huTStCSDBhV0c5aEsxN01SNGRyV2tDS3hxV0FT?= =?utf-8?Q?/BTX6hteGGOlqw+LHEk62t/Yl?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7236897-b78b-40f6-a41b-08dbb77b1db4 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2023 12:39:21.1178 (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: GdL2BZcfDVug8GuP8rVjndzkqIeOFz33eUhV1xnz3Z8qWkeuMgJqvJQYJ2qTgTZDViMVZF6ykvtVldKBU9/KTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8928 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 17 Sep 2023 05:40:29 -0700 (PDT) From: Peng Fan The Message Unit(MU) General Purpose Control registers are used for TX doorbell, but there is no hardware ACK support. The current TX doorbell channel is using tasklet to emulate hardware ACK support to kick the TX tick from controller driver side. The new added TX doorbell channel V2 not using tasklet to emulate the hardware ACK support. The behavior for the channel is just writing the GCR register, and no else. This will be used for SCMI mailbox. Signed-off-by: Peng Fan --- drivers/mailbox/imx-mailbox.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 3ef4dd8adf5d..0af739ab571c 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -20,7 +20,9 @@ #include #include -#define IMX_MU_CHANS 17 +#include "mailbox.h" + +#define IMX_MU_CHANS 24 /* TX0/RX0/RXDB[0-3] */ #define IMX_MU_SCU_CHANS 6 /* TX0/RX0 */ @@ -39,6 +41,7 @@ enum imx_mu_chan_type { IMX_MU_TYPE_TXDB = 2, /* Tx doorbell */ IMX_MU_TYPE_RXDB = 3, /* Rx doorbell */ IMX_MU_TYPE_RST = 4, /* Reset */ + IMX_MU_TYPE_TXDB_V2 = 5, /* Tx doorbell with S/W ACK */ }; enum imx_mu_xcr { @@ -226,6 +229,9 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv, imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0); tasklet_schedule(&cp->txdb_tasklet); break; + case IMX_MU_TYPE_TXDB_V2: + imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0); + break; default: dev_warn_ratelimited(priv->dev, "Send data on wrong channel type: %d\n", cp->type); return -EINVAL; @@ -554,6 +560,9 @@ static int imx_mu_startup(struct mbox_chan *chan) int ret; pm_runtime_get_sync(priv->dev); + if (cp->type == IMX_MU_TYPE_TXDB_V2) + return 0; + if (cp->type == IMX_MU_TYPE_TXDB) { /* Tx doorbell don't have ACK support */ tasklet_init(&cp->txdb_tasklet, imx_mu_txdb_tasklet, @@ -595,6 +604,11 @@ static void imx_mu_shutdown(struct mbox_chan *chan) int ret; u32 sr; + if (cp->type == IMX_MU_TYPE_TXDB_V2) { + pm_runtime_put_sync(priv->dev); + return; + } + if (cp->type == IMX_MU_TYPE_TXDB) { tasklet_kill(&cp->txdb_tasklet); pm_runtime_put_sync(priv->dev); @@ -671,6 +685,7 @@ static struct mbox_chan *imx_mu_specific_xlate(struct mbox_controller *mbox, static struct mbox_chan * imx_mu_xlate(struct mbox_controller *mbox, const struct of_phandle_args *sp) { + struct mbox_chan *p_chan; u32 type, idx, chan; if (sp->args_count != 2) { @@ -680,14 +695,25 @@ static struct mbox_chan * imx_mu_xlate(struct mbox_controller *mbox, type = sp->args[0]; /* channel type */ idx = sp->args[1]; /* index */ - chan = type * 4 + idx; + /* RST only supports 1 channel */ + if ((type == IMX_MU_TYPE_RST) && idx) { + dev_err(mbox->dev, "Invalid RST channel %d\n", idx); + return ERR_PTR(-EINVAL); + } + + chan = type * 4 + idx; if (chan >= mbox->num_chans) { dev_err(mbox->dev, "Not supported channel number: %d. (type: %d, idx: %d)\n", chan, type, idx); return ERR_PTR(-EINVAL); } - return &mbox->chans[chan]; + p_chan = &mbox->chans[chan]; + + if (type == IMX_MU_TYPE_TXDB_V2) + p_chan->txdone_method = TXDONE_BY_ACK; + + return p_chan; } static struct mbox_chan *imx_mu_seco_xlate(struct mbox_controller *mbox, -- 2.37.1