Difference between revisions of "Direct Memory Access"

From krtkl wiki
Jump to: navigation, search
(Created page with " == Using Userspace I/O == Userspace I/O ==== Reserved Memory ==== [https://github.com/krtkl/snickerdoodle-dts Device tree source] Specify the memory start address an...")
(No difference)

Revision as of 08:02, 8 March 2018

Using Userspace I/O

Userspace I/O


Reserved Memory

Device tree source

Specify the memory start address and length. In this example, a 256MB region is allocated starting at an offset 768MB.

reserved-memory {
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;

        test_mem: buffer@30000000 {
                reg = <0x30000000 0x10000000>;
        };
};


&amba {
        axi_dma: dma@40400000 {
                reg = <0x40400000 0x10000>;
                compatible = "krtkl,generic-uio,ui_pdrv";
                interrupt-parent = <&intc>;
                interrupts = <0 59 4>;
        };

        dma_mm2s: mm2s-channel@38000000 {
                reg = <0x38000000 0x8000000>;
                compatible = "krtkl,generic-uio,ui_pdrv";
                interrupt-parent = <&intc>;
                interrupts = <0 29 4>;
        };

        dma_s2mm: s2mm-channel@30000000 {
                reg = <0x30000000 0x8000000>;
                compatible = "krtkl,generic-uio,ui_pdrv";
                interrupt-parent = <&intc>;
                interrupts = <0 30 4>;
        };
};


This will create three separate UIO devices; each with a single memory region map.