Data repair method, device, equipment and storage medium

CN119181412BActive Publication Date: 2026-08-28XIAMEN UNISOC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411245328.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2026-08-28
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

[0005]本申请实施例涉及一种数据修复方法、装置、设备及存储介质,用以解决现有技术中只能对ROM进行二次晶圆制造,导致修复效率较低的缺陷

Benefits of technology

[0067]本申请实施例提供一种数据修复方法、装置、设备及存储介质,该方法中,通过确定只读存储器ROM中的当前地址,判断当前地址是否为使能修复地址,若是,根据当前地址,在随机存取存储器RAM中确定进行修复的目标地址,根据目标地址,在RAM中确定修复代码,并根据修复代码对ROM中的数据进行修复。这样,在ROM中存在错漏、或有意修改ROM代码时,可以不对ROM进行二次晶圆制造,通过运行在RAM上的修复代码,执行任意的指令和逻辑功能,修复ROM中的数据,以提高修复效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119181412B_ABST
    Figure CN119181412B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data repair method, device and equipment and a storage medium. The method comprises the following steps: determining a current address in a read-only memory (ROM), judging whether the current address is an enabled repair address, if yes, determining a target address for repair in a random access memory (RAM) according to the current address, determining a repair code in the RAM according to the target address, and repairing data in the ROM according to the repair code. The method improves the repair efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of data processing, specifically relating to a data repair method, apparatus, device, and storage medium. Background Technology

[0002] Read-only memory (ROM) is a type of solid-state semiconductor memory that can only read the data stored in it.

[0003] ROM can store ROM code. Once written to the ROM, the ROM code can only be read and cannot be modified or deleted under normal operating conditions. ROM code can be used to implement functions such as CPU core initialization, bootloader storage device interface initialization, and loading of secondary program loaders (SPL) or file download loaders (FDL). Because errors may exist during ROM manufacturing, or manufacturers may intentionally modify the ROM code to meet ever-changing market demands, it is necessary to repair the ROM code already embedded in the ROM.

[0004] In the above situation, only secondary wafer fabrication of the ROM is possible, resulting in low repair efficiency. Summary of the Invention

[0005] This application relates to a data repair method, apparatus, device, and storage medium, which addresses the shortcomings of existing technologies that can only perform secondary wafer fabrication on ROMs, resulting in low repair efficiency.

[0006] In a first aspect, embodiments of this application provide a data repair method, the method comprising:

[0007] Determine the current address in the read-only memory (ROM), where the current address is the address currently read.

[0008] Determine whether the current address is an address that enables repair;

[0009] When the current address is the address that enables repair, the target address for repair is determined in the random access memory (RAM) based on the current address.

[0010] Based on the target address, repair code is determined in the RAM, and the data in the ROM is repaired according to the repair code.

[0011] In one possible implementation, determining the corresponding target address in the random access memory (RAM) based on the current address includes:

[0012] Based on the current address, a first code is determined in the ROM, the first code including the first address in the ROM;

[0013] Run the first code to call the protected context program corresponding to the first address in the ROM;

[0014] The corresponding target address is determined in the random access memory (RAM) through the aforementioned field protection procedure.

[0015] In one possible implementation, determining the corresponding target address in the random access memory (RAM) through the context preservation procedure includes:

[0016] The current running information in the ROM is obtained through the protected field program, and the current running information is stored.

[0017] In response to the successful storage of the current running information, the target address is obtained in the protection site program.

[0018] In one possible implementation, after repairing the data in the ROM, the method further includes:

[0019] The second code is determined in the RAM;

[0020] The second code is executed to call the restore scene program corresponding to the second address in the ROM;

[0021] The restored environment program restores the current running information in the ROM and runs to the next address corresponding to the current address.

[0022] In one possible implementation, before determining whether the current address is an enable repair address, the method further includes:

[0023] Obtain the repair configuration data corresponding to the ROM, the repair configuration data including the repair method, at least one repair address, and the repair code corresponding to each repair address;

