CN115408204A - Chip dual-firmware backup starting method and device, electronic equipment and storage medium - Google Patents
Chip dual-firmware backup starting method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115408204A CN115408204A CN202211069001.2A CN202211069001A CN115408204A CN 115408204 A CN115408204 A CN 115408204A CN 202211069001 A CN202211069001 A CN 202211069001A CN 115408204 A CN115408204 A CN 115408204A
- Authority
- CN
- China
- Prior art keywords
- firmware
- chip
- starting
- value
- field
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000009977 dual effect Effects 0.000 claims description 28
- 230000003068 static effect Effects 0.000 claims description 15
- 238000012827 research and development Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1417—Boot up procedures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1433—Saving, restoring, recovering or retrying at system level during software upgrading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1441—Resetting or repowering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application belongs to the technical field of integrated circuits and discloses a method and a device for starting a chip dual-firmware backup, electronic equipment and a storage medium. The method for starting the chip dual-firmware backup provided by the embodiment of the application comprises the following steps: step S1: running a starting program; step S2: reading the value of an indication register according to the starting program, determining a starting mode which should be selected by the chip according to the value of the indication register, and updating the value of the indication register according to the starting mode of the chip, wherein the starting mode comprises main firmware starting and auxiliary firmware starting; and step S3: and reading the updated value of the indication register, and determining the starting mode of the chip according to the updated value of the indication register. According to the method for starting the chip dual-firmware backup, the backup switching starting of the main firmware and the slave firmware can be realized only by one FLASH chip, so that the resources occupied by setting the main firmware and the slave firmware are greatly saved, and the cost and the research and development period of a product are reduced.
Description
Technical Field
The application belongs to the technical field of integrated circuits, and relates to a method and a device for starting a chip dual-firmware backup, electronic equipment and a storage medium.
Background
Common cores such as computer equipment and embedded equipment are equipment with various chips, the operation of the equipment and the reading and writing of data are controlled by the chips, and firmware (firmware) is an instruction set for directly controlling the execution behavior of the chips, so that the correctness and reliability of firmware versions are related to whether the equipment can be normally started and normally work, master and slave firmware are usually set to ensure the normal start and normal work of the equipment, and if the master firmware fails to be started, the slave firmware is switched to be started, so that the redundant backup of 1.
However, if the conventional device using dual firmware backup, such as an embedded device, wants to implement master-slave firmware backup switching, an additional FPGA or CPLD is required to be provided as an auxiliary device, and two FLASH memory chips are additionally provided to store the master firmware and the slave firmware, so that the dual firmware backup starting device can be implemented.
Disclosure of Invention
The application aims to provide a method and a device for starting a chip dual-firmware backup, an electronic device and a storage medium, so as to solve the technical problems that the traditional dual-firmware backup starting device is high in cost and occupies a lot of resources.
In order to solve the technical problem, the technical scheme of the application is as follows:
the embodiment of the application provides a method for starting a chip dual-firmware backup, which comprises the following steps:
step S1: running a starting program;
step S2: reading a value of an indication register according to the starting program, determining a starting mode which should be selected by the chip according to the value of the indication register, and updating the value of the indication register according to the starting mode which is selected by the chip, wherein the starting mode comprises main firmware starting and auxiliary firmware starting;
and step S3: and reading the updated value of the indication register, and determining the starting mode of the chip according to the updated value of the indication register.
Further, the value of the indication register includes:
when the first field is a second value, the starting mode of the chip is started by the slave firmware;
the second field is used for representing the starting state of the chip, when the second field is a third value, the chip is successfully started or successfully reset, when the second field is a fourth value, whether the chip is started is checked to be valid, and when the second field is a fifth value, the chip is started.
Further, the step S2 includes:
when the first field of the indication register is a first value and the second field of the indication register is a third value, the chip selects the main firmware to start; otherwise, the chip selects starting from the firmware.
Further, the step S3 includes:
when the updated first field of the indication register is a first value, the chip is started by using main firmware; when the updated first field is the second value, the chip starts using the slave firmware.
Further, in step S3, when the boot mode is a main firmware boot, the method includes:
step S31: updating a second field of the indication register to be a fourth value, checking whether the version of the main firmware is valid, if the version of the main firmware is valid, turning to the step S32, and if the version of the main firmware is invalid, resetting the chip and turning to the step S1;
step S32: updating a second field of the indication register to a fifth value and causing the main firmware to run in a static random access memory;
step S33: and judging whether the chip is successfully started according to the main firmware operated in the static random access memory, if the chip is successfully started, updating a second field of the indication register to be a third value, if the chip is failed to be started, resetting the chip, and turning to the step S1.
Further, in step S3, when the boot mode is boot from firmware, the method includes:
step S34: updating a second field of the indication register to be a fourth value, checking whether the version of the slave firmware is valid, if the version of the slave firmware is valid, going to the step S32, and if the version of the slave firmware is invalid, resetting the chip and going to the step S1;
step S35: updating a second field of the indication register to a fifth value and causing the slave firmware to run in a static random access memory;
step S36: and judging whether the chip is successfully started according to the slave firmware operated in the static random access memory, if the chip is successfully started, updating a second field of the indication register to be a third value, if the chip is failed to be started, resetting the chip, and turning to the step S1.
Based on any one of the above methods for backup startup of dual firmware on a chip, an embodiment of the present application further provides a device for backup startup of dual firmware on a chip, where the device includes:
a firmware storage module for storing a master firmware and a slave firmware, both for starting the apparatus;
the indication module comprises an indication register and is used for representing the starting mode and the starting state of the device;
a control module comprising a non-volatile memory for controlling a start-up mode of the apparatus according to a start-up program;
the starting module comprises a static random access memory and is used for acquiring the main firmware and running the main firmware program according to the starting program or acquiring the slave firmware and running the slave firmware program;
the firmware storage module is arranged on a first chip, and the indication module, the control module and the starting module are arranged on a second chip.
Further, the apparatus further comprises:
the execution module comprises a kernel and is used for implementing program instructions sent by the control module, the starting module and the indicating module; the execution module is arranged on the second chip.
Based on the above method for starting up the dual firmware backup of any chip, an embodiment of the present application further provides an electronic device, including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the steps of any of the above-described methods of dual-chip firmware backup booting via execution of the executable instructions.
Based on any one of the above methods for starting a chip dual firmware backup, an embodiment of the present application further provides a computer readable storage medium, configured to store computer instructions, and when the computer instructions are executed, the computer readable storage medium implements any one of the above steps of the method for starting a chip dual firmware backup.
Compared with the prior art, the beneficial effects of the application lie in that:
according to the method and the device for starting the chip dual-firmware backup, the master-slave firmware backup switching starting equipment can be used only by additionally providing a FLASH chip, so that resources occupied by setting the master-slave firmware backup switching starting equipment are greatly saved, and the cost and the research and development period of a product are reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a dual firmware backup boot method according to an embodiment of the present disclosure.
Fig. 2 is a schematic structural diagram of a dual firmware backup boot apparatus according to an embodiment of the present disclosure.
Fig. 3 is a block diagram of a dual firmware backup boot apparatus according to an embodiment of the present disclosure.
Fig. 4 is a block diagram of an apparatus that may be disposed in an integrated circuit system according to an embodiment of the present disclosure.
Detailed Description
The technical solution in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be understood that the described embodiments are only a few embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/", and generally means that the former and latter related objects are in an "or" relationship.
An embodiment of the present application provides a method for starting a dual firmware backup of a chip, and fig. 1 is a flowchart of the method for starting a dual firmware backup provided in the embodiment of the present application, and as shown in fig. 1, the method includes:
step S1: powering on the chip and running a starting program; the boot-up program is stored in a non-volatile memory (boot-only memory) of the chip, the boot-up program is solidified during chip streaming and cannot be modified, and the logic processing code of the method provided by the application is solidified in the non-volatile memory (boot-only memory).
Step S2: reading the value of an indication register according to a starting program, arbitrating a starting mode to be selected by the chip according to the value of the indication register, and updating the value of the indication register, wherein the starting mode comprises main firmware starting and auxiliary firmware starting; the indication register is used for indicating the starting mode and the starting state of the chip, the value of a first field of the indication register is set to indicate the starting mode of the chip, the value of a second field of the indication register is set to indicate the starting state of the chip, after the starting program runs, the value of the indication register is read to carry out master-slave arbitration, the purpose of the master-slave arbitration is to arbitrate whether the chip is started to use master firmware or slave firmware, after the starting mode is arbitrated, the arbitration result is written into the first field of the indication register, the master firmware and the slave firmware are both stored in a FLASH chip, the FLASH chip is different from the chip described in the application and is only used for storing the master firmware and the slave firmware, the starting state of the chip comprises a reset state, a check state, a running state and an invalid state, wherein the reset state indicates that the chip has been reset or the chip has been started successfully, the check state indicates that the validity of the firmware (the master firmware or the slave firmware) is being checked, the running state indicates that the chip is being started by using the firmware, and the invalid state indicates that the function is undefined, and the invalid state can be defined by a user to enable the invalid state to indicate the function.
And step S3: reading the updated first field, determining a starting mode according to the updated first field, updating the first field by the starting program after arbitrating the firmware used by the chip starting, if arbitrating the chip starting to use the main firmware starting, updating the first field to make the starting mode represented by the first field be the main firmware starting, if arbitrating the chip starting to use the slave firmware starting, updating the first field to make the starting mode represented by the first field be the slave firmware starting, and after updating the first field of the indication register, reading the first field again by the starting program to further determine the starting mode of the chip.
In some embodiments, the setting of the indication register of the embodiments of the present application is as follows:
wherein, a Bit represents a value of the indication register, and is divided into a first field and a second field, the first field represents Boot _ src, when Bit [0] =0, the value representing the first field Boot _ src is a first value 0, at this time, the main firmware Boot chip is used, when Bit [0] =1, the value representing the first field Boot _ src is a second value 1, at this time, the slave firmware Boot chip is used, and Default value is 0 represents that the Default value of the first field Boot _ src is a first value 0; the second field is denoted boot _ status, bit [2:1] =00, which means that the value of the second field boot _ status is the third value 00, when the chip has been reset or the chip has been successfully started, bit [2:1] =01, it indicates that the value of the second field boot _ status is the fourth value 01, and when the validity of the firmware is checked, bit [2:1] =10, it indicates that the value of the second field boot _ status is the fifth value 10, and at this time, the firmware is being used to start up the chip, bit [2:1] =11 is a reserved value, and a Bit [2:1] = 11.
It should be clear that the setting of the indication register is not unique, and the user can set different bits as the indicated function completely according to the requirement, for example, the user can set Bit [0] to indicate using the slave firmware to start the chip, or Bit [1] to indicate using the master firmware to start the chip, or the default value of the first field can also be set to 1, and even the user can set Bit [00] to indicate using the master firmware to start the chip, and in summary, the function indicated by each Bit of the indication register can be set by self-definition completely as long as the setting result corresponds to the start program, and in addition, the Bit of the indication register does not include only three bits, and the embodiment of the application only uses three bits of the register because three bits are enough to indicate.
In some embodiments, using the indication register as described above, the master-slave arbitration logic executed by the start-up procedure in step S2 is: if (boot _ src = = master & & boot _ status = 00), indicating that the chip is booted using the main firmware only if the value satisfying the first field boot _ src is 0 and the value of the second field boot _ status is 00; otherwise, the chip is started by using the slave firmware, if the value of the first field boot _ src is 0, but the value of the second field boot _ status is 01, 10 or 11, the chip is started by using the slave firmware, and if the value of the second field boot _ status is not 00, the chip indicates that the starting action has already occurred and the starting fails, so that if the arbitration result shows that the value of the second field boot _ status is not 00, the chip switches the starting of the master firmware to the starting of the slave firmware; after arbitrating the new boot mode, the boot program will update the value of the first field boot _ src, if the value of the first field boot _ src before updating is 0, but the arbitration result is the boot from the firmware, at this time, the boot program will update the value of the first field boot _ src to be 1, which indicates that this chip boot uses the boot from the firmware.
In some embodiments, using the indication register as described in the above table, the step S3 of the start-up program determines the start-up firmware used by the chip according to if (boot _ src = = master), and if the chip is started using the main firmware, the method includes:
step S31: the value of the second field boot _ status of the update indication register is 01, which indicates whether the version of the main firmware is valid, if the version of the main firmware is valid, the process goes to step S32, and if the version of the main firmware is invalid, the chip is reset, and the process goes to step S1 to re-run the boot program.
Step S32: the second field boot status of the update indication register is 10, indicating that the chip is being booted using the main firmware at this time, specifically, the main firmware is copied to the sram to be run.
Step S33: judging whether the chip is started successfully according to the main firmware operated in the static random access memory, if the chip is started successfully, updating a second field boot _ status of an indication register to 00, if the chip is started unsuccessfully, resetting the chip, and turning to the step S1 to operate the starting program again, wherein the main firmware can judge whether the chip is started successfully according to the state, if the main firmware operates to a certain stage and the serial port output is normal, the chip is judged to be started successfully, and if the main firmware cannot operate to an expected stage within a certain time, the chip is judged to be started unsuccessfully.
In some embodiments, using the indication register as described in the above table, the step S3 of the start-up program determines the firmware used for the chip start-up according to if (boot _ src = = master), and if the chip start-up using slave firmware is performed this time, the method includes:
step S34: the value of the second field boot _ status of the update indication register is 01, which indicates that whether the version of the slave firmware is valid at this time is being checked, if the version of the slave firmware is valid, the process goes to step S32, and if the version of the slave firmware is invalid, the chip is reset, and the process goes to step S1 to restart the boot program.
Step S35: the second field boot status of the update indication register is 10, indicating that the slave firmware is being used to boot the chip at this time, and specifically, will be copied to the sram to be run.
Step S36: judging whether the chip is started successfully according to the slave firmware running in the static random access memory, if the chip is started successfully, updating a second field boot _ status of an indication register to 00, if the chip is started unsuccessfully, resetting the chip, and turning to the step S1 to operate the starting program again.
In some embodiments, when the chip is started successfully, a start information prompt may be further set to facilitate a user to know information, where if the chip is started using the master firmware this time, a prompt indicating that the system is started successfully using the master firmware or other self-defined prompt information is displayed, and if the chip is started using the slave firmware this time, a prompt indicating that the system is started successfully using the slave firmware or other self-defined prompt information is displayed.
The method for starting a chip dual firmware backup provided in the embodiment of the present application may be applied to an integrated circuit system, to control the start of the integrated circuit system, or to control the start of a certain functional module of the integrated circuit system, for example, the method is applied to the start of an embedded system, or to a microcontroller system, or to the start of a programmable logic device system.
According to the method for starting the chip dual-firmware backup, the main firmware and the slave firmware are stored in one chip, the chip is switched to start the main firmware and the slave firmware when being started through the setting of the curing program and the indication register which are set in a nonvolatile memory (boot read-only memory), when the main firmware fails to be started, the chip is switched to start the slave firmware, and when the slave firmware fails to be started, the chip is switched to start the main firmware.
Based on the above method for starting up the dual firmware backup of the chip, the embodiment of the present application further provides a device for starting up the dual firmware backup of the chip.
The device for starting the chip dual-firmware backup provided by the embodiment of the application, as shown in fig. 2, includes:
a firmware storage module 110, configured to store a master firmware and a slave firmware, where both the master firmware and the slave firmware can be used to start the apparatus, and the firmware storage module is disposed in the first chip 100, and the first chip 100 is typically a FLASH memory chip.
An indication module 210, which includes an indication register, for indicating the start mode and start state of the device.
In some embodiments, the settings of the indication register are as follows:
wherein, a Bit represents a value of the indication register, and is divided into a first field and a second field, the first field represents Boot _ src, when Bit [0] =0, the value representing the first field Boot _ src is a first value 0, at this time, the main firmware Boot chip is used, when Bit [0] =1, the value representing the first field Boot _ src is a second value 1, at this time, the slave firmware Boot chip is used, and Default value is 0 represents that the Default value of the first field Boot _ src is a first value 0; the second field is denoted boot _ status, bit [2:1] =00, which means that the value of the second field boot _ status is the third value 00, when the chip has been reset or the chip has been successfully started, bit [2:1] =01, it means that the value of the second field boot _ status is the fourth value 01, and when the validity of the firmware is checked, bit [2:1] =10, it indicates that the value of the second field boot _ status is the fifth value 10, and at this time, the firmware is being used to start up the chip, bit [2:1] =11 is a reserved value, and a Bit [2:1] = 11.
A control module 220, including a non-volatile memory (boot-only memory), for controlling a start-up mode of the apparatus according to a start-up program; the non-volatile memory (boot read-only memory) stores a startup program, the startup program is solidified during chip streaming and cannot be modified, and the logic processing code of the device provided by the application is solidified in the non-volatile memory (boot read-only memory).
In some embodiments, when the value of the first field boot _ src of the indication register is 0 and the value of the second field of the indication register is 00, the control module controls the device to boot using the master firmware, otherwise, the device boots using the slave firmware, after the control module determines the boot mode of the device, the control module writes a corresponding value into the first field of the indication register, and after the control module determines the boot mode of the device, the control module also verifies the validity of the firmware, and at this time, the second field value of the indication register is updated to 01.
A start module 230, including a Static Random Access Memory (SRAM), configured to obtain the main firmware according to the start program and run the main firmware program, or obtain the slave firmware and run the slave firmware program, at this time, the second field value of the indication register should be updated to 10, and after the start module is successfully started, the second field value of the indication register is updated to 00; in the control module, if the starting program controls the device to start by using the main firmware, the starting module acquires the main firmware and runs the main firmware program according to the starting program, and if the starting program controls the device to start by using the slave firmware, the starting module acquires the slave firmware and runs the slave firmware program according to the starting program.
The indication module, the control module and the start module are all disposed in the second chip 200.
In some embodiments, the above apparatus further comprises:
an execution module 240, which includes a Core (Core) and is used for implementing program instructions sent by the control module, the starting module and the indicating module; the execution module is arranged in the second chip 200; that is, the second chip 200 includes a register, a non-volatile memory (boot-only memory), a Static Random Access Memory (SRAM), and a Core (Core), where the register, the non-volatile memory (boot-only memory), the Static Random Access Memory (SRAM), and the Core (Core) all transmit data through an internal bus of the second chip, and it should be clear that, for the chip, programs or instructions of the respective modules are read, analyzed, and executed by the Core (Core).
As shown in fig. 4, the apparatus provided in the embodiment of the present application may be disposed in an integrated circuit system 300 for starting the integrated circuit system 300, and the apparatus provided in the embodiment of the present application may be disposed in a computer system, or an embedded system, or a microcontroller system, or an integrated circuit system such as a programmable logic device system, and the second chip 200 reads a master firmware or a slave firmware in the first chip 100 to start the integrated circuit system 300, and the second chip 200 may be configured as a CPU (Central Processing Unit) of the integrated circuit system 300 to control the operation of the entire integrated circuit system 300, or the second chip 200 may be configured as another functional chip of the integrated circuit system 300 to control the operation of a certain functional module, and the first chip 100 is coupled to a bus in the second chip 200 and integrated in the integrated circuit system 300, and is a memory chip 100 for storing the master firmware and the slave firmware, and the first chip generally uses a memory chip FLASH.
As shown in fig. 3, in the chip dual-firmware backup starting apparatus provided in the embodiment of the present application, a reserved area of the first chip 100 is a user-defined area, a user can configure the area by himself, and the chip dual-firmware backup starting apparatus implements switching starting of the master and slave firmware through a curing program and setting of an indication register set in a non-volatile memory (boot-only memory), when the master firmware fails to start, the chip dual-firmware backup starting apparatus switches to the slave firmware starting, and when the slave firmware fails to start, the chip dual-firmware backup starting apparatus switches to the master firmware starting.
Based on the above method for starting up the chip dual firmware backup, an embodiment of the present application further provides an electronic device, including:
a processor; and a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the steps of the method for dual firmware backup boot provided in the above embodiments by executing the executable instructions.
The processor may also be referred to as a Central Processing Unit (CPU), and the processor may be an integrated circuit chip having signal processing capability; the processor may also be a general purpose processor, a DSP (Digital Signal processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable gate Array) or other Programmable logic device, discrete gate or transistor logic, discrete hardware components, wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
Based on the above method for starting up a chip dual firmware backup, an embodiment of the present application further provides a computer readable storage medium, configured to store a computer instruction, where the computer instruction is executed to implement the steps of the method for starting up a chip dual firmware backup provided in the above embodiment.
The computer program may be stored in the storage medium in the form of a software product, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a hard disk drive, a magnetic or optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), etc., or terminal devices, such as a computer, a server, a mobile phone, a tablet, etc.
The foregoing is a more detailed description of the present application in connection with specific embodiments thereof, and it is not intended to limit the present application to the details thereof. For those skilled in the art to which the present application pertains, several simple deductions or substitutions can be made without departing from the concept of the present application, and all should be considered as the protection scope of the present application.
Claims (10)
1. A method for starting up a chip dual-firmware backup is characterized by comprising the following steps:
step S1: running a starting program;
step S2: reading the value of an indication register according to the starting program, deciding a starting mode which should be selected by the chip according to the value of the indication register, and updating the value of the indication register according to the starting mode which is selected by the chip, wherein the starting mode comprises main firmware starting and auxiliary firmware starting;
and step S3: and reading the updated value of the indication register, and determining the starting mode of the chip according to the updated value of the indication register.
2. The method for chip dual firmware backup boot according to claim 1, wherein the value of the indication register comprises:
when the first field is a second value, the starting mode of the chip is started by the slave firmware;
the second field is used for representing the starting state of the chip, when the second field is a third value, the chip is successfully started or successfully reset, when the second field is a fourth value, whether the chip is started is checked to be valid, and when the second field is a fifth value, the chip is started.
3. The method for chip dual firmware backup boot according to claim 2, wherein the step S2 comprises:
when the first field of the indication register is a first value and the second field of the indication register is a third value, the chip selects the main firmware to start; otherwise, the chip selects starting from the firmware.
4. The method for chip dual firmware backup boot according to claim 2, wherein the step S3 comprises:
when the updated first field of the indication register is a first value, the chip is started by using main firmware; when the updated first field is the second value, the chip starts using the slave firmware.
5. The method for chip dual firmware backup boot according to claim 2, wherein in step S3, when the boot mode is a main firmware boot, the method includes:
step S31: updating a second field of the indication register to be a fourth value, checking whether the version of the main firmware is valid, if the version of the main firmware is valid, turning to the step S32, and if the version of the main firmware is invalid, resetting the chip and turning to the step S1;
step S32: updating a second field of the indication register to a fifth value and causing the main firmware to run in a static random access memory;
step S33: and judging whether the chip is successfully started according to the main firmware operated in the static random access memory, if the chip is successfully started, updating a second field of the indication register to be a third value, if the chip is failed to be started, resetting the chip, and turning to the step S1.
6. The method for dual firmware backup booting of chip of claim 2, wherein in the step S3, when the booting mode is from firmware booting, the method includes:
step S34: updating a second field of the indication register to be a fourth value, checking whether the version of the slave firmware is valid, if the version of the slave firmware is valid, going to the step S32, and if the version of the slave firmware is invalid, resetting the chip and going to the step S1;
step S35: updating a second field of the indication register to a fifth value and causing the slave firmware to run in a static random access memory;
step S36: and judging whether the chip is successfully started according to the slave firmware operated in the static random access memory, if the chip is successfully started, updating a second field of the indication register to be a third value, if the chip is failed to be started, resetting the chip, and turning to the step S1.
7. An apparatus for dual firmware backup booting, the apparatus comprising:
a firmware storage module for storing a master firmware and a slave firmware, both for starting the apparatus;
the indication module comprises an indication register and is used for representing the starting mode and the starting state of the device;
a control module comprising a non-volatile memory for controlling a start-up mode of the apparatus according to a start-up program;
the starting module comprises a static random access memory and is used for acquiring the main firmware and running the main firmware program according to the starting program or acquiring the slave firmware and running the slave firmware program;
the firmware storage module is arranged on a first chip, and the indication module, the control module and the starting module are arranged on a second chip.
8. The apparatus for chip dual firmware backup boot as claimed in claim 7, wherein said apparatus further comprises:
the execution module comprises a kernel and is used for implementing program instructions sent by the control module, the starting module and the indicating module; the execution module is arranged on the second chip.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the steps of the method for chip dual firmware backup boot of any one of claims 1 to 6 via execution of the executable instructions.
10. A computer-readable storage medium storing computer instructions which, when executed, implement the steps of the method for chip dual firmware backup boot according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211069001.2A CN115408204A (en) | 2022-09-02 | 2022-09-02 | Chip dual-firmware backup starting method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211069001.2A CN115408204A (en) | 2022-09-02 | 2022-09-02 | Chip dual-firmware backup starting method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115408204A true CN115408204A (en) | 2022-11-29 |
Family
ID=84163351
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211069001.2A Pending CN115408204A (en) | 2022-09-02 | 2022-09-02 | Chip dual-firmware backup starting method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115408204A (en) |
-
2022
- 2022-09-02 CN CN202211069001.2A patent/CN115408204A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI382346B (en) | Computer system with dual bios protection mechanism and control method of the same | |
CN101329632B (en) | Method and apparatus for starting CPU by BOOT | |
CN108304282B (en) | A dual BIOS control method and related device | |
CN111506454A (en) | Method and system for recovery and update of a basic input/output system | |
CN101499909B (en) | Single board starting system and method | |
US7194614B2 (en) | Boot swap method for multiple processor computer systems | |
WO2016206514A1 (en) | Startup processing method and device | |
CN113641537A (en) | A server startup system, method and medium | |
TW201716999A (en) | Method for startup inspection and computer system using the same | |
US9348603B2 (en) | Electronic apparatus and booting method | |
CN113867807A (en) | Method, device, equipment and storage medium for shortening power-on time of server | |
CN115951949A (en) | Recovery method and device for configuration parameters of BIOS (basic input output System) and computing equipment | |
CN101739315A (en) | System and method for automatically starting backup firmware | |
CN115408204A (en) | Chip dual-firmware backup starting method and device, electronic equipment and storage medium | |
CN113867812B (en) | Method, system, equipment and medium for BMC to acquire link information | |
WO2022199622A1 (en) | Method for running startup program of electronic device, and electronic device | |
CN117112059A (en) | Microcontroller starting method, device, equipment and storage medium | |
TW591377B (en) | Dual basic input/output system for a computer cross-reference to related applications | |
CN100394392C (en) | Automatic starting control method and system for computer program recovery mode | |
CN113721992A (en) | BIOS starting method and related device of server | |
CN112667544A (en) | Method, device, system and medium for controlling mainboard slot enabling | |
CN113687851A (en) | Embedded device upgrade method and device | |
CN118349290B (en) | Dual-memory chip start-up upgrade system, method, device, medium and product | |
CN113867753B (en) | A server firmware update method and system | |
CN101359292A (en) | Computer system and control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |