Skip to content

Commit 40746d3

Browse files
6by9popcornmix
authored andcommitted
staging: vchiq: Use the old dma controller for OF config on platform devices
vchiq on Pi4 is no longer under the soc node, therefore it doesn't get the dma-ranges for the VPU. Switch to using the configuration of the old dma controller as that will set the dma-ranges correctly. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
1 parent 139ad19 commit 40746d3

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

  • drivers/staging/vc04_services/interface/vchiq_arm

‎drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,6 +2727,7 @@ vchiq_register_child(struct platform_device *pdev, const char *name)
27272727
{
27282728
struct platform_device_info pdevinfo;
27292729
struct platform_device *child;
2730+
struct device_node *np;
27302731

27312732
memset(&pdevinfo, 0, sizeof(pdevinfo));
27322733

@@ -2742,10 +2743,20 @@ vchiq_register_child(struct platform_device *pdev, const char *name)
27422743
}
27432744

27442745
/*
2745-
* We want the dma-ranges etc to be copied from the parent VCHIQ device
2746-
* to be passed on to the children too.
2746+
* We want the dma-ranges etc to be copied from a device with the
2747+
* correct dma-ranges for the VPU.
2748+
* VCHIQ on Pi4 is now under scb which doesn't get those dma-ranges.
2749+
* Take the "dma" node as going to be suitable as it sees the world
2750+
* through the same eyes as the VPU.
27472751
*/
2748-
of_dma_configure(&new_dev->dev, pdev->dev.of_node, true);
2752+
np = of_find_node_by_path("dma");
2753+
if (!np)
2754+
np = pdev->dev.of_node;
2755+
2756+
of_dma_configure(&child->dev, np, true);
2757+
2758+
if (np != pdev->dev.of_node)
2759+
of_node_put(np);
27492760

27502761
return child;
27512762
}

0 commit comments

Comments
 (0)