From patchwork Tue Jun 29 07:29:38 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: 468298 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4683218jao; Mon, 28 Jun 2021 23:56:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWy9MevW3wWxjgSkfeTXFifnD1odf1PhZWp8AMtCjN+Xdul22MMJaebn7y2LrAu4bPOPAv X-Received: by 2002:aa7:dc53:: with SMTP id g19mr37753729edu.226.1624949802065; Mon, 28 Jun 2021 23:56:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624949802; cv=pass; d=google.com; s=arc-20160816; b=XDTn9WQYzG3BVipFPPJoxfn9hhqSFKvgdoIqA9BvTLuAbxg6/2mCc0nEbwHxxbPBHh n9pKVjwjJ3axjiJmRwgAEj0y/AE8JuAlde/99Dk97LaZjr5712HxYAW6ez9Y/U1UxGte kEn/NBiMACZYyZ5P19A6+E9+RzUNHmPu3WOxm4UAmKLaI2xP4ChnOlOqm8ib4cf7C0Ij KPcKfaFXLmvwe+nf2V1yUwzS+45WRLB4T3scVqKfiKDHCAIdwy5WdIxKeEO8wUPNG/Cx 9jQfLd3rB0CjGd4/K7izJ53RBzYxgzZ6nmOim8HeguHYy4EQNy+Qdqvp/82J0PHVE61t DlLQ== 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=uq7FXrpApvp1Nv62ksjXLYodcq91RtpOpoI8Zu9FADssN1HuRoOE4smhZCSQPCxOyp 7F4He/xOwpiNulh1We2wiOOXBoRWgWnQ8WLRAh9vVEWpFJ9OjLGKP1Vvy+6TEaXwm7jh LvcOvopd+SZUrcw+mGXcJDFlN6+MDJuCHv15073S4jI3nHPbsVzivTiMSjNLqq3Ugpgm zOTg0hAzXwO+HZ7VyURBP+sD/vaegVya7DpOt44pnwjj17vGYbLL1p2IAmG0GW+/v4Z6 0o9xdhuykIufGxbXTRjGJR3VEU6rkEpptvgVj4oT6/4/CpJ2rN7QbOEiDcEXUrIdJ8DT 81gQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="E/NcpAut"; 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 h9si7385952edb.389.2021.06.28.23.56.41; Mon, 28 Jun 2021 23:56:42 -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="E/NcpAut"; 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 S232206AbhF2G7H (ORCPT + 7 others); Tue, 29 Jun 2021 02:59:07 -0400 Received: from mail-eopbgr130058.outbound.protection.outlook.com ([40.107.13.58]:41537 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232202AbhF2G7G (ORCPT ); Tue, 29 Jun 2021 02:59:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GWU/3eqvAN8UavLsi4/RFYh8Ek4128u/Ehpg5iteqDHFIdWQ0rPmXg9tvsGS9w8NJzFpiTy58E8mogL4G9wXDVM4b+nUAZbf2Ipd58iy2qI5hLGzDZ6ApjcR1MsYMk46YrCHK/q5GYbCf8+lznXLD1wc/phSoytVLrdAelxaTpHlE+mhePAVIPQ/XIaTc1ItESNAbT91VPNpW+TfiZna9FRLm6ybzn8xLh3ag36AV/KdGLi8a68wX1/6FO6wPQrgSJW3LpYJTx4mhR0P6U5cJh2oxWdEctZFKbe4rzWORylPUJeWKyGWoDWrWKRaLAU1ZIfUWT9pwoM1ZaPdfqNsmQ== 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=SY62DrE204dirHE/kLBLN9iX76IDuSMg/p2QG+4/nz0LupSpOp8ejy1pj5QkQIE2B2Khedwmdw5/qALyHl6OU9EA1ogsOUkaPp7MOf7cGa6vXVanteJ8CX7CgglwgEdKeRO6Jx0YdkEk7dcbR069YagDbDLNCydBcxdSNycOdXh/OIxItOmN6O+kSG/0zke6mE/qFxkfwGX/Tk6dphOG/fMTfouO9OrBcncWhT0LpsagnTM9ZH+LXvOJ6GrFvmvRHZSgj6MsbVBnrlShmktmg+mj3eXHjpnKf7X2ovmz6hVtT6QQKfLu4LBbWi0V2a2p4x90WXmnrK44Yfba/DowMA== 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=E/NcpAutrwU45wtG/xHEsK/nVqAJtI8M035MlWPL/NEs4vZu9I6g/0j522LXv8Q0h8ypvl+vL9PcAojkzi8OtRZ/InZukmMyptRWTkgEmgtABn/ZbI1TRfJWnrgw5M6uE9ylPOVFLQwL55vcFnWxbAZsEgW0gP08RXVdNWf9k4s= 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 DB7PR04MB4762.eurprd04.prod.outlook.com (2603:10a6:10:16::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Tue, 29 Jun 2021 06:56:35 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 06:56:35 +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, jagan@amarulasolutions.com, Peng Fan , Rob Herring Subject: [PATCH V8 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Date: Tue, 29 Jun 2021 15:29:38 +0800 Message-Id: <20210629072941.7980-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210629072941.7980-1-peng.fan@oss.nxp.com> References: <20210629072941.7980-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) 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 SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.12 via Frontend Transport; Tue, 29 Jun 2021 06:56:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a54ec21-c91e-4d10-83a3-08d93acb08a7 X-MS-TrafficTypeDiagnostic: DB7PR04MB4762: 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: XBU/gzfhjaiLG0td5NYJdhu3m5UO2CcvOu0MqzbmbzRcdFCfnBTZl6mkgm+PUD5O+5UDKB8z5xl/8VTin4QtEeEuI//M+AdF6zxKpz+cDzY58qfnB50i04ub5d/OdzCVqcaNHcK9Vr8ePP9ayyQfiE1gQyEtgQ91tQXcy3B0TE632jJyvToccC8ZF0GbeCBJaR96tLtp5dwXO/JN8KRFb5hEMotQvO2Usljelz298N3xztrhysSiRmQHhxFHw9tWU4Zct6o/SctWrq2Ejv6i210irC1cmAyle/pGOl00a1a09jMLoUSPYwqcGier+0/PYHp7GsoWUF9lmhCZ1qCnr3N0N3rmfLBQKEi5rdGICKnHapzKthQAxvE6d2kvghRH1l7nefQ7IXiURDNXR5y9KOEnp6ZJqweISEREsZW/YveeVvDOXCxBlpxYSHtxmgpld8d0THtsuinevy9F7Mu6ATdZbtyScjAU+d+ZXCRgWdTVNJGlGwkMck/01HaNrNA1AFqjMFTfYZsMVKprgPL3ewIp5XKbj2LEFua7UYcLOIlHSvunGj1wxSywT2lKrWbU01qBhFiH2TAZ0gHQFZGbHKxFx83UbAGn3oezClbb8ONR+f9ORGz+3hPgxLqqCICZmxQE1dqOmo+zC17OMr2gFAFeawj7AkYPTrEXB5c10T1a2PJ2fCIp2DNMca9Rv6gfQhcByJx9ttC7oumnzj/kJw== 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)(136003)(376002)(39860400002)(346002)(396003)(366004)(956004)(38100700002)(1076003)(478600001)(316002)(6666004)(2616005)(5660300002)(66946007)(38350700002)(54906003)(6506007)(66556008)(6486002)(66476007)(8936002)(52116002)(8676002)(7416002)(86362001)(16526019)(26005)(186003)(2906002)(6512007)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q/MfPHwjO2GANK2/eaD+hYFxqA/aB3zIWxsAmEoGcE80IO4BU1opvWodLjg3JCl8hN0GF9To82uQAwoCmRzHQgfIpGTefp5NF0R4PIDxhphsVhfzfW128eBCUgyJen3CrOHY7/b46j1gnJm0kbjqWIPdqhbUZf6FEv5qgGmjgoacGLBCI5ydgHOIJ3PtApuX1q3AbZTezi32KdqrWKF9cY5VGDiCravkj35pVsoNytRh4SBBJWN43/HfiLw49vgUM6+pC8EDWe4Ib1mpDM7UPjtAY/PE/NbjeJp2/dIcxBE+mQ/8pz0ANbMaL1RI283i9Z6gylR3F5f4Z0EZg7q3w68cKsfp4sN6z0a/KqD5zQ4zfiDRbdR64IPHkKrwDbpTNg+PiSE3S17Uybt3EOxzoJ0K68BsO74CIrf5X7qaTGViPv2/RR8nWtcC/s4HJy6Q7RAS2CLaiuF/hHqIWW01s8tkqPAljv66co6ZscysyrUMv3mVkjlEfaBHn0rMfsTxcHSO1p3GntfN0+D2qantBjSQXzaYdM4wX5IQ//OA+fUOcbMIdOoo8STkP6JVdaMuGgsrUE2aNfBesQMpTVDAS2yr1sYYrYl6i0nA+rNDqpTszZjTxd2+6tkJ29apnfgZTcHkZrId8YZDluQUg/MO5nFu5TxfJlECmfx9RwLXNrDps3+HQDNrgqxZeiLaIwR3YRJxIvGtS1q4Y2uMMgG/O2tqvSPix3z7F+/GgD6w9qOjDnbj3+AcVCQVosZIjQ4cQ06fkWOUR6NR0xVlcElohweYwJoVTuzPe/yBFan1W209n+irSaI6xT6ZcZeO++BnwRm8GR46oDg1fRRcMKuj8abG3K/KhaufDWuShU7FVEAyVMX0h5YcgQHP3LrtXDrP3P/fErU4vf+ZWqrTitsP2LwwnVVyhQFujSlM/WVsPzSgwxjujv1CnHmX+c7vdTsbqAlR50vmLiR94jwg4bgGNw7OWwPARY7JEl1TQVgStEt/IdsgS1wGl6zxn0hiJh7D2B0qbhzg9VNLyZI896iyVJRUtB5/6UfA0doFvqdYLaljQR5QUaw3E+z92ewj8qsZhSoL4NParlrhwBLT00uQfXMtCi3lUZSsitonUD8mI6wT5EkkTJQK+ktM0Hx/AKw50jR9Z+Y/rh++cfqDoyls0pkifI1EzyRQDq3oWtudb2sH+KgXOLrF+VTF4UbrqXNH6mBE+Mwlrhwt0atR5bWptwjEfIXZ8PMSR4gGuieJu3hkI/o8JChVtzxBR/xDyh3NWnLvrxhjHZfBy0A1QjB3FCKJhdlplKEsbdnY3jHixomHDJim16b/eTcqu8VUiCVT X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a54ec21-c91e-4d10-83a3-08d93acb08a7 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2021 06:56:35.1602 (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: vVt33+OxLfd1SFl3Ha1UOHkmNHJx3sKjnt+d4ZVx5CLP95IOoKGgStyvL/96jiCwXfj5HlAqKSx7q2k+LjvSsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4762 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 Tue Jun 29 07:29:39 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: 468299 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4683310jao; Mon, 28 Jun 2021 23:56:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJuzDtSocBDmp/ytP3a3liF5h1VpB+MrIqjgrIzNXN7SLsIQUJMQTFx0LWU7ttkmpuY50L X-Received: by 2002:a05:6402:31a5:: with SMTP id dj5mr38472544edb.229.1624949811122; Mon, 28 Jun 2021 23:56:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624949811; cv=pass; d=google.com; s=arc-20160816; b=iSW6y7EAPY8pHfsC3aaO90fFogKhVFw3xX/9H0r+FgZPnPO0OV1tOD+M/xcDb4D+19 F5/KaOQqPeBA1wBSNPmKRfTnQ5dymZmvnHOQGigrrIgCMzZWRG0tjf5qRq1vtq7tlVec uX6n1hcOfqoTTQAs3xOAZBih9V6H6Pi1sLaOwfcXz+Njz6NPehBoxwTnChB8AAnZXl/i HNSfr/wkc+TTQiHiy0fMw+5nFjS4xyIHgtK4Kox/b/dYceyIDcju1OuFvUPIUqFX9iRr nYUJ/9idDPrSoXjGvgrIz7pdk8ByUKb/8AhSUTa6oQqJD2qyACt61W/FTfRt8dQiYgMn /Ihw== 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=SJeiGZS9accnDVcHeBfW2ue60CBC/Cb/fSbWnKBXZ3G4XYPG7ewL0Yt5LKmWj2sjbe AZC6zOSGXhGxzlpeFI8l6L3SGD35t0Tj2ULWxtMHos0n3ew6AZ8/7IhhvDDIfqMT3FRo 1gzZ3QMo4RBam1H6Xl2c78+9L3Kk02es1rXDFmjvgJVVqsNADS1EqjZFyf08LrjLSBbw wZMiSKthG7148Jx8JMWDpu39Bf4FVpv9or/dX1pTw+G0Btkm1k7HzyzxRD4ipLDXTYEc j4VV5Q+p3OXJEBuFqO7RJlmIdPdMzKozBGcLsTnhhBLh/lgFri73Zk8E1hQYfeg4P8ij h6Zw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="N/30//Ic"; 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 hv6si16305322ejc.150.2021.06.28.23.56.50; Mon, 28 Jun 2021 23:56:51 -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="N/30//Ic"; 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 S232193AbhF2G7O (ORCPT + 7 others); Tue, 29 Jun 2021 02:59:14 -0400 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:12769 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232195AbhF2G7M (ORCPT ); Tue, 29 Jun 2021 02:59:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gJ+aEqlBYNcecLmJMF5X7rla3JaM3l4bZ6CzkeT2ZVxuxiGzRMReVHWhfZeJKXafjnJi7BKtEUw2pHV/x5T83nZ4ztOA0iunBUHou76lDMRv3dy7AwRDubapYYFFi+EFyEL9FQtrJXqh50R+PDzKzdBcA5qypkRFRfwrrgWSDkuNEVxLjizUuCA0QKj5IiZuG+UE6+widM8LSzUAWY6qxgBEAEXzrpaz5i9fhzilQU0Qn/T/9KH5k+t4M6wJWQBHPHKXzPVnxWv/KNJrOXABkgXR/F4VG0R/fagrM4gyVlNnRf6nFIFREWRDBq5NDoXn1kh4+femGtnhH82JyBsz+w== 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=S97McVLbza/2tMfOhqMmBs4Yb+EG1rlN+tBMa+DX+BtQTu8r7bHR1W5uY4kLhpRup6Wl+J9fgNgWzgF4/zsSNYXbTt/nrQsPXOSiRmSDa4Q7Z/QPqgmumisji/KGWAJfJ0Wh4kxs8n9v2ikAzMiSSAnduddvpsSJzN5/Do4qId78e0kmIIVlyDoHrDzA9nmptUzywA0wjy8Fa0HxQrDHkrQWDVOC4+Zhh4ESRJzpfqbZ1/fSFML9ich45GMJv3Y1cTWMiYhP5zMhukDxrvYUJLaAM28IKcw+ZgR0nkx5Rk1TxPTi3Zn4MkFc5JeXP/BhBA4zqTYzSW1JO7dZvkrYtQ== 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=N/30//IcBwm8lB6KKHNq5uEaM8yyPrE8y0467QcYgrDfYoDgeo3ODU2bwyhqrXeubKSEm/0SnHdQhKzYB6QLRHrNzx5HaM356AmJRJDRjWcGZVZvlkEYO5NsPe0i+R2OtFmtD27ab57wWA80q0qf9UhjqD+pWM94p+K3TdpIECo= 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 DB7PR04MB4762.eurprd04.prod.outlook.com (2603:10a6:10:16::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Tue, 29 Jun 2021 06:56:41 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 06:56:41 +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, jagan@amarulasolutions.com, Peng Fan , Rob Herring Subject: [PATCH V8 2/4] dt-bindings: soc: imx: Add bindings for i.MX BLK_CTL Date: Tue, 29 Jun 2021 15:29:39 +0800 Message-Id: <20210629072941.7980-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210629072941.7980-1-peng.fan@oss.nxp.com> References: <20210629072941.7980-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) 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 SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.12 via Frontend Transport; Tue, 29 Jun 2021 06:56:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5533f584-e9be-4bea-79ad-08d93acb0c9b X-MS-TrafficTypeDiagnostic: DB7PR04MB4762: 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: KYX4VElckPR6DkUdqu6nZh/pz4EDHZ46pNPoczKiRSV4wwAoch3ozRr4bARO2PCfrJSjo3hMiA5aT591ZUZRS5wrUnYd+rFiBof7uEQIVnIY7Iz/sh0JvfpPbtqjl+DwbaJLQd9XnKInTrf6hSwl7HCg6GJAiKs+cmtfwQxg9hyqCMCIdzfLM0l2aQrnuElOkn/+2aTvoTp0MZIhebE7Tk8dbPKH/Hcsodb4SZiOju+snzj+4alodQwmScyJj5OGdQROTp8i7J9njrzkp0639wzhdx1PQqsxemApz0FFpQSXDAJ7IjOCDFLqeP00AracwjxdQJq3WCzRyPTTBX3ne0Va/U8/03cMTrUjHSpmbWijnHa6ylCs0tnRXHoUh9uXokxa1TUmm4z9tMauuAVjsQUtBeSv+co3ThNaOQWRE79FtNNLyaZ0kyR0pKZKsqqsgLENXLog8ULQ+Oc8fdMd6yq41K4Phf5XaTfP5yuuRK0TtFsZgnz9xjTGRxIwUhtLGWUeiiNXmqlbRv+El1WWnRtODocSasRl8iyQHgnMkMzypghQbfxzdjMbPi2wmXD5qOca2YeNbM0Wv2wdFfyYHdOD2TsxiJNQzaeviPR5o8BxNi7LAPl+Z7qnMTrqFGeb0Hnt+Q8UBvpvHBmvoQBaNueKWQVbxDu6LqLPeUIsbkbX6iBigyjp6EEAH+WWcWsiYTwOw8HWewzDptqUsrTp/GWIWKo1wWU4liNlbb7rUEgT4K7tCFMVwt7A17vxnIai1YrS5Y4qpn/u+E3arCvgTyBbJegMYM4ZppZ+l8fDxaqQJGLm6FJrAPic1z6qpuXeHJGI5RedbBJ0kuIvBTYcWhaGGKCtXWBxu59EXf96BoMhCFsl4DPXsBpxpg2Uepu8 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)(136003)(376002)(39860400002)(346002)(396003)(366004)(956004)(38100700002)(1076003)(478600001)(316002)(2616005)(966005)(5660300002)(66946007)(38350700002)(54906003)(6506007)(66556008)(6486002)(66476007)(83380400001)(8936002)(52116002)(8676002)(7416002)(86362001)(16526019)(26005)(186003)(2906002)(6512007)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TdSkDCx37hyBs/iMUAUNA9UI9SpX+yp6Uy4zsI4UgvQZvOmo1gyFjm356M7B7+7290yAbgslRt2hgyAzBXHIMcTlOm+N0Yo+Dxurzn3m7tVtke7Mt8hJpHU8cMGU5QPPh3rLmL3CoMnOZZFe3NSop+O4chAcijaBpcA5Uk3FjcqA3KmlXRFH8gh7Lnn6dGcHOZDmbmWrldUjhAHMRSCkrNV1Zv7HfYIjP0WAESYqCr+yuRq8fz6K42FFnk6yVG+6seNbICyRolgP/M8iChXXw8/1FA9/bFudZFehCfaXtSAVxYzYYdGOp6vcTn/8pN/NTu+2y6uZSDPi7WuravDeThF7q5lZxOlsDCznsffcVfLo2Rxm7uwKF8N8V5DkXF/Zm9O0i4+y77sbFsOkL0jFeZ50UoSN7kBJ251JxJScFAl56yik/M4MowJWT9wY1uvBL+dc6VS3VywHsV72yA0On7PnGbuvXZffjIbC6poVoJMpgTFHjhQy80TMs6+7aUtWVNuW+xjX58EbxvH2inoK2/ztD/GtmOv0ApG8ITfGyQU++Q+YtOKrf5PKH9k04IwTOxJjupHf9nEber4UVilnPS8U7PrB+gI8ffoTuLBwxnQocGifq4uIOt8D+w14T5Q5+89/ZQcKeLxJ4Gn69Ns3RcHv78VaSxK5HDQtXcsW+t1ALy8JJGUQPLUAnsXgupiUirfmbznFG8VsKiB5Um3S0W4VmQKbzrzlTUvCMVtHSly3/RiNgGtoTaLEjAiq1t7oM0N+gtVaVD2d0GHLmV6MTnzlsb/2Kt1q7DlGKoBVoost8Zv7iqr6NiFAAa0rtcec+73hlMqLBHkXe0/zWFNnFaKh88QKd7kqF/mLpodEbUgCwwjYwXQgMfDM7LVDr0D61aYlsF+wY/V5VvbfA8O1PzGhTsZAN90EbGiqsf9SBNvMQVv0n8M4uRWkt0DrL9/xTmzr3h+3JgzyNh9oo3W22iz/Jw54Sn3YMY2YAceI5Ma4SUbbCZ9Iq7t0mDwxz8iFigffjVJ8rZH69cKM1zrXzJkNpuMW14A48nnxHFr/y7r1Qs0IM9mq+1ZBKFub4Lj7jLO8RfexYlCSec6U+oTeqhAgHVqoaU3cQ9AGeJKF0UjLFQ0DINFf+VfiIz2xkEIyiibiLUVjizk0HQgU5hbzVwcB4fbLK56is4vS2uJQllKpTYGQKOw+6G1E+6a8Q9lSGIwPIh5Zg2YJo4j+nvGHOeakPeOIaU/kwaYEw/4xY3CLAgCfFnpFfWmm9sKDXAN3N9bXG1imVR60gcQRts54zrk2r55jHyaHyyxJaJ3Zlag6dwBgvTstoZoFug2euC0x X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5533f584-e9be-4bea-79ad-08d93acb0c9b X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2021 06:56:41.6192 (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: W3BJyqOtVKeYEXFg36WwEzLnMJRc9Te0JNAsVwFtFmylZCWEnJikVS69xpvSIPB8+xTimJUjl7kRXYUs2bQO1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4762 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 Tue Jun 29 07:29:40 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: 468300 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4683337jao; Mon, 28 Jun 2021 23:56:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeYuyXiuWQjQqD0KcYO37rCoSYUfd/0dU+dY80cpxnTKQP9d3EDDbB+AWMpJrArJ/LYUJJ X-Received: by 2002:a05:6402:501:: with SMTP id m1mr38688848edv.163.1624949814148; Mon, 28 Jun 2021 23:56:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624949814; cv=pass; d=google.com; s=arc-20160816; b=ThUkrQcfO5Ra4VTgsqcmmkUBnmCQjYevXxyW9IH/z0toeIu+ET3CBHQ4hME/x/p7dw sIP+tyxDsmOk28qgm9wTGSqisxL5GnIwmgxbcL2HrYZFyWmUTOc7ygQitWmiq7k2ptnn RJ7pxZhSOZ17XUZTc6WCn60zSeOO/SfJsrX7p7OTq2RFbk/fUEvOtVs4yLQxagH9Zp/5 /4gdCIq6t827BPE8BiIktdx/wj9P4eIOStrPvQ+5xzrkdpbwR4o7y+1cc4H5bEFsqIkc H5oXgQifbg8ucvNJ2C6xoG0D7zk2PjwQPNvkGWPAej8DulcoH/z7z3nFPKchT1TcdtAp pTUg== 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=K27AjtmOr+jOc7RycKBTA5RxRhe3BPs3doQIUd14R+4=; b=Gb7p8CNdP1RVQx0xsmo/t+wpfPzLc6xd+GIAeaRCl+/pO9IbjHP6Z394+zUvxKKgGW Zc6HKC8z9TION8fMdDFcdsJNBxoNIZsSkvm52eROJHB1EuEsNzv/pLjWUOi4OgjlRV4/ ANSAJJypYumBln/JXpDFqVXzNK0R82E5TFd/5j5zcRfMOxltezRcR3l7+F4hya4QDOdz jvhkZp4JrP9XwEc9aY18LIUv7aZIQUDgpu+5T97mszF4uKHaXYZ1B2XhGHXi0CkbDFXL 7j8c7nD0YfSGAgTAXLCGw+KcaiFnUfl1K3huB8UkB6UzNd1SwaXRMrN8eoWIPrQ8CglO uoNQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ZeoknmIO; 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 hv6si16305322ejc.150.2021.06.28.23.56.53; Mon, 28 Jun 2021 23:56:54 -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=ZeoknmIO; 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 S232220AbhF2G7T (ORCPT + 7 others); Tue, 29 Jun 2021 02:59:19 -0400 Received: from mail-eopbgr130082.outbound.protection.outlook.com ([40.107.13.82]:11571 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232195AbhF2G7T (ORCPT ); Tue, 29 Jun 2021 02:59:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mzIz958RV2G0htFELCA4Z6ZGQ/xbxyz6eb1UJ9MTy6iUuh2UQoL/KdfluGeb1ls1wewLw00XB0GkdiDlfvTMuyd9/5sbUct52DWG1TypY5UbyCCdUGnrF0b6JiKyeJIHUWcmHu3egdR3MgoFOEnLRkX7ciwwwIDE9QVlUntwT4M3+K8xvsMcqW1z5dG81HDC9jjDFZ1EFWDHNCVmTtvXapOBpWStuZSldrDCbRemLwSk0QyFUFQnVhayxk/F99JSOs/ELU5SWXE4XSt4JdAS2t8Y5+1wf5hzch4EaVoMn/hwD6AXuqAEJ2MTmVuTZyshQo5Z6B7QNEau6ZMMtVFhBw== 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=K27AjtmOr+jOc7RycKBTA5RxRhe3BPs3doQIUd14R+4=; b=RkNcCs8qAubLCmruWxUX/TCSy1bf6I+2pJfMM/Zx8f11kuVqaAGK9qBeMyLUEIDWOe6tnzX0tQ9NoSk/gIv1DWGUq0AV9hUcp65ZMf3V/M5MeMb3OIyGvzdPYKlkvds1g6FFocXdblY4UFAyNQdmbeHhnTjg4M1QOFput//kg1Gvega0bgSJ60jzCK3NEqXwDsHXReqGQesDPtVU7mfdIAn9YOvosCrlOvPHepAuGll339l39LxaZ7cuiNB/oXcJNhSUjputMZJZLYACVdBa0pTlqCWOOCJ9ry8AYWm141M2vFQ6FpcdUbi0LhWDqw1NNTOVyyVxoIo5FJz7gCKN2g== 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=K27AjtmOr+jOc7RycKBTA5RxRhe3BPs3doQIUd14R+4=; b=ZeoknmIOwgMfeSaRLxoMQgB2vDvSQrpiZVgOSaAW+YDnpnKj0mae854yg5eJZIgHiNf0PJebDtJVS41bi+kdTMTSG9GlSi8rljdFZN7KkevA09HPVrC1g3rhAn5WLHsN3fGtI3pjKMhhhYsiHNComUF919zvsC/va4eP2O7T7T0= 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 DB7PR04MB4762.eurprd04.prod.outlook.com (2603:10a6:10:16::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Tue, 29 Jun 2021 06:56:48 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 06:56:48 +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, jagan@amarulasolutions.com, Peng Fan Subject: [PATCH V8 3/4] soc: imx: Add generic blk-ctl driver Date: Tue, 29 Jun 2021 15:29:40 +0800 Message-Id: <20210629072941.7980-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210629072941.7980-1-peng.fan@oss.nxp.com> References: <20210629072941.7980-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) 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 SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.12 via Frontend Transport; Tue, 29 Jun 2021 06:56:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6200227-1fb7-4cf3-cd9b-08d93acb104a X-MS-TrafficTypeDiagnostic: DB7PR04MB4762: 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: YGzgKyBRSEyR7ncVWEEtOKexMj5mzAlbjrboNZ9n6/MgiCEjTt3IZlp4Z8pfz32V4yoGcitRvHRpXWdcvDiTcuwkPGOsi1uo1q6mxJ0tMSZ/zCGmrZBxF/dntP9CNr3+J0JJ3i4UXigeL1PXZhhbkHljnxGybnfSoPxsmivr2GkRiQS0zPE0oISKx7SP3kVBtcnBYeysxHlLtmcucXvrrhf286UKRA7Eb6GOpYTmbFye1FsPUd2tYaQl2pqdL5YKalbB3GGVvrcWDleMWEsMINiYu9hgqYT0DpfnzN4vzsaYf1n8eMuuUC4kaf5yAvlfl01pyxnr4z5dN577BsUvcQOco22g+OXI7btqm89wgFYRjJaxEB22/N1a7rFoQ+wgxjvRFRG6OvtxIvR8kvvmHPHkIAJO7c9CRfDD7DyBR8I4rce6S9DunxlDhXf1f/ALUviRSGi24PPW1KW25BmiGDJIU/3h97TswbjvBQBwQjKfnhymGt3j4+4RRu2M1sgA3IVaUfn0b4QqrjgBfxUrE8oj9swRRFtkjUM4R2dngKMtHTJnIht8JIXIxVTkjQNBfZ/P4shO3IqHlNetmJtgF1o5wWIKo7Kb0DcMyIEfmZjuVwC5i1xqEEPzFgXC72xo+2yR1kNFLjk7vZv+5bIFJ6Osai2drPf/4JBhJ1qHebjezTcW58dfyoJMEzpXMIiyejY5f4ekzhGL92qvLj719v+sYayCorshkaZwc9AQ9d8= 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)(136003)(376002)(39860400002)(346002)(396003)(366004)(956004)(38100700002)(1076003)(478600001)(316002)(2616005)(5660300002)(66946007)(38350700002)(6506007)(66556008)(6486002)(66476007)(83380400001)(8936002)(52116002)(8676002)(7416002)(86362001)(16526019)(30864003)(26005)(186003)(2906002)(6512007)(4326008)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gkM4+xCEkXuh2c5enOtnd29KwuR+dfOk5jYnke9nSWnAVAH9f1AW1oC2aONvmqxKIPPZb8Iirs3xnuAmsNn0EV/Y9hCHErZdpuUHmeqQLvwl/m5oaR4FrvrFvr/9OGeF0tgv4Rq8GWNLOFnNuhxDo5I48bUmZ4Gumz2TwNLVWxQxc0qlE62SF9adwp/B9IfXHdanQ55rn+khUegqu7ms3iTqggZtckhRU6GdMd0u3lD/R1VQIPNX5dYAQylGm5JoN/jxiKS/GUf6JDrCcw7HebYI5p4WvRj/eEnRSzKaaXn0cuJAlbHlM5lko82nEOyjctMfCxr4UCgQL+LgeKro2TNQpZDFqKNxoXRiGyPuLTEKp/2B7I0Nyk5VJesxelPVaj3D04HL7nEjq4Q2MUkYO3L8sme2YNaRPAKTJsiZKlRm54SgudnGRY2tQbqngFg0uW3+5i4KReRnL0IC5G7UuwZpoDWUm9ZPYoF/y07se2uzyeyhZZGyw//nvWiRn8WbEDnczCx2gV8YaW6VSRQBMMY5/17WllyOAZQs4rJuFPlxwem8iuOfHwBWTQNDDn0V4OyVrJiumAG62KuFNJl+AhUXdgftISis8b+Z9aq595xRXXfl/6KQ3sIbAzA6dsgy7XtknDziz0R4CAszwnvPwO9P8ewXirGGdCJXzmq38OVZ5/SnafZxff9lGVTRln070xaVzudlDcUiJCj5+urfptqtSLJTGMMUFPIOfi2uPoi0q3T3DBDD/cNjTFhWfkhDe1vKvk/ZUgj0kEFX4QEFMenEe4MKiRn1/rohcnn2bZUo1WagqAzmCGfOsBBXuX5aCI0dB1L6Ru1n6MZxrcDcWTLgcWnYD+AuRpq6uc4WNRif7FjqP971ZjASzRWdh4TVZAAebDcDx9vBzVDKq6GtVMgCI2svSuI018TdhD4MgjtI24dVsCfa8ipc/2iBi7ohT9fRZEu3+r4T5gSxL9SaPqWjCdAQ378gpeh5zgxR9oaZCB7vcBkTQsxDlsu+BmmgG7SuSWJzduzN66QP5Ob9rDtKP4tSXbpdvHHUCuQK3V6KUKrXFtXq0avbE3YGX9lTHEcxfgKcclWEPgK7T4XdzXO1f/JcJx2KANTpW1MKSMrnodSL8OJQuE095bU/ryzotc5QANs0N46i7EnBh0aNHfph6WYRsFTXrC+NoouDTcyVaa11ymuPo5D6Xs3hnIcpmPlIaM2YWr8Gng5UIGWNbcsbpR7VkkL/79ol1YFx9MIfXEBsK5h6nAFCJGaZFdOZMmKbNluFT2VhbgvxmAnBWDnltuIe9YhrMfoGZ6/EVL3na3ZfBaJDEzSJQwcZYzKK X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6200227-1fb7-4cf3-cd9b-08d93acb104a X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2021 06:56:47.9024 (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: m35QKK06oCR4COHOXlF/fnPDJ+rpCcmYqvN+SjRmuE8LbX71hqSc3QDvKmY3szJ+D8DKuhsdPSN77mPSLvFRvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4762 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 | 324 ++++++++++++++++++++++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 85 ++++++++++ 3 files changed, 410 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..cec1884202e0 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.c @@ -0,0 +1,324 @@ +// 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, "Handshake failed when power on\n"); + + /* Expected, handshake already handle reset*/ + 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 = 0; + + 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; + } + } else { + ret = imx_blk_ctl_enable_hsk(blk_ctl->dev); + if (ret) + dev_err(blk_ctl->dev, "Handshake 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 Tue Jun 29 07:29:41 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: 468301 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4683442jao; Mon, 28 Jun 2021 23:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztf32ZAAgggsxchurTeH7A2bGA7n3Eb7zkXdapkVWpNwBXfCsxzo8XFh5VViZcvTv3pEx5 X-Received: by 2002:a6b:e916:: with SMTP id u22mr2680048iof.155.1624949825400; Mon, 28 Jun 2021 23:57:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624949825; cv=pass; d=google.com; s=arc-20160816; b=oGKlT4/Wzybz0SlxSaGDhWH5wWIjcwrAtqwgsXZivt6NEGdQhPqAV5vHYgnC6zqrfM sHaAKri+CNDTYyzK2G0ucnjA7YkLX8ED1O67STjcvDOzwZtw5nqWr303uvaMyLQC7OzV fif2BYVH4UTF7KxTnILirbaZ04uOVFkZf5E6qUT3j6lJsUjBzFjpU+NGooJQYtaqgtwd LO0tE6NmwcSWNkY20DmNiP/yo9foU9yNfQgL6gOBzz4nNfn7QQ7kqVK6j2lMEav5w3TR l4l6SZcG6Tprbn0OE4cXdcNoS78NnTxPG7F48aW0gojfWH3kXcS8xD4h02xeRUmtrZX/ y5+w== 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=OhVvg95fN5+w6lTU1vVk1z1j5PydSHuWX4r5ipP1BB5pBV3ZJ17H+x6/wAnglaPVxB 7ejrk27/soVmPaov0/XLAATgtkPXqPi0Q+LxlOufDvXDyIXllvX+m+as9jXRoNDDD8ou K5wBykOzmCr0ryUe3FY9nR0PP6dc6iaq6HlqUZJ0SICcsrrvBU6Q4JqZWSg/mTsm2FZE Qki0Q4Q1ibHObKKPEJ7EF1ItMxAI0ErpYIoF5DlR7zifwj4EaHsVlhxRD/SFSMvc+xoc q+eU9H8hfMB9k9N/T1+toU+TDou5c7d7pDygZFVnsP88WbqI48sc/20exCuH2NgiKLoW fjUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="BCQ/5Xir"; 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 e26si17195620ioc.29.2021.06.28.23.57.05; Mon, 28 Jun 2021 23:57:05 -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="BCQ/5Xir"; 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 S232195AbhF2G72 (ORCPT + 7 others); Tue, 29 Jun 2021 02:59:28 -0400 Received: from mail-eopbgr130041.outbound.protection.outlook.com ([40.107.13.41]:64485 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232254AbhF2G7Z (ORCPT ); Tue, 29 Jun 2021 02:59:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lk7HAXrcgZym8+u8HAJTriGny6/CV16kYVfS0y92EOkMWYhwjcxK2HhRYZzsz6SFYnAcvnjBehh/TYIgzs5vvg6Ugp3Ax7GedBfiyQb+mO85NcwtD6HeJCbeKkFxM7pkONkzmDtszP/SuHhdXINPVFHNPwVQ4c1NNSzk0JVzdlgJa+KicLzH5PRJoPjiPC8C1utyb557p6doYMngc6rBn8/fI6Koait84ZOxz5BmrgKsbM6oOiYI0YUUDvTJh8bjX+jElC+cppjaIQ4ZhzV+metJRutvUua9Dn/q2ZgF/iJg2jhItD2Lve5PS9RcWZk8M1DWK4wHfIhT0B5Kr/abOw== 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=gcYtsGbv3GIZlRyYCuH8txQHaBPISVYhkxCT04ISHAVSr0QfXGtrD8wWWSi5i3dmJJ3Y5FGe+xU4WRYuXZDLitpzlJVTB7i6ZWBqGuBWFAPrw9W5G8Mc3M+QLQa+WQiYmM7ToSnAtgx2I6+xX/0NGQlnPhdFLczPEqe+AWWEEAFr4q6o3a/5socZRfd9wAgyJRBvZPmRDW+pzUP7KkjSPupJ+s5SGWazIeG+Ru9veAcKXwLn/jt8a+LwrhaHt6WdYf0cjbiyLBkcGcQQCbcGj0KeX04eXm7h4W1WoXSpMKjsVCAYhxW0O0SSzQeqIfAgf6eibghP4LGyKfdFUMZrjA== 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=BCQ/5Xirc/uip5b99qlFn7ox0uEiGG3t5lBNYDwykSPCUT2/FN8ICf14iP3vqS+H8qFdsTt8VKIr0TbZcbvmGqqC0CzOTuYUZl62J0roknIi24MlziMNUrKujVPeQPqgVoud1GUBJAz3I59DqblMGjLF5XFZViIQzJQopOPpI64= 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 DB7PR04MB4762.eurprd04.prod.outlook.com (2603:10a6:10:16::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Tue, 29 Jun 2021 06:56:54 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 06:56:54 +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, jagan@amarulasolutions.com, Peng Fan Subject: [PATCH V8 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Date: Tue, 29 Jun 2021 15:29:41 +0800 Message-Id: <20210629072941.7980-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210629072941.7980-1-peng.fan@oss.nxp.com> References: <20210629072941.7980-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) 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 SG2PR03CA0116.apcprd03.prod.outlook.com (2603:1096:4:91::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.12 via Frontend Transport; Tue, 29 Jun 2021 06:56:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a958435-e9fd-46a3-184d-08d93acb1407 X-MS-TrafficTypeDiagnostic: DB7PR04MB4762: 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: 4bRwS9x28Ijh6D7k5jzHm3Kml4+2EjpajBkrh2amNrziIli1fAZHfmgsVPSu9tvA2olzMaJvSRlPSoUFQRQM7Awpqd2+a/SHHcV8jr0VaYecgXIxbnZyGuxBi97prnild4Xux/zB+5pgM59JRnU8iysbF6MBQshkjLwEpiaEDxrh6pQHK6BEegpseP5Ij2/M2aGNGz9ph0RoQ9qGqGZvgLKLO3ienNWXO+eejzbMz5GD3NKnz9qN7Ng+SFiX2zMOGpi+2KOgWEjDMI6NKeQqSLeKVB86cpVFUPKW0H/+Vx4vxAipVYU8uz/V+sTkbikHmbkoS8tiFjAXtjNbVa7m7Ru7ofuHrrbduUwRP1XIMqu441A2LHn/M3BTUEQoMr9ALTwXBNhexi5MuBEu7eH3IIMKF3MoF9rL61eiVO8/x+9jmWlYuh0BjsUSWJaeiCjvGb4w9MqfDKvuZ/BfgjebVpler48E/lX4Kq9Z76B0+utUh9heljimQGfWiU9SiS2TsLrkOMU+fZfrmq4Y98LCtvq+o4H5hflNIEnXN3exBAFTIFBnHSoZkN0p3q6yeZUCFAws5LDE25fchWoICmOlgZm6nMoKcnBJ+4Q0sNx6bLgNytAxskmUStQ52+1T13AkNCC6bp3z2OBscuz8h2YCJzURPlUkP51r/bMT9B2cM1q/9DjAqQ8wbrXRyR8lawvqMFAB6P+lWf96xNNpi2mzMA== 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)(136003)(376002)(39860400002)(346002)(396003)(366004)(956004)(38100700002)(1076003)(478600001)(316002)(6666004)(2616005)(5660300002)(66946007)(38350700002)(6506007)(66556008)(6486002)(66476007)(83380400001)(8936002)(52116002)(8676002)(7416002)(86362001)(16526019)(26005)(186003)(2906002)(6512007)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oWmQS3k5Exmds7XkAs9BSXyImN0Ih02llzvB1Q+Hty3PVkowjmcolg07gc6AhULeHLGQ8FToKtNhWyC/j68pUK/BprVrD4+yAGsUu269VCOMrsFkHL1Gi1pRdE3Mjky6EVCouSphExbvILFmnKpW6F6wJ7uQbuWG7ZUe7ipdkKrv7NSqbm7heUVTmBqGvBA8UT/lTJMSnSCMSCE6egV3P+GW+Yyt15596mgEpMm6Ek4EI4SwPGlw9BBmHF2j0cLZ1FPDLToHxoRhs+3ukDDzgigFI/KjSfYWmCW0WbxQVIPXPUQ43Khdg8COgssR5GgJrCbLpQnZOosHC2A3frvJKbbtTSzEPHIwmFw9XI1A447sNvCVjdidW4l0kdIGAlyTm2zeiYNkz00y/iBx3jeX1SgdRKPeP547j9/VkvquARy2Q3vQcuGlpEgckZ7EInEhgjiF4tnDeqcgAjP+Dge//wErueDy8IYvQeb+5weX71elsNm7yMm8CYJsCQziTh4lTjQG0YNa8yAD2N0vn9SePX/YlkRsHqXJbuxv78NeYnR/twxJGHboFMOnZVjFJudKy1xoOR+dDkxy0fxJK0X3p/KzmoxOPqW7UYKqpjTygdDITP4NS0Od5bCavRGU/pII/7IPvqpNi18QGxJZPr07SQW7Iu4dZH5WoT6seWcrMpyECny+LlbdHeI/AR/Bk3lyGeReOgwlVbzF6zStowN2uFHhvm0ZliDIy/Byyd8fxK8tlA9lPpU79ES4dfHIyfAn9Snz/FdlkF6D+FgARF+gDMi8KJyeG7inuQVEOWi+kgX93KLYB8LZ4zRqjgqvf5Wb1A/EeLgjXAhOTknFTuWs9QkMhBqScey4acxKZi9UMmcWbfY2fZ0EgWslHV/L8NN2w5kOx6y/lcaHI0VUB1UFJY8BR7kz9y4qvNh87LPRPkAuOtiW1DWfcmJa+elpGAQ9CiKpcFQqiQO889VM7rRAs4RM2ivlc44Se1+NBcGlDPwvgSiiyOCtuqEIZpX1+41+dRmtzKt5y5uiJWk0I8Z7dhZufXdo6sZVsmaOWFJ9v6A+lBLVxAFyJ0j12dXNu/pmDfR+Sz8DyXLDLjJO9prQkvIRPvLTE74Vptr/Da3iHN6gmNpbmrFBYCfv+woyqTFaE7EuHRe/daPKcTrqb5pWqefb7vYxLJ5m1qmJ+SxFlka/RL/47JsCyUSILfk7GXpx4IQPTKPFbSfUyouAaU3iGMzzFobAyzAb4fb8lMkvxjloQ/345LLFSCndd0TOuy4lK0w4R2sXXAy/nfMdK5WFel24OkHMcHxcqmCP6w78Yc54VEUkjR/DjX4B3YXNDLp6 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a958435-e9fd-46a3-184d-08d93acb1407 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2021 06:56:54.1116 (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: 5aajHpR9Ugfql1e0h9ts87uXxJH8UDgfJR/PpopY0iaqKPGyMnDGG7CTgWmy1axQI79FH4uqaNytqMnJ/yLV0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4762 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);