Message ID | 20200504114711.31093-1-laurentiu.tudor@nxp.com |
---|---|
State | Accepted |
Commit | 21a00d130e5f6290924657b8576b545fac8e0a5c |
Headers | show |
Series | drivers: net: fsl-mc: fixup msi-map property | expand |
Reviewed-by: Diana Craciun <diana.craciun at oss.nxp.com> On 5/4/2020 2:47 PM, Laurentiu Tudor wrote: > Similarly to iommu-map, the msi-map property must also be fixed up > in the device tree, in order for the icid -> streamid translation > be possible in the MSI case as well. > > Signed-off-by: Laurentiu Tudor <laurentiu.tudor at nxp.com> > --- > drivers/net/fsl-mc/mc.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c > index fee372968a..9c4ba7dbda 100644 > --- a/drivers/net/fsl-mc/mc.c > +++ b/drivers/net/fsl-mc/mc.c > @@ -317,7 +317,7 @@ void fdt_fixup_mc_ddr(u64 *base, u64 *size) > void fdt_fsl_mc_fixup_iommu_map_entry(void *blob) > { > u32 *prop; > - u32 iommu_map[4]; > + u32 iommu_map[4], phandle; > int offset; > int lenp; > > @@ -346,6 +346,21 @@ void fdt_fsl_mc_fixup_iommu_map_entry(void *blob) > > fdt_setprop_inplace(blob, offset, "iommu-map", > iommu_map, sizeof(iommu_map)); > + > + /* get phandle to MSI controller */ > + prop = (u32 *)fdt_getprop(blob, offset, "msi-parent", 0); > + if (!prop) { > + debug("\n%s: ERROR: missing msi-parent\n", __func__); > + return; > + } > + phandle = fdt32_to_cpu(*prop); > + > + /* also set msi-map property */ > + fdt_appendprop_u32(blob, offset, "msi-map", FSL_DPAA2_STREAM_ID_START); > + fdt_appendprop_u32(blob, offset, "msi-map", phandle); > + fdt_appendprop_u32(blob, offset, "msi-map", FSL_DPAA2_STREAM_ID_START); > + fdt_appendprop_u32(blob, offset, "msi-map", FSL_DPAA2_STREAM_ID_END - > + FSL_DPAA2_STREAM_ID_START + 1); > } > > static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id,
>-----Original Message----- >From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Diana Madalina >Craciun >Sent: Friday, May 8, 2020 11:55 AM >To: Laurentiu Tudor <laurentiu.tudor at nxp.com>; u-boot at lists.denx.de; >Ioana Ciornei <ioana.ciornei at nxp.com>; Priyanka Jain ><priyanka.jain at nxp.com> >Cc: joe.hershberger at ni.com >Subject: Re: [PATCH] drivers: net: fsl-mc: fixup msi-map property > >Reviewed-by: Diana Craciun <diana.craciun at oss.nxp.com> > >On 5/4/2020 2:47 PM, Laurentiu Tudor wrote: >> Similarly to iommu-map, the msi-map property must also be fixed up in >> the device tree, in order for the icid -> streamid translation be >> possible in the MSI case as well. >> >> Signed-off-by: Laurentiu Tudor <laurentiu.tudor at nxp.com> >> --- Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks Priyanka
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index fee372968a..9c4ba7dbda 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -317,7 +317,7 @@ void fdt_fixup_mc_ddr(u64 *base, u64 *size) void fdt_fsl_mc_fixup_iommu_map_entry(void *blob) { u32 *prop; - u32 iommu_map[4]; + u32 iommu_map[4], phandle; int offset; int lenp; @@ -346,6 +346,21 @@ void fdt_fsl_mc_fixup_iommu_map_entry(void *blob) fdt_setprop_inplace(blob, offset, "iommu-map", iommu_map, sizeof(iommu_map)); + + /* get phandle to MSI controller */ + prop = (u32 *)fdt_getprop(blob, offset, "msi-parent", 0); + if (!prop) { + debug("\n%s: ERROR: missing msi-parent\n", __func__); + return; + } + phandle = fdt32_to_cpu(*prop); + + /* also set msi-map property */ + fdt_appendprop_u32(blob, offset, "msi-map", FSL_DPAA2_STREAM_ID_START); + fdt_appendprop_u32(blob, offset, "msi-map", phandle); + fdt_appendprop_u32(blob, offset, "msi-map", FSL_DPAA2_STREAM_ID_START); + fdt_appendprop_u32(blob, offset, "msi-map", FSL_DPAA2_STREAM_ID_END - + FSL_DPAA2_STREAM_ID_START + 1); } static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id,
Similarly to iommu-map, the msi-map property must also be fixed up in the device tree, in order for the icid -> streamid translation be possible in the MSI case as well. Signed-off-by: Laurentiu Tudor <laurentiu.tudor at nxp.com> --- drivers/net/fsl-mc/mc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)