Lines Matching full:mc
3 * Freescale Management Complex (MC) bus driver
11 #define pr_fmt(fmt) "fsl-mc: " fmt
26 #include "fsl-mc-private.h"
29 * Default DMA mask for devices on a fsl-mc bus
36 * struct fsl_mc - Private data of a "fsl,qoriq-mc" platform device
37 * @root_mc_bus_dev: fsl-mc device representing the root DPRC
52 * @mc_region_type: Type of MC region for the range being translated
53 * @start_mc_offset: Start MC offset of the range being translated
54 * @end_mc_offset: MC offset of the first byte after the range (last MC
77 * @dev: the fsl-mc device to match against
78 * @drv: the device driver to search for matching fsl-mc object type
132 if (add_uevent_var(env, "MODALIAS=fsl-mc:v%08Xd%s", in fsl_mc_bus_uevent()
178 return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor, in modalias_show()
313 .name = "fsl-mc",
479 * MC bus
515 * MC bus
545 /* send command to mc*/ in mc_get_version()
560 * fsl_mc_get_version - function to retrieve the MC f/w version information
562 * Return: mc version when called after fsl-mc-bus probe; NULL otherwise.
636 struct fsl_mc *mc; in translate_mc_addr() local
639 mc = dev_get_drvdata(root_dprc_dev->parent); in translate_mc_addr()
641 if (mc->num_translation_ranges == 0) { in translate_mc_addr()
649 for (i = 0; i < mc->num_translation_ranges; i++) { in translate_mc_addr()
651 &mc->translation_ranges[i]; in translate_mc_addr()
682 * This function should not have been called for this MC object in fsl_mc_device_get_mmio_regions()
708 * Older MC only returned region offset and no base address in fsl_mc_device_get_mmio_regions()
721 * Some versions of the MC firmware wrongly report in fsl_mc_device_get_mmio_regions()
738 "Invalid MC offset: %#x (for %s.%d\'s region %d)\n", in fsl_mc_device_get_mmio_regions()
745 regions[i].name = "fsl-mc object MMIO region"; in fsl_mc_device_get_mmio_regions()
784 * Add a newly discovered fsl-mc device to be visible in Linux
803 * Allocate an MC bus device object: in fsl_mc_device_add()
842 * parent DPRC's MC portal instead of the child DPRC's MC in fsl_mc_device_add()
847 * given MC object, using the same MC portal. in fsl_mc_device_add()
883 * Get MMIO regions for the device from the MC: in fsl_mc_device_add()
923 * fsl_mc_device_remove - Remove an fsl-mc device from being visible to
926 * @mc_dev: Pointer to an fsl-mc device
975 * yet discovered by the fsl-mc bus, thus the lookup returned NULL. in fsl_mc_get_endpoint()
1074 * 'fsl,qoriq-mc' node. In this case, identity mapping in get_mc_addr_translation_ranges()
1107 * fsl_mc_bus_probe - callback invoked when the root MC bus is being
1114 struct fsl_mc *mc; in fsl_mc_bus_probe() local
1122 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); in fsl_mc_bus_probe()
1123 if (!mc) in fsl_mc_bus_probe()
1126 platform_set_drvdata(pdev, mc); in fsl_mc_bus_probe()
1130 mc->fsl_mc_regs = devm_ioremap_resource(&pdev->dev, plat_res); in fsl_mc_bus_probe()
1131 if (IS_ERR(mc->fsl_mc_regs)) in fsl_mc_bus_probe()
1132 return PTR_ERR(mc->fsl_mc_regs); in fsl_mc_bus_probe()
1135 if (mc->fsl_mc_regs) { in fsl_mc_bus_probe()
1137 mc_stream_id = readl(mc->fsl_mc_regs + FSL_MC_FAPR); in fsl_mc_bus_probe()
1158 * Some bootloaders pause the MC firmware before booting the in fsl_mc_bus_probe()
1159 * kernel so that MC will not cause faults as soon as the in fsl_mc_bus_probe()
1161 * in place for MC. in fsl_mc_bus_probe()
1162 * At this point MC should have all its SMMU setup done so make in fsl_mc_bus_probe()
1165 writel(readl(mc->fsl_mc_regs + FSL_MC_GCR1) & in fsl_mc_bus_probe()
1167 mc->fsl_mc_regs + FSL_MC_GCR1); in fsl_mc_bus_probe()
1171 * Get physical address of MC portal for the root DPRC: in fsl_mc_bus_probe()
1191 dev_info(&pdev->dev, "MC firmware version: %u.%u.%u\n", in fsl_mc_bus_probe()
1196 &mc->translation_ranges, in fsl_mc_bus_probe()
1197 &mc->num_translation_ranges); in fsl_mc_bus_probe()
1226 mc->root_mc_bus_dev = mc_bus_dev; in fsl_mc_bus_probe()
1236 * fsl_mc_bus_remove - callback invoked when the root MC bus is being
1241 struct fsl_mc *mc = platform_get_drvdata(pdev); in fsl_mc_bus_remove() local
1244 if (!fsl_mc_is_root_dprc(&mc->root_mc_bus_dev->dev)) in fsl_mc_bus_remove()
1247 mc_io = mc->root_mc_bus_dev->mc_io; in fsl_mc_bus_remove()
1248 fsl_mc_device_remove(mc->root_mc_bus_dev); in fsl_mc_bus_remove()
1253 if (mc->fsl_mc_regs) { in fsl_mc_bus_remove()
1255 * Pause the MC firmware so that it doesn't crash in certain in fsl_mc_bus_remove()
1258 writel(readl(mc->fsl_mc_regs + FSL_MC_GCR1) | in fsl_mc_bus_remove()
1260 mc->fsl_mc_regs + FSL_MC_GCR1); in fsl_mc_bus_remove()
1272 {.compatible = "fsl,qoriq-mc",},
1319 * Make sure that the MC firmware is paused before the IOMMU setup for in fsl_mc_bus_notifier()