From patchwork Thu Apr 23 06:59:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11505047 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BEEAB13B2 for ; Thu, 23 Apr 2020 07:08:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CA1D208E4 for ; Thu, 23 Apr 2020 07:08:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FF9G00tw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="gBtctP/D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CA1D208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zglAUb6Xcw2graM3/0LHgywAVMmfAwLooiMkzZezVTg=; b=FF9G00twXun/Vv gi7tdOzqDNKHWR/DxitwbWvvXKjVmtmRXKmxLIHbeG/7Wc3mb0v1VV/ZtPNpRo7Bsumw0/0XxCMz5 8BY3WRbpkGEYoL2jOc1ZVZfZWtqmCusQiSgAzCpbmLghXeiqV2+XsefngHucINzE+iioT0zgg8nFS AtlQDkZK4q6/XvnQ/kLqC7u9agMTAOuy5SKuQUXrJEAyHxHSrd5OivvkUQrwFQpj/AT7g66dmhhtf 8G2gd3zVU9QpwHQijdfuykMJ94i5vMNME1Txy3+70xAlOIm9GrWV9DttTclbXrdxnOt/iVvn4AMm1 orF3di2rZozl+CVS+1Dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVyI-0003sy-07; Thu, 23 Apr 2020 07:08:30 +0000 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVyC-0003ju-3r for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2020 07:08:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IjCgockGVONWTR1/HSbHOjTA9NbGSxrSC0dwe6mOy9PBnA1ejqiVC2WQEQWz6eAu2myorM3mxStiIHnuFCZTOu9+lY3vdaO27yGg5tTVVTzRGwGIZVrEk80cWKVW5n5fM4ZRTwFBx+IHB7tSky7CZ0DOWigqdB0kdp1iS4szEzMBVNLx1LRMMyz1DZrDEGtbCUIChnzeX0bzk9K+W/CFXBvoPtKd2u6Z2yADHhyr7akUCUPav7h2wSXAbhzjOW8ymAHZRVfKmPBTgUaJxY9X+2gQn0TWhjIs+bJDSFO4dG41pBUT1qhWkheL9MFPVEuGW3r7BMeWUYH7RNsvHO2PJg== 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-SenderADCheck; bh=Ur8Au3O0xO7Md6JZwcMzv0kfcjxps9aYPr10QkeweZg=; b=jo6MG9V94ht0pi9wJlj+2fLQ6xUi2rlxzGknRmeI7QSfVY3YT5A+978bthf3q28Tkm6hkqB85PJlBzBUoclrajg7a9mgDsKR6r/HZHFhc6vBFcDXK4QgkbBA0PGHqtDxV9TpNeiuvztvqzq8agMvpOkWRibjnZgpRGW7Up5s7LyScBIpvIo69nRQLI15ibEbPRcIJXr1CpaXQq5q8d/ZRNVzeIUd+0aMsqjWAMLXOKfRNCY4bmjz5zHj736wjXa6sC8VcLYX6r8KK62jKnLaOjUWbE/5Dl9FML4pl4uHHjhMQpP5w5m7yl65JvyxyYA1oLYbni8vw1REs17GoKD2Bw== 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=Ur8Au3O0xO7Md6JZwcMzv0kfcjxps9aYPr10QkeweZg=; b=gBtctP/Dw3RhZ7DBKXRcDuFgGRCHVEXrDBqf488fWv2xEfCgV3+u/h0d4okeSs7FkxwzWEMkjgFJdR4UnwTTbYDznJFoxYE/hBOgxn6EKynmc3HAwTAt0GS1ZJ03StzhLYt/T2p5vlxs5bQMZBAXIbYM1hE77vFWIjTXeCP3ROY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2855.eurprd04.prod.outlook.com (2603:10a6:4:98::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 23 Apr 2020 07:08:21 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2937.012; Thu, 23 Apr 2020 07:08:21 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH 1/4] firmware: imx: scu-pd: fix cm40 power domain Date: Thu, 23 Apr 2020 14:59:31 +0800 Message-Id: <1587625174-32668-2-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> References: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2937.13 via Frontend Transport; Thu, 23 Apr 2020 07:08:16 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 71d9c54d-9967-4146-50d4-08d7e7551b02 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2855:|DB6PR0402MB2855: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 03827AF76E X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(366004)(136003)(376002)(346002)(26005)(66946007)(4326008)(6512007)(9686003)(66476007)(4744005)(6486002)(66556008)(69590400007)(6666004)(5660300002)(86362001)(8676002)(81156014)(6506007)(52116002)(16526019)(8936002)(2616005)(316002)(2906002)(478600001)(186003)(956004)(36756003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kdJIvjKUk7r7WM6lRRx+NL5CVTHr+8ElrocAA2CrDHECFhFLUBtZqduHSKyk6UTAJpySL+mXng611jNeano9myrknuC0H0ft3ZaS3Bq1a9EJEFmLUH1+ctp/NHo56yvNlpxVdrZas/pgW1TJsgcDVcfYdBIBD3sssHRL1ZIH9WSSqye7lv1O9yTMj5+4zPNsPmell9b/zQ3qyedHdZF/eWZmj63eyg+8fbHVwpQEBPvQrK0Tm0S9vDgI8iwxMxWnNESVbmn8jef1uKFWp8XqpB/4E8oyxV4mLlCy/doZQNUxv/bugWgt2GlCnvwf2FF+t0Vp9vvTD2/qNAVAQkYG07DLJNeh54AYmDcKO7HnRt+yLB05JA7wCS3trI92uEjRFsUMr1rODTcTT0P6VsdI6GusOd0kd8Xz6qW6f0Yw/ODTEx2iwbcABygxU0MI6k/YvZc5lwrRO+xe8bRLaPF3AdkEcYqHGIiLNp4HdktL4u17QPxB0BzY3FkpCOZxcdyr X-MS-Exchange-AntiSpam-MessageData: KChe8/LwsqOcGv+2+CYapbG0xu9zIsQh3G3IYZ+uZR5+RFVJfoCxTvYumzCj4VeO2GfScmrUqKZrETylRZcBZkj6lFnhaBkrXyk7+SxaPrFKqjB5NbPNej1pqryJ/A0NWNpYVtVU8iWO0A2h6UMdhA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71d9c54d-9967-4146-50d4-08d7e7551b02 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2020 07:08:21.1385 (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: kCro14OwojSUdZ8ikP4TgrD/IwfPwtNiwHai0HGGmzgh0wo9cQqpbLxp/0Djy2QHRiHKIEDHAMPFe3cLLXiq+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200423_000824_206884_854040A6 X-CRM114-Status: GOOD ( 10.60 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.6.71 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aisheng.dong@nxp.com, Peng Fan , festevam@gmail.com, qiangqing.zhang@nxp.com, linux@rempel-privat.de, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, leonard.crestez@nxp.com, daniel.baluta@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan The postfix needs to be false. Alought compiler use 0 for postfix now, and take start_from as 0, it is better we add explicit false to postfix. Fixes: 705dcca91d0a("firmware: imx: scu-pd: add power domain for I2C and INTMUX in CM40 SS") Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng --- drivers/firmware/imx/scu-pd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c index fb5523aa16ee..d1b313fa7b96 100644 --- a/drivers/firmware/imx/scu-pd.c +++ b/drivers/firmware/imx/scu-pd.c @@ -167,8 +167,8 @@ static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = { { "dc0-pll", IMX_SC_R_DC_0_PLL_0, 2, true, 0 }, /* CM40 SS */ - { "cm40_i2c", IMX_SC_R_M4_0_I2C, 1, 0 }, - { "cm40_intmux", IMX_SC_R_M4_0_INTMUX, 1, 0 }, + { "cm40_i2c", IMX_SC_R_M4_0_I2C, 1, false, 0 }, + { "cm40_intmux", IMX_SC_R_M4_0_INTMUX, 1, false, 0 }, }; static const struct imx_sc_pd_soc imx8qxp_scu_pd = { From patchwork Thu Apr 23 06:59:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11505049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87561112C for ; Thu, 23 Apr 2020 07:08:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FC1C21582 for ; Thu, 23 Apr 2020 07:08:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nrPBJGw/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="a/51B6b4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FC1C21582 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xVbgU2PEIV1obsrAV7qwVN2HDdR32dn4q3G3lJV8t8w=; b=nrPBJGw/ECrJIE f7nJ9BoCqSgiHQLPnWPYDSj26aOV/s1BlJHRu5QF9SL7cAMA+y3Bf1PtdjvnMx27/LPloRDf9BYcc 3nK8dDKI2lCfvvkNOMwGo2WryM9CQ9ozb2pIzLolyMBoO9zuFb5XnG8Fw5xQxBL/DVqxkHzuKJQ0Y N2TdWcmDqmM1Zo8Z/HyQdmv5o2VLw0gaPkanNLFlw3DGIC8ArlxlCy6zWgKGZ+0FjlRPpsuCY+rB5 5gWfhLWNYMD9L/TGe14wwy13CtkvNQIxMF77xfQgvEMr19XRf2D3lLs4QPU3IZ/6Izc8MbF10Dpl/ i71fVP8xkDLwoK8Sm9qQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVyg-0004Gm-Q6; Thu, 23 Apr 2020 07:08:54 +0000 Received: from mail-eopbgr60055.outbound.protection.outlook.com ([40.107.6.55] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVyG-0003q8-Oa for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2020 07:08:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZiJ7qAiWZTkEF0Yo8GoM5G3WEp6MDlMrllmnhjK08Xc6l7wgP1vzFdcqrkbEw44J8pu5SaLXlvnao0YQR/tx3YI5eO5nUrcRmBSTDBFPPhp3y+dgPQAJxXBROLCvsKJeWOKfizIodw7cx0ThtbUQN8+G1ZkTi3aYSnxHFXu4jgCb3WhGbkA3pHidIyUtp4TL3yanSOCql+hMFXh6yst1OopttgPw/jbWsvcXjIeV1YkqRqsdKUUbg4Sq+oNA3/vtKFMZXfLhg9XiVQgYDKGgrS0AOAIetakT8oeX9nT6Dt105kWgy8IBtGq0ILvvvztoLjNBeuwI8iPtXKHIa2hZNQ== 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-SenderADCheck; bh=p4FEv099cAWG1Df1rkKDr0Qp9RWpyCfNJwRRLEZw59w=; b=e0EdGvu/nNyIJHPRevbP3fF9yXNhbehbBAAxns+6oSwcMdLtzerN98SUPphL3srXDh8h0DCTD5Kpq+Li8vFLa6oVzqFgCVvq6kFZ4Fk5m3HBATG3K6y6nNYNQqNkPzMxcwqoOw0gsx5pDuqSe6aEwbhAmQ5Z9kCPxHXqqv+1K3EpZyTgWsYYRb0RV3O0hQMGhQWaM9rIssriNJ8RibAvkpvAT6/JNgR5zWbAKFj21kGbkkVj+itjonneoCIYfW/vF/Ma7+5b8OhTrZQcQwtMM8wLAG/S5KT3+RqlpyTHv32GcE+Rss1TPSzy0XkZjsV3XX9zjr98vpNhmonbJD4o4w== 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=p4FEv099cAWG1Df1rkKDr0Qp9RWpyCfNJwRRLEZw59w=; b=a/51B6b44/cmKeXS5oYpPVS6cugFeQ75X0IXyLitAQfTblUl7jPOh37qBA19gjX1Qo5mX3MOzYIuyNE61Z6fdDif8jLPboN9l2BDjufwYgDTsfSy6nHxipkx8KOq+a6BMeI4y4TwiLckkDIJhXKBvtdP9/qAiQIM3cml/Uf2tfw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2855.eurprd04.prod.outlook.com (2603:10a6:4:98::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 23 Apr 2020 07:08:26 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2937.012; Thu, 23 Apr 2020 07:08:26 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH 2/4] firmware: imx: add resource management api Date: Thu, 23 Apr 2020 14:59:32 +0800 Message-Id: <1587625174-32668-3-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> References: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2937.13 via Frontend Transport; Thu, 23 Apr 2020 07:08:21 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d45d75b7-ebc6-4539-40d2-08d7e7551df0 X-MS-TrafficTypeDiagnostic: DB6PR0402MB2855:|DB6PR0402MB2855: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 03827AF76E X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(366004)(136003)(376002)(346002)(26005)(66946007)(4326008)(6512007)(9686003)(66476007)(6486002)(66556008)(69590400007)(6666004)(5660300002)(86362001)(8676002)(81156014)(6506007)(52116002)(16526019)(8936002)(2616005)(316002)(2906002)(478600001)(186003)(956004)(36756003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o4hIOXzDzE9U1fiY6oSKIt4k23QVSCzUppf+KXdYOyUJA+jn3/sX6Cf60tv+9bjRT92OmiB7T+udTADq+jzQsFq6LVXJY+Zp0MbJu7/7ayVzzJu8sKvGzv1Iynhb8q5hYU12LJ6B3xy65L46NVtJ39v5jbni8jhxVPL+AngepezhcssVVQAmj2BMB60fTYbLo0ySXMZvdxnQYm7cvgkcIeizskHIP3ZB5oTci/Bjg+1u/j/qZXMIWLoeCeNeuanljjvUaF49dAz7tO3/omQ+5SYS1vQp/pac8uxWHVt9rfSRZ9JzJ0FkEqm2B/uxmihxzyzhn6sui5cujIy4J/LJpRxnNRNy1b6R6jR2EFWN3TB7ihMZfWMnFBHv37PrGfUuK13PmRCeNVXzAoz5dwPJEwCnHFUWHh2d5A41TqowsdNWZOjHRt3MRIP9BIuyDK+xnLsRL3RBtucfbHnap9gkHKloHqVtUnP98E3Jmq2cYlCH+Vb4I0GZjJBUUzZm7cky X-MS-Exchange-AntiSpam-MessageData: 1bqFZJcmubYIdOPu6ff9c0T82ysRSoWtenMuOhuCyeS9wwoNOYwkYudxDtp+/vKC5SSfV/zgNn5KrqY8v3ZHkl5CaITImEvpiKOUj/sWMdzBVmJ8bppF5zCCXloLWFiIXsNZtLyLDW11bBddvcVybQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d45d75b7-ebc6-4539-40d2-08d7e7551df0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2020 07:08:25.9194 (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: VXoDQrWrGOwekmnYwaxqh3MTbQOj9C3RjFCr6qNTTkN01rY65DqGvlFjrC1IVwe6OZdwaalr/B8Kt3nLFcEs8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200423_000828_805674_278DB056 X-CRM114-Status: GOOD ( 16.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.6.55 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aisheng.dong@nxp.com, Peng Fan , festevam@gmail.com, qiangqing.zhang@nxp.com, linux@rempel-privat.de, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, leonard.crestez@nxp.com, daniel.baluta@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Add resource management API, when we have multiple partition running together, resources not owned to current partition should not be used. Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan --- drivers/firmware/imx/Makefile | 2 +- drivers/firmware/imx/rm.c | 40 +++++++++++++++++++++ include/linux/firmware/imx/sci.h | 1 + include/linux/firmware/imx/svc/rm.h | 69 +++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 drivers/firmware/imx/rm.c create mode 100644 include/linux/firmware/imx/svc/rm.h diff --git a/drivers/firmware/imx/Makefile b/drivers/firmware/imx/Makefile index 08bc9ddfbdfb..17ea3613e142 100644 --- a/drivers/firmware/imx/Makefile +++ b/drivers/firmware/imx/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_IMX_DSP) += imx-dsp.o -obj-$(CONFIG_IMX_SCU) += imx-scu.o misc.o imx-scu-irq.o +obj-$(CONFIG_IMX_SCU) += imx-scu.o misc.o imx-scu-irq.o rm.o obj-$(CONFIG_IMX_SCU_PD) += scu-pd.o diff --git a/drivers/firmware/imx/rm.c b/drivers/firmware/imx/rm.c new file mode 100644 index 000000000000..7b0334de5486 --- /dev/null +++ b/drivers/firmware/imx/rm.c @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2020 NXP + * + * File containing client-side RPC functions for the RM service. These + * function are ported to clients that communicate to the SC. + */ + +#include + +struct imx_sc_msg_rm_rsrc_owned { + struct imx_sc_rpc_msg hdr; + u16 resource; +} __packed __aligned(4); + +/* + * This function check @resource is owned by current partition or not + * + * @param[in] ipc IPC handle + * @param[in] resource resource the control is associated with + * + * @return Returns 0 for success and < 0 for errors. + */ +bool imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource) +{ + struct imx_sc_msg_rm_rsrc_owned msg; + struct imx_sc_rpc_msg *hdr = &msg.hdr; + + hdr->ver = IMX_SC_RPC_VERSION; + hdr->svc = IMX_SC_RPC_SVC_RM; + hdr->func = IMX_SC_RM_FUNC_IS_RESOURCE_OWNED; + hdr->size = 2; + + msg.resource = resource; + + imx_scu_call_rpc(ipc, &msg, true); + + return hdr->func; +} +EXPORT_SYMBOL(imx_sc_rm_is_resource_owned); diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h index 17ba4e405129..b5c5a56f29be 100644 --- a/include/linux/firmware/imx/sci.h +++ b/include/linux/firmware/imx/sci.h @@ -15,6 +15,7 @@ #include #include +#include int imx_scu_enable_general_irq_channel(struct device *dev); int imx_scu_irq_register_notifier(struct notifier_block *nb); diff --git a/include/linux/firmware/imx/svc/rm.h b/include/linux/firmware/imx/svc/rm.h new file mode 100644 index 000000000000..fc6ea62d9d0e --- /dev/null +++ b/include/linux/firmware/imx/svc/rm.h @@ -0,0 +1,69 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017-2019 NXP + * + * Header file containing the public API for the System Controller (SC) + * Power Management (PM) function. This includes functions for power state + * control, clock control, reset control, and wake-up event control. + * + * RM_SVC (SVC) Resource Management Service + * + * Module for the Resource Management (RM) service. + */ + +#ifndef _SC_RM_API_H +#define _SC_RM_API_H + +#include + +/* + * This type is used to indicate RPC RM function calls. + */ +enum imx_sc_rm_func { + IMX_SC_RM_FUNC_UNKNOWN = 0, + IMX_SC_RM_FUNC_PARTITION_ALLOC = 1, + IMX_SC_RM_FUNC_SET_CONFIDENTIAL = 31, + IMX_SC_RM_FUNC_PARTITION_FREE = 2, + IMX_SC_RM_FUNC_GET_DID = 26, + IMX_SC_RM_FUNC_PARTITION_STATIC = 3, + IMX_SC_RM_FUNC_PARTITION_LOCK = 4, + IMX_SC_RM_FUNC_GET_PARTITION = 5, + IMX_SC_RM_FUNC_SET_PARENT = 6, + IMX_SC_RM_FUNC_MOVE_ALL = 7, + IMX_SC_RM_FUNC_ASSIGN_RESOURCE = 8, + IMX_SC_RM_FUNC_SET_RESOURCE_MOVABLE = 9, + IMX_SC_RM_FUNC_SET_SUBSYS_RSRC_MOVABLE = 28, + IMX_SC_RM_FUNC_SET_MASTER_ATTRIBUTES = 10, + IMX_SC_RM_FUNC_SET_MASTER_SID = 11, + IMX_SC_RM_FUNC_SET_PERIPHERAL_PERMISSIONS = 12, + IMX_SC_RM_FUNC_IS_RESOURCE_OWNED = 13, + IMX_SC_RM_FUNC_GET_RESOURCE_OWNER = 33, + IMX_SC_RM_FUNC_IS_RESOURCE_MASTER = 14, + IMX_SC_RM_FUNC_IS_RESOURCE_PERIPHERAL = 15, + IMX_SC_RM_FUNC_GET_RESOURCE_INFO = 16, + IMX_SC_RM_FUNC_MEMREG_ALLOC = 17, + IMX_SC_RM_FUNC_MEMREG_SPLIT = 29, + IMX_SC_RM_FUNC_MEMREG_FRAG = 32, + IMX_SC_RM_FUNC_MEMREG_FREE = 18, + IMX_SC_RM_FUNC_FIND_MEMREG = 30, + IMX_SC_RM_FUNC_ASSIGN_MEMREG = 19, + IMX_SC_RM_FUNC_SET_MEMREG_PERMISSIONS = 20, + IMX_SC_RM_FUNC_IS_MEMREG_OWNED = 21, + IMX_SC_RM_FUNC_GET_MEMREG_INFO = 22, + IMX_SC_RM_FUNC_ASSIGN_PAD = 23, + IMX_SC_RM_FUNC_SET_PAD_MOVABLE = 24, + IMX_SC_RM_FUNC_IS_PAD_OWNED = 25, + IMX_SC_RM_FUNC_DUMP = 27, +}; + +#if IS_ENABLED(CONFIG_IMX_SCU) +bool imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource); +#else +static inline bool +imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource) +{ + return true; +} +#endif +#endif From patchwork Thu Apr 23 06:59:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11505051 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C1AB112C for ; Thu, 23 Apr 2020 07:09:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6847E208E4 for ; Thu, 23 Apr 2020 07:09:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EDf+hb7F"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Eb8icTg4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6847E208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7aYnEfPY+wvfoMa0AlAJ4RggvFu845vIaoaMXK5ADfs=; b=EDf+hb7F+IDsXd QRA0eX8FPxA9rMqqTOZWQT/yv2B9VQwBueSECSHV8lrxmJjVRm9+uRnEAh8wVdqkGZTxVdYXIAGqX E4JxzwZuAzwFO8gVKuqHhvgFAAjCI3mvf7vKzUtVENc+atCdDyi5WMXz0iso+nieLHIY0ZemPGxxD piqM84L/LcoGIqg+Hjn4xOJ7h3KLDMMP8240cqhfIWUVlA3jm0nGiTiaXiOdUruF1wcv2m6N3khjv xYLkDizg09WBSvIhUeYU0NA0ysbgiBIm/r7wTwcpEJoH368+AeqyERS82F7kQQ9wv2GZ9UIKfuEAi c5dL21R4UYlvVf/RTXNw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVys-0004TU-DV; Thu, 23 Apr 2020 07:09:06 +0000 Received: from mail-eopbgr60047.outbound.protection.outlook.com ([40.107.6.47] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVyL-0003wE-Nn for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2020 07:08:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YGpsuvk36CniBlplmQtE7ZLDJmFOZs3/LkQcPmLtuNDx7tb89ctJx6oOfXXkjLZW7RY9g/VmbiuxBrj2oT5EPUzPBeggLwNBoVzQmzfT8gF7RfnvHrciVSmfXIcp8TJGeQearL4WyH3qBTvlk+rZ1+8QH0DbDFil4l5U21C02l8qKH18wueMjhvRpu/3GK/6Sv8bn2sOgrkUqli9llRfUyKtOpYTu9jexQRlcBImtwOO4vd9OCR83rX4z2bv40TvcrkODgX36YcVekA7R43zQv7Ey/AaZbeA7W17rs3YPfXmhfF26yDhlQbmug/HcAp4Ed7WijplNqr1id67XeHbcg== 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-SenderADCheck; bh=7zOy39rk5Xge0p5JCMCrKXCRpmTTvNYyP9zXs1h67S0=; b=eM28EIVxSiVy5yjNLcfN3ZLccpMfL+FWAjN+OAfFvoTFwmFeRj2ws8ZwJWux1/yPARv7+8kwoRzir3ft4jO4OuAFS/AmwqWOf6ZrFnFTwUccp12H1qbVV/KRbsECVjaSznsXq/aOsOFAAvloGBOEaQYHyO2S+r1FlviaaPSp0zwRyBRfQ3iBQut4kz30PLi0iy4QUPhjR/KLy4cA5eW67swsc2pQh+pd+wwAdJjr15RD0S70zAFXEja/xYR0AEprwcixtRgF3oaUOIaY8qqUZCO8tj4eSdwF24QJsYu3N6L8EKzZsp28oEbAokyPdQO3KKvwR3GKV2wcrqdt1tLV7w== 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=7zOy39rk5Xge0p5JCMCrKXCRpmTTvNYyP9zXs1h67S0=; b=Eb8icTg4ig6Q7upnutAGDt3irUkWH3K7drVpeslarKwdPHKZnSNJ0Z+kUQAPQLQ4+swTXmJv7FfdfQndZ6lX1bWY+a1g1mL5czH3pgW3nbi/aVHe/hf0sG49t77tkrWZnyeNOTNQDhEFPpaS7BDm8afwaVuME0CtkFhVdgmRGcc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2855.eurprd04.prod.outlook.com (2603:10a6:4:98::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 23 Apr 2020 07:08:30 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2937.012; Thu, 23 Apr 2020 07:08:30 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH 3/4] firmware: imx: scu-pd: ignore power domain not owned Date: Thu, 23 Apr 2020 14:59:33 +0800 Message-Id: <1587625174-32668-4-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> References: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2937.13 via Frontend Transport; Thu, 23 Apr 2020 07:08:26 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 34566bfc-f4a8-4085-3e6b-08d7e75520cf X-MS-TrafficTypeDiagnostic: DB6PR0402MB2855:|DB6PR0402MB2855: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:843; X-Forefront-PRVS: 03827AF76E X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(366004)(136003)(376002)(346002)(26005)(66946007)(4326008)(6512007)(9686003)(66476007)(4744005)(6486002)(66556008)(69590400007)(6666004)(5660300002)(86362001)(8676002)(81156014)(6506007)(52116002)(16526019)(8936002)(2616005)(316002)(2906002)(478600001)(186003)(956004)(36756003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L/FLOqmoVcj1Q/So1zFlyKRedji74htY1IQX6Nxnz6Qb2cUURINigPEirpBuQaU0SY4fr+rAeA6QQIGRGuyAKiCv6wGkiUVHOXVoQv3sJjCTAXlqEXk+GM6RrmOsneXezBoCBdsR89hjNrZl2X37i5QUoRTHqY4M99r+n1sMzCXi8nlI1Z/MwVnlgQZpWPRfEWDwx0ZuVpzc+ew3OdGaofFcFaIiksPIHIYirAoqGeUIOGiGFQ0ig5k2FZ00ppcoS4tLmElz7iWKmibGzqFfUMQszF78s6JPbkKiknKcyigAlt+5lmWvPn2xMCjvXZpcUBqaTRjvnZyo5Eo0kgFfi4d742XpWzEtwGUoGtbBkVj6pUynGsnpdubbiNoXFUTnTczzKdeZgC8lz0PYhX7s4payHABz676zJPR3KDQRKdqJVhwSkAqWWvsZ2V6XrbiS83BYzONcqRv23ZKYb0R7ZizPZ/CjM5Au4H+qZjcVFY6xLDqKmls1hjcmiHeX1sc6 X-MS-Exchange-AntiSpam-MessageData: vknaM7/RpfCgS4GMAjp9Q+LJ9wqpOVCg9pdHsviqNXFXoPxgYzG/LeArwCXv8xflo3a+wU0cK0IWxn+JbM0G7O8muzQVnR0hZdj7+xOdkvDsrGjKYA2kAwHD4FR+OnGqb5cGA0oeC+38JETExXIWyA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34566bfc-f4a8-4085-3e6b-08d7e75520cf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2020 07:08:30.8652 (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: fgmhLamEJZyzXGgprYllFy5/VOhOKybT8OdQHPY6hzEdCL7YnltsoAByM8JEZ2BNsVlMaLsvTpysOjHmkc8wkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200423_000833_806244_4167CE1A X-CRM114-Status: UNSURE ( 8.57 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.6.47 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aisheng.dong@nxp.com, Peng Fan , festevam@gmail.com, qiangqing.zhang@nxp.com, linux@rempel-privat.de, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, leonard.crestez@nxp.com, daniel.baluta@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Should not register power domain that not owned by current partition. Reviewed-by: Leonard Crestez Signed-off-by: Peng Fan --- drivers/firmware/imx/scu-pd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c index d1b313fa7b96..7b43bd63cc1e 100644 --- a/drivers/firmware/imx/scu-pd.c +++ b/drivers/firmware/imx/scu-pd.c @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -246,6 +247,9 @@ imx_scu_add_pm_domain(struct device *dev, int idx, struct imx_sc_pm_domain *sc_pd; int ret; + if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx)) + return NULL; + sc_pd = devm_kzalloc(dev, sizeof(*sc_pd), GFP_KERNEL); if (!sc_pd) return ERR_PTR(-ENOMEM); From patchwork Thu Apr 23 06:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 11505053 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E11E313B2 for ; Thu, 23 Apr 2020 07:09:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCA30208E4 for ; Thu, 23 Apr 2020 07:09:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Tq50k7od"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Qe8pz9qi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCA30208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JU5cf6K0z0h/jz2IetDVE/8ZI6WjGEqIXfgj5XVkitI=; b=Tq50k7od/XW87f YAPRvDb+l7AFbjs7RPtRaOIeJbTTSSsc2GeCrQDJgSWOj4W/5aH53E88JBVW9OQnYG623VuwvCslf 5fmEc+yMcTz702VYhHNIlDzRcKeUb2A1650/HV5MuXufB6yYvcKb3/XbXNzT0dDjbb/sXXvyICzhL rF021W2ACoGppLG/g6ZR8Vjs50SMWWO1niz/oqPR/5pqp6uLFTRwcD82i+HYAHdmVAGL2fOEu/cS/ c8r9y4slTS1eI9nC/YAqGwFFy5mjavzlPSb3tg7x2K8+hRdU1ejLd0KyXRkgokf7XKZ5jLDF7VPVp D3XEDuUvnqTophLvBDEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVz5-0004is-16; Thu, 23 Apr 2020 07:09:19 +0000 Received: from mail-eopbgr60056.outbound.protection.outlook.com ([40.107.6.56] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRVyQ-00042B-FC for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2020 07:08:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JKPIA81+j9RB2kcq4IszHUFnHjoHVpIAArZwTLKJ5ROfe0S0BLordLUomdZ5x6M/4fqdUKgXN1Zadpks9q+fE4uFegZRMftgxsY3CTeWzFPvoVtVoTflYLsLymdmfdcKKajxgntD0Z+1bE0gQNxB5S63I8xe0Qk8/TT/iWVh6qp7uiRkRWi+PUjBQykSa+jbCE55DZJuItb116xcL4TVGaH1RjTc2VG54BXubFRYcfos3oZd1inHO1eUQLnCKZlPilf2/FKjjj1jP3Pim0lwO6y2tNG8G1qbDcV87DFnFy5Zd8V2cwbSz7//oMT7TgQhSqi0nvjUS3B2fSmQUoSmIA== 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-SenderADCheck; bh=fgeF+OkJz2dE44ywUCK6M1VgyGE5Z4cWNu17ijm1ZxQ=; b=cWP/JtqdjC2+NXvxxWmjb9Xz71WhQAe8YPclH740QJFVlXKVLMY28ONoNMiITsG1mw1yJmAUMts0FLrlrraxhXlunTucQzZG+t1nt0DW2q5airw0P/W8wJVjlCARQT4DFCdm8+VWIvKm+8irGOC+kYdOQc4uP2v4VmwG4Svl+QkPjanJrYljsFfQAlJi4IvAmxppysCp0Dqiz7NHTDLFa4CaMYH5gv4O0aa3h4XMp15lLjfI1NAZr+sJe+fHNp3C730rMKUvLptTuYdQuYDNnJ/2/B/gjpimZa8lYQsN+DzkjXzNQhGP+5621dsyjbg4DDM1ZrMLx8zxUvqu8GYjTQ== 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=fgeF+OkJz2dE44ywUCK6M1VgyGE5Z4cWNu17ijm1ZxQ=; b=Qe8pz9qiAZrJ9fN9QvWKsITzupLgq+9PrsqVb9u5tMlxWny9Jk3oEE2JXvUS/iCEhtJbVmHS7vzga/+wb9igghddrteS9Dzdphs+OL54BzHtpLZ+B7dqfxy50BdtyNVIi8WRZoiyIP08w39c3OI3HZLF0Ob/jiiIAt6ZSQUcjHk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peng.fan@nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB6PR0402MB2855.eurprd04.prod.outlook.com (2603:10a6:4:98::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Thu, 23 Apr 2020 07:08:35 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d17b:d767:19c3:b871%6]) with mapi id 15.20.2937.012; Thu, 23 Apr 2020 07:08:35 +0000 From: peng.fan@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de Subject: [PATCH 4/4] firmware: imx: scu-pd: add more cm4 resources Date: Thu, 23 Apr 2020 14:59:34 +0800 Message-Id: <1587625174-32668-5-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> References: <1587625174-32668-1-git-send-email-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR04CA0149.apcprd04.prod.outlook.com (2603:1096:3:16::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2937.13 via Frontend Transport; Thu, 23 Apr 2020 07:08:31 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.66] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dbfab8b6-1fbf-4660-8a20-08d7e75523ae X-MS-TrafficTypeDiagnostic: DB6PR0402MB2855:|DB6PR0402MB2855: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:364; X-Forefront-PRVS: 03827AF76E X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(366004)(136003)(376002)(346002)(26005)(66946007)(4326008)(6512007)(9686003)(66476007)(6486002)(66556008)(69590400007)(5660300002)(86362001)(8676002)(81156014)(6506007)(52116002)(16526019)(8936002)(2616005)(316002)(2906002)(478600001)(186003)(956004)(36756003); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ixEYShV2kkFKoL/XTv7EXGzY8CeDBUaNXBSD/FI21dkSlqNI4cbccoF9QKBXM74+yXxyOrwzgjt0I4KVjaYww4kyaPyXtORJoIMpVNHd3Pee6HsXw+f/spOrZqehmWx67LfnfdEeNglommCQVDRUb+8iuMV1R3W5lkjN7ZQUNPYBqERrCXpPy68XJlEX88vDMOy6YzdDWBVG+fLjaQ4UqlxPr7kYueuRFEsOQFIe2LtqtTFt89kcvqMqSdKEM/kpM2rvRwPcM8Ml7JcYXcsk037rJs4yn+OuDYr+z9hZ/wYo2Gid/8mHPNhswfgght4I2FF08EPtI2mgvhwP07mvTrf/L6zGfzMQ2XEIIGn1YQgtunp2Qztdjs+EbYq1YH2IgQVJRN6oBn9S3sowyfy14J0uMkucCvL/A8jLhr+BXEQZNYFjeUgeF8SSD7n0E8kilLuEiYiDtv0zjlWr1drWbjJBWPqdR8p/grvx+XSJtbQ95qQJiR5F1rhPLelfllQj X-MS-Exchange-AntiSpam-MessageData: mDGa/qIG/2t90Q1kBgenj2VmHRtBa12J2mMeL1yZmOq27/yJqWRNXLM4blAYf0M8cuF1ikZ4Mpy0TDjV+Jy3yn1fVwEr5fpyOyd8+6+rX2kIiy01rPdObeuGeQauyCskhp/VBVAYNdqOJOl3wb/CLA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbfab8b6-1fbf-4660-8a20-08d7e75523ae X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2020 07:08:35.7400 (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: 7imp+S/Y8LYsz2k7JwdASTDTgy9qg2UqTxz5xlGIn7mv21pB/OhGmvQpS5BAXNDn44M9ylGRnOnLtAa5CrisoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200423_000838_539769_0B6F8A36 X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.6.56 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.6.56 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aisheng.dong@nxp.com, Peng Fan , festevam@gmail.com, qiangqing.zhang@nxp.com, linux@rempel-privat.de, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, leonard.crestez@nxp.com, daniel.baluta@nxp.com, linux-kernel@vger.kernel.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Peng Fan Add more cm4 resources, then linux could use cm4's i2c/lpuart and could kick cm4 core. Signed-off-by: Peng Fan Reviewed-by: Dong Aisheng --- drivers/firmware/imx/scu-pd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c index 7b43bd63cc1e..2fa86be2027a 100644 --- a/drivers/firmware/imx/scu-pd.c +++ b/drivers/firmware/imx/scu-pd.c @@ -170,6 +170,16 @@ static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = { /* CM40 SS */ { "cm40_i2c", IMX_SC_R_M4_0_I2C, 1, false, 0 }, { "cm40_intmux", IMX_SC_R_M4_0_INTMUX, 1, false, 0 }, + { "cm40_pid", IMX_SC_R_M4_0_PID0, 5, true, 0}, + { "cm40_mu1a", IMX_SC_R_M4_0_MU_1A, 1, false, 0}, + { "cm40_lpuart", IMX_SC_R_M4_0_UART, 1, false, 0}, + + /* CM41 SS */ + { "cm41_i2c", IMX_SC_R_M4_1_I2C, 1, false, 0 }, + { "cm41_intmux", IMX_SC_R_M4_1_INTMUX, 1, false, 0 }, + { "cm41_pid", IMX_SC_R_M4_1_PID0, 5, true, 0}, + { "cm41_mu1a", IMX_SC_R_M4_1_MU_1A, 1, false, 0}, + { "cm41_lpuart", IMX_SC_R_M4_1_UART, 1, false, 0}, }; static const struct imx_sc_pd_soc imx8qxp_scu_pd = {