1. Technical Field
The present disclosure relates to an electronic device for loading firmware, and, particularly to an electronic device and a method for loading a firmware of a baseboard management controller.
2. Description of Related Art
Before starting an electronic device with a baseboard management controller (BMC), the BMC should be initialized first. The BMC is initialized by loading a firmware of the BMC which is pre-stored in a read-only memory (ROM) to the BMC by a universal boot loader (U-boot) application. However, if the firmware of the BMC is damaged, the electronic device cannot be started.
The components of the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout several views.
The electronic device 100 further includes a port 50 for connecting an external storage 40. The external storage 40 stores a second firmware 401 which is a backup of the first firmware 101. In the embodiment, the external storage 40 is a universal serial bus (USB) disk and the port 50 is a USB port which is connected to the BMC 30 through a south-bridge 60.
When receiving power after the electronic device 100 is powered on, the BMC 30 runs the boot application 201 to load the first firmware 101 from the first internal storage 10. If the first firmware 101 is loaded successfully, the BMC 30 is initialized and the electronic device 100 can be started. If the first firmware 101 fails to load, the BMC 30 detects whether the external storage 40 is connected to the USB port 50. If the external storage 40 is connected to the USB port 50, the BMC 30 copies the second firmware 401 to the first internal storage 10 to replace the first firmware 101. After the first firmware 101 is replaced, the electronic device 100 is powered off and on again, and the BMC 30 runs the boot application 201 to obtain the replaced first firmware 101 to initialize the BMC 30.
In the embodiment, the first firmware 101 includes a checksum for indicating the integrity of the first firmware. If the checksum of the first firmware 101 is detected to be wrong, the BMC 30 determines a failure to load of the first firmware.
In the embodiment, if the first firmware 101 cannot be loaded from the first internal storage 10, the BMC 30 sets a loading failure identifier to the boot application 101. The BMC 30 detects whether the loading failure identifier exists in the boot application 201 so as to determine whether the first firmware 101 has successfully loaded. If the first firmware 101 is replaced, the BMC 30 deletes the loading failure identifier from the boot application 201.
In step S21, the BMC 30 receives power when the electronic device 100 is powered on.
In step S22, the BMC 30 runs a boot application 201 to load the first firmware 101 from the first internal storage 10.
In step S23, the BMC 30 determines whether the first firmware 101 has successfully loaded.
In step S24, the BMC 30 is initialized and the electronic device 100 can be started if the first firmware 101 has successfully loaded.
In step S25, the BMC 30 copies the second firmware 201 from the external storage to the first internal storage 10 to replace the first firmware 101, if the first firmware 101 fails to load.
In step S26, after the first firmware 101 is replaced, the BMC 30 powers off the electronic device 100 and the procedure goes back to step S21 to power on the electronic device 100 again to reload the first firmware 101 from the first internal storage 10.
In another embodiment, if it is determined that the first firmware 101 has failed to load in step S23, the BMC 30 sets the loading failure identifier to the boot application 201 before implementing the step S25. After the electronic device 100 is powered on, in step S23, the BMC detects whether the loading failure identifier exists in the boot application 201 so as to determine whether the first firmware 101 has successfully loaded. If the first firmware 101 is replaced, the BMC 30 deletes the loading failure identifier from the boot application 201.
Although the present disclosure has been specifically described on the basis of preferred embodiments, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201110455915.8 | Dec 2011 | CN | national |