1*2c1966afSLeonard Crestez // SPDX-License-Identifier: GPL-2.0 2*2c1966afSLeonard Crestez /* 3*2c1966afSLeonard Crestez * Interconnect framework driver for i.MX8MM SoC 4*2c1966afSLeonard Crestez * 5*2c1966afSLeonard Crestez * Copyright (c) 2019, BayLibre 6*2c1966afSLeonard Crestez * Copyright (c) 2019-2020, NXP 7*2c1966afSLeonard Crestez * Author: Alexandre Bailon <abailon@baylibre.com> 8*2c1966afSLeonard Crestez * Author: Leonard Crestez <leonard.crestez@nxp.com> 9*2c1966afSLeonard Crestez */ 10*2c1966afSLeonard Crestez 11*2c1966afSLeonard Crestez #include <linux/module.h> 12*2c1966afSLeonard Crestez #include <linux/platform_device.h> 13*2c1966afSLeonard Crestez #include <dt-bindings/interconnect/imx8mm.h> 14*2c1966afSLeonard Crestez 15*2c1966afSLeonard Crestez #include "imx.h" 16*2c1966afSLeonard Crestez 17*2c1966afSLeonard Crestez static const struct imx_icc_node_adj_desc imx8mm_dram_adj = { 18*2c1966afSLeonard Crestez .bw_mul = 1, 19*2c1966afSLeonard Crestez .bw_div = 16, 20*2c1966afSLeonard Crestez .phandle_name = "fsl,ddrc", 21*2c1966afSLeonard Crestez }; 22*2c1966afSLeonard Crestez 23*2c1966afSLeonard Crestez static const struct imx_icc_node_adj_desc imx8mm_noc_adj = { 24*2c1966afSLeonard Crestez .bw_mul = 1, 25*2c1966afSLeonard Crestez .bw_div = 16, 26*2c1966afSLeonard Crestez .main_noc = true, 27*2c1966afSLeonard Crestez }; 28*2c1966afSLeonard Crestez 29*2c1966afSLeonard Crestez /* 30*2c1966afSLeonard Crestez * Describe bus masters, slaves and connections between them 31*2c1966afSLeonard Crestez * 32*2c1966afSLeonard Crestez * This is a simplified subset of the bus diagram, there are several other 33*2c1966afSLeonard Crestez * PL301 nics which are skipped/merged into PL301_MAIN 34*2c1966afSLeonard Crestez */ 35*2c1966afSLeonard Crestez static struct imx_icc_node_desc nodes[] = { 36*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("NOC", IMX8MM_ICN_NOC, &imx8mm_noc_adj, 37*2c1966afSLeonard Crestez IMX8MM_ICS_DRAM, IMX8MM_ICN_MAIN), 38*2c1966afSLeonard Crestez 39*2c1966afSLeonard Crestez DEFINE_BUS_SLAVE("DRAM", IMX8MM_ICS_DRAM, &imx8mm_dram_adj), 40*2c1966afSLeonard Crestez DEFINE_BUS_SLAVE("OCRAM", IMX8MM_ICS_OCRAM, NULL), 41*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("A53", IMX8MM_ICM_A53, IMX8MM_ICN_NOC), 42*2c1966afSLeonard Crestez 43*2c1966afSLeonard Crestez /* VPUMIX */ 44*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("VPU H1", IMX8MM_ICM_VPU_H1, IMX8MM_ICN_VIDEO), 45*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("VPU G1", IMX8MM_ICM_VPU_G1, IMX8MM_ICN_VIDEO), 46*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("VPU G2", IMX8MM_ICM_VPU_G2, IMX8MM_ICN_VIDEO), 47*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MM_ICN_VIDEO, NULL, IMX8MM_ICN_NOC), 48*2c1966afSLeonard Crestez 49*2c1966afSLeonard Crestez /* GPUMIX */ 50*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("GPU 2D", IMX8MM_ICM_GPU2D, IMX8MM_ICN_GPU), 51*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("GPU 3D", IMX8MM_ICM_GPU3D, IMX8MM_ICN_GPU), 52*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MM_ICN_GPU, NULL, IMX8MM_ICN_NOC), 53*2c1966afSLeonard Crestez 54*2c1966afSLeonard Crestez /* DISPLAYMIX */ 55*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("CSI", IMX8MM_ICM_CSI, IMX8MM_ICN_MIPI), 56*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("LCDIF", IMX8MM_ICM_LCDIF, IMX8MM_ICN_MIPI), 57*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MM_ICN_MIPI, NULL, IMX8MM_ICN_NOC), 58*2c1966afSLeonard Crestez 59*2c1966afSLeonard Crestez /* HSIO */ 60*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("USB1", IMX8MM_ICM_USB1, IMX8MM_ICN_HSIO), 61*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("USB2", IMX8MM_ICM_USB2, IMX8MM_ICN_HSIO), 62*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("PCIE", IMX8MM_ICM_PCIE, IMX8MM_ICN_HSIO), 63*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_HSIO", IMX8MM_ICN_HSIO, NULL, IMX8MM_ICN_NOC), 64*2c1966afSLeonard Crestez 65*2c1966afSLeonard Crestez /* Audio */ 66*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("SDMA2", IMX8MM_ICM_SDMA2, IMX8MM_ICN_AUDIO), 67*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("SDMA3", IMX8MM_ICM_SDMA3, IMX8MM_ICN_AUDIO), 68*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MM_ICN_AUDIO, NULL, IMX8MM_ICN_MAIN), 69*2c1966afSLeonard Crestez 70*2c1966afSLeonard Crestez /* Ethernet */ 71*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("ENET", IMX8MM_ICM_ENET, IMX8MM_ICN_ENET), 72*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MM_ICN_ENET, NULL, IMX8MM_ICN_MAIN), 73*2c1966afSLeonard Crestez 74*2c1966afSLeonard Crestez /* Other */ 75*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("SDMA1", IMX8MM_ICM_SDMA1, IMX8MM_ICN_MAIN), 76*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("NAND", IMX8MM_ICM_NAND, IMX8MM_ICN_MAIN), 77*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("USDHC1", IMX8MM_ICM_USDHC1, IMX8MM_ICN_MAIN), 78*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("USDHC2", IMX8MM_ICM_USDHC2, IMX8MM_ICN_MAIN), 79*2c1966afSLeonard Crestez DEFINE_BUS_MASTER("USDHC3", IMX8MM_ICM_USDHC3, IMX8MM_ICN_MAIN), 80*2c1966afSLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MM_ICN_MAIN, NULL, 81*2c1966afSLeonard Crestez IMX8MM_ICN_NOC, IMX8MM_ICS_OCRAM), 82*2c1966afSLeonard Crestez }; 83*2c1966afSLeonard Crestez 84*2c1966afSLeonard Crestez static int imx8mm_icc_probe(struct platform_device *pdev) 85*2c1966afSLeonard Crestez { 86*2c1966afSLeonard Crestez return imx_icc_register(pdev, nodes, ARRAY_SIZE(nodes)); 87*2c1966afSLeonard Crestez } 88*2c1966afSLeonard Crestez 89*2c1966afSLeonard Crestez static int imx8mm_icc_remove(struct platform_device *pdev) 90*2c1966afSLeonard Crestez { 91*2c1966afSLeonard Crestez return imx_icc_unregister(pdev); 92*2c1966afSLeonard Crestez } 93*2c1966afSLeonard Crestez 94*2c1966afSLeonard Crestez static struct platform_driver imx8mm_icc_driver = { 95*2c1966afSLeonard Crestez .probe = imx8mm_icc_probe, 96*2c1966afSLeonard Crestez .remove = imx8mm_icc_remove, 97*2c1966afSLeonard Crestez .driver = { 98*2c1966afSLeonard Crestez .name = "imx8mm-interconnect", 99*2c1966afSLeonard Crestez }, 100*2c1966afSLeonard Crestez }; 101*2c1966afSLeonard Crestez 102*2c1966afSLeonard Crestez module_platform_driver(imx8mm_icc_driver); 103*2c1966afSLeonard Crestez MODULE_AUTHOR("Alexandre Bailon <abailon@baylibre.com>"); 104*2c1966afSLeonard Crestez MODULE_LICENSE("GPL v2"); 105*2c1966afSLeonard Crestez MODULE_ALIAS("platform:imx8mm-interconnect"); 106