1 From d7dbf1141d107ba6df15b04498e5fb88b6b61912 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 18 Jun 2019 12:15:50 +0100
4 Subject: [PATCH] staging: vchiq: Use the old dma controller for OF
5 config on platform devices
7 vchiq on Pi4 is no longer under the soc node, therefore it
8 doesn't get the dma-ranges for the VPU.
10 Switch to using the configuration of the old dma controller as
11 that will set the dma-ranges correctly.
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
15 .../interface/vchiq_arm/vchiq_arm.c | 17 ++++++++++++++---
16 1 file changed, 14 insertions(+), 3 deletions(-)
18 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
19 +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
20 @@ -2696,6 +2696,7 @@ vchiq_register_child(struct platform_dev
22 struct platform_device_info pdevinfo;
23 struct platform_device *child;
24 + struct device_node *np;
26 memset(&pdevinfo, 0, sizeof(pdevinfo));
28 @@ -2711,10 +2712,20 @@ vchiq_register_child(struct platform_dev
32 - * We want the dma-ranges etc to be copied from the parent VCHIQ device
33 - * to be passed on to the children too.
34 + * We want the dma-ranges etc to be copied from a device with the
35 + * correct dma-ranges for the VPU.
36 + * VCHIQ on Pi4 is now under scb which doesn't get those dma-ranges.
37 + * Take the "dma" node as going to be suitable as it sees the world
38 + * through the same eyes as the VPU.
40 - of_dma_configure(&new_dev->dev, pdev->dev.of_node, true);
41 + np = of_find_node_by_path("dma");
43 + np = pdev->dev.of_node;
45 + of_dma_configure(&child->dev, np, true);
47 + if (np != pdev->dev.of_node)