Firmware upgrading module and method, chip, processor and equipment

By dividing the memory of the board module into multiple firmware partitions, the problem of board and card cannot be restored independently due to abnormalities during firmware upgrade is solved, and the firmware upgrade efficiency and system maintenance is improved.

CN119987801APending Publication Date: 2025-05-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311501944.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-10
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

If an abnormality occurs during the firmware upgrade process in the prior art, the board cannot be restored independently, and the non-volatile memory needs to be removed for manual flashing, which reduces the firmware upgrade efficiency and system maintenance.

Method used

By dividing the memory in the board module into multiple firmware partitions and performing different program functions in different partitions, the management and independent allocation of storage space is achieved, ensuring that each partition does not interfere with each other and avoiding the failure of one partition affecting other partitions.

Benefits of technology

It improves the efficiency of firmware upgrades and the maintainability of the system, ensuring that even if a board module has problems with one firmware partition, the entire board will not be paralyzed, and the programs in other partitions can run normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987801A_ABST
    Figure CN119987801A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware upgrading module and method, a chip, a processor and equipment, and belongs to the technical field of chips. The firmware upgrading module comprises a board card module and a host module; the board card module comprises a memory, the memory is divided into a plurality of firmware partitions, and the plurality of firmware partitions comprise a first firmware partition and a second firmware partition; the first firmware partition is used for storing a first link program, and the first link program is a program solidified and stored in the first firmware partition; the second firmware partition is used for storing a second link program and first firmware content, the second link program is used for establishing bus connection between the board card module and the host module, and the first firmware content is used for running module functions of the board card module. Namely, it is guaranteed that the board card template cannot be completely paralyzed due to the fact that one firmware partition generates a problem, the firmware upgrading efficiency is improved, and the maintainability of the whole system is also guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip technology, and in particular to a firmware upgrade module, method, chip, processor and device. Background Art

[0002] Board firmware refers to program content stored in a non-volatile memory on the board module. Firmware upgrade refers to writing new program content into the non-volatile memory on the board module to replace the original program content.

[0003] In the related art, during the firmware upgrade, the firmware in the non-volatile memory board is first loaded, and when the firmware loading is completed, the board module is connected to the host via a bus, so that when the firmware in the non-volatile memory board receives the upgrade instruction sent by the host, it determines whether to upgrade the firmware content that needs to be upgraded.

[0004] However, if an exception occurs during the firmware loading stage or upgrade process, the board cannot be restored independently, so the non-volatile memory needs to be removed for manual flashing, which reduces the efficiency of firmware upgrade and the maintainability of the entire system. Summary of the invention

[0005] The present application provides a firmware upgrade module, method, chip, processor and device. The technical solution is introduced below.

[0006] According to one aspect of an embodiment of the present application, a firmware upgrade module is provided, the firmware upgrade module comprising: a board module and a host module; the board module comprises a memory, the memory is divided into a plurality of firmware partitions, the plurality of firmware partitions comprises a first firmware partition and a second firmware partition;

[0007] The first firmware partition is used to store a first link program, and the first link program is a program fixedly stored in the first firmware partition;

[0008] The second firmware partition is used to store a second link program and first firmware content, the second link program is used to establish a bus connection between the board module and the host module, and the first firmware content is used to run the module function of the board module.

[0009] According to one aspect of an embodiment of the present application, a chip is provided, comprising: a memory and the firmware upgrade module as described above.

[0010] According to one aspect of an embodiment of the present application, a processor is provided, comprising: a processor and the firmware upgrade module as described above.

[0011] According to one aspect of an embodiment of the present application, an electronic device is provided, which includes the firmware upgrade module as described above.

[0012] The technical solution provided by this application is provided with a module for managing firmware upgrades, which manages the storage space from the hardware level. When it is necessary to allocate storage space of target capacity, the firmware upgrade module finds an address segment that is idle and compatible with the target capacity from the storage space according to the target capacity, and returns the base address corresponding to the address segment, completing the allocation process of the storage unit starting from the base address in the storage space.

[0013] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0014] The memory in the board module is divided into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. If a problem occurs in one of the firmware partitions, it will not affect the program running in other firmware partitions. The program content in other firmware partitions can still run normally, ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is an implementation environment diagram corresponding to a firmware upgrade module provided by an exemplary embodiment of the present application;

[0016] Figure 2 It is a schematic diagram of the structure of a firmware upgrade module provided by an exemplary embodiment of the present application;

[0017] Figure 3 is a schematic diagram of a memory partition structure provided by an exemplary embodiment of the present application;

[0018] Figure 4 is a flowchart of a firmware upgrade method provided by an exemplary embodiment of the present application;

[0019] Figure 5 is a structural diagram of a firmware upgrade device provided by an exemplary embodiment of the present application;

[0020] Figure 6 is a flowchart of a firmware upgrade method provided by an exemplary embodiment of the present application;

[0021] Figure 7 It is a flowchart of a firmware upgrade method provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0023] The following is a detailed description of the implementation environment corresponding to the firmware upgrade module.

[0024] For illustration, please refer to Figure 1 , which shows an implementation environment diagram corresponding to a firmware upgrade module provided by an exemplary embodiment of the present application, such as Figure 1 As shown, a firmware upgrade module is displayed in the current embodiment environment, including a board module 110 and a host module 120, wherein the board module 110 is provided with a peripheral component bus interface (Peripheral Component Interconnect express, PCIe) for inserting into the corresponding PCIe expansion slot in the host module 120, thereby connecting the board module 110 with the host module 120.

[0025] The board module 110 includes a memory 111 for storing program content. The memory 111 is divided into a plurality of firmware partitions, including a first firmware partition 1111 and a second firmware partition 1112 .

[0026] Among them, the first firmware partition 1111 stores a first link program that is fixedly stored in the first firmware partition, and the second firmware partition 1112 stores a second link program for establishing a bus connection between the board module 110 and the host module 120, as well as a first firmware content for running the module function of the board module 110.

[0027] In an optional case, the host module 120 is connected to a power source, and the host module 120 is powered on. At the same time, since the board module 110 is physically connected to the host module 120, the board module 110 is also powered on. A random access memory (RAM) module is installed in the board module 110, and the firmware content stored in the memory of the board module 110 is loaded into the RAM module, thereby running the firmware content.

[0028] During the power-on process, first, the first link program in the first firmware partition 111 is loaded into the RAM module and starts to be executed. When the first link program is executed and successfully, the second link program in the second firmware partition 1112 is loaded into the RAM module and starts to be executed. When the second link program is executed, a bus connection is established between the board module 110 and the host module 120, so as to receive the second firmware content sent by the host module 120, and write the second firmware content into the second firmware partition to replace the first firmware content, so as to realize the firmware upgrade in the board module 110.

[0029] The board module 110 includes at least one of the circuit board types such as a sound card, a graphics card, and a main card.

[0030] Among them, the host module 120 can be implemented as a physical server or as a cloud server in the cloud. Among them, cloud technology (Cloud Technology) refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or local area network to realize data calculation, storage, processing and sharing.

