1 From d57ee5afedf0b1b9a9afb29357c484acda5a40af Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 19 May 2020 14:54:28 +0100
4 Subject: [PATCH] drm/vc4: Adopt the dma configuration from the HVS or
7 vc4_drv isn't necessarily under the /soc node in DT as it is a
8 virtual device, but it is the one that does the allocations.
9 The DMA addresses are consumed by primarily the HVS or V3D, and
10 those require VideoCore cache alias address mapping, and so will be
13 During probe find the a suitable device node for HVS or V3D,
14 and adopt the DMA configuration of that node.
16 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
18 drivers/gpu/drm/vc4/vc4_drv.c | 18 ++++++++++++++++++
19 1 file changed, 18 insertions(+)
21 --- a/drivers/gpu/drm/vc4/vc4_drv.c
22 +++ b/drivers/gpu/drm/vc4/vc4_drv.c
23 @@ -246,6 +246,14 @@ static void vc4_match_add_drivers(struct
27 +const struct of_device_id vc4_dma_range_matches[] = {
28 + { .compatible = "brcm,bcm2835-hvs" },
29 + { .compatible = "brcm,bcm2835-v3d" },
30 + { .compatible = "brcm,cygnus-v3d" },
31 + { .compatible = "brcm,vc4-v3d" },
35 static int vc4_drm_bind(struct device *dev)
37 struct platform_device *pdev = to_platform_device(dev);
38 @@ -263,6 +271,16 @@ static int vc4_drm_bind(struct device *d
39 vc4_drm_driver.driver_features &= ~DRIVER_RENDER;
42 + node = of_find_matching_node_and_match(NULL, vc4_dma_range_matches,
45 + ret = of_dma_configure(dev, node, true);
52 vc4 = devm_drm_dev_alloc(dev, &vc4_drm_driver, struct vc4_dev, base);