From patchwork Sat Jun 12 13:31:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 459156 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1795148jae; Sat, 12 Jun 2021 05:59:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBuKY1hpxeuuKZkdbJi21SBa2AO4SLFVyY9YpxQ/T7nh1FhokalAJC4vvwLjZxj8ydDsvt X-Received: by 2002:a17:906:d1d1:: with SMTP id bs17mr7849612ejb.492.1623502768378; Sat, 12 Jun 2021 05:59:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623502768; cv=pass; d=google.com; s=arc-20160816; b=waOZLEawLO7amB/+YwkYNRZVMh3S6g7RKIgOYgdlUC+h0uRFNPIfLtMIji3XoWb+bW ijy7AK+lzt9BlggI6zz4F4sLovzyn7YYZiP8X0tewUO9jqwyphoLc32P0fzG2/+BWisT Xx8x/JP2wqPqa5Cs0I8eOI12atVmvaJZpYFVHE3mjh224zF3DEwnMC+xg7ljczfYZgCN ZYyDH8RPpqCT5ICKiuxe9Kj9TFNGdZLV7Ct5K6s8FQgGq2eRZXQ8BPTSwtIf4MHhjGwN brD6Gmrin6XugdgcPFrhFXLgKo1yhFIGctaZZKJiv/qw4uafMssYjh18BKrgoXwjYIh4 34LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/woyMMdDjmoLpw+OB3GH/kDvCzq6VvqWMWVeZD4Bi+A=; b=rbExXZCQs/G9dxMBYqomBT4Fr2ljb+bpKpKOzAGUE4Cdb1gfsCxFwkSKKaU2sYHZHU e8oJWemPU6oSSWU5Vwzw4aX5lGzCgM+h3va2lWey4L5t2bw4yLK6VPSLTvCiux/JCjI+ bpVi8/Xp9+3kJW8GvGpOtxoVhTnKg2/SiAd1rlpx1pLhBQTckPKloBUPyw2O5RyFsQsJ 0Fvpi5MoL2dkNucEyjyOXzEmowlgVcZJa3rnLqDj0fovYzBoaTHrG/5cqZKGknDwQNom v+r+Ei+yjIHmv5tjDTFiLTQMbmne6a0/meQOnJfrwpXjg9ANPnOKJFAZP9AtUCCri/DF kHzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=LnFyifj5; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si7565559ejl.253.2021.06.12.05.59.28; Sat, 12 Jun 2021 05:59:28 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=LnFyifj5; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231327AbhFLNAl (ORCPT + 7 others); Sat, 12 Jun 2021 09:00:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbhFLNAl (ORCPT ); Sat, 12 Jun 2021 09:00:41 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::615]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 821CEC061574; Sat, 12 Jun 2021 05:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Efo3/enhUv+yANpdNGGiDAsQwsGyIeMHqYSt2AJUx92wN5dqnfZ224KxG5n42tAVJPnFr4hmJuTySJWRAMDUOQDRX6vK/lsGf3+qPT64tW75yGSxwUx6uNiAnXuUVcVgyISEIaAg/Pax18N6gSe95X/SKP9X5tRyZBP+IaDz9e/xebJC7hGQFj5XFnmuc3m/+jr3LdLmqAywtwA81uxq2X09FUlfgNWnKn3Dxi8CSRYT/Kt7tEaUiII2nueSd39zRO2ExbpCp/YlpFI7o2h01etOraRsHecopU2i4iweRQZx6/mvNJ/yGewBoDMvMb8n3l1MEbFUmZWzIiFLiZfSeA== 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=/woyMMdDjmoLpw+OB3GH/kDvCzq6VvqWMWVeZD4Bi+A=; b=Xqe3WmHRR9dOq7ioilOY4v/CVvZpDxQF5l/chHNwtK1PrZujeMYdeDSOU34H9Ewy2vYo9FteafAchKyhFUkwoUy3hL/FofjEYHstC4PryxFNEG7zac8E7+LOjvBU0Xn7eCgY0asPwxp9yElRdwPzIfTU/9ODIWtmksC+QDmPy6cYeiA1xUm/aCKMbdaq3y+16FRNRAjr3MKW3W3XYPo1AEwgAtALITBmcyWxQxwbMbCaWODEMA4K4WrycdsxJGT0x9y7k+le65mTh6RsluyjmIV0+vmISANTSX1V6LAEp/vc/1e4zbsj6R4bKDoguBygLIsEb2P54YmLiJAovmefpQ== 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=/woyMMdDjmoLpw+OB3GH/kDvCzq6VvqWMWVeZD4Bi+A=; b=LnFyifj5rdidrzeSm8/F4QqS/y1nKQBoy8W0ngtYaZtAlrEtoCM/n9CLDSKY52hPoB2zRWd3ClLsqYWgZqsVJuaEHBKpVppwcaT77kkHuPkcgGG0PPiEqiMvFicEWffyqtAm+uPNbvyBDzuHaiT0aeJ4r6v6KuSlfsxZMiUmduQ= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Sat, 12 Jun 2021 12:58:38 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4219.022; Sat, 12 Jun 2021 12:58:38 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan , Rob Herring Subject: [PATCH V7 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Date: Sat, 12 Jun 2021 21:31:31 +0800 Message-Id: <20210612133134.2738-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210612133134.2738-1-peng.fan@oss.nxp.com> References: <20210612133134.2738-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Sat, 12 Jun 2021 12:58:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da71948f-21da-4c5a-1c31-08d92da1cb82 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7FQre84eeUINz8MhWS2EreZ2fUHcmRf96iP9oD3RI2+aqk7YWJZsLEKn4AuG6b+eNbJKmI7VA6YdE8yuIWrcRwSFy5pOOs6QRGBv7/iIquLFQROmQvbzJAtkmTe7g+dMuXyvViOsAmpvhkH1DlRtZa4zAjZ47EuYpjNumOwJsVVws9KBN0DTm9Y0JTz9ACHOrhsglCnTos9LTlXpxAwgJD+UtAz+ernKilEtktjVWacZk9+MPztkbJO8yP9YDbILqQia1KkLeWcuDKN9YVHaIFodj5A9MCNuFW/f7BaB+rSMsguqmKHfSdWxgnvmNdyCBGp8AQzWw8mq7FBpToqAJ8Rt/E764e+TdJCCS5rCHqjS1w1M7Ih6+ET1ZXN4gPI/AY0YV4E3lW57KpyN55rkJgZ82upfJd/dmO3FKmo1DX90FtSEF7t1NBdmDIiFR4KvYj4xH+hLyfhC2sHN8O3lB8YIwHc5l4jmO+ercwYamgP78vnqtOX25d90K4X8TYBRUY4pRayycTHsxG2UUEnlKGKSc4vTEDG/r3GUNNB9lUj+YwNfz9G8Ig5RFm8iEZLgUcg25CdOclgS0Z0L+AP/bSxIYsZG6SJ9hAP+9iHi8eb3vm7KOxQqgNqhS51nZS0PJQXYxTB50MhIlUCZb84itQ== 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; SFS:(4636009)(376002)(346002)(136003)(366004)(396003)(39840400004)(6486002)(8676002)(52116002)(2906002)(186003)(1076003)(16526019)(8936002)(26005)(4326008)(6506007)(66556008)(66476007)(66946007)(6512007)(54906003)(316002)(38350700002)(38100700002)(478600001)(2616005)(956004)(7416002)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: t01pM5HdGR4bPemuTBRb8/4JIHDRYyiZMmdgw7/w6jBef1fsk3XEcWM4RASZ/e64lVKSklFG7O9PMNI1sfp42G9q7bGai9GOLP1NS0snnXwAnNo9Wtwm9Itwt1zP9IyGBME7Nf/DYVMdjit6nZf2H5iRn46T30SJbaQPS8CJ6xCZYx9dlSkV2NooEWV+2vBVUGL2p4ytRR9gOHJ9oRMHFvAkYjFfnPoBPv7jRCwgnFiand5oiBLO59FRg3AF2K+CAoo2YtNT7PcSfVQvjQTCQpy1hfWMHdEbbFXAMhkdcyi1bJEXTvti/vO8vzS/XHgdZ/zSCKOPakuisrultMr1qOmItkBeM114PN7KX+DyMpqCRa/f39exhgzcM/AZlUceYZjNtOkxlACmCAsT2veHS1b/A5kQ//vm1TOgnVcJRRpdWZhUNmvd+RX+U84JT++4JADqsb1IixcXh+49qCFO66juESOvKuWsbQiB9fVElKBXxhWDmmd+siTkzqUvjLekZHxaGKLQXvtKQMAe8w4zKJP9RpBDAI+esmwRvyjm+VbI9zjNjfLH5PBB2VtJKrBwNZ2MZrnWZW3nGZnjgXXtMigPvpjTwwGPTkUNN4MYgAru8BHxk8sCwB0xZyxwK1lu8NoubEGwPztIw3tJgmImDUY5FL/mFGMh7I6ktyRqlceQhb7RAFdvcXDBsaA8DDa6xK4ZC9bR++JtahTUcKikiqD+Nmg5tV1NbvsdJghj7lRnyK3QB5p2Um1GZEDE2XbfhDgCAttRH6DRLLJQY0b+inmuXK9tyLoybQsetsm7tzj3it5ufHafvc6zf2JUo33roqElaQjxZei+EW8F3rMAClwKEKScNYbmn96zpGrlO+zzWW/b79f1YFfpJ/24BVhIN9B9WrJvVeZt0N0TErQzjhYGMluEymCREvdV2f5f46bOFjuiRTktjzu3DopRQoiWgqEKUImcTefbMwSJWUt+yfjPNlE8jGYvFw0HSACmymYjWHAHx2ut/SJnqDl1uZ4kUgR6OzrkiEsQQZMPjprwv8ApPYIiBD44VPLcZiEACBiL89oczGGkizrMmj523sgeE79AmSm4eHXy43xH2lJlGCgr5KlnHaQWTH6UeuuGItUVXKDOrzHfsrjM2rwg5pgy92q1lE5ljNmqIeEUp7vdYEVWRRtcxO0r2b0xhmhTiZkdd37/Jw1gZVVo/S/Nsb1LJpkoUBcTqA1t9OD+PhHf4HsCLtz47N466/fAnx06G3ZwmI0YBEMrNIDLSvVgcttpH6biIzrBRG/5s222ScOWIw3bUb/9DlXaIAXMG6CmlZ+Ioejc9BEvD/Be9pAo2DRr X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: da71948f-21da-4c5a-1c31-08d92da1cb82 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2021 12:58:38.0970 (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: QXDrdOzfjdghayIKr3/1aruTjLrw/b34kNheLH+uVJe+x/MnZvX2B87ia5R1QKtyjqkOl6eGjfDyhbkhjW8ryg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Adding the defines for i.MX8MM BLK-CTL power domains. Signed-off-by: Peng Fan Reviewed-by: Frieder Schrempf Acked-by: Rob Herring --- include/dt-bindings/power/imx8mm-power.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.30.0 diff --git a/include/dt-bindings/power/imx8mm-power.h b/include/dt-bindings/power/imx8mm-power.h index fc9c2e16aadc..982ca2939cdc 100644 --- a/include/dt-bindings/power/imx8mm-power.h +++ b/include/dt-bindings/power/imx8mm-power.h @@ -19,4 +19,17 @@ #define IMX8MM_POWER_DOMAIN_DISPMIX 10 #define IMX8MM_POWER_DOMAIN_MIPI 11 +#define IMX8MM_BLK_CTL_PD_VPU_G2 0 +#define IMX8MM_BLK_CTL_PD_VPU_G1 1 +#define IMX8MM_BLK_CTL_PD_VPU_H1 2 +#define IMX8MM_BLK_CTL_PD_VPU_BUS 3 +#define IMX8MM_BLK_CTL_PD_VPU_MAX 4 + +#define IMX8MM_BLK_CTL_PD_DISPMIX_CSI_BRIDGE 0 +#define IMX8MM_BLK_CTL_PD_DISPMIX_LCDIF 1 +#define IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_DSI 2 +#define IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_CSI 3 +#define IMX8MM_BLK_CTL_PD_DISPMIX_BUS 4 +#define IMX8MM_BLK_CTL_PD_DISPMIX_MAX 5 + #endif From patchwork Sat Jun 12 13:31:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 459157 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1795157jae; Sat, 12 Jun 2021 05:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSKwgDXheYZy2oowVbfYFCOCkWphFcVlBGkj5CcnKYiUlW6CRWI3ni+AqgJubgy0kxRv/N X-Received: by 2002:a17:906:6712:: with SMTP id a18mr7957592ejp.334.1623502769282; Sat, 12 Jun 2021 05:59:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623502769; cv=pass; d=google.com; s=arc-20160816; b=J6qj9M+GJ3mvwPZDsxA3VVjefzmha+aCjIg0iF4Q+Q0LQP+mK2gRoArzcUT5BpquRP p0Voba0Bb2ZszRUVZPoJ2q8p116QafMpErUpzamSk4+YhHi9+9WOxoHyWiHyQr7dcVt6 C0LoKJ5Pu/AvJIlpp+Lcd3QaRRbWAs3wEW2p2tPfKqDm3zuZ198euTiPvC58f5BSf0Gs s6wKSEpkiYu5I0/+feSjviBpTMbCsaOK1fdubHQsSLIWmIGfeuaUUWa8dYYFzJrwP+AP zT+wOHO6ttfphAT2dTOACsqeLb9pSbRuzs/YoYwn8tbM9zoXnNyJV1+wORwDk4WBpyDO +KQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0aB9k0PrMCYDScMBixgBT3+fJPleWCeHpDcOqnFBs8Q=; b=dWWJ8uUC/qlE+64pNUy+oc1Nx+d6mBop3y/AfTBvBwFXwBq9Gg7+RsiFBepPTaJ2U7 Ir+JZz+CUSShWg6ShlXpHouHUdVe63QxUDCvNUw3yD5QpUIiGcJIrFKkBR/tJdgisRHl D41xuVkSTtqB+eijUfo5yf3VqlaJflSQzuGgfnO6DygaMxS24OUqMDJtMYjBsX+gR78A 1CKee6cWxhrWWe51WN0vppxurOfVYQqHzNiM0it0htjxdBvx+KD7lVA/onQTywnQcJPf ai9RRx0FI9MPZIW6K20r/jC6UEMhgm1165414iO9IrsE6LAmOHAAOfkj4OiXVlvomKGV c5LA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ZzqDAsXk; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si7565559ejl.253.2021.06.12.05.59.29; Sat, 12 Jun 2021 05:59:29 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ZzqDAsXk; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231352AbhFLNAr (ORCPT + 7 others); Sat, 12 Jun 2021 09:00:47 -0400 Received: from mail-eopbgr70051.outbound.protection.outlook.com ([40.107.7.51]:54498 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231310AbhFLNAq (ORCPT ); Sat, 12 Jun 2021 09:00:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPaO/jcJyB9IHhiwnWgojd5ObbJe78BRW83EkH3wtUhvUXovimqHtFhTNgM6xaYUzpVR8ccUbrWQnBp/ffX/99BmenRJCD7DNXKSCAO2J8hhUbRCEgBPdQI6j3/mSs6WGx5yrilO3cdNZKAGd6NPez04l28DoPm/c4vWkr9iBRG71j1RRigAmvUin2AaNeZ77LXKnkxjlNXT52x9efog5dClnwLWfvjEV55233QG9+dV/Dt8Z04LOKABCuo/Isks/5kQ2hXaZShc/KD4mnB+cbfYgJUjfydwi+aJl6iDpOB9vnpTMY8o23No4pR96jR1hO3q/5ey7sW/xWTyFJwKbg== 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=0aB9k0PrMCYDScMBixgBT3+fJPleWCeHpDcOqnFBs8Q=; b=JhGTRXyRM6T1+QrMyaAyHarstIN45bZr8/0ID0N2/Rhy0KSijRqBG+05bqROpmRTbhjGip5tNy4kp9AwywZE+yIHF/Zf55+b/Njh3csrnx+aFBID85qAYKPoJ+bSggEtTrlEhJDVSH+oQC8WrrngyezMjIhajtFZ+xaenwmwlKWsj5XRC+Lr7QCZny5y5emX0VAxnvrFCQ16ffoRLbxt47nz26KU4v8823/O3cTBOYscLXqgf+G18PSHtGG8auG+r61+kLwfMIcD0GJFfrZzPAS1ckLspK/D92iFGG4/ERKMfBQcunUvAyPPJEGXdeVp9sPyZx/gxYy2wZov5SJR0Q== 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=0aB9k0PrMCYDScMBixgBT3+fJPleWCeHpDcOqnFBs8Q=; b=ZzqDAsXkrrCXZsjqa7XcOtofI3+djUdLgwh9E9LBGgm2Q/HDfY7lCuON403QrYUh9ayy4nvNorAHNzSZQB3ePbpSpJIUvZoTzg3LGii1cbjOTA8IReyEx/RsfTsKtvIbJIIlTrPC96YowcDyuycvbzvJtQRXV9CQz/EjkTlbT24= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Sat, 12 Jun 2021 12:58:44 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4219.022; Sat, 12 Jun 2021 12:58:44 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan , Rob Herring Subject: [PATCH V7 2/4] dt-bindings: soc: imx: Add bindings for i.MX BLK_CTL Date: Sat, 12 Jun 2021 21:31:32 +0800 Message-Id: <20210612133134.2738-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210612133134.2738-1-peng.fan@oss.nxp.com> References: <20210612133134.2738-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Sat, 12 Jun 2021 12:58:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 065199db-d650-4a4c-3a1b-08d92da1cf5b X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AoubFlf58UoiXIHqWBp1w0guIRf6/RcpqDKrS4nxuENnJ55993Mar3j1QBTdESub+wFH8koyMzidHTbgO0onwqdKJr8TMPEwgyhfOXpRh6TIoVNq31uWTdeAYdLAvZy474Tpg4igo4d1AR/0faVUl17Mm2SW+QUjKGSYsDmvee1Qhb0iaUMz1GxOyLKtYnQh7cFybVFyKB6LRgR89OBNoRH6ptw803ouJeeFLz97zKHIa/+rO6OlM4ELyAIbmfDVILgAW6uxIfBjq2jKzcjVb9no47IVxJgH6vfy8qQ4Oja6ndvQhg+81wQ+MF/l03G8RAokISirV6ht56eRzg+gornkJw8+X8shWcDsrXsSC8swG6IhEPsegmI4j7VOfEBQ1NcINftLFj1db23DVcgTurvJQ+e6SPrn2bAyi6I2WDxuJISbqNv0AqOACwvbqZ13PUQCNNUvymG0lzHBZaJKMdJ8iJj/w48k13D3Fjfszf+saNm5q+c6jVNaw4JvGCRVBcdg4B/u0EEeYdZR0qxE+WZtEglqepSs5ML4jLyREBPOMzbo0gqb2qUcJz/TZNdOOwPb4njaZYrPH2aG7sYmToPRVLV1QBOhoFmldOlxQVRe65ExzeQhcN94A1Y7jA3vJoHLfdlpsJ4LyFfajisLxWlL79I1Gc4vim0brppx3xeuvwjPsOGugCHrZuMbBbvF6I0B6yqWOj3VCwhnCgS/3IdibAugHTqAAE88qBMs6Sgee8+JNbXZHV/WDlLzL3ujhQTrustuZb5dl0JspqrkLZ6oz+EZLMLhYWdCmsKY1OkdO0Q4GrW/AEdbh9NwFOdd 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; SFS:(4636009)(376002)(346002)(136003)(366004)(396003)(39840400004)(6486002)(6666004)(8676002)(52116002)(2906002)(186003)(1076003)(16526019)(8936002)(26005)(4326008)(6506007)(66556008)(66476007)(66946007)(6512007)(54906003)(316002)(38350700002)(38100700002)(478600001)(2616005)(956004)(966005)(83380400001)(7416002)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nsMAzQv2EjYzpPllqN7ztQWJRCUBo4jxdqRb3rD11cp6w3mNvMAPKKNuMsTloQnsNYQ/WAzgwxQode0xC3QioeMW12AuYLHHBTCVT0gSrT03jZpSvQJqOmV6LXcPOtz8AZ8Nnb9wtn42+vn+RyI02Wk1wtmDbYAXz+ru2ycUWlAbgdyWfL+rSbLLLMXCr3//8Y/UMwm02tXXbcYCCPZ+OX63T8ajB/f7BZAKNsiIeR1ahAbINhpLmGXpgS7G6Q1v0lSpx4ObuMZr3UaqoOpTXwIrp6PX9INsHwwEJkTrCMbt3pHhzUvnX3MN3+9bAsE1E3IMoMC0jGn9WDTUhr7eJzYnOdaxaakTd9UOpXbPyYVipxc00q6GojtZgTbvjKihqzk2f78WG/DtQahUhgltjz7fLCqAZjHyZgfI6f/j9Hz0it85M8UTV9sl7wHaQKwT2EHiPdYZ3VtZqzLducIwyb/3jmHA0DpQ9RjIRXMib2WdsOZunbCQP9XA5wMZkqoV8U0SsBa4iW+JIk4tdq+Lf7nOll6rcVeS3GEx9Yd29lSPRAsidXhO89CBYo+BWpeqmZQDgD1f1NP//kAuEFZW+lyMJJZJ44n3+KcxSNjSxN3Ax+uE5AQGD05JdrQJPLPii+9lARVEVOaFjdFqsMncSmA9uwPW8Btsi1VAU/xMp4IvT6cWU6U1+eXXoOI7LnSITXaIvwkOe3fxZFtWRl7cj5MTuUg62nAagWkNqQlKlxnv5z7FPUzuNhtm69owtwHatjUrbWG8KwQqc4Z5j3QpdiC3ZpcQvpaxPXvk4iucTK4SwAWh3zgUaA/DeLtT7Gtna5pbysy6SdI9fM8hiIvxEcYcNpI1PX9Qt9UfLwOrQn6dG9Ker+0qq8VhHbeMQFoXnXKufNHFPkmpZcBnNHhAx9gYTB6eXf5xfQ3gEDKo0aPJiD7WygYO728TGIR8mljle95vHsViWwryBLQ6XjY4iaIgqPRRsMqieYFIZ95A3YAY9FZNJRDomKtzqIj01z2gBWWSkFjndaCnQJJ+cTkSvjjy3b2x2BJayBL7ZSvmCaZxQMQ46ZhlaSDthjkv30My02l2a0mQWLf+KiOQFgfKQBMg+zDt4S/ZA3I5++xA9R7ehi07mkpcp6wi49U+mSVSRGiC9qNa5I4JBmHLdBS0MdJsFF9KfWdschtmnG3Agzlrg8rbaDU3BKXt8ctdKgJqveI2yKaACovwrFk3rIRpjTqzEYKf9MTRPJvpceSf2/7kR1nQZRr19ZzQ2b/XWmaJ+lLhnLaBz/jpRRBkLKEpyLZGrj6kFxsRzp0hb1bp3voUW3oUQVIt5+BFqHopMLRI X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 065199db-d650-4a4c-3a1b-08d92da1cf5b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2021 12:58:44.3701 (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: zQIe8MaOSjAvInRQOZz4P+t0Nfd+o0R0r9D0POL/UJvzEt6kjr0HCNomVaEDQbvWFj4UU12U/yAuwQI4S43rrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Document the i.MX BLK_CTL with its devicetree properties. Each BLK CTL have different power domain inputs and they have different names, so we are not able to list all the power domain names for each BLK CTL here. For example: i.MX8MM dispmix BLK CTL, it has power-domains = <&pgc_dispmix>, <&pgc_mipi>; power-domain-names = "dispmix", "mipi"; vpumix BLK CTL, it has power-domains = <&vpumix_pd>, <&vpu_g1_pd>, <&vpu_g2_pd>, <&vpu_h1_pd>; power-domain-names = "vpumix", "g1", "g2", "h1"; Reviewed-by: Rob Herring Signed-off-by: Peng Fan --- .../bindings/soc/imx/fsl,imx-blk-ctl.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml -- 2.30.0 diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml new file mode 100644 index 000000000000..a66f11acc6b4 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/imx/fsl,imx-blk-ctl.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/imx/fsl,imx-blk-ctl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX BLK_CTL + +maintainers: + - Peng Fan + +description: + i.MX BLK_CTL is a conglomerate of different GPRs that are + dedicated to a specific subsystem. It usually contains + clocks and resets amongst other things. Here we take the clocks + and resets as virtual PDs, the reason we could not take it as + clock provider is there is A/B lock issue between power domain + and clock. + +properties: + compatible: + items: + - enum: + - fsl,imx8mm-dispmix-blk-ctl + - fsl,imx8mm-vpumix-blk-ctl + - const: syscon + + reg: + maxItems: 1 + + "#power-domain-cells": + const: 1 + + power-domains: + minItems: 1 + maxItems: 32 + + power-domain-names: + minItems: 1 + maxItems: 32 + + clocks: + minItems: 1 + maxItems: 32 + +required: + - compatible + - reg + - power-domains + - power-domain-names + +additionalProperties: false + +examples: + - | + #include + + dispmix_blk_ctl: blk-ctl@32e28000 { + compatible = "fsl,imx8mm-dispmix-blk-ctl", "syscon"; + reg = <0x32e28000 0x100>; + #power-domain-cells = <1>; + power-domains = <&pgc_dispmix>, <&pgc_mipi>; + power-domain-names = "dispmix", "mipi"; + clocks = <&clk IMX8MM_CLK_DISP_ROOT>, <&clk IMX8MM_CLK_DISP_AXI_ROOT>, + <&clk IMX8MM_CLK_DISP_APB_ROOT>; + }; From patchwork Sat Jun 12 13:31:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 459158 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1795170jae; Sat, 12 Jun 2021 05:59:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKFz7XQXuoKyiWKZQm9rrkk/hGduKHZmhmkvTYOF1yFXznjORWdFUO/L36kVqLk/IdGUDG X-Received: by 2002:a17:906:bc2:: with SMTP id y2mr7634000ejg.489.1623502770203; Sat, 12 Jun 2021 05:59:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623502770; cv=pass; d=google.com; s=arc-20160816; b=hv6+f4kkKxP7FvdHqantsAiAesRGZpJALIsMVO4t6N8tVSQ3PwWf5lMaBm3+51qGfI ARqX7M4qQuRDWzbQnTj8O9fWs3lUcINVhE0nqElehpcD90I3KxEmfYefttZb1Ns6W+dl ftL+nUobah1lADZBv/INmuukcGVumT9hz/6a/HZIeCIbHWaH3GPuUUj2VriVb4VJjs7O iHN1Fh5KyUAZT1o+DIZ6O6AOFgI8JRM2PmAWm7M7vf3ubTwpvFGvmLbtunv9RmPUH9Go fQjKFHBitfTRkJBbC/qpkwLZwkIyTCSSapmXe1FEW5UsO/WYKKfVXtJ8isAJm0lRZy8e sbVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7fd4Ex5jJ8xmP0DQwMlFmeaKqlb1tR4Td+cJZBP/gwE=; b=at7oV/+RHazpE2LhrkCiSO2nFGP1eXHdTl/ABBA4wTDUgRYuJfTgw+f5cK6ZSXdNHd JmTkhCCPzBu/b3Td49NfhP4EgAeJUw56sucCi4/z+kZdEByQZxCu0YKp/dMSlXI7ZOZF 6Bll3cxWXJ3TTps+dZSyh3wEP5kdLaNJM3DrPvrfl0T7OBmDyi488ak4hawPGgU2G8XQ X7UjVuvNYKmAwDiuNQc4nK+lqOeJNORq43j8wMdF6hIR7DKH/Ib1kQTDoXnRbPelXK0v I2MGQuCNW3oTvph+igebhwK8C+rUOegfTR5JEj4Au8B9riqh1HbbecVkrd8PMWKg18nr +FQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=OZ6J2zJS; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si7565559ejl.253.2021.06.12.05.59.30; Sat, 12 Jun 2021 05:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=OZ6J2zJS; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231325AbhFLNAx (ORCPT + 7 others); Sat, 12 Jun 2021 09:00:53 -0400 Received: from mail-eopbgr70088.outbound.protection.outlook.com ([40.107.7.88]:17479 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231268AbhFLNAw (ORCPT ); Sat, 12 Jun 2021 09:00:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSrG18GEg4h4Z2QxqIn6o41VjuYx7whM/xp9lqDFUyVWOK6UjLdiTLwEChfRgGfnOPFQaQ0Z3Xsrl/XvjEE5mY744k/uNce9L/RaEeSwEt0mCQqMAHi9+3SLVu760VKfRpcf5pIQ573WZHIr51dPXXVK1/iRyAv91SAn1vVkP/szkU96UoCrxV9vXf0Qfij/PptRx0U7+e5OekpqVbYO3ZFuzSLaR/dvfpPZdF+nsXBCKD8laZy1jEbga72UJYnC78zOI4M7Yb8p1MNjmE1bbzJDgZYGTHuQGRVuYIhrPMDbi4ZhK7kbiDCSQ80qxzH25MtM9eOh02mxhA/CJWdITQ== 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=7fd4Ex5jJ8xmP0DQwMlFmeaKqlb1tR4Td+cJZBP/gwE=; b=oIKVfdcvZ8PMkpxASQnDXkEYrmIILInitRoqDDMwdRbgUJ861yL5byl4m5Z6P/YQgXF/Lr50UbqRQcof+h8hgwfOSnd9IADTugnUe0Jmq8KtZEhyMA1DkNnRb9dqjB71suG4qcDKv3zl3b/SoWKDw+r0xkUKzcTNNVJk8ASCT9+ksVSu3AtJk+H6x7rZjvvzKon6GlrZ2Nm2O6QZc+2aULrr/QDIyCVrx1gmdYHboV5LOL9pdqbZxNaRpbozCNAIud/ijSMEhE5sl9v+RU/TNFoE7czG3KqtmLuC+Rs6wdj0hMc3GpVPOZPtcE0QVSJ+SN3eOu7G4UKUi9DIbDSp2w== 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=7fd4Ex5jJ8xmP0DQwMlFmeaKqlb1tR4Td+cJZBP/gwE=; b=OZ6J2zJStvRLtafm6xVpoBY6vXGq8X3MSLElJlZqow5K/htcQ0qZXO2bufP/gLm9HEBLmruNDQicp2u7+eWe0x6JOfjdO8oRo7/zv0JmtOicjD0CZnLog679u3ZQHbs0cK5NBx+RVgAKYPFZnYaFDVCy1vIBOerxXt9IvNGjHfE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Sat, 12 Jun 2021 12:58:50 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4219.022; Sat, 12 Jun 2021 12:58:50 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V7 3/4] soc: imx: Add generic blk-ctl driver Date: Sat, 12 Jun 2021 21:31:33 +0800 Message-Id: <20210612133134.2738-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210612133134.2738-1-peng.fan@oss.nxp.com> References: <20210612133134.2738-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Sat, 12 Jun 2021 12:58:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9e6b865-6128-4948-37f2-08d92da1d2f3 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nss2GOi9Qn4njyhc29LbP8z/nUbxQxfGL6p7aC80naX958uwASbAnHQNKz35GM4XmfnA05jSqrMfJXwFDZwEGsXkkXIxW+eme3smGEPQyPn0cS8/X/oB1YRma3nMCteK/SVuNB2aF7Uq8Rv4rGpjeEN2OEGLJPyD0KELRzZiadtsG3I3RDlRozLUhRO+bM8VxZHL5rlf5MjX2xcIA/2R+OXdZf3HSAJH3sKfyNeelpJ5+FQZRZAoLfPas11vt88YY0j3z5Ey1WjIdYM3SS4/RBWhennENFV6tXa/rRaxBcP9pdYUn6VimwnNs5xQElYoBIGqKzb2VOck9IZf2z2xOPfDgngQNfd4a13SyPYkVe7/kVXK+neyFns1I5yhbo/zrOQk2E5wqqZ3K4+Jr5sETxyQSkPuraKp5bCnidwJxZoABsHuu2LDMh+0FUZ2KeNH2tjXYMospbH+KXQ0Xur+noqMlcGDCUTjZRXIVNgGI6qGDMVI5oC8dOoucy9CeLL6jKzuL6OGJHd2LnpZpjopHJpA9AMc30/COBLkiHYwAWagaEYj72B4VMr7OnkT2wZwuUg8pa+lJRYtYu7qIcBqSqd+PU+FMWzCU9S/mnbWjxi7sWhOu9gsKoRQSCgIEOVv+CyM9TX6VUl9TS2ywqvHgGQMOZet7/OcorFGgXt5gyRpMt8YzG6BnWmmRx5/vtrH 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; SFS:(4636009)(376002)(346002)(136003)(366004)(396003)(39840400004)(6486002)(6666004)(8676002)(52116002)(2906002)(186003)(1076003)(16526019)(8936002)(26005)(4326008)(6506007)(66556008)(66476007)(66946007)(30864003)(6512007)(316002)(38350700002)(38100700002)(478600001)(2616005)(956004)(83380400001)(7416002)(5660300002)(86362001)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rgR+O3bpL5t0deZc5saAIXXI4e9boFIPrn38/jIBRqjIJ4JlHk35/Gocti1cKm2eMPTAEm+ie1tLt3U+m/A1WUN0QrkYdXuToKACC/QY95/bC9VhLLFBghkJXmO0KHWMrLfau+s0AJFnp1tKyBcq/OfZIxFBxjK4Fq7FIdPbTu2VmHwKpTZ7Ewo/etSa5Cm9z99P7II8P6EGpsHlcULlMPdxMSM2Jf2El1QL+9mzry9laemc42lkRd2Xbw7FByfeK4PO6pcv29Ij8+I4npyEadR2VFQ4CjZSnt3p9+qZMUs4IvadTvzwwd4xdH2r3bCJum1dmVsjo/QryESFJdkmLssOPFD+lpi4k+S8W9Z0InYXN0VQEyTpYH8IRE1bVBTJKE4tdQ29Wy9PSa1+OVVQ6LuPs4d8z5oKjeSu9Gz+hl1Wqhs061rdBKTNYUL4/jBti8V2rnVYPOhrB0xhpe+czOmzpZEBr6tDUsDA729A5qWo4a+4kXApyDT19sTPTsVm/3kdOY1jFD96GebgB97BGj44CuS+r/zZpKJw6ekaJSzjFTIJGcu2C+VUb7idb+OpzMAvQctRZdUgecFJizfnlwgEwgUfo2cZIVxmE2ruQglecnQQmM5wYMex6JHn6JK4wXTkjrwb44Y2Tf/8CTqvzuqC0yKdUaFhOz9PSsN8ZfyMn2smNNkaRy2c/O3pEkGxVu5ByEZY0YW/wKJrl6sXvnmJfdNbjp6LgIBYjNkLSIznA+7uqHBZ4/nQM7WXa3nK9amV9JfKJMD7QvZC4NJRvEkooMLn4g1FDwIQVyvGfIqzo3kgwM5OidXBsq9bfbM4XmV70IlR+E5lgJujai5bF5lV/+JVAFoaiCagQgr1K41wVDy+8I4XqTLyUu+tBnlaweNOZAn6g4MzGL4rMwIGA/lR5/ONqs1osKqkqONNcJvdlbCP/YrbmABDU2yvbN6NKZxIDEN7BgUWkXV02Srld3g2OjV67Nd0sTi/5KTg5ZQKo5wpVTRLvq83I+T2TW/aWbSdikL5gTmrLtN/J7gDwmOa7OTjdp0gj2WgW+svubEyyuu/qxoOu7EazWdVsqLEHppmUp5p1Wxd+WwJfBZQ0kcIQllQCL/YF6uBt/IOMcRQqcP3rBqImcrcwhuoe/RgFOc6NrxTWbNdPKnIW75GBpcYcfcIjmHHH2Er4S6xd3ms8WOJPT/PiSmoZ12yQ8RMYVVqscrfDqIICEJClCdcmb7i/CNpv68ugVsWqPUIyF+lMrnuvmvT5RT/i6PYXjdvZu74cYZqjGCew+IalS5j6cwzGy903bJgL8s958QK86dCfCsQYEvTPpMDmpGk5CtQ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9e6b865-6128-4948-37f2-08d92da1d2f3 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2021 12:58:50.5243 (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: 3LI+cPsoRaAybbWJNQEpRRLotxv8/akflCQY+y46RIvIHCp1qYiGH6paEGTbmas3Bv5MYN3xTHN/vneDbz0GtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan The i.MX8MM introduces an IP named BLK_CTL and usually is comprised of some GPRs. The GPRs has some clock bits and reset bits, but here we take it as virtual PDs, because of the clock and power domain A/B lock issue when taking it as a clock controller. For some bits, it might be good to also make it as a reset controller, but to i.MX8MM, we not add that support for now. Signed-off-by: Peng Fan --- drivers/soc/imx/Makefile | 2 +- drivers/soc/imx/blk-ctl.c | 325 ++++++++++++++++++++++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 85 ++++++++++ 3 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/imx/blk-ctl.c create mode 100644 drivers/soc/imx/blk-ctl.h -- 2.30.0 diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index 078dc918f4f3..d3d2b49a386c 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_ARCH_MXC) += soc-imx.o endif obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o -obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o +obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o diff --git a/drivers/soc/imx/blk-ctl.c b/drivers/soc/imx/blk-ctl.c new file mode 100644 index 000000000000..3464e4cf7fe6 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.c @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021 NXP. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "blk-ctl.h" + +static inline struct imx_blk_ctl_domain *to_imx_blk_ctl_pd(struct generic_pm_domain *genpd) +{ + return container_of(genpd, struct imx_blk_ctl_domain, genpd); +} + +static int imx_blk_ctl_enable_hsk(struct device *dev) +{ + struct imx_blk_ctl *blk_ctl = dev_get_drvdata(dev); + const struct imx_blk_ctl_hw *hw = blk_ctl->dev_data->hw_hsk; + struct regmap *regmap = blk_ctl->regmap; + int ret; + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_update_bits(regmap, hw->rst_offset, hw->rst_mask, hw->rst_mask); + if (ret) + return ret; + } + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, hw->mask); + + /* Wait for handshake */ + udelay(5); + + return ret; +} + +static int imx_blk_ctl_power_on(struct generic_pm_domain *domain) +{ + struct imx_blk_ctl_domain *pd = to_imx_blk_ctl_pd(domain); + struct imx_blk_ctl *blk_ctl = pd->blk_ctl; + struct regmap *regmap = blk_ctl->regmap; + const struct imx_blk_ctl_hw *hw = &blk_ctl->dev_data->pds[pd->id]; + int ret; + + mutex_lock(&blk_ctl->lock); + + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); + if (ret) { + mutex_unlock(&blk_ctl->lock); + return ret; + } + + if (hw->flags & IMX_BLK_CTL_PD_HANDSHAKE) { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) { + dev_err(blk_ctl->dev, "Hankshake failed when power on\n"); + goto disable_clk; + } + } + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_clear_bits(regmap, hw->rst_offset, hw->rst_mask); + if (ret) + goto disable_clk; + + /* Wait for reset propagate */ + udelay(5); + + ret = regmap_update_bits(regmap, hw->rst_offset, hw->rst_mask, hw->rst_mask); + if (ret) + goto disable_clk; + } + + ret = regmap_update_bits(regmap, hw->offset, hw->mask, hw->mask); + +disable_clk: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + mutex_unlock(&blk_ctl->lock); + + return ret; +} + +static int imx_blk_ctl_power_off(struct generic_pm_domain *domain) +{ + struct imx_blk_ctl_domain *pd = to_imx_blk_ctl_pd(domain); + struct imx_blk_ctl *blk_ctl = pd->blk_ctl; + struct regmap *regmap = blk_ctl->regmap; + const struct imx_blk_ctl_hw *hw = &blk_ctl->dev_data->pds[pd->id]; + int ret; + + mutex_lock(&blk_ctl->lock); + + ret = clk_bulk_prepare_enable(blk_ctl->num_clks, blk_ctl->clks); + if (ret) { + mutex_unlock(&blk_ctl->lock); + return ret; + } + + if (!(hw->flags & IMX_BLK_CTL_PD_HANDSHAKE)) { + ret = regmap_clear_bits(regmap, hw->offset, hw->mask); + if (ret) + goto disable_clk; + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_clear_bits(regmap, hw->rst_offset, hw->rst_mask); + if (ret) + goto disable_clk; + } + } + + if (hw->flags & IMX_BLK_CTL_PD_HANDSHAKE) { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) + dev_err(blk_ctl->dev, "Hankshake failed when power off\n"); + } + +disable_clk: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + mutex_unlock(&blk_ctl->lock); + + return ret; +} + +static int imx_blk_ctl_probe(struct platform_device *pdev) +{ + struct imx_blk_ctl_domain *domain = pdev->dev.platform_data; + struct imx_blk_ctl *blk_ctl = domain->blk_ctl; + struct generic_pm_domain *parent_genpd; + struct device *dev = &pdev->dev; + struct device *active_pd; + int ret; + + pdev->dev.of_node = blk_ctl->dev->of_node; + + if (domain->hw->active_pd_name) { + active_pd = dev_pm_domain_attach_by_name(dev, domain->hw->active_pd_name); + if (IS_ERR_OR_NULL(active_pd)) { + ret = PTR_ERR(active_pd) ? : -ENODATA; + pdev->dev.of_node = NULL; + return ret; + } + + domain->active_pd = active_pd; + } else { + if (!blk_ctl->bus_domain) { + pdev->dev.of_node = NULL; + return -EPROBE_DEFER; + } + } + + if (domain->hw->active_pd_name) + parent_genpd = pd_to_genpd(active_pd->pm_domain); + else + parent_genpd = blk_ctl->bus_domain; + + if (pm_genpd_add_subdomain(parent_genpd, &domain->genpd)) { + dev_warn(dev, "failed to add subdomain: %s\n", domain->genpd.name); + } else { + mutex_lock(&blk_ctl->lock); + domain->hooked = true; + mutex_unlock(&blk_ctl->lock); + } + + return 0; +} + +static int imx_blk_ctl_remove(struct platform_device *pdev) +{ + struct imx_blk_ctl_domain *domain = pdev->dev.platform_data; + struct imx_blk_ctl *blk_ctl = domain->blk_ctl; + struct generic_pm_domain *parent_genpd; + struct device *active_pd; + + if (domain->hw->active_pd_name) + parent_genpd = pd_to_genpd(active_pd->pm_domain); + else + parent_genpd = blk_ctl->bus_domain; + + pm_genpd_remove_subdomain(parent_genpd, &domain->genpd); + + mutex_lock(&blk_ctl->lock); + domain->hooked = false; + mutex_unlock(&blk_ctl->lock); + + if (domain->hw->active_pd_name) + dev_pm_domain_detach(domain->active_pd, false); + + return 0; +} + +static const struct platform_device_id imx_blk_ctl_id[] = { + { "imx-vpumix-blk-ctl", }, + { "imx-dispmix-blk-ctl", }, + { }, +}; + +static struct platform_driver imx_blk_ctl_driver = { + .driver = { + .name = "imx-blk-ctl", + }, + .probe = imx_blk_ctl_probe, + .remove = imx_blk_ctl_remove, + .id_table = imx_blk_ctl_id, +}; +builtin_platform_driver(imx_blk_ctl_driver) + +static struct generic_pm_domain *imx_blk_ctl_genpd_xlate(struct of_phandle_args *genpdspec, + void *data) +{ + struct genpd_onecell_data *genpd_data = data; + unsigned int idx = genpdspec->args[0]; + struct imx_blk_ctl_domain *domain; + struct generic_pm_domain *genpd = ERR_PTR(-EPROBE_DEFER); + + if (genpdspec->args_count != 1) + return ERR_PTR(-EINVAL); + + if (idx >= genpd_data->num_domains) + return ERR_PTR(-EINVAL); + + if (!genpd_data->domains[idx]) + return ERR_PTR(-ENOENT); + + domain = to_imx_blk_ctl_pd(genpd_data->domains[idx]); + + mutex_lock(&domain->blk_ctl->lock); + if (domain->hooked) + genpd = genpd_data->domains[idx]; + mutex_unlock(&domain->blk_ctl->lock); + + return genpd; +} + +int imx_blk_ctl_register(struct device *dev) +{ + struct imx_blk_ctl *blk_ctl = dev_get_drvdata(dev); + const struct imx_blk_ctl_dev_data *dev_data = blk_ctl->dev_data; + int num = dev_data->pds_num; + struct imx_blk_ctl_domain *domain; + struct generic_pm_domain *genpd; + struct platform_device *pd_pdev; + int domain_index; + int i, ret; + + blk_ctl->onecell_data.num_domains = num; + blk_ctl->onecell_data.xlate = imx_blk_ctl_genpd_xlate; + blk_ctl->onecell_data.domains = devm_kcalloc(dev, num, sizeof(struct generic_pm_domain *), + GFP_KERNEL); + if (!blk_ctl->onecell_data.domains) + return -ENOMEM; + + for (i = 0; i < num; i++) { + domain_index = dev_data->pds[i].id; + if (domain_index >= num) { + dev_warn(dev, "Domain index %d is out of bounds\n", domain_index); + continue; + } + + domain = devm_kzalloc(dev, sizeof(struct imx_blk_ctl_domain), GFP_KERNEL); + if (!domain) + goto error; + + pd_pdev = platform_device_alloc(dev_data->name, domain_index); + if (!pd_pdev) { + dev_err(dev, "Failed to allocate platform device\n"); + goto error; + } + + pd_pdev->dev.platform_data = domain; + + domain->blk_ctl = blk_ctl; + domain->hw = &dev_data->pds[i]; + domain->id = domain_index; + domain->genpd.name = dev_data->pds[i].name; + domain->genpd.power_off = imx_blk_ctl_power_off; + domain->genpd.power_on = imx_blk_ctl_power_on; + domain->dev = &pd_pdev->dev; + domain->hooked = false; + + ret = pm_genpd_init(&domain->genpd, NULL, true); + pd_pdev->dev.parent = dev; + + if (domain->hw->flags & IMX_BLK_CTL_PD_HANDSHAKE) + blk_ctl->bus_domain = &domain->genpd; + + ret = platform_device_add(pd_pdev); + if (ret) { + platform_device_put(pd_pdev); + goto error; + } + blk_ctl->onecell_data.domains[i] = &domain->genpd; + } + + return of_genpd_add_provider_onecell(dev->of_node, &blk_ctl->onecell_data); + +error: + for (; i >= 0; i--) { + genpd = blk_ctl->onecell_data.domains[i]; + if (!genpd) + continue; + domain = to_imx_blk_ctl_pd(genpd); + if (domain->dev) + platform_device_put(to_platform_device(domain->dev)); + } + return ret; +} +EXPORT_SYMBOL_GPL(imx_blk_ctl_register); + +const struct dev_pm_ops imx_blk_ctl_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) +}; +EXPORT_SYMBOL_GPL(imx_blk_ctl_pm_ops); diff --git a/drivers/soc/imx/blk-ctl.h b/drivers/soc/imx/blk-ctl.h new file mode 100644 index 000000000000..6780d00ec8c5 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __SOC_IMX_BLK_CTL_H +#define __SOC_IMX_BLK_CTL_H + +enum imx_blk_ctl_pd_type { + BLK_CTL_PD, +}; + +struct imx_blk_ctl_hw { + int type; + char *name; + char *active_pd_name; + u32 offset; + u32 mask; + u32 flags; + u32 id; + u32 rst_offset; + u32 rst_mask; + u32 errata; +}; + +struct imx_blk_ctl_domain { + struct generic_pm_domain genpd; + struct device *active_pd; + struct imx_blk_ctl *blk_ctl; + struct imx_blk_ctl_hw *hw; + struct device *dev; + bool hooked; + u32 id; +}; + +struct imx_blk_ctl_dev_data { + struct regmap_config config; + struct imx_blk_ctl_hw *pds; + struct imx_blk_ctl_hw *hw_hsk; + u32 pds_num; + u32 max_num; + char *name; +}; + +struct imx_blk_ctl { + struct device *dev; + struct regmap *regmap; + struct genpd_onecell_data onecell_data; + const struct imx_blk_ctl_dev_data *dev_data; + struct clk_bulk_data *clks; + u32 num_clks; + struct generic_pm_domain *bus_domain; + + struct mutex lock; +}; + +#define IMX_BLK_CTL(_type, _name, _active_pd, _id, _offset, _mask, _rst_offset, _rst_mask, \ + _flags, _errata) \ + { \ + .type = _type, \ + .name = _name, \ + .active_pd_name = _active_pd, \ + .id = _id, \ + .offset = _offset, \ + .mask = _mask, \ + .flags = _flags, \ + .rst_offset = _rst_offset, \ + .rst_mask = _rst_mask, \ + .errata = _errata, \ + } + +#define IMX_BLK_CTL_PD(_name, _active_pd, _id, _offset, _mask, _rst_offset, _rst_mask, _flags) \ + IMX_BLK_CTL(BLK_CTL_PD, _name, _active_pd, _id, _offset, _mask, _rst_offset, \ + _rst_mask, _flags, 0) + +#define IMX_BLK_CTL_PD_ERRATA(_name, _active_pd, _id, _offset, _mask, _rst_offset, _rst_mask, \ + _flags, _errata) \ + IMX_BLK_CTL(BLK_CTL_PD, _name, _active_pd, _id, _offset, _mask, _rst_offset, \ + _rst_mask, _flags, _errata) + +int imx_blk_ctl_register(struct device *dev); + +#define IMX_BLK_CTL_PD_HANDSHAKE BIT(0) +#define IMX_BLK_CTL_PD_RESET BIT(1) +#define IMX_BLK_CTL_PD_BUS BIT(2) + +const extern struct dev_pm_ops imx_blk_ctl_pm_ops; + +#endif From patchwork Sat Jun 12 13:31:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 459159 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1795187jae; Sat, 12 Jun 2021 05:59:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvlWFXbXPERjOCFlCxGLeuviwAK3KTh9UXu+ytAt1GvQg1uk9SK++i0qIHuAD5bs+hRWvq X-Received: by 2002:a17:906:7fc5:: with SMTP id r5mr8005291ejs.474.1623502771021; Sat, 12 Jun 2021 05:59:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623502771; cv=pass; d=google.com; s=arc-20160816; b=hAT9ntxlUUapI5RLIgFz/ZK1APDOOnjYL5kSL9ASPuq1PnuvUg+9Gw3FOWCaI4rbCK QTgREwiJ7kOdYIL5RYtGXazEtd/JWDlsTCnE9ZcDu7EGjtpolCxh7vXlgs53tKvyZYG5 m07UdbBOvoamaoe/PN+V1OhbWJ2e7BjQhADDRbPhTPs3ExMiReRhJgBoq+ZGncJ0z3gK iLp/JhY3Rz0GQII5kEM//WAvxdbu6RcGaqmmrFkO5Fmlz7uYulBftjBARjWkDrVubEdG 7eCoFeb8ovapYQh5T0qOvZvJuMBhpRGxqYWnPCSoEcZ4kTTIk8xnOjKNHyj04yvYrj7F De5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Gm8D7o9Zkhoyic+N9lE/S6Kr9IT/0CYNpO5BdIwHQps=; b=wRJJpVqv8fyyaeDJ1e4GTVxTfDtM0OLWeY8lbI6xGg4X5sImiPklawgnhx3ul0NWlc t+oRqGxkigJQaeONK3/LYN5mq6sjIPsgNIqbSUQAQV/cxLsq8lgtMBVupI0ML/XhtMsv pVB7Adj6zhDc5nn6Q3kMR6QpUuYxPnyF2WMiff2gnw594f3inGY3bNIF8AcFoeSa65tS 2xk/l3mz2vY9cL5M6jxG+TN/mEk1htLfGyVasJeVJtAbmmzok0+eCo2o2GUBOsPdXf61 NNkFTrt2CQ5mAuw7O7JfQS2JUnh1SqgVk10hCWdoXMoarw15PQLzlQeHypOfmqZTUwOI Y/NA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="E5/hwdo1"; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si7565559ejl.253.2021.06.12.05.59.30; Sat, 12 Jun 2021 05:59:31 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="E5/hwdo1"; 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 devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231403AbhFLNBB (ORCPT + 7 others); Sat, 12 Jun 2021 09:01:01 -0400 Received: from mail-eopbgr70077.outbound.protection.outlook.com ([40.107.7.77]:61414 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231393AbhFLNBA (ORCPT ); Sat, 12 Jun 2021 09:01:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VoJY2PghjBIkZeM3/NoSqveFeB7Qb5gy95V8nZaMyx35cLqoiJlyATeFor7OOoRl4NPsENQ2Kcinqh7eRckTpqpLzRQZLmVVfiWnMGJkY2OGYfq0G2bhmkMZApg2HSvOlruTUEHx66kF9UIUq8NAjVUcVQF7Wu5+YFrgOGKbm6G7m8Xm6dhZ7KSh70pUCj4o9sYxjhbLpOrGckC4auXVHHmj3soLgd/3lCFBjxvTsQqdev1MQw1Gonac5IqgGtpzG15Y4P+eokmkkht0WwlIQvvw5U1rE/tqMiXBTB0J5DX3i4XSy0Fs/U0XzMdSuFF/vfj3BgTkL8W0w9fpTvmxiw== 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=Gm8D7o9Zkhoyic+N9lE/S6Kr9IT/0CYNpO5BdIwHQps=; b=QBm0W+qfm457LgdzppMjNBZTUT35IYULghsrfm1puau9zentV0RDmWpZWJA9EFMxXROxdMNeTNqhlfbwf/qqrseF/jc86ECWdw4AxigwRFhIUf4u5sQZZQOKx6Gp8raHNixk13CTTsro7CNPjgiWImfobiFYxFKAzUw4bL4GWZMB4hLFHcPqxhTSBdGKbDsdIrG4VNQi54jOm3QUnixpKEVhsaporg2eW07sTXcHB015bpjY4soG9xbfj8ATg+9xPGqNybcx7nJLyEFV1fJvv6Uf9qEY6/h+VTE9yBpbhlnduMBUMGqVqWvUkW3pE9qggPbTwDNVzZsoGsKcfCvOcg== 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=Gm8D7o9Zkhoyic+N9lE/S6Kr9IT/0CYNpO5BdIwHQps=; b=E5/hwdo1rBXO6HFzR7+jydCRPlOKzUV7yN29K8cCy0KHn6aRSgBgrJbrmoNO7o2cQuVYiDA8ZTP1IrQUETPRknMIj2tJTVrEsJUdf68/SFZkNaSAg6dumg1+SUKABiv+56yNTRPtJlYB3t+xT7FeRAFezO+pMmNHevuN9QVRlbo= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DBAPR04MB7285.eurprd04.prod.outlook.com (2603:10a6:10:1ac::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Sat, 12 Jun 2021 12:58:56 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::45b9:c993:87ec:9a64%8]) with mapi id 15.20.4219.022; Sat, 12 Jun 2021 12:58:56 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, p.zabel@pengutronix.de, l.stach@pengutronix.de, krzk@kernel.org, agx@sigxcpu.org, marex@denx.de, andrew.smirnov@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ping.bai@nxp.com, frieder.schrempf@kontron.de, aford173@gmail.com, abel.vesa@nxp.com, Peng Fan Subject: [PATCH V7 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Date: Sat, 12 Jun 2021 21:31:34 +0800 Message-Id: <20210612133134.2738-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210612133134.2738-1-peng.fan@oss.nxp.com> References: <20210612133134.2738-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR06CA0174.apcprd06.prod.outlook.com (2603:1096:1:1e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Sat, 12 Jun 2021 12:58:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52fc616a-854c-44f9-27d1-08d92da1d6a3 X-MS-TrafficTypeDiagnostic: DBAPR04MB7285: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:366; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iCQxD5JmIc44DkBH39uiCcJT0PFtucPE2GQWv7EFP5Z6Rmmii0XEhdg1WWR8Aj1rBbzWRemP4qseFUNZga8/+AeRNH51GGJztuErqdIuxHrurmrNwcJkwzi1A3dI0DyvGIqIAfizwdd8sXjbWMtVpfGT80OJQXt1YRwPMHLprVr/FQ3rBLbDR+G6+GOBJtZICF7JxJMt1QVNCP3IV6ixR147Bet2H3QeHAfdjCEdqWOASSiuwuPPDDtwQvMmSE7EGkwyzCi+eH2Ev74eJJoPXG6QnBJ98XnX4Bk1dPlFt//R7MrZvHPl8Nqa05FpdqI+cKqpDvDIRNP4+pT+8V4o5E0i+jwWIfBcJ8MNdChHlhEvSkQLWvgT4eEozLN635oHaz9xefbLLhSOBa3vxPVXLBoEiiUwvCU1If4x1B/GgMZYsKDxRARTA3NTdlRQSMV7fqcEauF1smUPs4Ik8X1v5PTxnxoquk1ifT7PHTsLjpgsQPIwNavbHks/P7FR9RJv/sBnT8dK+gmFB3Pf0dL7RPXKYiFYVtkE+1Le4orlQG0dAxH9kpEx7UQ9UsDEAjl7h7aqjRBXfoQAe4HT/COfPHGc4AtRJFj/RQWj05/3qdWk3tUdl1oabDQupb0sdyU4ns7VIWn7kAfjRfAKstOPBA== 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; SFS:(4636009)(376002)(346002)(136003)(366004)(396003)(39840400004)(6486002)(6666004)(8676002)(52116002)(2906002)(186003)(1076003)(16526019)(8936002)(26005)(4326008)(6506007)(66556008)(66476007)(66946007)(6512007)(316002)(38350700002)(38100700002)(478600001)(2616005)(956004)(83380400001)(7416002)(5660300002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SW4CZi1kJKknUuJSTHNi5GGG1F6JZMMFjrhs3SlIk5CNOowsx+NxGUUzLmi0LrlAAb3rAZd683cRqHWYecCYRZgIANoUY9YuXLuhU78WPR+I83U8z5rZ0N4WwWRBWXTgn28ITRHIoRsJ7Utl1/mTM4tTSk5k8SKdt7t/BwwSctiSwk7RDZStdlIqSMCzq2yiWDrpQs7zc2aR3sswqfwYRZTaxwnKP/0wRd5f5pkPWXPfdV5KEVncVolXbxw4XcKcSyGc+/AYLFYekCyia0SNVxML0qo9d/6I45NKChsuuKgrPf2/v9Jmeyby8ErBYz38hxfv0cxmEiGUDJmTqjr7EjVTUNJaNFqDp2KajZANbFVU/9zD86tCa8J/Fhp1qOTD//upu3DRgs8PD7Q3p04oSvF6k3yf2Qx6DrFS0IILEPiM2j3aI/QNrccOF/9xmHjViLrZG4sLuam38ZB9iiCA3WwNAxrJOrVesnxSvoqxxeSNk6K+CFS1XMCnFZA6AqBKeKZC50n3xYPbeBKvXIl5RLNaHMuzt481aI97Jq+9sZQyxPVtBHPHaOA6IALNZpTz7LhS/Kt4/cztrThqP3HwcxJi0tCTx5sd+lyLOy6NbT3xSrPw1l1Xr3ky0i5tk3hnviAkP9GrzruUiQ1UR0iHLjF3hVYvO+NBEQizQ6FmKJprnyuWzFpSQfF2XjLxykJrTI03LEW44TYha7xixQG39PvHI12NQNrwiCfrG8B6fGd2tVkw++G/uTUPovabrGVuJf0SaeQEvN9RQKg+Py7wkeDkFJoFn53eWsE0emXBN/3HkGN+K+Ja+QdVANi7qvrwD5bgpGXFXwcG7tlD5mpOF8Opmf4BILT4SSixFW2dtR9ahzqyhG5Hs9d2hotCW79dy/vTqBkxqlrQqozvu+whmoZNOm5oEXWblltIRfVUmQk3DzQ5zUVFQ8hLaTFPy9Qz+AxCB9hm9Y3cT4sDwkFgxznw4b+xmYm/QVRGlsMJME7bOz53EEgtkXGR7uvsGOCIEx4OXAnurWgs+wcuTMjXmVdShedrN3E46Aj728IwV8YQzqLEjDtFeAhb+U7iFlsHKsR69UOwOZVksndOsd174KqVFhcHMh5qYBG5BmojW/Osd0fGQgbp9V1HaCgHjhEECsNogVay1FW4sgP0jCozfp/jvpUIOpWv7B3TorQTt1oJnsILU1osdpdlP2n7YLzvTba9nQsSGMHoLIyQvdKnnZtVSRYkMDkU+cPItMOdlUA0b5zVO86fkPGgzbM6N/pM3PBBqommYKySGCmw/1z0BzcoPANR0ZhVPqJiCGes+pycaAEqN0PXRTQhvpRlr0FJ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52fc616a-854c-44f9-27d1-08d92da1d6a3 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2021 12:58:56.5946 (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: 3bBYXcqbzytoPTnUOvBKWHTxHNiSWsY398TwvXA/4THF7bVZmqnFmLp906EkksKpTQnEsOwOKP/DHcVOgbKaCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7285 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan The i.MX8MM SoC has dispmix BLK-CTL and vpumix BLK-CTL, so we add that support in this driver. Reviewed-by: Abel Vesa Signed-off-by: Peng Fan --- drivers/soc/imx/Makefile | 2 +- drivers/soc/imx/blk-ctl-imx8mm.c | 139 +++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/imx/blk-ctl-imx8mm.c -- 2.30.0 diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index d3d2b49a386c..c260b962f495 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_ARCH_MXC) += soc-imx.o endif obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o -obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o +obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o blk-ctl.o blk-ctl-imx8mm.o diff --git a/drivers/soc/imx/blk-ctl-imx8mm.c b/drivers/soc/imx/blk-ctl-imx8mm.c new file mode 100644 index 000000000000..59443588f892 --- /dev/null +++ b/drivers/soc/imx/blk-ctl-imx8mm.c @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "blk-ctl.h" + +#define MEDIA_BLK_BUS_RSTN_BLK_SYNC_SFT_EN BIT(6) +#define MEDIA_BLK_MIPI_DSI_I_PRESETN_SFT_EN BIT(5) +#define MEDIA_BLK_MIPI_CSI_I_PRESETN_SFT_EN BIT(4) +#define MEDIA_BLK_CAMERA_PIXEL_RESET_N_SFT_EN BIT(3) +#define MEDIA_BLK_CSI_BRIDGE_SFT_EN GENMASK(2, 0) + +#define MEDIA_BLK_BUS_PD_MASK BIT(12) +#define MEDIA_BLK_MIPI_CSI_PD_MASK GENMASK(11, 10) +#define MEDIA_BLK_MIPI_DSI_PD_MASK GENMASK(9, 8) +#define MEDIA_BLK_LCDIF_PD_MASK GENMASK(7, 6) +#define MEDIA_BLK_CSI_BRIDGE_PD_MASK GENMASK(5, 0) + +static struct imx_blk_ctl_hw imx8mm_dispmix_blk_ctl_pds[] = { + IMX_BLK_CTL_PD("CSI_BRIDGE", NULL, IMX8MM_BLK_CTL_PD_DISPMIX_CSI_BRIDGE, 0x4, + MEDIA_BLK_CSI_BRIDGE_PD_MASK, 0, MEDIA_BLK_CSI_BRIDGE_SFT_EN, + IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("LCDIF", NULL, IMX8MM_BLK_CTL_PD_DISPMIX_LCDIF, 0x4, + MEDIA_BLK_LCDIF_PD_MASK, -1, -1, 0), + IMX_BLK_CTL_PD("MIPI_DSI", "mipi", IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_DSI, 0x4, + MEDIA_BLK_MIPI_DSI_PD_MASK, 0, MEDIA_BLK_MIPI_DSI_I_PRESETN_SFT_EN, + IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("MIPI_CSI", "mipi", IMX8MM_BLK_CTL_PD_DISPMIX_MIPI_CSI, 0x4, + MEDIA_BLK_MIPI_CSI_PD_MASK, 0, + MEDIA_BLK_MIPI_CSI_I_PRESETN_SFT_EN | MEDIA_BLK_CAMERA_PIXEL_RESET_N_SFT_EN, + IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("DISPMIX_BUS", "dispmix", IMX8MM_BLK_CTL_PD_DISPMIX_BUS, 0x4, + MEDIA_BLK_BUS_PD_MASK, 0, MEDIA_BLK_BUS_RSTN_BLK_SYNC_SFT_EN, + IMX_BLK_CTL_PD_HANDSHAKE | IMX_BLK_CTL_PD_RESET) +}; + +static struct imx_blk_ctl_hw imx8mm_vpumix_blk_ctl_pds[] = { + IMX_BLK_CTL_PD("VPU_BLK_CTL_G2", "vpu-g2", IMX8MM_BLK_CTL_PD_VPU_G2, 0x4, + BIT(0), 0, BIT(0), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_G1", "vpu-g1", IMX8MM_BLK_CTL_PD_VPU_G1, 0x4, + BIT(1), 0, BIT(1), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_H1", "vpu-h1", IMX8MM_BLK_CTL_PD_VPU_H1, 0x4, + BIT(2), 0, BIT(2), IMX_BLK_CTL_PD_RESET), + IMX_BLK_CTL_PD("VPU_BLK_CTL_BUS", "vpumix", IMX8MM_BLK_CTL_PD_VPU_BUS, 0x4, + BIT(2), 0, BIT(2), IMX_BLK_CTL_PD_HANDSHAKE | IMX_BLK_CTL_PD_RESET) +}; + +static const struct regmap_config imx8mm_blk_ctl_regmap_config = { + .reg_bits = 32, + .reg_stride = 4, + .val_bits = 32, + .max_register = 0x30, + .fast_io = true, +}; + +static const struct imx_blk_ctl_dev_data imx8mm_vpumix_blk_ctl_dev_data = { + .pds = imx8mm_vpumix_blk_ctl_pds, + .pds_num = ARRAY_SIZE(imx8mm_vpumix_blk_ctl_pds), + .max_num = IMX8MM_BLK_CTL_PD_VPU_MAX, + .hw_hsk = &imx8mm_vpumix_blk_ctl_pds[3], + .config = imx8mm_blk_ctl_regmap_config, + .name = "imx-vpumix-blk-ctl", +}; + +static const struct imx_blk_ctl_dev_data imx8mm_dispmix_blk_ctl_dev_data = { + .pds = imx8mm_dispmix_blk_ctl_pds, + .pds_num = ARRAY_SIZE(imx8mm_dispmix_blk_ctl_pds), + .max_num = IMX8MM_BLK_CTL_PD_DISPMIX_MAX, + .hw_hsk = &imx8mm_dispmix_blk_ctl_pds[4], + .config = imx8mm_blk_ctl_regmap_config, + .name = "imx-dispmix-blk-ctl", +}; + +static int imx8mm_blk_ctl_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + const struct imx_blk_ctl_dev_data *dev_data = of_device_get_match_data(dev); + struct regmap *regmap; + struct imx_blk_ctl *ctl; + void __iomem *base; + + ctl = devm_kzalloc(dev, sizeof(*ctl), GFP_KERNEL); + if (!ctl) + return -ENOMEM; + + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + regmap = devm_regmap_init_mmio(dev, base, &dev_data->config); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + ctl->regmap = regmap; + ctl->dev = dev; + mutex_init(&ctl->lock); + + ctl->num_clks = devm_clk_bulk_get_all(dev, &ctl->clks); + if (ctl->num_clks < 0) + return ctl->num_clks; + + dev_set_drvdata(dev, ctl); + ctl->dev_data = dev_data; + + return imx_blk_ctl_register(dev); +} + +static const struct of_device_id imx_blk_ctl_of_match[] = { + { .compatible = "fsl,imx8mm-vpumix-blk-ctl", .data = &imx8mm_vpumix_blk_ctl_dev_data }, + { .compatible = "fsl,imx8mm-dispmix-blk-ctl", .data = &imx8mm_dispmix_blk_ctl_dev_data }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx_blk_ctl_of_match); + +static struct platform_driver imx_blk_ctl_driver = { + .probe = imx8mm_blk_ctl_probe, + .driver = { + .name = "imx8mm-blk-ctl", + .of_match_table = of_match_ptr(imx_blk_ctl_of_match), + .pm = &imx_blk_ctl_pm_ops, + }, +}; +module_platform_driver(imx_blk_ctl_driver);