[0024] According to the repair method, the at least one repair address is enabled to obtain at least one enabling result, which includes enabling success or enabling failure.

[0025] Based on the at least one enabling repair address, at least one enabling repair address is determined from the at least one repair address;

[0026] The repair code corresponding to each of the at least one enabled repair address is stored in the RAM.

[0027] In one possible implementation, for any repair address, according to the repair method, the repair address is enabled to obtain the enabling result, including:

[0028] If the repair method is a hardware repair method, the repair address is remapped to obtain a mapping result. If the mapping result is successful, the enabling result is determined to be successful. If the mapping result is unsuccessful, the enabling result is determined to be unsuccessful. 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 yes, determine that the enabling result is successful; otherwise, determine that the enabling result is unsuccessful.

[0030] In one possible implementation, determining at least one enable repair address from the at least one repair address based on the at least one enable result includes:

[0031] In at least one repair address, the target repair address whose enabling result is successfully enabled is determined;

[0032] The target repair address is determined as the enable repair address.

[0033] Secondly, embodiments of this application provide a data repair apparatus, the apparatus comprising:

[0034] The first determining module is used to determine the current address in the read-only memory (ROM), wherein the current address is the address currently read.

[0035] The judgment module is used to determine whether the current address is an address that enables repair;

[0036] The second determining module is used to determine the target address for repair in the random access memory (RAM) based on the current address when the current address is an enable repair address.

[0037] The repair module is used to determine repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.

[0038] In one possible implementation, the second determining module is specifically used for:

[0039] Based on the current address, a first code is determined in the ROM, the first code including the first address in the ROM;

[0040] Run the first code to call the protected context program corresponding to the first address in the ROM;

[0041] The corresponding target address is determined in the random access memory (RAM) through the aforementioned field protection procedure.

[0042] In one possible implementation, the second determining module is specifically used for:

[0043] The current running information in the ROM is obtained through the protected field program, and the current running information is stored.

[0044] In response to the successful storage of the current running information, the target address is obtained in the protection site program.

[0045] In one possible implementation, the apparatus further includes a third determining module, the third determining module being configured to:

[0046] The second code is determined in the RAM;

[0047] The second code is executed to call the restore scene program corresponding to the second address in the ROM;

[0048] The restored environment program restores the current running information in the ROM and runs to the next address corresponding to the current address.

[0049] In one possible implementation, the device further includes a configuration module, which is configured to:

[0050] Obtain the repair configuration data corresponding to the ROM, the repair configuration data including the repair method, at least one repair address, and the repair code corresponding to each repair address;

[0051] According to the repair method, the at least one repair address is enabled to obtain at least one enabling result, which includes enabling success or enabling failure.

[0052] Based on the at least one enabling repair address, at least one enabling repair address is determined from the at least one repair address;

[0053] The repair code corresponding to each of the at least one enabled repair address is stored in the RAM.

[0054] In one possible implementation, for any given repair address, the configuration module is specifically used for:

[0055] If the repair method is a hardware repair method, the repair address is remapped to obtain a mapping result. If the mapping result is successful, the enabling result is determined to be successful. If the mapping result is unsuccessful, the enabling result is determined to be unsuccessful. 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 yes, determine that the enabling result is successful; otherwise, determine that the enabling result is unsuccessful.

[0057] In one possible implementation, the configuration module is specifically used for:

[0058] In at least one repair address, the target repair address whose enabling result is successfully enabled is determined;

[0059] The target repair address is determined as the enable repair address.

[0060] Thirdly, this application provides a chip on which a computer program is stored, and when the computer program is executed by the chip, it implements the data repair method as described in any of the first aspects.

[0061] Fourthly, this application provides a chip module on which a computer program is stored. When the computer program is executed by the chip module, it implements the data repair method as described in any of the first aspects.

[0062] Fifthly, embodiments of this application provide an electronic device, including: a memory, a processor, and a transceiver;

[0063] The memory stores computer-executed instructions;

[0064] The processor executes computer execution instructions stored in the memory to implement the data repair method as described in any of the first aspects.

[0065] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing 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, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the data repair method described in any one of the first aspects.

[0067] This application provides a data repair method, apparatus, device, and storage medium. In this method, the current address in the read-only memory (ROM) is determined. If the current address is an address that enables repair, a target address for repair is determined in the random access memory (RAM) based on the current address. Repair code is then determined in the RAM based on the target address, and the data in the ROM is repaired according to the repair code. This way, when errors or omissions exist in the ROM, or when the ROM code is intentionally modified, secondary wafer fabrication of the ROM is not required. The data in the ROM can be repaired by executing arbitrary instructions and logical functions through the repair code running in the RAM, thereby improving repair efficiency. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0069] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0070] Figure 2 A flowchart illustrating a data repair method provided in an embodiment of this application;

[0071] Figure 3 A flowchart illustrating another data repair method provided in this application embodiment;

[0072] Figure 4 An address space diagram provided for an embodiment of this application;

[0073] Figure 5 A flowchart illustrating yet another data repair method provided in this application embodiment;

[0074] Figure 6 This is a schematic diagram of the structure of a data repair device provided in an embodiment of this application;

[0075] Figure 7 This is a schematic diagram of another data repair device provided in an embodiment of this application;

[0076] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0077] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort 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 types of information in the embodiments of this application, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. Optionally, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.

[0080] It should be understood that the terms "comprising" or "including" indicate the presence of the previously mentioned features, steps, or operations, but do not preclude the presence, occurrence, or addition of one or more other features, steps, or operations. The terms "and / or," etc., used in this application can be interpreted as inclusive, or mean any one or any combination thereof. Optionally, "A and / or B" means "any one of the following: A; B; A and B." Additionally, the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0081] In related technologies, read-only memory (ROM) is a type of solid-state semiconductor memory that can only read data stored in advance.

[0082] ROM can store ROM code. Once written to the ROM, the ROM code can only be read and cannot be modified or deleted under normal operating conditions. ROM code can be used to implement functions such as CPU core initialization, bootloader storage device interface initialization, and loading of secondary program loaders (SPL) or file download loaders (FDL). Because errors may exist during ROM manufacturing, or manufacturers may intentionally modify the ROM code to meet ever-changing market demands, it is necessary to repair the ROM code already embedded in the ROM.

[0083] In the above situation, only secondary wafer fabrication of the ROM is possible, resulting in low repair efficiency.

[0084] To address the aforementioned technical problems, this application provides a data repair method. By setting an enable repair address in the ROM, repair code on the Random Access Memory (RAM) is invoked through the enable repair address, and the data in the ROM is repaired according to the repair code. Thus, when errors or omissions exist in the ROM, or when the ROM code is intentionally modified, secondary wafer fabrication of the ROM is unnecessary. The repair code running on RAM executes arbitrary instructions and logical functions to repair the data in the ROM, thereby improving repair efficiency.

[0085] Below, in conjunction with Figure 1 Examples of data repair application scenarios are provided.

[0086] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. Please refer to [link / reference]. Figure 1 , Figure 1 It 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 central processing unit 101 can work in conjunction with the read-only memory 102 and the random access memory 103 to perform various computing tasks.

[0088] The central processing unit 101 can read instructions from the read-only memory 102 or the random access memory 103, and perform data processing and control operations according to the requirements of the instructions.

[0089] Read-only memory 102 can be used to store firmware programs or data.

[0090] For example, read-only memory 102 can store the control program of the embedded system to ensure that it is not accidentally modified during system operation. Central processing unit 101 can read the control program from read-only memory 102 as needed to perform specific tasks.