[0031] In some embodiments, the host module 120 may also be implemented as a node in a blockchain system.

[0032] It should be noted that before collecting relevant data of users and during the process of collecting relevant data of users, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant regions.

[0033] The following is a detailed description of each component in the firmware upgrade module.

[0034] For illustration, please refer to Figure 2 , which shows a schematic diagram of the firmware upgrade module structure provided by an exemplary embodiment of the present application, such as Figure 2 As shown, the firmware upgrade module includes the following components.

[0035] Host module 210

[0036] Schematically, the host module 210 is a control box (Mainframe) for placing a mainboard and other components.

[0037] Optionally, the components include a central processing unit (CPU), memory, hard disk, optical drive, power supply, other input and output controllers and interfaces, wherein the other input and output controllers and interfaces include at least one of the component types such as an external bus standard (Universal Serial Bus, USB) controller, graphics card, network card, sound card, etc.

[0038] In some embodiments, the host module 210 is implemented as a server with computing capabilities. By sending relevant instructions to other components or other devices, other components or other devices perform corresponding operations according to the relevant instructions. After the operation is completed, an instruction completion signal is fed back to the host module 210, thereby realizing the control of other devices or other components to perform specified tasks through the host module 210.

[0039] ·Card module 220

[0040] The board module 220 includes a memory, which is divided into a plurality of firmware partitions, wherein the plurality of firmware partitions include a first firmware partition and a second firmware partition;

[0041] The first firmware partition is used to store a first link program.

[0042] The first link program is a program fixedly stored in the first firmware partition.

[0043] The second firmware partition is used to store the second link program and the first firmware content.

[0044] The second linking program is used to establish a bus connection between the board module 220 and the host module 210 , and the first firmware content is used to run the module function of the board module 220 .

[0045] Illustratively, the board module 220 refers to a printed circuit board that is inserted into a designated interface slot in the host module 210 and is used to control the operation of hardware.

[0046] Among them, controlling hardware operation includes controlling displays, acquisition cards and other devices.

[0047] Optionally, the board module 220 supports multiple operating systems, or the board module 220 supports a single operating system.

[0048] Illustratively, when the host module 210 runs the target operating system, and when the board module 220 also supports the target operating system, it is considered that data can be transmitted between the board module 220 and the host module 210 .

[0049] In some embodiments, in the firmware upgrade module, a designated bus interface is provided in the board module 220 for connecting to a slot corresponding to the designated bus interface in the host module 210, that is, the board module 220 inserts the designated bus interface into the slot corresponding to the designated bus interface in the host module 210 to realize the physical connection between the board module 220 and the host module 210.

[0050] Optionally, the designated bus interface includes at least one of bus interface types such as a PCIe interface, an Accelerated Graphics Port (AGP), an Industry Standard Architecture (ISA) bus interface, and the like.

[0051] Illustratively, taking the PCIe interface in the board module 220 as an example, the PCIe interface in the board module 220 is inserted into the PCI interface slot in the host module 210 to obtain a firmware upgrade module.

[0052] Optionally, the board module 220 includes a plurality of different components during the design process, wherein the system firmware corresponding to the operating system of the host module 210 is stored in the memory in the board module 220. Therefore, the memory in the board module 220 is used to store the system firmware. In this embodiment, the memory in the board module 220 is used to indicate a non-volatile memory.

[0053] The system firmware refers to the host module 210 driving the board module 220 to establish a bus connection with the host module 210 during operation, and then sending commands and data to the board module 220 through the host module 210 to implement the board function corresponding to the board module.

[0054] In some embodiments, the memory is divided into a plurality of firmware partitions, each partition independently stores at least one program, that is, the programs stored in different partitions do not interfere with each other.

[0055] Illustratively, the multiple firmware partitions include a first firmware partition and a second firmware partition, wherein the first firmware partition and the second firmware partition respectively store different contents.

[0056] Optionally, the first firmware partition and the second firmware partition are sequentially arranged in the memory according to a specified arrangement order, for example: the memory is arranged in an order from the first firmware partition to the second firmware partition, and for another example: the memory is arranged in an order from the second firmware partition to the first firmware partition, and this is not limited. In this embodiment, the order from the first firmware partition to the second firmware partition is taken as an example for explanation.

[0057] Schematically, there are multiple memory addresses in the memory, and the multiple memory addresses are divided in order of arrangement to obtain the storage space of each firmware partition in the memory. For example, the memory includes partition a and partition b, wherein partition a is located at the memory address corresponding to 0x1000 to 0x2000 in the memory, that is, the position corresponding to partition a is the storage space corresponding to 0x1000 to 0x2000.

[0058] Optionally, the first firmware partition and the second firmware partition are two independent and non-intersecting firmware partitions; or, the first firmware partition and the second firmware partition have an intersection in address ranges.

[0059] Illustratively, the board module 220 needs to burn program content before executing the corresponding board function, so in the current case, the memory of the board module 220 stores program content for implementing the entire board operation process. The program content can also be called firmware content.

[0060] The firmware content refers to the underlying code content corresponding to the connection between the board module 220 and the operating system when the host module 210 is started.

[0061] Optionally, the operation process of the board module 220 includes at least one of the following processes: board initialization, bus connection of the board module 220 and the host module 210, and detection of the operation status of the operating system.

[0062] In some embodiments, since the board function includes multiple stages of operation processes, the program content stored in the memory includes sub-routines corresponding to different stages of operation processes. Therefore, the memory is divided into multiple firmware partitions, and the multiple firmware partitions are used to respectively store the sub-routines executed by different stages of operation processes.

[0063] It is worth noting that the subprograms stored in each firmware partition can be called firmware content. In the embodiment of the present application, the first link program is stored in the first firmware partition, and the second link program and the first firmware content are stored in the second firmware partition for distinction. That is, the first link program, the second link program and the first firmware content correspond to the operation processes of different board modules, but the first link program, the second link program and the first firmware content all belong to the firmware content stored in their respective firmware partitions.

[0064] Illustratively, the first linking program stored in the first firmware partition is fixedly stored in the first firmware partition during the design process of the board module 220 .

[0065] The fixed storage refers to burning the first link program into the memory in the board module 220 , so that when the program stored in the board module 220 is subsequently modified, the first link program cannot be modified.

[0066] Optionally, the first link program is used to initialize the operating system corresponding to the board module 220 during the execution of the program content.

[0067] The initialization refers to reading the configuration state of the register in the board module 220. For example, during the running of the first link program, the current configuration state of the register is read and determined as the initialization state of the register.

[0068] Illustratively, the second linking program stored in the second firmware partition is used to establish a bus connection between the board module 220 and the host module 210 when the execution is successful, so that the host module 210 can transmit data to the board module 220. The bus type for establishing the connection corresponds to the bus type corresponding to the bus interface corresponding to the board module 220.

[0069] In some embodiments, when the second link program is executed successfully, it is considered that the current host module 210 successfully establishes a bus connection with the board module 220. When the second link program fails to execute or is not completed, the current host module 210 fails to establish a bus connection with the board module.

[0070] Illustratively, the first firmware content in the second firmware partition refers to the program content corresponding to the operating system corresponding to the board module 220 when it is running, and is used to detect the operating status of the operating system, the operating performance of the board module 220, and other functions.

[0071] In some embodiments, the module function corresponding to the board module is implemented during the execution of the first firmware content.

[0072] Optionally, in the second firmware partition, the storage location of the second link program is located before the storage location of the first firmware content; or, the storage location of the first firmware content is located before the storage location of the second link program.

[0073] Illustratively, in the process of executing the firmware contents stored in the memory (including the first link program, the second link program and the first firmware content), since a RAM module is installed in the board module 220, after the board module 220 is powered on, the firmware contents in the memory are loaded onto the RAM module, thereby starting to run the firmware contents. For example, the memory includes the first link program of the first firmware partition, the second link program of the second firmware partition and the first firmware content. After the board module is inserted into the bus slot corresponding to the host module, the host module 210 is powered on, and the first link program is first loaded into the RAM module in the board module 220, thereby executing the first link program. After the first link program is completed, the second link program is loaded into the RAM module, and the second link program is started to be executed. And so on, the firmware contents in the memory are executed.

[0074] The loading process is performed by automatically loading the host module 210 after it is powered on; or, after the host module 210 is powered on, a loading instruction is received to perform the loading process.

[0075] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. If a problem occurs in one of the firmware partitions, it will not affect the program running in other firmware partitions. The program content in other firmware partitions can still run normally, ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0076] The following is a detailed description of the link building process of the firmware upgrade module, which is applied to the above Figure 2 Take the corresponding module structure as an example.

[0077] Second firmware partition

[0078] The second firmware partition is used to establish a bus connection between the board module 220 and the host module 210 through a second link program.

[0079] In some embodiments, the board module also includes a register; the second firmware partition is also used to rewrite the configuration state corresponding to the register through a second link program to obtain a first configuration result; in response to the first configuration result meeting the link success condition, it is determined to establish a bus connection between the board module and the host module.

[0080] In this embodiment, when the bus interface is PCIe, the second linking program is used to establish a PCIe bus connection between the board module 220 and the host module 210. The connection establishment process may also be referred to as a PCIe initialization process.

[0081] In this embodiment, the second link program is loaded into the RAM module in the board module 220, so as to start running the second link program. In the process of running the second link program, the position of the board module 220 in the host module 210 is first determined, and after obtaining the device position corresponding to the board module 220, the bus structure corresponding to the board module 220 is obtained, and then the device state corresponding to the board module 220 is set, and then the driver corresponding to the board module 220 is installed. After the setting is completed, the configuration space corresponding to the board module 220 is set, and after the configuration is completed, the board module 220 is started. The above process is the bus connection establishment process.

[0082] Among them, configuration refers to the state configuration of the registers in the board module 220. For example, if the current configuration state of the registers in the board module 220 is "1", and the configuration state corresponding to the successful connection is 2, the configuration state "1" is adjusted to "2". If the adjustment is successful, it means that the board module 220 and the host module 210 have successfully established a bus connection. If the adjustment fails, it means that the bus connection between the board module 220 and the host module 210 has failed to be established. In this embodiment, the adjustment result obtained by adjusting the configuration state of the registers through the second link program is used as the first configuration result.

[0083] Optionally, the second link program and the first firmware content are stored in the second firmware partition as a whole program content; or, the second link program and the first firmware are stored in the second partition as two independent program contents.

[0084] First firmware partition

[0085] In response to the second linking program linking failure, the first firmware partition is further used to establish a bus connection between the board module and the host module through the first linking program.

[0086] Illustratively, when the second link program fails to execute, it indicates that it is currently impossible to establish a bus connection between the board module 220 and the host module 210 through the second link program. Since the second link program is the program content that preferentially has the program content of establishing a bus connection between the board module 220 and the host module 210, if the second link program fails to execute, the second link program needs to be updated subsequently.

[0087] Since the first link program not only has the function of initializing the operating system, but also has the function of establishing a bus connection between the board module 220 and the host module 210, when the second link program fails to execute, the first link program is run, so that when the first link program is executed successfully, a bus connection is established between the board module 220 and the host module 210.

[0088] Illustratively, the first link program includes an operating system initialization function and a bus connection function, so that during the running of the first link program, the operating system initialization can be achieved, and a bus connection can be established between the board module 220 and the host module 210.

[0089] Illustratively, the initialization of the operating system is used to read the configuration status of the register in the board module 220, that is, in the process of running the first link program, the configuration status of the register in the board module 220 is read as "1", which means that the initial configuration status of the register is "1", and in the subsequent process of establishing a bus connection, it is used to adjust the initial configuration status corresponding to the register.

[0090] In some embodiments, the first firmware partition is also used to detect the connection status of the bus connection at specified time intervals through the first link program; in response to the connection status meeting the link failure condition, it is determined that the second link program link has failed, and the first firmware partition is also used to establish a bus connection between the board module and the host module through the first link program.

[0091] Schematically, the first link program also has a status detection function, that is, in the process of running the first link program, the bus connection status between the board module 220 and the host module 210 is detected by the first link program according to a preset specified time interval. Taking the case where the configuration status of the register is "2" in the bus connection success state as an example, when the first link program detects that the configuration status of the register is not 2, it is considered that the current bus connection status between the board module 220 and the host module 210 meets the link failure condition, so that the configuration status of the register is adjusted by the first link program from state "1" to state "2", and the adjustment result obtained after the configuration status of the register is adjusted by the first link program is used as the second configuration result. If the second configuration result is "2", it indicates that the configuration status of the register is successfully adjusted, thereby realizing the PCIe initialization between the host module 210 and the board module 220, that is, the bus link between the host module 210 and the board module 220 is established by the first link program.

[0092] That is, in response to the first configuration result meeting the link failure condition, the first firmware partition is further used to adjust the configuration state corresponding to the register through the first link program to obtain the second configuration result.

[0093] Illustratively, when there is a need to update the second firmware partition, after a bus connection is established between the board module 220 and the host module 210 , the program content in the second firmware partition is updated through the host module 210 .

[0094] Illustratively, updating means replacing the second link program / first firmware content in the second firmware partition with new program content.

[0095] Optionally, update requirements include the following situations:

[0096] First, the host module 210 generates a third link program, which is used to replace the second link program with the third link program;

[0097] Second, the host module 210 generates a second firmware content, which is used to replace the first firmware content with the second firmware content;

[0098] Third, the host module 210 generates a third link program and a second firmware content, which is used to replace the second link program with the third link program and replace the first firmware content with the second firmware content.

[0099] It is worth noting that the above-mentioned update requirements are only illustrative examples and are not limited to the embodiments of the present application.

[0100] Illustratively, when a bus connection is established between the board module 220 and the host module 210 , it means that the host module 210 can send a third link program and / or a second firmware content to the board module 220 to replace the second link program and / or the first firmware content.

[0101] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. When a problem occurs in one of the firmware partitions, it will not affect the program operation in other firmware partitions, thereby ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0102] In this embodiment, when the second link program fails to link, the first link program can also be used as a backup program to establish a bus connection between the host module and the board module to improve the link building efficiency of the board module and ensure the normal operation of the board.

