Linux从Userland注册读取臂i.mx257-devmem无法正常工作 [英] Linux register read arm i.mx257 from userland - devmem not working
问题描述
我目前正在i.mx257平台上工作,想读取一些外设寄存器(具体来说是iomux寄存器)以了解其配置方式或设置是否正确.
I'm currently working on a i.mx257 platform and want to read some peripheral registers (the iomux register to be specific) to see how it is configured or if it is set right.
我也从busybox和devmem2中了解了devmem.两者都尝试过,并且都出错.当前,定制板从meta-fsl-arm yocto meta包运行Linux内核版本4.6.0-rc7.该系统是使用yocto构建的.
I've read about the devmem from busybox and devmem2, too. Tried both and both get an error. Currently there the custom board is running linux kernel version 4.6.0-rc7 from the meta-fsl-arm yocto meta package. The system is built with yocto.
root @ system/]#./tmp/devmem2 0x43fac190 /dev/mem已打开.
root@system /]#./tmp/devmem2 0x43fac190 /dev/mem opened.
未处理的故障:在0xb6f3a190处的非线提取(0x008)上的外部中止 pgd = c3334000 [b6f3a190] * pgd = 8285e831,* pte = 43fac103,* ppte = 43facaa2
Unhandled fault: external abort on non-linefetch (0x008) at 0xb6f3a190 pgd = c3334000 [b6f3a190] *pgd=8285e831, *pte=43fac103, *ppte=43facaa2
映射到地址0xb6f3a000的内存.
Memory mapped at address 0xb6f3a000.
公交错误
该工具会收到信号错误.未在内核配置中设置CONFIG_STRICT_DEVMEM选项.
The tool gets an Signal Err. The CONFIG_STRICT_DEVMEM option is not set in the kernel config.
我找到了另一篇帖子 http://thread.gmane.org /gmane.linux.ports.arm.kernel/26878 ,但我找不到有关i-mx25的这些寄存器的某些信息.
I found another post http://thread.gmane.org/gmane.linux.ports.arm.kernel/26878 but I can't find some information about these registers for an i-mx25.
还有其他内核安全功能或我缺少的功能吗?
Is there another kernel security feature or something I'm missing?
devmem或devmem2仅适用于0x4000以下的值.对于以上所有地址,我都会收到信号总线错误.
The devmem or devmem2 is only working with values below 0x4000. For all addresses above i get the signal bus error.
推荐答案
好的, 我找到了我自己问题的答案. 必须将AIPS控制寄存器添加到设备树中.他们正在保护我要阅读的寄存器.添加完这些补丁后,它就起作用了.
Okay, i found an answer to my own question. The AIPS control registers have to be added to the devicetree. They are protecting the register i want to read. After i added these patches it worked.
https://github.com/torvalds/linux/commit/24bb244e02a6beadbbbddb2002df2002
https://github.com/torvalds/linux/commit/24bb244e02a6bead5b854d842002df0d38ae7b7b
https://github.com/torvalds/f3f4f4f3d3f4f3d #diff-64c444a874c565fd98cf1ab538c1e0cd
这篇关于Linux从Userland注册读取臂i.mx257-devmem无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!