/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2020 MediaTek Inc. */ #ifndef __SMI_PORT_H__ #define __SMI_PORT_H__ #define SMI_OSTD_MAX (0x3f) #define SMI_COMM_MASTER_NUM (1 << 3) #define SMI_LARB_NUM 12 #define SMI_LARB0_PORT_NUM 9 /* DIS */ #define SMI_LARB1_PORT_NUM 14 /* DIS */ #define SMI_LARB2_PORT_NUM 12 /* VDE */ #define SMI_LARB3_PORT_NUM 19 /* VEN */ #define SMI_LARB4_PORT_NUM 0 /* DUMMY */ #define SMI_LARB5_PORT_NUM 26 /* ISP */ #define SMI_LARB6_PORT_NUM 3 /* IPU */ #define SMI_LARB7_PORT_NUM 4 /* IPE */ #define SMI_LARB8_PORT_NUM 10 /* IPE */ #define SMI_LARB9_PORT_NUM 24 /* CAM */ #define SMI_LARB10_PORT_NUM 31 /* CAM */ #define SMI_LARB11_PORT_NUM 5 /* IPU */ #define SMI_COMM_NUM (1) #define SMI_DEV_NUM ((SMI_LARB_NUM) + (SMI_COMM_NUM)) static const bool SMI_COMM_BUS_SEL[SMI_COMM_MASTER_NUM] = {0, 1, 1, 0, 1, 1, 1, 1}; static const u32 SMI_LARB_L1ARB[SMI_LARB_NUM] = { 0, 1, 2, 3, SMI_COMM_MASTER_NUM, 4, SMI_COMM_MASTER_NUM, 5, 5, 7, 6, SMI_COMM_MASTER_NUM}; static const u8 SMI_LARB_PORT_NUM[SMI_LARB_NUM] = { 9, 14, 12, 19, 0, 26, 3, 4, 10, 24, 31, 5}; #define SMI_LARB_PORT_ID(l, p) (((l) << 16) | ((p) & 0xffff)) /* MMSYS */ #define SMI_PORT_DISP_POSTMASK0 SMI_LARB_PORT_ID(0, 0) #define SMI_PORT_DISP_OVL0_HDR SMI_LARB_PORT_ID(0, 1) #define SMI_PORT_DISP_OVL0 SMI_LARB_PORT_ID(0, 3) #define SMI_PORT_DISP_RDMA0 SMI_LARB_PORT_ID(0, 6) #define SMI_PORT_DISP_WDMA0 SMI_LARB_PORT_ID(0, 7) #define SMI_PORT_DISP_OVL0_2L_HDR SMI_LARB_PORT_ID(1, 0) #define SMI_PORT_DISP_OVL0_2L SMI_LARB_PORT_ID(1, 2) #define SMI_PORT_DISP_OVL1_2L SMI_LARB_PORT_ID(1, 3) #define SMI_PORT_DISP_RDMA1 SMI_LARB_PORT_ID(1, 4) #define SMI_PORT_MDP_RDMA0 SMI_LARB_PORT_ID(1, 7) #define SMI_PORT_MDP_RDMA1 SMI_LARB_PORT_ID(1, 8) #define SMI_PORT_MDP_WROT0_R SMI_LARB_PORT_ID(1, 9) #define SMI_PORT_MDP_WROT1_R SMI_LARB_PORT_ID(1, 11) /* VDEC */ #define SMI_PORT_VDEC_MC SMI_LARB_PORT_ID(2, 0) #define SMI_PORT_VDEC_UFO SMI_LARB_PORT_ID(2, 1) #define SMI_PORT_VDEC_PP SMI_LARB_PORT_ID(2, 2) #define SMI_PORT_VDEC_PRED_RD SMI_LARB_PORT_ID(2, 3) #define SMI_PORT_VDEC_PRED_WR SMI_LARB_PORT_ID(2, 4) #define SMI_PORT_VDEC_PPWRAP SMI_LARB_PORT_ID(2, 5) #define SMI_PORT_VDEC_TILE SMI_LARB_PORT_ID(2, 6) #define SMI_PORT_VDEC_VLD SMI_LARB_PORT_ID(2, 7) #define SMI_PORT_VDEC_VLD2 SMI_LARB_PORT_ID(2, 8) #define SMI_PORT_VDEC_AVC_MV SMI_LARB_PORT_ID(2, 9) #define SMI_PORT_VDEC_UFO_ENC SMI_LARB_PORT_ID(2, 10) #define SMI_PORT_VDEC_RG_CTRL_DMA SMI_LARB_PORT_ID(2, 11) /* VENC */ #define SMI_PORT_VENC_RCPU SMI_LARB_PORT_ID(3, 0) #define SMI_PORT_VENC_REC SMI_LARB_PORT_ID(3, 1) #define SMI_PORT_VENC_BSDMA SMI_LARB_PORT_ID(3, 2) #define SMI_PORT_VENC_SV_COMV SMI_LARB_PORT_ID(3, 3) #define SMI_PORT_VENC_RD_COMV SMI_LARB_PORT_ID(3, 4) #define SMI_PORT_JPGENC_Y_RDMA SMI_LARB_PORT_ID(3, 7) #define SMI_PORT_JPGENC_C_RDMA SMI_LARB_PORT_ID(3, 8) #define SMI_PORT_JPGENC_Q_TABLE SMI_LARB_PORT_ID(3, 9) #define SMI_PORT_JPGENC_BSDMA SMI_LARB_PORT_ID(3, 10) #define SMI_PORT_VENC_CUR_LUMA SMI_LARB_PORT_ID(3, 15) #define SMI_PORT_VENC_CUR_CHROMA SMI_LARB_PORT_ID(3, 16) #define SMI_PORT_VENC_REF_LUMA SMI_LARB_PORT_ID(3, 17) #define SMI_PORT_VENC_REF_CHROMA SMI_LARB_PORT_ID(3, 18) /* IMG */ #define SMI_PORT_IMGI_D1 SMI_LARB_PORT_ID(5, 0) #define SMI_PORT_IMGCI_D1 SMI_LARB_PORT_ID(5, 1) #define SMI_PORT_DMGI_D1 SMI_LARB_PORT_ID(5, 2) #define SMI_PORT_UFDI_D1 SMI_LARB_PORT_ID(5, 3) #define SMI_PORT_LCI_D1 SMI_LARB_PORT_ID(5, 4) #define SMI_PORT_SMTI_D1 SMI_LARB_PORT_ID(5, 5) #define SMI_PORT_SMTO_D2 SMI_LARB_PORT_ID(5, 6) #define SMI_PORT_SMTO_D1 SMI_LARB_PORT_ID(5, 7) #define SMI_PORT_CRZO_D1 SMI_LARB_PORT_ID(5, 8) #define SMI_PORT_UFOYW SMI_LARB_PORT_ID(5, 9) #define SMI_PORT_UFOCW SMI_LARB_PORT_ID(5, 10) #define SMI_PORT_UFOYR SMI_LARB_PORT_ID(5, 11) #define SMI_PORT_UFOCR SMI_LARB_PORT_ID(5, 12) #define SMI_PORT_UFOY2R SMI_LARB_PORT_ID(5, 13) #define SMI_PORT_UFOC2R SMI_LARB_PORT_ID(5, 14) #define SMI_PORT_WPE_RDMA1 SMI_LARB_PORT_ID(5, 15) #define SMI_PORT_WPR_RDMA0 SMI_LARB_PORT_ID(5, 16) #define SMI_PORT_WPR_WDMA SMI_LARB_PORT_ID(5, 17) #define SMI_PORT_TIMGO_D1 SMI_LARB_PORT_ID(5, 18) #define SMI_PORT_PRVYR SMI_LARB_PORT_ID(5, 19) /* IPE */ #define SMI_PORT_FDVT_RDA SMI_LARB_PORT_ID(8, 0) #define SMI_PORT_FDVT_RDB SMI_LARB_PORT_ID(8, 1) #define SMI_PORT_FDVT_WRA SMI_LARB_PORT_ID(8, 2) #define SMI_PORT_FDVT_WRB SMI_LARB_PORT_ID(8, 3) #define SMI_PORT_RSC_RDMA0 SMI_LARB_PORT_ID(8, 8) #define SMI_PORT_RSC_WDMA SMI_LARB_PORT_ID(8, 9) /* CAM */ #define SMI_PORT_IMGO_R1_C SMI_LARB_PORT_ID(9, 0) #define SMI_PORT_RRZO_R1_C SMI_LARB_PORT_ID(9, 1) #define SMI_PORT_LSCI_R1_C SMI_LARB_PORT_ID(9, 2) #define SMI_PORT_BPCI_R1_C SMI_LARB_PORT_ID(9, 3) #define SMI_PORT_YUVO_R1_C SMI_LARB_PORT_ID(9, 4) #define SMI_PORT_UFDI_R2_C SMI_LARB_PORT_ID(9, 5) #define SMI_PORT_RAWI_R2_C SMI_LARB_PORT_ID(9, 6) #define SMI_PORT_CAMSV_1 SMI_LARB_PORT_ID(9, 8) #define SMI_PORT_CAMSV_2 SMI_LARB_PORT_ID(9, 9) #define SMI_PORT_CAMSV_3 SMI_LARB_PORT_ID(9, 10) #define SMI_PORT_AAO_R1_C SMI_LARB_PORT_ID(9, 14) #define SMI_PORT_AFO_R1_C SMI_LARB_PORT_ID(9, 15) #define SMI_PORT_FLKO_R1_C SMI_LARB_PORT_ID(9, 16) #define SMI_PORT_LCESO_R1_C SMI_LARB_PORT_ID(9, 17) #define SMI_PORT_CRZO_R1_C SMI_LARB_PORT_ID(9, 18) #define SMI_PORT_LTMSO_R1_C SMI_LARB_PORT_ID(9, 19) #define SMI_PORT_RSSO_R1_C SMI_LARB_PORT_ID(9, 20) #define SMI_PORT_CCUI SMI_LARB_PORT_ID(9, 21) #define SMI_PORT_CCUO SMI_LARB_PORT_ID(9, 22) #define SMI_PORT_IMGO_R1_A SMI_LARB_PORT_ID(10, 0) #define SMI_PORT_RRZO_R1_A SMI_LARB_PORT_ID(10, 1) #define SMI_PORT_LSCI_R1_A SMI_LARB_PORT_ID(10, 2) #define SMI_PORT_BPCI_R1_A SMI_LARB_PORT_ID(10, 3) #define SMI_PORT_YUVO_R1_A SMI_LARB_PORT_ID(10, 4) #define SMI_PORT_UFDI_R2_A SMI_LARB_PORT_ID(10, 5) #define SMI_PORT_RAWI_R2_A SMI_LARB_PORT_ID(10, 6) #define SMI_PORT_IMGO_R1_B SMI_LARB_PORT_ID(10, 8) #define SMI_PORT_RRZO_R1_B SMI_LARB_PORT_ID(10, 9) #define SMI_PORT_LSCI_R1_B SMI_LARB_PORT_ID(10, 10) #define SMI_PORT_BPCI_R1_B SMI_LARB_PORT_ID(10, 11) #define SMI_PORT_YUVO_R1_B SMI_LARB_PORT_ID(10, 12) #define SMI_PORT_UFDI_R2_B SMI_LARB_PORT_ID(10, 13) #define SMI_PORT_RAWI_R2_b SMI_LARB_PORT_ID(10, 14) #define SMI_PORT_AAO_R1_A SMI_LARB_PORT_ID(10, 17) #define SMI_PORT_AFO_R1_A SMI_LARB_PORT_ID(10, 18) #define SMI_PORT_FLKO_R1_A SMI_LARB_PORT_ID(10, 19) #define SMI_PORT_LCESO_R1_A SMI_LARB_PORT_ID(10, 20) #define SMI_PORT_CRZO_R1_A SMI_LARB_PORT_ID(10, 21) #define SMI_PORT_AAO_R1_B SMI_LARB_PORT_ID(10, 22) #define SMI_PORT_AFO_R1_B SMI_LARB_PORT_ID(10, 23) #define SMI_PORT_FLKO_R1_B SMI_LARB_PORT_ID(10, 24) #define SMI_PORT_LCESO_R1_B SMI_LARB_PORT_ID(10, 25) #define SMI_PORT_CRZO_R1_B SMI_LARB_PORT_ID(10, 26) #define SMI_PORT_LTMSO_R1_A SMI_LARB_PORT_ID(10, 27) #define SMI_PORT_RSSO_R1_A SMI_LARB_PORT_ID(10, 28) #define SMI_PORT_LTMSO_R1_B SMI_LARB_PORT_ID(10, 29) #define SMI_PORT_RSSO_R1_B SMI_LARB_PORT_ID(10, 30) #endif