[0103] In this embodiment, the first link program is used to perform regular detection of the bus connection status between the host module and the board module, so that when the second link program fails to link, the bus connection between the board module and the host module can be established in time through the first link program to ensure the bus connection efficiency.

[0104] In this embodiment, the configuration status of the registers in the board module is rewritten by the second link program, so that the bus connection status between the board module and the host module is determined according to the configuration result, so that when the configuration result meets the connection failure, the bus connection between the host module and the board module is established in time through the first link program to ensure the success of the bus connection.

[0105] In some embodiments, the second firmware partition can also be divided into a first firmware sub-partition and a second firmware sub-partition. The following describes in detail the case where the memory is divided into three firmware partitions, and the firmware upgrade module is applied to the above Figure 2 Take the corresponding module structure as an example.

[0106] First firmware sub-partition

[0107] The first firmware sub-partition is used to store the second link program.

[0108] Illustratively, the second firmware partition may be further divided into a first firmware sub-partition and a second firmware sub-partition. The first firmware sub-partition is used to separately store a second link program for establishing a bus connection between the board module 220 and the host module 210 .

[0109] Illustratively, the second link program is stored separately in the first firmware sub-partition, that is, in the current case, the second link program and the first firmware content are two separate program contents, and the second link program is stored separately in the first firmware sub-partition.

[0110] In some embodiments, the first sub-firmware partition is further used to establish a bus connection between the board module 220 and the host module through a second link program.

[0111] Illustratively, by loading the second link program into the board module 220 and running the second link program, the configuration state of the register in the board module 220 is rewritten during the running of the second link program, thereby obtaining a first configuration result corresponding to the second link program, which is used to represent the rewriting result of the register configuration state by the current second link program.

[0112] In some embodiments, when the second link is successful in response to the second link program linking, and there is a need to update the second firmware sub-partition, the host module is further used to perform a firmware update on the first firmware content.

[0113] In this embodiment, after the second link program is run, the first link program detects that the configuration status of the registers in the board module 220 meets the link success condition, indicating that a bus connection is successfully established between the board module 220 and the host module 210 through the second link program.

[0114] At this time, if there is an update requirement in the first firmware sub-partition, the second link program can be updated through the host module 210 .

[0115] Illustratively, the update requirement means that the host module 210 obtains the third link program, and sends the third link program to the board module 220, so as to replace the second link program with the third link program.

[0116] In some embodiments, when the first link program detects that the configuration status of the register in the board module 220 meets the link failure condition, the configuration status of the register in the board module 220 is rewritten by the first link program so that the configuration status of the register meets the link success condition, thereby ensuring that a bus connection is successfully established between the host module 210 and the board module 220.

[0117] Illustratively, when the second link program fails to link, it indicates that there is a fault in the current second link program and a bus connection cannot be successfully established between the board module 220 and the host module 210. Therefore, after the bus connection between the board module 220 and the host module 210 is successfully established through the first link program, the third link program is obtained through the host module 210, and the third link program is sent to the board module 220 to replace the second link program in the first firmware sub-partition.

[0118] Second firmware sub-partition

[0119] The second firmware sub-partition is used to store the first firmware content.

[0120] Illustratively, when the second firmware partition is divided into a first firmware sub-partition and a second firmware sub-partition, the second firmware sub-partition is used to store the first firmware content.

[0121] Optionally, when a bus connection is successfully established between the host module 210 and the board module 220, the first firmware content in the second firmware sub-partition is loaded into the RAM module in the board module 220, so that the first firmware content is run in the board module 220, thereby realizing the program function corresponding to the first firmware content, for example: detecting the operating status during system operation.

[0122] Optionally, when a bus connection is successfully established between the host module 210 and the board module 220, and when there is an update requirement in the second firmware sub-partition, the host module 210 obtains the second firmware content and sends the second firmware content to the board module 220, so as to replace the first firmware content with the second firmware content, thereby realizing a firmware upgrade in the board module 220.

[0123] Illustratively, when there is a need to update the second firmware sub-partition, a bus connection between the board module and the host module is established through the second link program.

[0124] In some embodiments, if the second link program detects through the first link program that the configuration status of the register in the board module 220 meets the link success condition during the operation of the second link program, it means that the bus connection between the board module 220 and the host module 210 is successfully established through the second link program.

[0125] In some embodiments, when there is a need to update the second sub-firmware partition, in response to the second linking program linking failure, the first firmware partition is further used to establish a bus connection between the board module and the host module through the first linking program.

[0126] In some embodiments, if the first firmware content in the second firmware sub-partition is updated, the second link program is executed. If the second link program fails to execute, the first link program is executed. If the first link program is executed successfully, it means that the bus connection between the board module 220 and the host module 210 is successfully established through the first link program.

[0127] For illustration, please refer to Figure 3 , which shows a schematic diagram of a memory partition structure provided by an exemplary embodiment of the present application, such as Figure 3 As shown, the memory 300 is currently displayed, wherein the memory 300 is divided into a firmware header area 310, a partition 320, a partition 330 and a partition 340, wherein the partition 320 stores a first link program, the partition 330 stores a second link program, the partition 340 stores a first firmware content, and the firmware header area 310 stores the first link program, the second link program and version information corresponding to the first firmware content, the number of pages corresponding to the new version of the firmware that needs to be updated, and the firmware size.

[0128] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. When a problem occurs in one of the firmware partitions, it will not affect the program operation in other firmware partitions, thereby ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0129] In this embodiment, the second firmware partition is subdivided into the first firmware sub-partition and the second firmware sub-partition, which can ensure that each firmware partition can implement different program functions, so that when one of the firmware partitions fails, the other firmware partitions can run normally and successfully establish a bus connection between the board module and the host module, ensuring that the board module can operate normally, avoiding the need for manual flashing after an abnormality occurs in the board module, and improving the efficiency of subsequent firmware upgrades.

[0130] In some embodiments, the firmware upgrade method corresponding to the board module is described. For illustration, please refer to Figure 4 , which shows a flowchart of a firmware upgrade method provided by an exemplary embodiment of the present application, such as Figure 4 As shown, the method includes the following steps.

[0131] Step 410: Start the second link program through the second firmware partition to establish a bus connection between the board module and the host module.

[0132] Illustratively, the board module includes a memory, which is divided into multiple firmware partitions, including a first firmware partition and a second firmware partition, the first firmware partition stores a first link program, and the second firmware partition stores a second link program and the first firmware content.

[0133] Schematically, the host module is a control box for placing a mainboard and other components.

[0134] Optionally, the components include a central processing unit, memory, hard disk, optical drive, power supply, other input and output controllers and interfaces, wherein the other input and output controllers and interfaces include at least one of the component types such as an external bus standard controller, a graphics card, a network card, and a sound card.

[0135] In some embodiments, the host module is implemented as a server with computing capabilities. By sending relevant instructions to other components or other devices, other components or other devices perform corresponding operations according to the relevant instructions. After the operation is completed, an instruction completion signal is fed back to the host module, thereby realizing the control of other devices or other components to perform specified tasks through the host module.

