Patent Publication Number: US-11385885-B2

Title: System and method of downloading a firmware to a server

Description:
TECHNICAL FIELD 
     This invention relates to system and method of downloading a firmware to a server via a smart phone and a USB port of the server. 
     BACKGROUND OF THE INVENTION 
     A mainboard of a server includes a baseboard management controller (BMC) which provides fundamental services of server management. It is thus imperative to prevent corruption of the BMC and to provide recovery solutions in case of corruption. In one existing recovery solution, a separate Uboot/Kernel provided with a file system is saved in a separate “almost RO” chip, e.g. a NOR flash. The Uboot/Kernel reads the recovery image from a trivial file transfer protocol (TFTP) server or flash disk. The drawbacks of such an arrangement include (a) a separate chip is required to save the recovery image for recovery purpose; (b) a serial debug cable is usually required to be attached for the operations, and (c) the security concern over the use of flash disks. One other possible recovery solution includes saving two copies of the BMC images in two chips, with one of the two chips being reserved for recovery purpose only. If all bootable images are corrupted, then replacement of the mainboard is the only choice. 
     It is thus an object of the present invention to provide a server and a method in which the aforesaid shortcomings are mitigated or at least to provide a useful alternative to the trade and public. 
     SUMMARY OF THE INVENTION 
     According to a first aspect of the present invention, there is provided a server including a mainboard with a baseboard management controller (BMC) having a universal serial bus (USB) device controller; at least one USB port; and an integrated circuit (IC) device, wherein the IC device is operable to connect said USB port to said USB device controller of said BMC. 
     According to a second aspect of the present invention, there is provided a method including connecting a universal serial bus (USB) port of a server to a USB device controller of a baseboard management controller (BMC) of the server; resetting said BMC; connecting a data processing device with said server via said USB port; and downloading a firmware to said BMC from or through said data processing device via said USB port. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       Embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which: 
         FIG. 1  shows a schematic view of an arrangement for downloading a firmware to a server via a smart phone and a USB port of the server; 
         FIGS. 2A, 2B and 2C  show steps of a first method of downloading a firmware to a server via a smart phone and a USB port of the server; and 
         FIGS. 3A and 3B  show steps of a second method of downloading a firmware to a server via a smart phone and a USB port of the server. 
     
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
     A schematic view of an example system for downloading a firmware to a server  10  via a smart phone  12  and a USB port  14  of the server  10  is shown in  FIG. 1 . The smart phone  12  is with Internet connectivity, and the USB port  14  may be a USB Type A receptacle. The smart phone  12  is connected via a standard USB On-The-Go (OTG) cable  30  with the USB port  14 . The USB port  14  is selectively connectable via a switch  16  to:
         (a) a USB host controller  18   a  of a platform controller hub (PCH)  18 ,   (b) a USB host controller  20   a  of a baseboard management controller (BMC)  20 ,   (c) a USB device controller  20   b  of the BMC  20 , and   (d) an integrated circuit (IC) device, in the form of a field-programmable gate array (FPGA)  22 .       

     The FPGA  22  is connected with boot pins  24  of the server  10 , and with an identity (ID) button  26  and a power (PWR) button  28  of the server  10 . 
     Normally, the USB port  14  is assigned to the server host, and connected with the USB host controller  18   a  of the PCH  18 . The BMC  20  may load a boot image from a NAND or NOR flash; the PWR button  28  is operable to power on/off the server  10  and the ID button  26  is a button with light-emitting diode (LED) indication. 
     For carrying out the firmware recovery process according to a first method, the ID button  26  and the PWR button  28  are pressed at the same time, whereby instructions are sent to the FPGA  22 , which activates the switch  16  to disconnect the USB port  14  from the USB host controller  18   a  of the PCH  18  and to connect the USB port  14  instead with the USB device controller  20   b  of the BMC  20 . The FPGA  22  then changes the values of the boot pins  24  to enable BMC boot from the USB device port  14 , and finally resets the BMC  20 . 
     Turning then to  FIGS. 2A to 2C , the BMC boot ROM listens to the USB device port  14  (S 100 ). The smart phone  12  is connected via a standard USB On-The-Go (OTG) cable  30  with the USB port  14 . The smart phone  12  has installed application software (Apps) which is able to send commands to the USB device controller  20   b  of the BMC  20 . If the image data of the firmware are received (S 102 ) from or through the smart phone  12 , the image data are downloaded to the SRAM (S 104 ) of the BMC  20 . It should be noted that regardless of the number of firmware images to be downloaded, a FirmwareWriter application software may be downloaded first. It should also be appreciated that, in addition to the SRAM of the BMC  20 , the image data of the firmware may be downloaded to other storage locations. The BMC  20  then checks whether the download is complete (S 106 ), and if not, the BMC boot ROM continues to listen to the USB device port  14  (S 100 ). If, on the other hand, the download is complete (S 106 ), the BMC boot ROM jumps to the entry image entry point (S 108 ). 
     The smart phone Apps selects the appropriate firmware image (S 110 ), sends a transmission start command (S 112 ), sends the selected firmware image (S 114 ), and then sends a transmission end command (S 116 ). If the download is to be continued (S 118 ), the Apps starts a new firmware image (S 110 ). If the download is not to be continued (S 118 ), the smart phone Apps ends the operation (S 120 ). 
     The FirmwareWriter application software initializes a target flash memory (S 122 ) and listens to the USB device port  14  (S 124 ). If image data are received (S 126 ), it checks the image type (S 128 ) and saves the image (e.g. firmware copy) to the target flash memory (S 130 ). It then checks whether the download is complete (S 132 ). If not, it again listens to the USB device port  14  (S 124 ) for the reception of image data (S 126 ). If the download is complete (S 132 ), it will check if a next image is to be transferred (S 134 ). If so, it again listens to the USB device port  14  (S 124 ) for the reception of image data (S 126 ). If no further image is to be transferred (S 134 ), it will reset the boot pins  24  (S 136 ), and then reset the BMC  20  (S 138 ). 
     If the BMC CPU does not support booting from USB device port  14 , and as shown in  FIGS. 3A and 3B , the FPGA  22  disconnects the USB port  14  from the USB host controller  18   a  of the PCH  18  and connects the USB port  14  instead with the USB device controller  20   b  of the BMC  20 , and reboots the BMC  20 . 
     The Uboot checks the boot pins (S 140 ) to determine whether the USB device port  14  has been switched to the USB device controller  20   b  of the BMC  20  (S 141 ). The Uboot then listens to the USB device port  14  (S 142 ) to check if any image data (e.g. of a firmware) are received (S 144 ) from a smart phone  12 . If image data are received from a smart phone  12 , the image data are written to the target position (S 146 ). The Uboot then checks if the download is complete (S 148 ). If not, it will continue to listen to the USB device port  14  (S 142 ). If the download is complete (S 148 ), it will inform the FPGA  22  to switch the USB port  14  back to the PCH  18  of the server  10  (S 150 ), and then the normal boot process will continue (S 152 ). 
     The smart phone  12  is installed with a smart phone application software (Apps). The Apps checks the machine type of the server  10  (S 154 ), and then selects the appropriate image type to be transferred (S 156 ) from the network or Internet location to which it is connected. The Apps then downloads the image from a remote site (S 158 ), such as an trusted website. It then sends a transmission start command (S 160 ), sends the selected firmware image (S 162 ), and then sends a transmission end command (S 164 ). It will then check if the download is to continue (S 166 ). If so, the Apps again selects the appropriate image type to be transferred (S 156 ) from the trusted website to which it is connected. If, on the other hand, no further downloading is required, the Apps will end operation (S 168 ). 
     The following are advantages of the present invention:
         a. recovery and updating server firmware is simplified and cost is reduced;   b. trusted firmware images may be downloaded from trusted websites of the original manufacturers of the BMC;   c. server firmware may be recovered from scratch; and   d. no separate flash chip are required for saving the Uboot/Kernel.       

     It should be understood that the above only illustrates examples whereby the present invention may be carried out, and that various modifications and/or alterations may be made thereto without departing from the spirit of the invention. 
     It should also be understood that certain features of the invention, which are, for clarity, described in the context of separate embodiments, may be provided in combination in a single embodiment. Conversely, various features of the invention which are, for brevity, described in the context of a single embodiment, may also be provided separately or in any appropriate sub-combinations.