ikwzm / udmabuf

User space mappable dma buffer device driver for Linux.
BSD 2-Clause "Simplified" License
564 stars 168 forks source link

Support reserved mem in device-tree #7

Closed D3-jwatts closed 6 years ago

D3-jwatts commented 6 years ago

I wanted to use an explicit reserved-memory block for my design. The following device-tree was used:

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

        image_mem: buffer@0 {
            compatible = "shared-dma-pool";
            reusable;
            reg = <0x3C000000 0x4000000>; // offset: 960MiB, size: 64MiB
            label = "image_mem";
        };
    };

    udmabuf@0x00 {
        compatible = "ikwzm,udmabuf-0.10.a";
        device-name = "udmabuf0";
        minor-number = <0>;
        size = <0x4000000>; // 64MiB
        memory-region = <&image_mem>;
    };
};

Tested and working on linux-xlnx v4.9.

ikwzm commented 6 years ago

Thank you very much. It was very helpful.

D3-jwatts commented 6 years ago

And same to you: Your kernel module just saved me a week or two of schedule! :+1: