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 imx8mn

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

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Link: https://lore.kernel.org/r/338a5409ce88811ba6c940ba06441db3faa8c187.1586174566.git.leonard.crestez@nxp.com
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>

authored by

Leonard Crestez and committed by
Georgi Djakov
4b54bf47 63fc8029

+141
+4
drivers/interconnect/imx/Kconfig
··· 8 8 tristate "i.MX8MM interconnect driver" 9 9 depends on INTERCONNECT_IMX 10 10 11 + config INTERCONNECT_IMX8MN 12 + tristate "i.MX8MN interconnect driver" 13 + depends on INTERCONNECT_IMX 14 + 11 15 config INTERCONNECT_IMX8MQ 12 16 tristate "i.MX8MQ interconnect driver" 13 17 depends on INTERCONNECT_IMX
+2
drivers/interconnect/imx/Makefile
··· 1 1 imx-interconnect-objs := imx.o 2 2 imx8mm-interconnect-objs := imx8mm.o 3 3 imx8mq-interconnect-objs := imx8mq.o 4 + imx8mn-interconnect-objs := imx8mn.o 4 5 5 6 obj-$(CONFIG_INTERCONNECT_IMX) += imx-interconnect.o 6 7 obj-$(CONFIG_INTERCONNECT_IMX8MM) += imx8mm-interconnect.o 7 8 obj-$(CONFIG_INTERCONNECT_IMX8MQ) += imx8mq-interconnect.o 9 + obj-$(CONFIG_INTERCONNECT_IMX8MN) += imx8mn-interconnect.o
+94
drivers/interconnect/imx/imx8mn.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Interconnect framework driver for i.MX8MN 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/imx8mn.h> 11 + 12 + #include "imx.h" 13 + 14 + static const struct imx_icc_node_adj_desc imx8mn_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 imx8mn_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", IMX8MN_ICN_NOC, &imx8mn_noc_adj, 34 + IMX8MN_ICS_DRAM, IMX8MN_ICN_MAIN), 35 + 36 + DEFINE_BUS_SLAVE("DRAM", IMX8MN_ICS_DRAM, &imx8mn_dram_adj), 37 + DEFINE_BUS_SLAVE("OCRAM", IMX8MN_ICS_OCRAM, NULL), 38 + DEFINE_BUS_MASTER("A53", IMX8MN_ICM_A53, IMX8MN_ICN_NOC), 39 + 40 + /* GPUMIX */ 41 + DEFINE_BUS_MASTER("GPU", IMX8MN_ICM_GPU, IMX8MN_ICN_GPU), 42 + DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MN_ICN_GPU, NULL, IMX8MN_ICN_NOC), 43 + 44 + /* DISPLAYMIX */ 45 + DEFINE_BUS_MASTER("CSI1", IMX8MN_ICM_CSI1, IMX8MN_ICN_MIPI), 46 + DEFINE_BUS_MASTER("CSI2", IMX8MN_ICM_CSI2, IMX8MN_ICN_MIPI), 47 + DEFINE_BUS_MASTER("ISI", IMX8MN_ICM_ISI, IMX8MN_ICN_MIPI), 48 + DEFINE_BUS_MASTER("LCDIF", IMX8MN_ICM_LCDIF, IMX8MN_ICN_MIPI), 49 + DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MN_ICN_MIPI, NULL, IMX8MN_ICN_NOC), 50 + 51 + /* USB goes straight to NOC */ 52 + DEFINE_BUS_MASTER("USB", IMX8MN_ICM_USB, IMX8MN_ICN_NOC), 53 + 54 + /* Audio */ 55 + DEFINE_BUS_MASTER("SDMA2", IMX8MN_ICM_SDMA2, IMX8MN_ICN_AUDIO), 56 + DEFINE_BUS_MASTER("SDMA3", IMX8MN_ICM_SDMA3, IMX8MN_ICN_AUDIO), 57 + DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MN_ICN_AUDIO, NULL, IMX8MN_ICN_MAIN), 58 + 59 + /* Ethernet */ 60 + DEFINE_BUS_MASTER("ENET", IMX8MN_ICM_ENET, IMX8MN_ICN_ENET), 61 + DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MN_ICN_ENET, NULL, IMX8MN_ICN_MAIN), 62 + 63 + /* Other */ 64 + DEFINE_BUS_MASTER("SDMA1", IMX8MN_ICM_SDMA1, IMX8MN_ICN_MAIN), 65 + DEFINE_BUS_MASTER("NAND", IMX8MN_ICM_NAND, IMX8MN_ICN_MAIN), 66 + DEFINE_BUS_MASTER("USDHC1", IMX8MN_ICM_USDHC1, IMX8MN_ICN_MAIN), 67 + DEFINE_BUS_MASTER("USDHC2", IMX8MN_ICM_USDHC2, IMX8MN_ICN_MAIN), 68 + DEFINE_BUS_MASTER("USDHC3", IMX8MN_ICM_USDHC3, IMX8MN_ICN_MAIN), 69 + DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MN_ICN_MAIN, NULL, 70 + IMX8MN_ICN_NOC, IMX8MN_ICS_OCRAM), 71 + }; 72 + 73 + static int imx8mn_icc_probe(struct platform_device *pdev) 74 + { 75 + return imx_icc_register(pdev, nodes, ARRAY_SIZE(nodes)); 76 + } 77 + 78 + static int imx8mn_icc_remove(struct platform_device *pdev) 79 + { 80 + return imx_icc_unregister(pdev); 81 + } 82 + 83 + static struct platform_driver imx8mn_icc_driver = { 84 + .probe = imx8mn_icc_probe, 85 + .remove = imx8mn_icc_remove, 86 + .driver = { 87 + .name = "imx8mn-interconnect", 88 + }, 89 + }; 90 + 91 + module_platform_driver(imx8mn_icc_driver); 92 + MODULE_ALIAS("platform:imx8mn-interconnect"); 93 + MODULE_AUTHOR("Leonard Crestez <leonard.crestez@nxp.com>"); 94 + MODULE_LICENSE("GPL v2");
+41
include/dt-bindings/interconnect/imx8mn.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_IMX8MN_H 9 + #define __DT_BINDINGS_INTERCONNECT_IMX8MN_H 10 + 11 + #define IMX8MN_ICN_NOC 1 12 + #define IMX8MN_ICS_DRAM 2 13 + #define IMX8MN_ICS_OCRAM 3 14 + #define IMX8MN_ICM_A53 4 15 + 16 + #define IMX8MN_ICM_GPU 5 17 + #define IMX8MN_ICN_GPU 6 18 + 19 + #define IMX8MN_ICM_CSI1 7 20 + #define IMX8MN_ICM_CSI2 8 21 + #define IMX8MN_ICM_ISI 9 22 + #define IMX8MN_ICM_LCDIF 10 23 + #define IMX8MN_ICN_MIPI 11 24 + 25 + #define IMX8MN_ICM_USB 12 26 + 27 + #define IMX8MN_ICM_SDMA2 13 28 + #define IMX8MN_ICM_SDMA3 14 29 + #define IMX8MN_ICN_AUDIO 15 30 + 31 + #define IMX8MN_ICN_ENET 16 32 + #define IMX8MN_ICM_ENET 17 33 + 34 + #define IMX8MN_ICM_NAND 18 35 + #define IMX8MN_ICM_SDMA1 19 36 + #define IMX8MN_ICM_USDHC1 20 37 + #define IMX8MN_ICM_USDHC2 21 38 + #define IMX8MN_ICM_USDHC3 22 39 + #define IMX8MN_ICN_MAIN 23 40 + 41 + #endif /* __DT_BINDINGS_INTERCONNECT_IMX8MN_H */