A kind of firmware upgrade method
Technical field
This application involves field of computer technology, more particularly to a kind of firmware upgrade method.
Background technique
Firmware refers to write-in EROM (rewritable read-only memory) or EEPROM (Electrically Erasable Programmable Read-Only Memory)
In program, be equipment inside save device driver, operating system by firmware according to standard device drives realize
The run action of machine.In memory apparatus system, peripheral equipment usually depends on the programming stored in logical process chip and patrols
Collect firmware, Lai Zhihang corresponding operation.
The problem of firmware program in order to repair script and mistake, it is often necessary to be pacified by updating firmware code
Fill new firmware version, i.e., realization firmware upgrade, with using the firmware reparation after upgrading there are the problem of and mistake.Now more
Common firmware upgrade method is usually online upgrading, i.e., firmware file is passed through I2C by operating system or other methods, led to
Specific peripheral equipment is transmitted to physical links such as input/output (General Purpose Input Output, GPIO)
On logic chip, to realize firmware upgrade.
If unexpected situations such as power-off or program exception occurs, may be such that certain however during the upgrading of above-mentioned line
Some specific peripheral equipments rest on the firmware erasing stage, i.e., on these peripheral equipments both without the original firmware file of operation or
Firmware file after not running upgrading, correspondingly, which will be unable to work normally, so as to lead to whole operation
System can not work normally.For example, if CPLD rests on the stage of firmware erasing, system in escalation process because being abnormal
It will be unable to power on.
Summary of the invention
In order to solve the above-mentioned technical problem, this application provides a kind of firmware upgrade methods, can be abnormal situation
When, guarantee smoothly completing for firmware upgrade.
The embodiment of the present application discloses following technical solution:
In a first aspect, the embodiment of the present application provides a kind of firmware upgrade method, it is applied to upgrade controller, the method
Include:
Receive and store the firmware upgrade file of peripheral equipment;
The firmware upgrade file is correspondingly transmitted to corresponding peripheral equipment, so that the peripheral equipment utilizes
The firmware upgrade file carries out firmware upgrade;
If the sudden abnormal condition during firmware upgrade, judge the peripheral equipment firmware upgrade whether
It completes, if not completing, the firmware upgrade file that itself is stored correspondingly is transmitted to corresponding peripheral equipment.
Optionally, whether the firmware upgrade for judging the peripheral equipment is completed, comprising:
Detect the version number of the firmware run on the peripheral equipment;
If can't detect the version number of the firmware, it is determined that the firmware upgrade of the peripheral equipment does not complete;
If retrieving the version number of the firmware, the periphery for judging that the version number of the firmware stores with itself is set
The version number of standby corresponding firmware upgrade file is consistent, if inconsistent, it is determined that the firmware upgrade of the peripheral equipment does not complete.
Optionally, the abnormal conditions include: device Host abnormal power-down, the firmware upgrade file Transmission.
Optionally, when the abnormal conditions are device Host abnormal power-down, the firmware of the judgement peripheral equipment
Whether upgrading is completed, comprising:
After re-powering for the equipment, judge whether the firmware upgrade of the periphery is completed, the upgrade controller
It is individually powered by the equipment.
Optionally, the peripheral equipment includes: universal input/output GPIO, power supply module PSU, SAS expander core
Piece.
Second aspect, the embodiment of the present application provide a kind of device for upgrading firmware, and described device includes:
Receiving module, for receiving and storing the firmware upgrade file of peripheral equipment;
Transmission module, for the firmware upgrade file to be correspondingly transmitted to corresponding peripheral equipment, so that institute
It states peripheral equipment and carries out firmware upgrade using the firmware upgrade file;
Exception processing module, if judging the periphery for the sudden abnormal condition during firmware upgrade
Whether the firmware upgrade of equipment is completed, if do not complete, by itself store the firmware upgrade file be correspondingly transmitted to
Its corresponding peripheral equipment.
Optionally, the exception processing module is specifically used for:
Detect the version number of the firmware run on the peripheral equipment;
If can't detect the version number of the firmware, it is determined that the firmware upgrade of the peripheral equipment does not complete;
If retrieving the version number of the firmware, the periphery for judging that the version number of the firmware stores with itself is set
The version number of standby corresponding firmware upgrade file is consistent, if inconsistent, it is determined that the firmware upgrade of the peripheral equipment does not complete.
Optionally, the abnormal conditions include: device Host abnormal power-down, the firmware upgrade file Transmission.
Optionally, when the abnormal conditions are device Host abnormal power-down, the exception processing module is specifically used for:
After re-powering for the equipment, judge whether the firmware upgrade of the periphery is completed, the upgrade controller
It is individually powered by the equipment.
Optionally, the peripheral equipment includes: universal input/output GPIO, power supply module PSU, SAS expander core
Piece.
It can be seen from above-mentioned technical proposal in firmware upgrade method provided by the embodiments of the present application, upgrade controller
The firmware upgrade file of peripheral equipment is received and stored, the received firmware upgrade file of institute is then transmitted to corresponding periphery and is set
It is standby, so that peripheral equipment carries out firmware upgrade using corresponding firmware upgrade file, if the unexpected abnormality in firmware upgrade process
Situation, upgrade controller judge whether the firmware upgrade of peripheral equipment is completed, if not completing, upgrade controller again stores itself
Firmware upgrade file be transmitted to corresponding peripheral equipment again.In the firmware upgrade method, upgrade controller can be solid
In part escalation process in the case where sudden abnormal condition, whether machine core judgement is completed to peripheral equipment firmware upgrade, and not complete
In the case where, by itself store firmware upgrade file be retransmitted to peripheral equipment so that peripheral equipment again into
Row firmware upgrade, even if emergency case thus occurs in firmware upgrade process, upgrade controller can also guarantee firmware upgrade
Smoothly complete.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application without any creative labor, may be used also for those of ordinary skill in the art
To obtain other drawings based on these drawings.
Fig. 1 is the application scenarios schematic diagram of firmware upgrade method provided by the embodiments of the present application;
Fig. 2 is the flow diagram of firmware upgrade method provided by the embodiments of the present application;
Fig. 3 is the structural schematic diagram of device for upgrading firmware provided by the embodiments of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only this
Apply for a part of the embodiment, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art exist
Every other embodiment obtained under the premise of creative work is not made, shall fall in the protection scope of this application.
The description and claims of this application and term " first ", " second ", " third ", " in above-mentioned attached drawing
The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage
The data that solution uses in this way are interchangeable under appropriate circumstances, so that embodiments herein described herein for example can be to remove
Sequence other than those of illustrating or describe herein is implemented.In addition, term " includes " and " having " and theirs is any
Deformation, it is intended that cover it is non-exclusive include, for example, containing the process, method of a series of steps or units, system, production
Product or equipment those of are not necessarily limited to be clearly listed step or unit, but may include be not clearly listed or for this
A little process, methods, the other step or units of product or equipment inherently.
It in the prior art,, may if sudden abnormal condition during carrying out firmware upgrade using the method for online upgrading
It will lead to certain peripheral equipments and rest on the firmware erasing stage, in this way, these peripheral equipments will be unable to work normally, and then may
Whole operation system is caused to can not work normally.
In order to guarantee when being abnormal situation, firmware upgrade can also be normally completed, and the embodiment of the present application provides one
Kind firmware upgrade method.First the core technology thinking of the firmware upgrade method is introduced below.
In firmware upgrade method provided by the embodiments of the present application, upgrade controller receives and stores the firmware of peripheral equipment
Then the received firmware upgrade file of institute is transmitted to corresponding peripheral equipment by upgrade file, so that peripheral equipment utilizes correspondence
Firmware upgrade file carry out firmware upgrade, if the sudden abnormal condition in firmware upgrade process, upgrade controller judgement periphery
Whether the firmware upgrade of equipment is completed, if not completing, upgrade controller again transmits the firmware upgrade file that itself is stored again
To corresponding peripheral equipment.
In above-mentioned firmware upgrade method, upgrade controller can be in firmware upgrade process the case where sudden abnormal condition
Under, whether machine core judgement is completed to peripheral equipment firmware upgrade, and in the case where unfinished, the firmware upgrade that itself is stored
File is retransmitted to peripheral equipment, so that peripheral equipment re-starts firmware upgrade, even if thus in firmware upgrade
Emergency case occurs in journey, upgrade controller can also guarantee smoothly completing for firmware upgrade.
For the ease of further understanding firmware upgrade method provided by the embodiments of the present application, below with reference to the firmware upgrade side
The application scenarios of method are illustrated this method.
As shown in Figure 1, being the application scenarios schematic diagram of firmware upgrade method provided by the embodiments of the present application.The application scenarios
In include central controller (central processing unit, CPU), upgrade controller, universal input/output
(general purpose input output, GPIO), power supply module (power supply unit, PSU) and SAS
Expander chip (hereinafter referred to as SAS);Wherein, CPU is used to the firmware upgrade file of peripheral equipment being transferred to upgrade controller;
GPIO, PSU and SAS belong to peripheral equipment, it should be appreciated that there is also other peripheral equipments, peripheral equipments in practical applications
It is not limited in GPIO, PSU and SAS.
Firmware upgrade method provided by the present application is introduced by way of examples below:
Referring to fig. 2, Fig. 2 is the flow diagram of firmware upgrade method provided by the embodiments of the present application, the firmware upgrade side
Method is applied to upgrade controller.As shown in Fig. 2, this method comprises:
Step 201: receiving and storing the firmware upgrade file of peripheral equipment.
Step 202: the firmware upgrade file being correspondingly transmitted to corresponding peripheral equipment, so that the periphery
Firmware upgrade file described in equipment utilization carries out firmware upgrade.
When needing to carry out firmware upgrade to peripheral equipment, CPU passes through PCH for the firmware liter for the peripheral equipment for needing to upgrade
Grade file is sent to upgrade controller, and upgrade controller stores the firmware itself received after receiving firmware upgrade file
Upgrade file, and the firmware upgrade for correspondingly receiving itself is sent to corresponding peripheral equipment, so that the periphery is set
It is standby to carry out firmware upgrade using itself received firmware upgrade file.
Specifically, CPU, which is sent in the firmware upgrade file of upgrade controller, usually carries specific mark, the mark
The corresponding peripheral equipment of firmware upgrade file can be characterized, in turn, upgrade controller in firmware upgrade file according to carrying
Mark, determines the corresponding peripheral equipment of firmware upgrade file, and the firmware upgrade file is correspondingly transferred to the peripheral equipment.
It should be noted that CPU can only correspond to the firmware upgrade text of some peripheral equipment to upgrade controller transmission
Part, CPU can also correspond respectively to multiple firmware upgrade files of multiple peripheral equipments to upgrade controller transmission simultaneously, herein
Not to CPU the number of received firmware upgrade file do any restriction.
It should be noted that above-mentioned peripheral equipment may include universal input/output GPIO, power supply module PSU and
SAS expander chip, certainly, peripheral equipment can also include other hardware devices, not do any restriction to peripheral equipment herein.
Step 203: if the sudden abnormal condition during firmware upgrade, judging the firmware of the peripheral equipment
Whether upgrading is completed, if not completing, the firmware upgrade file that itself is stored correspondingly is transmitted to corresponding outer
Peripheral equipment.
If being abnormal situation in firmware upgrade process, upgrade controller can correspondingly detect happened suddenly exception
Situation, in turn, after abnormal conditions, upgrade controller judges whether the firmware upgrade of peripheral equipment is completed, if not completing,
The firmware upgrade file that itself is stored then correspondingly is transmitted to corresponding peripheral equipment by upgrade controller again again, so that this is outer
Peripheral equipment re-starts firmware upgrade.
In one possible implementation, after abnormal conditions, upgrade controller be can detecte on peripheral equipment
The version number of the firmware of operation illustrates on the peripheral equipment if can't detect the version number of the firmware run on peripheral equipment
Firmware be wiped free of, and firmware upgrade file is also not written into the peripheral equipment, then upgrade controller can determine that this is outer
The firmware upgrade of peripheral equipment does not complete, and then the corresponding firmware upgrade file of the peripheral equipment that itself is stored is transferred to again
The peripheral equipment;If upgrade controller detects the version number of firmware, the version number of the firmware and being somebody's turn to do for itself storage are judged
Whether the version number of the corresponding firmware upgrade file of peripheral equipment is consistent, if inconsistent, illustrates the firmware liter of the peripheral equipment
Grade does not complete, then the corresponding firmware upgrade file of the peripheral equipment that upgrade controller stores itself is transferred to the periphery again
Equipment.
It should be understood that in practical applications, upgrade controller can also judge by other means whether peripheral equipment is completed
Firmware upgrade, such as the numerical value by storing in register judge whether firmware upgrade is completed, herein not to judging firmware liter
The mode whether grade is completed does any restriction.
It should be noted that above-mentioned abnormal conditions mainly include device Host abnormal power-down, because of the originals such as data-signal is bad
Firmware upgrade file Transmission etc. because caused by, certain abnormal conditions can also include other situations, herein not to exception
The concrete condition of situation does any restriction.
It should be noted that above-mentioned upgrade controller is individually powered, i.e. the power supply of the upgrade controller is not outer by GPIO etc.
Peripheral equipment is controlled, if the abnormal conditions occurred are device Host abnormal power-down, after device Host re-powers, and the liter
Grade controller can power on automatically, and correspondingly, which can determine whether that each periphery is set after device Host re-powers
Whether standby firmware upgrade is completed.
In firmware upgrade method provided by the embodiments of the present application, upgrade controller receives and stores the firmware of peripheral equipment
Then the received firmware upgrade file of institute is transmitted to corresponding peripheral equipment by upgrade file, so that peripheral equipment utilizes correspondence
Firmware upgrade file carry out firmware upgrade, if the sudden abnormal condition in firmware upgrade process, upgrade controller judgement periphery
Whether the firmware upgrade of equipment is completed, if not completing, upgrade controller again transmits the firmware upgrade file that itself is stored again
To corresponding peripheral equipment.In the firmware upgrade method, upgrade controller can in firmware upgrade process unexpected abnormality feelings
In the case where condition, whether machine core judgement is completed to peripheral equipment firmware upgrade, and in the case where unfinished, by itself storage
Firmware upgrade file is retransmitted to peripheral equipment, so that peripheral equipment re-starts firmware upgrade, even if thus solid
Emergency case occurs in part escalation process, upgrade controller can also guarantee smoothly completing for firmware upgrade.
For firmware upgrade method described above, the embodiment of the present application also provides a kind of device for upgrading firmware, so as to
The realization of above-mentioned firmware upgrade method.
It is the structural schematic diagram of device for upgrading firmware provided by the embodiments of the present application referring to Fig. 3.As shown in figure 3, the device
Include:
Receiving module 301, for receiving and storing the firmware upgrade file of peripheral equipment;
Transmission module 302, for the firmware upgrade file to be correspondingly transmitted to corresponding peripheral equipment, so that
The peripheral equipment carries out firmware upgrade using the firmware upgrade file;
Exception processing module 303, if judging described outer for the sudden abnormal condition during firmware upgrade
Whether the firmware upgrade of peripheral equipment is completed, if not completing, the firmware upgrade file that itself is stored correspondingly is transmitted to
Corresponding peripheral equipment.
Optionally, the exception processing module is specifically used for:
Detect the version number of the firmware run on the peripheral equipment;
If can't detect the version number of the firmware, it is determined that the firmware upgrade of the peripheral equipment does not complete;
If retrieving the version number of the firmware, the periphery for judging that the version number of the firmware stores with itself is set
The version number of standby corresponding firmware upgrade file is consistent, if inconsistent, it is determined that the firmware upgrade of the peripheral equipment does not complete.
Optionally, the abnormal conditions include: device Host abnormal power-down, the firmware upgrade file Transmission.
Optionally, when the abnormal conditions are device Host abnormal power-down, the exception processing module is specifically used for:
After re-powering for the equipment, judge whether the firmware upgrade of the periphery is completed, the upgrade controller
It is individually powered by the equipment.
Optionally, the peripheral equipment includes: universal input/output GPIO, power supply module PSU, SAS expander core
Piece.
In device for upgrading firmware provided by the embodiments of the present application, upgrade controller receives and stores the firmware of peripheral equipment
Then the received firmware upgrade file of institute is transmitted to corresponding peripheral equipment by upgrade file, so that peripheral equipment utilizes correspondence
Firmware upgrade file carry out firmware upgrade, if the sudden abnormal condition in firmware upgrade process, upgrade controller judgement periphery
Whether the firmware upgrade of equipment is completed, if not completing, upgrade controller again transmits the firmware upgrade file that itself is stored again
To corresponding peripheral equipment.In the device for upgrading firmware, upgrade controller can in firmware upgrade process unexpected abnormality feelings
In the case where condition, whether machine core judgement is completed to peripheral equipment firmware upgrade, and in the case where unfinished, by itself storage
Firmware upgrade file is retransmitted to peripheral equipment, so that peripheral equipment re-starts firmware upgrade, even if thus solid
Emergency case occurs in part escalation process, upgrade controller can also guarantee smoothly completing for firmware upgrade.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment it
Between same and similar part may refer to each other, each embodiment focuses on the differences from other embodiments.
For equipment and system embodiment, since it is substantially similar to the method embodiment, so describe fairly simple,
The relevent part can refer to the partial explaination of embodiments of method.Equipment and system embodiment described above is only schematic
, wherein unit may or may not be physically separated as illustrated by the separation member, it is shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks
On unit.Some or all of the modules therein can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
Those of ordinary skill in the art can understand and implement without creative efforts.
The above, only a kind of specific embodiment of the application, but the protection scope of the application is not limited thereto,
Within the technical scope of the present application, any changes or substitutions that can be easily thought of by anyone skilled in the art,
Should all it cover within the scope of protection of this application.Therefore, the protection scope of the application should be with scope of protection of the claims
Subject to.