summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2017-09-27 19:55:56 +0300
committerLeonard Crestez <leonard.crestez@nxp.com>2017-10-09 13:11:53 +0300
commit62237c5928ab98916994cc9e8a58fcc90bffb293 (patch)
tree317ff07a1ed1bc76653698571c7935850a2da095
parent5c30961919608807a61eeff05d0a5a534b50fce9 (diff)
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 <leonard.crestez@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/cpu/armv8/imx8/cpu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/imx8/cpu.c b/arch/arm/cpu/armv8/imx8/cpu.c
index df150e4cae..d03f0fc952 100644
--- a/arch/arm/cpu/armv8/imx8/cpu.c
+++ b/arch/arm/cpu/armv8/imx8/cpu.c
@@ -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) {