Electronic device and CPLD firmware loading method

By introducing a combination of reset delay circuit and processor in CPLD firmware upgrade, the problems of long waiting time and information loss for CPLD firmware upgrade are solved, and an automated and accurate firmware upgrade process is realized.

CN113127045BActive Publication Date: 2024-09-17SUMA TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110451064.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-25
Publication Date
2024-09-17
Estimated Expiration
2041-04-25

AI Technical Summary

Technical Problem

Existing CPLD firmware upgrade methods have problems such as long waiting times and easy loss of CPLD update information. Especially when the server is running important services, it is difficult to meet the user's business processing needs and the CPLD version validation requirements at the same time.

Method used

Using a combination of processor, reset delay circuit and CPLD, it sends a reset request signal after the CPLD determines that the firmware version is refreshed, receives and delays processing of the shutdown signal, and generates a smooth reset signal to avoid logic confusion and information loss, thereby realizing automatic firmware upgrade.

Benefits of technology

It effectively shortens the waiting time for firmware upgrade, avoids CPLD internal logic confusion and IO port abnormalities, and ensures the integrity of update information and the accuracy of reset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113127045B
    Figure CN113127045B
Patent Text Reader

Abstract

The present application relates to an electronic device and a CPLD firmware loading method, and belongs to the field of computer technology. The electronic device comprises: a processor, a reset delay circuit, and a CPLD, and the CPLD is connected to the processor and the reset delay circuit respectively. The CPLD is used to determine that the firmware version in the CPLD has been refreshed, and send a reset request signal to the processor; the processor is used to generate a shutdown signal in response to the reset request signal; the CPLD is also used to receive the shutdown signal and send a first reset signal to the reset delay circuit; the reset delay circuit is used to delay preprocessing of the first reset signal to obtain a second reset signal; the CPLD is also used to receive the second reset signal and reset, and after resetting, load and run the updated firmware version. This method effectively improves the problem that the existing firmware upgrade method has a long upgrade waiting time and is prone to cause the loss of CPLD update information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to an electronic device and a CPLD firmware loading method. Background Art

[0002] In server systems, CPLD (Complex Programmable Logic Device) is usually used as a hardware power-on timing controller in the whole system, auxiliary hardware platform management and other functions. The working stability of CPLD is an important factor that determines the healthy operation of the entire server system. Therefore, the operation and maintenance of CPLD (such as firmware update) is an indispensable and very important link in the server system.

[0003] In traditional server systems, there are two main methods for upgrading CPLD firmware. The first method is to upgrade the firmware before the product is launched, such as Figure 1 As shown in FIG. 1 , the BMC (Baseboard Management Controller) is connected to the CPLD via a JTAG (Joint Test Action Group) or I2C (Inter-Integrated Circuit) signal line. The BMC sends an IEEE 1532 refresh command to let the CPLD perform the action of loading the firmware. However, this solution will inevitably cause the CPLD's IO port to reset while completing the CPLD firmware loading, thereby causing unpredictable risks such as system reset and power failure. Therefore, this method is generally only used for firmware upgrades before the product is launched.

[0004] The second type is firmware upgrades during end-user use. At this time, the server system is generally in the boot-up state, and the new version of CPLD is preloaded by the BMC. After the preloading is completed, the server is usually powered off manually to make the new CPLD version effective. However, when the server is running important business, users generally do not allow the server to be powered off, resulting in a long waiting period for the upgrade. If the user urgently needs to refresh the CPLD version and make it effective due to some specific factors at this time, if the power is forced to be cut off, the BMC may be burned or the CPLD update information may be lost, making it impossible to meet the user's business processing needs and the CPLD version effectiveness requirements at the same time. Summary of the invention

[0005] In view of this, the purpose of the present application is to provide an electronic device and a CPLD firmware loading method to improve the existing firmware upgrade method, which has a long upgrade waiting time and easily causes the loss of CPLD update information.

[0006] The embodiment of the present application is implemented as follows:

[0007] In the first aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a reset delay circuit, and a CPLD, wherein the CPLD is connected to the processor and the reset delay circuit, respectively; the CPLD is used to determine that the firmware version in the CPLD has been refreshed, and send a reset request signal to the processor; the processor is used to generate a shutdown signal in response to the reset request signal; the CPLD is also used to receive the shutdown signal and send a first reset signal to the reset delay circuit; the reset delay circuit is used to delay preprocessing of the first reset signal to obtain a second reset signal; the CPLD is also used to receive the second reset signal and perform a reset, and after resetting, load and run the updated firmware version.

[0008] In the embodiment of the present application, when the CPLD determines that the firmware version in the CPLD has been refreshed, the CPLD sends a reset request signal to the processor, and after receiving the shutdown signal generated by the processor in response to the reset request signal, sends a first reset signal to the reset delay circuit, and resets after receiving the second reset signal generated by the reset delay circuit in response to the first reset signal, thereby automatically completing the firmware upgrade and solving the problem of long waiting time for existing upgrades; at the same time, by introducing a reset delay circuit to delay preprocessing the first reset signal, it can effectively avoid the CPLD starting to reset upon receiving the shutdown signal, which causes the internal logic of the CPLD to be disordered, resulting in IO port abnormalities and loss of update information.

