12c1966afSLeonard Crestez // SPDX-License-Identifier: GPL-2.0 22c1966afSLeonard Crestez /* 32c1966afSLeonard Crestez * Interconnect framework driver for i.MX8MM SoC 42c1966afSLeonard Crestez * 52c1966afSLeonard Crestez * Copyright (c) 2019, BayLibre 62c1966afSLeonard Crestez * Copyright (c) 2019-2020, NXP 72c1966afSLeonard Crestez * Author: Alexandre Bailon <abailon@baylibre.com> 82c1966afSLeonard Crestez * Author: Leonard Crestez <leonard.crestez@nxp.com> 92c1966afSLeonard Crestez */ 102c1966afSLeonard Crestez 112c1966afSLeonard Crestez #include <linux/module.h> 122c1966afSLeonard Crestez #include <linux/platform_device.h> 132c1966afSLeonard Crestez #include <dt-bindings/interconnect/imx8mm.h> 142c1966afSLeonard Crestez 152c1966afSLeonard Crestez #include "imx.h" 162c1966afSLeonard Crestez 172c1966afSLeonard Crestez static const struct imx_icc_node_adj_desc imx8mm_dram_adj = { 182c1966afSLeonard Crestez .bw_mul = 1, 192c1966afSLeonard Crestez .bw_div = 16, 202c1966afSLeonard Crestez .phandle_name = "fsl,ddrc", 212c1966afSLeonard Crestez }; 222c1966afSLeonard Crestez 232c1966afSLeonard Crestez static const struct imx_icc_node_adj_desc imx8mm_noc_adj = { 242c1966afSLeonard Crestez .bw_mul = 1, 252c1966afSLeonard Crestez .bw_div = 16, 262c1966afSLeonard Crestez .main_noc = true, 272c1966afSLeonard Crestez }; 282c1966afSLeonard Crestez 292c1966afSLeonard Crestez /* 302c1966afSLeonard Crestez * Describe bus masters, slaves and connections between them 312c1966afSLeonard Crestez * 322c1966afSLeonard Crestez * This is a simplified subset of the bus diagram, there are several other 332c1966afSLeonard Crestez * PL301 nics which are skipped/merged into PL301_MAIN 342c1966afSLeonard Crestez */ 352c1966afSLeonard Crestez static struct imx_icc_node_desc nodes[] = { 362c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("NOC", IMX8MM_ICN_NOC, &imx8mm_noc_adj, 372c1966afSLeonard Crestez IMX8MM_ICS_DRAM, IMX8MM_ICN_MAIN), 382c1966afSLeonard Crestez 392c1966afSLeonard Crestez DEFINE_BUS_SLAVE("DRAM", IMX8MM_ICS_DRAM, &imx8mm_dram_adj), 402c1966afSLeonard Crestez DEFINE_BUS_SLAVE("OCRAM", IMX8MM_ICS_OCRAM, NULL), 412c1966afSLeonard Crestez DEFINE_BUS_MASTER("A53", IMX8MM_ICM_A53, IMX8MM_ICN_NOC), 422c1966afSLeonard Crestez 432c1966afSLeonard Crestez /* VPUMIX */ 442c1966afSLeonard Crestez DEFINE_BUS_MASTER("VPU H1", IMX8MM_ICM_VPU_H1, IMX8MM_ICN_VIDEO), 452c1966afSLeonard Crestez DEFINE_BUS_MASTER("VPU G1", IMX8MM_ICM_VPU_G1, IMX8MM_ICN_VIDEO), 462c1966afSLeonard Crestez DEFINE_BUS_MASTER("VPU G2", IMX8MM_ICM_VPU_G2, IMX8MM_ICN_VIDEO), 472c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MM_ICN_VIDEO, NULL, IMX8MM_ICN_NOC), 482c1966afSLeonard Crestez 492c1966afSLeonard Crestez /* GPUMIX */ 502c1966afSLeonard Crestez DEFINE_BUS_MASTER("GPU 2D", IMX8MM_ICM_GPU2D, IMX8MM_ICN_GPU), 512c1966afSLeonard Crestez DEFINE_BUS_MASTER("GPU 3D", IMX8MM_ICM_GPU3D, IMX8MM_ICN_GPU), 522c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MM_ICN_GPU, NULL, IMX8MM_ICN_NOC), 532c1966afSLeonard Crestez 542c1966afSLeonard Crestez /* DISPLAYMIX */ 552c1966afSLeonard Crestez DEFINE_BUS_MASTER("CSI", IMX8MM_ICM_CSI, IMX8MM_ICN_MIPI), 562c1966afSLeonard Crestez DEFINE_BUS_MASTER("LCDIF", IMX8MM_ICM_LCDIF, IMX8MM_ICN_MIPI), 572c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MM_ICN_MIPI, NULL, IMX8MM_ICN_NOC), 582c1966afSLeonard Crestez 592c1966afSLeonard Crestez /* HSIO */ 602c1966afSLeonard Crestez DEFINE_BUS_MASTER("USB1", IMX8MM_ICM_USB1, IMX8MM_ICN_HSIO), 612c1966afSLeonard Crestez DEFINE_BUS_MASTER("USB2", IMX8MM_ICM_USB2, IMX8MM_ICN_HSIO), 622c1966afSLeonard Crestez DEFINE_BUS_MASTER("PCIE", IMX8MM_ICM_PCIE, IMX8MM_ICN_HSIO), 632c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_HSIO", IMX8MM_ICN_HSIO, NULL, IMX8MM_ICN_NOC), 642c1966afSLeonard Crestez 652c1966afSLeonard Crestez /* Audio */ 662c1966afSLeonard Crestez DEFINE_BUS_MASTER("SDMA2", IMX8MM_ICM_SDMA2, IMX8MM_ICN_AUDIO), 672c1966afSLeonard Crestez DEFINE_BUS_MASTER("SDMA3", IMX8MM_ICM_SDMA3, IMX8MM_ICN_AUDIO), 682c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MM_ICN_AUDIO, NULL, IMX8MM_ICN_MAIN), 692c1966afSLeonard Crestez 702c1966afSLeonard Crestez /* Ethernet */ 712c1966afSLeonard Crestez DEFINE_BUS_MASTER("ENET", IMX8MM_ICM_ENET, IMX8MM_ICN_ENET), 722c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MM_ICN_ENET, NULL, IMX8MM_ICN_MAIN), 732c1966afSLeonard Crestez 742c1966afSLeonard Crestez /* Other */ 752c1966afSLeonard Crestez DEFINE_BUS_MASTER("SDMA1", IMX8MM_ICM_SDMA1, IMX8MM_ICN_MAIN), 762c1966afSLeonard Crestez DEFINE_BUS_MASTER("NAND", IMX8MM_ICM_NAND, IMX8MM_ICN_MAIN), 772c1966afSLeonard Crestez DEFINE_BUS_MASTER("USDHC1", IMX8MM_ICM_USDHC1, IMX8MM_ICN_MAIN), 782c1966afSLeonard Crestez DEFINE_BUS_MASTER("USDHC2", IMX8MM_ICM_USDHC2, IMX8MM_ICN_MAIN), 792c1966afSLeonard Crestez DEFINE_BUS_MASTER("USDHC3", IMX8MM_ICM_USDHC3, IMX8MM_ICN_MAIN), 802c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MM_ICN_MAIN, NULL, 812c1966afSLeonard Crestez IMX8MM_ICN_NOC, IMX8MM_ICS_OCRAM), 822c1966afSLeonard Crestez }; 832c1966afSLeonard Crestez 842c1966afSLeonard Crestez static int imx8mm_icc_probe(struct platform_device *pdev) 852c1966afSLeonard Crestez { 86*7980d85aSPeng Fan return imx_icc_register(pdev, nodes, ARRAY_SIZE(nodes), NULL); 872c1966afSLeonard Crestez } 882c1966afSLeonard Crestez 892c1966afSLeonard Crestez static int imx8mm_icc_remove(struct platform_device *pdev) 902c1966afSLeonard Crestez { 912c1966afSLeonard Crestez return imx_icc_unregister(pdev); 922c1966afSLeonard Crestez } 932c1966afSLeonard Crestez 942c1966afSLeonard Crestez static struct platform_driver imx8mm_icc_driver = { 952c1966afSLeonard Crestez .probe = imx8mm_icc_probe, 962c1966afSLeonard Crestez .remove = imx8mm_icc_remove, 972c1966afSLeonard Crestez .driver = { 982c1966afSLeonard Crestez .name = "imx8mm-interconnect", 992c1966afSLeonard Crestez }, 1002c1966afSLeonard Crestez }; 1012c1966afSLeonard Crestez 1022c1966afSLeonard Crestez module_platform_driver(imx8mm_icc_driver); 1032c1966afSLeonard Crestez MODULE_AUTHOR("Alexandre Bailon <abailon@baylibre.com>"); 1042c1966afSLeonard Crestez MODULE_LICENSE("GPL v2"); 1052c1966afSLeonard Crestez MODULE_ALIAS("platform:imx8mm-interconnect"); 106