Chip firmware management method, device, computer program product and storage medium

By setting firmware status priorities in the chip's storage device and managing it, the problem of inability to start after power outage during the chip's firmware upgrade process is solved, achieving higher chip reliability and user experience.

CN119718472BActive Publication Date: 2025-05-30SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510221606.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-05-30
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

There is a lack of a mature chip firmware management method in the prior art, which leads to the chip being unable to start the target system after power is cut off during the firmware upgrade process of the target system in the chip, which reduces the reliability and user experience of the chip.

Method used

By setting the priority of the firmware status in the first storage area and the second storage area of ​​the storage device, the firmware with the highest priority is selected as the target firmware for startup. During firmware upgrade, the firmware in the storage area with the lowest priority is updated, and the firmware status of the updated storage area is replaced with a special firmware status, and the firmware status of the storage area that is not updated is replaced with the lowest priority status.

Benefits of technology

Even if the power is cut off during the upgrade process, reliable firmware can be selected and started by comparing firmware status priorities, improving the reliability and user experience of the chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718472B_ABST
    Figure CN119718472B_ABST
Patent Text Reader

Abstract

The present invention discloses a chip firmware management method, device, computer program product and storage medium, belonging to the field of chip management, which is used to selectively update and use the target system firmware in two storage areas, and solves the problem that the target system cannot work properly after power-on due to power failure during the update process of the target system firmware. When updating the firmware, the firmware in the storage area with the lowest priority of the firmware status is updated, and the firmware status in the storage area where the updated firmware is located is replaced with a special firmware status corresponding to the storage area where the firmware is updated, and the firmware status in the storage area where the unupdated firmware is located is replaced with the firmware status with the lowest priority. Even if power failure occurs during the upgrade process, the reliable firmware with the highest priority of the firmware status can be successfully selected for startup through the comparison of the firmware status priorities, improving the chip reliability and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip management, and in particular, to a method, device, computer program product, and storage medium for chip firmware management. Background Art

[0002] During the startup process, a chip needs to boot a target system (such as a kernel system) in the chip. The firmware of the target system is usually located in a storage device, and there is a need to upgrade the firmware of the target system. However, in related technologies, there is a lack of a mature method for chip firmware management. If power is interrupted during the process of upgrading the firmware of the target system in the chip, it will cause the chip to be unable to boot the target system after being powered on again, reducing the reliability of the chip and the user experience.

[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve currently. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, device, computer program product, and storage medium for chip firmware management. When the chip starts up, the firmware with the highest priority among the firmware states in the first storage area and the second storage area of the storage device can be used as the target firmware, and the target system can be booted according to the target firmware. When the firmware needs to be updated, the firmware in the storage area with the lowest priority of the firmware state can be updated, and accordingly, the firmware state in the storage area where the firmware being updated is located can be replaced with a special firmware state corresponding to the storage area where the firmware is updated, and the firmware state in the storage area where the firmware not being updated is located can be replaced with the firmware state with the lowest priority, which is convenient for selecting the firmware with the highest priority of the firmware state for startup next time. And even if power is interrupted during the upgrade process, a reliable firmware can be successfully selected for startup through the comparison of the firmware state priorities, improving the reliability of the chip and the user experience.

[0005] To solve the above technical problems, the present invention provides a method for chip firmware management, which is applied to a processor of a chip and includes:

[0006] When starting up, use the firmware with the highest priority among the firmware states in the first storage area and the second storage area of the storage device as the target firmware, and boot the target system according to the target firmware, where the firmware state is the state of the firmware of the target system stored in the storage area, and the storage area includes the first storage area and the second storage area;

[0007] In response to a firmware modification instruction, replace the firmware in the storage area with the lowest priority of the firmware state with the latest firmware;

[0008] Replace the firmware status in the storage area where the firmware to be updated this time is located with a special firmware status corresponding to the storage area where the firmware is updated, where the priority of the special firmware status is higher than the lowest priority;

[0009] Replace the firmware status in the storage area where the firmware not updated this time is located with the firmware status of the lowest priority.

[0010] On the other hand, at startup, use the firmware with the highest priority among the firmware statuses in the first storage area and the second storage area of the storage device as the target firmware, and start the target system according to the target firmware, including:

[0011] At startup, obtain the firmware statuses in the first storage area and the second storage area of the storage device respectively;

[0012] Determine whether the firmware statuses in the first storage area and the second storage area are the same;

[0013] If they are different, use the firmware with the highest priority among the firmware statuses in the first storage area and the second storage area as the target firmware, and start the target system according to the target firmware;

[0014] If they are the same, use the firmware in the storage area with the highest priority as the target firmware, and start the target system according to the target firmware.

[0015] On the other hand, the special firmware status corresponding to the first storage area is different from the special firmware status corresponding to the second storage area.

[0016] On the other hand, before determining whether the firmware statuses in the first storage area and the second storage area are the same, the chip firmware management method further includes:

[0017] Determine whether the current combination of the firmware statuses in the first storage area and the second storage area belongs to a preset correct combination set;

[0018] If it belongs, determine whether the firmware statuses in the first storage area and the second storage area are the same;

[0019] If it does not belong, control the prompter to prompt a firmware status error.

[0020] On the other hand, after determining whether the current combination of the firmware statuses in the first storage area and the second storage area belongs to a preset correct combination set, the chip firmware management method further includes:

[0021] If it does not belong, determine whether the firmware statuses in both storage areas belong to the special firmware status corresponding to their respective storage areas;

[0022] If they all belong to the special firmware states corresponding to the storage areas, the firmware in the storage area with the highest priority among the storage areas is taken as the target firmware, and the target system is started according to the target firmware;

[0023] If they are not all in the special firmware states corresponding to the storage areas, and the firmware that belongs to the special firmware state corresponding to the storage area is taken as the target firmware, and the target system is started according to the target firmware.

[0024] On the other hand, starting the target system according to the target firmware includes:

[0025] Loading the bootloader from the storage section of the bootloader stored in the target storage area;

[0026] Executing the bootloader to load the target firmware from the target storage section stored in the target storage area, where the target storage area is the storage area where the target firmware is located, and the target storage section is the storage section of the target firmware;

[0027] Executing the target firmware to start the target system.

[0028] On the other hand, the target firmware includes a secondary program loader sub-firmware, a general bootloader, and a kernel system firmware;

[0029] Executing the bootloader to load the target firmware from the target storage section stored in the target storage area includes:

[0030] Executing the bootloader to load the secondary program loader sub-firmware in the target firmware from the first storage sub-section stored in the target storage area;

[0031] Executing the target firmware includes:

[0032] Executing the secondary program loader sub-firmware to load the general bootloader in the target firmware from the second storage sub-section stored in the target storage area;

[0033] Executing the general bootloader to load the kernel system firmware in the target firmware from the third storage sub-section stored in the target storage area;

[0034] Executing the kernel system firmware to start the target system.

[0035] On the other hand, at startup, taking the firmware with the highest priority among the firmware states in the first storage area and the second storage area of the storage device as the target firmware, and starting the target system according to the target firmware includes:

[0036] At startup, obtaining the storage device combination currently connected to the chip;

[0037] According to the preset storage area selection rule, select a first storage area and a second storage area from each storage device in the storage device combination currently connected to the chip;

[0038] Take the firmware with the highest priority in the firmware status of the first storage area and the second storage area of the storage device as the target firmware, and start the target system according to the target firmware.

[0039] On the other hand, when starting up, obtaining the storage device combination currently connected to the chip includes:

[0040] When starting up, determine the storage device combination currently connected to the chip according to the switch value of the multi-bit DIP switch;

[0041] Among them, the switch value of any bit of the DIP switch represents the in-position status of a corresponding storage device.

[0042] On the other hand, the storage area selection rule includes:

[0043] The selection method of double storage devices with single mirroring has a higher priority than the selection method of single storage device with double mirroring;

[0044] Among them, double storage devices with single mirroring means selecting a storage area from each of the two storage devices, and single storage device with double mirroring means selecting two storage areas from a single storage device.

[0045] On the other hand, after obtaining the firmware status in the first storage area and the second storage area of the storage device respectively when starting up, the chip firmware management method further includes:

[0046] Control the prompt to prompt the firmware status in the first storage area and the second storage area.

[0047] On the other hand, the firmware status of any storage area includes a two-bit array;

[0048] The first numerical combination of the two-bit array represents the special firmware status of the firmware in the first storage area, the second numerical combination of the two-bit array represents the special firmware status of the firmware in the second storage area, and the third numerical combination of the two-bit array represents the firmware status with the lowest priority.

[0049] To solve the above technical problems, the present invention also provides a chip firmware management device, including:

[0050] A memory for storing a computer program;

[0051] A processor for implementing the steps of the above-mentioned chip firmware management method when executing the computer program.

[0052] To solve the above technical problems, the present invention also provides a computer program product, including computer programs / instructions, which, when executed by a processor, implement the steps of the chip firmware management method as described above.

[0053] To solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the chip firmware management method as described above.

[0054] Beneficial effects: The present invention provides a chip firmware management method. Considering the case where there are two storage areas for storing firmware, by setting the firmware status and dividing the priority of the firmware status, a reliable firmware can be efficiently and clearly selected for use. Therefore, in the present invention, when the chip starts up, the firmware with the highest priority of the firmware status in the first storage area and the second storage area of the storage device can be used as the target firmware, and the target system can be started according to the target firmware. When firmware needs to be updated, the firmware in the storage area with the lowest priority of the firmware status can be updated, and accordingly, the firmware status in the storage area where the firmware being updated is located is replaced with a special firmware status corresponding to the storage area where the firmware is updated, and the firmware status in the storage area where the firmware not being updated is located is replaced with the firmware status of the lowest priority, which is convenient for selecting the firmware with the highest priority of the firmware status for startup next time. And even if the power is cut off during the upgrade process, a reliable firmware can be successfully selected for startup through the comparison of the firmware status priorities, improving the chip reliability and user experience.

[0055] The present invention also provides a chip firmware management device, a computer program product, and a computer-readable storage medium, which have the same beneficial effects as the above chip firmware management method. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the related technologies and embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0057] Figure 1 It is a flowchart showing a chip firmware management method provided by the present invention;

