Implementation Analysis of uclinux2.6 (bf561) norflash Driver (2): chips and maps

Source: Internet
Author: User

Currently, norflash supports CFI or JEDEC specifications. Based on these specifications, some chip parameters can be automatically detected and read/write, therefore, uClinux separately stores the driver implementations of these specifications in the MTD/chips directory. That is to say, this directory stores the general driver code of the chip. The Code itself will not actively detect the existence of the chip. It just registers a driver for other modules to call. Based on general specifications, each vendor has different implementations, And the chip may have different parameters in different systems, such as base address and bit width. UClinux puts this part independently under MTD/maps. The code in this directory will call the corresponding chips driver according to different specifications implemented by the chip. Therefore, modules under chips must be initialized before those under maps. In include/Linux/MTD/map. h:/* the map stuff is very simple. you fill in your struct map_info with a handful of routines for accessing the device, making sure they handle paging etc. correctly if your device needs it. then you pass it off to a chip probe routine -- either JEDEC or CFI probe or both -- via do_map_probe (). if a chip is recognized, the probe code will invoke the appropriate Chip Driver (if present) and return a struct mtd_info. at which point, you fill in the MTD-> module with your own module address, and register it with the MTD core code. or you cocould partition it and register the partitions instead, or keep it for your own private use; whatever. the MTD-> priv field will point to the struct map_info, and any further private data required by the chip driver is linked fro M The MTD-> priv-> fldrv_priv field. this allows the map driver to get at the destructor function map-> fldrv_destroy () when it's tired of living. */That is to say, you only need to fill in the specific norflash parameter in the map_info struct, and then call do_map_probe for Chip Detection. If the detection passes, it will return an MTD struct, in this way, it can be used in the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.