Firmware upgrading method and equipment for complex programmable logic device (CPLD)
Through the parallel upgrade method and dynamic interface management, the problem of long firmware upgrade time for multiple CPLDs is solved, a more efficient upgrade process is achieved, and the upgrade efficiency and reliability of CPLDs are improved.
Patent Information
- Application Number
- CN202410532864.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, the firmware upgrade process of multiple complex programmable logic devices CPLD needs to be performed sequentially, resulting in a linear increase in upgrade time with the number of CPLDs and low efficiency.
Adopting a parallel upgrade method, by acquiring multiple upgrade data sets and dynamically switching CPLD interfaces, the upgrade data sets are sent one by one to avoid waiting for the flashing to be completed. The interface transmission frequency and data length are used to optimize the sending order and waiting time to ensure that each CPLD is in order. Receive and process data.
It shortens the total upgrade time of multiple CPLDs, improves the efficiency of firmware upgrades, and improves the reliability and flexibility of parallel upgrades of multiple CPLDs.
Smart Images

Figure CN118567674A
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a method and device for upgrading the firmware of a complex programmable logic device (CPLD). Background Art
[0002] Complex programmable logic devices (CPLDs) are usually used to implement the control functions of various hardware components. For example, the functions implemented by CPLDs on the motherboard of computing devices include power on and off control, central processing unit (CPU) fault monitoring, etc. With the continuous development of computing device software / hardware technology, the logic implemented by CPLDs is becoming more and more complex, and one CPLD can no longer carry all the required logic. Therefore, many computing device motherboards will have multiple CPLDs to implement complex logic.
[0003] At present, when computing devices perform firmware upgrades on multiple CPLDs, they use a sequential upgrade method. Specifically, after all the upgrade data of a CPLD firmware is completely flashed, the next CPLD firmware is upgraded. Therefore, when upgrading multiple CPLD firmwares, the time required to upgrade all CPLD firmwares increases linearly with the number of CPLD firmwares to be upgraded, resulting in a long upgrade time and low upgrade efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method and device for upgrading the firmware of a complex programmable logic device (CPLD), which can shorten the total upgrade time of multiple CPLDs and improve the efficiency of upgrading the firmware of multiple CPLDs.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a method for upgrading the firmware of a complex programmable logic device (CPLD) is provided, which is applied to a computing device, wherein the computing device includes a plurality of complex programmable logic devices (CPLDs), the CPLDs including an interface for receiving upgrade data, and at the same time, the interface of at most one CPLD on the computing device is in an open state; the method includes: acquiring a plurality of upgrade data sets, an upgrade data set including at least a portion of the upgrade data of each target CPLD in a plurality of target CPLDs; the upgrade data of the CPLD is data of a new version of firmware; the upgrade data of each target CPLD in a first upgrade data set is sent to each target CPLD in turn, the first upgrade data set being any one of the plurality of upgrade data sets; each target CPLD is used for upgrading the firmware based on the received upgrade data.
[0007] During the upgrade process of multiple CPLDs, at most one CPLD interface is in the open state at the same time, that is, during the upgrade process of multiple CPLDs, upgrade data can only be sent to one CPLD at the same time. Considering that in the related art, multiple CPLDs are upgraded sequentially, after sending a part of the upgrade data to each CPLD, it is necessary to wait for the CPLD to flash the part of the upgrade data. When all the upgrade data of a CPLD are flashed to the CPLD, the next CPLD is upgraded, which causes the upgrade process of multiple CPLDs to be time-consuming. Therefore, in this solution, at least a part of the upgrade data of multiple target CPLDs in the upgrade data set is sent to each target CPLD in turn. In the process of sending multiple upgrade data in an upgrade data set, there is no wait for the target CPLD to complete the flashing of the corresponding upgrade data. The method of sequentially upgrading multiple CPLDs is replaced by the method of parallelly upgrading multiple CPLDs. The time spent on sending the upgrade data to the target CPLD is used to reduce the time waiting for the target CPLD to flash the upgrade data, thereby shortening the total upgrade time of multiple target CPLDs and improving the firmware upgrade efficiency of multiple target CPLDs.
[0008] In a possible implementation, when multiple upgrade data sets are obtained based on upgrade data of at least two target CPLDs, the method also includes: when the sending of the first upgrade data set is completed, waiting; when the waiting time reaches a preset time, sending the upgrade data of each target CPLD in the second upgrade data set to each target CPLD in turn; wherein the preset time is determined based on the data writing time corresponding to each target CPLD, and the data writing time refers to the time required for the target CPLD to write the upgrade data in the first upgrade data set.
[0009] In this implementation, when the sending of the first upgrade data set is completed, a preset time is waited, and the second upgrade data set is sent only after all the upgrade data in the first upgrade data set are flushed to the corresponding target CPLD, thereby ensuring that each target CPLD has enough time to flush the upgrade data, thereby avoiding the situation where the target CPLD has not yet completed flushing the upgrade data in the first upgrade data set but has received the upgrade data in the second upgrade data set. By waiting for the preset time, the upgrade process of multiple target CPLDs is made more orderly, thereby enhancing the reliability of upgrading multiple target CPLDs.
[0010] In a possible implementation, multiple upgrade data sets are obtained, including: obtaining complete upgrade data for each target CPLD; dividing the complete upgrade data for each target CPLD into multiple upgrade sub-data, wherein the data length of the upgrade sub-data is the maximum data length that can be processed by the target CPLD; and grouping the upgrade sub-data to obtain multiple upgrade data sets.
[0011] In this implementation, taking into account the data processing capability of the target CPLD, when the data length of the complete upgrade data of the target CPLD is large, the complete upgrade data can be divided into multiple upgrade sub-data to ensure that the target CPLD is capable of processing the received upgrade data and avoid the data length of the upgrade sub-data exceeding the maximum data length that the target CPLD can process, thereby causing the target CPLD to make errors when processing the upgrade data. At the same time, the data length of the upgrade sub-data is set to the maximum data length that the target CPLD can process, thereby maximizing the use of the data processing capability of the target CPLD and improving the upgrade efficiency of the target CPLD.
[0012] In a possible implementation, the upgrade data of each target CPLD in the first upgrade data set is sent to each target CPLD in sequence, including: determining the first CPLD, switching the interface of the first CPLD to an on state, the first CPLD being one of multiple target CPLDs; sending the upgrade data of the first CPLD to the first CPLD; when the sending of the upgrade data to the first CPLD is completed, determining the second CPLD, switching the interface of the second CPLD to an on state, the second CPLD being another of the multiple target CPLDs; sending the upgrade data of the second CPLD to the second CPLD until the sending of the upgrade data to all target CPLDs is completed.
[0013] In this implementation, by dynamically switching the interface of the target CPLD, the transmission order of the upgrade data in the first upgrade data set is ensured, ensuring that each target CPLD can receive the corresponding upgrade data in order, thereby improving the reliability of the CPLD firmware upgrade.
[0014] In a possible implementation manner, the upgrade data belonging to the first CPLD in the first upgrade data set has the largest data length.
[0015] In this implementation, considering that the upgrade data with the largest data length takes the longest time to send to the corresponding target CPLD, the upgrade data with the largest data length in the first upgrade data set is preferentially sent to the corresponding target CPLD, so that the upgrade data with the largest data length is upgraded first, ensuring that the target CPLD has completed the flashing of the upgrade data with the largest data length when receiving the next upgrade data set.
[0016] In a possible implementation, the method also includes: calculating the sending duration of each upgrade data in the first upgrade data set except the upgrade data with the largest data length, the sending duration refers to the time required to send the upgrade data to the target CPLD; obtaining the data write duration of the upgrade data with the largest data length; based on the data write duration of the upgrade data with the largest data length, and the sending duration of each upgrade data except the upgrade data with the largest data length, calculate the preset duration.
[0017] In this implementation, considering that the process of sending the upgrade data to the target CPLD takes time, when determining the preset duration, the time required for the first CPLD to complete the data flash can be determined based on the time required to send all the upgrade data except the upgrade data with the largest data length. It can be seen that the preset duration is shorter than the data flash duration in the related art, thereby shortening the time consumed for the actual flashing of the target CPLD.
[0018] In a possible implementation, calculating the sending duration of the upgrade data other than the upgrade data with the largest data length in the first upgrade data set includes: acquiring the transmission data frequency of the interface of the target CPLD; and determining the sending duration based on the ratio of the data length of the upgrade data to the transmission data frequency.
[0019] In this implementation, by obtaining the transmission data frequency of the interface of the target CPLD and determining the sending duration based on the ratio of the data length of the upgrade data and the transmission data frequency, the preset waiting time can be dynamically adjusted according to the transmission capacity of the interface, thereby improving the flexibility and reliability of the CPLD firmware upgrade.
[0020] In one possible implementation, the preset duration is calculated based on the data writing duration of the upgrade data with the largest data length and the sending duration of each upgrade data except the upgrade data with the largest data length, including: summing up the sending durations to obtain the total sending duration; subtracting the data writing duration from the total sending duration to obtain the preset duration.
[0021] In this implementation, when the first CPLD receives the upgrade data and starts to flash, the upgrade data is sent to other target CPLDs in turn. The target CPLD is flashed with the upgrade data and the upgrade data is sent to the target CPLD at the same time. The data flashing time is subtracted from the time consumed in sending the upgrade data to other target CPLDs, thereby shortening the actual waiting time of the first CPLD. The actual waiting time of other target CPLDs is similar to that of the first CPLD and is also shortened, which will not be elaborated here. Therefore, the total upgrade time of multiple target CPLDs is shortened and the upgrade efficiency of multiple target CPLDs is improved.
[0022] In a possible implementation, the method also includes: obtaining a target upgrade configuration file; the target upgrade configuration file includes multiple I / O instruction groups, one I / O instruction group includes multiple I / O instructions, and different I / O instructions correspond to different target CPLDs; the I / O instructions are used to send at least a portion of the upgrade data of the target CPLD to the corresponding target CPLD; the upgrade data of each target CPLD in the first upgrade data set are sent to each target CPLD in sequence, including: executing multiple I / O instructions in the first I / O instruction group in sequence, and the multiple I / O instructions in the first I / O instruction group are respectively used to send the upgrade data of each target CPLD in the first upgrade data set.
[0023] In this implementation, an I / O instruction is used to send at least a portion of the corresponding upgrade data to the target CPLD, and the I / O instructions corresponding to different target CPLDs are executed in sequence. In the process of executing multiple I / O instructions to send multiple upgrade data, there is no waiting for the target CPLD to complete the flashing of the corresponding upgrade data. The time consumed in executing the I / O instructions is used to reduce the time waiting for the target CPLD to flash the upgrade data, thereby shortening the total upgrade time of multiple target CPLDs and improving the firmware upgrade efficiency of multiple target CPLDs.
[0024] In one possible implementation, the target upgrade configuration file also includes at least one delay instruction, and a delay instruction is configured to be executed between two I / O instruction groups; when the sending of the first upgrade data set is completed, waiting includes: when the execution of multiple I / O instructions in the first I / O instruction group is completed, executing the first delay instruction, and the first delay instruction is used to indicate waiting for a preset time; when the waiting time reaches the preset time, sending the upgrade data of each target CPLD in the second upgrade data set to each target CPLD in turn, including: when the execution of the first delay instruction is completed, executing multiple I / O instructions in the second I / O instruction group in turn, and the multiple I / O instructions in the second I / O instruction group are respectively used to send the upgrade data of each target CPLD in the second upgrade data set.
[0025] In this implementation, when multiple I / O instructions in the first I / O instruction group are executed, the first delay instruction is used to instruct to wait for a preset time. After the first delay instruction is executed, each I / O instruction in the second I / O instruction group is executed in sequence, ensuring that each target CPLD has enough time to flash the upgrade data, avoiding the situation where the target CPLD has not yet completed flashing the upgrade data in the first upgrade data set but has received the upgrade data in the second upgrade data set, making the upgrade process of multiple target CPLDs more orderly and improving the upgrade efficiency of multiple target CPLDs.
[0026] In one possible implementation, obtaining a target upgrade configuration file includes: obtaining an upgrade configuration file of each target CPLD, wherein an upgrade configuration file of a target CPLD includes multiple I / O instructions corresponding to the target CPLD; merging the multiple I / O instructions corresponding to each target CPLD to obtain multiple I / O instruction groups; and obtaining a target upgrade configuration file based on the multiple I / O instruction groups.
[0027] In this implementation, an I / O instruction corresponds to a part of the upgrade file of the target CPLD, and multiple I / O instructions of multiple target CPLDs are merged to obtain multiple I / O instruction groups. The sequential upgrade method of COLD in the related technology is changed to a parallel upgrade method of CPLD, shortening the upgrade time of multiple CPLDs.
[0028] In one possible implementation, a target upgrade configuration file is obtained based on multiple I / O instruction groups, including: obtaining at least one delay instruction based on the multiple I / O instruction groups; generating a target upgrade configuration file including multiple I / O instruction groups and at least one delay instruction, wherein one delay instruction is configured to be executed between two I / O instruction groups.
[0029] In this implementation, one delay instruction corresponds to multiple I / O instructions. The time for executing the I / O instructions is used to reduce the execution time of the delay instructions, shorten the total upgrade time of multiple target CPLDs, and improve the firmware upgrade efficiency of multiple target CPLDs.
[0030] In a second aspect, a firmware upgrade device for a complex programmable logic device CPLD is provided, the device comprising: a functional unit for executing any one of the methods provided in the first aspect, the actions executed by each functional unit are implemented by hardware or by hardware executing corresponding software. For example, the firmware upgrade device for a complex programmable logic device CPLD may include: a first acquisition unit and a sending unit; the first acquisition unit is used to acquire multiple upgrade data sets, one upgrade data set includes at least a portion of upgrade data of each target CPLD in multiple target CPLDs; the upgrade data of the CPLD is data of a new version of the firmware; the first sending unit is used to send the upgrade data of each target CPLD in the first upgrade data set to each target CPLD in sequence, the first upgrade data set is any one of the multiple upgrade data sets; each target CPLD is used to perform a firmware upgrade based on the received upgrade data.
[0031] In a third aspect, a computer device is provided, comprising: a processor and a memory, wherein the processor is connected to the memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the first aspect.
[0032] In a fourth aspect, a chip is provided, the chip comprising: a processor and an interface circuit; the interface circuit is used to receive code instructions and transmit them to the processor; the processor is used to run the code instructions to execute any one of the methods provided in the first aspect above.
[0033] In a fifth aspect, a computer-readable storage medium is provided, which stores computer execution instructions. When the computer execution instructions are executed on a computer, the computer executes any one of the methods provided in the first aspect.
[0034] In a sixth aspect, a computer program product is provided, comprising computer execution instructions, which, when executed on a computer, enable the computer to execute any one of the methods provided in the first aspect.
[0035] Among them, the technical effects brought about by any implementation method in the second to sixth aspects can refer to the technical effects brought about by different implementation methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 An application scenario diagram of a firmware upgrade method for a complex programmable logic device CPLD provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of a BMC sequentially upgrading multiple CPLDs provided in an embodiment of the present application;
[0038] Figure 3 Another schematic diagram of a BMC sequentially upgrading multiple CPLDs provided in an embodiment of the present application;
[0039] Figure 4 A system architecture diagram of a computing device provided in an embodiment of the present application;
[0040] Figure 5 A flowchart of a method for upgrading the firmware of a complex programmable logic device (CPLD) provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of two upgrade data sets acquired by the BMC provided in an embodiment of the present application;
[0042] Figure 7 A schematic diagram of a first upgrade data set provided in an embodiment of the present application being written into target CPLD1, target CPLD2, and target CPLD3;
[0043] Figure 8 A schematic diagram of a firmware upgrade method for a complex programmable logic device CPLD provided in an embodiment of the present application;
[0044] Fig. 9A flowchart of obtaining multiple upgrade data sets provided in an embodiment of the present application;
[0045] Fig.10 A flowchart for determining a preset duration provided in an embodiment of the present application;
[0046] Fig.11 A flowchart for implementing upgrades of multiple target CPLDs based on a target upgrade configuration file provided in an embodiment of the present application;
[0047] Fig.12 A schematic diagram of a target upgrade configuration file provided in an embodiment of the present application;
[0048] Fig.13 A schematic diagram of a firmware upgrade device for a complex programmable logic device (CPLD) provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0050] In the description of this application, unless otherwise specified, " / " indicates that the objects associated with each other are in an "or" relationship, for example, A / B can represent A or B; "and / or" in this application is merely a description of the association relationship between associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0051] Furthermore, in the description of this application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0052] In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0053] The following is an introduction to the terms involved in the embodiments of the present application.
[0054] Firmware: It is software embedded in hardware devices, which provides basic functions and control logic of the device and is an essential component for the normal operation of the hardware device.
[0055] I / O instruction: During the CPLD upgrade process, it is used to instruct the sending of upgrade data to the CPLD.
[0056] Data transmission frequency: refers to the number of pulses transmitted by the interface per unit time.
[0057] First, the application scenarios of the embodiments of the present application are exemplarily introduced.
[0058] With the continuous development of computing device software and hardware technology, the logic implemented by CPLD is becoming more and more complex. One CPLD can no longer carry all the required logic. Therefore, many computing device motherboards have multiple CPLDs to implement complex logic.
[0059] like Figure 1As shown, the computing device includes a baseboard management controller (BMC) and multiple CPLDs. The BMC and each CPLD include a test data input (TDI) interface, a test data output (TDO) interface, a test mode select (TMS) interface, and a test clock (TCK) interface. The BMC and multiple CPLDs are linked in a joint test action group (JTAG) daisy chain manner. Specifically, the test data input (TDI) interface and the test data output (TDO) interface of the BMC and each CPLD are cascaded in sequence to form a JTAG daisy chain structure. Among them, the TDI interface and the TDO interface are used to transmit data between the BMC and each CPLD, such as: upgrade data for upgrading the CPLD firmware. The TMS interface of the BMC is connected to the TMS interface of each CPLD. The TCK interface of the BMC is connected to the TCK interface of each CPLD. The TMS interface is used for the BMC to control the TDI interface state of the CPLD. The TDI interface status includes the open state and the closed state. Only when the TDI interface of the CPLD is in the open state can it receive the upgrade data sent by the BMC. The TCK interface is used to synchronize the clock between the BMC and each CPLD.
[0060] In the JTAG daisy chain structure, the BMC sends upgrade data to the TDI interface of the CPLD through its own TDI interface, and each CPLD receives its own upgrade data through its own TDI interface. When the BMC is upgrading the firmware of multiple CPLDs, only one CPLD's TDI interface can be in the open state at the same time. For example, when the TDI interface of CPLD0 is in the closed state, the upgrade data sent by the BMC will be transmitted from the TDO interface of CPLD0 to the TDI interface of CPLD1, and will not be received by CPLD0.
[0061] Usually, the BMC completes the firmware upgrade of the CPLD by executing the instructions in the upgrade configuration file based on the upgrade configuration file of the CPLD. Among them, the upgrade configuration file of the CPLD usually includes three instructions that the BMC needs to execute, specifically including: configuration instructions, I / O instructions and delay instructions, among which the configuration instructions are used to open the TDI interface of the target CPLD, the I / O instructions are used to send the upgrade data of the target CPLD to the target CPLD, and the delay instructions are used to wait for the target CPLD to finish flashing the upgrade data after the BMC has sent the upgrade data to the target CPLD.
[0062] In related technologies, such as Figure 2 As shown in the figure, taking the BMC upgrading two CPLDs as an example, when BMC upgrades CPLD1 and CPLD2, it adopts a sequential upgrade method. First, BMC opens the TDI interface of CPLD1, sends the upgrade data of CPLD1 to the TDI interface of CPLD1, and upgrades CPLD1; after the upgrade of CPLD1 is completed, CPLD2 is upgraded. In the process of upgrading CPLD1, due to the limited data processing capability of CPLD1, the complete upgrade data of CPLD1 is often divided into multiple upgrade sub-data. BMC sends multiple upgrade sub-data to CPLD1 in sequence. After each upgrade sub-data is sent, BMC will wait for CPLD1 to complete the flashing of the upgrade sub-data until the complete upgrade data is flashed to CPLD1 and the upgrade of CPLD1 is completed.
[0063] Specifically, if Figure 3 As shown, the BMC first turns on the TDI interface of CPLD1 through configuration instructions, and then sends multiple upgrade sub-data to CPLD1 by executing multiple I / O instructions. Among them, each time an I / O instruction is completed, a delay instruction is executed to wait for CPLD1 to complete the flashing of the upgrade sub-data. After CPLD1 finishes flashing the upgrade sub-data, the next I / O instruction and the next delay instruction are continued to enable CPLD1 to complete the flashing of the next upgrade sub-data. After all the upgrade data of CPLD1 are flashed, CPLD2 is upgraded. It can be seen from this that when the BMC upgrades multiple CPLDs, the total upgrade time increases linearly with the number of CPLDs, and the upgrade efficiency of multiple CPLDs is low.
[0064] In view of this, an embodiment of the present application provides a method for upgrading the firmware of a complex programmable logic device (CPLD), which is applied to upgrading the firmware of multiple CPLDs in a computing device, wherein each CPLD includes an interface for receiving upgrade data, such as a TDI interface; at the same time, the interface of at most one CPLD on the computing device is in an open state. In this scenario, for multiple target CPLDs to be upgraded, the upgrade process of each target CPLD is divided into multiple sub-processes, and the multiple sub-processes corresponding to different target CPLDs are executed in series, thereby realizing the parallel upgrade of multiple target CPLDs as a whole, and improving the upgrade efficiency of multiple target CPLDs.
[0065] Among them, the sub-process of any target CPLD is mainly a process of sending partial upgrade data to the target CPLD and flashing the partial upgrade data to the target CPLD. Since the sub-processes corresponding to different target CPLDs are executed serially, after sending partial upgrade data to the i-th target CPLD, the partial upgrade data can be sent to the i+1-th target CPLD immediately without waiting for the i-th target CPLD to flash its partial upgrade data. In the process of sending partial upgrade data to the i+1-th target CPLD, the i-th target CPLD flashes partial upgrade data at the same time, thereby reducing the upgrade time of multiple target CPLDs as a whole.
[0066] In some embodiments, in the firmware upgrade method provided by the embodiment of the present application, multiple upgrade data sets are first obtained, and one upgrade data set includes at least a portion of the upgrade data of each target CPLD in multiple target CPLDs; the upgrade data of the CPLD is the data of the new version of the firmware. Then, the upgrade data of each target CPLD in the first upgrade data set is sent to each target CPLD in turn, wherein the first upgrade data set is any one of the multiple upgrade data sets; each target CPLD is used to perform a firmware upgrade based on the received upgrade data. The firmware upgrade method provided by the embodiment of the present application realizes parallel upgrades of multiple target CPLDs as a whole, and improves the upgrade efficiency of multiple target CPLDs.
[0067] The following is an exemplary introduction to the system architecture of the embodiments of the present application.
[0068] The embodiment of the present application provides a computing device, which may be a network device or a terminal device. The network device may include a server, etc. The server may be a physical server, or may be two or more physical servers that share different responsibilities and cooperate with each other to implement various functions of the server.
[0069] Exemplarily, the server may be a blade server, a high-density server, a rack server or a tower server, etc. The terminal device may include a personal digital assistant (PDA), an ultra-mobile personal computer (UMPC), a notebook computer, a netbook, a desktop computer, an all-in-one computer, etc.
[0070] It should be noted that the embodiments of the present application do not limit the device form of the computing device. The system architecture of the computing device provided in the embodiments of the present application is described below using a server as an example.
[0071] like Figure 4, which is a system architecture diagram of a computing device provided in an embodiment of the present application. The hardware part of the computing device includes a BMC, a processor (central processing unit, CPU), a CPLD and a memory, and the software part mainly includes a BMC module, a CPLD firmware, a processor firmware and an operating system (operating system, OS) management unit.
[0072] Among them, CPLD is a digital circuit hardware device used to implement various logic circuits, such as counters, adders, latches, etc. CPLD includes programmable logic macro units, programmable input / output (I / O) units and programmable internal connections. It has the characteristics of large logic unit array, powerful logic macro unit functions, fast speed, rich pin resources, strong I / O port driving ability, and easy to implement large-scale circuit design. A CPLD is equivalent to containing several programmable array logic (PAL). In a CPLD, the interconnection lines between each PAL can be programmed and burned. By using this all-in-one integration method, a CPLD can realize a circuit that can only be composed of thousands of logic gates or even hundreds of thousands of logic gates. CPLD firmware is a software program that can realize the functions of CPLD. In order to enable CPLD to meet the requirements of function, security, compatibility, etc., CPLD firmware needs to be upgraded.
[0073] Among them, the out-of-band controller or processor can perform firmware upgrade on multiple CPLDs according to the firmware upgrade method provided in the embodiment of the present application. It should be noted that in the following embodiments, the execution subject of the firmware upgrade method is based on the BMC as an example. Of course, the execution subject of the firmware upgrade method can also be the CPU.
[0074] Exemplarily, the BMC module may be a management unit of a non-business module. For example, the BMC module may remotely maintain and manage a computing device through a dedicated data channel. The BMC module is completely independent of the operating system of the computing device and may communicate with a basic input output system (BIOS) and an OS (or an OS management unit) through an out-of-band management interface of the computing device.
[0075] Exemplarily, the processor firmware (also referred to as a processor firmware program) may be firmware such as a basic input output system (BIOS), a management engine (ME), a microcode, or an intelligent management unit (IMU).
[0076] Among them, the memory, also called internal memory or main memory, is installed in the memory slot on the motherboard of the computing device, and the memory communicates with the memory controller through a memory channel.
[0077] Optionally, the computing device may further include a display terminal, also referred to as a display; the display terminal is used to display the interface content output by the CPU.
[0078] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0079] For ease of understanding, the following is an exemplary introduction to the firmware upgrade method of the complex programmable logic device CPLD provided by the present application in conjunction with the accompanying drawings. The method is applicable to Figure 4 The computing device shown.
[0080] The following embodiments of the present application will be divided into four parts to exemplarily introduce the scheme of the firmware upgrade method of the complex programmable logic device CPLD.
[0081] Part I: Combination Figure 5 , Figure 6 , Figure 7 , Figure 8 , introduces the firmware upgrade method provided in the embodiment of the present application, aiming to introduce the overall process of firmware upgrade for multiple target CPLDs.
[0082] Part II: Combination Fig. 9 , introduces the firmware upgrade method provided in the embodiment of the present application, aiming to introduce the implementation method of obtaining multiple upgrade data sets during the firmware upgrade process for the target CPLD.
[0083] Part III: Combination Fig.10 , introduces the firmware upgrade method provided in an embodiment of the present application, aiming to introduce an implementation method for determining a preset time length that the BMC needs to wait when sending adjacent upgrade data sets when there are multiple upgrade data sets.
[0084] Part 4: Combination Fig.11 , Fig.12 , introduces the firmware upgrade method provided in the embodiment of the present application, aiming to introduce the process of upgrading multiple target CPLDs by executing a target upgrade configuration file.
[0085] Figure 5The flowchart of a method for upgrading the firmware of a complex programmable logic device (CPLD) according to an exemplary embodiment is shown. Exemplarily, the method includes the following S501-S504.
[0086] S501: The BMC obtains multiple upgrade data sets.
[0087] Wherein, one upgrade data set includes at least a part of upgrade data of each target CPLD in a plurality of target CPLDs; the upgrade data of the CPLD is data of a new version of firmware.
[0088] In a possible implementation, the upgrade data belonging to a target CPLD in the upgrade data set may be the complete upgrade data of the target CPLD, for example, when the data length of the complete upgrade data of the target CPLD is small. The data length indicates the size of the storage space occupied by the upgrade data, and the unit of the data length may be bits, bytes, etc.
[0089] In a possible implementation, the upgrade data belonging to a certain target CPLD in the upgrade data set may be a part of the upgrade data of the target CPLD, for example, when the data length of the complete upgrade data of the target CPLD is large. In this case, if the complete upgrade data is sent to the target CPLD, the data processing capacity of the target CPLD will be exceeded, resulting in an upgrade error of the target CPLD. Therefore, the complete upgrade data of the target CPLD may be divided to obtain a plurality of upgrade sub-data, and at this time, the plurality of upgrade sub-data of the target CPLD are divided into a plurality of upgrade data sets.
[0090] For example, Figure 6 As shown, the BMC obtains two upgrade data sets. Among them, the first upgrade data set contains the upgrade sub-data a of the target CPLD1, the upgrade sub-data 1 of the target CPLD2, and the complete upgrade data o of the target CPLD3, and the second upgrade data set contains the upgrade sub-data b of the target CPLD1 and the upgrade sub-data 2 of the target CPLD2. Since the data length of the complete upgrade data of the target CPLD1 and the target CPLD2 is relatively large, the complete upgrade data of the target CPLD1 is divided into upgrade sub-data a and upgrade sub-data b, and the complete upgrade data of the target CPLD2 is divided into upgrade sub-data 1 and upgrade sub-data 2. The data length of the complete upgrade data o of the target CPLD3 is relatively small, so the complete upgrade data of the target CPLD3 is not divided, and the first upgrade data set contains the complete upgrade data o of the target CPLD3.
[0091] In a possible implementation, the new version of firmware is a functional enhancement or optimization of the old version of firmware. Compared with the old version of firmware, the new version of firmware can be used to add new functions, improve the performance of existing functions, fix vulnerabilities, etc., so that the CPLD can better meet the actual needs of users.
[0092] In a possible implementation, the data of the new version of the firmware includes but is not limited to all logic functions that the CPLD needs to execute, configuration information including the connection method of internal logic blocks, digital signatures, and the like.
[0093] S502: The BMC sends the upgrade data of each target CPLD in the first upgrade data set to each target CPLD in sequence.
[0094] The first upgrade data set is any one of a plurality of upgrade data sets; each target CPLD is used to perform firmware upgrade based on the received upgrade data.
[0095] For example, Figure 6 Taking the first upgrade data set in as an example, the upgrade sub-data a, upgrade sub-data 1 and complete upgrade data o in the first upgrade data set are sent to the target CPLD1, the target CPLD2 and the target CPLD3 in sequence.
[0096] In a possible implementation, each upgrade data in the first upgrade data set is sent to the corresponding target CPLD by opening the interface of each target CPLD in turn. When the BMC is linked to multiple target CPLDs via a JTAG daisy chain, the interface of the target CPLD is the TDI interface of the target CPLD.
[0097] In some embodiments, the above S502 includes: S502a-S502d.
[0098] S502a: The BMC determines the first CPLD and switches the interface of the first CPLD to an enabled state.
[0099] The first CPLD is one of the multiple target CPLDs.
[0100] In a possible implementation, the upgrade data of the first CPLD in the first upgrade data set has the largest data length. This is because the upgrade data with the largest data length needs the longest transmission time to be sent to the corresponding target CPLD, and the upgrade data with the largest data length in the first upgrade data set is preferentially sent to the corresponding target CPLD, so that the upgrade data with the largest data length is upgraded first, ensuring that the target CPLD has completed the flashing of the upgrade data with the largest data length when receiving the next part of the upgrade data.
[0101] For example, in Figure 6 In the first upgrade data set, the data length of the upgrade sub-data a of the target CPLD1 is the largest, so the target CPLD1 is taken as the first CPLD in the first upgrade data set. Figure 7 The diagram is a diagram of the first upgrade data set being written to the target CPLD1, target CPLD2, and target CPLD3. At time t1, the target CPLD1 receives the upgrade sub-data a sent by the BMC, and the target CPLD1 starts to flash the upgrade sub-data a until time t2, when the target CPLD1 completes the flashing of the upgrade sub-data a. During the process of the target CPLD1 flashing the upgrade sub-data a, the BMC also sends the upgrade sub-data 1 and the complete upgrade data o to the target CPLD2 and the target CPLD3, respectively. Therefore, the BMC can send the upgrade sub-data b in the second upgrade data set to the target CPLD1 after time t2.
[0102] S502b: The BMC sends the upgrade data of the first CPLD to the first CPLD.
[0103] S502c: When the upgrade data transmission to the first CPLD is completed, the BMC determines a second CPLD and switches the interface of the second CPLD to an on state, where the second CPLD is another one of the multiple target CPLDs.
[0104] S502d: The BMC sends the upgrade data of the second CPLD to the second CPLD until the upgrade data of all target CPLDs are sent.
[0105] For example, in Figure 6 In the first upgrade data set, when all the upgrade data in the first upgrade data set, namely upgrade sub-data a, upgrade sub-data 1 and complete upgrade data o, are sent to the corresponding target CPLD, the BMC completes sending the upgrade data to all target CPLDs in the first upgrade data set.
[0106] In a possible implementation, the first CPLD, the second CPLD, ... the nth CPLD are determined in descending order according to the data length of the upgrade data of the target CPLD in the first upgrade data set, so that each upgrade data in the first upgrade data set is sent in sequence.
[0107] For example, Figure 6 Taking the first upgrade data set in as an example, the data length of upgrade sub-data a>the data length of upgrade sub-data 1>the data length of complete upgrade data o, then the first CPLD is the target CPLD1, the second CPLD is the target CPLD2, and the third CPLD is the target CPLD3. The order of sending the upgrade data in the first upgrade data set is upgrade sub-data a, upgrade sub-data 1, and complete upgrade data o.
[0108] In a possible implementation, the BMC can also determine the first CPLD, the second CPLD, ... the nth CPLD according to the priority of the upgrade data of the target CPLD. The priority of each upgrade data can be determined according to the importance and urgency of the upgrade data, etc., and no specific limitation is made here. For example, the importance of upgrade data related to core control logic or key safety functions is higher, while the importance of upgrade data for auxiliary function optimization is lower. The upgrade data with high importance is sent first to ensure the timely update of key functions and the stable operation of the computing device. Of course, the priority of the upgrade data can also be set according to the actual situation, and no specific limitation is made here.
[0109] In a possible implementation, the BMC can also determine the first CPLD, the second CPLD, ... the nth CPLD according to the priority of the target CPLD. For example, the priority of the target CPLD related to the key functions of the computing device is higher, such as the target CPLD related to power management and the target CPLD for clock control, while the priority of other target CPLDs responsible for less important functions is lower. Of course, the priority of the target CPLD can also be set according to the actual situation, and no specific limitation is made here.
[0110] The number of upgrade data sets can be one or more. When the data length of the complete upgrade data of each target CPLD is relatively small, the complete upgrade data is within the data processing capability of the target CPLD. Therefore, there is no need to divide the complete upgrade data. One upgrade data set can contain the complete upgrade data of all target CPLDs. In this case, the number of upgrade data sets is one. When the data length of the complete upgrade data of the target CPLD is relatively large, the complete upgrade data with a relatively large data length needs to be divided to obtain multiple upgrade sub-data. Thus, the number of upgrade data sets is no longer one, but multiple.
[0111] In some embodiments, when there is only one upgrade data set, the BMC completes the upgrade of each target CPLD after sending the complete upgrade data of each target CPLD in sequence. After sending the complete upgrade data of the i-th target CPLD, the BMC directly sends the complete upgrade data of the i+1-th target CPLD without waiting for the i-th target CPLD to complete the flashing of the upgrade data.
[0112] In some embodiments, when multiple upgrade data sets are obtained based on the upgrade data of at least two target CPLDs, the method provided in the embodiment of the present application further includes the following steps:
[0113] S503: When the sending of the first upgrade data set is completed, the BMC waits.
[0114] like Figure 8 As shown, in the case where there are multiple upgrade data sets, after the BMC sends the i-th upgrade data set, when sending the i+1-th upgrade data set, it is necessary to ensure that the target CPLD has completed the flashing of the corresponding upgrade data in the i-th upgrade data set when receiving the corresponding upgrade data in the i+1-th upgrade data set, ensuring that the target CPLD is in a state where it can receive the corresponding upgrade data in the i+1-th upgrade data set, thereby improving the reliability of the upgrade process. Therefore, when the sending of the first upgrade data set is completed, the BMC needs to wait for the target CPLD to complete the flashing of the upgrade data.
[0115] S504: When the waiting time reaches the preset time, the BMC sends the upgrade data of each target CPLD in the second upgrade data set to each target CPLD in sequence.
[0116] The preset duration is determined based on the data writing duration corresponding to each target CPLD, and the data writing duration refers to the duration required for the target CPLD to write the upgrade data in the first upgrade data set.
[0117] For example, Figure 6 Taking the upgrade sub-data a in the first upgrade data set as an example, the data writing time is the time required for the upgrade sub-data a to be completely written to the target CPLD1.
[0118] In a possible implementation, the time required for the target CPLD to write the upgrade data is related to the transmission data frequency of the interface of the target CPLD. Exemplarily, for the same upgrade data, when the transmission data frequency of the interface of the target CPLD is larger, it indicates that the amount of data that can be transmitted by the interface per unit time is larger, and the time required to write the upgrade data will be shorter. In an embodiment of the present application, the transmission data frequency of the interfaces of multiple target CPLDs is the same.
[0119] In a possible implementation, the preset time length may be reasonably set to ensure that the target CPLD can complete the flashing operation of the upgrade data even in the most unfavorable conditions (such as network delay, etc.).
[0120] In a possible implementation, when the data lengths of the upgrade data in the upgrade data set are different, the preset durations may also differ. For example, when the waiting duration reaches the first preset duration, the BMC sends the upgrade data of each target CPLD in the second upgrade data set to each target CPLD in sequence. When the sending of the second upgrade data set is completed, the BMC waits, and when the waiting duration reaches the second preset duration, the BMC sends the upgrade data of each target CPLD in the third upgrade data set to each target CPLD in sequence. When the data lengths of the upgrade data in the first upgrade data set and the second upgrade data set are different, the durations for the target CPLD to flash the upgrade data are also different, and thus there may be differences between the first preset duration and the second preset duration determined.
[0121] Based on the above, during the upgrade process of multiple CPLDs, at most one CPLD interface is in the open state at the same time. For example, the BMC and the CPLD are linked in a JTAG daisy chain structure. At the same time, the BMC can only send upgrade data to one CPLD. In the embodiment of the present application, Figure 8 As shown, after sending part of the upgrade data to the i-th target CPLD, part of the upgrade data can be sent to the i+1-th target CPLD immediately without waiting for the i-th target CPLD to finish flashing its part of the upgrade data. In the process of sending part of the upgrade data to the i+1-th target CPLD, the i-th target CPLD flashes part of the upgrade data at the same time, and the part of the upgrade data corresponding to different target CPLDs is executed serially, thereby realizing parallel upgrade of multiple target CPLDs as a whole, thereby shortening the total upgrade time of multiple target CPLDs and improving the upgrade efficiency of multiple target CPLDs.
[0122] The above is the first part of the embodiment of this application. Fig. 9 , describes the process of obtaining multiple upgraded datasets.
[0123] Fig. 9 The flowchart of obtaining multiple upgrade data sets according to an exemplary embodiment is shown. Exemplarily, the method includes the following S901-S903.
[0124] S901: The BMC obtains complete upgrade data of each target CPLD.
[0125] In a possible implementation, the complete upgrade data of the target CPLD is stored in a storage medium (such as a hard disk, flash memory, etc.) in the computing device, and the BMC may send a request to the storage medium in the computing device to obtain the complete upgrade data of the target CPLD.
[0126] In one possible implementation, the complete upgrade data includes a firmware image file and a parameter setting file, wherein the firmware image file contains codes for updating or modifying the internal logic functions of the CPLD, and the parameter setting file contains the working mode, clock settings, etc. of the CPLD.
[0127] S902: The BMC divides the complete upgrade data of each target CPLD into multiple upgrade sub-data.
[0128] The data length of the upgrade sub-data is the maximum data length that the target CPLD can process. Of course, the data length of the upgrade sub-data can also be smaller than the maximum data length that the target CPLD can process.
[0129] In a possible implementation, the maximum data length that the target CPLD can process is determined by the hardware specifications of the CPLD, the interface protocol, etc. The hardware specifications of the CPLD include the number of pins, the type of pins, the package form, etc. The interface protocol can be a serial peripheral interface protocol, a serial bus interface protocol, etc.
[0130] S903: The BMC groups each upgrade sub-data to obtain multiple upgrade data sets.
[0131] Each upgrade data set includes an upgrade sub-data for each target CPLD.
[0132] For example, Figure 6 For example, BMC obtains two upgrade data sets, namely the first upgrade data set and the second upgrade data set, based on the complete upgrade data of target CPLD1, target CPLD2, and target CPLD3. Among them, the complete upgrade data of target CPLD1 is divided into upgrade sub-data a and upgrade sub-data b. The complete upgrade data of target CPLD2 is divided into upgrade sub-data 1 and upgrade sub-data 2. Since the complete upgrade data o of target CPLD3 is small in length, target CPLD3 is not divided. The first upgrade data set includes upgrade sub-data a, upgrade sub-data 1, and complete upgrade data o. The second upgrade data set includes upgrade sub-data b and upgrade sub-data 2.
[0133] In a possible implementation, for multiple upgrade sub-data of the same target CPLD, the order in which the upgrade sub-data of the multiple target CPLDs are sent can be determined according to the dependency relationship between the multiple upgrade sub-data. Exemplarily, some upgrade sub-data need to be sent before or after other upgrade sub-data to ensure the smooth progress of the entire upgrade process of the target CPLD and avoid the upgrade failure of the target CPLD caused by the conflict of the upgrade sub-data with dependency relationship.
[0134] In the embodiment of the present application, taking into account the data processing capability of the target CPLD, when the data length of the complete upgrade data of the target CPLD is large, the complete upgrade data can be divided into multiple upgrade sub-data to ensure that the target CPLD is capable of processing the received upgrade data, thereby avoiding the data length of the upgrade sub-data exceeding the maximum data length that the target CPLD can process, thereby causing the target CPLD to make errors when processing the upgrade data. At the same time, the data length of the upgrade sub-data is set to the maximum data length that the target CPLD can process, thereby maximizing the use of the data processing capability of the target CPLD and improving the upgrade efficiency of the target CPLD.
[0135] The above is the second part of the embodiment of this application. Fig.10 , describes a process of determining a preset time that the BMC needs to wait between sending adjacent upgrade data sets when there are multiple upgrade data sets.
[0136] Fig.10 The flowchart of determining the preset time length that the BMC needs to wait between sending adjacent upgrade data sets according to an exemplary embodiment is shown. Exemplarily, the method includes the following S1001-S1003.
[0137] S1001: The BMC calculates the sending time length of each upgrade data in the first upgrade data set except the upgrade data with the largest data length.
[0138] The sending time refers to the time required to send the upgrade data to the target CPLD.
[0139] In a possible implementation, the sending duration is calculated by the transmission data frequency of the interface of the target CPLD, and the preset waiting duration is dynamically adjusted according to the transmission capacity of the interface, thereby improving the flexibility and reliability of the CPLD firmware upgrade.
[0140] Optionally, the ratio of the upgrade data other than the upgrade data with the largest data length in the first upgrade data set to the corresponding transmission data frequency is used as the sending duration of the upgrade data. Determining the sending duration based on the transmission data frequency of the interface of the target CPLD helps to dynamically adjust the preset waiting duration according to the transmission capacity of the interface, thereby improving the flexibility and reliability of the CPLD firmware upgrade.
[0141] Optionally, the process of BMC sending configuration instructions also takes time. Therefore, in addition to the upgrade data with the largest data length, the sending time of the upgrade data can also include the time spent on opening the target CPLD interface, so as to make full use of the time spent by the BMC in sending the upgrade data and further shorten the waiting time of the BMC.
[0142] S1002: The BMC obtains the data flashing time of the upgrade data with the largest data length.
[0143] The data writing time of the upgrade data with the largest data length refers to the time required for the corresponding target CPLD to finish writing the upgrade data with the largest data length.
[0144] For example, Figure 7 Taking the first upgrade data set in as an example, the upgrade data with the largest data length in the first upgrade data set is the upgrade sub-data a of the target CPLD1. Therefore, the data writing time of the upgrade data with the largest data length is the time required for the target CPLD1 to complete the writing of the upgrade sub-data a.
[0145] S1003: The BMC calculates a preset duration based on the data flashing duration of the upgrade data with the largest data length and the sending duration of each upgrade data except the upgrade data with the largest data length.
[0146] In a possible implementation, in the above S1003, the preset duration is calculated in the following manner:
[0147] S1003a: Sum up the sending durations to obtain the total sending duration. During the total sending duration, the upgrade data with the largest data length is also written into the corresponding first CPLD at the same time.
[0148] S1003b: Subtract the data writing time from the total sending time to obtain the preset time.
[0149] In an embodiment of the present application, when the first CPLD receives upgrade data and starts to flash, the upgrade data is sent to other target CPLDs corresponding to the first upgrade data set in sequence, and the flashing of the upgrade data to the first CPLD and the sending of the upgrade data to the other target CPLDs are performed simultaneously. The data flashing time is subtracted from the time consumed in sending the upgrade data to the other target CPLDs, thereby shortening the actual waiting time of the first CPLD. The actual waiting time of the other target CPLDs is similar to that of the first CPLD, and is also shortened, which will not be elaborated here. Therefore, the total upgrade time of multiple target CPLDs is shortened, and the upgrade efficiency of multiple target CPLDs is improved.
[0150] For example, Figure 7 For example, the BMC sends the upgrade sub-data 1 to the target CPLD2 during the time period from t1 to t3, and sends the complete upgrade data o to the target CPLD3 during the time period from t3 to t4. Therefore, the preset waiting time T of the BMC = the target CPLD1 flashing time of the upgrade sub-data a - the sending time of the upgrade sub-data 1 - the sending time of the complete upgrade data = (t2-t1)-(t3-t1)-(t4-t3)=t2-t4.
[0151] In a possible implementation, in the above S1003, in addition to referring to the data writing time of the upgrade data with the largest data length and the sending time of each upgrade data except the upgrade data with the largest data length, the BMC can also refer to emergencies such as network delays to set a preset time to ensure that the first CPLD has completed the writing of the corresponding upgrade data in the first upgrade data set within the preset time.
[0152] The above is the third part of the embodiment of this application. Fig.11 , Fig.12 , describes the process of upgrading multiple target CPLDs based on target upgrade configuration files.
[0153] Fig.11 FIG. 1 is a flowchart of implementing the upgrade of multiple target CPLDs according to a target upgrade configuration file according to an exemplary embodiment. Fig.11 In the method, the BMC implements the upgrade of multiple target CPLDs by executing the target upgrade configuration file. The method includes the following S1101-S1104.
[0154] S1101: The BMC obtains a target upgrade configuration file.
[0155] Among them, the target upgrade configuration file includes multiple I / O instruction groups, one I / O instruction group includes multiple I / O instructions, different I / O instructions correspond to different target CPLDs; the I / O instructions are used to send at least part of the upgrade data of the target CPLD to the corresponding target CPLD.
[0156] In a possible implementation, the BMC obtains the target upgrade configuration file in the following manner:
[0157] S1101a: The BMC obtains the upgrade configuration files of each target CPLD.
[0158] Wherein, an upgrade configuration file of a target CPLD includes a plurality of I / O instructions corresponding to the target CPLD.
[0159] S1101b: The BMC merges the multiple I / O instructions corresponding to each target CPLD to obtain multiple I / O instruction groups.
[0160] Exemplarily, an I / O instruction is corresponded to a part of the upgrade file of the target CPLD, and multiple I / O instructions of multiple target CPLDs are merged to obtain multiple I / O instruction groups, and the sequential upgrade method of COLD in the related technology is changed to a parallel upgrade method of CPLD, thereby shortening the upgrade time of multiple CPLDs.
[0161] S1101c: The BMC obtains a target upgrade configuration file based on the multiple I / O instruction groups.
[0162] Optionally, at least one delay instruction is obtained through multiple I / O instruction groups, and multiple I / O instruction groups and at least one delay instruction can constitute a target upgrade configuration file. Among them, a delay instruction is configured to be executed between two I / O instruction groups, and the delay instruction is used to indicate waiting for a preset time length.
[0163] S1102: The BMC executes multiple I / O instructions in the first I / O instruction group in sequence.
[0164] The multiple I / O instructions in the first I / O instruction group are respectively used to send the upgrade data of each target CPLD in the first upgrade data set.
[0165] In a possible implementation, the target upgrade configuration file also includes multiple configuration instruction groups, one configuration instruction group corresponds to one upgrade data set, and one configuration instruction group includes multiple configuration instructions, and different configuration instructions correspond to different target CPLDs. The configuration instruction is used for the BMC to select one of the multiple target CPLDs as the object for transmitting the upgrade data. When the BMC is linked to multiple target CPLDs in a JTAG daisy chain structure, the configuration instruction is used to switch the TDI interface of the selected target CPLD to an on state.
[0166] In one possible implementation, the BMC first executes the first configuration instruction in the first configuration instruction group to open the TDI port for the target CPLD, and then executes the first I / O instruction in the first I / O instruction group; after executing the first I / O instruction, continue to execute the second configuration instruction in the first configuration instruction group to open the TDI port for CPLD2 to execute the second I / O instruction in the first I / O instruction group until all I / O instructions in the first I / O instruction group are executed.
[0167] Specifically, take upgrading two target CPLDs as an example. Fig.12 As shown, the BMC first opens the TDI port of CPLD1 through the first configuration instruction, executes the first I / O instruction to CPLD1, and sends part of the upgrade data of CPLD1 to CPLD1; then opens the TDI port of CPLD2 through the second configuration instruction, executes the second I / O instruction to CPLD2, and sends part of the upgrade data of CPLD2 to CPLD2, thereby completing the sending of the first upgrade data set.
[0168] In the case where multiple upgrade data sets are obtained based on the upgrade data of at least two target CPLDs, the method provided in the embodiment of the present application further includes the following steps:
[0169] S1103: When the execution of multiple I / O instructions in the first I / O instruction group is completed, the BMC executes a first delay instruction.
[0170] The first delay instruction is used to instruct to wait for a preset time period.
[0171] Specifically, when multiple I / O instructions in the first I / O instruction group are executed, the first delay instruction is used to instruct to wait for a preset time. After the first delay instruction is executed, each I / O instruction in the second I / O instruction group is executed in sequence, ensuring that each target CPLD has enough time to flash the upgrade data, avoiding the situation where the target CPLD has not yet completed flashing the upgrade data in the first upgrade data set but has received the upgrade data in the second upgrade data set, thereby making the upgrade process of multiple target CPLDs more orderly.
[0172] S1104: When the execution of the first delay instruction is completed, the BMC executes multiple I / O instructions in the second I / O instruction group in sequence.
[0173] The multiple I / O instructions in the second I / O instruction group are respectively used to send the upgrade data of each target CPLD in the second upgrade data set.
[0174] exist Fig.12 In the embodiment, after all the upgrade data in the first upgrade data set are sent to CPLD1 and CPLD2, the BMC executes the first delay instruction. When the waiting time reaches the preset time, the BMC continues to send the upgrade data of CPLD1 and CPLD2 in the next upgrade data set until the upgrade of CPLD1 and CPLD2 is completed.
[0175] Specifically, when the first delay instruction is executed, the BMC executes multiple I / O instructions in the second I / O instruction group. When the multiple I / O instructions in the second I / O instruction group are executed, the BMC executes the second delay instruction, and when the second delay instruction is executed, the BMC continues to execute multiple I / O instructions in the third I / O instruction group until the BMC executes all instructions in the target configuration file and completes the configuration of multiple target CPLDs.
[0176] In an embodiment of the present application, an I / O instruction is used to send at least a portion of the corresponding upgrade data to the target CPLD, and the I / O instructions corresponding to different target CPLDs are executed in sequence. In the process of executing multiple I / O instructions to send multiple upgrade data, there is no waiting for the target CPLD to complete the flashing of the corresponding upgrade data. The time consumed in executing the I / O instructions is used to reduce the time waiting for the target CPLD to flash the upgrade data, shortening the total upgrade time of multiple target CPLDs and improving the firmware upgrade efficiency of multiple target CPLDs.
[0177] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the firmware upgrade device of the complex programmable logic device CPLD includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0178] The embodiment of the present application can divide the functional modules of the firmware upgrade device of the complex programmable logic device CPLD according to the above method. For example, the firmware upgrade device of the complex programmable logic device CPLD can include various functional modules corresponding to the various functional divisions, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0179] For example, Fig.13 A possible structural schematic diagram of a firmware upgrade device for a complex programmable logic device CPLD involved in the above-mentioned embodiment is shown. The firmware upgrade device for a complex programmable logic device CPLD is applied to a computing device, and the computing device includes multiple complex programmable logic devices CPLDs. The CPLD includes an interface for receiving upgrade data. At the same time, the interface of at most one CPLD on the computing device is in an open state. The device includes: a first acquisition unit 1301, which is used to acquire multiple upgrade data sets, and an upgrade data set includes at least a part of the upgrade data of each target CPLD in multiple target CPLDs; the upgrade data of the CPLD is the data of the new version of the firmware. A first sending unit 1302, which is used to send the upgrade data of each target CPLD in the first upgrade data set to each target CPLD in sequence, and the first upgrade data set is any one of the multiple upgrade data sets; each target CPLD is used to perform a firmware upgrade based on the received upgrade data.
[0180] Optionally, the device further includes: a waiting unit and a second sending unit. The waiting unit is used to wait when the sending of the first upgrade data set is completed. The second sending unit is used to send the upgrade data of each target CPLD in the second upgrade data set to each target CPLD in sequence when the waiting time reaches a preset time; wherein the preset time is determined based on the data writing time corresponding to each target CPLD, and the data writing time refers to the time required for the target CPLD to write the upgrade data in the first upgrade data set.
[0181] Optionally, the first acquisition unit 1301 is specifically used to: acquire the complete upgrade data of each target CPLD; divide the complete upgrade data of each target CPLD into multiple upgrade sub-data, the data length of the upgrade sub-data being the maximum data length that the target CPLD can process; and group each upgrade sub-data to obtain multiple upgrade data sets.
[0182] Optionally, the first sending unit 1302 is specifically used to determine the first CPLD, switch the interface of the first CPLD to the on state, and the first CPLD is one of multiple target CPLDs; send upgrade data of the first CPLD to the first CPLD; when the sending of the upgrade data of the first CPLD is completed, determine the second CPLD, switch the interface of the second CPLD to the on state, and the second CPLD is another one of the multiple target CPLDs; send the upgrade data of the second CPLD to the second CPLD until the sending of the upgrade data of all target CPLDs is completed.
[0183] Optionally, in the first sending unit 1302, the data length of the upgrade data belonging to the first CPLD in the first upgrade data set is the largest.
[0184] Optionally, the device further includes: a first calculation unit, used to calculate the sending duration of each upgrade data in the first upgrade data set except the upgrade data with the largest data length, the sending duration refers to the time required to send the upgrade data to the target CPLD. A second acquisition unit, used to acquire the data write duration of the upgrade data with the largest data length. The second calculation unit is used to calculate the preset duration based on the data write duration of the upgrade data with the largest data length and the sending duration of each upgrade data except the upgrade data with the largest data length.
[0185] Optionally, the first calculation unit is specifically used to obtain the transmission data frequency of the interface of the target CPLD; and determine the sending duration based on the ratio of the data length of the upgrade data and the transmission data frequency.
[0186] Optionally, the second calculation unit is specifically used to sum up the sending durations to obtain a total sending duration; and to subtract the data flushing duration from the total sending duration to obtain a preset duration.
[0187] Optionally, the device also includes: a third acquisition unit, used to acquire a target upgrade configuration file; the target upgrade configuration file includes multiple I / O instruction groups, one I / O instruction group includes multiple I / O instructions, and different I / O instructions correspond to different target CPLDs; the I / O instructions are used to send at least a portion of the upgrade data of the target CPLD to the corresponding target CPLD.
[0188] The first sending unit 1302 is further used to execute multiple I / O instructions in the first I / O instruction group in sequence, and the multiple I / O instructions in the first I / O instruction group are used to send the upgrade data of each target CPLD in the first upgrade data set.
[0189] Optionally, the target upgrade configuration file further includes at least one delay instruction, and the delay instruction is configured to be executed between two I / O instruction groups.
[0190] The waiting unit is specifically used to execute a first delay instruction when multiple I / O instructions in the first I / O instruction group are executed, and the first delay instruction is used to indicate waiting for a preset time length.
[0191] The second sending unit is specifically used to execute multiple I / O instructions in the second I / O instruction group in sequence when the first delay instruction is executed. The multiple I / O instructions in the second I / O instruction group are used to send the upgrade data of each target CPLD in the second upgrade data set.
[0192] Optionally, a third acquisition unit is specifically used to obtain an upgrade configuration file of each target CPLD, wherein an upgrade configuration file of a target CPLD includes multiple I / O instructions corresponding to the target CPLD; the multiple I / O instructions corresponding to each target CPLD are merged to obtain multiple I / O instruction groups; and the target upgrade configuration file is obtained based on the multiple I / O instruction groups.
[0193] Optionally, a third acquisition unit is specifically used to obtain at least one delay instruction based on multiple I / O instruction groups; generate a target upgrade configuration file including multiple I / O instruction groups and at least one delay instruction, and a delay instruction is configured to be executed between two I / O instruction groups.
[0194] For the specific description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any of the above-mentioned complex programmable logic device CPLD firmware upgrade devices and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.
[0195] The embodiment of the present application also provides a computer device, which includes a processor and a memory, the processor is connected to the memory, the memory stores a computer execution instruction, and the processor implements the data processing method in the above embodiment when executing the computer execution instruction. The embodiment of the present application does not impose any restrictions on the specific form of the computer device. For example, the computer device can be a terminal device or a network device. Among them, the terminal device can be called: terminal, user equipment (user equipment, UE), terminal equipment, access terminal, user unit, user station, mobile station, remote station, remote terminal, mobile device, user terminal, wireless communication device, user agent or user device, etc. The terminal device can be a mobile phone, augmented reality (augmented reality, AR) device, virtual reality (virtual reality, VR) device, tablet computer, laptop computer, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook, personal digital assistant (personal digital assistant, PDA), etc. The network device can be a server, etc. Among them, the server can be a physical or logical server, or it can be two or more physical or logical servers that share different responsibilities and cooperate with each other to realize the functions of the server.
[0196] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is enabled to execute any of the methods executed by the computer devices provided above.
[0197] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0198] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the above-mentioned computer device. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gatearray, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0199] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0200] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.
[0201] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0202] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0203] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for upgrading the firmware of a complex programmable logic device (CPLD), characterized in that: Applied to a computing device, the computing device includes a plurality of CPLDs, the CPLDs include an interface for receiving upgrade data, and at the same time, the interface of at most one CPLD on the computing device is in an open state; The method comprises: Acquire multiple upgrade data sets, one of which includes at least a portion of upgrade data of each target CPLD in the multiple target CPLDs; the upgrade data of the CPLD is data of a new version of firmware; The upgrade data of each target CPLD in the first upgrade data set is sent to each target CPLD in sequence, wherein the first upgrade data set is any one of the multiple upgrade data sets; each target CPLD is used to perform firmware upgrade based on the received upgrade data.
2. The firmware upgrade method according to claim 1, characterized in that: In the case where a plurality of the upgrade data sets are obtained based on the upgrade data of the at least two target CPLDs, the method further comprises: When the sending of the first upgraded data set is completed, waiting; When the waiting time reaches the preset time, the upgrade data of each target CPLD in the second upgrade data set are sent to each target CPLD in turn; wherein, the preset time is determined based on the data writing time corresponding to each target CPLD, and the data writing time refers to the time required for the target CPLD to write the upgrade data in the first upgrade data set.
3. The firmware upgrade method according to claim 1 or 2, characterized in that: The obtaining of multiple upgrade data sets includes: Obtaining complete upgrade data for each of the target CPLDs; Dividing the complete upgrade data of each target CPLD into a plurality of upgrade sub-data, wherein the data length of the upgrade sub-data is the maximum data length that can be processed by the target CPLD; The upgrade sub-data are grouped to obtain the multiple upgrade data sets.
4. The firmware upgrade method according to claim 1, characterized in that: The step of sending the upgrade data of each target CPLD in the first upgrade data set to each target CPLD in sequence includes: Determine a first CPLD, and switch the interface of the first CPLD to an on state, wherein the first CPLD is one of a plurality of target CPLDs; Sending upgrade data of the first CPLD to the first CPLD; When the upgrade data of the first CPLD is sent completely, determining a second CPLD, switching the interface of the second CPLD to an on state, the second CPLD being another one of the multiple target CPLDs; The upgrade data of the second CPLD is sent to the second CPLD until the sending of the upgrade data to all target CPLDs is completed.
5. The firmware upgrade method according to claim 4, characterized in that: Among the first upgrade data sets, the upgrade data belonging to the first CPLD has the largest data length.
6. The firmware upgrade method according to claim 2, characterized in that: The method further comprises: Calculating the sending duration of each upgrade data except the upgrade data with the largest data length in the first upgrade data set, where the sending duration refers to the duration required to send the upgrade data to the target CPLD; Get the data flushing time of the upgrade data with the largest data length; The preset duration is calculated based on the data writing duration of the upgrade data with the largest data length and the sending duration of each upgrade data except the upgrade data with the largest data length.
7. The firmware upgrade method according to claim 6, characterized in that: Calculating the sending duration of the upgrade data except the upgrade data with the largest data length in the first upgrade data set includes: Acquire the transmission data frequency of the interface of the target CPLD; The sending duration is determined based on a ratio of a data length of the upgrade data to a frequency of the transmission data.
8. The firmware upgrade method according to claim 6 or 7, characterized in that: The calculating of the preset duration based on the data writing duration of the upgrade data with the largest data length and the sending duration of each upgrade data except the upgrade data with the largest data length includes: Sum up the sending durations to obtain a total sending duration; The preset duration is obtained by subtracting the data writing duration from the total sending duration.
9. The firmware upgrade method according to claim 2, characterized in that: The method further comprises: Obtain a target upgrade configuration file; the target upgrade configuration file includes a plurality of I / O instruction groups, one of the I / O instruction groups includes a plurality of I / O instructions, and different I / O instructions correspond to different target CPLDs; the I / O instructions are used to send at least a portion of upgrade data of the target CPLD to the corresponding target CPLD; The step of sending the upgrade data of each target CPLD in the first upgrade data set to each target CPLD in sequence includes: The multiple I / O instructions in the first I / O instruction group are executed in sequence, and the multiple I / O instructions in the first I / O instruction group are respectively used to send the upgrade data of each target CPLD in the first upgrade data set.
10. A computer device, characterized in that: include: Processor and memory; The processor is connected to a memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, so that the computer device implements the method according to any one of claims 1 to 9.
