In conventional systems that include flash memory storage devices and associated hosts, a storage device typically requires both loading a large amount of firmware code and constructing extensive management tables during initialization. Examples of such storage devices include USB drives and SD cards. Examples of such hosts include mobile telephones, MP3 players, and digital cameras.
In such conventional systems, the storage device must complete the tasks of building the management table and initializing itself before it can service access commands from the host. Because the host itself might be simultaneously initializing from the storage device, the host must wait a relatively long time for initialization. In some cases, if the storage device does not respond to the host access command within a given time, a timeout in the host logic aborts the initialization process.
Accordingly, for some host commands, such as those used in the initialization of the host, it would be desirable to reduce the response time of the storage device while the storage device itself is initializing.
A design approach based in part on the foregoing observations is provided to enable a storage device to respond to host access commands under specified conditions before the storage device has completed its initialization process. This way, a host can initialize itself faster. To implement this design approach, various embodiments are possible, including a storage device, a controller, a method of servicing commands, and a method of using a host that sends access commands to a storage device.
In one embodiment, a storage device is provided for servicing commands that use logical addresses to reference memory contents. Such storage device includes a flash memory and a controller. The controller is configured to translate a logical address in a command to a physical address using a mapping table that the controller constructs in volatile memory during initialization. This table is based on data retrieved from the flash memory. The controller is operative to service an access command before the controller completes the construction of the mapping table. Such access command includes a logical address, which satisfies a predefined condition.
The access command may be a read command. The read command may be from a host, and the controller may be operative to respond to the read command by transferring code from the flash memory to the host, which uses the code for initialization of the host.
In such a storage device, the initialization may occur during a power-up or a reset operation. If the initialization occurs during a reset operation, the reset operation may be a hardware or a software reset operation.
In the storage device, the controller may be further operative to disregard an access command, which does not include a logical address satisfying the predefined condition, if the construction of the mapping table has not yet completed. Alternatively, the controller may be further operative to delay servicing an access command, which does not include a logical address satisfying the predefined condition, until after completing the construction of the mapping table.
In the storage device, the logical address may satisfy the predefined condition if the logical address equals one of a set of one or more logical addresses. The predefined condition may be such that the access command satisfies it if the at least one logical address is within a predefined range. The predefined range may include logical address zero.
In another embodiment, a controller for controlling a storage device is provided. Such controller includes a volatile memory and logic circuitry. The logic circuitry is configured to receive a command with a logical address and to translate the logical address to a physical address using a mapping table, which mapping table is constructed in the volatile memory during initialization based on data that the logic circuitry retrieves from a flash memory. The logic circuitry is operative to service an access command before completing the construction of the mapping table, if the access command includes a logical address that satisfies a predefined condition.
The access command serviced by the logic circuitry may be a read command. The read command may be from a host, and the logic circuitry may be operative to respond to the read command by transferring code from the flash memory to the host, which uses the code for initialization of the host.
In such a controller, the initialization may occur during a power-up or a reset operation. If the initialization occurs during a reset operation, and the reset operation is a hardware or a software reset operation.
In the controller, the logic circuitry may be further operative to disregard an access command, which does not include a logical address satisfying the predefined condition, if the construction of the mapping table has not yet completed. Alternatively, the logic circuitry may be further operative to delay servicing an access command, which does not include a logical address satisfying the predefined condition, until after completing the construction of the mapping table.
In the controller, the logical address may satisfy the predefined condition if the logical address equals one of a set of one or more logical addresses. The predefined condition may be such that the access command satisfies it if the at least one logical address is within a predefined range. The predefined range may include logical address zero.
In yet another embodiment, a method is provided for servicing commands that use logical addresses. Such the method may include providing a controller, providing to the controller a command, and causing the controller, in response thereto, to service the command. The controller provided is operative to service commands that use logical addresses to reference contents of a flash memory, and to translate logical addresses to physical addresses, which translation uses at least one mapping table that the controller constructs in volatile memory during initialization based on data retrieved from the flash memory. The command provided to the controller includes a logical address, which address satisfies a predefined condition. The controller is caused to service the command before the controller completes the construction of the at least one mapping table.
In this method of servicing commands, the initialization may occur during a power-up or a reset operation. If the initialization occurs during a reset operation, the reset operation may be a hardware or a software reset operation.
For this method, the command provided to the controller may be a read command. The read command may be provided from a host, and the controller may be caused to respond to the read command by transferring code from the flash memory to the host, which uses the code for initialization of the host.
This method of servicing commands may further comprise causing the controller to disregard an access command, which does not include a logical address satisfying the predefined condition, if the construction of the mapping table has not yet completed. Alternatively, the method may further comprise causing the controller to delay servicing an access command, which does not include a logical address satisfying the predefined condition, until after completing the construction of the mapping table.
The logical address may satisfy the predefined condition of the method of servicing commands if the logical address equals one of a set of one or more logical addresses. The predefined condition may be such that the access command satisfies it if the at least one logical address is within a predefined range. The predefined range may include logical address zero.
Another method may be provided for using a host that sends access commands to a storage device. This method may include providing a storage device with a controller, transferring from a host to the controller a command, and causing the controller, in response thereto, to service the command before the controller completes the construction of the at least one mapping table. The controller provided with the storage device is operative to service commands that use logical addresses to reference contents of a flash memory, and to translate logical addresses to physical addresses, which translating uses at least one mapping table that the controller constructs in volatile memory during initialization based on data retrieved from the flash memory. The command transferred from the host to the controller includes a logical address, which address satisfies a predefined condition. The controller is caused to service the command before the controller completes the construction of the at least one mapping table.
In this method of using a host, the initialization may occur during a power-up or a reset operation. If the initialization occurs during a reset operation, the reset operation may be a hardware or a software reset operation.
For this method, the command provided to the controller may be a read command. The controller may be caused to respond to the read command by transferring code from the flash memory to the host, which uses the code for initialization of the host.
Also, this method of using a host may further comprise causing the controller to disregard an access command, which does not include a logical address satisfying the predefined condition, if the construction of the mapping table has not yet completed. Alternatively, the method may further comprise causing the controller to delay servicing an access command, which does not include a logical address satisfying the predefined condition, until after completing the construction of the mapping table.
The logical address may satisfy the predefined condition of this method of using a host if the logical address equals one of a set of one or more logical addresses. The predefined condition may be such that it is satisfied if the at least one logical address of the command provided to the controller is within a predefined range. The predefined range may include logical address zero.
These and other embodiments, features, aspects and advantages thereof will become better understood from the description herein, appended claims, and accompanying drawings as hereafter described.
The accompanying drawings, which are incorporated in and constitute a part of this specification illustrate various aspects of the various embodiment and, together with the description, serve to explain them in greater detail, wherein:
a)-2(c) portray data structures that represent messages sent via a NAND-based interface from a host to a storage device in accordance with one embodiment of the storage device;
The claims below will be better understood by referring to the detailed description of the various embodiments. This description is not intended to limit the scope of claims but instead to further explain the design principles and the various embodiments that implement them. Examples of the various embodiments include a storage device for a host, a controller for the storage device, a method for servicing commands that use logical addresses, and a method of using a host that sends access commands to a storage device.
With reference to
If an access command has a logical address that satisfies a predefined condition, the controller 16 can service the access command before completing the construction of the mapping tables. The predefined condition may be based on at least one logical address, for example, a condition where the logical address is within a predefined range. In one embodiment, the predefined range includes logical address zero. The controller can service a variety of access commands, such as read commands, a write commands and erase commands.
For access commands, which have logical addresses that satisfy the predefined condition, the controller 16 does not need to construct mapping tables because of information programmed into firmware that resides in the flash memory 14. (In alternate embodiments, the firmware may reside in the ROM of the controller. In accordance with further alternate embodiments, the controller itself, and in turn its ROM, may be an integral part of the flash memory structure.) This firmware directs the controller 16 to contents of the flash memory 14, which correspond to the logical address of the access command. For example, if the predefined condition is that the logical address of an access command equals logical address zero, the firmware of the controller is designed to immediately service a host request involving logical address zero by retrieving data from a predetermined physical address of the flash memory 14. The firmware thus associates the logical address zero with the proper physical address in the flash memory 14 and does not need the mapping table for that purpose.
In some embodiments the association of the logical address satisfying the predefined condition with a corresponding physical address from which the host access is served may be fixed in advance. For example physical block 100 may always be the physical address from which accesses of the host to logical address 0 are serviced. In other embodiments this is not necessarily the case. For example, NAND flash memory devices typically have some bad physical blocks even at the time of shipment to customers. In such flash memory devices it is not possible to guarantee that a specific physical block (such as physical block 100) will always be available. Therefore some embodiments of the present invention use a logical-to-physical address association that is not fixed in advance but is determined after it is known which physical blocks are bad. In such embodiments it is the case that two similar memory devices responding to the same logical address satisfying the predetermined condition will use two different physical addresses for servicing the request. It is even possible that the same storage device will use two different physical addresses at different points in time, for example if the storage device is reformatted and reconfigured between the two points in time.
In the embodiment of
In this embodiment, if the storage device 10 receives an access command that has a logical address that does not satisfy the predefined condition before the controller 16 has completed constructing the mapping table, the controller 16 disregards the access command. In an alternate embodiment, the controller 16 delays servicing the access command until after constructing the mapping table.
The controller in this embodiment is designed to have a volatile memory (RAM) and logic circuitry, which is configured to translate logical addresses in access commands to physical addresses.
In order for a host to initialize from a storage device using the methods of the present invention, the storage device must first be configured to store the host's boot code and to store it in a way that it is associated with a logical address satisfying the predetermined condition. Example data structures are illustrated in
For the NAND-based interface,
Then, as represented in
The host in the factory then sends a reset command as represented in
The methods of the present invention can be used with NAND devices that support built-in logical-to-physical address translation within their controllers, such as the flash storage devices of U.S. patent application Ser. No. 11/326,336 to Lasser.
Regarding the MMC-based interface,
Another embodiment is a method of servicing commands that use logical addresses. The command may be of many types, such as read commands, write commands, and erase commands. The method may be executed during an initialization that occurs during a power-up or a reset operation. If the initialization occurs during a reset operation, the reset operation may be a hardware reset operation or a software reset operation.
With reference to the flow chart 20 in
If the logical address of the access command does not satisfy the predefined condition before completion of the construction of the mapping table, the controller disregards the command. [Step S5.] In an alternate embodiment, if the logical address of the access command does not satisfy the predefined condition, the controller delays servicing the access command until after completing the construction of the mapping table.
Having thus described the foregoing exemplary embodiments it will be apparent to those skilled in the art that various equivalents, alterations, modifications, and improvements thereof are possible without departing from the scope and spirit of the claims as hereafter recited. Accordingly, the claims are not limited to the foregoing discussion.