1*63fc8029SLeonard Crestez // SPDX-License-Identifier: GPL-2.0 2*63fc8029SLeonard Crestez /* 3*63fc8029SLeonard Crestez * Interconnect framework driver for i.MX8MQ SoC 4*63fc8029SLeonard Crestez * 5*63fc8029SLeonard Crestez * Copyright (c) 2019-2020, NXP 6*63fc8029SLeonard Crestez */ 7*63fc8029SLeonard Crestez 8*63fc8029SLeonard Crestez #include <linux/module.h> 9*63fc8029SLeonard Crestez #include <linux/platform_device.h> 10*63fc8029SLeonard Crestez #include <dt-bindings/interconnect/imx8mq.h> 11*63fc8029SLeonard Crestez 12*63fc8029SLeonard Crestez #include "imx.h" 13*63fc8029SLeonard Crestez 14*63fc8029SLeonard Crestez static const struct imx_icc_node_adj_desc imx8mq_dram_adj = { 15*63fc8029SLeonard Crestez .bw_mul = 1, 16*63fc8029SLeonard Crestez .bw_div = 4, 17*63fc8029SLeonard Crestez .phandle_name = "fsl,ddrc", 18*63fc8029SLeonard Crestez }; 19*63fc8029SLeonard Crestez 20*63fc8029SLeonard Crestez static const struct imx_icc_node_adj_desc imx8mq_noc_adj = { 21*63fc8029SLeonard Crestez .bw_mul = 1, 22*63fc8029SLeonard Crestez .bw_div = 4, 23*63fc8029SLeonard Crestez .main_noc = true, 24*63fc8029SLeonard Crestez }; 25*63fc8029SLeonard Crestez 26*63fc8029SLeonard Crestez /* 27*63fc8029SLeonard Crestez * Describe bus masters, slaves and connections between them 28*63fc8029SLeonard Crestez * 29*63fc8029SLeonard Crestez * This is a simplified subset of the bus diagram, there are several other 30*63fc8029SLeonard Crestez * PL301 nics which are skipped/merged into PL301_MAIN 31*63fc8029SLeonard Crestez */ 32*63fc8029SLeonard Crestez static struct imx_icc_node_desc nodes[] = { 33*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("NOC", IMX8MQ_ICN_NOC, &imx8mq_noc_adj, 34*63fc8029SLeonard Crestez IMX8MQ_ICS_DRAM, IMX8MQ_ICN_MAIN), 35*63fc8029SLeonard Crestez 36*63fc8029SLeonard Crestez DEFINE_BUS_SLAVE("DRAM", IMX8MQ_ICS_DRAM, &imx8mq_dram_adj), 37*63fc8029SLeonard Crestez DEFINE_BUS_SLAVE("OCRAM", IMX8MQ_ICS_OCRAM, NULL), 38*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("A53", IMX8MQ_ICM_A53, IMX8MQ_ICN_NOC), 39*63fc8029SLeonard Crestez 40*63fc8029SLeonard Crestez /* VPUMIX */ 41*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("VPU", IMX8MQ_ICM_VPU, IMX8MQ_ICN_VIDEO), 42*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MQ_ICN_VIDEO, NULL, IMX8MQ_ICN_NOC), 43*63fc8029SLeonard Crestez 44*63fc8029SLeonard Crestez /* GPUMIX */ 45*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("GPU", IMX8MQ_ICM_GPU, IMX8MQ_ICN_GPU), 46*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MQ_ICN_GPU, NULL, IMX8MQ_ICN_NOC), 47*63fc8029SLeonard Crestez 48*63fc8029SLeonard Crestez /* DISPMIX (only for DCSS) */ 49*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("DC", IMX8MQ_ICM_DCSS, IMX8MQ_ICN_DCSS), 50*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_DC", IMX8MQ_ICN_DCSS, NULL, IMX8MQ_ICN_NOC), 51*63fc8029SLeonard Crestez 52*63fc8029SLeonard Crestez /* USBMIX */ 53*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("USB1", IMX8MQ_ICM_USB1, IMX8MQ_ICN_USB), 54*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("USB2", IMX8MQ_ICM_USB2, IMX8MQ_ICN_USB), 55*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_USB", IMX8MQ_ICN_USB, NULL, IMX8MQ_ICN_NOC), 56*63fc8029SLeonard Crestez 57*63fc8029SLeonard Crestez /* PL301_DISPLAY (IPs other than DCSS, inside SUPERMIX) */ 58*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("CSI1", IMX8MQ_ICM_CSI1, IMX8MQ_ICN_DISPLAY), 59*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("CSI2", IMX8MQ_ICM_CSI2, IMX8MQ_ICN_DISPLAY), 60*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("LCDIF", IMX8MQ_ICM_LCDIF, IMX8MQ_ICN_DISPLAY), 61*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_DISPLAY", IMX8MQ_ICN_DISPLAY, NULL, IMX8MQ_ICN_MAIN), 62*63fc8029SLeonard Crestez 63*63fc8029SLeonard Crestez /* AUDIO */ 64*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("SDMA2", IMX8MQ_ICM_SDMA2, IMX8MQ_ICN_AUDIO), 65*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MQ_ICN_AUDIO, NULL, IMX8MQ_ICN_DISPLAY), 66*63fc8029SLeonard Crestez 67*63fc8029SLeonard Crestez /* ENET */ 68*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("ENET", IMX8MQ_ICM_ENET, IMX8MQ_ICN_ENET), 69*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MQ_ICN_ENET, NULL, IMX8MQ_ICN_MAIN), 70*63fc8029SLeonard Crestez 71*63fc8029SLeonard Crestez /* OTHER */ 72*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("SDMA1", IMX8MQ_ICM_SDMA1, IMX8MQ_ICN_MAIN), 73*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("NAND", IMX8MQ_ICM_NAND, IMX8MQ_ICN_MAIN), 74*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("USDHC1", IMX8MQ_ICM_USDHC1, IMX8MQ_ICN_MAIN), 75*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("USDHC2", IMX8MQ_ICM_USDHC2, IMX8MQ_ICN_MAIN), 76*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("PCIE1", IMX8MQ_ICM_PCIE1, IMX8MQ_ICN_MAIN), 77*63fc8029SLeonard Crestez DEFINE_BUS_MASTER("PCIE2", IMX8MQ_ICM_PCIE2, IMX8MQ_ICN_MAIN), 78*63fc8029SLeonard Crestez DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MQ_ICN_MAIN, NULL, 79*63fc8029SLeonard Crestez IMX8MQ_ICN_NOC, IMX8MQ_ICS_OCRAM), 80*63fc8029SLeonard Crestez }; 81*63fc8029SLeonard Crestez 82*63fc8029SLeonard Crestez static int imx8mq_icc_probe(struct platform_device *pdev) 83*63fc8029SLeonard Crestez { 84*63fc8029SLeonard Crestez return imx_icc_register(pdev, nodes, ARRAY_SIZE(nodes)); 85*63fc8029SLeonard Crestez } 86*63fc8029SLeonard Crestez 87*63fc8029SLeonard Crestez static int imx8mq_icc_remove(struct platform_device *pdev) 88*63fc8029SLeonard Crestez { 89*63fc8029SLeonard Crestez return imx_icc_unregister(pdev); 90*63fc8029SLeonard Crestez } 91*63fc8029SLeonard Crestez 92*63fc8029SLeonard Crestez static struct platform_driver imx8mq_icc_driver = { 93*63fc8029SLeonard Crestez .probe = imx8mq_icc_probe, 94*63fc8029SLeonard Crestez .remove = imx8mq_icc_remove, 95*63fc8029SLeonard Crestez .driver = { 96*63fc8029SLeonard Crestez .name = "imx8mq-interconnect", 97*63fc8029SLeonard Crestez }, 98*63fc8029SLeonard Crestez }; 99*63fc8029SLeonard Crestez 100*63fc8029SLeonard Crestez module_platform_driver(imx8mq_icc_driver); 101*63fc8029SLeonard Crestez MODULE_ALIAS("platform:imx8mq-interconnect"); 102*63fc8029SLeonard Crestez MODULE_AUTHOR("Leonard Crestez <leonard.crestez@nxp.com>"); 103*63fc8029SLeonard Crestez MODULE_LICENSE("GPL v2"); 104