[0058] Figure 2 It is a flowchart showing another chip firmware management method provided by the present invention;

[0059] Figure 3 It is a structural diagram of a storage device provided by the present invention;

[0060] Figure 4 Schematic flowchart of yet another chip firmware management method provided by the present invention;

[0061] Figure 5 Schematic structural diagram of a chip firmware management device provided by the present invention;

[0062] Figure 6 Schematic structural diagram of a computer-readable storage medium provided by the present invention. Specific embodiments

[0063] The core of the present invention is to provide a chip firmware management method, device, computer program product and storage medium. When the chip starts up, it can use the firmware with the highest priority among the firmware states in the first storage area and the second storage area of the storage device as the target firmware, and start the target system according to the target firmware. When firmware needs to be updated, the firmware in the storage area with the lowest priority of the firmware state can be updated, and accordingly, the firmware state in the storage area where the firmware being updated is located is replaced with a special firmware state corresponding to the storage area where the firmware is updated, and the firmware state in the storage area where the firmware not being updated is located is replaced with the firmware state with the lowest priority, which is convenient for selecting the firmware with the highest priority of the firmware state for startup next time. And even if the power is cut off during the upgrade process, a reliable firmware can be successfully selected for startup through the comparison of the firmware state priorities, improving the chip reliability and user experience.

[0064] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0065] Please refer to Figure 1 , Figure 1 Schematic flowchart of a chip firmware management method provided by the present invention. The chip firmware management method is applied to a processor of a chip and includes:

[0066] S101: At startup, use the firmware with the highest priority among the firmware states in the first storage area and the second storage area of the storage device as the target firmware, and start the target system according to the target firmware, where the firmware state is the state of the firmware of the target system stored in the storage area, and the storage area includes the first storage area and the second storage area;

[0067] Specifically, considering the technical problems in the background art as described above, and also considering that in the case of a storage area with two stored firmware, by setting the firmware state and dividing the priority of the firmware state, a reliable firmware can be efficiently and clearly selected for use. Therefore, in the embodiments of the present invention, it is desired to set the firmware state (the firmware state has a priority) for "two storage areas for storing the target system firmware", and adjust the firmware states of the two storage areas during the firmware upgrade process, so that even if the power is cut off during the firmware upgrade process, the firmware can still be correctly loaded to start the target system after the power is restored. Therefore, in this step, at startup, the firmware with the highest priority of the firmware states in the first storage area and the second storage area of the storage device can be used as the target firmware, and the target system can be started according to the target firmware.

[0068] Among them, in the initial situation, the target system firmware can be placed in the first storage area, and the priority of the initial firmware state of the first storage area can be higher than the priority of the initial firmware state of the second storage area, so that in the initial situation, the processor can start the target system according to the target firmware in the first storage area.

[0069] Specifically, the first storage area and the second storage area respectively store a copy of the target system firmware. Therefore, the firmware with the highest priority of the firmware states in the first storage area and the second storage area refers to the one with the higher priority of the firmware states among the two copies of firmware.

[0070] S102: In response to the firmware modification instruction, replace the firmware in the storage area with the lowest priority of the firmware state with the latest firmware;

[0071] Specifically, since the firmware with the highest priority of the firmware state will be used as the target firmware for startup, in order not to affect the target firmware during the update, in response to the firmware modification instruction, the firmware in the storage area with the lowest priority of the firmware state can be replaced with the latest firmware.

[0072] S103: Replace the firmware state in the storage area where the firmware being updated is located with a special firmware state corresponding to the storage area where the firmware is updated, where the priority of the special firmware state is higher than the lowest priority;

[0073] Specifically, since after the firmware is updated, it is necessary to set the firmware state of the storage area where the firmware is updated to the one with a "higher priority of the firmware state", in order to more conveniently identify the firmware state of the upgraded firmware, in this step, the firmware state in the storage area where the firmware being updated is located can be replaced with a special firmware state corresponding to the storage area where the firmware is updated, that is, through the special firmware state, it can be identified that the firmware corresponding to this firmware state belongs to the updated firmware.

[0074] S104: Replace the firmware status in the storage area where the firmware not updated this time is located with the firmware status of the lowest priority.

[0075] Specifically, in order to make the firmware status of the storage area where the firmware is updated be set to the one with a "higher priority of firmware status" after the firmware is updated, in the embodiments of the present invention, the firmware status in the storage area where the firmware not updated this time is located can also be replaced with the firmware status of the lowest priority, so as to achieve the effect that "the firmware status of one storage area is a special firmware status, and the firmware status of the other storage area is the firmware status of the lowest priority". Then, when the chip starts up, the firmware with the special firmware status will be used as the target firmware to start the target system.

[0076] In addition, assuming a power failure occurs between S103 and S104, the firmware statuses of both storage areas are the special firmware statuses corresponding to their respective storage areas. Since the firmware not updated this time can still support the startup of the target system, in this case, when the chip is powered on again, no matter which storage area's firmware is used as the target firmware, it can support the startup of the target system. In this case, it is only necessary to select the target firmware from the two firmwares with the special firmware status.

[0077] The present invention provides a chip firmware management method. Considering that in the case of having two storage areas for storing firmware, through the setting of firmware status and the division of firmware status priorities, a reliable firmware can be efficiently and clearly selected for use. Therefore, in the present invention, when the chip starts up, the firmware with the highest priority of firmware status in the first storage area and the second storage area of the storage device can be used as the target firmware, and the target system is started according to the target firmware. When the firmware needs to be updated, the firmware in the storage area with the lowest priority of firmware status can be updated, and accordingly, the firmware status in the storage area where the firmware updated this time is located is replaced with the special firmware status corresponding to the storage area where the firmware is updated, and the firmware status in the storage area where the firmware not updated this time is located is replaced with the firmware status of the lowest priority, which is convenient for selecting the firmware with the highest priority of firmware status for startup next time. And even if a power failure occurs during the upgrade process, a reliable firmware can be successfully selected for startup through the comparison of firmware status priorities, improving the reliability of the chip and the user experience.

[0078] Based on the above embodiments:

[0079] As an optional embodiment, when starting up, using the firmware with the highest priority of firmware status in the first storage area and the second storage area of the storage device as the target firmware and starting the target system according to the target firmware includes:

[0080] At startup, obtain the firmware status in the first storage area and the second storage area of the storage device respectively;

[0081] Determine whether the firmware statuses in the first storage area and the second storage area are the same;

[0082] If they are different, use the firmware with the highest priority among the firmware statuses in the first storage area and the second storage area as the target firmware, and start the target system according to the target firmware;

[0083] If they are the same, use the firmware in the storage area with the highest priority as the target firmware, and start the target system according to the target firmware.

[0084] Specifically, considering that in some cases (such as the special firmware statuses corresponding to the first and second storage areas being the same, or the firmware status of a certain storage area being incorrect), the firmware statuses in the two storage areas may be the same. In this case, in order to successfully select the target firmware, in the embodiments of the present invention, the priorities of the storage areas are set, that is, the first storage area and the second storage area have different priorities. In this case, at startup, the firmware statuses in the first storage area and the second storage area of the storage device can be obtained respectively, and it can be determined whether the firmware statuses in the first storage area and the second storage area are the same. In the case of being the same, the firmware in the storage area with the highest priority can be used as the target firmware, and the target system can be started according to the target firmware.

[0085] Among them, the priorities of the first storage area and the second storage area can be set independently. For example, it can be set that the priority of the default first storage area is higher than that of the second storage area, etc. The embodiments of the present invention do not make any limitations here.

[0086] As an optional embodiment, the special firmware status corresponding to the first storage area is different from the special firmware status corresponding to the second storage area.

[0087] Specifically, in order to clearly distinguish the two storage areas through the firmware statuses of the two storage areas, the special firmware status corresponding to the first storage area in the embodiments of the present invention is different from the special firmware status corresponding to the second storage area.

[0088] Of course, the special firmware status corresponding to the first storage area and the special firmware status corresponding to the second storage area can also be set to the same firmware status. The embodiments of the present invention do not make any limitations here.

[0089] As an optional embodiment, before determining whether the firmware statuses in the first storage area and the second storage area are the same, the chip firmware management method further includes:

[0090] Determine whether the current combination of the firmware states in the first storage area and the second storage area belongs to a preset correct combination set;

[0091] If it belongs, determine whether the firmware states in the first storage area and the second storage area are the same;

[0092] If it does not belong, control the prompter to prompt that the firmware state is incorrect.

[0093] Specifically, considering that in normal circumstances, there are a limited number of combinations of the firmware states in the first storage area and the second storage area. Therefore, in order to quickly verify whether the firmware states in the first storage area and the second storage area are incorrect, in the embodiments of the present invention, a preset correct combination set is set. The preset correct combination set includes various theoretically possible correct combinations of "the combination of the firmware states in the first storage area and the second storage area", and determine whether the current combination of the firmware states in the first storage area and the second storage area belongs to the preset correct combination set. If it belongs, it means that the firmware states in the first storage area and the second storage area probably have no errors. If it does not belong, it probably means that the firmware state of at least one of the storage areas has a problem. In this case, the prompter can be controlled to prompt that the firmware state is incorrect.

[0094] Among them, the prompter can be of various types. For example, it can be a display or a voice announcer, etc. The embodiments of the present invention do not make a limitation here.

[0095] As an optional embodiment, after determining whether the current combination of the firmware states in the first storage area and the second storage area belongs to the preset correct combination set, the chip firmware management method further includes:

