Commit 27914af9 authored by Leonard Crestez's avatar Leonard Crestez Committed by Jason Liu
Browse files

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: default avatarLeonard Crestez <>
Reviewed-by: default avatarYe Li <>
Acked-by: default avatarPeng Fan <>
parent 92a52cf6
......@@ -948,8 +948,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) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment