为 framebuffer 分配空间,但是失败了,所用的函数是 dma_alloc_wc 。
device 是设备树解析 i2c 节点生成的 platform device,即 client->dev。
info->screen_base = (char __iomem *)dma_alloc_wc(&(client->dev), info->fix.smem_len, &phy_addr, GFP_KERNEL);
报错的信息:
[ 78.640247] dma alloc failure, device may be missing a call to arch_setup_dma_ops
[ 78.640265] WARNING: CPU: 3 PID: 1094 at arch/arm64/mm/dma-mapping.c:490 __dummy_alloc+0x1c/0x2c
内核的版本:(ubuntu server)
rock@rock-3a:~/share$ uname -a
Linux rock-3a 4.19.193-44-rockchip-g5a07852a55cf #rockchip SMP Tue Jun 14 12:35:45 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
报错的函数:
static void *__dummy_alloc(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flags,
unsigned long attrs)
{
WARN(1, "dma alloc failure, device may be missing a call to arch_setup_dma_ops");
return NULL;
}
根据报错的内容,是需要调用 arch_setup_dma_ops 这个函数,找了一下,发现在 platform_dma_configure 会调用这个函数,那么是不需要修改设备树呢?还是别的原因?
离线