dts描述
aaa_pgtable_reserved: xx_region1 {
compatible = "shared-dma-pool";
reg = <0x20 0x08000000 0 0x2800000>;
no-map;
};
master1 {
compatible = "master1";
reg = ...
interrupts = ...
interrupt-parent = <&gic>;
memory-region = <&aaa_pgtable_reserved>;
}
platform_driver中可以使用
cpu_va = dma_alloc_coherent(&pdev->dev, size, &dma_addr, GFP_KERNEL | GFP_DMA);
从shared-dma-pool中分配一致性dma内存