ʲôMTD

MTD(memory technology deviceڴ漼豸)ڷmemory豸ROMflashLinuxϵͳMTDҪĿΪʹµmemory豸Ӽ򵥣ΪӲϲ֮ṩһĽӿڡMTDԴ/drivers/mtdĿ¼¡

MTD豸

MTD 豸оƬС濨֮豸Ƕʽ豸еʹڲ MTD Linux רΪǶʽµһڳ豸ʹ MTD Ҫŵ MTD רΪ豸Ƶģͨиõ֧֡õĹͻIJͶдĸõĽӿڡ

MTDûģӲģ

Linux µ MTD ӿڱΪģ飺ûģӲģ顣

Ϊ˷ض豸ļϵͳϣҪ MTD ϵͳ뵽ںСѡʵ MTD Ӳûģ顣ǰMTD ϵͳ֧Ϊڶ豸 D ԽԽӽڲͬоƬ

еûģöķʣ MTD_CHAR MTD_BLOCK

MTD_CHAR ṩԭʼַʣ MTD_BLOCK Ϊ洴ļϵͳij豸 IDE ̣ MTD_CHAR 豸 /dev/mtd0mtd1mtd2ȵȣ MTD_BLOCK 豸 /dev/mtdblock0mtdblock1ȵȣ MTD_BLOCK 豸ṩ豸ģ⣬ͨȡģϴ FTL JFFS2 ļϵͳ

Ϊ˽Ҫ豸ֲװسڡں˽ںļϵͳС Linux MTD ϵͳҪĿϵͳӲϲ㣬ûģ֮ṩͨýӿڡӲҪ֪ JFFS2 FTL ûģʹõķҪṩľһԵײϵͳ read write erase ļ̡

CFIӿ MTD豸

CFIӿڣCommon Flash InterfaceMTD豸ΪIJ㣨豸ڵֱײӲIJϵǣ豸ڵ㡢MTD豸㡢MTDԭʼ豸Ӳ㡣

һFlash Ӳ㣺Ӳ㸺initʱFlashӲLinux MTD豸NORFlashоƬѭCFIӿڱ׼λdrivers/mtd/chipsĿ¼¡NANDFlashλ/drivers/mtd/nandĿ¼

MTDԭʼ豸ԭʼ豸ɣһMTDԭʼ豸ͨô룬һǸضFlashݣ

MTDԭʼ豸ݽṹmtd_infoж˴ĹMTDݺͲmtd_tablemtdcore.cMTDԭʼ豸бmtd_partmtd_part.cڱʾMTDԭʼ豸Ľṹаmtd_infoΪÿһDZһMTDԭʼ豸mtd_tableеģmtd_part.mtd_infoеĴ󲿷ݶӸ÷mtd_part- >masterлá

drivers/mtd/maps/Ŀ¼´ŵضflashݣÿһļһϵflashе add_mtd_device()del_mtd_device()/ɾmtd_infoṹ/ɾmtd_tableߵ add_mtd_partition()del_mtd_partition()mtdpart.c/ɾmtd_partṹ mtd_part.mtd_info/ɾmtd_table У

MTD豸㣺MTDԭʼ豸linuxϵͳԶMTDĿ豸豸31ַ豸豸90MTDַ豸Ķmtdchar.cʵ֣ͨעһϵfile operationlseekopenclosereadwriteMTD豸ǶһMTD豸Ľṹ mtdblk_devһΪmtdblksָ飬еÿһmtdblk_devmtd_tableеÿһ mtd_infoһһӦ

ġ豸ڵ㣺ͨmknod/devĿ¼½MTDַ豸ڵ㣨豸Ϊ90MTD豸ڵ㣨豸Ϊ31ͨʴ豸ڵ㼴ɷMTDַ豸Ϳ豸

塢ļϵͳBootloaderнJFFSJFFS2ļϵͳӳjffs.imagejffs2.imgյflashijһУ/arch/arm/mach-your/arch.cļyour_fixupн÷Ϊļϵͳء

ļϵͳںͨmount ԽflashеΪļϵͳصmountpointϡ

MTD

MTDµķÖÎö -- ժϸMTD