Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

interconnect: imx: Add platform driver for imx8mq

Add a platform driver for the i.MX8MQ SoC describing bus topology,
based on internal documentation.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Link: https://lore.kernel.org/r/864310d1f2599c3bd621e70b77028a6e89f6410e.1586174566.git.leonard.crestez@nxp.com
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>

authored by

Leonard Crestez and committed by
Georgi Djakov
63fc8029 2c1966af

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