Flash memory is a non-volatile computer storage chip that can be electrically erased and reprogrammed. NAND flash memory (also referred to as just NAND memory) is a high density type of read-write memory that may be programmed and read in blocks or pages. NAND memory is used in memory cards, USB flash drives, solid-state drives, and similar products, for general storage and transfer of data, as well as being used to store configuration data in numerous digital devices.
Read-only memory (ROM) is a class of storage medium used in computers and other electronic devices. Traditional ROM is read-only memory and cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware. Firmware refers to software specifically designed for particular hardware. Changing the firmware of a device may rarely or never be done during its economic lifetime. Common reasons for updating firmware include fixing bugs or adding features to the hardware for which it is used. One way to update firmware is to reprogram with a special procedure flash memory used with the ROM. Unlike ROM, NAND memory can be erased and re-programmed multiple times.
NAND memory is typically organized in a number of blocks and each block consists of a number of pages. When the length of an actual page or block of NAND memory is set by a manufacturer, it is permanently fixed at that length. A “Block” as it relates to computer memory, and particularly NAND memory, comprises a sequence of storage bytes or bits, having a nominal length. That length is referred to as the block size. The process of storing data into blocks is normally accomplished a whole page at a time, while erasing data is done in units of blocks.
Each block may also be organized into a number of pages, which are typically 2,048 bytes (˜2 KB) or 4,096 bytes (˜4 KB) in size. Associated with at least one page of each block are a few bytes (typically 1/32 of the data size) that can be used for storage of an error correcting code (ECC) checksum. Typical block sizes include:
Manufacturing defects often occur in the fabrication of NAND memories, which can render some memory cells non-functional and unusable. Those blocks including a defective memory cell or cells are referred to as “bad blocks.” Due to manufacturing processes, many NAND devices are shipped from the factory with some bad blocks. For example, by allowing some bad blocks, the manufacturers achieve far higher yields than would be possible if all blocks had to be verified good. This significantly reduces NAND flash costs and only slightly decreases the storage capacity of the parts. Nonetheless, manufactures of NAND memory generally guarantee that the initial block (Block 0) is good, but the remaining data blocks are not guaranteed.
Some bad block management schemes place information on the NAND memory identifying bad blocks on the chip. Such bad block information may include a list indicating either the good blocks which store the image to be accessed or the bad blocks to be skipped. However, variables in the characteristics of the NAND memory itself, as well as reseller and/or manufacturer specific bad block detection schemes/formats too often require customized NAND memory handling and programming.
Additionally, ROM firmware design in computing devices is somewhat restrained compared to software because these routines cannot be practically rewritten later in the development cycle and are generally permanently set once the computing device is manufactured. Consequently, flash memory is used to run boot loader routines since all or part of the data image on a flash memory can be rewritten and thus updated. As used herein, the term “data image” refers to the information stored in one or more memory cells of a read-write memory device, such as a NAND memory device. The data images run off flash memory for contemporary boot loaders tend to be complicated, since they try to accommodate NAND device-specific characteristics, which as noted above vary greatly among resellers and manufacturers.
The various aspects include methods, systems and devices for revising a data image of a read-write memory device. The method includes accessing an initial data image from an initial virtual block corresponding to an actual block of a series of actual blocks of the read-write memory device. The initial data image may include an initial boot loader. Also, a backup data image may be stored in a remote virtual block spaced away and following in the series of actual blocks from the initial virtual block. The backup data image may include a backup boot loader. Additionally, the initial data image may be erased from the initial virtual block and a replacement data image may be stored in one or more initial virtual blocks. If more than one initial virtual block is used for the replacement data image, all of them may be spaced away and proceeding in the series of actual blocks from the remote virtual block. Additionally, in various aspects, storing the data image or copies thereof may accommodate bad blocks and enable a computing device to skip bad blocks when reading from the memory using a single algorithm regardless of the memory manufacturer.
Further aspects include a computing device having a processor configured with processor-executable instructions to perform various operations corresponding to the methods discussed above.
Further aspects include a computing device having various means for performing functions corresponding to the method operations discussed above.
Further aspects include a non-transitory processor-readable storage medium having stored thereon processor-executable instructions configured to cause a processor to perform various operations corresponding to the method operations discussed above.
The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate exemplary aspects of the invention, and, together with the general description given above and the detailed description given below, serve to explain features of the invention.
The various aspects will be described in detail with reference to the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts. References made to particular examples and implementations are for illustrative purposes, and are not intended to limit the scope of the invention or the claims. Alternate aspects may be devised without departing from the scope of the disclosure. Additionally, well-known elements of the disclosure will not be described in detail or will be omitted so as not to obscure the relevant details of the disclosure.
The word “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any implementation described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other implementations. Additionally, use of the words, “first,” “second,” “third,” “primary,” “secondary,” “tertiary” or similar verbiage is intended herein for clarity purposes to distinguish various described elements and is not intended to limit the invention to a particular order or hierarchy of elements. The terms “access” or “accessing” as used herein refers to the act of interacting with an electronic storage device, or if specified a particular portion thereof, for the purpose of scanning or reading data or information thereon. Also, the terms “scan” or “scanning” as used herein mean examining, interpreting or reviewing data or information, particularly in an electronic storage device. In contrast, the terms “read” or “reading” as used herein mean obtaining, extracting, copying, or retrieving data or information, particularly in an electronic storage device.
The various aspects disclosed here provide mechanisms for storing data images to read-write memories, such as flash memory, and reading data images from such memories that obviate the need for customized and/or device-specific bad block detection/management routines. An aspect of the disclosed technologies includes a method of storing a data image to a read-write memory device, such as a flash memory device. The method includes determining a data image distribution based on a virtual block size of a series of virtual blocks designated for the read-write memory device. The virtual blocks are created in accordance with aspects herein, whereas the actual blocks are fixed parameters of the read-write memory, like flash memory. The actual block size of the read-write memory device being divisible by the virtual block size with no remainder. In this way, one or more virtual blocks will equal an actual block exactly. If the data image is larger than the virtual block size, then it is divided into portions to accommodate the block sizes of the read-write memory on which the data image will be stored. A virtual boundary code is appended to at least one of the data image portions. Also, the virtual boundary code may be appended to the beginning of the data image portion, marking the initial boundary of a virtual block. The data image may be part of the data and software used by a computing device in the boot process. The data image may be divided into as many portions as needed, depending upon the virtual block size and the size of the entire data image. All or part of the data image may still be stored in Block 0 of the NAND memory. The method further includes storing the data image portion in a virtual block of the series of virtual blocks. In storing data image portions, any intervening bad blocks are skipped. In this way, one or more bad blocks may be disposed between stored data image portions stored in the separate virtual blocks. A data image first and second portions may be disposed in a shared actual block of the read-write memory device. Subsequent portions of the data image may each have the virtual boundary code appended thereto. This stores the data image on the read-write memory with virtual boundary codes that a computing device can look for to locate the virtual blocks of memory to be read without having to rely upon a good/bad block list. This obviates the need for programming computing devices to accommodate various good block/bad block schemes to vary greatly. In this way, the same data image portions including those with virtual boundary codes appended thereto may be stored on additional read-write devices. Those additional read-write devices may even have different page, block and/or device-specific bad-block algorithm characteristics from one another.
Computing devices may implement an aspect method of reading a data image from a read-write memory that utilizes the data image created using the method described above. This method may be implemented in a boot loader routine that is executed for a computing device when the read-write memory is used to store the boot loader image. That boot loader image need not be the exclusive boot loader executed for the computing device. This method includes accessing data within a virtual block of the read-write memory. An actual block size of the read-write memory device being divisible by a virtual block size with no remainder, which includes a scenario where the actual block size equals the virtual block size. If the complete data image being accessed is not contained in that virtual block, then the method may scan forward in the read-write memory looking for a virtual boundary code, which designates a boundary (e.g., the beginning) of another virtual block. When the virtual boundary code is recognized, the computing device data loading routine, such as the boot loader routine, may access the data within that other virtual block. Since the memory was loaded by the method described above, the virtual boundary code indicates that the virtual block, in which the virtual boundary code was identified, is good and includes a portion of the data image that may be read. After reading in this additional block of data, if the complete data image has still not been accessed, the computing device data loading routine continues to scan the memory for further virtual boundary codes and blocks of data until the entire data image is read. The amount/size of the data image may be determined from the image header information. This process may end when the data loading routine recognizes that the entire data image has been loaded. By scanning the memory for the virtual boundary codes, bad blocks will be automatically skipped (since they will not include a virtual boundary code) and data read from only good blocks without the need for the computing device to determine in advance which blocks are bad or good. In accordance with another aspect, the method may extrapolate a size of the data image or the virtual block sizes based on information stored in the first block (e.g., in a preamble portion of the data image). The page size of the read-write memory may be inferred from the first block or preamble portion of the data image, which in-turn may be used to determine the number of pages per virtual block.
A further aspect includes a method for revising a flash memory with an updated or new data image, such as when the existing data image stored in the memory is updated or replaced. This method includes an initial data image in at least one initial virtual block of the read-write memory. Also, scanning forward of the at least one initial virtual block for at least one subsequent virtual block available in the read-write memory. A first portion of a new data image may be stored in the subsequent virtual block, including a virtual boundary code appended thereto. The method may further include erasing the initial data image from the at least one initial virtual block, after the entire new data image has been stored. The new data image may be revised into that at least one initial virtual block. In fact, the revising of the new data and erasing of the old data may be performed as one action. However, the new data image need not be written into the very first virtual block, it can be written to one or more virtual blocks that follow. Once the entire new data image is written into that at least one initial virtual block or the one or more virtual blocks that follow the very first virtual block, the method may also include erasing the new data image from the subsequent virtual block(s) to which it was temporarily written as part of this method.
A processor of a computing device when first powered on does not generally have an operating system loaded in ROM or RAM. Thus, the processor initially executes program code stored in ROM firmware referred to as a boot loader that begins the process of booting up the system. The boot loader's job is to load other data and programs into random access memory (RAM) which are then executed by the processor. A primary boot loader is generally stored in ROM and is executed at power-up or when the device is reset. Thereafter, one or more secondary boot loaders, stored on a NAND device operatively coupled to the CPU, may allow new and/or additional application code to be loaded and executed. Traditionally multiple-stage boot loaders are used during which several programs of increasing complexity load one after the other in a process of chain loading. However, it may be advantageous to have a single variable sized boot loader in NAND flash memory that is scalable across different page and/or block sizes and bad block characteristics of the memory. Such a NAND memory boot loader may still be a secondary boot loader and/or work along with other boot loader programs.
NAND memory manufacturers and resellers do not use a uniform standard format for identifying bad blocks in their memory devices. Nonetheless, a computing device must know how to deal with bad blocks in the memory or it will otherwise not work properly or consistently. Consequently, a bad block software routine is typically included within data loader routines, including a secondary boot loader, that is configured to accommodate the bad blocks and provide methods of handling each manufacturer's/reseller's NAND memory devices that might be expected to be used with the computing device. However, NAND memory chips may be purchased from any of a number of manufacturers or resellers, and resellers may change their bad block detection information/methods. Contemporary bad block software routines deal with the variety of different bad block detection schemes by including a number of different routines into their boot loader(s) programmed into their computing devices. This is done in an attempt to deal with the varied requirements and specifications of resellers. Accommodating such variability in bad block routines can complicate the boot loader ROM firmware, and changing such routines to accommodate reseller changes is generally undesirable. Also, while a first boot loader may be designed to reside entirely within the smallest typical Block 0 of the NAND memory, which is guaranteed good, this may complicate overall boot-up of the system and often duplicates drivers and boot loaders. Additionally, data stored in NAND memory (including the first block) deteriorates with time and temperature. Thus, limiting the boot loader to one block may limit the capabilities of a device. An aspect herein cuts down on such complication and/or duplication and enables the ROM to load a boot loader that spans more than the first good block.
The disclosed aspects include methods to limit and/or eliminate the need for the varied bad block detection schemes implemented by the NAND memory resellers for the process of loading a data image on the memory chips. By adding virtual boundary codes to enable computing devices to identify the blocks of data to be loaded without having to use resources to look up bad blocks. Implementing a universal bad block detection/handling routine for the read-write memories being processed (i.e., loaded with the data image) can be implemented as part of the machine setup.
In the various aspects, the data image to be stored on read-write memory is configured with one or more virtual boundary codes, each located at positions in the data image that correspond to virtual blocks. The virtual blocks are sized to be compatible with the block size of read-write memories that may be implemented in a computing device. The virtual block sizes may match the actual block sizes of the memories. However, to accommodate different configurations of memories (i.e., memory chips with different size actual blocks), the virtual block size may be set to a lowest common denominator size of actual blocks of all memories that might be implemented in the computing device. This enables the aspect methods to support NAND devices of different page sizes (e.g., 2K and 4K) without requiring a separate data image for each type of memory. By appending virtual boundary codes at regular positions within the virtual blocks (at least after the initial block), the same data image may be stored in the good blocks of any memory that may be implemented and any intervening bad blocks can be skipped. Such virtual boundary codes may be appended almost anywhere in the virtual block, such as the beginning
When a data image is stored onto read-write memory, e.g., NAND memory, the reseller-specific bad block detection methods are used in order to avoid the bad blocks and only use the good blocks in a memory. However, conventional systems require routines that subsequently read that data image to also use the reseller-specific bad block detection methods. In contrast, aspects of the disclosed aspects minimize or eliminate the need to use such reseller-specific methods when reading the data image, providing a more universal method applicable to for virtually any read-write memory device. Aspects disclosed herein store the data image in one or more virtual blocks on the read-write memory. The data image may be stored in one or more virtual blocks of the read-write memory. If more than one virtual block is needed to accommodate the entire data image, then the next available virtual block (or blocks if needed) may be used to store the remaining portions of the data image, skipping any intervening bad blocks, until the full data image is stored. The virtual blocks are defined and demarcated by virtual boundary codes appended to the portions of the data image placed in each virtual block. One aspect places the virtual boundary code at the start of each virtual block. Also, the very first virtual block may not need a virtual boundary code, particularly since the first block on a device is generally guaranteed to be good. Also, if virtual boundary codes are placed at the start of the next and/or subsequent virtual blocks, they identify locations where portions of the data image is stored. The data image with virtual boundary codes appended thereto are stored only in good actual blocks of the memory, thus the virtual boundary codes correspond to good virtual blocks within good actual blocks of memory. As a result, a boot loader can use a single image reading process in accordance with aspects herein to recognize the virtual boundary codes and determine the blocks of memory to read, in a manner that accommodates virtually any read-write memory, regardless of manufacturer or reseller. The aspect methods can be used for booting up devices from a NAND memory, programmed as described above, such as a smartphone or other electronics with computing capabilities. Also, the aspect methods may be applied to handling fail-safe updating of the secondary boot loader.
The aspect methods may be particularly applicable to the initial boot software image that is stored in flash memory and used by a computing device, such as a smartphone or other mobile computing device, as the initial software loaded upon power up or restart. Typically such boot software is tightly controlled by the operating system, processor or device manufacturer. The company controlling the boot software typically “burns” the primary boot load image to ROM memory and the computing device then accesses read-write memory, such as NAND memory, as part of its boot routine to load the initial software image.
The aspect methods, systems and devices provide bad block handling, enabling a single secondary boot loader (referred to herein also as a boot loader and abbreviated as “BL”) architecture from virtually any NAND device. In contemporary systems, the size of a secondary boot loader may be dictated by the size of internal SRAM memory. So, for example, if a SRAM size is 256 KB in a NAND device, subtracting kilobytes for the preamble generally placed in Block 0, and subtracting additional kilobytes for miscellaneous additional data, such as certificates (Certs) or padding (PAD), may leave about 240 KB in that initial actual block. That 240 KB size corresponds to the maximum size of many individual boot loaders and is greater than the minimum NAND block size of 128 KB generally implemented in read-write memories today. An aspect herein sets the virtual block size to correspond to that contemporary minimum NAND block size of 128 KB. Thus, more than one virtual block needs to be read by the primary boot loader in order to execute a 240 KB BL from that SRAM. While some contemporary FLASH memory devices have block sizes greater than the 128 KB minimum, with some having 256 KB and larger memories being developed, such larger actual blocks may include two or more virtual blocks of 128 KB. Also, aspects of the methods herein may be extended to smaller block sizes, such as 32 KB, as well.
It should be understood that the 128 KB segment size is used herein as an example for purposes of illustration only; the segments may be larger or smaller, depending on the particular NAND devices being considered. For example, if a 128 KB virtual block size is used, it may not support NAND devices with less than 64 pages per block or less than 128 KB per block. However, a smaller block size has practical limitations since the number of virtual blocks needed may increase as the virtual block size gets smaller and smaller. More virtual blocks means more scanning needed to find the valid data image, which may translate to increased boot up times.
Aspect methods divide the BL image placed on the NAND device into segments that can be placed within the 128 KB virtual block size. The 128 KB virtual block size is chosen as it corresponds to a contemporary minimum for NAND devices, but a different virtual block size may be used as desired. Virtual blocks are created by appending markers within at least a second 128 KB segment. The first 128 KB segment generally includes the BL preamble and other readable codes and thus need not include a virtual boundary code. Each segment marked by a virtual boundary code defines the virtual block and its boundaries (the two ends of a virtual block—also referred to herein as a “virtual block boundary”). The remaining portions of the BL image are divided and distributed across as many virtual blocks as are needed to accommodate the entire image. Packing data may be added to fill out an incomplete virtual block of data.
The various aspects allow developers of ROM firmware to no longer have to accommodate NAND memory reseller-defined bad block detection schemes. The various aspects do not rely upon a pre-programmed page that holds a bad/good block table. The disclosed techniques simplify the design of flash tools and build management, which previously required separate tools/builds for different NAND devices. Additionally, the disclosed device, system and methods enable fail-safe updating of the boot loader and its handling. Further, this NAND design is scalable to support different page/size NAND devices.
In the 2 KB Scenario 1, the division and distribution of the boot loader is straight forward, with the virtual boundary code 14 placed at the beginning of Block 1, which coincides with the first virtual block boundary marked on the device. It should be noted that the virtual blocks coincide with the actual blocks in the 2 KB scenarios. As with the coding of the NAND memory described above, the Block 0 also includes a preamble 5, with preamble memory codes 10, a boot loader image header 12 and a first boot loader portion 15a. The second boot loader portion 15b follows the virtual boundary code 14, which is appended thereto and marks the beginning of the virtual block in this aspect. This 2 KB scenario 1 applies to a NAND device in which Block 1 is good, so the first and second virtual blocks are consecutive good blocks. However, manufacturers only generally guarantee Block 0 to be good, thus consider the second and third scenarios for the 2K NAND device. In 2 KB Scenario 2, Block 1 is bad but Block 2 is good. Thus, since Block 1 is bad, the virtual boundary code 14 may not be written into that block. Rather, the next good block, namely Block 2, is where the virtual boundary code 14 is then written, along with the second boot loader portion 15b. The 2 KB Scenario 3 has two initial bad blocks (Block 1 and Block 2) following Block 0. Thus, in this case the virtual boundary code 14 is written at the boundary after the last of those two bad blocks, which is the beginning of the next good block (Block 3). Similarly in that scenario the remainder of the BL (the BL second portion 15b) is written into Block 3.
In the 4 KB Scenarios, it virtually doesn't matter whether Block 1 is good or bad since the boot loader may generally be accommodated entirely within Block 0, which is large enough to include two virtual blocks. Thus, the 4 KB Scenario 1 shows a situation where Block 1 is good, but is not needed because the BL first portion 15a and BL second portion 15b can both be written entirely into Block 0. Also, the 4 KB Scenario 2 illustrates how both portions of the BL 15a, 15b can still be entirely written into its Block 0, making it irrelevant that Block 1 in that scenario is bad.
Positioning the VBC at the beginning of the virtual block aids in immediately detecting good blocks and may optimize a boot-loading process. A single pass reading of a virtual block may detect the VBC and at the same time read the boot loader data image contained in that block. Alternatively, the virtual boundary codes need not be placed at the beginning of the virtual blocks. For example, a VBC may be placed at the end of each virtual block (including Block 0) or in virtually any position desired. Positioning information regarding the one or more VBC's may be included in the image header discussed above.
Once the NAND device has one or more virtual boundary codes written thereto, a primary boot loader can parse the device to find those virtual boundary codes and read, authenticate and run the complete secondary boot loader using the virtual boundary markers like guideposts.
The aspect method shown in
An additional aspect includes failsafe update provisioning, such as through over the air (OTA) downloads for wireless devices. In this regard, many devices that include read-write memory, such as smart phones that include flash memory, often require upgrades or updates to firmware. The disclosed bad block management design enables such upgrades in a reliable/failsafe manner using an extension of the above-described techniques. Initially, the system detects the blocks in which the current boot loader is present. Then it advances forward to one or more additional good block available for a newer/replacement boot loader to be written. Thereafter, the new boot loader can be programmed using the new good block location as a back-up in case something interrupts the upgrade/update process. Then the old boot loader may be erased at the initial location, such as starting at Block 0, and the new secondary boot loader reprogrammed at Block 0 and subsequent good blocks if necessary.
In
In
In determination block 855 a determination may be made regarding whether the backup data image passes a verification check. Such a verification check may be performed to confirm that the backup data image is an accurate and functional data image. Such a verification check may be performed on some or all portions of the backup data image. If the backup data image does not pass the verification check (i.e., determination block 855=“No”) the process may return to block 830 to once again attempt to store the data image. Also, prior to attempting again to store data in the remote virtual blocks (i.e., process blocks 830 or 850), any data therein may be erased. A limit may be placed on how many attempts to store the backup data image may be made. In response to the backup data image passing the verification check (i.e., determination block 855=“Yes”) the initial data image may be erased from at least one initial virtual block in block 860. Either the entire initial data image or just a portion thereof may be erased in block 860. For example, if the initial data image is stored in more than one initial virtual block (i.e., a first initial virtual block and a second initial virtual block), that initial data image may be erased from any one or more of those initial virtual blocks.
In block 870 a replacement data image may be stored in at least one initial virtual block. When the entire replacement data image is too large for just one initial virtual block a replacement data image first portion may be stored in one first initial virtual block and a replacement data image second portion may be stored in a second initial virtual block. In determination block 875 a determination may be made regarding whether the replacement data image passes a verification check. Such a verification check may be similar to the one performed in determination block 855 to confirm that the replacement data image is an accurate and functional data image. Such a verification check may be performed on some or all portions of the replacement data image. When the replacement data image failing the verification check (i.e., determination block 875=“No”) this may mean that initial virtual block is bad and in block 877 the process may attempt to store the replacement data image in the next initial virtual block, such as a second initial virtual block. The process may then return to determination block 875 to determine whether the replacement data image in the next initial virtual block passes a verification check. As with the backup data image storage and verification, the loop between determination block 875 and block 877 may continue until a replacement data image is stored and verified or until a predetermined limit is reached. If the backup data image passes the verification check (i.e., determination block 875=“Yes”) in blocks 880 and 890 the backup data images may be erased. In block 880, the backup data image first portion may be erased from the first remote virtual block. Also, in block 890, the backup data image second portion may be erased from the second remote virtual block.
In an aspect, the backup data image portions stored in blocks 830 and 850 may each be copies of respective portions of the initial data image. Also, the replacement data image may be different from the initial data image, such as when the replacement data image is a new boot loader and the backup data image is a failsafe backup of the initial boot loader.
In an aspect, both the backup data image and the replacement data image may each be copies of the initial data image. For example, during a routine revision of a secondary boot loader, a copy of the secondary boot loader may be stored as a failsafe backup, then after erasing the initial data image and checking for bad blocks, the secondary boot loader may once again be stored in the initial virtual block(s) as the replacement data image.
In an aspect, the backup data image portions stored in blocks 830 and 850 may be different from the initial data image, such as when a new boot loader is stored as the backup data image portions. Also, the replacement data image may be a copy of the backup data image portion(s). For example, a new versions of a secondary boot loader may be stored as the backup and verified before replacing the initial data image.
One or more preamble memory codes may be used for deriving various device characteristics. If a valid preamble memory code is not initially found when a block is being accessed, the process may continue traversing the blocks to attempt to find a block that contains one. A preamble memory code may have a particular sequence, structure or format, such as a virtual boundary code, in the initial bytes of a block (e.g., the first 12 bytes) read (i.e., accessed) as part of a flash read command. In an aspect, a generic NAND device width handling technique may be desirable. An algorithm may be used to count detected virtual blocks that have been designated as such. If a virtual block count is not obtained using this technique, the process may exit concluding no secondary boot loader has been found. Otherwise, in this way the virtual boundary codes may be used to determine the size of the virtual blocks and NAND device itself. Also, ECC detection and page size detection may be implemented as part of the methods disclosed herein. For example, an auto-page size detection algorithm may read the number of pages marked with a specific virtual boundary code in order to determine how many pages are on the device and thus its page size.
Additionally, the various aspects may be implemented in and/or with any of a variety of mobile computing devices, an example of which is illustrated in
The various aspects may be implemented in and/or with any of a variety of computing devices, such as a tablet computer, an example of which is illustrated in
The various aspects described above may also be implemented within and/or with a variety of personal computing devices, such as a laptop computer 1100 as illustrated in
The method 1300 uses a predefined data structure of a preamble block that gives necessary information for determining the page size, number of pages per block, device width and ECC information. However, since not all read-write memory devices have the predefined data structure, the verification check is initiated in block 1305 assuming a backup copy of the read-write memory device Page 0 has been stored with a preamble memory code having the predefined data structure. Such a backup copy of Page 0 may be performed in accordance with the fail-safe backup techniques in accordance with various aspects described above. Also, the method 1300 may be implemented at part of method 600 described above. Referring back to
Referring to
The process of erasing and revising the blocks of a read-write memory device, such as a NAND device, with either the current data image or a completely new data image is referred to herein as “scrubbing.” The various aspects may find application in circumstances in which a boot loader of a read-write memory device would benefit from periodic scrubbing to avoid data and/or block deterioration. For example, NAND devices may experience reduced endurance limits as a result of manufacturing cost cutting techniques that cause blocks to go bad over time or from repeated erase/write operations. Even excessive reading of a NAND page, such as through reboots, may deteriorate its data or one or more blocks in which that data is stored. Also, consideration may be given to applications used in harsh environments, which may make the device unreliable. In particular, NAND devices used in motor vehicles are subject to extreme temperatures, which may corrupt the data image stored therein. Thus, by using failsafe backup techniques as disclosed herein, such read-write memory devices may be periodically scrubbed, ensuring the revision of data is stored in good blocks.
In an aspect, scrubbing a read-write memory device may include skipping bad blocks where necessary. Thus, accessing the initial data image may further include reading a last page within the first initial virtual block to recognize the presence of the initial boot loader in the initial data image. The last page may be a predestinated last page number within the blocks. Alternatively, accessing the initial data image may further include reading a preamble memory code in Block 0 of the series of actual blocks of the read-write memory device. A position of the last page may be identified from the preamble memory code. Additionally, prior to reading the preamble memory code, the method may include updating the preamble memory code in the initial data image to reflect a maximum number of pages per block in the series of actual blocks of the read-write memory device.
Additionally, in the various aspects consideration may be given to read-write memory device constraints, such as devices that require all pages within the blocks to be programmed in sequential order. Such constraints are becoming more prevalent due to process node shrink by NAND vendors and manufacturers. In an aspect, the method may include storing the replacement data image in the first initial virtual block and/or the second initial virtual block, storing portions of the replacement data image in consecutive pages starting from page 0. Also, a determination may be made regarding whether the replacement data image takes up fewer pages than a maximum number of pages available per block. Thus, in response to determining that the replacement data image takes up fewer pages than the maximum number of pages available per block a datum or verification code may be written to a last page in Block 0. No specific verification code is required so any datum or data may be written to the last page in Block 0 so that when the process reads back in the ROM code an ECC error is not generated.
In
The aspects illustrated in
The processors in the various aspects described herein may be any programmable microprocessor, microcomputer or multiple processor chip or chips that can be configured by software instructions (applications) to perform a variety of functions, including the functions of the various aspects described above. In some devices, multiple processors may be provided, such as one processor dedicated to wireless communication functions and one processor dedicated to running other applications. Typically, software applications may be stored in the internal memory before they are accessed and loaded into the processors. The processors may include internal memory sufficient to store the application software instructions. In many devices the internal memory may be a volatile or nonvolatile memory, such as flash memory, or a mixture of both. For the purposes of this description, a general reference to memory refers to memory accessible by the processors including internal memory or removable memory plugged into the device and memory within the processor themselves.
The foregoing method descriptions and the process flow diagrams are provided merely as illustrative examples and are not intended to require or imply that the blocks of the various aspects must be performed in the order presented. As will be appreciated by one of skill in the art the order of blocks in the foregoing aspects may be performed in any order.
Words such as “thereafter,” “then,” “next,” etc. are not intended to limit the order of the blocks; these words are simply used to guide the reader through the description of the methods. Further, any reference to claim elements in the singular, for example, using the articles “a,” “an” or “the” is not to be construed as limiting the element to the singular.
The various illustrative logical blocks and process flow diagram blocks described in connection with the aspects disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and blocks have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The hardware used to implement the various illustrative logics, logical blocks, modules, and circuits described in connection with the aspects disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but, in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. Alternatively, some blocks or methods may be performed by circuitry that is specific to a given function.
In one or more exemplary aspects, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored as one or more instructions or code on a non-transitory computer-readable storage medium or non-transitory processor-readable storage medium. The steps of a method or algorithm disclosed herein may be embodied in a processor-executable software module which may reside on a non-transitory computer-readable or processor-readable storage medium. Non-transitory computer-readable or processor-readable storage media may be any storage media that may be accessed by a computer or a processor. By way of example but not limitation, such non-transitory computer-readable or processor-readable media may include RAM, ROM, EEPROM, FLASH memory, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that may be used to store desired program code in the form of instructions or data structures and that may be accessed by a computer. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above are also included within the scope of non-transitory computer-readable and processor-readable media. Additionally, the operations of a method or algorithm may reside as one or any combination or set of codes and/or instructions on a non-transitory processor-readable medium and/or computer-readable medium, which may be incorporated into a computer program product.
One skilled in the relevant art will recognize that many possible modifications and combinations of the aspects of the disclosed aspects may be used, while still employing the same basic underlying mechanisms and methodologies. The foregoing description, for purposes of explanation, has been written with references to specific aspects. However, the illustrative discussions above are not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Many modifications and variations are possible in view of the above teachings. The aspects were chosen and described to explain the principles of the disclosure and their practical applications, and to enable others skilled in the art to best utilize the disclosure and various aspects with various modifications as suited to the particular use contemplated. Thus, the present disclosure is not intended to be limited to the aspects and individual aspects of the disclosed technologies shown and described herein, but is to be accorded the widest scope consistent with the following claims and the principles and novel features disclosed herein.
This application is a continuation in part of U.S. Non-Provisional application Ser. No. 13/720,532 filed Dec. 19, 2012 entitled “Virtual Boundary Codes In a Data Image of a Read-Write Memory Device,” the entire contents of which are hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 13720532 | Dec 2012 | US |
Child | 14060736 | US |