forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
media: platform: mtk-mdp3: Add Mediatek MDP3 driver
This patch adds driver for Media Data Path 3 (MDP3). Each modules' related operation control is sited in mtk-mdp3-comp.c Each modules' register table is defined in file with "mdp_reg_" and "mmsys_" prefix GCE related API, operation control sited in mtk-mdp3-cmdq.c V4L2 m2m device functions are implemented in mtk-mdp3-m2m.c Probe, power, suspend/resume, system level functions are defined in mtk-mdp3-core.c Signed-off-by: Ping-Hsun Wu <ping-hsun.wu@mediatek.com> Signed-off-by: daoyuan huang <daoyuan.huang@mediatek.com> Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
- Loading branch information
1 parent
072854d
commit ca5b8c1fac55efa08e8362a4aa345c474b798326
Showing
26 changed files
with
6,165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # SPDX-License-Identifier: GPL-2.0 | ||
| mtk-mdp3-y += mtk-mdp3-core.o mtk-mdp3-vpu.o mtk-mdp3-regs.o | ||
| mtk-mdp3-y += mtk-mdp3-m2m.o | ||
| mtk-mdp3-y += mtk-mdp3-comp.o mtk-mdp3-cmdq.o | ||
|
|
||
| obj-$(CONFIG_VIDEO_MEDIATEK_MDP3) += mtk-mdp3.o | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0 */ | ||
| /* | ||
| * Copyright (c) 2019 MediaTek Inc. | ||
| * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com> | ||
| */ | ||
|
|
||
| #ifndef __ISP_REG_H__ | ||
| #define __ISP_REG_H__ | ||
|
|
||
| enum ISP_DIP_CQ { | ||
| ISP_DRV_DIP_CQ_THRE0 = 0, | ||
| ISP_DRV_DIP_CQ_THRE1, | ||
| ISP_DRV_DIP_CQ_THRE2, | ||
| ISP_DRV_DIP_CQ_THRE3, | ||
| ISP_DRV_DIP_CQ_THRE4, | ||
| ISP_DRV_DIP_CQ_THRE5, | ||
| ISP_DRV_DIP_CQ_THRE6, | ||
| ISP_DRV_DIP_CQ_THRE7, | ||
| ISP_DRV_DIP_CQ_THRE8, | ||
| ISP_DRV_DIP_CQ_THRE9, | ||
| ISP_DRV_DIP_CQ_THRE10, | ||
| ISP_DRV_DIP_CQ_THRE11, | ||
| ISP_DRV_DIP_CQ_NUM, | ||
| ISP_DRV_DIP_CQ_NONE, | ||
| /* we only need 12 CQ threads in this chip, | ||
| * so we move the following enum behind ISP_DRV_DIP_CQ_NUM | ||
| */ | ||
| ISP_DRV_DIP_CQ_THRE12, | ||
| ISP_DRV_DIP_CQ_THRE13, | ||
| ISP_DRV_DIP_CQ_THRE14, | ||
| ISP_DRV_DIP_CQ_THRE15, /* CQ_THREAD15 does not connect to GCE */ | ||
| ISP_DRV_DIP_CQ_THRE16, /* CQ_THREAD16 does not connect to GCE */ | ||
| ISP_DRV_DIP_CQ_THRE17, /* CQ_THREAD17 does not connect to GCE */ | ||
| ISP_DRV_DIP_CQ_THRE18, /* CQ_THREAD18 does not connect to GCE */ | ||
| }; | ||
|
|
||
| #endif // __ISP_REG_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0 */ | ||
| /* | ||
| * Copyright (c) 2018 MediaTek Inc. | ||
| * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com> | ||
| */ | ||
|
|
||
| #ifndef __MDP_PLATFORM_H__ | ||
| #define __MDP_PLATFORM_H__ | ||
|
|
||
| #include "mtk-mdp3-comp.h" | ||
|
|
||
| /* CAM */ | ||
| #define MDP_WPEI MDP_COMP_WPEI | ||
| #define MDP_WPEO MDP_COMP_WPEO | ||
| #define MDP_WPEI2 MDP_COMP_WPEI2 | ||
| #define MDP_WPEO2 MDP_COMP_WPEO2 | ||
| #define MDP_IMGI MDP_COMP_ISP_IMGI | ||
| #define MDP_IMGO MDP_COMP_ISP_IMGO | ||
| #define MDP_IMG2O MDP_COMP_ISP_IMG2O | ||
|
|
||
| /* IPU */ | ||
| #define MDP_IPUI MDP_COMP_NONE | ||
| #define MDP_IPUO MDP_COMP_NONE | ||
|
|
||
| /* MDP */ | ||
| #define MDP_CAMIN MDP_COMP_CAMIN | ||
| #define MDP_CAMIN2 MDP_COMP_CAMIN2 | ||
| #define MDP_RDMA0 MDP_COMP_RDMA0 | ||
| #define MDP_RDMA1 MDP_COMP_NONE | ||
| #define MDP_AAL0 MDP_COMP_AAL0 | ||
| #define MDP_CCORR0 MDP_COMP_CCORR0 | ||
| #define MDP_SCL0 MDP_COMP_RSZ0 | ||
| #define MDP_SCL1 MDP_COMP_RSZ1 | ||
| #define MDP_SCL2 MDP_COMP_NONE | ||
| #define MDP_TDSHP0 MDP_COMP_TDSHP0 | ||
| #define MDP_COLOR0 MDP_COMP_COLOR0 | ||
| #define MDP_WROT0 MDP_COMP_WROT0 | ||
| #define MDP_WROT1 MDP_COMP_NONE | ||
| #define MDP_WDMA MDP_COMP_WDMA | ||
| #define MDP_PATH0_SOUT MDP_COMP_PATH0_SOUT | ||
| #define MDP_PATH1_SOUT MDP_COMP_PATH1_SOUT | ||
|
|
||
| #define MDP_TOTAL (MDP_COMP_WDMA + 1) | ||
|
|
||
| /* Platform options */ | ||
| #define ESL_SETTING 1 | ||
| #define RDMA_SUPPORT_10BIT 1 | ||
| #define RDMA0_RSZ1_SRAM_SHARING 1 | ||
| #define RDMA_UPSAMPLE_REPEAT_ONLY 1 | ||
| #define RSZ_DISABLE_DCM_SMALL_TILE 0 | ||
| #define WROT_FILTER_CONSTRAINT 0 | ||
| #define WROT0_DISP_SRAM_SHARING 0 | ||
|
|
||
| #define MM_MUTEX_MOD_OFFSET 0x30 | ||
| #define MM_MUTEX_SOF_OFFSET 0x2c | ||
|
|
||
| #endif /* __MDP_PLATFORM_H__ */ | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| /* SPDX-License-Identifier: GPL-2.0 */ | ||
| /* | ||
| * Copyright (c) 2019 MediaTek Inc. | ||
| * Author: Ping-Hsun Wu <ping-hsun.wu@mediatek.com> | ||
| */ | ||
|
|
||
| #ifndef __MDP_REG_CCORR_H__ | ||
| #define __MDP_REG_CCORR_H__ | ||
|
|
||
| #include "mmsys_reg_base.h" | ||
|
|
||
| #define MDP_CCORR_EN 0x000 | ||
| #define MDP_CCORR_RESET 0x004 | ||
| #define MDP_CCORR_INTEN 0x008 | ||
| #define MDP_CCORR_INTSTA 0x00c | ||
| #define MDP_CCORR_STATUS 0x010 | ||
| #define MDP_CCORR_CFG 0x020 | ||
| #define MDP_CCORR_INPUT_COUNT 0x024 | ||
| #define MDP_CCORR_OUTPUT_COUNT 0x028 | ||
| #define MDP_CCORR_CHKSUM 0x02c | ||
| #define MDP_CCORR_SIZE 0x030 | ||
| #define MDP_CCORR_Y2R_00 0x034 | ||
| #define MDP_CCORR_Y2R_01 0x038 | ||
| #define MDP_CCORR_Y2R_02 0x03c | ||
| #define MDP_CCORR_Y2R_03 0x040 | ||
| #define MDP_CCORR_Y2R_04 0x044 | ||
| #define MDP_CCORR_Y2R_05 0x048 | ||
| #define MDP_CCORR_R2Y_00 0x04c | ||
| #define MDP_CCORR_R2Y_01 0x050 | ||
| #define MDP_CCORR_R2Y_02 0x054 | ||
| #define MDP_CCORR_R2Y_03 0x058 | ||
| #define MDP_CCORR_R2Y_04 0x05c | ||
| #define MDP_CCORR_R2Y_05 0x060 | ||
| #define MDP_CCORR_COEF_0 0x080 | ||
| #define MDP_CCORR_COEF_1 0x084 | ||
| #define MDP_CCORR_COEF_2 0x088 | ||
| #define MDP_CCORR_COEF_3 0x08c | ||
| #define MDP_CCORR_COEF_4 0x090 | ||
| #define MDP_CCORR_SHADOW 0x0a0 | ||
| #define MDP_CCORR_DUMMY_REG 0x0c0 | ||
| #define MDP_CCORR_ATPG 0x0fc | ||
|
|
||
| /* MASK */ | ||
| #define MDP_CCORR_EN_MASK 0x00000001 | ||
| #define MDP_CCORR_RESET_MASK 0x00000001 | ||
| #define MDP_CCORR_INTEN_MASK 0x00000003 | ||
| #define MDP_CCORR_INTSTA_MASK 0x00000003 | ||
| #define MDP_CCORR_STATUS_MASK 0xfffffff3 | ||
| #define MDP_CCORR_CFG_MASK 0x70001317 | ||
| #define MDP_CCORR_INPUT_COUNT_MASK 0x1fff1fff | ||
| #define MDP_CCORR_OUTPUT_COUNT_MASK 0x1fff1fff | ||
| #define MDP_CCORR_CHKSUM_MASK 0xffffffff | ||
| #define MDP_CCORR_SIZE_MASK 0x1fff1fff | ||
| #define MDP_CCORR_Y2R_00_MASK 0x01ff01ff | ||
| #define MDP_CCORR_Y2R_01_MASK 0x1fff01ff | ||
| #define MDP_CCORR_Y2R_02_MASK 0x1fff1fff | ||
| #define MDP_CCORR_Y2R_03_MASK 0x1fff1fff | ||
| #define MDP_CCORR_Y2R_04_MASK 0x1fff1fff | ||
| #define MDP_CCORR_Y2R_05_MASK 0x1fff1fff | ||
| #define MDP_CCORR_R2Y_00_MASK 0x01ff01ff | ||
| #define MDP_CCORR_R2Y_01_MASK 0x07ff01ff | ||
| #define MDP_CCORR_R2Y_02_MASK 0x07ff07ff | ||
| #define MDP_CCORR_R2Y_03_MASK 0x07ff07ff | ||
| #define MDP_CCORR_R2Y_04_MASK 0x07ff07ff | ||
| #define MDP_CCORR_R2Y_05_MASK 0x07ff07ff | ||
| #define MDP_CCORR_COEF_0_MASK 0x1fff1fff | ||
| #define MDP_CCORR_COEF_1_MASK 0x1fff1fff | ||
| #define MDP_CCORR_COEF_2_MASK 0x1fff1fff | ||
| #define MDP_CCORR_COEF_3_MASK 0x1fff1fff | ||
| #define MDP_CCORR_COEF_4_MASK 0x1fff1fff | ||
| #define MDP_CCORR_SHADOW_MASK 0x00000007 | ||
| #define MDP_CCORR_DUMMY_REG_MASK 0xffffffff | ||
| #define MDP_CCORR_ATPG_MASK 0x00000003 | ||
|
|
||
| #endif // __MDP_REG_CCORR_H__ |
Oops, something went wrong.