The method of multimedia application processor compatible with various NandFlash
Technical field
The present invention relates to a kind of compatible multiple Nandflash memory device (comprising the different vendor of monolithic or multi-disc, the nandflash of different model) of multimedia application processor, method of carrying out data storage and reading utilized.
Background technology
In recent years, the portable electronic product develop rapidly has proposed new demand for internal memory, for example: characteristics such as volume is little, capacity is big, power is little, non-volatile and shatter-proof.Therefore, the hard disk of traditional type and internal memory have not been suitable for new portable system.And flash memory and general DRAM or SRAM maximum do not exist together, and are that flash memory can be preserved data-integrity when non-transformer, are to belong to non-voltile memory.And flash memory possesses electricity-saving function and shatter-proof, is best storing media in the wheeled apparatus utilization, so flash memory becomes the best internal memory solution of embedded computing system.
In the middle of flash memory, Sheffer stroke gate flash memory (NAND Type Flash is called for short Nandflash) has characteristics such as volume is little, capacity is big, storage density height, replaces the main flow that Norflash becomes flash memory gradually.
The hardware block diagram of typical mobile multimedia handheld device is seen Fig. 2, comprise program storage 1, display 2, mobile communication module 3, but hardware is handled audio and video data streams in real time and the multimedia application processor 4 that enriches peripheral interface is arranged, power supply 5, keyboard or touch-screen 6, Nandflash storage medium 7, earphone 8, loudspeaker 9 and microphone 10, wherein multimedia application processor 4 is cores of whole handheld device, the interface of itself and storage medium 7 is eight bit parallel Nandflash interfaces of standard, and multimedia application processor 4 and Nandflash storage medium 7 have constituted the hardware structure of storage system.
When upper layer application will be operated Nandflash memory device 7, by drive controlling multimedia application processor 4, export rational sequential control sheet Nandflash, thereby realize the read-write of file, make MTD layer and FS (file system) layer carry out read-write operation, thereby realize upper layer application such as playing back music, copied files the file on the Nandflash.The software architecture of this part storage system is seen Fig. 1.
The Nandflash technical development is swift and violent, and the Nandflash of different vendor, different model exists monolithic choosing and multi-disc choosing, single die and many die, different AC sequential, different command, different read-write order and number of times requires, the difference of SLC on the technological development of MLC or the like the physical characteristics.These have all proposed higher requirement to backend application (control chip, driving, MTD management and FS).Now comparatively simple way is the difference according to the Nandflash physical characteristics, uses a cover special driving to come it is carried out operations such as reading and writing, wiping.When the Nandflash kind was less, this way is fairly simple to be understood.But when embedded system will be supported Nandflash that increasing complex structure, sequential vary, it is unable to do what one wishes that pattern originally just seems.
Summary of the invention
The object of the present invention is to provide a kind of method of multimedia application processor compatible with various NandFlash: pass through multimedia application processor, cooperate corresponding driving, Nandflash to different vendor, different model controls, make MTD layer and FS (file system) layer carry out read-write operation, thereby realize upper layer application such as playing back music, copied files the file on the Nandflash.
For achieving the above object, the method for a kind of multimedia application processor compatible with various NandFlash of the present invention comprises following treatment step:
1, the respective flap of each sheet Nandflash being received multimedia application processor is chosen, and with the R/b (preparing/busy indication pin) that receives multimedia application processor behind output R/b (preparing/busy indication pin) short circuit that opens Lou of each sheet Nandflash;
2, according to the physical characteristics of the Nandflash of different vendor, different model, come out to form specific data structure table common separately physical characteristics is abstract, become single structure;
3, dispose the corresponding registers of multimedia application processor according to AC (interchange) the time sequence parameter physical characteristics of every Nandflash, make it can correspondingly export corresponding this Nandflash of read-write sequence access control;
4, the MTD layer of system can be visited each sheet Nandflash easily according to structure and pointer.
The abstract specific data structure of coming out in the step 2 among the present invention comprises:
1), Nandflash identifier (ID); 2), page or leaf (Page) size; 3), piece (Block) size; 4) the Block number in plane (Plane); 5) division of, characteristic parameter: Plane, whether support the page or leaf directly to copying whether need sequential write Page in (copyback) and the Block; 6) AC time sequence parameter;
Among the present invention in the step 4 detailed process be:
A, each sheet of circular test are chosen the position of the Nandflash of being put;
B, read the ID of monolithic Nandflash, obtain the physical characteristics of this sheet from data structure table;
C, from the structure that step B is obtained, the sheet selection condition that integrating step A obtained is passed to the MTD layer with these structures that extract and pointer relevant information.
The present invention is common structure by the physical characteristics of the abstract various Nandflash of Drive Layer, provides structure and function pointer to the MTD layer, controls multimedia application processor simultaneously, makes it to export suitable read-write sequence visit Nandflash.Thereby guaranteed upper layer application such as MTD and FS, need not be concerned about the Nandflash type that bottom varies, can stablize again and have access to the Nandflash memory device easily.
Description of drawings
The software architecture of Fig. 1 storage system;
The hardware block diagram of Fig. 2 mobile multimedia handheld device;
Fig. 3 model is the multimedia application processor Nandflash sequential requirement of MT29F8G08MAA;
Fig. 4 is the read-write sequence of Nandflash controller output in corresponding diagram 3 multimedia application processors.
Embodiment
Multimedia application processor has adopted the mobile multimedia processor of low-power consumption, and the key property of this chip is as follows: 1) adopted 32 bit processors; 2) has the Advanced Program Zoom technology; 3) support multi-disc Nandflash, and have the MMC/SD card; 4) embedded AMR decoder, MP3 decoder, WMA decoder, 64-Tone MIDI compositor, AAC/+decoder etc.; 5) embedded image processor, M/JPEG accelerator, demoder H.263/H.264/MPEG4; Support a plurality of serial ports; 6) support USB Host/Slave function; 7) support CCIR/ITU 656/601 image sensor interface, and have audio interface such as I2S, PCM; 8) support TFT LCD and/or OLED display.Therefore this chip functions is powerful, and the function of total system and performance can both be demonstrated fully.It is integration highly, has reduced the production cost of system, has the market competitiveness preferably.
As Fig. 2, multimedia application processor is supported the Nandflash of 4 sheet choosings, and interface is 8 bit parallel Nandflash interfaces of standard, can be according to the different control waveform of AC time sequence parameter output of different Nandflash.
On the hardware:
1, each sheet Nandflash is received in the respective flap choosing (sheet selects 0,1,2,3) of multimedia application processor, can connect 4 at most, the mechanism of this multi-disc choosing can realize that bus is multiplexing;
2, receive the R/b pin of multimedia application processor behind R/b pin (the driving type) short circuit with each sheet Nandflash for opening Lou output.
In the driving:
According to the physical characteristics of the Nandflash of different vendor, different model, they are abstractly come out to form specific data structure table, become single common structure, mainly comprise following:
1), Nandflash identifier (ID); 2), page or leaf (Page) size; 3), piece (Block) size; 4) the Block number in plane (Plane); 5) division of, characteristic parameter: Plane, whether support the page or leaf directly to copying whether need sequential write Page in (copyback) and the Block; 6) AC time sequence parameter;
After on the hardware each sheet Nandflash being posted, Drive Layer will be carried out following operation steps:
1, the Nandflash that chooses of each sheet of traverse scanning, and note ID and each sheet bit selecting is put;
2, look into data structure table according to ID, obtain the structure of the physical characteristics of this model Nandflash, comprised above-mentioned 1) to 6) whole parameters;
3, dispose the corresponding registers of multimedia application processor according to the AC time sequence parameter physical characteristics of every Nandflash,
Sequential as MLC Nandflash (MT29F8G08MAA) requires as Fig. 3, therefore, can just can make the Nandflash controller of multimedia application processor by register is set, export specific AC read-write sequence, satisfy the control requirement of different Nandflash;
When the Nandflash controller of having set multimedia application processor, export specific AC read-write sequence as shown in Figure 4: the ASIC CLOCK of chip (chip clock) is assumed to be 11.9ns,
TWP=3clock=35.7ns is greater than the desired tWP of Fig. 3 (15ns)
TWC=5clock=59.5ns is greater than the desired tWC of Fig. 3 (25ns)
TWH=tWH1+tWH2=2clock=23.8ns is greater than the desired tWH of Fig. 3 (10ns)
TDS=4clock=47.6ns is greater than the desired tDS of Fig. 3 (10ns)
TDH=1clock=11.9ns is greater than the desired tWP of Fig. 3 (5ns)
4, the structure that is obtained from the 2nd step, in conjunction with the 1st sheet selection condition that obtained of step, can extract the relevant information that the MTD layer is concerned about: as the division of the Block number in Page size, the total number of Block, the Plane, Plane, whether support whether need sequential write Page in copyback and the Block; And the pointer of function such as reading and writing, wiping;
5, the MTD layer can be visited each sheet Nandflash easily according to these structures and pointer, and need not be concerned about that bottom has pasted the Nandflash of several Nandflash or what type on earth.