diff mbox series

[V4,5/9] soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl

Message ID 20211128131853.15125-6-aford173@gmail.com (mailing list archive)
State New, archived
Headers show
Series arm64: imx8mn: Enable more imx8m Nano functions | expand

Commit Message

Adam Ford Nov. 28, 2021, 1:18 p.m. UTC
This adds the description for the i.MX8MN disp blk-ctrl.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 drivers/soc/imx/imx8m-blk-ctrl.c | 77 +++++++++++++++++++++++++++++++-
 1 file changed, 76 insertions(+), 1 deletion(-)

--
2.32.0

Comments

kernel test robot Nov. 28, 2021, 3:21 p.m. UTC | #1
Hi Adam,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on shawnguo/for-next soc/for-next rockchip/for-next v5.16-rc2 next-20211126]
[cannot apply to arm/for-next xilinx-xlnx/master arm64/for-next/core clk/clk-next kvmarm/next keystone/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Adam-Ford/arm64-imx8mn-Enable-more-imx8m-Nano-functions/20211128-212356
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: nios2-randconfig-s031-20211128 (https://download.01.org/0day-ci/archive/20211128/202111282315.VlV1LvRJ-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/4e41d7dd6745650d1f0e0015c876aeff76709054
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Adam-Ford/arm64-imx8mn-Enable-more-imx8m-Nano-functions/20211128-212356
        git checkout 4e41d7dd6745650d1f0e0015c876aeff76709054
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/soc/imx/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/soc/imx/imx8m-blk-ctrl.c:536:18: error: 'const struct imx8m_blk_ctrl_domain_data' has no member named 'mipi_phy_rst_mask'
     536 |                 .mipi_phy_rst_mask = BIT(17),
         |                  ^~~~~~~~~~~~~~~~~
   In file included from include/linux/bits.h:6,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/ratelimit.h:5,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from drivers/soc/imx/imx8m-blk-ctrl.c:7:
>> include/vdso/bits.h:7:33: warning: excess elements in struct initializer
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:536:38: note: in expansion of macro 'BIT'
     536 |                 .mipi_phy_rst_mask = BIT(17),
         |                                      ^~~
   include/vdso/bits.h:7:33: note: (near initialization for 'imx8mn_disp_blk_ctl_domain_data[0]')
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:536:38: note: in expansion of macro 'BIT'
     536 |                 .mipi_phy_rst_mask = BIT(17),
         |                                      ^~~
   drivers/soc/imx/imx8m-blk-ctrl.c:545:18: error: 'const struct imx8m_blk_ctrl_domain_data' has no member named 'mipi_phy_rst_mask'
     545 |                 .mipi_phy_rst_mask = BIT(16),
         |                  ^~~~~~~~~~~~~~~~~
   In file included from include/linux/bits.h:6,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/ratelimit.h:5,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from drivers/soc/imx/imx8m-blk-ctrl.c:7:
>> include/vdso/bits.h:7:33: warning: excess elements in struct initializer
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:545:38: note: in expansion of macro 'BIT'
     545 |                 .mipi_phy_rst_mask = BIT(16),
         |                                      ^~~
   include/vdso/bits.h:7:33: note: (near initialization for 'imx8mn_disp_blk_ctl_domain_data[1]')
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:545:38: note: in expansion of macro 'BIT'
     545 |                 .mipi_phy_rst_mask = BIT(16),
         |                                      ^~~


vim +7 include/vdso/bits.h

3945ff37d2f48d Vincenzo Frascino 2020-03-20  6  
3945ff37d2f48d Vincenzo Frascino 2020-03-20 @7  #define BIT(nr)			(UL(1) << (nr))
3945ff37d2f48d Vincenzo Frascino 2020-03-20  8  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Nov. 28, 2021, 4:54 p.m. UTC | #2
Hi Adam,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on shawnguo/for-next soc/for-next rockchip/for-next v5.16-rc2 next-20211126]
[cannot apply to arm/for-next xilinx-xlnx/master arm64/for-next/core clk/clk-next kvmarm/next keystone/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Adam-Ford/arm64-imx8mn-Enable-more-imx8m-Nano-functions/20211128-212356
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: nios2-randconfig-s031-20211128 (https://download.01.org/0day-ci/archive/20211129/202111290057.IessF4BL-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/4e41d7dd6745650d1f0e0015c876aeff76709054
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Adam-Ford/arm64-imx8mn-Enable-more-imx8m-Nano-functions/20211128-212356
        git checkout 4e41d7dd6745650d1f0e0015c876aeff76709054
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/soc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/soc/imx/imx8m-blk-ctrl.c:536:18: error: 'const struct imx8m_blk_ctrl_domain_data' has no member named 'mipi_phy_rst_mask'
     536 |                 .mipi_phy_rst_mask = BIT(17),
         |                  ^~~~~~~~~~~~~~~~~
   In file included from include/linux/bits.h:6,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/ratelimit.h:5,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from drivers/soc/imx/imx8m-blk-ctrl.c:7:
   include/vdso/bits.h:7:33: warning: excess elements in struct initializer
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:536:38: note: in expansion of macro 'BIT'
     536 |                 .mipi_phy_rst_mask = BIT(17),
         |                                      ^~~
   include/vdso/bits.h:7:33: note: (near initialization for 'imx8mn_disp_blk_ctl_domain_data[0]')
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:536:38: note: in expansion of macro 'BIT'
     536 |                 .mipi_phy_rst_mask = BIT(17),
         |                                      ^~~
   drivers/soc/imx/imx8m-blk-ctrl.c:545:18: error: 'const struct imx8m_blk_ctrl_domain_data' has no member named 'mipi_phy_rst_mask'
     545 |                 .mipi_phy_rst_mask = BIT(16),
         |                  ^~~~~~~~~~~~~~~~~
   In file included from include/linux/bits.h:6,
                    from include/linux/ratelimit_types.h:5,
                    from include/linux/ratelimit.h:5,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from drivers/soc/imx/imx8m-blk-ctrl.c:7:
   include/vdso/bits.h:7:33: warning: excess elements in struct initializer
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:545:38: note: in expansion of macro 'BIT'
     545 |                 .mipi_phy_rst_mask = BIT(16),
         |                                      ^~~
   include/vdso/bits.h:7:33: note: (near initialization for 'imx8mn_disp_blk_ctl_domain_data[1]')
       7 | #define BIT(nr)                 (UL(1) << (nr))
         |                                 ^
   drivers/soc/imx/imx8m-blk-ctrl.c:545:38: note: in expansion of macro 'BIT'
     545 |                 .mipi_phy_rst_mask = BIT(16),
         |                                      ^~~


vim +536 drivers/soc/imx/imx8m-blk-ctrl.c

   527	
   528	static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = {
   529		[IMX8MN_DISPBLK_PD_MIPI_DSI] = {
   530			.name = "dispblk-mipi-dsi",
   531			.clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", },
   532			.num_clks = 2,
   533			.gpc_name = "mipi-dsi",
   534			.rst_mask = BIT(0) | BIT(1),
   535			.clk_mask = BIT(0) | BIT(1),
 > 536			.mipi_phy_rst_mask = BIT(17),
   537		},
   538		[IMX8MN_DISPBLK_PD_MIPI_CSI] = {
   539			.name = "dispblk-mipi-csi",
   540			.clk_names = (const char *[]){ "csi-aclk", "csi-pclk" },
   541			.num_clks = 2,
   542			.gpc_name = "mipi-csi",
   543			.rst_mask = BIT(2) | BIT(3),
   544			.clk_mask = BIT(2) | BIT(3),
   545			.mipi_phy_rst_mask = BIT(16),
   546		},
   547		[IMX8MN_DISPBLK_PD_LCDIF] = {
   548			.name = "dispblk-lcdif",
   549			.clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", },
   550			.num_clks = 3,
   551			.gpc_name = "lcdif",
   552			.rst_mask = BIT(4) | BIT(5),
   553			.clk_mask = BIT(4) | BIT(5),
   554		},
   555		[IMX8MN_DISPBLK_PD_ISI] = {
   556			.name = "dispblk-isi",
   557			.clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root",
   558							"disp_apb_root"},
   559			.num_clks = 4,
   560			.gpc_name = "isi",
   561			.rst_mask = BIT(6) | BIT(7),
   562			.clk_mask = BIT(6) | BIT(7),
   563		},
   564	};
   565	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Adam Ford Dec. 6, 2021, 1:05 p.m. UTC | #3
On Sun, Nov 28, 2021 at 10:55 AM kernel test robot <lkp@intel.com> wrote:
>
> Hi Adam,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on robh/for-next]
> [also build test ERROR on shawnguo/for-next soc/for-next rockchip/for-next v5.16-rc2 next-20211126]
> [cannot apply to arm/for-next xilinx-xlnx/master arm64/for-next/core clk/clk-next kvmarm/next keystone/next]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]

