Data recovery method and device, equipment and storage medium
By setting the enable repair address in the ROM, and using the repair code on the RAM to repair ROM data, the problem of low ROM repair efficiency is solved and efficient data repair is achieved.
Patent Information
- Application Number
- CN202411245328.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-05
AI Technical Summary
In the prior art, read-only memory (ROM) repair efficiency is low, and secondary wafer manufacturing is required, resulting in low efficiency.
By setting the enable repair address in the ROM, calling the repair code on the random access memory (RAM) is used to repair the data in the ROM according to the repair code to avoid secondary wafer manufacturing.
It improves the efficiency of ROM data repair, and can repair data in ROM by executing arbitrary instructions and logic functions by running the repair code on RAM when there are errors and omissions in the ROM or code is intentionally modified.
Smart Images

Figure CN119181412A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of data processing, and specifically relates to a data repair method, device, equipment and storage medium. Background Art
[0002] Read-Only Memory (ROM) is a solid-state semiconductor memory that can only read previously stored data.
[0003] ROM code can be stored in ROM. Once written into ROM, it can only be read out under normal working conditions and cannot be modified or deleted. ROM code can be used to implement functions such as CPU core initialization, boot program storage device interface initialization, loading secondary program loader (SPL) or file download loader (FDL). Since there may be errors and omissions when making ROM, or manufacturers intentionally modify ROM code to meet changing market needs, etc., it is necessary to repair the ROM code that has been solidified on ROM.
[0004] In the above case, the ROM can only be subjected to secondary wafer manufacturing, resulting in low repair efficiency. Summary of the invention
[0005] The embodiments of the present application relate to a data repair method, device, equipment and storage medium, which are used to solve the defect that the prior art can only perform secondary wafer manufacturing on ROM, resulting in low repair efficiency.
[0006] In a first aspect, an embodiment of the present application provides a data repair method, the method comprising:
[0007] Determine a current address in the read-only memory ROM, where the current address is the address currently read;
[0008] Determining whether the current address is a repair-enabled address;
[0009] When the current address is a repair-enabled address, determining a target address for repair in a random access memory RAM according to the current address;
[0010] A repair code is determined in the RAM according to the target address, and the data in the ROM is repaired according to the repair code.
[0011] In a possible implementation, determining a corresponding target address in a random access memory RAM according to the current address includes:
[0012] determining a first code in the ROM according to the current address, the first code comprising a first address in the ROM;
[0013] Running the first code to call the protection field program corresponding to the first address in the ROM;
[0014] Through the protection field program, a corresponding target address is determined in the random access memory RAM.
[0015] In a possible implementation, determining a corresponding target address in a random access memory RAM through the protection field program includes:
[0016] Acquiring the current operation information in the ROM through the protection field program, and storing the current operation information;
[0017] In response to the current operation information being successfully stored, the target address is obtained in the protection field program.
[0018] In a possible implementation manner, after repairing the data in the ROM, the method further includes:
[0019] determining a second code in the RAM;
[0020] Running the second code to call the restoration site program corresponding to the second address in the ROM;
[0021] The current operation information in the ROM is restored through the restoration on-site program, and the program runs to the next address corresponding to the current address.
[0022] In a possible implementation manner, before determining whether the current address is a repair-enabled address, the method further includes:
[0023] Acquire repair configuration data corresponding to the ROM, wherein the repair configuration data includes a repair method, at least one repair address, and a repair code corresponding to each repair address;
[0024] According to the repair mode, enabling processing is performed on the at least one repair address to obtain at least one enabling result, wherein the enabling result includes enabling success or enabling failure;
[0025] Determining at least one enabled repair address among the at least one repair address according to the at least one enabling result;
[0026] The repair codes respectively corresponding to the at least one enabled repair address are stored in the RAM.
[0027] In a possible implementation manner, for any repair address, according to the repair mode, enabling processing is performed on the repair address to obtain the enabling result, including:
[0028] If the repair method is a hardware repair method, remapping the repair address to obtain a mapping result, if the mapping result is a mapping success, determining the enabling result is an enabling success, if the mapping result is a mapping failure, determining the enabling result is an enabling failure, and the remapping is used to remap the original code in the repair address to the first code;
[0029] If the repair method is a software repair method, determine whether the repair address is a preset address, if so, determine that the enabling result is successful, if not, determine that the enabling result is failed.
[0030] In a possible implementation manner, determining at least one enabled repair address in the at least one repair address according to the at least one enabling result includes:
[0031] In at least one repair address, determining a target repair address for which the enabling result is successfully enabled;
[0032] The target repair address is determined as an enabled repair address.
[0033] In a second aspect, an embodiment of the present application provides a data repair device, the device comprising:
[0034] A first determining module is used to determine a current address in the read-only memory ROM, where the current address is the address currently read;
[0035] A judging module, used for judging whether the current address is an enabled repair address;
[0036] A second determination module is used to determine a target address for repair in a random access memory RAM according to the current address when the current address is a repair-enabled address;
[0037] A repair module is used to determine a repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.
[0038] In a possible implementation manner, the second determining module is specifically configured to:
[0039] determining a first code in the ROM according to the current address, the first code comprising a first address in the ROM;
[0040] Running the first code to call the protection field program corresponding to the first address in the ROM;
[0041] Through the protection field program, a corresponding target address is determined in the random access memory RAM.
[0042] In a possible implementation manner, the second determining module is specifically configured to:
[0043] Acquiring the current operation information in the ROM through the protection field program, and storing the current operation information;
[0044] In response to the current operation information being successfully stored, the target address is obtained in the protection field program.
[0045] In a possible implementation manner, the device further includes a third determining module, and the third determining module is configured to:
[0046] determining a second code in the RAM;
[0047] Running the second code to call the restoration site program corresponding to the second address in the ROM;
[0048] The current operation information in the ROM is restored through the restoration on-site program, and the program runs to the next address corresponding to the current address.
[0049] In a possible implementation, the device further includes a configuration module, and the configuration module is used to:
[0050] Acquire repair configuration data corresponding to the ROM, wherein the repair configuration data includes a repair method, at least one repair address, and a repair code corresponding to each repair address;
[0051] According to the repair mode, enabling processing is performed on the at least one repair address to obtain at least one enabling result, wherein the enabling result includes enabling success or enabling failure;
[0052] Determining at least one enabled repair address among the at least one repair address according to the at least one enabling result;
[0053] The repair codes respectively corresponding to the at least one enabled repair address are stored in the RAM.
[0054] In a possible implementation manner, for any repair address, the configuration module is specifically configured to:
[0055] If the repair method is a hardware repair method, remapping the repair address to obtain a mapping result, if the mapping result is a mapping success, determining the enabling result is an enabling success, if the mapping result is a mapping failure, determining the enabling result is an enabling failure, and the remapping is used to remap the original code in the repair address to the first code;
[0056] If the repair method is a software repair method, determine whether the repair address is a preset address, if so, determine that the enabling result is successful, if not, determine that the enabling result is failed.
[0057] In a possible implementation, the configuration module is specifically used to:
[0058] In at least one repair address, determining a target repair address for which the enabling result is successfully enabled;
[0059] The target repair address is determined as an enabled repair address.
[0060] In a third aspect, the present application provides a chip having a computer program stored thereon, wherein when the computer program is executed by the chip, the data repair method as described in any one of the first aspects is implemented.
[0061] In a fourth aspect, the present application provides a chip module having a computer program stored thereon, and when the computer program is executed by the chip module, the data repair method as described in any one of the first aspects is implemented.
[0062] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor, and a transceiver;
[0063] The memory stores computer-executable instructions;
[0064] The processor executes the computer-executable instructions stored in the memory to implement the data repair method as described in any one of the first aspects.
[0065] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data repair method described in any one of the first aspects.
[0066] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the data repair method described in any one of the first aspects.
[0067] The embodiment of the present application provides a data repair method, device, equipment and storage medium. In the method, by determining the current address in the read-only memory ROM, it is determined whether the current address is an enabled repair address. If so, according to the current address, the target address for repair is determined in the random access memory RAM, and according to the target address, the repair code is determined in the RAM, and the data in the ROM is repaired according to the repair code. In this way, when there are errors or omissions in the ROM, or the ROM code is intentionally modified, the ROM can be repaired without secondary wafer manufacturing. By running the repair code on the RAM, any instructions and logical functions are executed to repair the data in the ROM, so as to improve the repair efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions in the present application, a brief introduction will be given below to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0069] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0070] Figure 2 A flowchart of a data repair method provided in an embodiment of the present application;
[0071] Figure 3 A flowchart of another data repair method provided in an embodiment of the present application;
[0072] Figure 4 A schematic diagram of an address space provided for an embodiment of the present application;
[0073] Figure 5 A flowchart of another data repair method provided in an embodiment of the present application;
[0074] Figure 6 A schematic diagram of the structure of a data repair device provided in an embodiment of the present application;
[0075] Figure 7 A schematic diagram of the structure of another data repair device provided in an embodiment of the present application;
[0076] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0077] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0079] It should be noted that, although the terms "first", "second", etc. are used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. Optionally, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0080] It should be understood that the terms "comprises" and "includes" indicate the presence of the previously mentioned features, steps, operations, but do not exclude the presence, occurrence or addition of one or at least one other feature, step, operation. The terms "and / or" and the like used in this application may be interpreted as inclusive, or mean any one or any combination. Optionally, "A and / or B" means "any of the following: A; B; A and B". In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.
[0081] In the related art, a read-only memory (ROM) is a solid-state semiconductor memory that can only read out previously stored data.
[0082] ROM code can be stored in ROM. Once written into ROM, it can only be read out under normal working conditions and cannot be modified or deleted. ROM code can be used to implement functions such as CPU core initialization, boot program storage device interface initialization, loading secondary program loader (SPL) or file download loader (FDL). Since there may be errors and omissions when making ROM, or manufacturers intentionally modify ROM code to meet changing market needs, etc., it is necessary to repair the ROM code that has been solidified on ROM.
[0083] In the above case, the ROM can only be subjected to secondary wafer manufacturing, resulting in low repair efficiency.
[0084] In order to solve the above technical problems, the embodiment of the present application provides a data repair method, which enables the repair address in the ROM, calls the repair code on the random access memory (RAM) through the enabled repair address, and repairs the data in the ROM according to the repair code. In this way, when there are errors or omissions in the ROM, or the ROM code is intentionally modified, the ROM can be repaired without secondary wafer manufacturing. By running the repair code on the RAM, any instructions and logical functions are executed to repair the data in the ROM, so as to improve the repair efficiency.
[0085] Next, combine Figure 1 , the application scenarios of data repair are illustrated with examples.
[0086] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , Figure 1 The system may include a terminal device 100 , which may include a central processing unit 101 , a read-only memory 102 , and a random access memory 103 .
[0087] The CPU 101 can work in conjunction with the ROM 102 and the RAM 103 to complete various computing tasks.
[0088] The CPU 101 can read instructions from the ROM 102 or the RAM 103 and perform data processing and control operations according to the instructions.
[0089] The read-only memory 102 can be used to store fixed programs or data.
[0090] For example, the read-only memory 102 can store the control program in the embedded system to ensure that it will not be accidentally modified during the operation of the system. The central processing unit 101 can read the control program from the read-only memory 102 as needed to perform a specific task.
[0091] The random access memory 103 can be used to provide temporary storage space for programs and data in computer operation. When the computer runs a program, the program and data can be loaded into the random access memory 103 from a storage device such as a hard disk.
[0092] The CPU 101 can quickly read instructions and data from the RAM 103 and process them. During the execution of the program, the intermediate results and temporary data generated can also be stored in the RAM 103.
[0093] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0094] Figure 2 A flowchart of a data repair method provided by an embodiment of the present application. The execution subject of the embodiment of the present application may be a central processing unit. Figure 2 , the method comprising:
[0095] S201, determine the current address in ROM.
[0096] The current address is the address currently read by the CPU.
[0097] Device initialization codes can be stored in multiple addresses of the read-only memory ROM. When the device is started, the initialization codes in the ROM can be run. When the initialization codes in the ROM are run, the current address to which the central processor runs can be determined.
[0098] S202: Determine whether the current address is a repair-enabled address.
[0099] The enabling repair address may be a repair address after successful enabling.
[0100] The repair address can be used to repair the address of the code in the ROM.
[0101] The enabling success can be used to indicate that the repair code corresponding to the repair address is allowed to run.
[0102] At least one enabled repair address may be obtained, and it may be determined whether the current address exists in the at least one enabled repair address. If so, it may be determined that the current address is the enabled repair address; if not, it may be determined that the current address is not the enabled repair address.
[0103] S203: When the current address is a repair-enabled address, a target address for repair is determined in a random access memory RAM according to the current address.
[0104] The target address may be a RAM address corresponding to the current address.
[0105] Repair code can be stored in the target address.
[0106] Optionally, when the current address is a repair-enabled address, a code corresponding to the current address may be determined according to the current address, and a target address for repair may be determined in a random access memory RAM through the code.
[0107] For example, assuming that the current address is the enable repair address, the current address is 0x21000010, and the corresponding target address is 0x00000000 in the RAM.
[0108] When the CPU runs to address 0x21000010, it can be determined that the address is the enable repair address, and the code in 0x21000010 is run. After the code execution is completed, it can be determined that the target address is 0x00000000 in RAM.
[0109] Optionally, the corresponding target address can be determined in the random access memory RAM according to the current address in the following manner: determine the first code in the ROM according to the current address; run the first code to call the protection field program in the ROM corresponding to the first address; and determine the corresponding target address in the random access memory RAM through the protection field program.
[0110] The first code includes a first address in the ROM.
[0111] The saved on-site program may be an executable code solidified in ROM.
[0112] The execution code may be used to store current operation information. For example, the current operation information may be related general register information and the like.
[0113] It should be noted that the target address for repair can be determined in the random access memory RAM according to the current address through any feasible implementation method, and the embodiment of the present application is not limited to this.
[0114] S204: Determine a repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.
[0115] The repair code can be stored in the space corresponding to the target address.
[0116] The repair code can perform specific instructions and logic functions to fix the vulnerability in the ROM.
[0117] For example, the repair code may change configuration information in a register, etc., and the functions that the repair code may implement are not limited herein.
[0118] The repair code can be determined in the RAM according to the target address, and the repair code can be run to execute specific instructions and logic functions to repair the data in the ROM.
[0119] The data repair method provided in this embodiment determines the current address in the ROM, determines whether the current address is an enabled repair address, and if so, determines the target address for repair in the random access memory RAM according to the current address, determines the repair code in the RAM according to the target address, and repairs the data in the ROM according to the repair code. In this way, when there are errors or omissions in the ROM, or the ROM code is intentionally modified, the ROM can be repaired without secondary wafer manufacturing, and the data in the ROM can be repaired by running the repair code on the RAM to execute any instructions and logical functions, so as to improve the repair efficiency.
[0120] Figure 3 This is a flow chart of another data repair method provided by the embodiment of the present application. Based on the above embodiment, please refer to Figure 3 , the method comprising:
[0121] S301, determine the current address in ROM.
[0122] The execution process of S301 can refer to the execution process of S201, which will not be described in detail here.
[0123] S302: Determine whether the current address is a repair-enabled address.
[0124] The execution process of S302 can refer to the execution process of S202, which will not be described in detail here.
[0125] S303: When the current address is a repair-enable address, determine a first code in the ROM according to the current address.
[0126] The first code may include a first address in the ROM.
[0127] The first code may be used to run a protected field program.
[0128] When the current address is the repair-enable address, the current address may be read to determine the storage space in the ROM, and the first code may be obtained from the storage space.
[0129] S304: Run the first code to call the protection field program corresponding to the first address in the ROM.
[0130] The protected field program can be used to store field data in ROM.
[0131] For example, the field data may be relevant general register information and the like.
[0132] The first code can be run to determine the address to be called, and according to the address to be called, the protection field program corresponding to the first address in the ROM is called.
[0133] S305: Obtain the current operation information in the ROM through the protection field program, and store the current operation information.
[0134] The current operation information may include register information, etc., which is not limited here.
[0135] The protection field program can be run to determine the current running information in the ROM and store the current running information in the stack or temporarily store it in a specific RAM space.
[0136] S306: In response to the successful storage of the current running information, a target address is obtained in the protection site program.
[0137] The protection scene program may include target addresses corresponding to a plurality of enabled repair addresses.
[0138] When the current running information is successfully stored, the target address can be determined through the protection site program.
[0139] S307: Determine a repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.
[0140] A repair code may be determined in a RAM space corresponding to the target address, and the repair code may be run to repair the data in the ROM.
[0141] S308: Determine the second code in the RAM.
[0142] The address corresponding to the second code may be located after the address corresponding to the repair code, so that the second code can be executed after the repair code is executed.
[0143] The second code can be used to call the restore field program in the ROM.
[0144] S309: Run the second code to call the restoration site program corresponding to the second address in the ROM.
[0145] The restore field program can be used to restore the current running information in ROM.
[0146] Restoring the scene can be the reverse process of saving the scene.
[0147] The second address in the ROM can be determined by running the second code, and the restoration site program can be run according to the second address.
[0148] S310, restore the current running information in the ROM by restoring the on-site program, and run to the next address corresponding to the current address.
[0149] The operation information in the ROM can be restored according to the saved current operation information by restoring the on-site program, and after the execution of the restored on-site program is completed, it runs to the next address corresponding to the current address.
[0150] Next, combine Figure 4 , the process of S301-S310 is explained.
[0151] Figure 4 A schematic diagram of an address space provided in an embodiment of the present application. Based on the above embodiment, see Figure 4 , Figure 4 Including ROM address and RAM address.
[0152] Assume that the current address is ROM address 0x21000010, the first code corresponding to the current address is AAAA, the enabled repair address includes ROM address 0x21000010, the first address is ROM address 0x21001000, the target address is RAM address 0x00000000, and the second address is ROM address 0x21002000.
[0153] You can perform data repair by following the steps below:
[0154] 1. Determine the current address in ROM: ROM address 0x21000010;
[0155] 2. Determine that the current address is an enabled repair address;
[0156] 3. Determine the first code AAAA corresponding to the current address, and call the corresponding protection field program in the ROM address 0x21001000 by running the first code AAAA;
[0157] 4. Obtain the current running information in ROM through the protection field program and store the current running information;
[0158] 5. In response to the successful storage of the current running information, the target address is obtained in the protection scene program: RAM address 0x00000000;
[0159] 6. According to the target address, determine the repair code in RAM, and repair the data in ROM according to the repair code;
[0160] 7. After repairing the data in the ROM, determine the second code BBBB in the RAM, run the second code BBBB to call the restoration site program corresponding to the second address 0x21002000 in the ROM, and restore the current running information in the ROM;
[0161] 8. Run to the next address corresponding to the current address 0x21000010.
[0162] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0163] The data repair method provided in this embodiment determines the current address in the ROM, determines whether the current address is an enabled repair address, and when the current address is an enabled repair address, determines the first code in the ROM according to the current address, runs the first code to call the protection field program corresponding to the first address in the ROM, obtains the current operation information in the ROM through the protection field program, and stores the current operation information; in response to the successful storage of the current operation information, obtains the target address in the protection field program, determines the repair code in the RAM according to the target address, repairs the data in the ROM according to the repair code, determines the second code in the RAM; runs the second code to call the restore field program corresponding to the second address in the ROM; restores the current operation information in the ROM through the restore field program, and runs to the next address corresponding to the current address. In this way, when there are errors or omissions in the ROM, or the ROM code is intentionally modified, the ROM can be manufactured for a second wafer without performing secondary wafer manufacturing, and the data in the ROM can be repaired by running the repair code on the RAM to execute any instructions and logical functions, so as to improve the repair efficiency.
[0164] In a possible implementation manner, before determining whether the current address is a repair-enabled address, the process further includes initializing repair configuration data.
[0165] Next, combine Figure 5 , the process of initializing the repair configuration data is explained.
[0166] Figure 5 A flowchart of another data repair method provided in an embodiment of the present application is shown below. Figure 5 , the method comprising:
[0167] S501, obtaining repair configuration data corresponding to the ROM.
[0168] The repair configuration data includes a repair method, at least one repair address, and a repair code corresponding to each repair address.
[0169] Repair configuration data can be used to fix vulnerabilities in ROM.
[0170] The repair configuration data corresponding to the ROM can be obtained in the programmable non-volatile memory.
[0171] S502: According to the repair method, enable processing is performed on at least one repair address to obtain at least one enabling result.
[0172] The enabling result includes enabling success or enabling failure.
[0173] An enabling processing mode may be determined according to the repair mode, and enabling processing may be performed on at least one repair address according to the enabling processing mode to obtain at least one enabling result.
[0174] Optionally, taking any one of the at least one repair address as an example, the repair address may be enabled in the following manner to obtain an enabling result:
[0175] If the repair method is a hardware repair method, the repair address is remapped to obtain a mapping result. If the mapping result is a mapping success, the enabling result is determined to be an enabling success. If the mapping result is a mapping failure, the enabling result is determined to be an enabling failure.
[0176] If the repair mode is a software repair mode, it is determined whether the repair address is a preset address. If so, it is determined that the enabling result is successful. If not, it is determined that the enabling result is failed.
[0177] The remapping is used to remap the original code in the repair address into the first code.
[0178] The original code can be modified to jump to the first code of the protection scene program by remapping.
[0179] S503: Determine at least one enabled repair address from at least one repair address according to at least one enabling result.
[0180] According to at least one enabling result, a repair address whose enabling result is successful enabling may be determined as an enabled repair address.
[0181] Optionally, at least one enabled repair address may be determined in at least one repair address according to at least one enabling result in the following manner: in at least one repair address, determine a target repair address whose enabling result is successful enabling; and determine the target repair address as the enabled repair address.
[0182] S504: Store the repair code corresponding to at least one enabled repair address in the RAM.
[0183] For example, the repair code corresponding to the enable repair address 0x21000010 may be stored in the RAM address 0x00000000.
[0184] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0185] The data repair method provided in this embodiment obtains the repair configuration data corresponding to the ROM, the repair configuration data includes a repair method, at least one repair address, and a repair code corresponding to each repair address. According to the repair method, at least one repair address is enabled to obtain at least one enabling result. According to the at least one enabling result, at least one enabled repair address is determined in at least one repair address, and the repair code corresponding to the at least one enabled repair address is stored in the RAM. In this way, when there are errors or omissions in the ROM, or the ROM code is intentionally modified, the ROM can be manufactured for a second time without wafer manufacturing. By using the repair configuration data, the repair code running on the RAM is determined, and any instructions and logic functions are executed to repair the data in the ROM, so as to improve the repair efficiency.
[0186] Figure 6 This is a schematic diagram of the structure of a data repair device provided in an embodiment of the present application. Figure 6 The device 600 includes a first determination module 601, a judgment module 602, a second determination module 603 and a repair module 604, wherein:
[0187] A first determining module 601 is used to determine a current address in a read-only memory ROM, where the current address is the address currently read;
[0188] A determination module 602 is used to determine whether the current address is an enabled repair address;
[0189] A second determination module 603 is used to determine a target address for repair in a random access memory RAM according to the current address when the current address is a repair-enabled address;
[0190] The repair module 604 is used to determine a repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.
[0191] In a possible implementation manner, the second determining module 603 is specifically configured to:
[0192] determining a first code in the ROM according to the current address, the first code comprising a first address in the ROM;
[0193] Running the first code to call the protection field program corresponding to the first address in the ROM;
[0194] Through the protection field program, a corresponding target address is determined in the random access memory RAM.
[0195] In a possible implementation manner, the second determining module 603 is specifically configured to:
[0196] Acquiring the current operation information in the ROM through the protection field program, and storing the current operation information;
[0197] In response to the current operation information being successfully stored, the target address is obtained in the protection field program.
[0198] Figure 7 A schematic diagram of the structure of another data repair device provided in an embodiment of the present application. Figure 6 Based on the examples shown, see Figure 7 The data repair device 600 further includes a third determining module 605, and the third determining module 605 is used to:
[0199] determining a second code in the RAM;
[0200] Running the second code to call the restoration site program corresponding to the second address in the ROM;
[0201] The current operation information in the ROM is restored through the restoration on-site program, and the program runs to the next address corresponding to the current address.
[0202] In a possible implementation manner, the apparatus further includes a configuration module 606, and the configuration module 606 is configured to:
[0203] Acquire repair configuration data corresponding to the ROM, wherein the repair configuration data includes a repair method, at least one repair address, and a repair code corresponding to each repair address;
[0204] According to the repair mode, enabling processing is performed on the at least one repair address to obtain at least one enabling result, wherein the enabling result includes enabling success or enabling failure;
[0205] Determining at least one enabled repair address among the at least one repair address according to the at least one enabling result;
[0206] The repair codes respectively corresponding to the at least one enabled repair address are stored in the RAM.
[0207] In a possible implementation manner, for any repair address, the configuration module 606 is specifically configured to:
[0208] If the repair method is a hardware repair method, remapping the repair address to obtain a mapping result, if the mapping result is a mapping success, determining the enabling result is an enabling success, if the mapping result is a mapping failure, determining the enabling result is an enabling failure, and the remapping is used to remap the original code in the repair address to the first code;
[0209] If the repair method is a software repair method, determine whether the repair address is a preset address, if so, determine that the enabling result is successful, if not, determine that the enabling result is failed.
[0210] In a possible implementation, the configuration module 606 is specifically configured to:
[0211] In at least one repair address, determining a target repair address for which the enabling result is successfully enabled;
[0212] The target repair address is determined as an enabled repair address.
[0213] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 , the electronic device 800 may include: a memory 801 , a processor 802 , and a transceiver 803 .
[0214] The memory 801 is used to store program instructions;
[0215] The processor 802 is used to execute the program instructions stored in the memory, so as to enable the electronic device 800 to execute any of the above-mentioned data repair methods.
[0216] The transceiver 803 may include: a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or the like, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or the like. Exemplarily, the memory 801, the processor 802, and the transceiver 803 are interconnected via a bus 804.
[0217] The present application also provides a chip having a computer program stored thereon. When the computer program is executed by the chip, the above-mentioned data repair method is implemented. The corresponding content and effects can be referred to in the method embodiment part, which will not be described in detail.
[0218] The present application also provides a chip module, on which a computer program is stored. When the computer program is executed by the chip module, the above-mentioned data repair method is implemented. The corresponding content and effects can be referred to the method embodiment part, which will not be repeated here.
[0219] The embodiment of the present application also provides a computer program product, which can be executed by a processor. When the computer program product is executed, the above-mentioned data repair method can be implemented.
[0220] The data repair device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above-mentioned data repair method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.
[0221] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.
[0222] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0223] These computer executable instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0224] These computer executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0225] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data repair method, characterized in that: The method comprises: Determine a current address in the read-only memory ROM, where the current address is the address currently read; Determining whether the current address is a repair-enabled address; When the current address is a repair-enabled address, determining a target address for repair in a random access memory RAM according to the current address; A repair code is determined in the RAM according to the target address, and the data in the ROM is repaired according to the repair code.
2. The method according to claim 1, characterized in that According to the current address, determining a corresponding target address in a random access memory RAM includes: determining a first code in the ROM according to the current address, the first code comprising a first address in the ROM; Running the first code to call the protection field program corresponding to the first address in the ROM; Through the protection field program, a corresponding target address is determined in the random access memory RAM.
3. The method according to claim 2, characterized in that Determining a corresponding target address in a random access memory RAM through the protection field program includes: Acquiring the current operation information in the ROM through the protection field program, and storing the current operation information; In response to the current operation information being successfully stored, the target address is obtained in the protection field program.
4. The method according to any one of claims 1 to 3, characterized in that: After repairing the data in the ROM, the method further includes: determining a second code in the RAM; Running the second code to call the restoration site program corresponding to the second address in the ROM; The current operation information in the ROM is restored through the restoration on-site program, and the program runs to the next address corresponding to the current address.
5. The method according to any one of claims 1 to 4, characterized in that: Before determining whether the current address is an enabled repair address, the method further includes: Acquire repair configuration data corresponding to the ROM, wherein the repair configuration data includes a repair method, at least one repair address, and a repair code corresponding to each repair address; According to the repair mode, enabling processing is performed on the at least one repair address to obtain at least one enabling result, wherein the enabling result includes enabling success or enabling failure; Determining at least one enabled repair address among the at least one repair address according to the at least one enabling result; The repair codes respectively corresponding to the at least one enabled repair address are stored in the RAM.
6. The method according to claim 5, characterized in that For any repair address, according to the repair method, enabling processing is performed on the repair address to obtain the enabling result, including: If the repair method is a hardware repair method, remapping the repair address to obtain a mapping result, if the mapping result is a mapping success, determining the enabling result is an enabling success, if the mapping result is a mapping failure, determining the enabling result is an enabling failure, and the remapping is used to remap the original code in the repair address to the first code; If the repair method is a software repair method, determine whether the repair address is a preset address, if so, determine that the enabling result is successful, if not, determine that the enabling result is failed.
7. The method according to claim 5 or 6, characterized in that: Determining at least one enabled repair address from the at least one repair address according to the at least one enabling result includes: In at least one repair address, determining a target repair address for which the enabling result is successfully enabled; The target repair address is determined as an enabled repair address.
8. A data repair device, characterized in that: The device comprises: A first determining module is used to determine a current address in the read-only memory ROM, where the current address is the address currently read; A judging module, used for judging whether the current address is an enabled repair address; A second determination module is used to determine a target address for repair in a random access memory RAM according to the current address when the current address is a repair-enabled address; A repair module is used to determine a repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.
9. An electronic device, characterized in that: include: memory, processors, and transceivers; Wherein, the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
ROM data patch circuit, embedded system including the same and method of patching rom data
CN101075213A
SoC chip, method for obtaining repair information, storage medium and electronic equipment
CN112231136A
ROM code repairing method and device, readable storage medium and terminal
CN113312270A
Method and apparatus for patching code and data residing on a memory
CN1732443A
ROM software breakpoints
US20070011431A1
