From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DFA8C433EF for ; Sat, 16 Oct 2021 21:04:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 212856115C for ; Sat, 16 Oct 2021 21:04:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 212856115C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GYFkw5Llzk3I/9hZ9eCdaFHLl0NHew1OAp//RtgDPqE=; b=pbu/ClslcP3osC g4vW996Chkd3JA/VaShzEn9niHO0Mn+01ljvcBceutRUXeYNq7v08g3QFQh0SxL4kmWN+Wb9F3VBU W029UVe0YFOn+3x8UT3Gjgxe3CLxrcDDjV6IkWawUKyIAeSdDh3uvY0xlQaU57CKh7BCgX/uRuL2P X7UfLzIRBzapnngHq777RNug8ElOzmO7j+XRn61ANJmQXavs7/corADx94+h2eHPDz2K7BVpTHGcy +nyucVpEhYTgIAcS45KBz53slSQ1N49pnxrBI7pkoY3LFs5jTYAwF2CiLTIMFEsEpH+Z+wIQN8uzZ r6KVAf2iu0z7ew8K0hZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbqpL-00BJf6-EU; Sat, 16 Oct 2021 21:02:47 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbqpI-00BJek-57 for linux-arm-kernel@lists.infradead.org; Sat, 16 Oct 2021 21:02:45 +0000 Received: by mail-ed1-x532.google.com with SMTP id g10so53166386edj.1 for ; Sat, 16 Oct 2021 14:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e8RptWSTYh1UiIYmEmk7oOt0TCMDLze5CjXcCV1alrU=; b=b7eVvyby3iXfNWRtTVB07EYk0yXX4uoCIjrQGSn0qUIi4NVbxrdyUTRSQmuOhsLIOG DUw+k8mEuFccYZPEyr/M8vvmeMXqlJYn2t63oHTa1pifFTtDnvY+x7HuZnmfmjV265Lu AVEISten7LBM0c2ps1lu3Xrqxje3/2KRTC2MP0D/KK+jZk64HOUY7mkT3E3SLVoLfYUZ APvR2K6TObeaTxC4Pt11uFxFpdyXh0jD4VBPa0srr4568lgDnHUR5mOiOD3XqqLFrl5g WfnzSFay9M4H7cNjGB2Gp0dPplPcKZ12pGErPWYzseArlC5kQr4/sPu2oWdB/ZSVXaKK bv4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e8RptWSTYh1UiIYmEmk7oOt0TCMDLze5CjXcCV1alrU=; b=XjtNaeyDytn/MzTcB7seKizpv+FzoNUJ7fLfrGyJYZUTeeUzElJwMGuqsLEd2IdyJz NDzvnn5NceDjTIq59jnmYcIrmTGm3M6aLZr2htpRpakTBeyogkVKr1bhR5aIDCgnGIa8 R06UQsWvfd7A0jHcVIyMqdEwq/GVCsgF+DghjRVgQHAzRdsS+zmX/qMFv9pjbc60j6pt 04lYiF02Ydb9Xn1CQqi1424h7gKacvwku1snIjkzF59nyoS39bhZtmAsMko/D0x6lIMs sMd0hWN4R1cGtL/rmS0FCnm/1zbwOr7EckIeU3nqbhZ08KOOVjO/3BQAUGxWDfUaJE0Y 01bA== X-Gm-Message-State: AOAM533x0kDJVyzdhBW4SEpyBHKfJbcAgG99TtjSuiHC+VKeFpZM9tuF lH2WvKzIjuyBj9G7l1fVSRk4W+cHGG3NkXmMarDRlgCx X-Google-Smtp-Source: ABdhPJyGqgZMYbjFw3DiUaBm0clqq3FWSpQe5aQRGmEpmn/CVgAGggoizx+RSeG4mRwAm++rD0/ArXtNweosmUXx1v0= X-Received: by 2002:a05:6402:3586:: with SMTP id y6mr29561747edc.292.1634418162208; Sat, 16 Oct 2021 14:02:42 -0700 (PDT) MIME-Version: 1.0 References: <20211009162700.1452857-1-aford173@gmail.com> <20211009162700.1452857-6-aford173@gmail.com> In-Reply-To: <20211009162700.1452857-6-aford173@gmail.com> From: Adam Ford Date: Sat, 16 Oct 2021 16:02:31 -0500 Message-ID: Subject: Re: [PATCH V2 5/9] soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl To: arm-soc Cc: Adam Ford-BE , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Lucas Stach , devicetree , Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211016_140244_244310_7874952D X-CRM114-Status: GOOD ( 27.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Oct 9, 2021 at 11:27 AM Adam Ford wrote: > > This adds the description for the i.MX8MN disp blk-ctrl. > > Signed-off-by: Adam Ford > --- Does anyone from NXP have any feedback on this? I tried to look at the ISI driver and power domain and understand it, but it's not present in the 8mm, so I went off my best understanding of the datasheet. adam > drivers/soc/imx/imx8m-blk-ctrl.c | 75 +++++++++++++++++++++++++++++++- > 1 file changed, 74 insertions(+), 1 deletion(-) > > diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c > index e172d295c441..8d3bf7690383 100644 > --- a/drivers/soc/imx/imx8m-blk-ctrl.c > +++ b/drivers/soc/imx/imx8m-blk-ctrl.c > @@ -14,6 +14,7 @@ > #include > > #include > +#include > > #define BLK_SFT_RSTN 0x0 > #define BLK_CLK_EN 0x4 > @@ -498,6 +499,75 @@ static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { > .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), > }; > > + > +static int imx8mn_disp_power_notifier(struct notifier_block *nb, > + unsigned long action, void *data) > +{ > + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, > + power_nb); > + > + if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) > + return NOTIFY_OK; > + > + /* Enable bus clock and deassert bus reset */ > + regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); > + regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); > + > + /* > + * On power up we have no software backchannel to the GPC to > + * wait for the ADB handshake to happen, so we just delay for a > + * bit. On power down the GPC driver waits for the handshake. > + */ > + if (action == GENPD_NOTIFY_ON) > + udelay(5); > + > + > + return NOTIFY_OK; > +} > + > +static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { > + [IMX8MN_DISPBLK_PD_MIPI_DSI] = { > + .name = "dispblk-mipi-dsi", > + .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, > + .num_clks = 2, > + .gpc_name = "mipi-dsi", > + .rst_mask = BIT(0) | BIT(1), > + .clk_mask = BIT(0) | BIT(1), > + }, > + [IMX8MN_DISPBLK_PD_MIPI_CSI] = { > + .name = "dispblk-mipi-csi", > + .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, > + .num_clks = 2, > + .gpc_name = "mipi-csi", > + .rst_mask = BIT(2) | BIT(3), > + .clk_mask = BIT(2) | BIT(3), > + }, > + [IMX8MN_DISPBLK_PD_LCDIF] = { > + .name = "dispblk-lcdif", > + .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, > + .num_clks = 3, > + .gpc_name = "lcdif", > + .rst_mask = BIT(4) | BIT(5), > + .clk_mask = BIT(4) | BIT(5), > + }, > + [IMX8MN_DISPBLK_PD_ISI] = { > + .name = "dispblk-isi", > + .clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root", > + "disp_apb_root"}, > + .num_clks = 4, > + .gpc_name = "isi", > + .rst_mask = BIT(6) | BIT(7), > + .clk_mask = BIT(6) | BIT(7), > + }, > +}; > + > +static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { > + .max_reg = 0x84, > + .power_notifier_fn = imx8mn_disp_power_notifier, > + .domains = imx8mn_disp_blk_ctl_domain_data, > + .num_domains = ARRAY_SIZE(imx8mn_disp_blk_ctl_domain_data), > +}; > + > static const struct of_device_id imx8m_blk_ctrl_of_match[] = { > { > .compatible = "fsl,imx8mm-vpu-blk-ctrl", > @@ -505,7 +575,10 @@ static const struct of_device_id imx8m_blk_ctrl_of_match[] = { > }, { > .compatible = "fsl,imx8mm-disp-blk-ctrl", > .data = &imx8mm_disp_blk_ctl_dev_data > - } ,{ > + }, { > + .compatible = "fsl,imx8mn-disp-blk-ctrl", > + .data = &imx8mn_disp_blk_ctl_dev_data > + }, { > /* Sentinel */ > } > }; > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel