Skip to content

Commit bd4f5f6

Browse files
AngeloGioacchino Del Regnokrzk
authored andcommitted
memory: mtk-smi: Add support for Dimensity 1200 MT6893 SMI
Add the necessary platform data to enable support for the SMI found on the MediaTek Dimensity 1200 (MT6893) SoC Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 98a4109 commit bd4f5f6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

drivers/memory/mtk-smi.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,43 @@ static int mtk_smi_larb_config_port_gen2_general(struct device *dev)
283283
return 0;
284284
}
285285

286+
static const u8 mtk_smi_larb_mt6893_ostd[][SMI_LARB_PORT_NR_MAX] = {
287+
[0] = {0x2, 0x6, 0x2, 0x2, 0x2, 0x28, 0x18, 0x18, 0x1, 0x1, 0x1, 0x8,
288+
0x8, 0x1, 0x3f},
289+
[1] = {0x2, 0x6, 0x2, 0x2, 0x2, 0x28, 0x18, 0x18, 0x1, 0x1, 0x1, 0x8,
290+
0x8, 0x1, 0x3f},
291+
[2] = {0x5, 0x5, 0x5, 0x5, 0x1, 0x3f},
292+
[3] = {0x5, 0x5, 0x5, 0x5, 0x1, 0x3f},
293+
[4] = {0x28, 0x19, 0xb, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x4, 0x1},
294+
[5] = {0x1, 0x1, 0x4, 0x1, 0x1, 0x1, 0x1, 0x16},
295+
[6] = {},
296+
[7] = {0x1, 0x4, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x4, 0x4, 0x1,
297+
0x4, 0x1, 0xa, 0x6, 0x1, 0xa, 0x6, 0x1, 0x1, 0x1, 0x1, 0x5,
298+
0x3, 0x3, 0x4},
299+
[8] = {0x1, 0x4, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x4, 0x4, 0x1,
300+
0x4, 0x1, 0xa, 0x6, 0x1, 0xa, 0x6, 0x1, 0x1, 0x1, 0x1, 0x5,
301+
0x3, 0x3, 0x4},
302+
[9] = {0x9, 0x7, 0xf, 0x8, 0x1, 0x8, 0x9, 0x3, 0x3, 0x6, 0x7, 0x4,
303+
0x9, 0x3, 0x4, 0xe, 0x1, 0x7, 0x8, 0x7, 0x7, 0x1, 0x6, 0x2,
304+
0xf, 0x8, 0x1, 0x1, 0x1},
305+
[10] = {},
306+
[11] = {0x9, 0x7, 0xf, 0x8, 0x1, 0x8, 0x9, 0x3, 0x3, 0x6, 0x7, 0x4,
307+
0x9, 0x3, 0x4, 0xe, 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1,
308+
0x1, 0x1, 0x1, 0x1, 0x1},
309+
[12] = {},
310+
[13] = {0x2, 0xc, 0xc, 0xe, 0x6, 0x6, 0x6, 0x6, 0x6, 0x12, 0x6, 0x1},
311+
[14] = {0x2, 0xc, 0xc, 0x28, 0x12, 0x6},
312+
[15] = {0x28, 0x1, 0x2, 0x28, 0x1},
313+
[16] = {0x28, 0x14, 0x2, 0xc, 0x18, 0x2, 0x14, 0x14, 0x4, 0x4, 0x4, 0x2,
314+
0x4, 0x2, 0x8, 0x4, 0x4},
315+
[17] = {0x28, 0x14, 0x2, 0xc, 0x18, 0x2, 0x14, 0x14, 0x4, 0x4, 0x4, 0x2,
316+
0x4, 0x2, 0x8, 0x4, 0x4},
317+
[18] = {0x28, 0x14, 0x2, 0xc, 0x18, 0x2, 0x14, 0x14, 0x4, 0x4, 0x4, 0x2,
318+
0x4, 0x2, 0x8, 0x4, 0x4},
319+
[19] = {0x2, 0x2, 0x4, 0x2},
320+
[20] = {0x9, 0x9, 0x5, 0x5, 0x1, 0x1},
321+
};
322+
286323
static const u8 mtk_smi_larb_mt8188_ostd[][SMI_LARB_PORT_NR_MAX] = {
287324
[0] = {0x02, 0x18, 0x22, 0x22, 0x01, 0x02, 0x0a,},
288325
[1] = {0x12, 0x02, 0x14, 0x14, 0x01, 0x18, 0x0a,},
@@ -429,6 +466,12 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt6779 = {
429466
/* DUMMY | IPU0 | IPU1 | CCU | MDLA */
430467
};
431468

469+
static const struct mtk_smi_larb_gen mtk_smi_larb_mt6893 = {
470+
.config_port = mtk_smi_larb_config_port_gen2_general,
471+
.flags_general = MTK_SMI_FLAG_THRT_UPDATE | MTK_SMI_FLAG_SW_FLAG,
472+
.ostd = mtk_smi_larb_mt6893_ostd,
473+
};
474+
432475
static const struct mtk_smi_larb_gen mtk_smi_larb_mt8167 = {
433476
/* mt8167 do not need the port in larb */
434477
.config_port = mtk_smi_larb_config_port_mt8167,
@@ -474,6 +517,7 @@ static const struct of_device_id mtk_smi_larb_of_ids[] = {
474517
{.compatible = "mediatek,mt2712-smi-larb", .data = &mtk_smi_larb_mt2712},
475518
{.compatible = "mediatek,mt6779-smi-larb", .data = &mtk_smi_larb_mt6779},
476519
{.compatible = "mediatek,mt6795-smi-larb", .data = &mtk_smi_larb_mt8173},
520+
{.compatible = "mediatek,mt6893-smi-larb", .data = &mtk_smi_larb_mt6893},
477521
{.compatible = "mediatek,mt8167-smi-larb", .data = &mtk_smi_larb_mt8167},
478522
{.compatible = "mediatek,mt8173-smi-larb", .data = &mtk_smi_larb_mt8173},
479523
{.compatible = "mediatek,mt8183-smi-larb", .data = &mtk_smi_larb_mt8183},
@@ -694,6 +738,13 @@ static const struct mtk_smi_common_plat mtk_smi_common_mt6795 = {
694738
.init = mtk_smi_common_mt6795_init,
695739
};
696740

741+
static const struct mtk_smi_common_plat mtk_smi_common_mt6893 = {
742+
.type = MTK_SMI_GEN2,
743+
.has_gals = true,
744+
.bus_sel = F_MMU1_LARB(1) | F_MMU1_LARB(2) | F_MMU1_LARB(4) |
745+
F_MMU1_LARB(5) | F_MMU1_LARB(7),
746+
};
747+
697748
static const struct mtk_smi_common_plat mtk_smi_common_mt8183 = {
698749
.type = MTK_SMI_GEN2,
699750
.has_gals = true,
@@ -756,6 +807,7 @@ static const struct of_device_id mtk_smi_common_of_ids[] = {
756807
{.compatible = "mediatek,mt2712-smi-common", .data = &mtk_smi_common_gen2},
757808
{.compatible = "mediatek,mt6779-smi-common", .data = &mtk_smi_common_mt6779},
758809
{.compatible = "mediatek,mt6795-smi-common", .data = &mtk_smi_common_mt6795},
810+
{.compatible = "mediatek,mt6893-smi-common", .data = &mtk_smi_common_mt6893},
759811
{.compatible = "mediatek,mt8167-smi-common", .data = &mtk_smi_common_gen2},
760812
{.compatible = "mediatek,mt8173-smi-common", .data = &mtk_smi_common_gen2},
761813
{.compatible = "mediatek,mt8183-smi-common", .data = &mtk_smi_common_mt8183},

0 commit comments

Comments
 (0)