[0096] If it does not belong, determine whether the firmware states in both storage areas belong to the special firmware states corresponding to their respective storage areas;

[0097] If both belong to the special firmware states corresponding to their respective storage areas, use the firmware in the storage area with the highest priority as the target firmware, and start the target system according to the target firmware;

[0098] If they are not both the special firmware states corresponding to their respective storage areas, and use the firmware that belongs to the special firmware state corresponding to its storage area as the target firmware, and start the target system according to the target firmware.

[0099] Specifically, in order to successfully select the target firmware and start the target system when there are errors in the firmware status, first, considering the abnormal situation that "the firmware statuses in both storage areas belong to the special firmware status corresponding to the respective storage area", in the embodiments of the present invention, it can be determined whether the firmware statuses in both storage areas belong to the special firmware status corresponding to the respective storage area. If they both belong to the special firmware status corresponding to the respective storage area, the firmware in the storage area with the highest priority can be used as the target firmware, and the target system can be started according to the target firmware. Also, considering that the firmware in the special firmware status has higher reliability compared to the firmware status in other location forms, when they are not both the special firmware status corresponding to the respective storage area, the firmware that belongs to the special firmware status corresponding to the respective storage area can be used as the target firmware, and the target system can be started according to the target firmware.

[0100] As an optional embodiment, starting the target system according to the target firmware includes:

[0101] Loading the bootloader from the storage section of the bootloader stored in the target storage area;

[0102] Executing the bootloader to load the target firmware from the target storage section stored in the target storage area, where the target storage area is the storage area where the target firmware is located, and the target storage section is the storage section of the target firmware;

[0103] Executing the target firmware to start the target system.

[0104] Specifically, in order to successfully load and execute the target firmware, in the embodiments of the present invention, a bootloader is set in any storage area. When the bootloader is executed, the target firmware can be loaded from the target storage section stored in the target storage area, and then the target firmware is executed.

[0105] Among them, the target firmware can be loaded into the chip for execution, and specifically, it can be loaded into various positions inside the chip, such as in SRAM (Static Random Access Memory), etc. The embodiments of the present invention do not limit this here.

[0106] As an optional embodiment, the target firmware includes a secondary program loader sub-firmware, a general bootloader, and a kernel system firmware;

[0107] Executing the bootloader to load the target firmware from the target storage section stored in the target storage area includes:

[0108] Execute the bootloader to load the secondary program loader sub-firmware in the target firmware from the first storage sub-segment stored in the target storage area;

[0109] Executing the target firmware includes:

[0110] Execute the secondary program loader sub-firmware to load the universal boot loader in the target firmware from the second storage sub-segment stored in the target storage area;

[0111] Execute the universal boot loader to load the kernel system firmware in the target firmware from the third storage sub-segment stored in the target storage area;

[0112] Execute the kernel system firmware to start the target system.

[0113] Specifically, considering that the startup of the kernel system firmware requires multi-level boot, when the target system is a kernel system (kernel system), the target firmware can include a secondary program loader sub-firmware (SPL, Secondary ProgramLoader), a universal boot loader (U-Boot, Universal Boot Loader), and the kernel system firmware. In this way, the bootloader can first load the secondary program loader sub-firmware in the target firmware, load the universal boot loader when executing the secondary program loader sub-firmware, load the kernel system program and execute the kernel system program when executing the universal boot loader, thus completing the startup of the kernel system.

[0114] Among them, during the boot startup process of the target system, it can also include the BootRom (Boot Read-Only Memory, primary startup program) stage that is first executed inside the chip.

[0115] For better illustration of the embodiments of the present invention, please refer to Figure 2 , Figure 2 which is a schematic flowchart of another chip firmware management method provided by the present invention. After the chip is powered on, it can first read and execute the primary startup program from the ROM, then determine the first and second storage areas, then read the firmware status of the two storage areas, and finally select the target firmware according to the firmware status to perform the boot startup of the target system.

[0116] For better illustration of the embodiments of the present invention, please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a storage device provided by the present invention. Each storage device connected to the chip can have two storage areas as shown in Figure 3 , Figure 3The upper half and the lower half in it respectively represent a storage area. In the same storage device, the first information group in the upper half can be represented by Paramter_ROM_P0, the first information group in the lower half can be represented by Paramter_ROM_P1, the second information group in the upper half can be represented by Parameter_P0, the second information group in the lower half can be represented by Parameter_P1, the boot program in the upper half can be represented by PRE_P0, and the boot program in the lower half can be represented by PRE_P1.

[0117] Among them, the first information group can include the firmware status of the storage area where it is located and the storage section of the boot program, and the second information group can include the storage section of the firmware of the target system. Through this structure, it can simply and accurately support the boot startup of the target system.

[0118] Of course, in addition to this specific storage structure, the storage structure of the storage area in the storage device can also be in other forms, and the embodiments of the present invention do not limit this here.

[0119] As an optional embodiment, at startup, taking the firmware with the highest priority of the firmware status in the first storage area and the second storage area of the storage device as the target firmware, and starting the target system according to the target firmware includes:

[0120] At startup, obtaining the combination of storage devices currently connected to the chip;

[0121] According to the preset storage area selection rule, selecting the first storage area and the second storage area from each storage device in the combination of storage devices currently connected to the chip;

[0122] Taking the firmware with the highest priority of the firmware status in the first storage area and the second storage area of the storage device as the target firmware, and starting the target system according to the target firmware.

[0123] Specifically, considering that there may be various situations for the storage devices connected to the chip, and there may also be various situations for the layout of the first and second storage areas. In order to support higher flexibility in connecting storage devices and flexibility in the layout of storage areas, the processor in the embodiments of the present invention can, at startup, according to the preset storage area selection rule, select the first storage area and the second storage area from each storage device in the combination of storage devices currently connected to the chip. In this way, no matter what the combination of storage devices currently connected to the chip is, two storage areas can be selected, and the storage area selection rule can be flexibly configured.

[0124] As an optional embodiment, obtaining the combination of storage devices currently connected to the chip at startup includes:

[0125] At startup, determine the combination of storage devices currently connected to the chip according to the switch values of the multi-bit DIP switch;

[0126] Among them, the switch value of any bit of the DIP switch represents the presence status of a corresponding storage device.

[0127] Specifically, considering that the combination of storage devices currently connected to the chip can be represented at low cost and accurately through the multi-bit DIP switch, in the embodiments of the present invention, at startup, the combination of storage devices currently connected to the chip can be determined according to the switch values of the multi-bit DIP switch, and the presence status of a corresponding storage device can be represented by the switch value of any bit of the DIP switch, which can further reduce the cost of the DIP switch.

[0128] To better illustrate the embodiments of the present invention, please refer to Table 1 below. Table 1 is a DIP switch value comparison table provided by the present invention.

[0129] Table 1

[0130]

[0131] Among them, in Table 1, it is assumed that there are 4 storage devices connected to the chip, numbered 0-3 respectively, and are abbreviated as Medium 0, Medium 1, Medium 2, and Medium 3 according to different numbers. Bit0 corresponds to Medium 0, Bit1 corresponds to Medium 1, Bit2 corresponds to Medium 2, and Bit3 corresponds to Medium 3. For any bit, the value 1 indicates that the corresponding storage device is present, and the value 0 indicates that the corresponding storage device is not present.

[0132] As an optional embodiment, the storage area selection rule includes:

[0133] The selection method of double storage devices with single mirroring has a higher priority than the selection method of single storage device with double mirroring;

[0134] Among them, double storage devices with single mirroring means selecting one storage area from each of the two storage devices, and single storage device with double mirroring means selecting two storage areas from a single storage device.

[0135] Specifically, considering that the method of having two storage areas located in different storage devices can improve the disaster tolerance ability of the firmware, in the embodiments of the present invention, the storage area selection rule can be set as: the selection method of double storage devices with single mirroring has a higher priority than the selection method of single storage device with double mirroring.

[0136] Of course, in addition to this specific form, the storage area selection rule can also be set in other forms, and the embodiments of the present invention do not limit this here.

[0137] Specifically, based on the situation in Table 1 above, since the selection method of dual storage devices with single mirroring has a higher priority than the selection method of single storage device with dual mirroring, when there are more than one storage devices present, the storage areas in two of the storage devices can be selected as the first storage area and the second storage area. When there is one storage device present, the first storage area and the second storage area can be selected from the only present storage device. When the number of present storage devices is greater than two, any two of the present storage devices can be arbitrarily selected and the storage areas can be selected.

[0138] Among them, the storage device can be of various types, such as flash or eMMC (Embedded MultiMedia Card), etc., and the embodiments of the present invention do not make limitations here.

[0139] As an optional embodiment, after obtaining the firmware statuses in the first storage area and the second storage area of the storage device respectively at startup, the chip firmware management method further includes:

[0140] Controlling a prompter to prompt the firmware statuses in the first storage area and the second storage area.

[0141] Specifically, considering that the staff can obtain a lot of information through the firmware statuses in the first storage area and the second storage area, such as whether the firmware status is in error, which storage area is the most recently updated storage area, and whether firmware update needs to be performed again, etc., so in the embodiments of the present invention, the prompter can be controlled to prompt the firmware statuses in the first storage area and the second storage area so that the staff can perform corresponding processing.

[0142] As an optional embodiment, the chip is a baseboard management controller.

[0143] Specifically, considering the boot startup requirements of the target system in the BMC (Baseboard management controller), so the chip in the embodiments of the present invention can be a baseboard management controller.

[0144] Of course, in addition to the BMC, the chip can also be of various other types, and the embodiments of the present invention do not make limitations here.

[0145] As an optional embodiment, the firmware status of any storage area includes a two-bit array;

[0146] The first numerical combination of the two-bit array represents the special firmware status of the firmware in the first storage area, the second numerical combination of the two-bit array represents the special firmware status of the firmware in the second storage area, and the third numerical combination of the two-bit array represents the firmware status with the lowest priority.

[0147] Specifically, considering that the special firmware state and the lowest-priority firmware state of the storage area can be supported by a two-bit array, the chip in the embodiments of the present invention is a baseboard management controller, thereby reducing costs.

[0148] Of course, in addition to this specific form, the firmware state of the storage area can also be represented in other forms, which are not limited in the embodiments of the present invention.

[0149] Specifically, to better illustrate the embodiments of the present invention, please refer to Table 2 below and Figure 4 , Table 2 is a firmware state comparison table provided by the present invention, Figure 4 is a schematic flowchart of another chip firmware management method provided by the present invention.

[0150] Table 2

[0151]

[0152] Specifically, in Table 2 above, the special firmware state of the first storage area is 00, the initial firmware state is 00, the special firmware state of the second storage area is 01, the initial firmware state is 11, and it is stipulated that the lowest-priority firmware state is 11. The priority order of the firmware states is: 00 > 01 > 11. The firmware state 10 belongs to an error state, and the priority of the first storage area is greater than that of the second storage area. When an error state occurs, it can be stipulated not to start, or the target firmware can be selected according to the firmware state priority and the storage area priority for startup. When both firmware states are 11, startup is prohibited, and at any time, it is prohibited to use the firmware with the lowest-priority firmware state as the target firmware. Among them, the first bit of the two-bit array can also represent the firmware update state of the corresponding storage area. When the first bit is 1, it means that the firmware of the corresponding storage area has not been updated. When the first bit is 0, it means that the firmware of the corresponding storage area has been updated. The second bit of the two-bit array can also represent the firmware valid state of the corresponding storage area. When the second bit is 1, it means that the firmware of the corresponding storage area is invalid. When the second bit is 0, it means that the firmware of the corresponding storage area is valid.

[0153] Specifically, refer to Figure 4 , Image 0 represents the firmware of the target system in the first storage area, and Image 1 represents the firmware of the target system in the second storage area. In the initial state, the firmware state of Image 0 is 00, and the firmware state of Image 1 is 11. At this time, Image 0 is used as the target firmware. Figure 4The second line represents "the update process of Image 1". First, since the priority of 01 is lower than that of 00, Image 1 can be updated. After the update, the firmware status of Image 1 can be set to the special firmware status 01 in the second storage area. Then, in the third line, the firmware status of the first storage area can be set to the lowest priority firmware status 11. Assuming a power failure in the firmware status of the second line, when starting up again, since the priority of firmware status 00 is higher than that of firmware status 01, Image 0 can be used as the target firmware. The fourth line represents "the update process of Image 0". First, since the priority of 01 is higher than that of 11, Image 0 can be updated. After the update, the firmware status of Image 0 can be set to the special firmware status 00 in the first storage area. Then, in the sixth line, the firmware status of the second storage area can be set to the lowest priority firmware status 11. Assuming a power failure in the firmware status of the fifth line, when starting up again, since the priority of firmware status 00 is higher than that of firmware status 01, Image 0 can be used as the target firmware.

[0154] Please refer to Figure 5 , Figure 5 FIG. is a schematic structural diagram of a chip firmware management device provided by the present invention. The chip firmware management device includes:

[0155] A memory 51 for storing a computer program;

[0156] A processor 52 for implementing the steps of the chip firmware management method in the foregoing embodiments when executing the computer program.

[0157] For the introduction of the chip firmware management device provided by the embodiments of the present invention, please refer to the embodiments of the foregoing chip firmware management method, and the embodiments of the present invention will not be described in detail herein.

[0158] The present invention also provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the chip firmware management method in the foregoing embodiments are implemented.

[0159] For the introduction of the computer program product provided by the embodiments of the present invention, please refer to the embodiments of the foregoing chip firmware management method, and the embodiments of the present invention will not be described in detail herein.

[0160] Please refer to Figure 6 , Figure 6 FIG. is a schematic structural diagram of a computer-readable storage medium provided by the present invention. A computer program 62 is stored on the computer-readable storage medium 61, and when the computer program 62 is executed by a processor, the steps of the chip firmware management method in the foregoing embodiments are implemented.

[0161] For the introduction of the computer-readable storage medium provided by the embodiments of the present invention, please refer to the embodiments of the foregoing chip firmware management method, which will not be elaborated herein.

[0162] The embodiments in this specification are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. It should also be noted that in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the element.