[0009] In combination with a possible implementation of the first aspect, the CPLD includes a register and an IO control unit, the register is preset with an identification bit for indicating whether the firmware version in the CPLD is refreshed; the IO control unit is used to determine whether the firmware version in the CPLD has been refreshed by judging whether the character in the preset identification bit of the register is a preset character; when the character in the preset identification bit of the register is the preset character, it is determined that the firmware version in the CPLD has been refreshed. In the embodiment of the present application, by presetting an identification bit in the register to indicate whether the firmware version in the CPLD has been refreshed, not only can it be quickly determined whether the firmware version in the CPLD has been refreshed, but also the problem of "memory loss" caused by BMC hanging or re-flash in the later stage can be avoided.

[0010] In combination with a possible implementation of the embodiment of the first aspect, the reset delay circuit includes: an RC delay circuit and a shaping circuit, the RC delay circuit and the shaping circuit are both connected to the CPLD, and the RC delay circuit is also connected to the shaping circuit; the RC delay circuit is used to delay the first reset signal to obtain a signal that changes slowly from a low level to a high level, or to obtain a signal that changes slowly from a high level to a low level; the shaping circuit is used to shape the signal that changes slowly from a low level to a high level, or the signal that changes slowly from a high level to a low level, to obtain a second reset signal that changes smoothly from a high level to a low level. In the embodiment of the present application, the first reset signal is delayed by the RC delay circuit, which can effectively avoid the problem of causing internal logic disorder of the CPLD and causing abnormal IO ports. At the same time, the signal after the delay of the RC delay circuit is shaped by the shaping circuit, and the second reset signal that changes smoothly from a high level to a low level is output, thereby improving the accuracy of the CPLD reset and avoiding misoperation.

[0011] In combination with a possible implementation manner of the embodiment of the first aspect, the effective level of the first reset signal is a low level, and the effective level of the second reset signal is a low level; the RC delay circuit includes: a first resistor, a second resistor, a third resistor, a first capacitor, a diode and a switch tube; the shaping circuit includes: an inverting Schmitt trigger; the first end of the first resistor is connected to the CPLD, the first end of the first resistor is also connected to the power supply through the second resistor, the first end of the first resistor is also connected to the anode end of the diode, the second end of the first resistor is grounded through the first capacitor, the second end of the first resistor is also respectively connected to the cathode end of the diode and the first end of the switch tube, the second end of the switch tube is grounded, the third end of the switch tube is connected to the input end of the inverting Schmitt trigger, the third end of the switch tube is also connected to the power supply through the third resistor, and the output end of the inverting Schmitt trigger is connected to the CPLD. In the implementation of the present application, the voltage of the first capacitor and the first end of the switch tube is clamped by a diode to avoid voltage oscillation and the problem of output logic error. At the same time, the inverting Schmitt trigger is used to output a high-level signal when the CPLD does not need to load new firmware; when the CPLD receives a shutdown signal sent by the processor and changes the first reset signal from a high level to a low level, the inverting Schmitt trigger delays the output signal from a high level to a low level output, and outputs a second reset signal that changes smoothly from a high level to a low level, thereby improving the accuracy of CPLD reset and avoiding misoperation.

[0012] In combination with a possible implementation manner of the embodiment of the first aspect, the effective level of the first reset signal is a high level, and the effective level of the second reset signal is a low level; the RC delay circuit includes: a first resistor, a second resistor, a third resistor, a first capacitor, a diode and a switch tube; the shaping circuit includes: a positive phase Schmitt trigger; the first end of the first resistor is connected to the CPLD, the first end of the first resistor is also connected to the power supply through the second resistor, the first end of the first resistor is also connected to the cathode end of the diode, the second end of the first resistor is grounded through the first capacitor, the second end of the first resistor is also respectively connected to the anode end of the diode and the first end of the switch tube, the second end of the switch tube is grounded, the third end of the switch tube is connected to the input end of the positive phase Schmitt trigger, the third end of the switch tube is also connected to the power supply through the third resistor, and the output end of the positive phase Schmitt trigger is connected to the CPLD. In the implementation of the present application, the voltage of the first capacitor and the first end of the switch tube is clamped by a diode to avoid voltage oscillation and the problem of output logic error. At the same time, a positive-phase Schmitt trigger is used to output a high-level signal when the CPLD does not need to load new firmware; when the CPLD receives a shutdown signal sent by the processor and changes the first reset signal from a low level to a high level, the positive-phase Schmitt trigger delays the output signal from a high level to a low level output, and outputs a second reset signal that changes smoothly from a high level to a low level, thereby improving the accuracy of CPLD reset and avoiding misoperation.

[0013] In combination with a possible implementation of the first aspect, the CPLD includes: an IO control unit, a logic gate circuit, the logic gate circuit is respectively connected to the IO control unit, the processor and the reset delay circuit; the IO control unit is used to determine that the firmware version in the CPLD has been refreshed, and sends the reset request signal to the processor and the logic gate circuit respectively; the logic gate circuit is used to perform a logical operation on the reset request signal and the shutdown signal, and output the first reset signal. In the embodiment of the present application, the logic switching of the level is realized by the logic gate circuit, which has a faster processing speed and is less prone to logical errors than using software.

[0014] In combination with a possible implementation manner of the embodiment of the first aspect, the effective level of the shutdown signal is a low level, the effective level of the first reset signal is a low level, and the logic gate circuit includes: a first NAND gate and a second NAND gate; the first input end of the first NAND gate is connected to the processor, the first input end of the first NAND gate is used to receive the shutdown signal, and the second input end of the first NAND gate is used to receive a high level signal; the output end of the first NAND gate is connected to the first input end of the second NAND gate, the second input end of the second NAND gate is connected to the IO control unit, the second input end of the second NAND gate is used to receive the reset request signal, and the output end of the second NAND gate is connected to the reset delay circuit.

[0015] In combination with a possible implementation manner of the embodiment of the first aspect, the effective level of the shutdown signal is a low level, and the effective level of the first reset signal is a high level; the logic gate circuit includes: a first NAND gate and a first AND gate; the first input end of the first NAND gate is connected to the processor, the first input end of the first NAND gate is used to receive the shutdown signal, and the second input end of the first NAND gate is used to receive a high level signal; the output end of the first NAND gate is connected to the first input end of the first AND gate, the second input end of the first AND gate is connected to the IO control unit, the second input end of the first AND gate is used to receive the reset request signal, and the output end of the first AND gate is connected to the reset delay circuit.

[0016] In combination with a possible implementation manner of the embodiment of the first aspect, the effective level of the shutdown signal is a high level, and the effective level of the first reset signal is a high level; the logic gate circuit includes: a first AND gate and a second AND gate; the first input end of the first AND gate is connected to the processor, the first input end of the first AND gate is used to receive the shutdown signal, and the second input end of the first AND gate is used to combine a high level signal; the output end of the first AND gate is connected to the first input end of the second AND gate, the second input end of the second AND gate is connected to the IO control unit, the second input end of the second AND gate is used to receive the reset request signal, and the output end of the second AND gate is connected to the reset delay circuit.

[0017] In the second aspect, an embodiment of the present application also provides a CPLD firmware loading method, which is applied to a CPLD in an electronic device, wherein the electronic device also includes a processor and a reset delay circuit; the CPLD is connected to the processor and the reset delay circuit respectively; the method includes: determining that the firmware version in the CPLD has been refreshed, and sending a reset request signal to the processor; receiving a shutdown signal sent by the processor in response to the reset request signal, and sending a first reset signal to the reset delay circuit; receiving a second reset signal generated by the reset delay circuit in response to the first reset signal, and resetting; after resetting, loading and running the updated firmware version.

[0018] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by implementing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work. As shown in the drawings, the above and other purposes, features and advantages of the present application will be clearer. The same reference numerals indicate the same parts in all the drawings. The drawings are not deliberately scaled to the actual size, and the focus is on showing the main purpose of the present application.

[0020] Figure 1 This is the schematic diagram of the existing circuit for CPLD firmware upgrade.

[0021] Figure 2 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0022] Figure 3 A circuit schematic diagram of a reset delay circuit provided in an embodiment of the present application is shown.

[0023] Figure 4 A circuit schematic diagram of another reset delay circuit provided in an embodiment of the present application is shown.

[0024] Figure 5 A schematic diagram showing the waveform relationship between a first reset signal, a signal delayed by an RC delay circuit, and a second reset signal provided in an embodiment of the present application is shown.

[0025] Figure 6A schematic diagram showing another waveform relationship between a first reset signal, a signal delayed by an RC delay circuit, and a second reset signal provided in an embodiment of the present application is shown.

[0026] Figure 7 A schematic structural diagram of another electronic device provided in an embodiment of the present application is shown.

[0027] Figure 8 A schematic structural diagram of another electronic device provided in an embodiment of the present application is shown.

[0028] Fig. 9 A schematic structural diagram of another electronic device provided in an embodiment of the present application is shown.

[0029] Fig.10 A flow chart of a CPLD firmware loading method provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] 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.

[0031] It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it is not necessary to further define and explain it in the subsequent drawings. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0032] Furthermore, the term "and / or" in this application is merely a term used to describe the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0033] In view of the defects of the current firmware upgrade method in CPLD, such as Figure 1The structure shown in the figure is upgraded, which will inevitably cause the IO port of the CPLD to be reset, thereby causing unpredictable risks such as system reset and power failure, and this upgrade method can only be used before the product is launched on the market; and during the use of the end user, the method of manually powering off the server to make the new CPLD version effective will have the problem of not being able to meet the user's business processing needs and the CPLD version effectiveness requirements at the same time. Based on this, the embodiment of the present application provides a CPLD firmware loading method, in which the CPLD preloads the firmware by adopting the Background mode, and after the loading is completed, sends a reset request signal to the processor, and after receiving the shutdown signal generated by the processor in response to the reset request signal, sends a first reset signal to the reset delay circuit, and resets after receiving the second reset signal generated by the reset delay circuit in response to the first reset signal, thereby completing the firmware upgrade and solving the problem of long waiting time for the existing upgrade; at the same time, by introducing a reset delay circuit to delay preprocessing the first reset signal, it can effectively avoid the CPLD starting to reset after receiving the shutdown signal, which causes the internal logic of the CPLD to be disordered, resulting in the problem of IO port abnormality.

[0034] For ease of understanding, the following will combine Figure 2 The electronic device of the present application is described. The electronic device comprises: a processor, a reset delay circuit, a CPLD and a BMC. The CPLD is connected to the processor, the reset delay circuit and the BMC respectively.

[0035] The BMC hardware is connected to the CPLD through JTAG and I2C signal lines. The BMC can burn the built-in Flash (flash memory) of the CPLD through JTAG, so as to preload the new version of the firmware into the Flash; and can also set the Flash refresh flag for the register inside the CPLD through the I2C interface to indicate that the firmware version in the CPLD has been refreshed. Define a preset identification bit in the register to indicate whether the firmware version in the CPLD has been refreshed: if the character in the preset identification bit is 1, it means that the firmware version in the CPLD has been refreshed, otherwise if the character in the preset identification bit is 0, it means that the firmware version in the CPLD has not been refreshed. For example, when the BMC completes pre-burning the CPLD through JTAG, it sets bit0 in the register to 1 through I2C to indicate that the firmware version in the CPLD has been refreshed. After the CPLD is reset, it will automatically set bit0 to 0.

[0036] In addition, the character indicating whether the firmware version has been refreshed can also be reversed, such as if the character in the preset identification bit is 1, it indicates that the firmware version in the CPLD has not been refreshed, and conversely, if the character in the preset identification bit is 0, it indicates that the firmware version in the CPLD has been refreshed. It can be understood that in addition to using the number 0 / 1 to indicate whether the firmware version in the CPLD has been refreshed, other numbers or letters can also be used to indicate, such as 1 for refresh and 2 for not refreshed, so the above example of using the number 0 / 1 to indicate whether the firmware version in the CPLD has been refreshed cannot be understood as a limitation of the present application.

[0037] In addition, in addition to indicating whether the firmware version in the CPLD is refreshed by presetting a flag bit in the register, an existing method may also be used, such as sending an IEEE 1532 refresh command to the CPLD by the BMC to inform the CPLD that its firmware version has been refreshed. If the BMC sends an IEEE 1532 refresh command to the CPLD to inform the CPLD that its firmware version has been refreshed, the CPLD may not include a register.

[0038] The process of how the BMC preloads or burns the new version of the firmware into the Flash in the CPLD in the background mode is well known to those skilled in the art and will not be described here.

[0039] The CPLD is used to determine whether the firmware version in the CPLD has been refreshed and send a reset request signal to the processor. In an optional implementation, it can be determined whether the firmware version in the CPLD has been refreshed by judging whether the character in the preset identification bit of the register in the CPLD is a preset character. When the character in the preset identification bit of the register is a preset character, it is determined that the firmware version in the CPLD has been refreshed. For example, when the character in the preset identification bit is 1, it is determined that the firmware version in the CPLD has been refreshed. In this implementation, the CPLD includes a register and an IO control unit. The register is preset with an identification bit for indicating whether the firmware version in the CPLD has been refreshed. The IO control unit is used to determine whether the firmware version in the CPLD has been refreshed by judging whether the character in the preset identification bit of the register is a preset character; when the character in the preset identification bit of the register is a preset character, it is determined that the firmware version in the CPLD has been refreshed.

[0040] The processor is used to generate a shutdown signal in response to a reset request signal. When the processor receives the reset request signal sent by the CPLD, it generates a shutdown signal in response to the reset request signal. In one implementation, the priority of the reset request signal can be set to a lower priority. When the processor receives the reset request signal, it will wait until other events with higher priorities are processed before responding. Among them, the processor in this embodiment can be a CPU (Central Processing Unit), a PCH (Platform Controller Hub), etc.

[0041] The CPLD is also used to receive a shutdown signal generated by the processor in response to a reset request signal, and to send a first reset signal to the reset delay circuit. The reset delay circuit is used to perform delay preprocessing on the first reset signal to obtain a second reset signal that changes smoothly from a high level to a low level. The CPLD is also used to receive a second reset signal generated by the reset delay circuit in response to the first reset signal, and to reset after receiving the second reset signal. After resetting, the updated firmware version is loaded and run, thereby completing the firmware upgrade. By introducing a reset delay circuit to perform delay preprocessing on the first reset signal, it is possible to effectively avoid the CPLD resetting as soon as it receives the shutdown signal, thereby causing confusion in the internal logic of the CPLD, leading to abnormal IO ports and loss of update information.

[0042] The reset delay circuit includes: an RC delay circuit and a shaping circuit, both of which are connected to the CPLD, and the RC delay circuit is also connected to the shaping circuit. The RC delay circuit is used to delay the first reset signal to obtain a signal that changes slowly from a low level to a high level, or to obtain a signal that changes slowly from a high level to a low level. The shaping circuit is used to shape the signal that changes slowly from a low level to a high level, or the signal that changes slowly from a high level to a low level, to obtain a second reset signal that changes smoothly from a high level to a low level. The effective level of the second reset signal is a low level, and the effective level of the first reset signal can be a low level or a high level.

[0043] If the effective level of the first reset signal is a low level, the RC delay circuit delays the falling edge of the first reset signal, and the delay time is about 23ms, so as to obtain a signal that changes slowly from a low level to a high level. If the effective level of the first reset signal is a high level, the RC delay circuit delays the rising edge of the first reset signal, so as to obtain a signal that changes slowly from a high level to a low level.

[0044] Optionally, the RC delay circuit includes: a first resistor R1, a second resistor R2, a third resistor R3, a first capacitor C1, a diode D1 and a switch tube Q1.

[0045] If the effective level of the first reset signal is a low level, the first end of the first resistor R1 is connected to the CPLD, the first end of the first resistor R1 is also connected to the power supply through the second resistor R2, the first end of the first resistor R1 is also connected to the anode end of the diode D1, the second end of the first resistor R1 is grounded via the first capacitor C1, the second end of the first resistor R1 is also connected to the cathode end of the diode D1 and the first end of the switch tube Q1 respectively, the second end of the switch tube Q1 is grounded, the third end of the switch tube Q1 is connected to the input end of the shaping circuit, and the third end of the switch tube Q1 is also connected to the power supply through the third resistor R3, as shown in the schematic diagram. Figure 3 shown.

[0046] When the CPLD does not need to load new firmware, the first reset signal is high, and the first end of C1 or Q1 is clamped at 3V through D1. At this time, Q1 is in the on state, and the voltage of the third end of Q1 is 0V. When the CPLD receives the shutdown signal sent by the processor, it changes the first reset signal from high to low, and C1 and R1 form a discharge loop to start slow discharge, the time is about 23ms, as the current at the first end of Q1 decreases, the working state of Q1 will change from the saturation area to the cut-off area, when the current at the first end of Q1 is less than the turn-on current, Q1 is in the cut-off state, and the voltage at the third end of Q1 will gradually change from 0V to 3.3V, and the falling edge of the first reset signal is delayed by the RC delay circuit, thereby obtaining a signal that changes slowly from a low level to a high level.

[0047] If the effective level of the first reset signal is high, the first end of the first resistor R1 is connected to the CPLD, the first end of the first resistor R1 is also connected to the power supply through the second resistor R2, the first end of the first resistor R1 is also connected to the cathode end of the diode D1, the second end of the first resistor R1 is grounded through the first capacitor C1, the second end of the first resistor R1 is also connected to the anode end of the diode D2 and the first end of the switch tube Q1 respectively, the second end of the switch tube Q1 is grounded, the third end of the switch tube Q1 is connected to the input end of the shaping circuit, and the third end of the switch tube Q1 is also connected to the power supply through the third resistor R3, as shown in the schematic diagram. Figure 4As shown. When the CPLD does not need to load new firmware, the first reset signal is low level, the first end of C1 or Q1 is clamped at 0V through D1, Q1 is in the cut-off state, and the voltage of the third end of Q1 is 3.3V. When the CPLD receives the shutdown signal sent by the processor, it changes the first reset signal from low level to high level, and C1 and R1 form a loop to start charging slowly, the time is about 23ms, as the current of the first end of Q1 increases, when the current of the first end of Q1 is greater than the start-up current, the working state of Q1 will change from the cut-off area to the saturation area, and the voltage of the third end of Q1 will gradually change from 3.3V to 0V. The rising edge of the first reset signal is delayed by the RC delay circuit, thereby obtaining a signal that changes slowly from high level to low level.

[0048] In an optional implementation, the switch tube Q1 is an NPN transistor, and accordingly, the first end of Q1 is the base, the second end of Q1 is the emitter, and the third end of Q1 is the collector. As an alternative, an NMOS tube can also be used to replace the NPN transistor, and accordingly, the first end of Q1 is the gate, the second end of Q1 is the source, and the third end of Q1 is the drain.

[0049] If the effective level of the first reset signal is low, the effective level of the second reset signal is low, optionally, Figure 3 As shown, the shaping circuit includes: an inverting Schmitt trigger. The third end of the switch tube is connected to the input end of the inverting Schmitt trigger, and the output end of the inverting Schmitt trigger is connected to the CPLD. When the input signal voltage is higher than the positive threshold voltage of the inverting Schmitt trigger, the output of the inverting Schmitt trigger jumps to a low level, and when the voltage of the input signal is lower than the negative threshold voltage of the inverting Schmitt trigger, the output of the inverting Schmitt trigger jumps to a high level. After the inverting Schmitt trigger shapes the signal that changes slowly from a low level to a high level, a second reset signal that changes smoothly from a high level to a low level is obtained.

[0050] If the effective level of the first reset signal is a high level and the effective level of the second reset signal is a low level, optionally, Figure 4 As shown, the shaping circuit includes: a positive phase Schmitt trigger. The third end of the switch tube is connected to the input end of the positive phase Schmitt trigger, and the output end of the positive phase Schmitt trigger is connected to the CPLD. When the input signal voltage is higher than the positive threshold voltage of the positive phase Schmitt trigger, the output of the positive phase Schmitt trigger jumps to a high level, and when the voltage of the input signal is lower than the negative threshold voltage of the positive phase Schmitt trigger, the output of the positive phase Schmitt trigger jumps to a low level. After the positive phase Schmitt trigger shapes the signal that changes slowly from a high level to a low level, a second reset signal that changes smoothly from a high level to a low level is obtained.

[0051] Among them, it should be noted that in addition to using a Schmitt trigger, the shaping circuit can also use a processor to implement a function similar to a Schmitt trigger. For example, by detecting the voltage of the input processor (the voltage output by the RC delay circuit), when the input voltage is higher than the positive threshold voltage, the output jumps to a low level, and when the voltage of the input signal is lower than the negative threshold voltage, the output jumps to a high level, or when the input signal voltage is higher than the positive threshold voltage, the output jumps to a high level, and when the input signal voltage is lower than the negative threshold voltage, the output jumps to a low level.

[0052] In order to facilitate understanding, the relationship between the first reset signal, the signal after the first reset signal is delayed by the RC delay circuit, and the second reset signal will be described below in conjunction with Figure 5 as well as Figure 6 The schematic diagram shown is used for explanation.

[0053] If the effective level of the first reset signal is a low level, the relationship between the first reset signal, the signal after the first reset signal is delayed by the RC delay circuit, and the second reset signal is as follows: Figure 5 As shown. When the CPLD does not need to load new firmware, the first reset signal is high level, and the voltage of the third terminal of Q1 in the RC delay circuit is 0V; when the CPLD receives the shutdown signal sent by the processor, it changes the first reset signal from high level to low level, and the third terminal of Q1 in the RC delay circuit gradually changes from 0V to 3.3V. After the first reset signal passes through the RC delay circuit, a signal that changes slowly from low level to high level is obtained; after the shaping circuit shapes the signal that changes slowly from low level to high level, a second reset signal that changes smoothly from high level to low level is output.

[0054] If the effective level of the first reset signal is a high level, the relationship between the first reset signal, the signal after the first reset signal is delayed by the RC delay circuit, and the second reset signal is as follows: Figure 6 As shown. When the CPLD does not need to load new firmware, the first reset signal is low level, and the voltage of the third terminal of Q1 in the RC delay circuit is 3.3V; when the CPLD receives the shutdown signal sent by the processor, it changes the first reset signal from low level to high level, and the third terminal of Q1 in the RC delay circuit gradually changes from 3.3V to 0V. After the first reset signal passes through the RC delay circuit, a signal that changes slowly from high level to low level is obtained; after the shaping circuit shapes the signal that changes slowly from high level to low level, a second reset signal that changes smoothly from high level to low level is output.

[0055] Among them, in addition to the effective level of the first reset signal being a high level or a low level, the effective level of the shutdown signal can also be a high level or a low level. In one implementation, logical control can be performed through firmware burned in the CLPD. For example, after the CPLD receives the shutdown signal, it sends a first reset signal to the reset delay circuit, that is, the level of the first reset signal is switched from a high level to a low level, or from a low level to a high level. In addition, in addition to using firmware to perform logical switching of levels, logical switching of levels can also be achieved through logic gate circuits. In this implementation, the CPLD includes: an IO control unit, a logic gate circuit, and the logic gate circuit is respectively connected to the IO control unit, the processor and the reset delay circuit.

[0056] The IO control unit is used to determine that the firmware version in the CPLD has been updated, and to send a reset request signal to the processor and the logic gate circuit respectively. The logic gate circuit is used to perform a logic operation on the reset request signal and the shutdown signal, and output a first reset signal.

[0057] In one implementation mode, if the effective level of the shutdown signal is low and the effective level of the first reset signal is low, then Figure 7 As shown, the logic gate circuit includes: a first NAND gate and a second NAND gate; the first input end of the first NAND gate is connected to the processor, the first input end of the first NAND gate is used to receive a shutdown signal, and the second input end of the first NAND gate is used to receive a high level signal; the output end of the first NAND gate is connected to the first input end of the second NAND gate, the second input end of the second NAND gate is connected to the IO control unit, the second input end of the second NAND gate is used to receive a reset request signal, and the output end of the second NAND gate is connected to the reset delay circuit. When the CPLD does not need to load new firmware, the shutdown signal is a high level signal, the first NAND gate outputs a low level signal, and the second NAND gate outputs a high level, that is, the first reset signal is a high level signal. When the processor receives the reset request signal (high level by default), the shutdown signal is switched from a high level to a low level, the first NAND gate outputs a high level signal, and the second NAND gate outputs a low level at this time, that is, the first reset signal is switched from a high level to a low level, and after being pre-processed by the reset delay circuit, the second reset signal changes smoothly from a high level to a low level.

[0058] In one implementation mode, the effective level of the shutdown signal is a low level, and the effective level of the first reset signal is a high level; Figure 8As shown, the logic gate circuit includes: a first NAND gate and a first AND gate; the first input end of the first NAND gate is connected to the processor, the first input end of the first NAND gate is used to receive a shutdown signal, and the second input end of the first NAND gate is used to receive a high level signal; the output end of the first NAND gate is connected to the first input end of the first AND gate, the second input end of the first AND gate is connected to the IO control unit, the second input end of the first AND gate is used to receive a reset request signal, and the output end of the first AND gate is connected to the reset delay circuit. When the CPLD does not need to load new firmware, the shutdown signal is a high level signal, the first NAND gate outputs a low level signal, and the first AND gate outputs a low level, that is, the first reset signal is a low level signal. When the processor receives the reset request signal (high level by default), the shutdown signal is switched from a high level to a low level, and the first NAND gate outputs a high level signal. At this time, the first AND gate outputs a high level, that is, the first reset signal is switched from a low level to a high level, and after being delayed preprocessed by the reset delay circuit, the second reset signal changes smoothly from a high level to a low level.

