从用户空间访问NOR内存 [英] Access NOR memory from userspace

查看:254
本文介绍了从用户空间访问NOR内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Compulab cm-x270 CoM Linux内核放在NOR中。这个内核没有MTD支持,引导后我无法访问NOR作为MTD分区。我的目标是从用户空间更新这个内核。是的,通过tftp更容易的方式从bootloader更新,但是我不能在这个任务中使用它。可能在/ dev / mem或其他方式映射NOR吗?

解决方案

我和SRAM有类似的情况。我为 / dev / sram 写了一个块设备驱动程序。通过设备驱动程序访问会保留所有的Linux安全规则。



您没有提到如何访问该NOR内存。如果它在物理内存地址空间中,则驱动程序将执行 request_mem_region() ioremap()映射NOR内存进入虚拟内存空间。然后用户程序可以使用此块(或字符)设备上的标准文件I / O。


On my Compulab cm-x270 CoM Linux kernel placed in NOR. This kernel without MTD support, and after boot I can't access to NOR as MTD partition. My goal is update this kernel from userspace. Yes, update from bootloader by tftp most easier way, but I can't use it in this task. It is possible mapping NOR in /dev/mem or any another way?

解决方案

I had a similar situation with SRAM. I wrote a block device driver for /dev/sram. Access through a device driver preserves all of the Linux security rules.

You didn't mention how this NOR memory is accessed. If it's in the physical memory address space, then the driver would perform request_mem_region() and ioremap() to map the NOR memory into virtual kernel memory space. Then user programs can use standard file I/O on this block (or char) device.

这篇关于从用户空间访问NOR内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