Background technology
Current when the various product of research and development; be subjected to the restriction of material supply of material aspect through regular meeting; particularly the flash memory supply of material of portable terminal product use exists bigger problem; the flash memory that in a kind of product of being everlasting, needs to use multiple model; and use the flash memory of a plurality of models all can bring a lot of troubles for exploitation and later maintenance with a kind of product; therefore, the automatic identification that realizes flash memory is a job highly significant, can reduce product development and safeguard a lot of work of aspect.
For this reason, U.S. AMD (Advanced Micro Devices) company releases passes through in each storage unit of flash memory 2 information of storage, recording density is improved 1 times MirrorBit flash memory has height reliability, has cost benefit, and the MirrorBit flash memory of AMD can with existing Floating Gate (floating gate) flash memory pin compatibility, but the device number of two kinds of dissimilar same capability flash memories but is identical, and its read-write operation aspect then needs to adopt diverse ways according to different model flash memories.
Summary of the invention
Purpose of the present invention is exactly to solve the problems referred to above of running in the actual product, proposes the method for the different flash memories identifications under the method, particularly device number same case of employed flash memory type in a kind of automatic identification product.
For achieving the above object, the present invention proposes a kind of method of automatic identification flash memory, its technical scheme is:
At first create a flash memory relevant information table in the internal memory of system, each record in this form all comprises: the flash memory device model; The hardware information of this model flash memory device; The checkout equipment ID function of this model flash memory: wherein, the hardware information of flash memory device comprises: the information of the die of this model flash memory (wafer); The number of die; The ID of manufacturer of flash memory; The flash memory device sign indicating number; Flash memory expansion equipment sign indicating number 1; Expansion equipment sign indicating number 2;
Improve the read (reading) of this model flash memory again according to the instructions of flash memory, erase (wiping), program (programming), the specific implementation function of operation such as checkout equipment ID;
Carry out the ID of manufacturer, flash memory device sign indicating number, flash memory expansion equipment sign indicating number 1, expansion equipment sign indicating number 2 that flash memory checkout equipment ID function in the information table removes to read flash memory then, again respectively with this record in the ID of manufacturer, flash memory device sign indicating number, flash memory expansion equipment sign indicating number 1, the expansion equipment sign indicating number 2 of flash memory compare and then identification respectively.
Positive progressive effect of the present invention is: when the multiple flash memory type of needs uses simultaneously, discern automatically by flash memory, only software of need gets final product the flash memory of compatible multiple model, can accelerate the development progress of project, makes things convenient for project maintenance.
Embodiment
At first, in the internal memory of system, set up a flash information table, joined in this table as a corresponding record with each information of flash memory that may use that use in the past, that will use, each record all comprises the flash memory device model, the checkout equipment ID function address of the hardware information of this model flash memory device and this model flash memory.Wherein the hardware information of flash memory device comprises information, the number of die, the ID of manufacturer of flash memory, flash memory device sign indicating number, flash memory expansion equipment sign indicating number 1, the expansion equipment sign indicating number 2 of the die (wafer) of this model flash memory;
Flash memory is divided into AMD and two series of Intel at present, corresponding its operational order also is divided into two series, therefore, must improve read, the erase of this model flash memory, the corresponding realization function of various operations such as program, checkout equipment ID according to the instructions of flash memory again.
Then, the operation flash memory automatic identification procedure, be exactly execution in step 1000, start-up routine 100, execution in step 1001 is from first flash memory type of flash information table, the address that execution in step 1002,1003,1004 is obtained die according to the information of die earlier, if this flash memory has two die, the address of reading second die again; Execution in step 1005 then, the checkout equipment ID function of this model flash memory goes fetch equipment ID number in the call list: this function is that first die with flash memory is changed to reading mode, read the ID of manufacturer of this model flash memory then according to the address of die, the flash memory device sign indicating number, flash memory expansion equipment sign indicating number 1, flash memory expansion equipment sign indicating number 2, obtain the number of die, die with flash memory is changed to reading mode again, execution in step 1006,1007,1008, if the ID of manufacturer of the flash memory that reads, the flash memory device sign indicating number, flash memory expansion equipment sign indicating number 1, the number of flash memory expansion equipment sign indicating number 2 and die all conforms to the hardware device information of this record in the information table, shows that then used flash memory is exactly this model.Otherwise,, the next model of flash information table is read comparison, up to the model that finds flash memory or till searching for complete flash information table again according to above step with regard to rebound execution in step 1002.In execution in step 1003,, just adopt the processing function of this model corresponding flash memory handling function as current flash disk operation if find the model of flash memory; If do not find, show that then the flash memory of this model does not join in the flash information table, execution in step 1008 need be added this flash memory relevant information, and perhaps the problem that is welded with of this flash memory causes reading and writing mistake.
Because the Mirrorbit in the AMD series is identical with its pin of Floating gate flash memory, and it is high that its cost performance is wanted, so most of product all will switch to the Mirrorbit flash memory from floating gate flash memory, but both read-write operations have adopted diverse ways, therefore need discern automatically these two kinds of flash memories, and the Mirrorbit of same capability and the Floating gate flash memory ID of its manufacturer, the flash memory device sign indicating number, flash memory expansion equipment sign indicating number 1, the number of flash memory expansion equipment sign indicating number 2 and die is all identical, therefore, employing is read certain different mode bit that automatic selection address obtains and is distinguished two kinds of flash memories, just can adopt corresponding operating method that flash is operated after distinguishing.
After having adopted automatic identifying method,, reduced the difficulty of product maintenance, also accelerated the research and development process of project for using the flash memory of different model will bring very big benefit in the same development project.