diff options
author | Nipun Gupta <nipun.gupta@nxp.com> | 2018-08-20 16:01:14 +0530 |
---|---|---|
committer | York Sun <york.sun@nxp.com> | 2018-09-27 08:55:05 -0700 |
commit | a78df40cbabe2cb96e0d2fc18a64759302f9e809 (patch) | |
tree | 06d91ae21a2104cece01196ad68509163971cecf /drivers/net/fsl-mc | |
parent | 1deae0c439550d1721aa14c40f49e38b7b1b4c9b (diff) |
u-boot: fixup the iommu-map property of fsl-mc node
The iommu-map property in the fsl-mc node is updated by
valid stream-ids by u-boot. This patch is to fixup this
property for LS208x and LS1088.
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'drivers/net/fsl-mc')
-rw-r--r-- | drivers/net/fsl-mc/mc.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 940025a467..cb2fbe9e2f 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -278,6 +278,40 @@ static int mc_fixup_dpl_mac_addr(void *blob, int dpmac_id, MC_FIXUP_DPL); } +void fdt_fsl_mc_fixup_iommu_map_entry(void *blob) +{ + u32 *prop; + u32 iommu_map[4]; + int offset; + int lenp; + + /* find fsl-mc node */ + offset = fdt_path_offset(blob, "/soc/fsl-mc"); + if (offset < 0) + offset = fdt_path_offset(blob, "/fsl-mc"); + if (offset < 0) { + printf("%s: fsl-mc: ERR: fsl-mc node not found in DT, err %d\n", + __func__, offset); + return; + } + + prop = fdt_getprop_w(blob, offset, "iommu-map", &lenp); + if (!prop) { + debug("%s: fsl-mc: ERR: missing iommu-map in fsl-mc bus node\n", + __func__); + return; + } + + iommu_map[0] = cpu_to_fdt32(FSL_DPAA2_STREAM_ID_START); + iommu_map[1] = *++prop; + iommu_map[2] = cpu_to_fdt32(FSL_DPAA2_STREAM_ID_START); + iommu_map[3] = cpu_to_fdt32(FSL_DPAA2_STREAM_ID_END - + FSL_DPAA2_STREAM_ID_START + 1); + + fdt_setprop_inplace(blob, offset, "iommu-map", + iommu_map, sizeof(iommu_map)); +} + static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id, struct eth_device *eth_dev) { |