From 36b8aded1ad35ccd68ef0ca16e983f709ad35428 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Wed, 3 Apr 2019 14:48:39 +0800 Subject: [PATCH] MLK-21378-2 gpu: imx: Add imx8_dprc support Fast-forward imx8_dprc driver from imx_4.14.y. Signed-off-by: Liu Ying --- .../bindings/display/imx/fsl-imx-drm.txt | 32 + drivers/gpu/imx/Kconfig | 5 + drivers/gpu/imx/Makefile | 1 + drivers/gpu/imx/imx8_dprc.c | 909 ++++++++++++++++++ include/video/imx8-prefetch.h | 24 + 5 files changed, 971 insertions(+) create mode 100644 drivers/gpu/imx/imx8_dprc.c diff --git a/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt b/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt index e269a3d352a1..594e931b09e2 100644 --- a/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt +++ b/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt @@ -250,6 +250,38 @@ prg@56040000 { power-domains = <&pd_dc0>; }; +Freescale i.MX8 DPRC (Display Prefetch Resolve Channel) +======================================================= +Required properties: +- compatible: should be "fsl,-dpr-channel" +- reg: should be register base and length as documented in the + datasheet +- fsl,sc-resource: SCU resource number as described in + Documentation/devicetree/bindings/soc/fsl/imx_rsrc.txt +- fsl,prgs: phandles to the PRG unit(s) attached to this DPRC, the first one + is the primary PRG and the second one(if available) is the auxiliary PRG + which is used to fetch luma chunk of a YUV frame with 2 planars. +- clocks: phandles to the DPRC apb, b and rtram clocks, as described in + Documentation/devicetree/bindings/clock/clock-bindings.txt, + Documentation/devicetree/bindings/clock/imx8qm-clock.txt and + Documentation/devicetree/bindings/clock/imx8qxp-clock.txt +- clock-names: should be "apb", "b" and "rtram" +- power-domains: phandle pointing to power domain + +example: + +dpr-channel@56100000 { + compatible = "fsl,imx8qm-dpr-channel"; + reg = <0x0 0x56100000 0x0 0x10000>; + fsl,sc-resource = ; + fsl,prgs = <&prg4>, <&prg5>; + clocks = <&clk IMX8QM_DC0_DPR1_APB_CLK>, + <&clk IMX8QM_DC0_DPR1_B_CLK>, + <&clk IMX8QM_DC0_RTRAM1_CLK>; + clock-names = "apb", "b", "rtram"; + power-domains = <&pd_dc0>; +}; + Parallel display support ======================== diff --git a/drivers/gpu/imx/Kconfig b/drivers/gpu/imx/Kconfig index 7a2c7e06f052..589631d44519 100644 --- a/drivers/gpu/imx/Kconfig +++ b/drivers/gpu/imx/Kconfig @@ -3,6 +3,11 @@ config IMX8_PRG default y if IMX_DPU_CORE=y default m if IMX_DPU_CORE=m +config IMX8_DPRC + tristate + default y if IMX_DPU_CORE=y + default m if IMX_DPU_CORE=m + source drivers/gpu/imx/ipu-v3/Kconfig source drivers/gpu/imx/lcdif/Kconfig source drivers/gpu/imx/dcss/Kconfig diff --git a/drivers/gpu/imx/Makefile b/drivers/gpu/imx/Makefile index a8feed067a1f..3c4310858e3b 100644 --- a/drivers/gpu/imx/Makefile +++ b/drivers/gpu/imx/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_IMX8_PRG) += imx8_prg.o +obj-$(CONFIG_IMX8_DPRC) += imx8_dprc.o obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ obj-$(CONFIG_IMX_LCDIF_CORE) += lcdif/ diff --git a/drivers/gpu/imx/imx8_dprc.c b/drivers/gpu/imx/imx8_dprc.c new file mode 100644 index 000000000000..a0a41294769f --- /dev/null +++ b/drivers/gpu/imx/imx8_dprc.c @@ -0,0 +1,909 @@ +/* + * Copyright 2017-2019 NXP + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include