Skip to content

Commit 2a0a8d8

Browse files
AngeloGioacchino Del Regnombgg
authored andcommitted
soc: mediatek: mtk-mmsys: Split out MT8173 mmsys DDP routing table
MT2701, MT2712 and MT8173 were relying on a "default" DDP I/O routing table, describing all of the possible connections between display block components: while this is definitely working it's suboptimal for the actual routing description, as we may be enabling outputs and inputs that are not needed, possibly impacting on actual DDP performance other than slightly prolonging boot times by having to parse a table that is bigger than needed. Seen that all of the other supported SoCs have got their own table and seen that a comment in mtk-mmsys.h explicitly mentions that the wanted way is to have one table per SoC, create a new routing table that is specifically tailored to MT8173 and, while at it, remove mentions to said SoC from the comment in mtk-mmsys.h. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
1 parent b34884b commit 2a0a8d8

File tree

3 files changed

+99
-3
lines changed

3 files changed

+99
-3
lines changed

drivers/soc/mediatek/mt8173-mmsys.h

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
3+
#ifndef __SOC_MEDIATEK_MT8173_MMSYS_H
4+
#define __SOC_MEDIATEK_MT8173_MMSYS_H
5+
6+
#define MT8173_DISP_REG_CONFIG_DISP_OVL0_MOUT_EN 0x040
7+
#define MT8173_DISP_REG_CONFIG_DISP_OVL1_MOUT_EN 0x044
8+
#define MT8173_DISP_REG_CONFIG_DISP_OD_MOUT_EN 0x048
9+
#define MT8173_DISP_REG_CONFIG_DISP_GAMMA_MOUT_EN 0x04c
10+
#define MT8173_DISP_REG_CONFIG_DISP_UFOE_MOUT_EN 0x050
11+
#define MT8173_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN 0x084
12+
#define MT8173_DISP_REG_CONFIG_DISP_COLOR1_SEL_IN 0x088
13+
#define MT8173_DISP_REG_CONFIG_DISP_AAL_SEL_IN 0x08c
14+
#define MT8173_DISP_REG_CONFIG_DISP_UFOE_SEL_IN 0x0a0
15+
#define MT8173_DISP_REG_CONFIG_DSI0_SEL_IN 0x0a4
16+
#define MT8173_DISP_REG_CONFIG_DPI_SEL_IN 0x0ac
17+
#define MT8173_DISP_REG_CONFIG_DISP_RDMA0_SOUT_SEL_IN 0x0b0
18+
#define MT8173_DISP_REG_CONFIG_DISP_RDMA1_SOUT_EN 0x0c8
19+
#define MT8173_DISP_REG_CONFIG_DISP_COLOR0_SOUT_SEL_IN 0x0bc
20+
21+
#define MT8173_AAL_SEL_IN_MERGE BIT(0)
22+
#define MT8173_COLOR0_SEL_IN_OVL0 BIT(0)
23+
#define MT8173_COLOR0_SOUT_MERGE BIT(0)
24+
#define MT8173_DPI0_SEL_IN_MASK GENMASK(1, 0)
25+
#define MT8173_DPI0_SEL_IN_RDMA1 BIT(0)
26+
#define MT8173_DSI0_SEL_IN_UFOE BIT(0)
27+
#define MT8173_GAMMA_MOUT_EN_RDMA1 BIT(0)
28+
#define MT8173_OD0_MOUT_EN_RDMA0 BIT(0)
29+
#define MT8173_OVL0_MOUT_EN_COLOR0 BIT(0)
30+
#define MT8173_OVL1_MOUT_EN_COLOR1 BIT(0)
31+
#define MT8173_UFOE_MOUT_EN_DSI0 BIT(0)
32+
#define MT8173_UFOE_SEL_IN_RDMA0 BIT(0)
33+
#define MT8173_RDMA0_SOUT_COLOR0 BIT(0)
34+
35+
static const struct mtk_mmsys_routes mt8173_mmsys_routing_table[] = {
36+
{
37+
DDP_COMPONENT_OVL0, DDP_COMPONENT_COLOR0,
38+
MT8173_DISP_REG_CONFIG_DISP_OVL0_MOUT_EN,
39+
MT8173_OVL0_MOUT_EN_COLOR0, MT8173_OVL0_MOUT_EN_COLOR0
40+
}, {
41+
DDP_COMPONENT_OD0, DDP_COMPONENT_RDMA0,
42+
MT8173_DISP_REG_CONFIG_DISP_OD_MOUT_EN,
43+
MT8173_OD0_MOUT_EN_RDMA0, MT8173_OD0_MOUT_EN_RDMA0
44+
}, {
45+
DDP_COMPONENT_UFOE, DDP_COMPONENT_DSI0,
46+
MT8173_DISP_REG_CONFIG_DISP_UFOE_MOUT_EN,
47+
MT8173_UFOE_MOUT_EN_DSI0, MT8173_UFOE_MOUT_EN_DSI0
48+
}, {
49+
DDP_COMPONENT_COLOR0, DDP_COMPONENT_AAL0,
50+
MT8173_DISP_REG_CONFIG_DISP_COLOR0_SOUT_SEL_IN,
51+
MT8173_COLOR0_SOUT_MERGE, 0 /* SOUT to AAL */
52+
}, {
53+
DDP_COMPONENT_RDMA0, DDP_COMPONENT_UFOE,
54+
MT8173_DISP_REG_CONFIG_DISP_RDMA0_SOUT_SEL_IN,
55+
MT8173_RDMA0_SOUT_COLOR0, 0 /* SOUT to UFOE */
56+
}, {
57+
DDP_COMPONENT_OVL0, DDP_COMPONENT_COLOR0,
58+
MT8173_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN,
59+
MT8173_COLOR0_SEL_IN_OVL0, MT8173_COLOR0_SEL_IN_OVL0
60+
}, {
61+
DDP_COMPONENT_AAL0, DDP_COMPONENT_COLOR0,
62+
MT8173_DISP_REG_CONFIG_DISP_AAL_SEL_IN,
63+
MT8173_AAL_SEL_IN_MERGE, 0 /* SEL_IN from COLOR0 */
64+
}, {
65+
DDP_COMPONENT_RDMA0, DDP_COMPONENT_UFOE,
66+
MT8173_DISP_REG_CONFIG_DISP_UFOE_SEL_IN,
67+
MT8173_UFOE_SEL_IN_RDMA0, 0 /* SEL_IN from RDMA0 */
68+
}, {
69+
DDP_COMPONENT_UFOE, DDP_COMPONENT_DSI0,
70+
MT8173_DISP_REG_CONFIG_DSI0_SEL_IN,
71+
MT8173_DSI0_SEL_IN_UFOE, 0, /* SEL_IN from UFOE */
72+
}, {
73+
DDP_COMPONENT_OVL1, DDP_COMPONENT_COLOR1,
74+
MT8173_DISP_REG_CONFIG_DISP_OVL1_MOUT_EN,
75+
MT8173_OVL1_MOUT_EN_COLOR1, MT8173_OVL1_MOUT_EN_COLOR1
76+
}, {
77+
DDP_COMPONENT_GAMMA, DDP_COMPONENT_RDMA1,
78+
MT8173_DISP_REG_CONFIG_DISP_GAMMA_MOUT_EN,
79+
MT8173_GAMMA_MOUT_EN_RDMA1, MT8173_GAMMA_MOUT_EN_RDMA1
80+
}, {
81+
DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
82+
MT8173_DISP_REG_CONFIG_DISP_RDMA1_SOUT_EN,
83+
RDMA1_SOUT_MASK, RDMA1_SOUT_DPI0
84+
}, {
85+
DDP_COMPONENT_OVL1, DDP_COMPONENT_COLOR1,
86+
MT8173_DISP_REG_CONFIG_DISP_COLOR1_SEL_IN,
87+
COLOR1_SEL_IN_OVL1, COLOR1_SEL_IN_OVL1
88+
}, {
89+
DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
90+
MT8173_DISP_REG_CONFIG_DPI_SEL_IN,
91+
MT8173_DPI0_SEL_IN_MASK, MT8173_DPI0_SEL_IN_RDMA1
92+
}
93+
};
94+
95+
#endif /* __SOC_MEDIATEK_MT8173_MMSYS_H */