[0136] Illustratively, the first link program is a program fixedly stored in the first firmware partition. The second firmware partition is used to store the second link program and the first firmware content. The second link program is used to establish a bus connection between the board module and the host module, and the first firmware content is used to run the module function of the board module.

[0137] Schematically, a board module refers to a printed circuit board that is inserted into a designated interface slot in a host module and is used to control the operation of hardware.

[0138] Among them, controlling hardware operation includes controlling displays, acquisition cards and other devices.

[0139] Optionally, the board module supports multiple operating systems, or the board module supports a single operating system.

[0140] Illustratively, when the host module runs the target operating system and the board module also supports the target operating system, it is considered that data can be transmitted between the board module and the host module.

[0141] In some embodiments, in the firmware upgrade module, a designated bus interface is provided in the board module, which is used to connect to the slot corresponding to the designated bus interface in the host module. That is, the board module inserts the designated bus interface into the slot corresponding to the designated bus interface in the host module to realize the physical connection between the board module and the host module.

[0142] Optionally, the designated bus interface includes at least one of bus interface types such as a PCIe interface, an Accelerated Graphics Port (AGP), and an ISA bus interface.

[0143] Schematically, taking the case where a PCIe interface is provided in a board module as an example, the PCIe interface in the board module is inserted into a PCI interface slot in a host module to obtain a firmware upgrade module.

[0144] Optionally, the board module includes multiple different components during the design process, wherein the system firmware corresponding to the operating system of the host module is stored in the memory in the board module, and thus, the memory in the board module is used to store the system firmware. In this embodiment, the memory in the board module is used to indicate a non-volatile memory.

[0145] The system firmware refers to the host module sending commands and data to the board module through the host module after the host module drives the board module to establish a bus connection with the host module during operation, so as to realize the board function corresponding to the board module.

[0146] In some embodiments, the memory is divided into a plurality of firmware partitions, each partition independently stores at least one program, that is, the programs stored in different partitions do not interfere with each other.

[0147] Illustratively, the multiple firmware partitions include a first firmware partition and a second firmware partition, wherein the first firmware partition and the second firmware partition respectively store different contents.

[0148] Optionally, the first firmware partition and the second firmware partition are sequentially arranged in the memory according to a specified arrangement order, for example: the memory is arranged in an order from the first firmware partition to the second firmware partition, and for another example: the memory is arranged in an order from the second firmware partition to the first firmware partition, and this is not limited. In this embodiment, the order from the first firmware partition to the second firmware partition is taken as an example for explanation.

[0149] Schematically, there are multiple memory addresses in the memory, and the multiple memory addresses are divided in order of arrangement to obtain the storage space of each firmware partition in the memory. For example, the memory includes partition a and partition b, wherein partition a is located at the memory address corresponding to 0x1000 to 0x2000 in the memory, that is, the position corresponding to partition a is the storage space corresponding to 0x1000 to 0x2000.

[0150] Optionally, the first firmware partition and the second firmware partition are two independent and non-intersecting firmware partitions; or, the first firmware partition and the second firmware partition have an intersection in address ranges.

[0151] Indicatively, the board module needs to be burned with program content before it can execute the corresponding board function. Therefore, in the current case, the memory of the board module stores program content for implementing the entire board operation process. The program content can also be called firmware content.

[0152] The firmware content refers to the underlying code content corresponding to the connection between the board module and the operating system when the host module is started.

[0153] Optionally, the operation process of the board module includes at least one of the following processes: board initialization, bus connection of the board module with the host module, and detection of the operation status of the operating system.

[0154] In some embodiments, since the board function includes multiple stages of operation processes, the program content stored in the memory includes sub-routines corresponding to different stages of operation processes. Therefore, the memory is divided into multiple firmware partitions, and the multiple firmware partitions are used to respectively store the sub-routines executed by different stages of operation processes.

[0155] It is worth noting that the subprograms stored in each firmware partition can be called firmware content. In the embodiment of the present application, the first link program is stored in the first firmware partition, and the second link program and the first firmware content are stored in the second firmware partition for distinction. That is, the first link program, the second link program and the first firmware content correspond to the operation processes of different board modules, but the first link program, the second link program and the first firmware content all belong to the firmware content stored in their respective firmware partitions.

[0156] Illustratively, the first linking program stored in the first firmware partition is fixedly stored in the first firmware partition during the board module design process.

[0157] The fixed storage refers to burning the first link program into the memory in the board module, so that when the program stored in the board module is subsequently modified, the first link program cannot be modified.

[0158] Optionally, the first link program is used to initialize the operating system corresponding to the board module during the execution of the program content.

[0159] The initialization refers to reading the configuration state of the register in the board module, for example, during the running of the first link program, reading the current configuration state of the register and determining it as the initialization state of the register.

[0160] Illustratively, the second linking program stored in the second firmware partition is used to establish a bus connection between the board module and the host module when the execution is successful, so that the host module can transmit data to the board module. The bus type for establishing the connection corresponds to the bus type corresponding to the bus interface corresponding to the board module.

[0161] In some embodiments, when the second link program is executed successfully, it is considered that the current host module and the board module have successfully established a bus connection. When the second link program fails to execute or is not executed completely, the current host module and the board module fail to establish a bus connection.

[0162] Illustratively, the first firmware content in the second firmware partition refers to the program content corresponding to the operating system corresponding to the board module when it is running, and is used to detect the operating status of the operating system, the operating performance of the board module, and other functions.

[0163] In some embodiments, the module function corresponding to the board module is implemented during the execution of the first firmware content.

[0164] Optionally, in the second firmware partition, the storage location of the second link program is located before the storage location of the first firmware content; or, the storage location of the first firmware content is located before the storage location of the second link program.

[0165] Illustratively, in the process of executing the firmware contents stored in the memory (including the first link program, the second link program and the first firmware content), since a RAM module is installed in the board module, after the board module is powered on, the firmware contents in the memory are loaded onto the RAM module, thereby starting to run the firmware contents. For example, the memory includes the first link program of the first firmware partition, the second link program of the second firmware partition and the first firmware content. After the board module is inserted into the bus slot corresponding to the host module, the host module is powered on, and the first link program is first loaded into the RAM module in the board module, thereby executing the first link program. After the first link program is finished running, the second link program is loaded into the RAM module, and the second link program starts to be executed. And so on, to execute the firmware contents in the memory.

[0166] The loading process is performed by automatically loading the host module after it is powered on; or, after the host module is powered on, a loading instruction is received to perform the loading process.

[0167] Step 420: In response to the second linking program failing to link, the first linking program is started by the first firmware partition to establish a bus connection between the board module and the host module.

[0168] In schematic form, when the second link program fails to execute, it indicates that it is currently impossible to establish a bus connection between the board module and the host module through the second link program. Since the second link program is the program content that preferentially has the function of establishing a bus connection between the board module and the host module, if the second link program fails to execute, the second link program will need to be updated subsequently.

[0169] Since the first link program has the function of establishing a bus connection between the board module and the host module in addition to the function of initializing the operating system, when the second link program fails to execute, the first link program is run, thereby establishing a bus connection between the board module and the host module when the first link program is executed successfully.

[0170] Illustratively, the first link program includes an operating system initialization function and a bus connection function, so that during the running of the first link program, the operating system initialization can be achieved, and a bus connection can be established between the board module and the host module.

[0171] Illustratively, the initialization of the operating system is used to read the configuration status of the registers in the board module, that is, in the process of running the first link program, the configuration status of the registers in the board module is read as "1", which indicates that the initial configuration status of the registers is "1", and in the subsequent process of establishing a bus connection, it is used to adjust the initial configuration status corresponding to the register.

[0172] In some embodiments, the first firmware partition is also used to detect the connection status of the bus connection at specified time intervals through the first link program; in response to the connection status meeting the link failure condition, it is determined that the second link program link has failed, and the first firmware partition is also used to establish a bus connection between the board module and the host module through the first link program.

[0173] Schematically, the first link program also has a status detection function, that is, in the process of running the first link program, the bus connection status between the board module and the host module is detected by the first link program according to a preset specified time interval. Taking the case where the bus connection is successful and the configuration status of the register is "2" as an example, when the first link program detects that the configuration status of the register is not 2, it is considered that the current bus connection status between the board module and the host module meets the link failure condition, so that the configuration status of the register is adjusted by the first link program from state "1" to state "2", and the adjustment result obtained after adjusting the configuration status of the register by the first link program is used as the second configuration result. If the second configuration result is "2", it indicates that the configuration status of the register is successfully adjusted, thereby realizing PCIe initialization between the host module and the board module, that is, establishing a bus link between the host module and the board module through the first link program.

[0174] That is, in response to the first configuration result meeting the link failure condition, the first firmware partition is further used to adjust the configuration state corresponding to the register through the first link program to obtain the second configuration result.

[0175] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. When a problem occurs in one of the firmware partitions, it will not affect the program operation in other firmware partitions, thereby ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0176] The following is a detailed description of the signature verification process in the firmware partition. The firmware upgrade module is used in the above Figure 2 Take the corresponding module structure as an example.

[0177] First firmware partition

[0178] In some embodiments, the first firmware partition is further used to perform signature verification on the second link program through the first link program to obtain a signature verification result.

[0179] Illustratively, during the execution of the first link program in the first firmware partition, the first link program further includes a function of performing signature verification on the second link program.

[0180] Illustratively, during the process of running the first link program, it is used to perform signature verification on the second link program.

[0181] In this embodiment, the first link program includes multiple lines of program content, and the multiple lines of program content can be divided into multiple sections of different program functions. For example, the first link program includes 10 lines of code content, wherein the first to third lines are operating system initialization functions (i.e., capturing the initial configuration state corresponding to the register), the fourth to sixth lines are signature verification functions, which are used to perform signature verification on the second link program, the seventh to eighth lines are firmware loading functions, which are used to load the second link program into the RAM module for execution, and the ninth to tenth lines are state detection, which are used to detect the configuration state of the register at a specified time interval. If it is detected that the configuration state meets the connection failure condition, the host module and the board module are PCIe initialized, that is, a bus connection is established through the first link program. It is worth noting that since the first link program may include an "if else" statement, the second link program will be run when the if branch is executed to execute the bus connection establishment process. If the if branch detects that the second link program fails to establish a link, the else branch is executed, that is, the bus connection between the host module 210 and the board module 220 is established through the first link program.

[0182] During the execution of the first link program, the operating system corresponding to the board module 220 is first initialized to obtain the initial configuration state corresponding to the register. If the acquisition is successful, it means that the initialization is successful, and the signature verification of the second link program is started.

[0183] In the process of signature verification, a pair of public keys and private keys are provided in the first link program. The first link program calculates a first hash value corresponding to the second link program, and uses the private key to sign the first hash value to obtain a signature result. The signature result is verified using the public key, and a second hash value is calculated. The first hash value is compared with the second hash value, and the comparison result is used as a signature verification result.

[0184] In some embodiments, in response to the signature verification result meeting the verification success condition, a bus connection between the board module and the host module is established through a second linking program.

[0185] Illustratively, when the first Hash value is the same as the second Hash value, it indicates that the signature verification result meets the verification success condition, and thus the second link subroutine is started to be executed, that is, a bus connection is established between the board module 220 and the host module 210 through the second link subroutine.

[0186] In some embodiments, in response to the signature verification result meeting the verification failure condition, the first firmware partition is further used to establish a bus connection between the board module and the host module through the first link program.

[0187] Illustratively, when the first Hash value is different from the second Hash value, it indicates that the signature verification result meets the verification failure condition, and the second link program cannot be executed at this time, so a bus connection is established between the board module 220 and the host module 210 through the first link program.

[0188] Second firmware partition

[0189] Illustratively, when the second firmware partition is divided into a first firmware sub-partition and a second firmware sub-partition, the first firmware sub-partition stores the second link program, and the second firmware sub-partition stores the first firmware content.

[0190] When executing the second link program in the first firmware sub-partition, the second link program needs to perform a signature verification process on the first firmware content in the second firmware sub-partition after establishing a bus connection between the board module 220 and the host module 210 .

[0191] Among them, during the operation, the second link program includes the functions of establishing a bus connection between the board module 220 and the host module 210, loading the first firmware content stored in the second firmware sub-partition, and verifying the signature of the first firmware content.

[0192] First, during the process of running the second link program in the first firmware sub-partition, the configuration state of the register is adjusted to obtain a first configuration result. If the first configuration result meets the connection success condition, it means that the bus connection between the board module 220 and the host module 210 is successfully established.

[0193] Secondly, after the bus connection is established between the board module 220 and the host module 210, the second link program continues to run, thereby loading and obtaining the first firmware content.

[0194] Finally, after the first firmware content is loaded, the signature of the first firmware content is verified through the second link program. The signature verification process is consistent with the above-mentioned signature verification process for the second link program, which will not be repeated here.

[0195] When the signature verification result corresponding to the first firmware content meets the verification success condition and there is a need to update the first firmware content, the first firmware content is executed and the control in the memory is transferred from the first firmware sub-partition to the second firmware sub-partition for subsequent updating of the first firmware content.

[0196] When the signature verification result corresponding to the first firmware content meets the verification failure condition, the first firmware content is not executed.

[0197] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. When a problem occurs in one of the firmware partitions, it will not affect the program operation in other firmware partitions, thereby ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0198] In this embodiment, by performing signature verification on the first link program / the second link program, the security of the firmware operation can be improved.

[0199] The following is a detailed description of the firmware upgrade process corresponding to the firmware upgrade module, which is applied to the above Figure 2 Take the corresponding module structure as an example.

[0200] The board module 220 includes an intermediate storage medium, a register, a controller and a direct access memory.

[0201] Host module

[0202] The host module 210 is used to write the second firmware content into the intermediate storage medium, the second firmware content is used to replace the first firmware content to update the second firmware partition, and the intermediate storage medium is used to temporarily store the second firmware content.

