@awwwwa
参考一下xboot代码,有mmu的配置和开启代码
Z
ZM960406 发布的帖子
-
回复: T113 DMA 测试在开启mmu后,测试失败
解决了,awboot中对dma设备寄存器的操作很多情况下都是先在内存中创建一个全局变量,给全局变量赋值后,再将赋值内容传给设备寄存器的地址处,虽然设备地址都被设为no cache了,但全局变量是cacheable的,而未初始化或初始化为0的全局变量都是放在.bss段的,所以.bss段需要设为no cache
base = ((uint32_t)__bss_start__ ) & (~0xFFFFF); end = ((uint32_t)__bss_end__ ); n = (end - base) >> 20; for (i = 0; i < n; i++) //dev { MMU_ConfigSection((uint32_t *)__mmu_start, (const void *)(base + (i << 20)), (base + (i << 20)), &s_mmudmaAttr); }
完美解决,测试成功,开了mmu后,基本达到了400Mbit/s的DMA传输速度
[I] ------BootLoader Jump Successed----------- [D] welcome to T113s3 [D] CLK: CPU PLL=PLL_CPU FREQ=1200MHz [D] CLK: PLL_peri (2X)=1200MHz, (1X)=600MHz, (800M)=800MHz [D] CLK: PLL_ddr=1584MHz [D] DMA: init [T] DMA: test 0x42000000 ====> 0x42800000, len 512KB [T] DMA: provide channel 0 [D] DMA: test OK in 20ms [D] timer0 irq is enable [D] i am task0 [D] i am task2