I had listed the dependency in the cover letter, and I wasn't sure
what to use for 'base' since the patches needed were not applied yet.

The dependency has since been pulled into Shawn's for-next branch now
and that was completed last night.

base:  git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next

I am not sure of the process for requesting a retry, but I can resend
the patch if that helps.

adam

>
> url:    https://github.com/0day-ci/linux/commits/Adam-Ford/arm64-imx8mn-Enable-more-imx8m-Nano-functions/20211128-212356
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
> config: nios2-randconfig-s031-20211128 (https://download.01.org/0day-ci/archive/20211129/202111290057.IessF4BL-lkp@intel.com/config)
> compiler: nios2-linux-gcc (GCC) 11.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.4-dirty
>         # https://github.com/0day-ci/linux/commit/4e41d7dd6745650d1f0e0015c876aeff76709054
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Adam-Ford/arm64-imx8mn-Enable-more-imx8m-Nano-functions/20211128-212356
>         git checkout 4e41d7dd6745650d1f0e0015c876aeff76709054
>         # save the config file to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/soc/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> drivers/soc/imx/imx8m-blk-ctrl.c:536:18: error: 'const struct imx8m_blk_ctrl_domain_data' has no member named 'mipi_phy_rst_mask'
>      536 |                 .mipi_phy_rst_mask = BIT(17),
>          |                  ^~~~~~~~~~~~~~~~~
>    In file included from include/linux/bits.h:6,
>                     from include/linux/ratelimit_types.h:5,
>                     from include/linux/ratelimit.h:5,
>                     from include/linux/dev_printk.h:16,
>                     from include/linux/device.h:15,
>                     from drivers/soc/imx/imx8m-blk-ctrl.c:7:
>    include/vdso/bits.h:7:33: warning: excess elements in struct initializer
>        7 | #define BIT(nr)                 (UL(1) << (nr))
>          |                                 ^
>    drivers/soc/imx/imx8m-blk-ctrl.c:536:38: note: in expansion of macro 'BIT'
>      536 |                 .mipi_phy_rst_mask = BIT(17),
>          |                                      ^~~
>    include/vdso/bits.h:7:33: note: (near initialization for 'imx8mn_disp_blk_ctl_domain_data[0]')
>        7 | #define BIT(nr)                 (UL(1) << (nr))
>          |                                 ^
>    drivers/soc/imx/imx8m-blk-ctrl.c:536:38: note: in expansion of macro 'BIT'
>      536 |                 .mipi_phy_rst_mask = BIT(17),
>          |                                      ^~~
>    drivers/soc/imx/imx8m-blk-ctrl.c:545:18: error: 'const struct imx8m_blk_ctrl_domain_data' has no member named 'mipi_phy_rst_mask'
>      545 |                 .mipi_phy_rst_mask = BIT(16),
>          |                  ^~~~~~~~~~~~~~~~~
>    In file included from include/linux/bits.h:6,
>                     from include/linux/ratelimit_types.h:5,
>                     from include/linux/ratelimit.h:5,
>                     from include/linux/dev_printk.h:16,
>                     from include/linux/device.h:15,
>                     from drivers/soc/imx/imx8m-blk-ctrl.c:7:
>    include/vdso/bits.h:7:33: warning: excess elements in struct initializer
>        7 | #define BIT(nr)                 (UL(1) << (nr))
>          |                                 ^
>    drivers/soc/imx/imx8m-blk-ctrl.c:545:38: note: in expansion of macro 'BIT'
>      545 |                 .mipi_phy_rst_mask = BIT(16),
>          |                                      ^~~
>    include/vdso/bits.h:7:33: note: (near initialization for 'imx8mn_disp_blk_ctl_domain_data[1]')
>        7 | #define BIT(nr)                 (UL(1) << (nr))
>          |                                 ^
>    drivers/soc/imx/imx8m-blk-ctrl.c:545:38: note: in expansion of macro 'BIT'
>      545 |                 .mipi_phy_rst_mask = BIT(16),
>          |                                      ^~~
>
>
> vim +536 drivers/soc/imx/imx8m-blk-ctrl.c
>
>    527
>    528  static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = {
>    529          [IMX8MN_DISPBLK_PD_MIPI_DSI] = {
>    530                  .name = "dispblk-mipi-dsi",
>    531                  .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", },
>    532                  .num_clks = 2,
>    533                  .gpc_name = "mipi-dsi",
>    534                  .rst_mask = BIT(0) | BIT(1),
>    535                  .clk_mask = BIT(0) | BIT(1),
>  > 536                  .mipi_phy_rst_mask = BIT(17),
>    537          },
>    538          [IMX8MN_DISPBLK_PD_MIPI_CSI] = {
>    539                  .name = "dispblk-mipi-csi",
>    540                  .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" },
>    541                  .num_clks = 2,
>    542                  .gpc_name = "mipi-csi",
>    543                  .rst_mask = BIT(2) | BIT(3),
>    544                  .clk_mask = BIT(2) | BIT(3),
>    545                  .mipi_phy_rst_mask = BIT(16),
>    546          },
>    547          [IMX8MN_DISPBLK_PD_LCDIF] = {
>    548                  .name = "dispblk-lcdif",
>    549                  .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", },
>    550                  .num_clks = 3,
>    551                  .gpc_name = "lcdif",
>    552                  .rst_mask = BIT(4) | BIT(5),
>    553                  .clk_mask = BIT(4) | BIT(5),
>    554          },
>    555          [IMX8MN_DISPBLK_PD_ISI] = {
>    556                  .name = "dispblk-isi",
>    557                  .clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root",
>    558                                                  "disp_apb_root"},
>    559                  .num_clks = 4,
>    560                  .gpc_name = "isi",
>    561                  .rst_mask = BIT(6) | BIT(7),
>    562                  .clk_mask = BIT(6) | BIT(7),
>    563          },
>    564  };
>    565
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Adam Ford Dec. 14, 2021, 3:40 a.m. UTC | #4
On Sun, Nov 28, 2021 at 7:19 AM Adam Ford <aford173@gmail.com> wrote:
>
> This adds the description for the i.MX8MN disp blk-ctrl.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>

