This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux Memory Mapped Drivers and NOR Flash



Hi,

I am learning to write Memory Mapped drivers in Linux. I thought a good place to start was writing a driver to directly access the NOR flash, as I know what it's contents should be already (contents of UBOOT).

My kernel object registers a char device (register_chrdev) and then uses request_mem_region to allocate a test memory area that's listed in /proc/iomem, at the address range I specify (0x0200 0000 to 0x0200 0FFF, the first page of NOR flash memory). I then use mmap (on a mknod 'node' char file) in the test app, and in the kernel object I use remap_pfn_range (in the mmap function pointer) to map my userspace memory onto the physical memory.

Trouble is I don't think it works. The memory I get back isn't as per UBOOT and it appears to change between runs.

Are there any examples of memory mapped drivers already in the DaVinci installation?

Will.

 

  • If you are using our latest DVSDK version 2.0, then there should be a NOR driver already available for DM6446 (is this the DaVinci platform you are using?).  FYI, you can find out what drivers are available and what features they support by looking in the Driver Data Manual included in the DVSDK software installation (look under PSP_xx_xx_xx_xxxx/docs)

  • There's reference to NOR flash drivers, using a Journelling Flash File System, but thats not really what I want now. It wasn't that I wanted access to the NOR per se, rather I intended to use it as a known memory mapped device to which I would write a verifiable driver.

    Thanks for the document reference.