Chip dual firmware backup starting method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211069001.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-09-02
AI Technical Summary
[0004]本申请的目的在于提供一种芯片双固件备份启动的方法、装置、电子设备及存储介质,以解决传统的双固件备份启动的设备成本高且占用资源多的技术问题
[0039]本申请实施例提供的芯片双固件备份启动的方法和装置,只需要额外提供一个FLASH芯片就能实现使用主从固件备份切换启动设备,大幅度节省了设置主从固件所占用的资源,降低了产品的成本和研发周期。
Smart Images

Figure CN115408204B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of integrated circuit technology and relates to a method, apparatus, electronic device and storage medium for chip dual firmware backup boot. Background Technology
[0002] Common devices such as computer equipment and embedded devices use various chips as their core components. These chips control the operation of the device and the reading and writing of data. Firmware is a set of instructions that directly controls the behavior of the chip. Therefore, the correctness and reliability of the firmware version are related to whether the device can start up and work normally. Usually, master and slave firmware are set up to ensure the normal startup and normal operation of the device. If the master firmware fails to start, it will switch to the slave firmware to start, thus achieving a 1:1 redundancy backup.
[0003] However, traditional devices that use dual firmware backup, such as embedded devices, require an additional FPGA or CPLD as an auxiliary device and two additional FLASH storage chips to store the master and slave firmware in order to achieve master-slave firmware backup switching. In addition, the additional FPGA or CPLD requires separate logic code development, which increases costs and development time and consumes more resources. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, electronic device and storage medium for chip dual firmware backup boot, so as to solve the technical problems of high cost and high resource consumption of traditional dual firmware backup boot devices.
[0005] To solve the above-mentioned technical problems, the technical solution of this application is as follows:
[0006] This application provides a method for dual firmware backup booting of a chip, the method comprising:
[0007] Step S1: Run the startup program;
[0008] Step S2: Read the value of the indicator register according to the boot program, determine the boot mode that the chip should select according to the value of the indicator register, and update the value of the indicator register according to the boot mode selected by the chip. The boot mode includes master firmware boot and slave firmware boot.
[0009] Step S3: Read the updated value of the indicator register and determine the startup mode of the chip based on the updated value of the indicator register.
[0010] Furthermore, the value of the indicator register includes:
[0011] The first field, when the first field is a first value, indicates that the chip's boot mode is main firmware boot; when the first field is a second value, it indicates that the chip's boot mode is slave firmware boot.
[0012] The second field is used to indicate the startup status of the chip. When the second field is the third value, it indicates that the chip has started successfully or reset successfully. When the second field is the fourth value, it indicates that the startup of the chip is being verified. When the second field is the fifth value, it indicates that the chip is starting up.
[0013] Further, step S2 includes:
[0014] When the first field of the indicator register is a first value and the second field of the indicator register is a third value, the chip selects to boot from the main firmware; otherwise, the chip selects to boot from the secondary firmware.
[0015] Further, step S3 includes:
[0016] When the first field of the updated indicator register is a first value, the chip boots using the master firmware; when the first field is a second value, the chip boots using the slave firmware.
[0017] Further, in step S3, when the boot mode is the main firmware boot, it includes:
[0018] Step S31: Update the second field of the indicator register to the fourth value, and verify whether the version of the main firmware is valid. If the version of the main firmware is valid, proceed to step S32. If the version of the main firmware is invalid, reset the chip and proceed to step S1.
[0019] Step S32: Update the second field of the indicator register to the fifth value, and enable the main firmware to run in static random access memory;
[0020] Step S33: Determine whether the chip boots successfully based on the main firmware running in the static random access memory. If the chip boots successfully, update the second field of the indicator register to the third value. If the chip boots unsuccessfully, reset the chip and proceed to step S1.
[0021] Further, in step S3, when the boot mode is booting from firmware, the following steps are included:
[0022] Step S34: Update the second field of the indicator register to the fourth value, and verify whether the firmware version is valid. If the firmware version is valid, proceed to step S32. If the firmware version is invalid, reset the chip and proceed to step S1.
[0023] Step S35: Update the second field of the indicator register to the fifth value, and enable the firmware to run in static random access memory;
[0024] Step S36: Determine whether the chip boots successfully based on the firmware running in the static random access memory. If the chip boots successfully, update the second field of the indicator register to the third value. If the chip boots unsuccessfully, reset the chip and proceed to step S1.
[0025] Based on any of the above-mentioned chip dual firmware backup boot methods, this application embodiment also provides a chip dual firmware backup boot apparatus, the apparatus comprising:
[0026] A firmware storage module is provided for storing master firmware and slave firmware, both of which are used to start the device.
[0027] An indicator module, comprising an indicator register, for indicating the startup mode and startup status of the device;
[0028] A control module, including a non-volatile memory, is used to control the startup mode of the device according to a startup program;
[0029] A boot module, comprising a static random access memory, is used to obtain the main firmware and run the main firmware program according to the boot program, or to obtain the slave firmware and run the slave firmware program.
[0030] The firmware storage module is located on the first chip, and the indicator module, control module, and startup module are located on the second chip.
[0031] Furthermore, the device also includes:
[0032] An execution module, including a kernel, is used to implement program instructions issued by the control module, the startup module, and the instruction module; the execution module is located in the second chip.
[0033] Based on the above-mentioned method for dual firmware backup booting of any of the chips, embodiments of this application also provide an electronic device, including:
[0034] Processor; and
[0035] Memory for storing the executable instructions of the processor;
[0036] The processor is configured to perform the steps of the chip dual firmware backup boot method described above by executing the executable instructions.
[0037] Based on any of the above-described chip dual firmware backup boot methods, this application embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed, implement the steps of the chip dual firmware backup boot method described above.
[0038] Compared to existing technologies, the advantages of this application are as follows:
[0039] The chip dual firmware backup boot method and apparatus provided in this application embodiment only require an additional FLASH chip to realize the use of master-slave firmware backup switching boot device, which greatly saves the resources occupied by setting master-slave firmware, and reduces product cost and development cycle. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart of the dual firmware backup boot method provided in this application embodiment.
[0042] Figure 2 This is a schematic diagram of the dual firmware backup boot device provided in an embodiment of this application.
[0043] Figure 3 This is a structural block diagram of the dual firmware backup boot device provided in the embodiments of this application.
[0044] Figure 4 The apparatus provided in the embodiments of this application can be disposed in the structural block diagram of an integrated circuit system. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the described embodiments are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0046] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0047] This application provides a method for chip dual firmware backup boot. Figure 1 A flowchart of the dual firmware backup boot method provided in the embodiments of this application is shown below. Figure 1 As shown, the method includes:
[0048] Step S1: Power on the chip and run the boot program; the boot program is stored in the chip's non-volatile memory (boot read-only memory). This boot program is fixed during chip fabrication and cannot be modified. The logic processing code of the method provided in this application is fixed in the non-volatile memory (boot read-only memory).
[0049] Step S2: Read the value of the indicator register according to the startup program, and arbitrate the startup mode that the chip should select based on the value of the indicator register. Update the value of the indicator register. The startup modes include master firmware startup and slave firmware startup. The indicator register is used to indicate the startup mode and startup state of the chip. Set the value of the first field of the indicator register to indicate the startup mode of the chip, and set the value of the second field of the indicator register to indicate the startup state of the chip. After the startup program runs, it will read the value of the indicator register and perform master-slave arbitration. The purpose of master-slave arbitration is to arbitrate whether the chip should start using the master firmware or the slave firmware. After arbitrating the startup mode, the arbitration result is written to the first field of the indicator register. The master firmware and slave firmware are both stored in a FLASH chip. This FLASH chip is different from the chip described in this application and is only used to store the master firmware and slave firmware. The startup state of the chip includes reset state, verification state, running state and invalid state. The reset state indicates that the chip has been reset or the chip has started successfully. The verification state indicates that the validity of the firmware (master firmware or slave firmware) is being verified. The running state indicates that the chip is being started using the firmware. The invalid state indicates that it is not defined. At this time, the user can define a function so that the invalid state represents the function.
[0050] Step S3: Read the updated first field and determine the boot mode based on the updated first field. After arbitrarily determining the firmware to be used for this chip boot, the boot program will update the first field. If the arbitration determines that the chip boot will use the master firmware, the first field will be updated to make the boot mode represented by the first field the master firmware boot. If the arbitration determines that the chip boot will use the slave firmware, the first field will be updated to make the boot mode represented by the first field the slave firmware boot. After updating the first field of the indicator register, the boot program will read the first field again to further determine the chip boot mode.
[0051] In some embodiments, the settings of the indicator register in this application are shown in the following table:
[0052]
[0053] The bit indicates the value of the indicator register, which is divided into a first field and a second field. The first field is Boot_src. When Bit[0]=0, it means that the value of the first field boot_src is the first value 0, and the chip is started using the main firmware. When Bit[0]=1, it means that the value of the first field boot_src is the second value 1, and the chip is started using the slave firmware. Default value is 0 means that the default value of the first field boot_src is the first value 0. The second field is boot_status. When Bit[2:1]=00, it means that the value of the second field boot_status is the third value 00, and the chip has been reset or has been successfully started. When Bit[2:1]=01, it means that the value of the second field boot_status is the fourth value 01, and the validity of the firmware is being verified. When Bit[2:1]=10, it means that the value of the second field boot_status is the fifth value 10, and the chip is being started using the firmware. Bit[2:1]=11 is a reserved value, and the function represented by Bit[2:1]=11 can be customized by the user.
[0054] It should be clear that the setting of the indicator register is not unique. Users can set different bits to represent different functions according to their needs. For example, users can set Bit[0] to indicate using the firmware to start the chip, or Bit[1] to indicate using the main firmware to start the chip. The default value of the first field can also be set to 1. Users can even set Bit
[00] to indicate using the main firmware to start the chip. In short, the function represented by each bit of the indicator register can be customized. As long as the setting result corresponds to the startup program, it is fine. In addition, the number of bits in the indicator register is not limited to three. The embodiment of this application only uses three bits of the register because three bits are sufficient to represent the function.
[0055] In some embodiments, using the indicator registers described in the table above, the master-slave arbitration logic executed by the startup program in step S2 is as follows: if(boot_src==master && boot_status=00), it means that the chip will use the master firmware to start only when the value of the first field boot_src is 0 and the value of the second field boot_status is 00; otherwise, the chip will use the slave firmware to start. For example, 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 will also use the slave firmware to start. If the value of the second field boot_status is not 00, it means that a startup action has already occurred and the startup failed. Therefore, if the arbitration result shows that the value of the second field boot_status is not 00, the master firmware startup will be switched to the slave firmware startup. After arbitrarily determining a new startup mode, the startup program will update the value of the first field boot_src. For example, if the value of the first field boot_src was 0 before the update, but the arbitration result is slave firmware startup, the startup program will update the value of the first field boot_src to 1, indicating that the chip will use the slave firmware to start this time.
[0056] In some embodiments, using the indicator registers described in the table above, the boot program in step S3 determines the boot firmware used by the chip based on if (boot_src == master). If the chip uses the master firmware for booting, the process includes:
[0057] Step S31: Update the value of the second field boot_status in the indicator register to 01, indicating that the version of the main firmware is being checked. If the version of the main firmware is valid, proceed to step S32. If the version of the main firmware is invalid, reset the chip and proceed to step S1 to rerun the boot program.
[0058] Step S32: Update the second field boot_status of the indicator register to 10, indicating that the chip is now being started using the main firmware. Specifically, the main firmware is copied to the static random access memory for operation.
[0059] Step S33: Determine whether the chip boot is successful based on the main firmware running in the static random access memory. If the chip boots successfully, update the second field boot_status of the indicator register to 00. If the chip boots fail, reset the chip and return to step S1 to rerun the boot program. The main firmware can determine whether the chip boot is successful based on the status. For example, if the serial port output is normal when the main firmware runs to a certain stage, the chip boot is considered successful. If the main firmware cannot run to the expected stage within a certain time, the chip boot is considered to have failed.
[0060] In some embodiments, using the indicator registers described in the table above, the boot program in step S3 determines the firmware to be used for this chip boot based on if (boot_src == master). If the chip uses firmware to boot, the following steps are included:
[0061] Step S34: Update the value of the second field boot_status in the indicator register to 01, indicating that the firmware version is being checked. If the firmware version is valid, proceed to step S32. If the firmware version is invalid, reset the chip and proceed to step S1 to rerun the boot program.
[0062] Step S35: Update the second field boot_status of the indicator register to 10, indicating that the chip is currently booting from firmware. Specifically, the firmware will be copied to static random access memory for operation.
[0063] Step S36: Determine whether the chip boot is successful based on the firmware running in the static random access memory. If the chip boots successfully, update the second field boot_status of the indicator register to 00. If the chip boots fail, reset the chip and return to step S1 to rerun the boot program. The firmware can determine whether the chip boot is successful based on the status. For example, if the serial port output is normal when the firmware runs to a certain stage, the chip boot is considered successful. If the firmware cannot run to the expected stage within a certain time, the chip boot is considered to have failed.
[0064] In some embodiments, when the chip boots successfully, a boot information prompt can be set to facilitate user access to information. For example, if the chip boots using the main firmware, it will display "System booted successfully using the main firmware" or other custom prompts. If the chip boots using the slave firmware, it will display "System booted successfully using the slave firmware" or other custom prompts.
[0065] The chip dual firmware backup boot method provided in this application embodiment can be applied to an integrated circuit system to control the boot of the integrated circuit system or to control the boot of a certain functional module of the integrated circuit system. For example, the method can be applied to the boot of an embedded system, a microcontroller system, or a programmable logic device system. The chip mentioned in the above embodiment can be the CPU of the integrated circuit system, which controls the operation of the entire integrated circuit system, or it can be a chip that implements a certain function of the integrated circuit system.
[0066] The chip dual-firmware backup boot method provided in this application embodiment stores the master firmware and slave firmware on a single chip. Through the firmware program set in non-volatile memory (boot read-only memory) and the settings of the indicator register, the chip enables master-slave firmware switching during startup. When the master firmware fails to boot, it switches to slave firmware; when the slave firmware fails to boot, it switches to master firmware. Compared to traditional master-slave firmware switching boot chips, which require an additional FPGA or CPLD and two FLASH memory chips to store the master and slave firmware respectively, the chip dual-firmware backup boot device provided in this application embodiment is as follows: Figure 3 As shown, only one additional FLASH chip is needed to achieve master-slave firmware backup switching and boot, which greatly saves the resources occupied by setting up master-slave firmware and reduces product cost and development cycle.
[0067] Based on the above-described method for dual-firmware backup booting of a chip, this application also provides an apparatus for dual-firmware backup booting of a chip. All embodiments of the method for dual-firmware backup booting of a chip provided in this application are applicable to the apparatus for dual-firmware backup booting of a chip and can achieve the same or similar beneficial effects.
[0068] The chip dual firmware backup boot device provided in this application embodiment, such as Figure 2 As shown, it includes:
[0069] Firmware storage module 110 is used to store master firmware and slave firmware, both of which can be used to boot the device. The firmware storage module is located in the first chip 100, which is typically a FLASH storage chip.
[0070] Indicator module 210 includes an indicator register for indicating the device’s startup mode and startup status.
[0071] In some embodiments, the settings of the indicator register are shown in the following table:
[0072]
[0073] The bit indicates the value of the indicator register, which is divided into a first field and a second field. The first field is Boot_src. When Bit[0]=0, it means that the value of the first field boot_src is the first value 0, and the chip is started using the main firmware. When Bit[0]=1, it means that the value of the first field boot_src is the second value 1, and the chip is started using the slave firmware. Default value is 0 means that the default value of the first field boot_src is the first value 0. The second field is boot_status. When Bit[2:1]=00, it means that the value of the second field boot_status is the third value 00, and the chip has been reset or has been successfully started. When Bit[2:1]=01, it means that the value of the second field boot_status is the fourth value 01, and the validity of the firmware is being verified. When Bit[2:1]=10, it means that the value of the second field boot_status is the fifth value 10, and the chip is being started using the firmware. Bit[2:1]=11 is a reserved value, and the function represented by Bit[2:1]=11 can be customized by the user.
[0074] The control module 220 includes a non-volatile memory (boot read-only memory) for controlling the boot mode of the device according to the boot program. The boot program is stored in the non-volatile memory (boot read-only memory), which is fixed during chip fabrication and cannot be modified. The logic processing code of the device provided in this application is fixed in the non-volatile memory (boot read-only memory).
[0075] In some embodiments, when the value of the first field boot_src of the indicator register is 0 and the value of the second field of the indicator register is 00, the control module controls the device to boot using the master firmware; otherwise, the device boots using the slave firmware. After determining the boot mode of the device, the control module should also write the corresponding value into the first field of the indicator register. In addition, after determining the boot mode of the device, the control module will also verify the validity of the firmware. At this time, the value of the second field of the indicator register should also be updated to 01.
[0076] The startup module 230 includes a static random access memory (SRAM) for obtaining and running the master firmware program according to the startup program, or obtaining and running the slave firmware program. In this case, the value of the second field of the indicator register should be updated to 10, and after the startup module starts successfully, the value of the second field of the indicator register should be updated to 00. In the control module, if the startup program controls the device to start using the master firmware, the startup module obtains and runs the master firmware program according to the startup program; if the startup program controls the device to start using the slave firmware, the startup module obtains and runs the slave firmware program according to the startup program.
[0077] The indicator module, control module, and start-up module are all located in the second chip 200.
[0078] In some embodiments, the above-described apparatus further includes:
[0079] The execution module 240 includes a core for implementing program instructions issued by the control module, startup module, and instruction module. The execution module is located in the second chip 200. The second chip 200 includes registers, boot read-only memory, static random access memory (SRAM), and a core. The registers, boot read-only memory, SRAM, and core all transmit data through the internal bus of the second chip. It should be clear that, for the chip, the programs or instructions of each module are read, parsed, and executed by the core.
[0080] like Figure 4As shown, the device provided in this application embodiment can be disposed in an integrated circuit system 300 to start the integrated circuit system 300. For example, the device provided in this application embodiment can be disposed in a computer system, an embedded system, a microcontroller system, or a programmable logic device system, etc., of an integrated circuit system. The second chip 200 reads the master firmware or slave firmware in the first chip 100 and then starts the integrated circuit system 300. The second chip 200 can be set as the 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 can be set as other functional chips of the integrated circuit system 300 to control the operation of a certain functional module. The bus of the first chip 100 and the second chip 200 is coupled and integrated in the integrated circuit system 300. The first chip 100 is a storage chip that stores the master firmware and slave firmware. The first chip usually uses a FLASH storage chip.
[0081] The chip dual firmware backup boot device provided in this application embodiment, such as... Figure 3 As shown, the master firmware and slave firmware are stored in the first chip 100. The reserved area of the first chip 100 is a custom area that users can configure themselves. Through the firmware program set in the non-volatile memory (boot read-only memory) and the setting of the indicator register, the chip dual firmware backup boot device can realize master-slave firmware switching boot during startup. When the master firmware fails to boot, it switches to slave firmware boot; when the slave firmware fails to boot, it switches to master firmware boot. Compared with traditional master-slave firmware switching boot devices, which require an additional FPGA or CPLD and two FLASH memory chips to store the master firmware and slave firmware respectively, the chip dual firmware backup boot device provided in this application embodiment only requires an additional FLASH chip to realize master-slave firmware backup switching boot, which greatly saves the resources occupied by setting master and slave firmware, and reduces product cost and development cycle.
[0082] Based on the above-mentioned chip dual firmware backup boot method, this application embodiment also provides an electronic device, including:
[0083] A processor; and a memory for storing executable instructions of the processor;
[0084] The processor is configured to execute the steps of the chip dual firmware backup boot method provided in the above embodiments by executing the executable instructions.
[0085] The processor can also be called a CPU (Central Processing Unit). A processor may be an integrated circuit chip with signal processing capabilities. A processor can also be a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), a FPGA (Field Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.
[0086] Based on the above-described chip dual firmware backup boot method, this application embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed, perform the steps of the chip dual firmware backup boot method provided in the above embodiment.
[0087] The computer program can be stored in the aforementioned storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks or optical disks, ROM (Read-Only Memory), RAM (Random Access Memory), or terminal devices such as computers, servers, mobile phones, and tablets.
[0088] The above description, in conjunction with specific embodiments, provides a further detailed explanation of this application and should not be construed as limiting the specific implementation of this application to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications and substitutions should be considered within the scope of protection of this application.
Claims
1. A method for chip dual firmware backup boot, characterized in that, The invention is applied to an integrated circuit system comprising a first chip and a second chip. The first chip is a FLASH memory chip that stores master firmware and slave firmware. The second chip includes registers, non-volatile memory, static random access memory, and a kernel. The second chip connects to the first chip, and the second chip reads the master firmware or slave firmware in the first chip to start the integrated circuit system; The method includes: Step S1: Run the startup program; the startup program is stored in the non-volatile memory of the second chip; Step S2: Read the value of the indicator register according to the boot program, determine the boot mode that the chip should select according to the value of the indicator register, and update the value of the indicator register according to the boot mode selected by the chip. The boot mode includes master firmware boot and slave firmware boot. Step S3: Read the updated value of the indicator register and determine the startup mode of the chip based on the updated value of the indicator register; The value of the indicator register includes: The first field, when the first field is a first value, indicates that the chip's boot mode is main firmware boot; when the first field is a second value, it indicates that the chip's boot mode is slave firmware boot. The second field is used to indicate the startup status of the chip. When the second field is the third value, it indicates that the chip has started successfully or reset successfully. When the second field is the fourth value, it indicates that the startup of the chip is being verified. When the second field is the fifth value, it indicates that the chip is starting up. After the startup program runs, it will read the value of the indicator register for master-slave arbitration. The purpose of master-slave arbitration is to determine whether the chip will start using the master firmware or the slave firmware. After determining the startup mode, the arbitration result will be written to the first field of the indicator register. Step S2 includes: When the first field of the indicator register is a first value and the second field of the indicator register is a third value, the chip selects to boot from the main firmware; otherwise, the chip selects to boot from the secondary firmware. Step S3 includes: When the first field of the updated indicator register is a first value, the chip boots using the master firmware; when the first field is a second value, the chip boots using the slave firmware. In step S3, when the boot mode is the main firmware boot, the following is included: Step S31: Update the second field of the indicator register to the fourth value, and verify whether the version of the main firmware is valid. If the version of the main firmware is valid, proceed to step S32. If the version of the main firmware is invalid, reset the chip and proceed to step S1. Step S32: Update the second field of the indicator register to the fifth value, and enable the main firmware to run in static random access memory; Step S33: Determine whether the chip boots successfully based on the main firmware running in the static random access memory. If the chip boots successfully, update the second field of the indicator register to the third value. If the chip boots unsuccessfully, reset the chip and proceed to step S1. In step S3, when the boot mode is booting from firmware, the following steps are included: Step S34: Update the second field of the indicator register to the fourth value, and verify whether the firmware version is valid. If the firmware version is valid, proceed to step S35. If the firmware version is invalid, reset the chip and proceed to step S1. Step S35: Update the second field of the indicator register to the fifth value, and enable the firmware to run in static random access memory; Step S36: Determine whether the chip boots successfully based on the firmware running in the static random access memory. If the chip boots successfully, update the second field of the indicator register to the third value. If the chip boots unsuccessfully, reset the chip and proceed to step S1.
2. A device for chip dual firmware backup boot, characterized in that, The device includes: A firmware storage module is provided for storing master firmware and slave firmware, both of which are used to start the device. The indicator module includes an indicator register for indicating the startup mode and startup state of the device; the value of the indicator register includes: The first field, when the first field is a first value, indicates that the chip's boot mode is main firmware boot; when the first field is a second value, it indicates that the chip's boot mode is slave firmware boot. The second field is used to indicate the startup status of the chip. When the second field is the third value, it indicates that the chip has started successfully or reset successfully. When the second field is the fourth value, it indicates that the startup of the chip is being verified. When the second field is the fifth value, it indicates that the chip is starting up. A control module, including non-volatile memory, is used to control the startup mode of the device according to a startup program. After the startup program runs, it reads the value of an indicator register and performs master-slave arbitration. The purpose of master-slave arbitration is to determine whether the chip should start using the master firmware or the slave firmware. After determining the startup mode, the arbitration result is written to the first field of the indicator register. When the first field of the indicator register is a first value and the second field of the indicator register is a third value, the chip selects master firmware startup; otherwise, the chip selects slave firmware startup. When the updated first field of the indicator register is a first value, the chip uses master firmware startup; when the updated first field is a second value, the chip uses slave firmware startup. When the boot mode is the main firmware boot, the second field of the indicator register is updated to the fourth value, and the version of the main firmware is checked. If the version of the main firmware is valid, the second field of the indicator register is updated to the fifth value, and the main firmware is run in the static random access memory. If the version of the main firmware is invalid, the chip is reset and the control module is triggered. The chip boot process is determined based on the main firmware running in the static random access memory. If the chip boots successfully, the second field of the indicator register is updated to the third value. If the chip boots unsuccessfully, the chip is reset and the control module is triggered. When the boot mode is booting from firmware, the second field of the indicator register is updated to the fourth value, and the version of the firmware is checked. If the version of the firmware is valid, the second field of the indicator register is updated to the fifth value, and the firmware is run in static random access memory. If the version of the firmware is invalid, the chip is reset and the control module is triggered. The chip boot process is determined based on the firmware running in the static random access memory. If the chip boots successfully, the second field of the indicator register is updated to the third value. If the chip boots unsuccessfully, the chip is reset and the control module is triggered. A boot module, comprising a static random access memory, is used to obtain the main firmware and run the main firmware program according to the boot program, or to obtain the slave firmware and run the slave firmware program. The firmware storage module is located in the first chip, and the indicator module, control module and startup module are located in the second chip. The device further includes: An execution module, including a kernel, is used to implement program instructions issued by the control module, the startup module, and the instruction module; the execution module is located in the second chip.
3. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to perform the steps of the chip dual firmware backup boot method of claim 1 by executing the executable instructions.
4. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed, implement the steps of the chip dual firmware backup boot method as described in claim 1.
Citation Information
Patent Citations
Double-booting method based on single FLASH storage chip
CN103116511A
Double-Flash switching device and server
CN113918389A