[0091] Random access memory 103 can be used to provide temporary storage space for programs and data running on a computer. When the computer runs a program, the program and data can be loaded into random access memory 103 from storage devices such as hard disks.

[0092] The central processing unit 101 can quickly read instructions and data from the random access memory 103 and process them. During program execution, intermediate results and temporary data generated can also be stored in the random access memory 103.

[0093] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for the same or similar content, the description will not be repeated in different embodiments.

[0094] Figure 2 This is a flowchart illustrating a data repair method provided in an embodiment of this application. The execution entity in this embodiment can be a central processing unit. Please refer to... Figure 2 The method includes:

[0095] S201. Determine the current address in the ROM.

[0096] The current address is the address currently read by the central processing unit.

[0097] Device initialization code can be stored in multiple addresses of the read-only memory (ROM). When the device starts up, the initialization code in the ROM can be executed. When the initialization code in the ROM is executed, the current address of the central processing unit can be determined.

[0098] S202. Determine whether the current address is an address that enables repair.

[0099] The enable repair address can be the repair address after successful enable.

[0100] The repair address can be used to repair the code in the ROM.

[0101] A successful enable signal can be used to indicate that the fix code corresponding to the fix address is allowed to run.

[0102] It can obtain at least one enabled repair address, and determine whether the current address exists among the at least one enabled repair address. If it does, the current address is determined to be an enabled repair address; otherwise, the current address is determined not to be an enabled repair address.

[0103] S203. When the current address is the address that enables repair, determine the target address for repair in the random access memory (RAM) based on the current address.

[0104] The target address can be the RAM address corresponding to the current address.

[0105] The target address can store the repair code.

[0106] Optionally, when the current address is the address that enables repair, the code corresponding to the current address can be determined based on the current address, and the target address for repair can be determined in the random access memory (RAM) using the code.

[0107] For example, suppose the current address is the enable repair address, the current address is 0x21000010, and the corresponding target address is 0x00000000 in RAM.

[0108] When the CPU runs to address 0x21000010, it can be determined that this address is the enable repair address. After the code at 0x21000010 is executed, the target address can be determined to be 0x00000000 in RAM.

[0109] Optionally, the corresponding target address can be determined in the random access memory (RAM) based on the current address in the following way: determine the first code in the ROM based on the current address; run the first code to call the context saver program corresponding to the first address in the ROM; and determine the corresponding target address in the RAM through the context saver program.

[0110] The first code includes the first address in the ROM.

[0111] The program that saves the current state can be executable code stored in ROM.

[0112] The executable code can be used to store current runtime information, such as relevant general-purpose register information.

[0113] It should be noted that the target address for repair can be determined in the random access memory (RAM) based on the current address using any feasible implementation method, and the embodiments of this application do not limit this.

[0114] S204. Based on the target address, determine the repair code in RAM, and repair the data in ROM according to the repair code.

[0115] The space corresponding to the target address can store the repair code.

[0116] Repair code can execute specific instructions and logic functions to fix vulnerabilities in the ROM.

[0117] For example, the repair code can change the configuration information in the registers, etc., and the functions that the repair code can achieve are not limited here.

[0118] Based on the target address, the repair code can be determined in RAM, and the repair code can be run to execute specific instructions and logical functions to repair the data in ROM.

[0119] The data repair method provided in this embodiment determines the current address in the ROM and whether it is an address that enables repair. If so, it determines the target address for repair in the Random Access Memory (RAM) based on the current address, determines the repair code in the RAM based on 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 when the ROM code is intentionally modified, secondary wafer fabrication of the ROM is not required. The data in the ROM can be repaired by executing arbitrary instructions and logic functions through the repair code running in RAM, thereby improving repair efficiency.

[0120] Figure 3 This is a flowchart illustrating another data repair method provided in an embodiment of this application. Based on the above embodiments, see [link to relevant documentation]. Figure 3 The method includes:

[0121] S301. Determine the current address in the ROM.

[0122] The execution process of S301 can be found in the execution process of S201, and will not be repeated here.

[0123] S302. Determine whether the current address is an address that enables repair.

[0124] The execution process of S302 can be found in the execution process of S202, and will not be repeated here.

[0125] S303. When the current address is the enable repair address, determine the first code in the ROM according to the current address.

[0126] The first code may include the first address in the ROM.

[0127] The first code can be used to run the field protection program.

[0128] When the current address is the address that enables repair, the current address can be read to determine the storage space in the ROM, and the first code can be retrieved from the storage space.

[0129] S304. Run the first code to call the scene protection program corresponding to the first address in the ROM.

[0130] The field protection program can be used to store field data in ROM.

[0131] For example, field data could be information from relevant general-purpose registers.

[0132] The first code can be run to determine the address to be called, and based on the address to be called, the save context program corresponding to the first address in the ROM can be called.

[0133] S305. Obtain the current running information in the ROM through the field protection program and store the current running information.

[0134] Current runtime information may include register information, etc., and is not limited here.

[0135] It can run a context-preserving program 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 current operating information, obtain the target address in the protection field program.

[0137] The site protection procedure can include multiple target addresses corresponding to the enable repair addresses.

[0138] When the current running information is successfully stored, the target address can be determined by protecting the current environment.

[0139] S307. Based on the target address, determine the repair code in RAM, and repair the data in ROM according to the repair code.

[0140] The repair code can be located in the RAM space corresponding to the target address, and the repair code can be run to repair the data in the ROM.

[0141] S308. Determine the second code in RAM.

[0142] The address corresponding to the second code can be located after the address corresponding to the repair code, so that the second code can run after the repair code is run.

[0143] The second code can be used to call the scene restoration program in ROM.

[0144] S309. Run the second code to call the restore scene program corresponding to the second address in the ROM.

[0145] The restore program can be used to restore the current running information in ROM.

[0146] Restoring the scene can be the reverse process of preserving the scene.

[0147] The second address in the ROM can be determined by running the second code, and the scene restoration program can be run based on the second address.

[0148] S310. By restoring the extrinsic program, the current running information in the ROM is restored, and the program runs to the next address corresponding to the current address.

[0149] By restoring the context program, the running information in the ROM can be restored based on the saved current running information, and after the context program is restored, the program will run to the next address corresponding to the current address.

[0150] Below, in conjunction with Figure 4 The process of S301-S310 will be explained.

[0151] Figure 4 This is a schematic diagram of an address space provided for an embodiment of this application. Based on the above embodiments, see also... Figure 4 , Figure 4 This includes ROM addresses and RAM addresses.

[0152] Assuming the current address is ROM address 0x21000010, the first code corresponding to the current address is AAAA, the enable 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] Data repair can be performed using the following steps:

[0154] 1. Determine the current address in the ROM: ROM address 0x21000010;

[0155] 2. Determine the current address as the address to enable repair;

[0156] 3. Determine the first code AAAA corresponding to the current address, and call the corresponding context protection program at ROM address 0x21001000 by running the first code AAAA;

[0157] 4. Obtain the current running information from the ROM through the context protection program and store the current running information;

[0158] 5. In response to the successful storage of the current running information, obtain the target address in the protection context program: RAM address 0x00000000;

[0159] 6. Based on 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 RAM, run the second code BBBB to call the restore context program corresponding to the second address 0x21002000 in the ROM, and restore the current running information in the ROM;

[0161] 8. Proceed to the next address corresponding to the current address 0x21000010.

[0162] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.

[0163] The data repair method provided in this embodiment determines the current address in the ROM and whether it is an enable repair address. If the current address is an enable repair address, a first code is determined in the ROM based on the current address, and the first code is executed to call the protection context program corresponding to the first address in the ROM. The protection context program obtains and stores the current running information in the ROM. In response to successful storage of the current running information, a target address is obtained in the protection context program. Based on the target address, repair code is determined in RAM, and the data in the ROM is repaired according to the repair code. A second code is determined in RAM, and the second code is executed to call the restore context program corresponding to the second address in the ROM. The restore context program restores the current running information in the ROM 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, secondary wafer fabrication of the ROM is not required. By running the repair code in RAM, arbitrary instructions and logical functions can be executed to repair the data in the ROM, thereby improving repair efficiency.

[0164] In one possible implementation, before determining whether the current address is an enable repair address, the repair configuration data is initialized.

[0165] Below, in conjunction with Figure 5 The process of initializing the repair configuration data is explained.

[0166] Figure 5 This is a flowchart illustrating another data repair method provided in an embodiment of this application. Based on the above embodiments, see [link to relevant documentation]. Figure 5 The method includes:

[0167] S501. Obtain the repair configuration data corresponding to the ROM.

[0168] The repair configuration data includes the repair method, at least one repair address, and the repair code corresponding to each repair address.

[0169] Repairing configuration data can be used to fix vulnerabilities in the ROM.

[0170] The repair configuration data corresponding to the ROM can be obtained from the programmable non-volatile memory.

[0171] S502. According to the repair method, enable at least one repair address to obtain at least one enable result.

[0172] The enabling result can be either successful or unsuccessful.

[0173] Based on the repair method, the enabling processing method can be determined. Based on the enabling processing method, at least one repair address can be enabled 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 can be enabled in the following way to obtain the enabling result:

[0175] If the repair method is hardware repair, the repair address is remapped to obtain the mapping result. If the mapping result is successful, the enable result is determined to be successful. If the mapping result is unsuccessful, the enable result is determined to be unsuccessful.

[0176] If the repair method is software repair, determine whether the repair address is the preset address. If yes, the enable result is confirmed as successful; otherwise, the enable result is confirmed as failed.

[0177] Among them, remapping is used to remap the original code in the repair address to the first code.

[0178] By remapping, the original code can be modified to jump to the first code of the protected context procedure.

[0179] S503. Based on at least one enable result, determine at least one enable repair address from at least one repair address.

[0180] Based on at least one enabling result, the repair address that has been successfully enabled can be determined as the enabled repair address.

[0181] Optionally, at least one enabled repair address can be determined from at least one repair address based on at least one enable result in the following manner: among at least one repair address, the target repair address whose enable result is successful is determined; the target repair address is determined as the enabled repair address.

[0182] S504. Store the repair code corresponding to at least one enable repair address into RAM.

[0183] For example, the repair code corresponding to the enable repair address 0x21000010 can be stored in RAM address 0x00000000.

[0184] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.

[0185] The data repair method provided in this embodiment obtains repair configuration data corresponding to the ROM. This repair configuration data includes a repair method, at least one repair address, and repair code corresponding to each repair address. Based on the repair method, at least one repair address is enabled to obtain at least one enabling result. Based on the at least one enabling result, at least one enabled repair address is determined from the at least one repair address. The repair codes corresponding to each of the at least one enabled repair address are stored in RAM. In this way, when errors or omissions exist in the ROM, or when the ROM code is intentionally modified, secondary wafer fabrication of the ROM is not required. By using the repair configuration data, the repair code running in RAM can be determined, and arbitrary instructions and logical functions can be executed to repair the data in the ROM, thereby improving repair efficiency.

[0186] Figure 6 This is a schematic diagram of a data repair device provided in an embodiment of this application. Please refer to... Figure 6 The device 600 includes a first determining module 601, a judging module 602, a second determining module 603, and a repair module 604, wherein...

[0187] The first determining module 601 is used to determine the current address in the read-only memory ROM, wherein the current address is the address currently read;

[0188] The judgment module 602 is used to determine whether the current address is an enable repair address;

[0189] The second determining module 603 is used to determine the target address for repair in the random access memory RAM according to the current address when the current address is the enable repair address;

