From patchwork Sat May 22 13:42:46 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: 445904 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1839938jac; Sat, 22 May 2021 06:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2+Q7n53wASqMB2ZVj7v5EFcWP+MWwRoc4+ZneMUL+HFzmafBIWtnFP0jlSrpYT3KXzsMD X-Received: by 2002:a92:d48e:: with SMTP id p14mr4477358ilg.33.1621689024857; Sat, 22 May 2021 06:10:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621689024; cv=pass; d=google.com; s=arc-20160816; b=ZdyEmDn9I/vDwdnicZx5s2JCHsnePvCFW2VeOrJ1OT+YrBBhQ9ZUFGDIVSa2+yaA0V s28UfEsHoJ4v6dwXRgb0xSzsb7feRiPpoJni5j0LxeuwgVzdWHTj8+P5JYIm70aRAujC eU80Q6xst+qupTGMgYTyXr+teye+4tJMwVeySgj8nASOEMLyZb7CVfQgE/G9wvFMW0BW SV7CTihWcI03kSIJ0Iz0GB0qfSe+b2r6c2bYnkgdvNuGdLkEkj78wwl+tyrJ2+e3LRhp lo5QiIcStdhYdwe3Mq814Jcd0ZAwZ1BoBeJq1aNBLSLmDEmHT92m7WjcecVzRsjsMePm yX6w== 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=G2Nh3QgUu4KdUphbaqUrlIiyxL58xddwTbMEDZkCx8sJJGFFePua1NL1F2mmh+Uq58 lMf/OuhenfOaU/s0TZl1w4YlhPRNKbpjt9hgsQmoRhSaZmC16Lij8ii+vG94PuccRjxI WoHV+1KCfVeUpVTemg4l7eD268LBRKDMtIKT1rklB2bu1KOeC2KFn799cwGUTGcGfC5l 9Pz/6fJaP7cdL9Oe/WJ6vUN/C94siAeqI+c4c/poCqBmckVXFzoKa5DChoRdrne+tu92 1KnGHhTvsfP+5qIHPYJDEH1X0G8jugv5AzVwtCZqBPkT6l045bpCr2H4xtQzj+WZQcfP GLpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b="NgZHk12/"; 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 o1si7071993ill.15.2021.05.22.06.10.24; Sat, 22 May 2021 06:10:24 -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="NgZHk12/"; 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 S231152AbhEVNLp (ORCPT + 7 others); Sat, 22 May 2021 09:11:45 -0400 Received: from mail-eopbgr60083.outbound.protection.outlook.com ([40.107.6.83]:8967 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230431AbhEVNLp (ORCPT ); Sat, 22 May 2021 09:11:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G0XO4wJwZqF+v+9hUu0PDY9ixB85a+NYky91aqtE2fDQDC6jXIRDarhbal8yClQoZoL9tQgKplzv4xHrF4iXW1cnZwtgSQFFGQ8pIUKKbfCYu5LllqBY/v2Pf+UZa4JJzLk9PgJDenTyfjYMXLbrrG3tQKV7lvr23eVmttsWTjB7ZqULoQCcAhbuqsfP0867BNjWY1xPm9IC78NGAfKrbXPRQ3HtS4qwCwbXzdaxEHV5UJ97tCFheKSTA6CK/bSdiXn3A7Yv3TPTLNM66zAJOjuiJv824RYnOw/9YZqSbIjtdB9DNG/ErdK8EYp0B7I2KVi1fZxZKqX5j/SODNyk2w== 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=DcNQ9QgIfelV635uSpa+ta3bKgUsdBmpFc5m2ubrGCx9HrPDhkOr1SlG5hyB+ZqZxAiLqbYwGJ+qSDMop5RoiiOHam3OwsG4YHOB3NzBS9O32laFiGJxIR9RhzG8mnJnxXIeZMp2ZRM8ptZuiurJFe1YlIctaCJ0VKjLnDUq2oKEDKKb3WGO7hZPBV7bJgoJ4gSlLoFeFu1K8nMuJi/WjujQ0+PSOfxlfBLgyG6jrq5/BEm5Uc9lpuei8UfjUC9J7fDzTcjK1Q06nJHw/pbigtVWl5/c8jNyzBJ2HMvjKqB2Iqq39whbItvM/WpGrZLxbfxPVlWJu1Ik0kAvt3NC/w== 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=NgZHk12/XFBcfReO9HUMF+JjZj1Hp4eHQdWMDQWvji4JWFBvykrmqe3a+twgLufxqoeV4qCHSS4RDsynsKsT5uRxcy3jdZ4rgIRuKNqnVwzh6nkO2qEkl6E6bBP7cfi5z0dzTZo9azazofJcTRWAOK6c0VenvpQkOnl1lloHHsk= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:18 +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.4150.027; Sat, 22 May 2021 13:10:18 +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 V6 1/4] dt-bindings: power: Add defines for i.MX8MM BLK-CTL power domains Date: Sat, 22 May 2021 21:42:46 +0800 Message-Id: <20210522134249.15322-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c3dfcece-6e45-4183-a470-08d91d22f1f6 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: 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: o+kryYxwBZKwCNF4M5OynlOt5nsZR+QOOWf986XSt3X8v97erm0NDVi2bQt/6XKTz18Pkl8LhCY3DATM7hsyMjy8MIjIHD1DJnKtJ7tgnrYdsit8I3zksxVcuGZx1D3G1zl/Ayn6/IKkIBk5GNmysoaCeOoB8YJKitSEug5tXoRCwtiaujnvh/Xey0TaWxJuoIn3Y61z8jZTd8mceUYu8DcxWwaDpRz63/ItuMCfTizlJuNSmf8oBcpw1baX6ALZVcEVeCCY9UusfylLoxsIN5A9BApKZWsiwHG8fovPNsfF3DuvoTHiIqUG1cOSVpcUiAn/EDlduXLw2dLYSxkmLmL8B7K02KwSzCCDFKKWlcNTRnToMmU+8ynTnK3ozx74rz3PBRlcpb9CiwPI1Zp5dOOyEw++bvebRGglajEHkjCtmmGRbwv2JdryZCM6p6uZPyb20pAnOFFd2DjiIVLkXschI8D8KiKgXt1xbWs/tj+9Lj0CbcC1wDDDchLheCC1GbJLPYVq7n5ff19p2gpXfHFkGuoPCxtv7Ph9mETZfs3p/HN8U/gQUrKhTbE6TEGwOug5kTujeeHZNlp8NRb0e5QqFmZciDh+AHOHuthGzlwpPcC4n1njT6HZJXtV3v5iyX92wwH50BMTQ+3Yaue9jyvFtDdQzRBbIS1we7k3A18= 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(6512007)(38350700002)(38100700002)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(54906003)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pM80qOQq6VQFnlKJwq15aozBB3ksQe9EfO20ubdGYj76z6ILrbjb7PCGuB2Ik0hgisZb0ppk6oQBrLtAO8qMmmMWXIQLxSeUdeiaYPtNCp6G2kXrYfchCZvmYzj5+b/7tZpWf31Lslp0oWErhc1+4CDtoXFWll2nXGepma/GIzB15HtMMIl8HMhDoS+4qMYat/+H1EtltEXmOktiy9Z3gZ7LVjyeiI9AP/MDCSCKsZE98h806yqMpJ5P2LIsjg/aPG617h5dWFtUDtkIVyAJ8gkMNOEjHpH6lw2F7RW0K1KV6vq7gTal1CM7zL/YKb+J33yCPImRYTYNZI78X22kD5ZSrLFlDu1AWXBfv9tC1Hnt4PZxk3V8tIjGizhboZG/wZOCHOo3cX2q/p2fMivY6qjskYmhQ23alwo/TU2pD3mCNu3TSZ12QlDIfpgjmY5JYsmFv8Si5H/v1v1QyEX8QNHlm5YxgErLOKNsd6qx5HMRaJVebwn+fXvOP24opACmyNryrVFMHS7vpRn5t11YYuMMfawNbtNvWt/vitA7/rpP5VGQaZ/5A9MA7CmQUWr/Xe0mHtMJrh7Rhzy+wpie83eW1V8zvFNqsy34hftF5/tyZ8sMIgFcd93e+SlcgoqidmaKgvNnNCgNDstuFRB79dFRoER2JPZG9D1t70VRll/kKYSx0f+IKFay8HXfbiPBtYd4wzvL1nQQ+FxGLCtwGyaJ0tE8fHPKQzXzG4oFNV1sTWvl0cCqlraerGix0T0tcnhjddYbI1Q4zBnnbxqMzrQdYJZP3gGS+LP4ZmvFvGbVmz2LaP9adRw9TLN4Mv9xjI7/lApJz5KRGMupBVgXyUHN+iUpvgqqRCj7oihZz/LmxubFsauckJk67ExeSAp+OU8pdc7Ehkg6Jfsoh3YhaQ59Sh7LtYIPSUMXxVHYz5QeeXTDNIJXDdvqymXGipT7C9ZYOrcFO470PYzGRaCfB76lv7qMxlrdLBddAevdmApJXQSgDlk6Xv40OBb/4msRf8FfxZ4vEWEXyRbyeZbxQIwcyONCT8eXMujRRe1iKbB84VRAgEhlcOVfG1ArITQBW+0hoELVDrED5DYjUkZwZl22b3gNGD3IxbsgxoeD9B/Pkm2RYjge7eYjHLkuK4oXaWwtS2MbLRq509ZHcbWB8LaHNH+0vlg8kSi8Uqta1o8nNsQ9saCPYZ/aAZGEO5+pCe9kRJ4w38bFcxRVdqb+XgJsaU/dBlxFTVMClixi1ovFhR3fDP1K7ut40rdtutT4SvgJi3jOW7aLcRiUWCSgepX9g1F0qIJf1Ok4hQUor74IsvWu/QsHcvv8KH7bstqZ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3dfcece-6e45-4183-a470-08d91d22f1f6 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:17.9070 (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: 3fuagunKgG6hiH0CR2N+8jqyFSR8Rej4OuiQdrre2OJ48TPzZspI/QRssZxU1aLXTgFq99ZOQ4EGAhtlZpv3rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 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 May 22 13:42:47 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: 445905 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1840059jac; Sat, 22 May 2021 06:10:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSehjmyp4+eQopLctHhq6YP8J8chCMeeGeQttmz0mlS/mB2CRFsFMuvXVMp5tO/b5LtuJw X-Received: by 2002:a05:6602:72f:: with SMTP id g15mr4989189iox.5.1621689033708; Sat, 22 May 2021 06:10:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621689033; cv=pass; d=google.com; s=arc-20160816; b=JNbH5BD2rCPxvQSpzeWrusXVN2vKFJQwzbj3ziA5rONjVXyfxuRpXKnoBhygKz/MtK rQ6B2d8GRAl8Pj0sBXTJsxpyFhlbj6BbOGeI/8oxaPdTucHL137HcIEob/BCXTjcjba7 plV3IySLqoVQSF5O9ZbGxvAfF7yCUueCgb+NxODiQSAEvDPblxGSm0UGSfDtUtbbXhIw lS1hP351+SswJalsu08BvvSZMkFu+hg9Y5p2OI/zIxzjoDMVlehQlpf1z/C9jTZzLaW0 8Rd7x77+MGw1aYVCIfD1lcizyEySUrSe6YjQeOyjcak1ABJb10aE1Ivb9s1/1JmYGHMj lQWQ== 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=MAZGA4R/NnAfUmPkiuRM5YlkSEJHDTc5EMnZ4M8W2h5NKIWm4XIyKcdrGgtWTgOu+6 ofD5a8LttEIwME+2wY3ClbrVBjwyw1z9O9Zl5+z/SNn0NLeUF0XDwYIJMU4BjqOTPHp2 2nw0xrISkXbflI3VP/oavr9dp53TfGo8Xrfhes/KZPZNxOQRPUX49hBMMOTqfTMGogQm j+yF3DEXfXvXHPWqM84xdu+Ot4g7r/NIwAwX5fADIqDlZUa4JTKuP0yg2pkEVwkNkzep 2QJ6/56RRfoxio+eHYmCzSANSBmIdbBEHYBf2f+i7urDMVJWDvYPI/Ye+pM2V8mXcbhz Z7DQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=ZD8x7nSC; 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 o19si8294785ilt.69.2021.05.22.06.10.33; Sat, 22 May 2021 06:10:33 -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=ZD8x7nSC; 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 S231193AbhEVNLy (ORCPT + 7 others); Sat, 22 May 2021 09:11:54 -0400 Received: from mail-am6eur05on2087.outbound.protection.outlook.com ([40.107.22.87]:11590 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231191AbhEVNLv (ORCPT ); Sat, 22 May 2021 09:11:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YWj+8J7L+Mi9Tsz+OJmNl4m5BAhKCz5WJl1ARdbzTHyyvGRAAybswtic+2nT4Pu1IHFXQFPMQ+WrEt8GSxZPd+hOliQC2dB9KCwsrDnO0mbKk1PurbLw/Q+V05FVCXEXENcII6nhFRt02OFIa5ZERQ59HOOr2toXOQxDHN5xKIdRlE0JyfMHQdP1+hHNGK28dKWk9q9KynVLExi1aY6N1oKb1kXHhnUix0/TG00pRhKfONbIttaHyDJFcW3HPfHai9G2h/OTq30YCD/AmPnatOtKGg3og9rTc2dDf5iVXQQ86wYq0Fxp0l0+u0szWiBswtxl0cAVASHdRDABwEyyWg== 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=coDMGa46dVpkH1NclrBIt8sOAU8pyGelISIlyE+tI1W3WwtznLWpXR5Odp4WeL3nP7c9KWCjxe1qpGmDzV/cJ+CeO5uVQLFy4z87gox2T133ZjSX7aY/6TMxJacg8rh0ODGz48/uMcdFj9SGHpd+BFEO5aYny8nDJSBLpo3NqdL+I6MJWdSDBrHZyLesz/oAK1MSI5P5D4Wn5bLT4OZEMQNxMJnB5WvPcwteu46sjLgdh5Bjp7NzsGQqDjlWS34NKx24+33o5fdPkfPELHSXuALr4lRdxLIxvil589RmXpSQg0lSU6ADprUsx8rpbUNwCJ6BEoO92u1tlU+lAKhpFA== 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=ZD8x7nSCRXVK+tHXeKiHE2ncIIzZFsdfTnsomqO5ShMzV+acY72jBcMBtLvh+oRpx8FlegDCYa5exCuNdigdxxW29cfRbnVCaJ5PCmxN0KnO7f5BDHlUNex4eOXCTfAAOKIjNo8Grfcx5TIBLZ14a57b6ClWaqmAmKfFopMRDpU= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:24 +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.4150.027; Sat, 22 May 2021 13:10:24 +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 V6 2/4] Documentation: bindings: clk: Add bindings for i.MX BLK_CTL Date: Sat, 22 May 2021 21:42:47 +0800 Message-Id: <20210522134249.15322-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 510ea44f-1763-4375-7326-08d91d22f5e1 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: 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: BzAZgGVLPayoLYqsh6uInoPWT1aR2UGKn67azRjqtftfVk4csrvL6Y895MbSWFp1uSjmTYW+HY+y+RJdrn8BNufa2urZSAxx+XJTAaL1HbVKkoDDo3pCVMx/FMvVhHQufO2L2ggIbufmV4YtL1zbyDtEK97mw4q15PdCaAMuKo9Yj5SFBtBm9MtIzK5T3vRduA76hglAcSb2hY2VjecuayqFHAaqqNvblBrPHscm55Ol0yiwrXdhLSDPHRHHCvZ9ug/xIRb+JxCtjWz44wRal/lYVw5LjM/IGZq5kNiHoVtSfUVrkeZG6Ng4PMIzcAmkOkS5+OqsJpCfmwhEBn01zaHgi4znwZvmbgKfY/qAenFHiEJKtQ/h7BZ5Pz67HyX7x43EeG8Ib26VP1gvucTMClYHtdcB8jk/lVDZ8pRayzOLp4YnHq7EH1d7iJkkC083Np3jNn5I1VSxhkOQ9ylw3zlQVsOuI5f5w1Kis7ZdXEa7tZRuxkFxR87TB+rAMVoJKqHhdhTre0FNNbl847C91eXhhPilMvQxQAGmuZfYadcyFPn/iFyvL4wC2s/PpHpIA23W1MQOiVBikk+EJbJkDULYmlyH5lM7xXYrFNVXKa31k8rn3OQ1u2rapBy09N3L78NhEVZpN29yCQL1S8VnGXvHdXHE6EVORgN3SgE2V00DzAVk2sTcGcwxPY1IEJ7sKwS2ONiJRXEV7knP4K6EZ0A0QqNBivH7IQh4vNccdyrC6Ew1Av2cVrvDfeGm5tMhbeiak7LbmWes6IOzzPG8Tg== 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(966005)(6512007)(38350700002)(38100700002)(83380400001)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(54906003)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oQhoahm4MXLxDJiyzIXojcMpvOQe9HcsocPonkNJSDDyMmwewP4Y8DbiPV2tYT9Ra7ucPLpi1k+YcsATC2vK8f+WnqcZIytHHbMPWU4VTpUeVr4cEM+f+x53qGBL2DC2ddYTGyIYC3pYWAQFx0O5sQjWRRweHkiRprnM16/pJVUIPw2WLuaAiIOF9q1MGS2CpR4OTY14T2W75wzpbtqi3OIbBzv5l3c2KAsd/GWXpJbqWrjgIgf2slBADaof0WXDNeHO9QO15GGWtcqi66oUZdKQySvB6+KVTBo6DKrVobxRN+e06ygPGTrfdfs+EzU4THFjZ5kJzGkx2A5RB51dpN/G0+BXNl+1W1GMrVwMGyjlbvKELpRkcnMovo6alIdzeceCVNY+7tnmumoxHf4w/kcdZKjvAC5sFm5nKHInIYcsCShCDxicfrtaaTV/JRzEWey6Z+zGMHIXKrxVV54b7bQayPPTOTCdsQJZrhY+FbqR5TSVEdKvg8NassaazYRtxAme74ssMFEmtzj0xA2Bhsi/6VyHZRc1KBYCvODVntIjqNjLM6A0KaPkvH7HWYn+zwYG6LOh28jpMoOZK4y3mZAIlCTne/FlM/6s1Ba/VoOyiJFZkr3Wo1k41yOTIGBd8LXdL2y4r7ayZxB//xC8jXYpk+f9P8CpuWDR3LXjtDbFRXSV+S99GrmjdFF5NandHKE+PSSsSHh6QtZmmuMhCuR2SqceKqvTeUu2utfRFnthb3SlgcMhcK5Iu3UQ5Cb0NKiheIRyhL4IDvEOxideBFxp4Wr8liQkiP36Ad+QUYmRJtzxCY6/wHyY9zKMHOkScxHEDxcF25v7LHZYgdSt4q/j84Xuy3ZiShiJeR1B508h2Jia6p/+iD2tsZD1aR+zm4OXiSiwK0wmCnmHOltQA24dZx48vYP7IKfm7OKIwUp+mn9RvQyKIQzU2ZjbtZuzn8rpBS6VWSnjRfTE5HF8toUhLv9CUhXi48R7RfdZUC/lcXnD3GTMBz/elYxQvZ6OWUOvTfVxki466OoZQh2uteTs0t6SE2FE5htKXr5cBrC7xjLeqmOwdwCa4/kIhA++YwaVlYEn8lzKu0eAn4DxaB0aBTrA2Y7+2gEmz24hcp3OdVhIZGmwSLurXnliM+SfA3IVBP0L7q/bGTHF7BU10fVTaN3Cprnw/33sHD8KhgMFei1Xu/4uHCR16+rhOk0Yv+oDil7V07VluCuCYK2775qrb9ZMijywRMV5aB6N07w37ereF9W6imvEGLiV0SK3VGE+h5HHqKTFW+HyUoBbUvJrvz2jEKXJg4NoEOooJR8v3nQjIcoOEDtGryuPBDZN X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 510ea44f-1763-4375-7326-08d91d22f5e1 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:24.3671 (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: ERzITLCYegPXKmt5qodDyKaoOuAirqA8RaEr+E6wH1ZeBTtz2z/ZHlU4L4Uigkm9hy191CcT0v78lmSENqMSXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 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 May 22 13:42:48 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: 445906 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1840111jac; Sat, 22 May 2021 06:10:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTUGSYPxIBiLDeaYQN0QgRrrrgeUfvKKm/lfaJdBniLZBlhjcTGclsf5K4VLH7ryEfT64F X-Received: by 2002:a5d:8c82:: with SMTP id g2mr4620834ion.34.1621689038012; Sat, 22 May 2021 06:10:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621689038; cv=pass; d=google.com; s=arc-20160816; b=hDiMQfDF6Bpl7eH1ANKfsbkDIMDy++or3gixpqB/SlquyRzbaKQymY+wZbzMiECo9K 2qJzIEZ0dTXA/hgE+WKs0H1vstHAB9vPKfHVaj8QXPI7GGDbUVzcAWByNO0fNzzKgQXz Ef5zm2dByUnBR/fP+DrrE/XGXxvB9mO8Wtxdk7OMLhX7a/v2tI5rCYQeV/rKwqWOJJZs djB2HXR0NjmK3b1xLoKsCV9lBzuzSZf/kvf+sGQf2GYWuLuxY9MBn7vLecSBti2+Phdg ofd0I5hPj0FkUwKCG4QtN4rAahDG1xF75/pc6sJes1zvRa6io+Tc6f04QIpbbDTMghfV DXxw== 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=5qwaDupzmhqcQqkEIrmxTz/W4DsI6Ku2iN63KCcphUI=; b=W9u5AmDmAjcxpJUt+0WXqmGv2bLJZQMphvUv78DWA2S/pEwL4xob0Ptv5Cg6eXvUzh IRclQsdFyzF6PeIqsUINuusToOWx98x6OqORM8Xd3seLDGHETxPwNvocfh2MNYOvUGbG FqArVW+BGCjadCtARE6y4eSAXHkmrT4sQ1pVP5AKfqP4W/rvi3v+iUIv9+thYpgstENW U2oR66K3ly5Lm7KgySN2gf4bBLGw+a6yxz+cD3elRlSgVpNii4dsOFFmVdYhzCPKAtJP aX+/XvTLg9URcA6K+K+JePackTLwNoHEVr8xuG+cWW7ny9DgjoG8Xvuw7d5+GkMEC+M7 FGrw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=UB9BgjZ5; 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 q186si8142137iof.83.2021.05.22.06.10.37; Sat, 22 May 2021 06:10:37 -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=UB9BgjZ5; 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 S231203AbhEVNL6 (ORCPT + 7 others); Sat, 22 May 2021 09:11:58 -0400 Received: from mail-am6eur05on2078.outbound.protection.outlook.com ([40.107.22.78]:41441 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231175AbhEVNL6 (ORCPT ); Sat, 22 May 2021 09:11:58 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LQRNnCT5GbR7wvoudEj6RpXUlxlzC0T0uHNxgR7/qW/LSLDO4saR9HR82FR7lc7u1ayH1ZmG9o2bTd6BYiDhgj4FsyH6xHxgJX2/e5OyCdwQqeocaI3FWDovxiAwDs4Po6pXpnTNxz9XoNhnQh0olCR1KYY1BXOwQvm287Apf3fGdFySs8RjOkz2QOlUFk4IqkeRB85H647CBkM6HxbOAJ1yCqd9yN2pHEE/eqvJ9M+NY17huQO8xxVLC/v852Ah1VTgnYw9ADbDXVOJ8dFO247EUCH9VHQ+r5Rg6+xlOJh8/UsLBu6esnEUVzL330BylU80grUgjyyg1hHdVHBmcw== 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=5qwaDupzmhqcQqkEIrmxTz/W4DsI6Ku2iN63KCcphUI=; b=eWivciaWh/WMKEjtkMjqAh0SEwOGn2al4/qBYZ+YRuBCP5FnJH6vz2s2zF7ZiKqba6M/VsmGmY6KOjPPy6j14WCxiIWaG1EV4wyeAT1YWiANYdIFFXbnNxfOGpq3cjADqoXVTn0RU0c8ldi62cskUlGsolq4RjBoVBZRvxAiyZ7zgU3iBr9psfSaIphnhY2h3qfHE1A9MJyo2BSaPCS13PrkGlcfNUbcnbsJuPBqc9bKHHVp4SGWHBM59i/q6vWIj56meY4BADeZHPbKgPNq8PQ7MeRpCHVGpC4wTplMwRaOCXl4qsDKvUdXM9CX2AXvTlQpqhcwqdSCtbZ58AHKTQ== 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=5qwaDupzmhqcQqkEIrmxTz/W4DsI6Ku2iN63KCcphUI=; b=UB9BgjZ5XMbYSAXo4ZD8UcBGW8fSZgrB6N0GNC6KO5XEYQ/GynoiiMcODckYUKq0ptC8JpWSrLFCJi1FNT9Yvwbvt7y3tgjLPqDND/0tYG5TjOyh233tIoYw76wU1/3KxPDl0lpyDe2/MUnIEJgNHO7fsBUAhPsjw2N7Xz10zz0= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:30 +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.4150.027; Sat, 22 May 2021 13:10:30 +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 V6 3/4] soc: imx: Add generic blk-ctl driver Date: Sat, 22 May 2021 21:42:48 +0800 Message-Id: <20210522134249.15322-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8657a16d-e049-48c7-ede4-08d91d22f987 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:632; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JAismw68TwvayAhWDK4vh3sKZNZ1Mtd3W7SPjkzmbl8oRxm72kyEJjSKF+/UxJnP+xHhhkWzNU81NMqj3ZZ7tmAH8AlDsEEoQm2vbGT4gx7eGk9DHLOnXz2nfTL06oh2dasiwSCFIDitN4RPoOSkhijKr3L0AMiu8CyoUMyBJ35DT2e8Nb/9eszwkRsVfLKszWbs+DYaOqTgBM6+uS5/IuMFPEzG9tsYahm59AmfObyO75ZNzN/hf1yqq0+PipzqRpoT6rUGAqiqo2AVzfPnfOjITH9b8dAXpdEfm3MzBHtwve6xEsarZ+wDMB/HsIOBwu06CdfYemMlMZNE5VdDEKJLHaKYR5BQW7f1BJUMc2oPRqskGy9vs2QwGUCotkEybxRI3a3kxQwID6B9atfb798zwPSIJ2Z9ZcdMPK9zvMCRTR2TOSCHtZgQMZp4OjepUkhZTstMNJHU1a9r+OT7FIEHISg4JCNJnb1gk7YPU6KLqUzZzjePjNcXSPqRumHgdsLnBT52sokzpf1Hq4TNdr+Okw5JpM7RS+NLQzCIOP+KvIRrTUk4y0fwPMavglFFdPqPkK0j82PwSDR8zDlDvWS2awXU19MtLCMD75KaKdbJ8Epshj2bs2AED3BwZKcGHZvB9kbbAN+052tsTiAVXzwNuwWou01oUbURgAhsIqtRz61UI0jQQcjSEO1/hjCX 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(30864003)(6512007)(38350700002)(38100700002)(83380400001)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(316002)(86362001)(2906002)(6486002)(6666004)(7416002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7DJGqU1+tmNdHlGzzYDxXTvHFlh6hyUZq/NOKnmkTngERZ4FnCM+ySvNBDQAkiqIVFMFJTwx2bbGwDEc2jTeH7/QgbCzL4r2Fynp7B/ouz3wAjLSZLOerCngvRDvtzE5QDjrZ5S92Kfk6BYSE72sr9E48E1r4AZftunZhFKU1PyhtwnVb/8EyO+0nQLK7AOCVskUkdcsUwsiYUTT8qIU+LrggREXsbuKd32ZzjED825xC84HZzGhlbI46qUKv6Dr9efV4LBnsKOxNVLYJI4vXzymZ7lVnCFG+mvnqMqjT2iHotbldjzdjzFCP19yXTtREgTQyngqyykQO9zPMajG6jElI1ge4ivPFpzyGpF1P4HE/CRpX8igHQCMQjH6STA+i6KCyiVNIpKOKPi84q7ELCrHAeS3cCtCrEpD1mcjeKNXBmXIqWuFELPXWtO2wY3CvV4l/6IcLmYFyiDWQBPJZvMR6e27/KZdnkQ/Tx7cPr/qixWm5jXe8dcGXaaStIfFYRLeeIu3V48Ubx5hPy0hIIlTU7w1KCokAi2Kn9UiOFxkSspq6Bvrj/XHtC1RLH14N02fTBuQEwyAtJxsJtgK4eX1qV4xmbfOTY2kvnrdtlI5Uv3puMWHusuZpW0DRz8ku2WFEP8A6KTww8y/mcgq4nxEgEL5oERvhZPzpEUEPEpl4TFDW0Kwbi0aH+7z7zEGATwh18lqdn78KBE47QAKOMgaP5mbynm/kEt9Gxkq3TavobV5Q4VEOsCyf7UOvpupKl0aW27A3Cv3hbNlotPm9ek93/a/44X9AWjhdkfvZBqCoLz5yb31uv1QpD7+witA/YcPUspFwfwxzuBAV0TLCQIbhiMhoxZMf6Lz5SfNPGDG415dNkdHFHhK8DuRH/rzrem3RE/PeJSM0AfBmkgu9Jw+/FTC4G/D9h1/fn59QBmEykU/DTdqWAwF/ClSKXRYyFyoq4VSue8cneJaNmr/So8NwWPyS2Wb2ewC+KZFgxoLmw6QXw8G/+7T227K1EAyEwEDyllnpwH+FxWXniQ23xENxY3B4UJXUhS6KZGWTuz6nRYOfXBCH3cOqJArhyAI/FkAwYQaQ9TB+yK2gwWGfEnsvgEQV+/lPGy/GC85HbSYEMoDI6+SSBiELo/5jRnjWnSB2QELqqWL9DeqUStdmewpRG0IMyFwWTGJwaRa+vXQpqntzboos5ojpOuc/ltMHkDWjpXH/4m38qJN0pYxyb7k7/B/HYfa+xCo3VNPAdnSVaoGoJNtZCxH1+iKP5964S0EF7aueAHzQqqdiGfcb+TRJ29LSJo046Z4iLcRfpDeln098YyusYZl1oFSv7Hn X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8657a16d-e049-48c7-ede4-08d91d22f987 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:30.4963 (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: oTH4zo4W47BlsTBdIP8KqTmvEX/LAQOvNNvbfZDRrB5oDSyy16E9CLi7p67fV1zkIFvhD7PuZkHV9K5asLLskQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 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 | 334 ++++++++++++++++++++++++++++++++++++++ drivers/soc/imx/blk-ctl.h | 85 ++++++++++ 3 files changed, 420 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..8e286b8ef1b3 --- /dev/null +++ b/drivers/soc/imx/blk-ctl.c @@ -0,0 +1,334 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2021 NXP. + */ + +#include +#include +#include +#include +#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; +} + +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); + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + 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); + if (ret) + goto disable_clk; + +disable_clk: + clk_bulk_disable_unprepare(blk_ctl->num_clks, blk_ctl->clks); + + mutex_unlock(&blk_ctl->lock); + + return ret; +} + +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 hsk_fail; + + if (hw->flags & IMX_BLK_CTL_PD_RESET) { + ret = regmap_clear_bits(regmap, hw->rst_offset, hw->rst_mask); + if (ret) + goto hsk_fail; + } + } + + 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"); + } + +hsk_fail: + 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)) { + pr_warn("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; + + pdev->dev.of_node = blk_ctl->dev->of_node; + 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) { + pr_err("%s: invalid domain index %u\n", __func__, idx); + 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 May 22 13:42:49 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: 445907 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1840191jac; Sat, 22 May 2021 06:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTKBBcgBfYG8Ud7M7Tx4OsKzcl0RBHMMWi/DTTEgnqLNfVvKSQY8cyAh+7kLUJiIRTe3cG X-Received: by 2002:a6b:f118:: with SMTP id e24mr4996402iog.125.1621689044467; Sat, 22 May 2021 06:10:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1621689044; cv=pass; d=google.com; s=arc-20160816; b=UKIS4cSsALSu/p93/T/mLmaStoEZ14Iq3JJLmDP4fMsDK9L/qrB1PWN/4KBwEe7iC4 kwSHyqbFQXJVllQcOn8JrmGWG8kxeAEgOlDLpXdRr702bvlYjWFV10AUyvpLrYajnOQJ zQn6iiENSU3/aLzHPfCNgctgbTn6CMDG8BjSbYGj86E7WFaRW3iesfdilhFUe57QGaT/ 0V6WlO1ihYj0xsmw7F076RpaiMrw13Yc4oA3KuhyNuOHRhjdq0EWM3xilWCCRfGsCPCa WjvZ/ipPqYuMgjCgAJOt11rqzc/UZlUu86Je9kAU7rbgAhPa/V9IPy3uCh2bJHozgVQL jgHQ== 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=n6P0B8GuMCqY5AcbQUhduF/I5yQPkgTylU7quiEm+qjRyoFotvCr+re8VrPLv184h8 /PNRNJqSND5D+Vy3girWK9TTn4TNHqJgP8jzRS0t19nJVyQOB/w6rvWTFNfqoqu0qAOi xeeHJebP7mraViRTfv6t2EnSFD6Mu88K4P3vIQSELKlTQRZLuBr6STgKoOFySSFNddSF Q4WyknDpduktaPVsG89vevSg5C2XIvgnIX1+jMeF6WuDSk/Tudz0tqZVzi/7+OBAkEh/ jH0wm3cZp+s6QC5cz+M8jG+TA/jSqPjb+ezZejwXlBwoHxMv5+pLBn2MPMfhZzN9s8Cy xZhA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=HLWB9d3F; 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 t1si3390024ile.141.2021.05.22.06.10.44; Sat, 22 May 2021 06:10:44 -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=HLWB9d3F; 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 S231228AbhEVNMG (ORCPT + 7 others); Sat, 22 May 2021 09:12:06 -0400 Received: from mail-am6eur05on2067.outbound.protection.outlook.com ([40.107.22.67]:12256 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231216AbhEVNMD (ORCPT ); Sat, 22 May 2021 09:12:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dC0PMzRkT+UnMhnyTxIUbu7S3/kbIbl/nuQ4B6kptm2XDiB05D5mW1QXAAxVb5+1loYxt8qx/y2JLHkDXQtBiNFijJK6UflpEb1tkbHkQ8h3xQnj7KV2NauL1aR1VQEMfc1iTk0Wq8kNblPa8yBxtV2sf7oMxBg2OFMGxcUokjdbflYzpCDdB8BdhaqXD/+uJckUvuKy2FKzb7DqY+D/3auhIHkM1yEbQQXrfd14YDgkiHS/4jXjxUGKR6x8g/nTy6PW72mSAwQ9Sp7OMC2meyWC0Je3adb2kwzYf0XDZjkNEf4kRNE/vrFvy7tzspiL2zB6ztg2dA89HAhpHj/Lcw== 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=mUW5tnNDKUF9YgFkie68nmaUJC/mqFrQmmFeEIDl97siCrpyg2SkUOyI+lRxzTQfw65qBcCiFFbave+W+l0z5o0wy3YJnUB4OUB01/6Dhh/NuAcF+pLQLSrCFMxIxtKUpmlrVMBPfIwqNkkCpX6J5SEMwfe2iP0CxikMo2LNNBieaIu/KRSxtsRUYmbsN/BQ8N/ZO/FtZxgsj9zthh+D+VPFZgSwDav4xA5F45caapYTBVx5hdsluF6eRutu8JjQApTkx4+unelRaeawXs20sibH6Phsum7laxnp62Bp4v8rGNXylsUvcwFTW07zLZk7XH7Bpl+UsWlUkbRGcdjaBw== 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=HLWB9d3FtoX2AkMtVT9+TNNQ42VvWF8z30r8+ohqqOb/3MYPYAwn0DP15hYXkiPPzMMOz8xhFRZS4yjTbdlcNpA9vhPgRhqUgiqTQVKjONcErvpGVRGtpgMxh2ckeG8TyoY13S3L6999kou3EemWpUYxNhgdgjSP+1Kg8TVStro= 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 DB8PR04MB5658.eurprd04.prod.outlook.com (2603:10a6:10:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.27; Sat, 22 May 2021 13:10:36 +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.4150.027; Sat, 22 May 2021 13:10:36 +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 V6 4/4] soc: imx: Add blk-ctl driver for i.MX8MM Date: Sat, 22 May 2021 21:42:49 +0800 Message-Id: <20210522134249.15322-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210522134249.15322-1-peng.fan@oss.nxp.com> References: <20210522134249.15322-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) 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 SG2PR04CA0155.apcprd04.prod.outlook.com (2603:1096:4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Sat, 22 May 2021 13:10:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22182090-b4a6-4148-b23f-08d91d22fd30 X-MS-TrafficTypeDiagnostic: DB8PR04MB5658: 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: DsPx6XkFdd8QH+B8fJ1nm3GW51R4iyarGeOt3ImkGJIxdlHb3RoA/U9Uzy4sAo8k2bne99NeJqGJWIurF+k37N3fKCL+qaCHJ897M74kR9h8Cy5sDsOnpXszT7a4V6NKiIKILKuWW/RwQoB+2g9x/KANHy7dXkOAOjvNUDSv8ouRwK1my/xv/bIR4sJ8cmkoA+5HBUzN4Bx6ZzRaEOMuO42ijcGpTB1+8PsIyGK8GdSXcEHnPLzqZJhPNxr3xUvCZOfC5dW/HtilK3gsUrSKJ4Z9O37UZEHxSTFKQvjoTWII0bxqWKXB9mSPBLWbyC/5S14nTgJUcu01YbfcD+nwg6gM/jKg5ku9ADSjqWL3EUqeTgbCYqOBjm2tItWe8qycKPJiY73Y4eAwQWLAL+B532CrGIiNSiHaslsOziqxg4w6dBrDJW0AkomZtXnp5BVht6QgmL3qs40PsbpYezTxL9yUtqtHYULykDQ17P0f8FweeBdVFEAIjwjrOwqQNeZ7hFEN3rRjidSm/BLmRyCeQK25CwCiBfb6qYZl9KPfgHeNsHdAiR1uhn01qcSF9+rvE9Bq8Bz68OBi/gby7duZK3lYDBUhgcBsK9O9W91YYfoZOz1kw79zofpM2iQfjW3HS/UZnH4UTnsLOV8bCAGntmbl27R9bWYLjgSh4nHXYjg= 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)(346002)(376002)(366004)(396003)(39860400002)(136003)(6506007)(66946007)(16526019)(66476007)(66556008)(186003)(4326008)(8936002)(26005)(52116002)(6512007)(38350700002)(38100700002)(83380400001)(5660300002)(478600001)(1076003)(8676002)(956004)(2616005)(316002)(86362001)(2906002)(6486002)(6666004)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UhwCWWYqMFrF71MwN63++wOvG7e91WvmAUVaDfKX0EfbsvhmitavXcegxzaejl4VipdcMCpxURudFyTB8e4K8JSb64PUwjQkQbv5aGiJ1pwuA3WdwtcfH5Y9hd+eycTsKWtLMsR0YZomXAgPmOEj15rKia9LzKJlm5EtjYZZtT5LEe40fQJZF/3e+Mw8i8//buCVDHohGxNAw8uZYiTTtQ2fVWHLCvKc9QiPdOU4afcS/u5kCTEOmVacU4E50bK6bjM4oR4L2qPVKoZhIHaXQVRhvjQ90g9e6ZFvI+3rZiC6ajOIFVNkIJFcgKobn81B9Xl2ARfHu8SC/4uIuaZTtNAwv5N5BgJJSpM/kRrhtSUctlbPgKmx83pj7QXwWc+aR9zdXTrotJQjGHwXJQRoe/31Xo8qU2MxultBe8eN/tYFApS4PyvT8Du86ClLsIlvpQSBGOaJRkPn7hoHIC2mltvl1iMp+nmzn7LffN239mQoA+NaIcddJxZz8OdM7TThWhUFuHFNM6L+wiJfTEGqmt7S5TehL6hhCO+Z3bbRhC8hXyYwwpfiq2c8/ZZVBF1ORGZDEyAkgCtTDRHwkTegxzXV6CIWfoqBWmMoCIywPE67Lw5zhNYgMpB7tzwjf4omtzO8OJk7hhlCK8akzRZQKrYMEezovNFMPX6MDaArtyNky67RTLeXTUjVwZhp03s/iY5yC0C9zzpMZ0ylPmrpxlMjV2jQ27rTTTQTHDdyiR8w2VCcetiZ25I2VLdMsO+RMLGr6EzUvZafbYwpbHXcXqwzOwFz9EBIMjLrhen8qIlZh7QHg0nxNsxCfcFYboqBZZWXQI9ur0VyOa4Spc3HXhjsxNSCVrJPSWi81m3xjfBgVeOUKLQ40iRQJfSDCzzv66eHfXiCh02a4hN63vzIEYq/IfHhrzxXxJFTCk2uId81toRYpkusHqnc128uyosKcvM6nBCEFheUPfAo+1Z6Es/Y/wNV75RJcBcP3Cg/hfarMDVJYXETMy5Jk9MsV5ZA43obhaelLJklpFBsdNvyQxmvg+F1xnowwnnEgWe3FYYRz7KYjSLU9VJ0hM56Q1E731LOAniJxIrOo5v4bN1n0AIqP1+HOqOUeYF5Xe60fhOB2y8UoFWmVliqltBWmlqpRHq0QzLLe9sYMKWTLUfJlaRiKS9jQXfLun/FgZN4U43ezUb8K16sJY8tFFdf3DSD88VhcGlrwkiO3Sr04NU0rJi7g/amFlG+U5KXIJoDZa3urIK6/VD6HJO71uJQfiqEZDymeRqfLUbvKIj9ltsvEYTvlMmYSWoUVXsMNtZWthhEMudV/38tBLV+cDrN5YCX X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22182090-b4a6-4148-b23f-08d91d22fd30 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2021 13:10:36.5735 (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: jwpluOGRDMageS+HF7nshHgF36XcBESM2LI8Zu3l4G/mUPDWJttDf4xtk0MO3KC6vL04NsKoYHA+qHC9EYk74Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB5658 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);