| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 126 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 126 Page - STMicroelectronics |
|
126 / 245 page ![]() Non-volatile memory device drivers UM0851 126/245 Doc ID 16604 Rev 2 u_long erasesize; Size in bytes of the "erase block" of this memory device - the smallest area which can be erased in a single erase command. u_long oobblock; u_long oobsize; Some memory technologies support out-of-band data - for example, NAND flash has 16 extra bytes per 512-byte page, for error correction or metadata. oobsize and oobblock hold the size of each out-of-band area, and the number of bytes of "real" memory with which each is associated, respectively. As an example, NAND flash, would have oobblock == 512 and oobsize == 16 to show that it has 16 bytes of OOB data per 512 bytes of flash. u_long ecctype; Some hardware not only allows access to flash or similar devices, u_long eccsize; but also has ECC (error correction) capabilities built- in to the interface. The eccsize holds the size of the blocks on which the hardware can perform automatic ECC. int (*erase) (struct mtd_info *mtd, struct erase_info *instr); This routine adds a struct erase_info to the erase queue for the device. This routine may sleep until the erase had finished, or it may simply queue the request and return immediately. The struct erase_info contains a pointer to a callback function which will be called by the driver module when the erase has completed. int (*read) (struct mtd_info *mtd, loff_t from, size_t len, u_char *buf); int (*write) (struct mtd_info *mtd, loff_t to, size_t len, const u_char *buf); Read and write functions for the memory device. These may sleep, and should not be called from IRQ context or with locks held. The buf argument is assumed to be in kernel-space. If you need to copy to userspace, either use a kiobuf to lock down the pages first, or use a bounce buffer. int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, u_char *buf, u_char *eccbuf); int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, const u_char *buf, u_char*eccbuf); For devices which support automatic ECC generation or checking, these routines behave just the same at the read/write functions above, but with the addition that the write_ecc function places the generated ECC data into eccbuf, and the read_ecc function verifies the ECC data and attempts to correct any errors which it detects. int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, u_char *buf); int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, const u_char *buf); For devices which have out-of-band data, these functions provide access to it.The from/to address is the address of the start of the real page of memory with which the OOB data is associated, added to the offset within the OOB block. Example: To specify the 5th byte of the OOB data associated with the NAND flash page at 0x1000 in the device, you would pass address 0x1005 }; The NAND device driver populates the struct mtd_info to MTD layer by calling the following routines. #ifdef CONFIG_MTD_PARTITIONS err = add_mtd_partitions( &mtd, v->mtd_parts, mtd_parts_nb ); |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |