From: Ye Li Date: Mon, 16 Apr 2018 07:30:29 +0000 (-0700) Subject: MLK-16560-2: imx8: Use fsl,sc_rsrc_id binding to map device to rsrc X-Git-Tag: rel_imx_4.19.35_1.1.0~892 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=d83533700721de81d5362500aada61b7b6634a21;p=u-boot.git MLK-16560-2: imx8: Use fsl,sc_rsrc_id binding to map device to rsrc Using the SMMU for some devices (like dpu) requires a streamid to be assigned to multiple resources. Determining the resource ids for a device is a problem that occurs in multiple contexts. So far uboot deals with this by parsing the power-domain node which is insufficient here. Add a new devicetree property called fsl,sc_rsrc_id which lists the resource ids associated by a certain device. Signed-off-by: Leonard Crestez Reviewed-by: Ye Li Acked-by: Peng Fan (cherry picked from commit 75cdc9b6a476f3cef9e49d02873b9244ceb447c8) --- diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 5533e18373..30fe1754ab 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -599,8 +599,23 @@ static int config_smmu_resource_sid(int rsrc, int sid) static int config_smmu_fdt_device_sid(void *blob, int device_offset, int sid) { int rsrc; + int proplen; + const fdt32_t *prop; const char *name = fdt_get_name(blob, device_offset, NULL); + prop = fdt_getprop(blob, device_offset, "fsl,sc_rsrc_id", &proplen); + if (prop) { + int i; + + debug("configure node %s sid 0x%x for %d resources\n", + name, sid, (int)(proplen / sizeof(fdt32_t))); + for (i = 0; i < proplen / sizeof(fdt32_t); ++i) { + config_smmu_resource_sid(fdt32_to_cpu(prop[i]), sid); + } + + return 0; + } + rsrc = get_srsc_from_fdt_node_power_domain(blob, device_offset); debug("configure node %s sid 0x%x rsrc=%d\n", name, sid, rsrc); if (rsrc < 0) {