Lucas,

Is there any chance you could give this series some feedback?  In
order to get more functionality on the Nano, we need the blk-ctrl on
Nano working.

thanks,

adam

> ---
>  drivers/soc/imx/imx8m-blk-ctrl.c | 77 +++++++++++++++++++++++++++++++-
>  1 file changed, 76 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
> index c2f076b56e24..511e74f0db8a 100644
> --- a/drivers/soc/imx/imx8m-blk-ctrl.c
> +++ b/drivers/soc/imx/imx8m-blk-ctrl.c
> @@ -14,6 +14,7 @@
>  #include <linux/clk.h>
>
>  #include <dt-bindings/power/imx8mm-power.h>
> +#include <dt-bindings/power/imx8mn-power.h>
>
>  #define BLK_SFT_RSTN   0x0
>  #define BLK_CLK_EN     0x4
> @@ -517,6 +518,77 @@ 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),
> +               .mipi_phy_rst_mask = BIT(17),
> +       },
> +       [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),
> +               .mipi_phy_rst_mask = BIT(16),
> +       },
> +       [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",
> @@ -524,7 +596,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.32.0
>
Lucas Stach Dec. 14, 2021, 9:15 a.m. UTC | #5
Am Sonntag, dem 28.11.2021 um 07:18 -0600 schrieb Adam Ford:
> This adds the description for the i.MX8MN disp blk-ctrl.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/soc/imx/imx8m-blk-ctrl.c | 77 +++++++++++++++++++++++++++++++-
>  1 file changed, 76 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
> index c2f076b56e24..511e74f0db8a 100644
> --- a/drivers/soc/imx/imx8m-blk-ctrl.c
> +++ b/drivers/soc/imx/imx8m-blk-ctrl.c
> @@ -14,6 +14,7 @@
>  #include <linux/clk.h>
> 
>  #include <dt-bindings/power/imx8mm-power.h>
> +#include <dt-bindings/power/imx8mn-power.h>
> 
>  #define BLK_SFT_RSTN	0x0
>  #define BLK_CLK_EN	0x4
> @@ -517,6 +518,77 @@ 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),
> +		.mipi_phy_rst_mask = BIT(17),
> +	},
> +	[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),
> +		.mipi_phy_rst_mask = BIT(16),
> +	},
> +	[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",
> @@ -524,7 +596,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.32.0
>
diff mbox series

Patch

diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
index c2f076b56e24..511e74f0db8a 100644
--- a/drivers/soc/imx/imx8m-blk-ctrl.c
+++ b/drivers/soc/imx/imx8m-blk-ctrl.c
@@ -14,6 +14,7 @@ 
 #include <linux/clk.h>

 #include <dt-bindings/power/imx8mm-power.h>
+#include <dt-bindings/power/imx8mn-power.h>

 #define BLK_SFT_RSTN	0x0
 #define BLK_CLK_EN	0x4
@@ -517,6 +518,77 @@  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),
+		.mipi_phy_rst_mask = BIT(17),
+	},
+	[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),
+		.mipi_phy_rst_mask = BIT(16),
+	},
+	[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",
@@ -524,7 +596,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 */
 	}
 };