[0203] The host module 210 is further used to configure the register mode through the bus; in response to configuring the controller with a write mode, the controller is started, and the write mode is used to write the second firmware content into the second firmware partition.

[0204] Illustratively, after the host module 210 and the board module 220 establish a bus connection, the host writes the new version of the firmware content (third link program / second firmware content) into the intermediate storage medium, and configures the corresponding register of the controller through the bus, configures it to write mode, and then starts the controller.

[0205] Board module

[0206] The controller is further used to move the second firmware content from the intermediate storage medium to the direct access memory; the direct access memory is further used to write the second firmware content into the second firmware partition in the memory.

[0207] Illustratively, after the controller is started, the new version of the firmware content is moved from the intermediate storage medium to the direct access memory.

[0208] The direct access memory writes the new version of the firmware content into the memory, and then causes the controller to move the new version of the firmware content from the intermediate storage medium to the direct access memory, and the cycle continues until all the configured new version of the firmware content is written.

[0209] In some embodiments, in response to the completion of the update of the second firmware partition, the host module is further used to send a reset instruction to the board module; the board module is further used to receive the reset instruction; and execute the first link program based on the reset instruction.

[0210] Illustratively, after writing is completed, the host module 220 sends a reset instruction to the board module 220, so that the new version of the firmware content begins to execute.

[0211] For illustration, please refer to Figure 5 , which shows a structure diagram of a firmware upgrade device provided by an exemplary embodiment of the present application, such as Figure 5 As shown, the present system includes a host module 510 and a board module 520 , wherein the board module 520 includes an intermediate storage medium 521 , a memory 522 , a controller register 523 , a controller memory 524 , and a direct access memory 525 .

[0212] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. When a problem occurs in one of the firmware partitions, it will not affect the program operation in other firmware partitions, thereby ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0213] For illustration, the firmware upgrade module is implemented as a PCIE module as an example. For illustration, please refer to Figure 6 , which shows a flowchart of a firmware upgrade method provided by an exemplary embodiment of the present application, the method includes the following steps.

[0214] Step 601, power on and start.

[0215] When the board module is inserted into the PCI slot of the host module through the PCI interface, the board module is powered on while the host module is connected to a power source.

[0216] Step 602: Execute a first link program in a first firmware partition.

[0217] After the board module is powered on, the first link program in the first firmware partition is started to run to obtain the corresponding registers in the board module.

[0218] Step 603: perform signature verification on the second link program in the first firmware partition.

[0219] During the execution of the first link program in the first firmware partition, a signature verification is performed on the second link program to obtain a signature verification result.

[0220] Step 604, updating the second link program.

[0221] When the signature verification result meets the verification failure condition, update the second link program. The update method can be found in the following Figure 7 The corresponding firmware update process in .

[0222] Furthermore, when the signature verification result meets the verification failure condition, the first link program is run, wherein the initial configuration state of the register is obtained during the running process.

[0223] Step 605: Establish a bus connection between the board module and the host module through a second link program.

[0224] When the signature verification result meets the verification success condition, the second link program is run, and a bus connection is established between the board module and the host module through the second link program.

[0225] Step 606: The second link program is executed normally.

[0226] When the bus connection is successfully established and there is no update requirement, the second link program runs normally.

[0227] Step 607: perform signature verification on the first firmware content in the first firmware sub-partition.

[0228] When the bus connection is successfully established and there is an update requirement, a signature verification is performed on the first firmware content in the second firmware sub-partition to obtain a signature verification result.

[0229] Step 608: If the signature verification fails, the second link program is run.

[0230] When the signature verification result meets the verification failure condition, continue to run the second link program.

[0231] Step 609: The signature verification is successful, and the first firmware content is executed.

[0232] When the signature verification result meets the verification success condition, the first firmware content starts to run.

[0233] Step 610: The first firmware content is executed normally.

[0234] If there is no need to update the first firmware content, the first firmware content is run normally.

[0235] Step 611: When receiving an upgrade request from the host module, perform a firmware upgrade.

[0236] When the board module receives the upgrade request from the host module, the first firmware content is upgraded, that is, the host module sends the second firmware content to the board module to replace the first firmware content with the second firmware content.

[0237] Step 612, normal startup.

[0238] When the firmware upgrade is complete, the second firmware content is started normally.

[0239] Step 613, end.

[0240] For illustration, please refer to Figure 7 , which shows a firmware upgrade flow chart provided by an exemplary embodiment of the present application, such as Figure 7 As shown, the method includes the following steps.

[0241] Step 701: The board module establishes a bus connection with the host module.

[0242] A bus connection is established between the board module and the host module through the first link program / the second link program.

[0243] Step 702, select a firmware upgrade method and input an upgrade instruction.

[0244] According to the upgrade instruction sent by the host module, it is determined to perform a firmware upgrade on the second link program, or to perform a firmware upgrade on the first firmware content.

[0245] If it is determined to perform a firmware upgrade on the second link program, a first upgrade instruction corresponding to the second link program is input, where the first upgrade instruction is used to instruct to perform a firmware upgrade on the second link program.

[0246] If it is determined to perform a firmware upgrade on the first firmware content, a second upgrade instruction corresponding to the first firmware content is input, and the second upgrade instruction is used to instruct to perform a firmware upgrade on the first firmware content.

[0247] If the second updated firmware is unavailable or has problems at this time, the connection with the host is lost. At this time, the timer interrupt detection mechanism of the first stage firmware detects that the PCIe of the next stage has not been initialized successfully, so the PCIe is initialized in the first stage. At this time, the link between the board and the host is re-established, and a new update command can be initiated to refresh the content in the memory. It should be noted here that the compatibility of the version of the initialized PCIe in the first stage firmware is better than that of the second stage version, but the second stage is better in terms of link establishment time and transmission rate. The second stage firmware is the latest version. The reason for using a higher version of the protocol in the second stage and separating it from the third stage firmware is to take into account the link establishment time, so that the probability of problems in the link establishment process is smaller. The reason for using a lower version in the first stage firmware is to ensure that PCIe can be initialized well in this stage after the initialization of the next stage has problems, so as to connect with the host, so there is no requirement for the rate, and the pursuit is the success rate. The reason for dividing the firmware into three stages is to take into account the different division of labor of firmware in different stages to ensure the reliability and maintainability of the upgrade.

[0248] Step 703: the host module writes the new version of the firmware into the intermediate storage medium, configures the write mode and starts the controller.

[0249] The host module writes the new version of the firmware content that needs to replace the original firmware content into the intermediate storage medium in the board module, configures the write mode for it, and starts the controller in the board module.

[0250] Step 704 : The controller moves the new version of the firmware content from the intermediate storage medium into a buffer area accessed by the memory.

[0251] After the controller in the board module is started, the new version of the firmware content is moved from the intermediate storage medium to the buffer corresponding to the memory access in the board module.

[0252] Step 705: directly access the memory to write the new version of the firmware from the buffer into the memory.

