bcm2835: Getting DMA-busaddress for HW-register

Martin Sperl martin at sperl.org
Mon May 11 07:38:25 PDT 2015


Thanks!

It has been incorporated into the spi-bcm2835.c patch which enables DMA.

I guess a similar thing needs to get applied also to the bcm2835-i2s
driver that still relies on on the fixed offset and so will not
work with the rpi2.

Martin

> Apparently dma_regs is the same as the reg DT property:
> 
> --- workdir/linux/drivers/spi/spi-bcm2835.c.dma    2015-05-10 18:18:28.955545580 +0200
> +++ workdir/linux/drivers/spi/spi-bcm2835.c    2015-05-10 18:20:26.315255619 +0200
> @@ -29,6 +29,7 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/of.h>
> +#include <linux/of_address.h>
> #include <linux/of_irq.h>
> #include <linux/of_gpio.h>
> #include <linux/of_device.h>
> @@ -793,6 +794,15 @@
> #define BCM2835_VCMMU_SHIFT             (0x7E000000 - 0x20000000)
>     bs->dma_regs = res->start + BCM2835_VCMMU_SHIFT;
> 
> +    {
> +    const __be32 *addrp;
> +
> +    pr_info("%s: bs->dma_regs=%pad\n", __func__, &bs->dma_regs);
> +    addrp = of_get_address(pdev->dev.of_node, 0, NULL, NULL);
> +    if (addrp)
> +        pr_info("%s: reg=0x%x\n", __func__, be32_to_cpup(addrp));
> +    }
> +
>     bs->clk = devm_clk_get(&pdev->dev, NULL);
>     if (IS_ERR(bs->clk)) {
>         err = PTR_ERR(bs->clk);




More information about the linux-rpi-kernel mailing list