[0163] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A chip firmware management method, characterized in that: Processors used in chips include: At startup, the firmware with the highest priority in the firmware state in the first storage area and the second storage area of ​​the storage device is used as the target firmware, and the target system is started according to the target firmware, wherein the firmware state is the state of the firmware of the target system stored in the storage area, and the storage area includes the first storage area and the second storage area; In response to the firmware modification instruction, the firmware in the storage area with the lowest priority of the firmware state is replaced with the latest firmware; Replace the firmware state in the storage area where the firmware being updated is located with a special firmware state corresponding to the storage area where the firmware is updated, wherein the priority of the special firmware state is higher than the lowest priority; Replace the firmware state in the storage area where the firmware that has not been updated this time is located with the firmware state with the lowest priority; At startup, taking the firmware with the highest priority of the firmware state in the first storage area and the second storage area of ​​the storage device as the target firmware, and starting the target system according to the target firmware includes: At startup, respectively obtaining firmware states in a first storage area and a second storage area of ​​a storage device; Determining whether the firmware states in the first storage area and the second storage area are the same; If they are different, the firmware with the highest priority in the firmware state in the first storage area and the second storage area is used as the target firmware, and the target system is started according to the target firmware; If they are the same, the firmware in the storage area with the highest priority in the storage area is used as the target firmware, and the target system is started according to the target firmware; Before determining whether the firmware states in the first storage area and the second storage area are the same, the chip firmware management method further includes: Determining whether a current combination of firmware states in the first storage area and the second storage area belongs to a preset correct combination set; If yes, determining whether the firmware states in the first storage area and the second storage area are the same; If it does not belong to the firmware, the control prompter will prompt that the firmware status is wrong; After determining whether the current combination of the firmware states in the first storage area and the second storage area belongs to a preset correct combination set, the chip firmware management method further includes: If not, determining whether the firmware states in the two storage areas both belong to the special firmware states corresponding to the storage areas; If they all belong to the special firmware state corresponding to the storage area, the firmware in the storage area with the highest priority of the storage area is used as the target firmware, and the target system is started according to the target firmware; If they are not all in the special firmware state corresponding to the storage area, the firmware belonging to the special firmware state corresponding to the storage area is used as the target firmware, and the target system is started according to the target firmware.

2. The chip firmware management method according to claim 1, characterized in that: The special firmware state corresponding to the first storage area is different from the special firmware state corresponding to the second storage area.

3. The chip firmware management method according to claim 1, characterized in that: Booting the target system according to the target firmware includes: Loading the boot program from the memory segment of the boot program stored in the target memory area; Executing the boot program to load the target firmware from the target storage segment stored in the target storage area, wherein the target storage area is the storage area where the target firmware is located, and the target storage segment is the storage segment of the target firmware; The target firmware is executed to boot the target system.

4. The chip firmware management method according to claim 3, characterized in that: The target firmware includes a secondary program loader sub-firmware, a universal boot loader and a kernel system firmware; Executing the boot program to load the target firmware from the target storage segment stored in the target storage area includes: Executing the boot program to load the secondary program loader sub-firmware in the target firmware from the first storage sub-segment stored in the target storage area; Executing the target firmware includes: executing the secondary program loader sub-firmware to load the universal boot loader in the target firmware from the second storage sub-segment stored in the target storage area; Executing the universal boot loader to load the kernel system firmware in the target firmware from the third storage subsection stored in the target storage area; The kernel system firmware is executed to boot the target system.

5. The chip firmware management method according to claim 1, characterized in that: At startup, taking the firmware with the highest priority of the firmware state in the first storage area and the second storage area of ​​the storage device as the target firmware, and starting the target system according to the target firmware includes: At startup, obtain the storage device combination currently connected to the chip; According to a preset storage area selection rule, a first storage area and a second storage area are selected from each storage device in the storage device combination currently connected to the chip; The firmware with the highest priority in the firmware state in the first storage area and the second storage area of ​​the storage device is used as the target firmware, and the target system is started according to the target firmware.

6. The chip firmware management method according to claim 5, characterized in that: At startup, the combination of storage devices currently connected to the chip is obtained, including: At startup, the combination of storage devices currently connected to the chip is determined according to the switch value of the multi-bit DIP switch; The switch value of any bit of the DIP switch indicates the in-place status of a corresponding storage device.

7. The chip firmware management method according to claim 6, characterized in that: The storage area selection rules include: The priority of the dual storage device single image selection method is higher than the single storage device dual image selection method; Among them, dual storage device single mirroring refers to selecting one storage area from each of the two storage devices, and single storage device dual mirroring refers to selecting two storage areas from a single storage device.

8. The chip firmware management method according to claim 1, characterized in that: At startup, after respectively acquiring the firmware states in the first storage area and the second storage area of ​​the storage device, the chip firmware management method further includes: The control prompter prompts the firmware status in the first storage area and the second storage area.

9. The chip firmware management method according to any one of claims 1 to 8, characterized in that: The firmware state of any storage area includes a two-bit array; The first numerical combination of the two-bit array represents a special firmware state of the firmware in the first storage area, the second numerical combination of the two-bit array represents a special firmware state of the firmware in the second storage area, and the third numerical combination of the two-bit array represents the lowest priority firmware state.

10. A chip firmware management device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the chip firmware management method as claimed in any one of claims 1 to 9 when executing the computer program.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the chip firmware management method as described in any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the chip firmware management method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Starting method of embedded LINUX operating system based on multiple backup bootstrap programs

    CN110737481A

  • System starting method, electronic equipment, and machine readable storage medium

    CN111316235A

  • Start loading management method, device and equipment of embedded system and storage medium

    CN116541081A