[0190] The repair module 604 is used to determine the repair code in the RAM according to the target address, and repair the data in the ROM according to the repair code.

[0191] In one possible implementation, the second determining module 603 is specifically used for:

[0192] Based on the current address, a first code is determined in the ROM, the first code including the first address in the ROM;

[0193] Run the first code to call the protected context program corresponding to the first address in the ROM;

[0194] The corresponding target address is determined in the random access memory (RAM) through the aforementioned field protection procedure.

[0195] In one possible implementation, the second determining module 603 is specifically used for:

[0196] The current running information in the ROM is obtained through the protected field program, and the current running information is stored.

[0197] In response to the successful storage of the current running information, the target address is obtained in the protection site program.

[0198] Figure 7 This is a schematic diagram of another data repair device provided in an embodiment of this application. Figure 6 Based on the illustrated embodiments, please refer to Figure 7 The data repair device 600 also includes a third determining module 605, which is used for:

[0199] The second code is determined in the RAM;

[0200] The second code is executed to call the restore scene program corresponding to the second address in the ROM;

[0201] The restored environment program restores the current running information in the ROM and runs to the next address corresponding to the current address.

[0202] In one possible implementation, the device further includes a configuration module 606, which is configured to:

[0203] Obtain the repair configuration data corresponding to the ROM, the repair configuration data including the repair method, at least one repair address, and the repair code corresponding to each repair address;

[0204] According to the repair method, the at least one repair address is enabled to obtain at least one enabling result, which includes enabling success or enabling failure.

[0205] Based on the at least one enabling repair address, at least one enabling repair address is determined from the at least one repair address;

[0206] The repair code corresponding to each of the at least one enabled repair address is stored in the RAM.

[0207] In one possible implementation, for any given repair address, the configuration module 606 is specifically used for:

[0208] If the repair method is a hardware repair method, the repair address is remapped to obtain a mapping result. If the mapping result is successful, the enabling result is determined to be successful. If the mapping result is unsuccessful, the enabling result is determined to be unsuccessful. 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 yes, determine that the enabling result is successful; otherwise, determine that the enabling result is unsuccessful.

[0210] In one possible implementation, the configuration module 606 is specifically used for:

[0211] In at least one repair address, the target repair address whose enabling result is successfully enabled is determined;

[0212] The target repair address is determined as the enable repair address.

[0213] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to... Figure 8 The electronic device 800 may include: a memory 801, a processor 802, and a transceiver 803.

[0214] Memory 801 is used to store program instructions;

[0215] The processor 802 is used to execute the program instructions stored in the memory, so that the electronic device 800 performs any of the data repair methods shown above.

[0216] Transceiver 803 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, transmitter port, or transmitter interface, and the receiver may also be referred to as a receiver port, receiver interface, or similar descriptions. Exemplarily, memory 801, processor 802, and transceiver 803 are interconnected via bus 804.

[0217] This application also provides a chip on which a computer program is stored. When the computer program is executed by the chip, it implements the above-mentioned data repair method. The corresponding content and effects can be referred to in the method embodiment section, and will not be repeated here.

[0218] This application also provides a chip module on which a computer program is stored. When the computer program is executed by the chip module, it implements the above-mentioned data repair method. The corresponding content and effects can be referred to the method embodiment section, and will not be repeated here.

[0219] This application also provides a computer program product that can be executed by a processor, and when the computer program product is executed, the above-mentioned data repair method can be implemented.

[0220] The data repair apparatus, electronic device, computer-readable storage medium, and computer program product of the embodiments of this application can execute the technical solutions shown in the above-described data repair method embodiments. Their implementation principles and beneficial effects are similar and will not be described again here.

