Lines Matching full:mc
3 * Freescale Management Complex (MC) bus driver
11 #define pr_fmt(fmt) "fsl-mc: " fmt
25 #include "fsl-mc-private.h"
28 * Default DMA mask for devices on a fsl-mc bus
35 * struct fsl_mc - Private data of a "fsl,qoriq-mc" platform device
36 * @root_mc_bus_dev: fsl-mc device representing the root DPRC
51 * @mc_region_type: Type of MC region for the range being translated
52 * @start_mc_offset: Start MC offset of the range being translated
53 * @end_mc_offset: MC offset of the first byte after the range (last MC
76 * @dev: the fsl-mc device to match against
77 * @drv: the device driver to search for matching fsl-mc object type
131 if (add_uevent_var(env, "MODALIAS=fsl-mc:v%08Xd%s", in fsl_mc_bus_uevent()
159 return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor, in modalias_show()
311 .name = "fsl-mc",
476 * MC bus
512 * MC bus
542 /* send command to mc*/ in mc_get_version()
557 * fsl_mc_get_version - function to retrieve the MC f/w version information
559 * Return: mc version when called after fsl-mc-bus probe; NULL otherwise.
633 struct fsl_mc *mc; in translate_mc_addr() local
636 mc = dev_get_drvdata(root_dprc_dev->parent); in translate_mc_addr()
638 if (mc->num_translation_ranges == 0) { in translate_mc_addr()
646 for (i = 0; i < mc->num_translation_ranges; i++) { in translate_mc_addr()
648 &mc->translation_ranges[i]; in translate_mc_addr()
679 * This function should not have been called for this MC object in fsl_mc_device_get_mmio_regions()
705 * Older MC only returned region offset and no base address in fsl_mc_device_get_mmio_regions()
718 * Some versions of the MC firmware wrongly report in fsl_mc_device_get_mmio_regions()
735 "Invalid MC offset: %#x (for %s.%d\'s region %d)\n", in fsl_mc_device_get_mmio_regions()
742 regions[i].name = "fsl-mc object MMIO region"; in fsl_mc_device_get_mmio_regions()
781 * Add a newly discovered fsl-mc device to be visible in Linux
800 * Allocate an MC bus device object: in fsl_mc_device_add()
839 * parent DPRC's MC portal instead of the child DPRC's MC in fsl_mc_device_add()
844 * given MC object, using the same MC portal. in fsl_mc_device_add()
880 * Get MMIO regions for the device from the MC: in fsl_mc_device_add()
920 * fsl_mc_device_remove - Remove an fsl-mc device from being visible to
923 * @mc_dev: Pointer to an fsl-mc device
972 * yet discovered by the fsl-mc bus, thus the lookup returned NULL. in fsl_mc_get_endpoint()
1071 * 'fsl,qoriq-mc' node. In this case, identity mapping in get_mc_addr_translation_ranges()
1104 * fsl_mc_bus_probe - callback invoked when the root MC bus is being
1111 struct fsl_mc *mc; in fsl_mc_bus_probe() local
1119 mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); in fsl_mc_bus_probe()
1120 if (!mc) in fsl_mc_bus_probe()
1123 platform_set_drvdata(pdev, mc); in fsl_mc_bus_probe()
1127 mc->fsl_mc_regs = devm_ioremap_resource(&pdev->dev, plat_res); in fsl_mc_bus_probe()
1128 if (IS_ERR(mc->fsl_mc_regs)) in fsl_mc_bus_probe()
1129 return PTR_ERR(mc->fsl_mc_regs); in fsl_mc_bus_probe()
1132 if (mc->fsl_mc_regs) { in fsl_mc_bus_probe()
1134 mc_stream_id = readl(mc->fsl_mc_regs + FSL_MC_FAPR); in fsl_mc_bus_probe()
1155 * Some bootloaders pause the MC firmware before booting the in fsl_mc_bus_probe()
1156 * kernel so that MC will not cause faults as soon as the in fsl_mc_bus_probe()
1158 * in place for MC. in fsl_mc_bus_probe()
1159 * At this point MC should have all its SMMU setup done so make in fsl_mc_bus_probe()
1162 writel(readl(mc->fsl_mc_regs + FSL_MC_GCR1) & in fsl_mc_bus_probe()
1164 mc->fsl_mc_regs + FSL_MC_GCR1); in fsl_mc_bus_probe()
1168 * Get physical address of MC portal for the root DPRC: in fsl_mc_bus_probe()
1188 dev_info(&pdev->dev, "MC firmware version: %u.%u.%u\n", in fsl_mc_bus_probe()
1193 &mc->translation_ranges, in fsl_mc_bus_probe()
1194 &mc->num_translation_ranges); in fsl_mc_bus_probe()
1223 mc->root_mc_bus_dev = mc_bus_dev; in fsl_mc_bus_probe()
1233 * fsl_mc_bus_remove - callback invoked when the root MC bus is being
1238 struct fsl_mc *mc = platform_get_drvdata(pdev); in fsl_mc_bus_remove() local
1240 if (!fsl_mc_is_root_dprc(&mc->root_mc_bus_dev->dev)) in fsl_mc_bus_remove()
1243 fsl_mc_device_remove(mc->root_mc_bus_dev); in fsl_mc_bus_remove()
1245 fsl_destroy_mc_io(mc->root_mc_bus_dev->mc_io); in fsl_mc_bus_remove()
1246 mc->root_mc_bus_dev->mc_io = NULL; in fsl_mc_bus_remove()
1250 if (mc->fsl_mc_regs) { in fsl_mc_bus_remove()
1252 * Pause the MC firmware so that it doesn't crash in certain in fsl_mc_bus_remove()
1255 writel(readl(mc->fsl_mc_regs + FSL_MC_GCR1) | in fsl_mc_bus_remove()
1257 mc->fsl_mc_regs + FSL_MC_GCR1); in fsl_mc_bus_remove()
1269 {.compatible = "fsl,qoriq-mc",},
1316 * Make sure that the MC firmware is paused before the IOMMU setup for in fsl_mc_bus_notifier()