[0059] In one implementation mode, the effective level of the shutdown signal is a high level, and the effective level of the first reset signal is a high level; then Fig. 9 As shown, the logic gate circuit includes: a first AND gate and a second AND gate; the first input end of the first AND gate is connected to the processor, the first input end of the first AND gate is used to receive a shutdown signal, and the second input end of the first AND gate is used to combine a high level signal; the output end of the first AND gate is connected to the first input end of the second AND gate, the second input end of the second AND gate is connected to the IO control unit, the second input end of the second AND gate is used to receive a reset request signal, and the output end of the second AND gate is connected to the reset delay circuit. When the CPLD does not need to load new firmware, the shutdown signal is a low level signal, the first AND gate outputs a low level signal, and the second AND gate outputs a low level, that is, the first reset signal is a low level signal. When the processor receives the reset request signal (high level by default), the shutdown signal is switched from low level to high level, the first AND gate outputs a high level signal, and at this time the second AND gate outputs a high level, that is, the first reset signal is switched from low level to high level, and after the reset delay circuit delay preprocessing, the second reset signal changes smoothly from high level to low level.

[0060] In order to facilitate the understanding of the entire process of CPLD firmware loading, the process is described below. BMC burns the built-in Flash (flash memory) of CPLD through JTAG, so as to preload the new version of firmware into Flash. After the preloading is completed, BMC sets the preset identification bit of the internal register of CPLD through I2C, and sets the character therein to 1. When the IO control unit detects that the character in the preset identification bit of the register is 1, it sends a reset request signal to the processor. The priority of the reset request signal can be set to a lower priority. When the processor receives the reset request signal, it will wait for other events with higher priority to be processed before responding. The processor is used to generate a shutdown signal in response to the reset request signal. After receiving the shutdown signal, the CPLD sends a first reset signal to the reset delay circuit. After the reset delay circuit delays the preprocessing, a second reset signal is obtained. After receiving the second reset signal, the CPLD starts to reset. After resetting, the updated firmware version is loaded and run, thereby completing the upgrade of the new version of the firmware. Among them, after resetting, the CPLD will automatically set the character in the preset identification bit of the register to 0.

[0061] Among them, different logic gate circuits can be combined with different reset delay circuits in different ways to obtain different solutions. Therefore, the above-mentioned example illustrations cannot be understood as limiting the solution of the present application.

[0062] Based on the same inventive concept, the embodiment of the present application also provides a CPLD firmware loading method, which is applied to a CPLD in an electronic device, and the electronic device also includes a processor and a reset delay circuit. Fig.10 The process is described below.

[0063] Step S101: Determine that the firmware version in the CPLD has been updated, and send a reset request signal to the processor.

[0064] In an optional implementation, whether the firmware version in the CPLD is refreshed can be determined by judging whether the character in the preset identification bit of the register in the CPLD is a preset character. When the character in the preset identification bit of the register is a preset character, it is determined that the firmware version in the CPLD has been refreshed. If the character in the preset identification bit is 1, it is determined that the firmware version in the CPLD has been refreshed.

[0065] Step S102: receiving a shutdown signal sent by the processor in response to the reset request signal, and sending a first reset signal to the reset delay circuit.

[0066] After receiving the reset request signal sent by the CPLD, the processor sends a shutdown signal to the CPLD in response to the reset request signal. After receiving the shutdown signal, the CPLD sends a first reset signal to the reset delay circuit.

[0067] Step S103: receiving a second reset signal generated by the reset delay circuit in response to the first reset signal, and performing a reset.

[0068] After receiving the first reset signal, the reset delay circuit generates a second reset signal in response to the first reset signal, that is, the first reset signal is delayed and preprocessed by the reset delay circuit to obtain the second reset signal. The CPLD resets after receiving the second reset signal.

[0069] Step S104: After resetting, load and run the updated firmware version.

[0070] The CPLD firmware loading method provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned device embodiment. For the sake of brief description, for matters not mentioned in the method embodiment, reference may be made to the corresponding contents in the aforementioned device embodiment.

[0071] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0072] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An electronic device, characterized in that: include: A processor, a reset delay circuit, and a CPLD, wherein the CPLD is connected to the processor and the reset delay circuit respectively; The CPLD is used to determine that the firmware version in the CPLD has been updated and send a reset request signal to the processor; The processor is used to generate a shutdown signal in response to the reset request signal, wherein the priority of the reset request signal is a lower priority. When the processor receives the reset request signal, it will wait for other events with higher priorities to be processed before responding; The CPLD is also used to receive the shutdown signal and send a first reset signal to the reset delay circuit; The reset delay circuit is used to perform delay preprocessing on the first reset signal to obtain a second reset signal; The CPLD is also used to receive the second reset signal and perform a reset, and after the reset, load and run the updated firmware version.

2. The electronic device according to claim 1, characterized in that: The CPLD includes a register and an IO control unit, wherein the register is preset with a flag bit for indicating whether the firmware version in the CPLD is refreshed; An IO control unit, used to determine whether the firmware version in the CPLD has been updated by judging whether the character in the preset identification bit of the register is a preset character; When the character in the preset identification bit of the register is the preset character, it is determined that the firmware version in the CPLD has been updated.

3. The electronic device according to claim 1, characterized in that: The reset delay circuit includes: an RC delay circuit and a shaping circuit, wherein both the RC delay circuit and the shaping circuit are connected to the CPLD, and the RC delay circuit is also connected to the shaping circuit; the RC delay circuit is used to delay the first reset signal to obtain a signal that changes slowly from a low level to a high level, or to obtain a signal that changes slowly from a high level to a low level; the shaping circuit is used to shape the signal that changes slowly from a low level to a high level, or to shape the signal that changes slowly from a high level to a low level, to obtain a second reset signal that changes smoothly from a high level to a low level.

4. The electronic device according to claim 3, characterized in that: The effective level of the first reset signal is a low level, and the effective level of the second reset signal is a low level; The RC delay circuit includes: a first resistor, a second resistor, a third resistor, a first capacitor, a diode and a switch tube; the shaping circuit includes: an inverting Schmitt trigger; The first end of the first resistor is connected to the CPLD, the first end of the first resistor is also connected to the power supply through the second resistor, the first end of the first resistor is also connected to the anode end of the diode, the second end of the first resistor is grounded via the first capacitor, the second end of the first resistor is also respectively connected to the cathode end of the diode and the first end of the switch tube, the second end of the switch tube is grounded, the third end of the switch tube is connected to the input end of the inverting Schmitt trigger, the third end of the switch tube is also connected to the power supply through the third resistor, and the output end of the inverting Schmitt trigger is connected to the CPLD.

5. The electronic device according to claim 3, characterized in that: The effective level of the first reset signal is a high level, and the effective level of the second reset signal is a low level; The RC delay circuit includes: a first resistor, a second resistor, a third resistor, a first capacitor, a diode and a switch tube; the shaping circuit includes: a positive phase Schmitt trigger; The first end of the first resistor is connected to the CPLD, the first end of the first resistor is also connected to the power supply through the second resistor, the first end of the first resistor is also connected to the cathode end of the diode, the second end of the first resistor is grounded via the first capacitor, the second end of the first resistor is also respectively connected to the anode end of the diode and the first end of the switch tube, the second end of the switch tube is grounded, the third end of the switch tube is connected to the input end of the positive phase Schmitt trigger, the third end of the switch tube is also connected to the power supply through the third resistor, and the output end of the positive phase Schmitt trigger is connected to the CPLD.

6. The electronic device according to claim 1, characterized in that: The CPLD comprises: an IO control unit and a logic gate circuit, wherein the logic gate circuit is respectively connected to the IO control unit, the processor and the reset delay circuit; The IO control unit is used to determine that the firmware version in the CPLD has been updated, and send the reset request signal to the processor and the logic gate circuit respectively; The logic gate circuit is used to perform a logic operation on the reset request signal and the shutdown signal, and output the first reset signal.

7. The electronic device according to claim 6, characterized in that: The effective level of the shutdown signal is a low level, the effective level of the first reset signal is a low level, and the logic gate circuit includes: a first NAND gate and a second NAND gate; the first input end of the first NAND gate is connected to the processor, the first input end of the first NAND gate is used to receive the shutdown signal, and the second input end of the first NAND gate is used to receive a high level signal; the output end of the first NAND gate is connected to the first input end of the second NAND gate, the second input end of the second NAND gate is connected to the IO control unit, the second input end of the second NAND gate is used to receive the reset request signal, and the output end of the second NAND gate is connected to the reset delay circuit.

8. The electronic device according to claim 6, characterized in that: The effective level of the shutdown signal is a low level, and the effective level of the first reset signal is a high level; the logic gate circuit includes: a first NAND gate and a first AND gate; the first input end of the first NAND gate is connected to the processor, the first input end of the first NAND gate is used to receive the shutdown signal, and the second input end of the first NAND gate is used to receive a high level signal; the output end of the first NAND gate is connected to the first input end of the first AND gate, the second input end of the first AND gate is connected to the IO control unit, the second input end of the first AND gate is used to receive the reset request signal, and the output end of the first AND gate is connected to the reset delay circuit.

9. The electronic device according to claim 6, characterized in that: The effective level of the shutdown signal is a high level, and the effective level of the first reset signal is a high level; the logic gate circuit includes: a first AND gate and a second AND gate; the first input end of the first AND gate is connected to the processor, the first input end of the first AND gate is used to receive the shutdown signal, and the second input end of the first AND gate is used to combine a high level signal; the output end of the first AND gate is connected to the first input end of the second AND gate, the second input end of the second AND gate is connected to the IO control unit, the second input end of the second AND gate is used to receive the reset request signal, and the output end of the second AND gate is connected to the reset delay circuit.

10. A CPLD firmware loading method, characterized in that: A CPLD applied to an electronic device, wherein the electronic device further comprises a processor and a reset delay circuit; the CPLD is connected to the processor and the reset delay circuit respectively; the method comprises: Determining that the firmware version in the CPLD has been updated, and sending a reset request signal to the processor; receiving a shutdown signal sent by the processor in response to the reset request signal, and sending a first reset signal to the reset delay circuit, wherein the priority of the reset request signal is a lower priority, and when the processor receives the reset request signal, it will wait until other events with higher priorities are processed before responding; receiving a second reset signal generated by the reset delay circuit in response to the first reset signal, and performing a reset; After reset, the updated firmware version is loaded and run.

Citation Information

Patent Citations

  • A method for autonomously taking effect after a server refreshes a CPLD and a BMC

    CN109669712A

  • Power management method of CPLD and related device

    CN109933377A

  • Control circuit for restarting CPLD (complex programmable logic device)

    CN110275482A

  • CPU reset control method and system and storage medium

    CN111208893A

  • Electronic device with automatic and stable system restart function

    US20190188081A1