[0221] All or part of the steps in the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-described method embodiments; 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] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0223] These computer-executable instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0224] These computer-executable instructions may also be loaded onto a computer or other programmable data processing equipment, causing a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0225] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A data repair method, characterized in that, The method includes: Determine the current address in the read-only memory (ROM), where the current address is the address currently read. Determine whether the current address is an enabled repair address; the enabled repair address is the repair address after successful enabling; the repair address is the address used to repair the code in the ROM; successful enabling indicates that the repair code corresponding to the repair address is allowed to run; When the current address is an enable repair address, a first code is determined in the ROM based on the current address, and the first code includes a first address in the ROM; The first code is executed to call the protection context program corresponding to the first address in the ROM; the first code is used to jump to and run the protection context program; the protection context program is executable code embedded in the ROM. The current running information in the ROM is obtained through the protected field program, and the current running information is stored. In response to the successful storage of the current running information, the target address for repair is obtained in the protection scene program; the target address is the RAM address corresponding to the current address. Based on the target address, repair code is determined in RAM, and the data in ROM is repaired according to the repair code; Before determining whether the current address is an address that enables repair, the process also includes: Obtain the repair configuration data corresponding to the ROM, the repair configuration data including the repair method, at least one repair address, and the repair code corresponding to each repair address; According to the repair method, the at least one repair address is enabled to obtain at least one enabling result, which includes enabling success or enabling failure. Based on the at least one enabling repair address, at least one enabling repair address is determined from the at least one repair address; The repair code corresponding to each of the at least one enabled repair address is stored in the RAM.

2. The method according to claim 1, characterized in that, After repairing the data in the ROM, the process also includes: The second code is determined in the RAM; The second code is executed to call the restore scene program corresponding to the second address in the ROM; The restored environment program restores the current running information in the ROM and runs to the next address corresponding to the current address.

3. The method according to claim 1, characterized in that, For any repair address, according to the repair method, the repair address is enabled to obtain the enabling result, including: If the repair method is a hardware repair method, the repair address is remapped to obtain a mapping result. If the mapping result is successful, the enabling result is determined to be successful. If the mapping result is unsuccessful, the enabling result is determined to be unsuccessful. 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 yes, determine that the enabling result is successful; otherwise, determine that the enabling result is unsuccessful.

4. The method according to claim 3, characterized in that, Based on the at least one enabling result, at least one enabling repair address is determined from the at least one repair address, including: In at least one repair address, the target repair address whose enabling result is successfully enabled is determined; The target repair address is determined as the enable repair address.

5. A data repair device, characterized in that, The device includes: The first determining module is used to determine the current address in the read-only memory (ROM), wherein the current address is the address currently read. The judgment module is used to determine whether the current address is an enabled repair address; the enabled repair address is the repair address after successful enabling; the repair address is the address used to repair the code in the ROM; successful enabling indicates that the repair code corresponding to the repair address is allowed to run; The second determining module is configured to, when the current address is an enable repair address, determine a first code in the ROM based on the current address, the first code being used to run a protection context program; the protection context program is executable code embedded in the ROM; the first code includes a first address in the ROM; run the first code to call the protection context program in the ROM corresponding to the first address; obtain current running information in the ROM through the protection context program and store the current running information; in response to successful storage of the current running information, obtain the target address for repair in the protection context program; the target address is a RAM address corresponding to the current address; The repair module is used to determine repair code in RAM based on the target address, and repair the data in ROM based on the repair code; Before determining whether the current address is an address that enables repair, the process also includes: Obtain the repair configuration data corresponding to the ROM, the repair configuration data including the repair method, at least one repair address, and the repair code corresponding to each repair address; According to the repair method, the at least one repair address is enabled to obtain at least one enabling result, which includes enabling success or enabling failure. Based on the at least one enabling repair address, at least one enabling repair address is determined from the at least one repair address; The repair code corresponding to each of the at least one enabled repair address is stored in the RAM.

6. An electronic device, characterized in that, include: Memory, processor, and transceiver; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, are used to implement the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • SoC chip, method for obtaining repair information, storage medium and electronic equipment

    CN112231136A

  • Method and apparatus for patching code and data residing on a memory

    CN1732443A