[0253] The direct access memory in the board module writes the new version of the firmware content from the buffer into the memory, replacing the original firmware content, and then feedback step 704, until all configured pages are written into the memory, completing the replacement of the firmware content and realizing the firmware upgrade.

[0254] Step 706: The host sends a reset instruction, and the program resets to the address where the startup code is located and starts execution.

[0255] The host module sends a reset instruction to the board module, so that the board module starts to run from the first link program in the first firmware partition.

[0256] Step 707, notifying the host module that the data packet parameters are wrong and continuing to run the original firmware content.

[0257] If an error occurs during the firmware update, a data packet parameter error instruction is sent to the host module to indicate that the current firmware upgrade has failed, and the original firmware content in the board module continues to run.

[0258] Step 708: The firmware upgrade is completed.

[0259] The key to the upgrade lies in whether the board can establish a link with the host. This application uses the second-stage firmware to initialize PCIe to complete the link between the board and the host. At this time, the host can initiate an update to update the current stage (second stage) firmware, or it can update the third stage firmware.

[0260] The firmware upgrade module provided in the embodiment of the present application divides the memory in the board module into multiple firmware partitions, so that different program functions are executed in different firmware partitions, so that the partitions do not interfere with each other. When a problem occurs in one of the firmware partitions, it will not affect the program operation in other firmware partitions, thereby ensuring that the board template will not be completely paralyzed due to a problem in one firmware partition, improving the efficiency of firmware upgrades, and ensuring the maintainability of the entire system.

[0261] The board firmware online upgrade method and device of the present application utilizes the functions and mechanisms of the firmware at different stages to ensure that the board and the host are linked, thereby loading the firmware from the host side through the network, and storing the firmware in the storage area through the controller of the host configuration storage device for online upgrade. It not only simplifies the upgrade steps, but also enables the recovery and repeated burning of firmware, improves the maintainability and compatibility of the firmware, and ensures the reliability of the upgrade. Moreover, in scenarios with a large number of devices, this method can uniformly load the firmware and configure the storage device on the host side, greatly saving the loss of personnel when restoring the equipment, reducing the workload, and reducing maintenance costs.

[0262] It should be noted that the method provided in the above embodiment and the embodiment of the firmware upgrade module belong to the same concept, and the specific implementation process is detailed in the embodiment of the firmware upgrade module, which will not be repeated here. For the beneficial effects of the above method embodiment, please refer to the description of the firmware upgrade module embodiment, which will not be repeated here.

[0263] In an exemplary embodiment, a chip is also provided, which includes at least one of a programmable logic circuit and a program instruction (also referred to as a programmable logic circuit and / or a program instruction). When the chip runs on a computer device, it is used to implement the data processing method described in the above aspects.

[0264] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0265] The above is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. The present application embodiment also provides an electronic device, which includes a firmware upgrade module as described above. Optionally, the electronic device includes a chip, which includes a memory and a firmware upgrade module. The firmware upgrade module is used to manage the storage space of the memory using the solution provided in the above embodiment.

[0266] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0267] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent switching, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A firmware upgrade module, characterized in that: The firmware upgrade module includes: a board module and a host module; the board module includes a memory, the memory is divided into a plurality of firmware partitions, and the plurality of firmware partitions include a first firmware partition and a second firmware partition; The first firmware partition is used to store a first link program, and the first link program is a program fixedly stored in the first firmware partition; The second firmware partition is used to store a second link program and first firmware content, the second link program is used to establish a bus connection between the board module and the host module, and the first firmware content is used to run the module function of the board module.

2. The firmware upgrade module according to claim 1, characterized in that: In response to the second linking program failing to link, the first firmware partition is further used to establish a bus connection between the board module and the host module through the first linking program.

3. The firmware upgrade module according to claim 2, characterized in that: The first firmware partition is further used to detect the connection status of the bus connection at a specified time interval through the first link program; In response to the connection status meeting the link failure condition, it is determined that the second link program has failed to link, and the first firmware partition is further used to establish a bus connection between the board module and the host module through the first link program.

4. The firmware upgrade module according to any one of claims 1 to 3, characterized in that: The board module also includes a register; The second firmware partition is further used to rewrite the configuration state corresponding to the register through the second link program to obtain a first configuration result; In response to the first configuration result meeting a link success condition, it is determined to establish the bus connection between the board module and the host module.

5. The firmware upgrade module according to claim 4, characterized in that: In response to the first configuration result meeting the link failure condition, the first firmware partition is further used to adjust the configuration state corresponding to the register through the first link program to obtain a second configuration result.

6. The firmware upgrade module according to any one of claims 1 to 3, characterized in that: The second firmware partition also includes a first firmware sub-partition and a second firmware sub-partition; The first firmware sub-partition is used to store the second link program; The second firmware sub-partition is used to store the first firmware content; The first sub-firmware partition is also used to establish a bus connection between the board module and the host module through the second link program.

7. The firmware upgrade module according to claim 6, characterized in that: In response to the second linking program being successfully linked and the second firmware sub-partition requiring an update, the host module is further configured to perform a firmware update on the first firmware content.

8. The firmware upgrade module according to claim 6, characterized in that: The first firmware partition is further used to perform signature verification on the second link program through the first link program to obtain a signature verification result; In response to the signature verification result meeting the verification success condition, the first firmware sub-partition is further used to establish a bus connection between the board module and the host module through the second link program.

9. The firmware upgrade module according to claim 7, characterized in that: In response to the signature verification result meeting the verification failure condition, the first firmware partition is further used to establish a bus connection between the board module and the host module through the first link program.

10. The firmware upgrade module according to claim 4, characterized in that: The board module also includes an intermediate storage medium and a controller; The host module is used to write the second firmware content into the intermediate storage medium, the second firmware content is used to replace the first firmware content to update the second firmware partition, and the intermediate storage medium is used to temporarily store the second firmware content; The host module is further used to configure the mode of the register through a bus; in response to configuring a write mode for the controller, the controller is started, and the write mode is used to write the second firmware content into the second firmware partition.

11. The firmware upgrade module according to claim 10, characterized in that: The board module also includes a direct access memory; The controller is further configured to move the second firmware content from the intermediate storage medium to the direct access memory; The direct access memory is also used to write the second firmware content into the second firmware partition in the memory.

12. A firmware upgrade method, characterized in that: The method is applied to a board module, wherein the board module includes a memory, wherein the memory is divided into a plurality of firmware partitions, wherein the plurality of firmware partitions include a first firmware partition and a second firmware partition, wherein the first firmware partition stores a first link program, and wherein the second firmware partition stores a second link program and first firmware content, wherein the method includes: Starting the second link program through the second firmware partition to establish a bus connection between the board module and the host module; In response to the second linking program failing to link, the first linking program is started through the first firmware partition to establish a bus connection between the board module and the host module.

13. A chip, characterized in that: The chip includes a memory and a firmware upgrade module as described in any one of claims 1 to 11.

14. A processor, characterized in that: The processor includes a firmware upgrade module as described in any one of claims 1 to 11.

15. An electronic device, characterized in that: The electronic device comprises the firmware upgrade module as described in any one of claims 1 to 11.