如何在i.MX8MP平台上为Qualcomm平台的Wi-Fi芯片开辟特定的CMA空间?

1. 为什么要开辟指定的空间

为了防止Wi-Fi长时间运行,导致的内存碎片化,Qualcomm Wi-Fi平台可以从内存空间中,划分出特定的CMA空间段,用以进行内存的申请和释放,下面我们重点介绍下,如何在i.MX8MP Linux 5.15.x平台上为QCA206x Wi-Fi 6/6E预留特定CMA空间的操作步骤。

2. Linux开辟特定的CMA空间

Linux 5.15.x中首先合入如下patch,为cnss driver提前预留CMA空间:

合入上如patch后,dmesg log如下所示:

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]

[ 0.000000] Linux version 5.15.71+gc7650dccb51c (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Wed Apr 12 06:36:33 UTC 2023

[ 0.000000] Machine model: NXP i.MX8MPlus EVK board

[ 0.000000] OF: reserved mem: OVERLAP DETECTED!

[ 0.000000] Reserved memory: created CMA memory pool at 0x00000000c4000000, size 960 MiB

[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool

[ 0.000000] Reserved memory: created DMA memory pool at 0x0000000094300000, size 1 MiB

[ 0.000000] OF: reserved mem: initialized node vdev0buffer@94300000, compatible id shared-dma-pool

[ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 64 MiB // 物理地址的空间范围:0x00000000a0000000--0x00000000a4000000

[ 0.000000] OF: reserved mem: initialized node linux,cnss2, compatible id shared-dma-pool

3. Wi-Fi Driver使能特定CMA区域

下载Wi-Fi驱动:Sign in · GitLab

编译Wi-Fi驱动:

  • 编译Wi-Fi驱动的时候,使能"CONFIG_USE_CUSTOMIZED_DMA_MEM=y"宏即可。
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值