Firmware remote upgrading method for BMC chip
Technical Field
The invention relates to the technical field of IP core design and firmware upgrading, in particular to a firmware remote upgrading method for a BMC chip.
Background
The application range of the multi-path server is more and more extensive in the current society, the stability is good, the safety degree is high, and the operation efficiency is high, so that the multi-path server is accepted by the society. Most companies are using servers and some companies are using a large number. If the upgrading work of the BMC (baseboard Management controller) firmware of the multi-path server is needed, the upgrading work can be carried out locally or remotely. If the server adopts remote update, especially the network bandwidth of the server location is low, which brings the problem of server update efficiency. Especially in the case of large firmware files, but the firmware is only partially modified, the update efficiency will be low.
In the existing remote upgrading technology of server BMC firmware, a CS structure is generally adopted. The Server is a database, and the Client is a BMC chip of the Server. And if the BMC firmware needs to be updated, downloading the firmware from the local database to a BMC chip of the remote server, and operating the BMC firmware automatic updating system in the remote server. The remote server is connected with the monitoring terminal equipment and the database through a network.
The BMC firmware automatic updating system comprises: the setting module is used for starting the BMC automatic updating function of the server according to the BMC updating instruction and setting a monitoring time period of a monitoring dog through an operating system of the server; the monitoring module is used for starting the monitoring dog to time the monitoring time period, judging whether the monitoring time period of the monitoring dog is ended or not, and resetting the monitoring time period to be an initial value when the monitoring time period is ended; and the updating module is used for judging whether the current BMC firmware in the memory of the BMC chip needs to be updated or not, downloading the latest version of BMC firmware data from the database when the current BMC firmware in the memory needs to be updated, and automatically updating the latest version of BMC firmware data into a corresponding storage area of the memory of the BMC chip.
In the existing firmware upgrading process of the BMC chip, two modes of remotely or locally refreshing the firmware are generally adopted. In both of these approaches, uncompressed original images are generally used, resulting in huge data files. Under the condition of remotely updating the firmware, the resource is greatly wasted, and the updating efficiency is low. Especially, under the condition that the firmware update is only partial modification or minimal function modification, the update efficiency and the update idea are more low and lagged. In addition, an unencrypted image has an insecure factor.
Based on the situation, the invention designs a firmware remote upgrading method facing the BMC chip.
Disclosure of Invention
In order to make up for the defects of the prior art, the invention provides a simple and efficient firmware remote upgrading method for a BMC chip.
The invention is realized by the following technical scheme:
a firmware remote upgrading method facing a BMC chip is characterized in that: firstly, a firmware remote upgrading system is constructed, wherein the system adopts a CS structure and comprises a BMC (baseboard management controller) chip and a local mirror database, and the BMC chip is connected with the local mirror database through a network; the BMC chip adopts an ARM processor, the ARM processor is connected with an interface control logic module and a mirror image decompression and reconstruction logic module, and the interface control logic module is connected with a FLASH memory and a receiving cache; the local mirror database is configured with a mirror image decomposition and compression algorithm module and a mirror image database module.
The mirror image decompression and reconstruction logic module comprises a processor control unit, a decoding state machine, an original mirror image input fifo unit and an updated mirror image output fifo unit; the processor control unit is connected with the original mirror image input fifo unit and the updated mirror image output fifo unit; the processor control unit is connected to the ARM processor, and the original mirror image input fifo unit and the updated mirror image output fifo unit are both connected to the interface control logic module.
The image decomposition and compression algorithm module is used for comparing two versions of image data, searching, and generating an incremental file by means of difference of the two versions of image data.
The method comprises the steps that a mirror image decompression and reconstruction logic module is added in a BMC chip, and a mirror image decomposition and compression algorithm module is added in a local mirror database, so that quick transmission and encrypted transmission of an incremental firmware mirror image are realized; the method comprises four steps of transmission preparation, data decompression and reconstruction, firmware updating and updating quitting.
The firmware remote upgrading method facing the BMC chip comprises the following steps:
(1) preparation for transmission
The image decomposition and compression algorithm module analyzes image difference to generate an incremental file, and then sends an image transmission preparation command to the image decompression and reconstruction logic module through a network; after receiving the command, the mirror image decompression and reconstruction logic module sends an interrupt to the ARM processor, so that the ARM processor enters a refresh processing interrupt, enters an idle cycle, and abandons the operation on the FLASH memory; the mirror image decompression and reconstruction logic module takes over the operation of the FLASH memory, saves the updated parameters and enters a firmware refreshing process;
(2) data decompression and reconstruction
The mirror image decompression and reconstruction logic module receives the message and analyzes the message action, reads the original mirror image data, reconstructs the updated mirror image data, and outputs the data to the mirror image receiving cache. If the data is uncompressed data, erasing the FLASH memory and writing the data into the FLASH memory;
(3) updating firmware
The mirror image decompression and reconstruction logic module carries out erasing FLASH memory operation and updates the received cached data to the address block corresponding to the FLASH memory;
(4) exiting the update
And after the image decompression and reconstruction logic module finishes updating the address block corresponding to the last FLASH memory, abandoning the take-over of the FLASH memory, sending a reset signal to the ARM processor, and resetting the ARM processor to restart a new image.
In the step (1), the upgraded parameters include an Opcode parameter, a Compress parameter, a Version parameter, a RESERVE parameter, an Ecc parameter, a Data parameter, a Tran _ Num parameter, and a Len parameter.
The Opcode parameter is message encoding, 0000 represents transmission start, 1111 represents transmission end, 0001 represents single-byte modification, 0010 represents multi-byte modification, 0011 represents single-byte addition, 0100 represents multi-byte addition, 0101 represents multi-byte deletion, and 0110 represents sequential reading of multiple bytes;
the compression parameter is a compression flag, 000 represents uncompressed and 001 represents incremental compression;
the Version parameter is a mirror Version number, the RESERVE parameter is a reserved bit, the Ecc parameter is a check bit, the Data parameter is a Data bit, the Tran _ Num parameter is the number of bytes needing to be transmitted, and the Len parameter is the number of bytes contained in the message.
In the step (2), the messages include a flow control message, a short data control message and a long data control message.
The invention has the beneficial effects that: the firmware remote upgrading method facing the BMC chip can realize rapid transmission of the incremental firmware image, and the upgraded image can be recovered without a complete image; the method is particularly suitable for the remote mirror image updating under the condition that the firmware updating is only partial modification or minimal function modification, can save a large amount of network transmission time, and improves the refreshing efficiency.
Drawings
Fig. 1 is a schematic diagram of a firmware remote upgrade system oriented to a BMC chip according to the present invention.
FIG. 2 is a schematic diagram of a mirror decompression and reconstruction logic module according to the present invention.
FIG. 3 is a schematic diagram of a firmware remote upgrade method for a BMC chip according to the present invention.
Fig. 4 is a message format diagram of the flow control message of the present invention.
Fig. 5 is a message format diagram of the short data control message of the present invention.
Fig. 6 is a message format diagram of a long data control message according to the present invention.
Fig. 7 is a message format diagram of the flow control message of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention more clearly apparent, the present invention is described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the specific embodiments described herein are only for explaining the present invention and are not used to limit the present invention.
The firmware remote upgrading method for the BMC chip comprises the steps of firstly, constructing a firmware remote upgrading system, wherein the system adopts a CS structure and comprises the BMC chip and a local mirror database, and the BMC chip is connected with the local mirror database through a network; the BMC chip adopts an ARM processor, the ARM processor is connected with an interface control logic module and a mirror image decompression and reconstruction logic module, and the interface control logic module is connected with a FLASH memory and a receiving cache; the local mirror database is configured with a mirror image decomposition and compression algorithm module and a mirror image database module.
The mirror image decompression and reconstruction logic module comprises a processor control unit, a decoding state machine, an original mirror image input fifo unit and an updated mirror image output fifo unit; the processor control unit is connected with the original mirror image input fifo unit and the updated mirror image output fifo unit; the processor control unit is connected to the ARM processor, and the original mirror image input fifo unit and the updated mirror image output fifo unit are both connected to the interface control logic module.
The image decomposition and compression algorithm module is used for comparing two versions of image data, searching, and generating an incremental file by means of difference of the two versions of image data.
According to the firmware remote upgrading method facing the BMC chip, the mirror image decompression and reconstruction logic module is added in the BMC chip, and the mirror image decomposition and compression algorithm module is added in the local mirror image database, so that the quick transmission and encryption transmission of the incremental firmware mirror image are realized; the method comprises four steps of transmission preparation, data decompression and reconstruction, firmware updating and updating quitting.
The method specifically comprises the following steps:
(1) preparation for transmission
The image decomposition and compression algorithm module analyzes image difference to generate an incremental file, and then sends an image transmission preparation command to the image decompression and reconstruction logic module through a network; after receiving the command, the mirror image decompression and reconstruction logic module sends an interrupt to the ARM processor, so that the ARM processor enters a refresh processing interrupt, enters an idle cycle, and abandons the operation on the FLASH memory; the mirror image decompression and reconstruction logic module takes over the operation of the FLASH memory, saves the updated parameters and enters a firmware refreshing process;
(2) data decompression and reconstruction
The mirror image decompression and reconstruction logic module receives the message and analyzes the message action, reads the original mirror image data, reconstructs the updated mirror image data, and outputs the data to the mirror image receiving cache. If the data is uncompressed data, erasing the FLASH memory and writing the data into the FLASH memory;
(3) updating firmware
The mirror image decompression and reconstruction logic module carries out erasing FLASH memory operation and updates the received cached data to the address block corresponding to the FLASH memory;
(4) exiting the update
And after the image decompression and reconstruction logic module finishes updating the address block corresponding to the last FLASH memory, abandoning the take-over of the FLASH memory, sending a reset signal to the ARM processor, and resetting the ARM processor to restart a new image.
In the step (1), the upgraded parameters include an Opcode parameter (message encoding. 0000: start transmission; 1111: end transmission; 0001 one byte modification; 0010: multiple byte modification; 0011 one byte addition; 0100: multiple byte addition; 0101: multiple byte deletion; 0110: sequentially reading multiple bytes), a compression parameter (compression flag. 000: uncompressed; 001: incremental compression), a Version parameter (mirror image), a RESERVE parameter (Version number reserved bit), an Ecc parameter (check bit), a Data parameter (Data bit), a Tran _ Num parameter (number of bytes required to be transmitted), and a Len parameter (number of bytes contained in the present message).
In the step (2), the messages include a flow control message, a short data control message and a long data control message.
The firmware remote upgrading system facing the BMC chip can select different network transmission modes and support 2 uncompressed and compressed transmission modes. And the mirror image decompression and reconstruction logic module and the mirror image decomposition and compression algorithm module are transmitted according to a specified transmission protocol.
The transmission protocol comprises two types of messages, namely a control message and a data message, wherein the length of the control message is 32 bits and is divided into a flow control message, a short data control message and a long data control message. The message formats are shown in fig. 4-fig. 7, respectively.
TABLE 1 mirror decompression and reconfiguration logic module state description table