drivers/soc/mediatek/mtk-mmsys.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "mtk-mmsys.h"
1717
#include "mt8167-mmsys.h"
18+
#include "mt8173-mmsys.h"
1819
#include "mt8183-mmsys.h"
1920
#include "mt8186-mmsys.h"
2021
#include "mt8188-mmsys.h"
@@ -52,8 +53,8 @@ static const struct mtk_mmsys_driver_data mt8167_mmsys_driver_data = {
5253

5354
static const struct mtk_mmsys_driver_data mt8173_mmsys_driver_data = {
5455
.clk_driver = "clk-mt8173-mm",
55-
.routes = mmsys_default_routing_table,
56-
.num_routes = ARRAY_SIZE(mmsys_default_routing_table),
56+
.routes = mt8173_mmsys_routing_table,
57+
.num_routes = ARRAY_SIZE(mt8173_mmsys_routing_table),
5758
.sw0_rst_offset = MT8183_MMSYS_SW0_RST_B,
5859
.num_resets = 32,
5960
};

drivers/soc/mediatek/mtk-mmsys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct mtk_mmsys_driver_data {
9696
};
9797

9898
/*
99-
* Routes in mt8173, mt2701, mt2712 are different. That means
99+
* Routes in mt2701 and mt2712 are different. That means
100100
* in the same register address, it controls different input/output
101101
* selection for each SoC. But, right now, they use the same table as
102102
* default routes meet their requirements. But we don't have the complete

0 commit comments

Comments
 (0)