15f9b5b75SYongqiang Niu /* SPDX-License-Identifier: GPL-2.0-only */
25f9b5b75SYongqiang Niu 
35f9b5b75SYongqiang Niu #ifndef __SOC_MEDIATEK_MT8186_MMSYS_H
45f9b5b75SYongqiang Niu #define __SOC_MEDIATEK_MT8186_MMSYS_H
55f9b5b75SYongqiang Niu 
65f9b5b75SYongqiang Niu #define MT8186_MMSYS_OVL_CON			0xF04
75f9b5b75SYongqiang Niu #define MT8186_MMSYS_OVL0_CON_MASK			0x3
85f9b5b75SYongqiang Niu #define MT8186_MMSYS_OVL0_2L_CON_MASK			0xC
95f9b5b75SYongqiang Niu #define MT8186_OVL0_GO_BLEND				BIT(0)
105f9b5b75SYongqiang Niu #define MT8186_OVL0_GO_BG				BIT(1)
115f9b5b75SYongqiang Niu #define MT8186_OVL0_2L_GO_BLEND				BIT(2)
125f9b5b75SYongqiang Niu #define MT8186_OVL0_2L_GO_BG				BIT(3)
135f9b5b75SYongqiang Niu #define MT8186_DISP_RDMA0_SOUT_SEL		0xF0C
145f9b5b75SYongqiang Niu #define MT8186_RDMA0_SOUT_SEL_MASK			0xF
155f9b5b75SYongqiang Niu #define MT8186_RDMA0_SOUT_TO_DSI0			(0)
165f9b5b75SYongqiang Niu #define MT8186_RDMA0_SOUT_TO_COLOR0			(1)
175f9b5b75SYongqiang Niu #define MT8186_RDMA0_SOUT_TO_DPI0			(2)
185f9b5b75SYongqiang Niu #define MT8186_DISP_OVL0_2L_MOUT_EN		0xF14
195f9b5b75SYongqiang Niu #define MT8186_OVL0_2L_MOUT_EN_MASK			0xF
205f9b5b75SYongqiang Niu #define MT8186_OVL0_2L_MOUT_TO_RDMA0			BIT(0)
215f9b5b75SYongqiang Niu #define MT8186_OVL0_2L_MOUT_TO_RDMA1			BIT(3)
225f9b5b75SYongqiang Niu #define MT8186_DISP_OVL0_MOUT_EN		0xF18
235f9b5b75SYongqiang Niu #define MT8186_OVL0_MOUT_EN_MASK			0xF
245f9b5b75SYongqiang Niu #define MT8186_OVL0_MOUT_TO_RDMA0			BIT(0)
255f9b5b75SYongqiang Niu #define MT8186_OVL0_MOUT_TO_RDMA1			BIT(3)
265f9b5b75SYongqiang Niu #define MT8186_DISP_DITHER0_MOUT_EN		0xF20
275f9b5b75SYongqiang Niu #define MT8186_DITHER0_MOUT_EN_MASK			0xF
285f9b5b75SYongqiang Niu #define MT8186_DITHER0_MOUT_TO_DSI0			BIT(0)
295f9b5b75SYongqiang Niu #define MT8186_DITHER0_MOUT_TO_RDMA1			BIT(2)
305f9b5b75SYongqiang Niu #define MT8186_DITHER0_MOUT_TO_DPI0			BIT(3)
315f9b5b75SYongqiang Niu #define MT8186_DISP_RDMA0_SEL_IN		0xF28
325f9b5b75SYongqiang Niu #define MT8186_RDMA0_SEL_IN_MASK			0xF
335f9b5b75SYongqiang Niu #define MT8186_RDMA0_FROM_OVL0				0
345f9b5b75SYongqiang Niu #define MT8186_RDMA0_FROM_OVL0_2L			2
355f9b5b75SYongqiang Niu #define MT8186_DISP_DSI0_SEL_IN			0xF30
365f9b5b75SYongqiang Niu #define MT8186_DSI0_SEL_IN_MASK				0xF
375f9b5b75SYongqiang Niu #define MT8186_DSI0_FROM_RDMA0				0
385f9b5b75SYongqiang Niu #define MT8186_DSI0_FROM_DITHER0			1
395f9b5b75SYongqiang Niu #define MT8186_DSI0_FROM_RDMA1				2
405f9b5b75SYongqiang Niu #define MT8186_DISP_RDMA1_MOUT_EN		0xF3C
415f9b5b75SYongqiang Niu #define MT8186_RDMA1_MOUT_EN_MASK			0xF
425f9b5b75SYongqiang Niu #define MT8186_RDMA1_MOUT_TO_DPI0_SEL			BIT(0)
435f9b5b75SYongqiang Niu #define MT8186_RDMA1_MOUT_TO_DSI0_SEL			BIT(2)
445f9b5b75SYongqiang Niu #define MT8186_DISP_RDMA1_SEL_IN		0xF40
455f9b5b75SYongqiang Niu #define MT8186_RDMA1_SEL_IN_MASK			0xF
465f9b5b75SYongqiang Niu #define MT8186_RDMA1_FROM_OVL0				0
475f9b5b75SYongqiang Niu #define MT8186_RDMA1_FROM_OVL0_2L			2
485f9b5b75SYongqiang Niu #define MT8186_RDMA1_FROM_DITHER0			3
495f9b5b75SYongqiang Niu #define MT8186_DISP_DPI0_SEL_IN			0xF44
505f9b5b75SYongqiang Niu #define MT8186_DPI0_SEL_IN_MASK				0xF
515f9b5b75SYongqiang Niu #define MT8186_DPI0_FROM_RDMA1				0
525f9b5b75SYongqiang Niu #define MT8186_DPI0_FROM_DITHER0			1
535f9b5b75SYongqiang Niu #define MT8186_DPI0_FROM_RDMA0				2
545f9b5b75SYongqiang Niu 
55831785f0SRex-BC Chen #define MT8186_MMSYS_SW0_RST_B				0x160
56831785f0SRex-BC Chen 
575f9b5b75SYongqiang Niu static const struct mtk_mmsys_routes mmsys_mt8186_routing_table[] = {
585f9b5b75SYongqiang Niu 	{
595f9b5b75SYongqiang Niu 		DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
605f9b5b75SYongqiang Niu 		MT8186_DISP_OVL0_MOUT_EN, MT8186_OVL0_MOUT_EN_MASK,
615f9b5b75SYongqiang Niu 		MT8186_OVL0_MOUT_TO_RDMA0
625f9b5b75SYongqiang Niu 	},
635f9b5b75SYongqiang Niu 	{
645f9b5b75SYongqiang Niu 		DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
655f9b5b75SYongqiang Niu 		MT8186_DISP_RDMA0_SEL_IN, MT8186_RDMA0_SEL_IN_MASK,
665f9b5b75SYongqiang Niu 		MT8186_RDMA0_FROM_OVL0
675f9b5b75SYongqiang Niu 	},
685f9b5b75SYongqiang Niu 	{
695f9b5b75SYongqiang Niu 		DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
705f9b5b75SYongqiang Niu 		MT8186_MMSYS_OVL_CON, MT8186_MMSYS_OVL0_CON_MASK,
715f9b5b75SYongqiang Niu 		MT8186_OVL0_GO_BLEND
725f9b5b75SYongqiang Niu 	},
735f9b5b75SYongqiang Niu 	{
745f9b5b75SYongqiang Niu 		DDP_COMPONENT_RDMA0, DDP_COMPONENT_COLOR0,
755f9b5b75SYongqiang Niu 		MT8186_DISP_RDMA0_SOUT_SEL, MT8186_RDMA0_SOUT_SEL_MASK,
765f9b5b75SYongqiang Niu 		MT8186_RDMA0_SOUT_TO_COLOR0
775f9b5b75SYongqiang Niu 	},
785f9b5b75SYongqiang Niu 	{
79*4e8988c6Sjason-jh.lin 		DDP_COMPONENT_DITHER0, DDP_COMPONENT_DSI0,
805f9b5b75SYongqiang Niu 		MT8186_DISP_DITHER0_MOUT_EN, MT8186_DITHER0_MOUT_EN_MASK,
815f9b5b75SYongqiang Niu 		MT8186_DITHER0_MOUT_TO_DSI0,
825f9b5b75SYongqiang Niu 	},
835f9b5b75SYongqiang Niu 	{
84*4e8988c6Sjason-jh.lin 		DDP_COMPONENT_DITHER0, DDP_COMPONENT_DSI0,
855f9b5b75SYongqiang Niu 		MT8186_DISP_DSI0_SEL_IN, MT8186_DSI0_SEL_IN_MASK,
865f9b5b75SYongqiang Niu 		MT8186_DSI0_FROM_DITHER0
875f9b5b75SYongqiang Niu 	},
885f9b5b75SYongqiang Niu 	{
895f9b5b75SYongqiang Niu 		DDP_COMPONENT_OVL_2L0, DDP_COMPONENT_RDMA1,
905f9b5b75SYongqiang Niu 		MT8186_DISP_OVL0_2L_MOUT_EN, MT8186_OVL0_2L_MOUT_EN_MASK,
915f9b5b75SYongqiang Niu 		MT8186_OVL0_2L_MOUT_TO_RDMA1
925f9b5b75SYongqiang Niu 	},
935f9b5b75SYongqiang Niu 	{
945f9b5b75SYongqiang Niu 		DDP_COMPONENT_OVL_2L0, DDP_COMPONENT_RDMA1,
955f9b5b75SYongqiang Niu 		MT8186_DISP_RDMA1_SEL_IN, MT8186_RDMA1_SEL_IN_MASK,
965f9b5b75SYongqiang Niu 		MT8186_RDMA1_FROM_OVL0_2L
975f9b5b75SYongqiang Niu 	},
985f9b5b75SYongqiang Niu 	{
995f9b5b75SYongqiang Niu 		DDP_COMPONENT_OVL_2L0, DDP_COMPONENT_RDMA1,
1005f9b5b75SYongqiang Niu 		MT8186_MMSYS_OVL_CON, MT8186_MMSYS_OVL0_2L_CON_MASK,
1015f9b5b75SYongqiang Niu 		MT8186_OVL0_2L_GO_BLEND
1025f9b5b75SYongqiang Niu 	},
1035f9b5b75SYongqiang Niu 	{
1045f9b5b75SYongqiang Niu 		DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
1055f9b5b75SYongqiang Niu 		MT8186_DISP_RDMA1_MOUT_EN, MT8186_RDMA1_MOUT_EN_MASK,
1065f9b5b75SYongqiang Niu 		MT8186_RDMA1_MOUT_TO_DPI0_SEL
1075f9b5b75SYongqiang Niu 	},
1085f9b5b75SYongqiang Niu 	{
1095f9b5b75SYongqiang Niu 		DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
1105f9b5b75SYongqiang Niu 		MT8186_DISP_DPI0_SEL_IN, MT8186_DPI0_SEL_IN_MASK,
1115f9b5b75SYongqiang Niu 		MT8186_DPI0_FROM_RDMA1
1125f9b5b75SYongqiang Niu 	},
1135f9b5b75SYongqiang Niu };
1145f9b5b75SYongqiang Niu 
1155f9b5b75SYongqiang Niu #endif /* __SOC_MEDIATEK_MT8186_MMSYS_H */
116