[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

TWI733279B - Server device and method for avoiding firmware cannot be updated again thereof - Google Patents

Server device and method for avoiding firmware cannot be updated again thereof Download PDF

Info

Publication number
TWI733279B
TWI733279B TW108146531A TW108146531A TWI733279B TW I733279 B TWI733279 B TW I733279B TW 108146531 A TW108146531 A TW 108146531A TW 108146531 A TW108146531 A TW 108146531A TW I733279 B TWI733279 B TW I733279B
Authority
TW
Taiwan
Prior art keywords
firmware
unit
interface
programmable logic
logic device
Prior art date
Application number
TW108146531A
Other languages
Chinese (zh)
Other versions
TW202125226A (en
Inventor
張衍輝
陳惠玲
Original Assignee
神雲科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 神雲科技股份有限公司 filed Critical 神雲科技股份有限公司
Priority to TW108146531A priority Critical patent/TWI733279B/en
Publication of TW202125226A publication Critical patent/TW202125226A/en
Application granted granted Critical
Publication of TWI733279B publication Critical patent/TWI733279B/en

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

A server device and a method for avoiding a firmware cannot be updated again thereof are provided. The method includes a firmware loading unit of a PLD loading a first firmware program, so that the sever device operating in a working mode and a functionality of an I2C interface being locked in a status of enable, a controlling unit of the PLD executing an initializing procedure for the firmware loading unit when receiving a firmware update command in the working mode, so that the sever device switching to a setting mode, and in the setting mode, the functionality still being locked in enable; the controlling unit further verifying a second firmware program that to be loaded into the firmware loading unit when receiving the firmware update command, when a verification result is “verifying failed”, the server device outputting a warning message in the setting mode to indicate that the second firmware program is not loaded into the firmware loading unit.

Description

伺服器裝置及其避免韌體無法再次更新之方法Server device and its method to prevent firmware from being unable to update again

本案是關於一種伺服器裝置,且特別是具有可程式化邏輯裝置之伺服器裝置。This case is about a server device, and especially a server device with programmable logic devices.

一般來說,伺服器裝置中會設置可程式化邏輯裝置,用以在伺服器裝置的開機過程控制上電流程、訊號的控制、或參數的傳遞等等,因此,可程式化邏輯裝置中的韌體程式常有更新的需求,通常,可程式化邏輯裝置具有聯合測試行動群組(Joint Test Action Group;JTAG)介面及串列週邊介面(Serial Peripheral Interface;SPI)介面,可程式化邏輯裝置可藉由JTAG介面、I2C介面或SPI介面更新其韌體程式。Generally speaking, a programmable logic device is set in the server device to control the power-on process, signal control, or parameter transmission during the boot process of the server device. Therefore, the programmable logic device Firmware programs are often updated. Generally, programmable logic devices have Joint Test Action Group (JTAG) interfaces and Serial Peripheral Interface (SPI) interfaces, and programmable logic devices The firmware program can be updated through the JTAG interface, I2C interface or SPI interface.

其中,可程式化邏輯裝置藉由JTAG介面與SPI介面連接於伺服器裝置的其他單元時,至少需要六根腳位始符合JTAG介面與SPI介面之規範,且JTAG介面與SPI介面之匯流排走線的長度也有一定限制。考量伺服器裝置內之佈局(layout)空間與連接器成本,JTAG介面與SPI介面較難以符合現今對於伺服器裝置之價格及輕薄之需求,因此,目前可程式化邏輯裝置更新其韌體程式之主要匯流排介面為I2C介面。Among them, when the programmable logic device is connected to other units of the server device through the JTAG interface and the SPI interface, at least six pins are required to meet the specifications of the JTAG interface and the SPI interface, and the JTAG interface and the SPI interface are wired for the bus There are also certain restrictions on the length. Considering the layout space and connector cost in the server device, the JTAG interface and the SPI interface are difficult to meet the current demand for the price and lightness of the server device. Therefore, the current programmable logic device updates its firmware program The main bus interface is the I2C interface.

然而,I2C介面係預設為關閉,伺服器裝置需額外啟用I2C介面才能使可程式化邏輯裝置更新其韌體。當韌體具有錯誤或在韌體的更新過程中發生錯誤時,若此時重啟伺服器裝置之電源將造成I2C介面單元在伺服器裝置重新啟動或上電後為關閉,伺服器裝置之維護者則無法藉由I2C介面再次地更新可程式化邏輯裝置之韌體,進而導致伺服器裝置無法成功地開機,若欲使用JTAG介面再次更新可程式化邏輯裝置之韌體程式時,必須打開伺服器裝置之機殼或機箱蓋,由外部裝置直接連線至JTAG介面的腳位始能更新可程式化邏輯裝置的韌體程式,造成伺服器裝置之維護者之不便。However, the I2C interface is disabled by default, and the server device needs to enable the I2C interface to enable the programmable logic device to update its firmware. When the firmware has an error or an error occurs during the firmware update process, if the power of the server device is restarted at this time, the I2C interface unit will be shut down after the server device is restarted or powered on. The maintainer of the server device The firmware of the programmable logic device cannot be updated again through the I2C interface, and the server device cannot be successfully booted. If you want to use the JTAG interface to update the firmware of the programmable logic device again, you must open the server In the case or cover of the device, the firmware of the programmable logic device can be updated only when the external device is directly connected to the pins of the JTAG interface, causing inconvenience to the maintainer of the server device.

在一實施例中,一種伺服器裝置包含可程式化邏輯裝置及基板管理控制器。可程式化邏輯裝置包含韌體載入單元、I2C介面單元、非揮發性記憶體單元及控制單元。韌體載入單元用以載入一第一韌體程式,使可程式化邏輯裝置由一設定模式切換至一工作模式且可程式化邏輯裝置之一I2C介面寫入功能鎖定於啟用,第一韌體程式包含鎖定I2C介面寫入功能之程式碼。I2C介面單元耦接基板管理控制器,I2C介面單元用以在工作模式中根據為啟用之I2C介面寫入功能自基板管理控制器接收一第二韌體程式。非揮發性記憶體單元耦接I2C介面單元,非揮發性記憶體單元用以經由I2C介面單元接收第二韌體程式並儲存第二韌體程式。控制單元耦接基板管理控制器、韌體載入單元及非揮發性記憶體單元,控制單元用以在工作模式中自基板管理控制器接收到一韌體更新指令時,執行韌體載入單元之一清除動作,使可程式化邏輯裝置由工作模式切換至設定模式,且I2C介面寫入功能在設定模式中仍鎖定在啟用而未切換為關閉,且控制單元在接收到韌體更新指令時驗證第二韌體程式,當第二韌體程式未通過驗證時,伺服器裝置在設定模式中輸出一警示訊息表示第二韌體程式未載入韌體載入單元。In one embodiment, a server device includes a programmable logic device and a baseboard management controller. The programmable logic device includes a firmware load unit, an I2C interface unit, a non-volatile memory unit, and a control unit. The firmware loading unit is used to load a first firmware program to switch the programmable logic device from a setting mode to a working mode, and the I2C interface writing function of the programmable logic device is locked to be enabled. The firmware program contains the code that locks the writing function of the I2C interface. The I2C interface unit is coupled to the baseboard management controller, and the I2C interface unit is used to receive a second firmware program from the baseboard management controller according to the enabled I2C interface write function in the working mode. The non-volatile memory unit is coupled to the I2C interface unit, and the non-volatile memory unit is used for receiving the second firmware program through the I2C interface unit and storing the second firmware program. The control unit is coupled to the baseboard management controller, the firmware load unit and the non-volatile memory unit, and the control unit is used to execute the firmware load unit when receiving a firmware update command from the baseboard management controller in the working mode A clearing action to switch the programmable logic device from working mode to setting mode, and the I2C interface writing function is still locked in the setting mode but not switched to off, and the control unit receives the firmware update command Verify the second firmware program. When the second firmware program fails the verification, the server device outputs a warning message in the setting mode to indicate that the second firmware program is not loaded into the firmware loading unit.

在一實施例中,一種避免韌體無法再次更新的方法包含可程式化邏輯裝置之一韌體載入單元載入一第一韌體程式,使可程式化邏輯裝置由一設定模式切換至一工作模式且I2C介面寫入功能鎖定於啟用,伺服器裝置的一基板管理控制器在可程式化邏輯裝置處於工作模式時發送一第二韌體程式,可程式化邏輯裝置之一非揮發性記憶體單元在工作模式中根據已啟用之I2C介面寫入功能經由可程式化邏輯裝置之一I2C介面單元接收並儲存第二韌體程式,可程式化邏輯裝置之一控制單元在工作模式中判斷是否接收到來自基板管理控制器之一韌體更新指令,控制單元在接收到韌體更新指令時執行韌體載入單元之一清除動作,使可程式化邏輯裝置由工作模式切換至設定模式,I2C介面寫入功能在設定模式中仍鎖定於啟用而未切換為關閉,控制單元在接收到韌體更新指令時驗證第二韌體程式,當第二韌體程式未通過驗證時,伺服器裝置在設定模式中輸出一警示訊息表示第二韌體程式未載入韌體載入單元。In one embodiment, a method for preventing the firmware from being unable to be updated again includes loading a first firmware program into a firmware loading unit of the programmable logic device, so that the programmable logic device is switched from a setting mode to a Working mode and the I2C interface writing function is locked to enable, a baseboard management controller of the server device sends a second firmware program when the programmable logic device is in working mode, and a non-volatile memory of the programmable logic device The body unit receives and stores the second firmware program through the I2C interface unit of the programmable logic device according to the enabled I2C interface write function in the working mode, and the control unit of the programmable logic device determines whether or not in the working mode Upon receiving a firmware update command from the baseboard management controller, the control unit executes a clear operation of the firmware loading unit when receiving the firmware update command, so that the programmable logic device is switched from working mode to setting mode, I2C The interface writing function is still locked in the setting mode and is not switched to off. The control unit verifies the second firmware program when receiving the firmware update command. When the second firmware program fails the verification, the server device is A warning message is output in the setting mode to indicate that the second firmware program is not loaded into the firmware loading unit.

請參照圖1,圖1係為根據本發明之伺服器裝置之一實施例之方塊示意圖。伺服器裝置1包含可程式化邏輯裝置(Programmable Logic Device;PLD)11及基板管理控制器13。基板管理控制器13耦接可程式化邏輯裝置11。可程式化邏輯裝置11包含積體電路間(inter-integrated circuit;I2C)介面單元111、非揮發性記憶體單元113、韌體載入單元114及控制單元115。非揮發性記憶體單元113耦接在I2C介面單元111與韌體載入單元114之間,控制單元115耦接非揮發性記憶體單元113及I2C介面單元111,且I2C介面單元111耦接在基板管理控制器13與非揮發性記憶體單元113之間。Please refer to FIG. 1. FIG. 1 is a block diagram of an embodiment of a server device according to the present invention. The server device 1 includes a Programmable Logic Device (PLD) 11 and a baseboard management controller 13. The baseboard management controller 13 is coupled to the programmable logic device 11. The programmable logic device 11 includes an inter-integrated circuit (I2C) interface unit 111, a non-volatile memory unit 113, a firmware loading unit 114, and a control unit 115. The non-volatile memory unit 113 is coupled between the I2C interface unit 111 and the firmware loading unit 114, the control unit 115 is coupled to the non-volatile memory unit 113 and the I2C interface unit 111, and the I2C interface unit 111 is coupled to Between the baseboard management controller 13 and the non-volatile memory unit 113.

在一實施例中,可程式化邏輯裝置11可為複雜可程式邏輯裝置(Complex Programmable Logic Device;CPLD),韌體載入單元114可為實現可程式化邏輯裝置11之硬體特殊功能(hardware feature)之記憶體裝置,硬體特殊功能包含相應I2C介面單元111之I2C介面寫入功能,韌體載入單元114可為隨機存取記憶體(Random Access Memory;RAM)。非揮發性記憶體單元113可為快閃記憶體(flash memory)。In one embodiment, the programmable logic device 11 may be a complex programmable logic device (Complex Programmable Logic Device; CPLD), and the firmware loading unit 114 may be a hardware special function for the programmable logic device 11 (hardware feature), the hardware special function includes the I2C interface writing function of the corresponding I2C interface unit 111, and the firmware loading unit 114 can be a random access memory (Random Access Memory; RAM). The non-volatile memory unit 113 may be a flash memory.

非揮發性記憶體單元113係儲存欲使可程式化邏輯裝置11執行之韌體程式,韌體載入單元114係儲存可程式化邏輯裝置11當下執行之韌體程式。當可程式化邏輯裝置11處於開機、重置或韌體更新程序中,可程式化邏輯裝置11係操作在設定模式,韌體載入單元114並未載入任何韌體程式,控制單元115控制韌體程式自非揮發性記憶體單元113載入韌體載入單元114,使可程式化邏輯裝置11由設定模式切換至工作模式,可程式化邏輯裝置11在工作模式中即根據韌體載入單元114載入之韌體程式碼運作。於是,當非揮發性記憶體單元113儲存有欲更新之韌體程式時,控制單元115可控制欲更新之韌體程式載入韌體載入單元114,使可程式化邏輯裝置11根據更新後之韌體程式運作而完成韌體程式之更新程序。The non-volatile memory unit 113 stores the firmware program to be executed by the programmable logic device 11, and the firmware loading unit 114 stores the firmware program currently executed by the programmable logic device 11. When the programmable logic device 11 is in the boot, reset or firmware update process, the programmable logic device 11 is operating in the setting mode, the firmware loading unit 114 does not load any firmware programs, and the control unit 115 controls The firmware program is loaded from the non-volatile memory unit 113 to the firmware loading unit 114, so that the programmable logic device 11 is switched from the setting mode to the working mode. In the working mode, the programmable logic device 11 is loaded according to the firmware. Enter the firmware code loaded in the unit 114 to operate. Therefore, when the firmware program to be updated is stored in the non-volatile memory unit 113, the control unit 115 can control the firmware program to be updated to be loaded into the firmware loading unit 114, so that the programmable logic device 11 is updated according to the updated firmware program. The firmware program runs to complete the update process of the firmware program.

非揮發性記憶體單元113儲存之韌體程式可來自於I2C介面單元111,可程式化邏輯裝置11具有對應I2C介面單元111之I2C介面寫入功能,當可程式化邏輯裝置11處於工作模式時,已載入韌體載入單元114之韌體程式包含啟用I2C介面寫入功能之韌體程式碼,使非揮發性記憶體單元113在工作模式中根據已為啟用之I2C介面寫入功能由I2C介面單元111接收欲更新之韌體程式;再者,當可程式化邏輯裝置11處於工作模式時,已載入韌體載入單元114之韌體程式包含鎖定I2C介面寫入功能為啟用之一鎖定功能,當欲更新之韌體程式寫入非揮發性記憶體單元113之後,可程式化邏輯裝置11進入韌體更新程序,可程式化邏輯裝置11由工作模式切換至設定模式,前述之鎖定功能將迫使I2C介面寫入功能不關閉而為持續地鎖定在啟用,當韌體更新失敗時,非揮發性記憶體單元113在設定模式中即可根據為啟用之I2C介面寫入功能由I2C介面單元111重新接收欲更新之韌體程式或接收其他韌體程式。The firmware program stored in the non-volatile memory unit 113 can come from the I2C interface unit 111. The programmable logic device 11 has an I2C interface writing function corresponding to the I2C interface unit 111. When the programmable logic device 11 is in working mode , The firmware program loaded into the firmware loading unit 114 includes the firmware code for enabling the I2C interface writing function, so that the non-volatile memory unit 113 is in the working mode according to the enabled I2C interface writing function by The I2C interface unit 111 receives the firmware program to be updated; furthermore, when the programmable logic device 11 is in working mode, the firmware program loaded into the firmware loading unit 114 includes the lock I2C interface writing function is enabled A lock function. After the firmware program to be updated is written into the non-volatile memory unit 113, the programmable logic device 11 enters the firmware update process, and the programmable logic device 11 switches from the working mode to the setting mode. The lock function will force the I2C interface write function not to be turned off but to be continuously locked to enable. When the firmware update fails, the non-volatile memory unit 113 can be activated by the I2C interface according to the I2C interface write function in the setting mode. The interface unit 111 receives the firmware program to be updated again or receives other firmware programs.

在運作上,請合併參照圖1及圖2,圖2係為根據本案之避免韌體無法再次更新的方法之一實施例之流程圖,以伺服器裝置1上電後可程式化邏輯裝置11處於設定模式為例,韌體載入單元114先載入尚未更新之第一韌體程式(步驟S01)使可程式化邏輯裝置11由設定模式切換至工作模式(步驟S02),且第一韌體程式包含前述鎖定I2C介面寫入功能為啟用之鎖定功能,使I2C介面寫入功能在第一韌體程式載入韌體載入單元114之後鎖定於啟用(步驟S03),接著,當可程式化邏輯裝置11處於工作模式時,基板管理控制器13可發送欲更新之第二韌體程式至I2C介面單元111(步驟S04),根據鎖定於啟用之I2C介面寫入功能,I2C介面單元111傳遞第二韌體程式,非揮發性記憶體單元113自I2C介面單元111接收第二韌體程式並儲存第二韌體程式(步驟S05)。In operation, please refer to Fig. 1 and Fig. 2 together. Fig. 2 is a flowchart of an embodiment of the method for avoiding the failure to update the firmware according to this case. The logic device 11 can be programmed after the server device 1 is powered on. In the setting mode as an example, the firmware loading unit 114 first loads the unupdated first firmware program (step S01) to switch the programmable logic device 11 from the setting mode to the working mode (step S02), and the first firmware The body program includes the aforementioned lock function that locks the I2C interface writing function to be enabled, so that the I2C interface writing function is locked after the first firmware program is loaded into the firmware loading unit 114 (step S03), and then, when the program is programmable When the logic logic device 11 is in the working mode, the baseboard management controller 13 can send the second firmware program to be updated to the I2C interface unit 111 (step S04), and the I2C interface unit 111 transmits it according to the I2C interface write function locked to the activation The second firmware program, the non-volatile memory unit 113 receives the second firmware program from the I2C interface unit 111 and stores the second firmware program (step S05).

待第二韌體程式儲存在非揮發性記憶體單元113之後,基板管理控制器13可發送欲使第一韌體程式更新為第二韌體程式之韌體更新指令,控制單元115在可程式化邏輯裝置11之工作模式中判斷是否接收到前述韌體更新指令(步驟S06),當控制單元115接收到韌體更新指令時(判斷結果為「是」),控制單元115執行韌體載入單元114之清除動作(步驟S07),使可程式化邏輯裝置11切換至設定模式(步驟S08),且I2C介面寫入功能在設定模式中仍鎖定為啟用(步驟S10),也就是I2C介面寫入功能不因可程式化邏輯裝置11自工作模式切換至設定模式而由啟用切換至關閉。After the second firmware program is stored in the non-volatile memory unit 113, the baseboard management controller 13 can send a firmware update command to update the first firmware program to the second firmware program, and the control unit 115 is in the programmable state In the working mode of the logic logic device 11, it is judged whether the aforementioned firmware update command is received (step S06). When the control unit 115 receives the firmware update command (the judgment result is "Yes"), the control unit 115 executes firmware loading The clearing action of the unit 114 (step S07) causes the programmable logic device 11 to switch to the setting mode (step S08), and the I2C interface writing function is still locked to be enabled in the setting mode (step S10), that is, the I2C interface writing The input function is not switched from enabled to disabled because the programmable logic device 11 switches from the working mode to the setting mode.

再者,在接收到韌體更新指令之後,控制單元115驗證儲存在非揮發性記憶體單元113中之第二韌體程式,以判斷第二韌體程式是否發生錯誤(步驟S11)。當第二韌體程式錯誤時,表示韌體更新程序無法完成,控制單元115在可程式化邏輯裝置11的設定模式中產生載入失敗訊號(步驟S12),使伺服器裝置1輸出包含聲音訊號及/或影像訊號之一警示訊息,表示第二韌體程式並未載入韌體載入單元114,也就是可程式化邏輯裝置11仍處於設定模式,以警示伺服器裝置1之使用者禁止移除伺服器裝置1之電源,也就是伺服器裝置1立即地通知使用者禁止系統層級的重啟,使用者不可藉由將其插頭自插座移除又重新插回插座之方式重啟伺服器裝置1,以避免伺服器裝置1因重啟/重新上電而造成前述之鎖定功能關閉,鎖定功能關閉將導致I2C介面單元111處於預設為關閉之狀態而除錯者無法藉由I2C介面單元111更新錯誤之第二韌體程式之問題。Furthermore, after receiving the firmware update command, the control unit 115 verifies the second firmware program stored in the non-volatile memory unit 113 to determine whether an error occurs in the second firmware program (step S11). When the second firmware program is wrong, it means that the firmware update process cannot be completed, and the control unit 115 generates a load failure signal in the setting mode of the programmable logic device 11 (step S12), so that the server device 1 outputs a sound signal And/or a warning message of the image signal, indicating that the second firmware program has not been loaded into the firmware loading unit 114, that is, the programmable logic device 11 is still in the setting mode to warn the user of the server device 1 to prohibit Remove the power of the server device 1, that is, the server device 1 immediately informs the user to prohibit the system-level restart. The user cannot restart the server device 1 by removing its plug from the socket and then plugging it back into the socket. In order to prevent the server device 1 from being turned off due to restarting/repowering on the aforementioned lock function, turning off the lock function will cause the I2C interface unit 111 to be in the default closed state and the debugger cannot update the error through the I2C interface unit 111 The problem with the second firmware program.

基此,在可程式化邏輯裝置11的設定模式中,雖然第二韌體程式之程式碼錯誤,為啟用之I2C介面單元111可再次接收韌體程式,伺服器裝置1之設計者或除錯者可將除錯後之程式碼在設定模式中藉由I2C介面單元111燒錄至非揮發性記憶體單元113,以修復第二韌體程式之錯誤;或者,韌體更新失敗是由於第二韌體程式自非揮發性記憶體單元113載入韌體載入單元114之過程發生傳輸錯誤,伺服器裝置1之設計者或除錯者可在設定模式中設定第二韌體程式重新自I2C介面單元111重新燒錄至非揮發性記憶體單元113,並控制重新燒錄至非揮發性記憶體單元113之第二韌體程式載入韌體載入單元114。換言之,可程式化邏輯裝置11並不會因為操作在設定模式而造成I2C介面寫入功能關閉,導致韌體程式在更新失敗時無法藉由I2C介面單元111重新燒錄至非揮發性記憶體單元113,且伺服器裝置1之設計者或除錯者亦不需要打開伺服器裝置1之機殼以藉由與非揮發性記憶體單元113連接之JTAG介面單元112或SPI介面單元116將韌體程式重新燒錄至非揮發性記憶體單元113。(其中,圖1僅係用以示意,JTAG介面單元112及SPI介面單元116係藉由六根腳位連接非揮發性記憶體單元113)。Based on this, in the setting mode of the programmable logic device 11, although the code of the second firmware program is wrong, the activated I2C interface unit 111 can receive the firmware program again. The designer or debugger of the server device 1 You can burn the code after debugging to the non-volatile memory unit 113 through the I2C interface unit 111 in the setting mode to repair the error of the second firmware program; or, the firmware update failed due to the second A transmission error occurred during the firmware loading process from the non-volatile memory unit 113 to the firmware loading unit 114. The designer or debugger of the server device 1 can set the second firmware program in the setting mode to reload from I2C The interface unit 111 is re-burned to the non-volatile memory unit 113, and controls the second firmware program re-burned to the non-volatile memory unit 113 to be loaded into the firmware loading unit 114. In other words, the programmable logic device 11 will not turn off the I2C interface writing function due to the operation in the setting mode, so that when the firmware update fails, the I2C interface unit 111 cannot be re-programmed to the non-volatile memory unit. 113, and the designer or debugger of the server device 1 does not need to open the case of the server device 1 to use the JTAG interface unit 112 or the SPI interface unit 116 connected to the non-volatile memory unit 113 to transfer the firmware The program is re-burned to the non-volatile memory unit 113. (Among them, FIG. 1 is only for illustration, the JTAG interface unit 112 and the SPI interface unit 116 are connected to the non-volatile memory unit 113 through six pins).

在一實施例中,控制單元115係以硬體電路之有限狀態機(Finite State Machine;FSM)來實現,例如控制單元115可為特殊應用積體電路(Application-specific integrated circuit;ASIC),控制單元115係根據以硬體描述語言(例如,Verilog code)預先定義之硬體行為執行步驟S07、S11、S12中之清除動作、驗證動作及訊號輸出動作,也就是控制單元115並非是執行韌體程式碼而動作,在韌體載入單元114未載入任何韌體程式時,控制單元115亦可執行前述之清除動作、驗證動作及訊號輸出動作。In one embodiment, the control unit 115 is implemented by a finite state machine (Finite State Machine; FSM) of a hardware circuit. For example, the control unit 115 can be an Application-specific integrated circuit (ASIC), which controls The unit 115 executes the clearing action, verification action and signal output action in steps S07, S11, S12 according to the hardware behavior predefined by the hardware description language (for example, Verilog code), that is, the control unit 115 is not executing firmware When the firmware loading unit 114 does not load any firmware program, the control unit 115 can also perform the aforementioned cleanup action, verification action and signal output action.

在一實施例中,伺服器裝置1之使用者可藉由基板管理控制器13的管理介面(console)在近端控制基板管理控制器13,使基板管理控制器13在步驟S04中發送第二韌體程式。並且,使用者可在第二韌體程式儲存至非揮發性記憶體單元113之後控制基板管理控制器13發出韌體更新指令,使控制單元115在步驟S06中判斷出接收到韌體更新指令。在其他的實施例中,伺服器裝置1之使用者亦可操作遠端裝置連線於基板管理控制器13的網路介面,以遠端操控的方式控制基板管理控制器13發送前述之第二韌體程式及韌體更新指令。在其他的實施例中,伺服器裝置1亦可自動地偵測韌體版本,也就是基板管理控制器13可自動地判斷出第二韌體程式的版本較新而自動地將第二韌體程式發送至可程式化邏輯裝置11且自動地發出韌體更新指令。In one embodiment, the user of the server device 1 can control the baseboard management controller 13 at the proximal end through the management interface (console) of the baseboard management controller 13, so that the baseboard management controller 13 sends the second Firmware program. Moreover, the user can control the baseboard management controller 13 to issue a firmware update command after the second firmware program is stored in the non-volatile memory unit 113, so that the control unit 115 determines that the firmware update command is received in step S06. In other embodiments, the user of the server device 1 can also operate the remote device to connect to the network interface of the baseboard management controller 13, and control the baseboard management controller 13 to send the aforementioned second Firmware program and firmware update commands. In other embodiments, the server device 1 can also automatically detect the firmware version, that is, the baseboard management controller 13 can automatically determine that the version of the second firmware program is newer and automatically change the version of the second firmware The program is sent to the programmable logic device 11 and automatically issues a firmware update command.

在一實施例中,如圖1所示,可程式化邏輯裝置11更包含通用型輸入輸出腳位(General-purpose input/output;GPIO)117耦接在基板管理控制器13與控制單元115之間。在步驟S12中,控制單元115在產生載入失敗訊號之後可藉由GPIO腳位117發送載入失敗訊號至基板管理控制器13,基板管理控制器13可根據載入失敗訊號產生前述之警示訊息,並由前述之伺服器裝置1之聲音或影像輸出單元輸出警示訊息表示第二韌體程式未載入韌體載入單元114,可程式化邏輯裝置11係處於設定模式,以警示伺服器裝置1之使用者不可移除伺服器裝置1之電源,以避免伺服器裝置1因重啟而使前述鎖定功能無效而無法對錯誤之第二韌體程式進行除錯或更新之問題。In one embodiment, as shown in FIG. 1, the programmable logic device 11 further includes a general-purpose input/output pin (General-purpose input/output; GPIO) 117 coupled between the baseboard management controller 13 and the control unit 115 between. In step S12, the control unit 115 can send a loading failure signal to the baseboard management controller 13 through the GPIO pin 117 after generating the loading failure signal, and the baseboard management controller 13 can generate the aforementioned warning message according to the loading failure signal , And the audio or video output unit of the aforementioned server device 1 outputs a warning message indicating that the second firmware program is not loaded into the firmware loading unit 114, and the programmable logic device 11 is in the setting mode to alert the server device The user of 1 cannot remove the power supply of the server device 1 to avoid the problem that the server device 1 is restarted and the aforementioned lock function is invalidated and the wrong second firmware program cannot be debugged or updated.

進一步,在控制單元115發送載入失敗訊號至基板管理控制器13之後,基板管理控制器13則可根據前述之載入失敗訊號重新發送相同之一韌體程式至I2C介面單元111,或基板管理控制器13亦在接收到載入失敗訊號之後發送除錯後之其他韌體程式至I2C介面單元111(以下將基板管理控制器13在接收到載入失敗訊號後發送之韌體程式稱為第三韌體程式),非揮發性記憶體單元113在可程式化邏輯裝置11的設定模式中根據為啟用之I2C介面寫入功能由I2C介面單元111接收基板管理控制器13發送之第三韌體程式,基板管理控制器13接著再發送另一韌體更新指令至控制單元115,使控制單元115在步驟S06產生為「是」之判斷結果而執行後續之步驟S11,若控制單元115在步驟S11判斷出基板管理控制器13重新發送之第二韌體程式或除錯後之其他韌體程式未發生錯誤(判斷結果為「否」),控制單元115則控制重新發送之第二韌體程式或除錯後之其他韌體程式自非揮發性記憶體單元113載入韌體載入單元114(步驟S13),使可程式化邏輯裝置11由設定模式切換至工作模式,且控制單元115可產生一載入成功訊號,載入成功訊號經由GPIO腳位117發送至基板管理控制器13,使基板管理控制器13得知更新之韌體程式已載入韌體載入單元114。於是,韌體載入單元114載入重新發送之第二韌體程式或除錯後之其他韌體程式之後,可程式化邏輯裝置11即根據重新發送之第二韌體程式或除錯後之其他韌體程式運作。Furthermore, after the control unit 115 sends the load failure signal to the baseboard management controller 13, the baseboard management controller 13 can resend the same firmware program to the I2C interface unit 111 or the baseboard management controller according to the aforementioned load failure signal. The controller 13 also sends other debugged firmware programs to the I2C interface unit 111 after receiving the loading failure signal (hereinafter, the firmware program sent by the baseboard management controller 13 after receiving the loading failure signal is referred to as the first Third firmware program), the non-volatile memory unit 113 receives the third firmware sent by the baseboard management controller 13 from the I2C interface unit 111 according to the enabled I2C interface write function in the setting mode of the programmable logic device 11 Program, the baseboard management controller 13 then sends another firmware update command to the control unit 115, so that the control unit 115 generates a "Yes" judgment result in step S06 and executes the subsequent step S11. If the control unit 115 is in step S11 It is determined that the second firmware program re-sent by the baseboard management controller 13 or other firmware programs after debugging has no error (the judgment result is "No"), and the control unit 115 controls the re-sent second firmware program or After debugging, other firmware programs are loaded from the non-volatile memory unit 113 to the firmware loading unit 114 (step S13), so that the programmable logic device 11 is switched from the setting mode to the working mode, and the control unit 115 can generate A loading success signal is sent to the baseboard management controller 13 via the GPIO pin 117, so that the baseboard management controller 13 knows that the updated firmware program has been loaded into the firmware loading unit 114. Therefore, after the firmware loading unit 114 loads the resent second firmware program or the debugged other firmware program, the programmable logic device 11 is based on the resent second firmware program or debugged Other firmware programs operate.

在一實施例中,載入失敗訊號與載入成功訊號可具有不同的邏輯位準,例如載入成功訊號可具有高位準,載入失敗訊號可具有低位準,基板管理控制器13可判斷來自GPIO腳位117之訊號位準為高位準或低位準,以判斷為載入失敗訊號或載入成功訊號。據此,基板管理控制器13可得知可程式化邏輯裝置11是處於設定模式或工作模式,也就是基板管理控制器13在發出韌體更新指令之後可判斷出韌體程式是否已載入韌體載入單元114。In one embodiment, the load failure signal and the load success signal may have different logic levels. For example, the load success signal may have a high level, the load failure signal may have a low level, and the baseboard management controller 13 may determine that it comes from The signal level of the GPIO pin 117 is high or low, and it is judged as a loading failure signal or a loading success signal. Accordingly, the baseboard management controller 13 can know that the programmable logic device 11 is in the setting mode or working mode, that is, the baseboard management controller 13 can determine whether the firmware program has been loaded after issuing the firmware update command. Body loading unit 114.

綜上所述,根據本案之避免韌體無法再次更新之方法之一實施例,可程式化邏輯裝置並不會因為韌體程式錯誤而操作在設定模式造成I2C介面寫入功能關閉,導致除錯後之韌體程式無法藉由I2C介面單元更新於非揮發性記憶體單元之問題,且控制單元可發出錯誤訊息,以避免使用者重啟伺服器裝置之電源而造成I2C介面單元在伺服器裝置重新啟動或上電後為關閉。可程式化邏輯裝置之設計者或除錯者在韌體程式錯誤時並不需要打開機箱蓋以藉由JTAG介面更新韌體程式,設計者或除錯者依然可藉由I2C介面單元修復韌體程式,大幅地提升可程式化邏輯裝置之韌體程式之除錯之靈活性與便利性。並且,I2C介面單元僅需兩根腳位,且I2C介面單元之匯流排走線的長度較長,I2C介面單元較JTAG介面與SPI介面更能符合現今對於伺服器穩定且輕薄之需求。In summary, according to an embodiment of the method for preventing the firmware from being updated again in this case, the programmable logic device does not cause the I2C interface writing function to be disabled due to firmware programming errors and operating in the setting mode, resulting in debugging The later firmware cannot be updated to the non-volatile memory unit through the I2C interface unit, and the control unit can issue an error message to prevent the user from restarting the power of the server device and causing the I2C interface unit to restart on the server device. It is closed after startup or power-on. The designer or debugger of programmable logic device does not need to open the case cover to update the firmware program through the JTAG interface when the firmware program error occurs. The designer or debugger can still repair the firmware through the I2C interface unit The program greatly improves the flexibility and convenience of debugging the firmware of programmable logic devices. In addition, the I2C interface unit only needs two pins, and the length of the bus trace of the I2C interface unit is longer. The I2C interface unit is more capable of meeting today's demand for stability and lightness of the server than the JTAG interface and the SPI interface.

雖然本案已以實施例揭露如上然其並非用以限定本案,任何所屬技術領域中具有通常知識者,在不脫離本案之精神和範圍內,當可作些許之更動與潤飾,故本案之保護範圍當視後附之專利申請範圍所界定者為準。Although this case has been disclosed by the examples above, it is not intended to limit the case. Anyone with ordinary knowledge in the technical field can make some changes and modifications without departing from the spirit and scope of the case. Therefore, the scope of protection of this case The scope of the patent application attached hereafter shall prevail.

1            伺服器裝置 11          可程式化邏輯裝置 111         I2C介面單元 112        JTAG介面單元 113        非揮發性記憶體單元 114        韌體載入單元 115        控制單元 116        SPI介面單元 117        GPIO腳位 13          基板管理控制器 S01-S08 步驟 S10-S13 步驟 1 Server device 11 Programmable logic device 111 I2C interface unit 112 JTAG interface unit 113 Non-volatile memory unit 114 Firmware load unit 115 Control unit 116 SPI interface unit 117 GPIO pins 13 Substrate management controller S01-S08 steps S10-S13 steps

[圖1] 為根據本發明之伺服器裝置之一實施例之方塊示意圖。 [圖2] 為根據本發明之避免韌體無法再次更新的方法之一實施例之流程圖。 [Figure 1] is a block diagram of an embodiment of the server device according to the present invention. [Fig. 2] is a flowchart of an embodiment of the method for preventing the firmware from being unable to be updated again according to the present invention.

1            伺服器裝置 11          可程式化邏輯裝置 111         I2C介面單元 112        JTAG介面單元 113        非揮發性記憶體單元 114        韌體載入單元 115        控制單元 116        SPI介面單元 117        GPIO腳位 13          基板管理控制器 1 Server device 11 Programmable logic device 111 I2C interface unit 112 JTAG interface unit 113 Non-volatile memory unit 114 Firmware load unit 115 Control unit 116 SPI interface unit 117 GPIO pins 13 Substrate management controller

Claims (8)

一種伺服器裝置,包含:一基板管理控制器;及一可程式化邏輯裝置,包含:一韌體載入單元,用以載入一第一韌體程式,使該可程式化邏輯裝置由一設定模式切換至一工作模式且該可程式化邏輯裝置之一I2C介面寫入功能鎖定於啟用,該第一韌體程式包含鎖定該I2C介面寫入功能之程式碼;一I2C介面單元,耦接該基板管理控制器,用以在該工作模式中根據為啟用之該I2C介面寫入功能自該基板管理控制器接收一第二韌體程式;一非揮發性記憶體單元,耦接該I2C介面單元,用以經由該I2C介面單元接收該第二韌體程式並儲存該第二韌體程式;一控制單元,耦接該基板管理控制器、該韌體載入單元及該非揮發性記憶體單元,用以在該工作模式中自該基板管理控制器接收到一韌體更新指令時,執行該韌體載入單元之一清除動作,使該可程式化邏輯裝置由該工作模式切換至該設定模式,且該I2C介面寫入功能在該設定模式中仍鎖定在啟用而未切換為關閉,且該控制單元在接收到該韌體更新指令時驗證該第二韌體程式,當該第二韌體程式未通過驗證時,該伺服器裝置在該設定模式中輸出一警示訊息表示該第二韌體程式未載入該韌體載入單元;及 一通用型輸入輸出腳位,耦接在該控制單元與該基板管理控制器之間,當該第二韌體程式錯誤而未通過驗證時,該控制單元在該設定模式中產生一載入失敗訊號,該載入失敗訊號經由該通用型輸入輸出腳位輸出至該基板管理控制器,該基板管理控制器根據該載入失敗訊號產生該警示訊息。 A server device includes: a baseboard management controller; and a programmable logic device, including: a firmware loading unit for loading a first firmware program, so that the programmable logic device is controlled by a The setting mode is switched to a working mode and an I2C interface writing function of the programmable logic device is locked to enable, the first firmware program includes a code for locking the writing function of the I2C interface; an I2C interface unit, coupled The baseboard management controller is used for receiving a second firmware program from the baseboard management controller according to the I2C interface write function enabled in the working mode; a non-volatile memory unit coupled to the I2C interface Unit for receiving the second firmware program via the I2C interface unit and storing the second firmware program; a control unit coupled to the baseboard management controller, the firmware loading unit and the non-volatile memory unit , For performing a clear operation of the firmware loading unit when a firmware update command is received from the baseboard management controller in the working mode, so that the programmable logic device is switched from the working mode to the setting Mode, and the I2C interface writing function is still locked in the setting mode and is not switched to disabled, and the control unit verifies the second firmware program when the firmware update command is received. When the second firmware When the firmware fails the verification, the server device outputs a warning message in the setting mode to indicate that the second firmware program is not loaded into the firmware load unit; and A general-purpose input and output pin is coupled between the control unit and the baseboard management controller. When the second firmware program fails the verification due to an error, the control unit generates a loading failure in the setting mode The load failure signal is output to the baseboard management controller through the universal input/output pin, and the baseboard management controller generates the warning message according to the load failure signal. 如請求項1所述之伺服器裝置,其中該控制單元係以特殊應用積體電路實現,該控制單元係根據以硬體描述語言預先定義之硬體行為執行該清除動作且驗證該第二韌體程式。 The server device according to claim 1, wherein the control unit is implemented by a special application integrated circuit, and the control unit executes the cleaning action and verifies the second firmware according to a hardware behavior predefined in a hardware description language Body program. 如請求項1所述之伺服器裝置,其中該基板管理控制器更根據該載入失敗訊號發送一第三韌體程式至該I2C介面單元,該非揮發性記憶體單元在該設定模式中根據為啟用之該I2C介面寫入功能經由該I2C介面單元接收該第三韌體程式。 The server device according to claim 1, wherein the baseboard management controller further sends a third firmware program to the I2C interface unit according to the load failure signal, and the non-volatile memory unit in the setting mode is based on The enabled I2C interface writing function receives the third firmware program through the I2C interface unit. 如請求項1所述之伺服器裝置,其中該警示訊息包含禁止移除該伺服器裝置之電源之聲音訊息或文字訊息。 The server device according to claim 1, wherein the warning message includes an audio message or text message that prohibits removing the power of the server device. 一種避免韌體無法再次更新的方法,適於一伺服器裝置的一可程式化邏輯裝置,該可程式化邏輯裝置具有相應於一韌體寫入方式之一I2C介面寫入功能,該避免韌體無法再次更新的方法包含:該可程式化邏輯裝置之一韌體載入單元載入一第一韌體程式,使該可程式化邏輯裝置由一設定模式切換至一工作模式且該I2C介面寫入功能鎖定於啟用;該伺服器裝置的一基板管理控制器在該可程式化邏輯裝置處於該工作模式時發送一第二韌體程式; 該可程式化邏輯裝置之一非揮發性記憶體單元在該工作模式中根據已啟用之該I2C介面寫入功能經由該可程式化邏輯裝置之一I2C介面單元接收並儲存該第二韌體程式;該可程式化邏輯裝置之一控制單元在該工作模式中判斷是否接收到來自該基板管理控制器之一韌體更新指令;該控制單元在接收到該韌體更新指令時執行該韌體載入單元之一清除動作,使該可程式化邏輯裝置由該工作模式切換至該設定模式;該I2C介面寫入功能在該設定模式中仍鎖定於啟用而未切換為關閉;該控制單元在接收到該韌體更新指令時驗證該第二韌體程式;當該第二韌體程式未通過驗證時,該伺服器裝置在該設定模式中輸出一警示訊息表示該第二韌體程式未載入該韌體載入單元,該控制單元在該設定模式中產生一載入失敗訊號;該控制單元藉由該可程式化邏輯裝置之通用型輸入輸出腳位發送該載入失敗訊號至該基板管理控制器;及該基板管理控制器根據該載入失敗訊號產生該警示訊息。 A method for preventing the firmware from being unable to be updated again is suitable for a programmable logic device of a server device. The programmable logic device has an I2C interface writing function corresponding to a firmware writing method. The method that the body cannot be updated again includes: a firmware load unit of the programmable logic device loads a first firmware program, so that the programmable logic device is switched from a setting mode to a working mode and the I2C interface The write function is locked to enable; a baseboard management controller of the server device sends a second firmware program when the programmable logic device is in the working mode; A non-volatile memory unit of the programmable logic device receives and stores the second firmware program through an I2C interface unit of the programmable logic device according to the enabled I2C interface write function in the working mode ; A control unit of the programmable logic device determines whether a firmware update command from the baseboard management controller is received in the working mode; the control unit executes the firmware load when receiving the firmware update command A clearing action of the input unit causes the programmable logic device to switch from the working mode to the setting mode; the I2C interface writing function is still locked in the setting mode and is not switched to off; the control unit is receiving Verify the second firmware program when the firmware update command is reached; when the second firmware program fails the verification, the server device outputs a warning message in the setting mode to indicate that the second firmware program is not loaded The firmware loading unit, the control unit generates a loading failure signal in the setting mode; the control unit sends the loading failure signal to the board management through the universal input and output pins of the programmable logic device Controller; and the baseboard management controller generates the warning message according to the load failure signal. 如請求項5所述之避免韌體無法再次更新的方法,其中該控制單元係以特殊應用積體電路實現,該控制單元係根據硬體描述語言預先定義之硬體行為執行該清除動作以及驗證該第二韌體程式。 The method for preventing the firmware from being unable to be updated again as described in claim 5, wherein the control unit is implemented by a special application integrated circuit, and the control unit executes the cleaning action and verification according to the hardware behavior predefined by the hardware description language The second firmware program. 如請求項5所述之避免韌體無法再次更新的方法,其中該警示訊息包含禁止移除該伺服器裝置之電源之聲音訊息或文字訊息。 The method for preventing the firmware from being unable to be updated again as described in claim 5, wherein the warning message includes an audio message or a text message that prohibits removing the power of the server device. 如請求項5所述之避免韌體無法再次更新的方法,更包含: 該基板管理控制器根據該載入失敗訊號發送一第三韌體程式至該I2C介面單元;及該非揮發性記憶體單元在該設定模式中根據為啟用之該I2C介面寫入功能經由該I2C介面單元接收並儲存該第三韌體程式。 The method described in claim 5 to prevent the firmware from being updated again includes: The baseboard management controller sends a third firmware program to the I2C interface unit according to the load failure signal; and the non-volatile memory unit is in the setting mode according to the enabled I2C interface write function through the I2C interface The unit receives and stores the third firmware program.
TW108146531A 2019-12-18 2019-12-18 Server device and method for avoiding firmware cannot be updated again thereof TWI733279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108146531A TWI733279B (en) 2019-12-18 2019-12-18 Server device and method for avoiding firmware cannot be updated again thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108146531A TWI733279B (en) 2019-12-18 2019-12-18 Server device and method for avoiding firmware cannot be updated again thereof

Publications (2)

Publication Number Publication Date
TW202125226A TW202125226A (en) 2021-07-01
TWI733279B true TWI733279B (en) 2021-07-11

Family

ID=77908442

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108146531A TWI733279B (en) 2019-12-18 2019-12-18 Server device and method for avoiding firmware cannot be updated again thereof

Country Status (1)

Country Link
TW (1) TWI733279B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201616348A (en) * 2014-10-23 2016-05-01 英業達股份有限公司 Server directly updated through baseboard management controller
US10331434B2 (en) * 2016-12-21 2019-06-25 Quanta Computer Inc. System and method for remotely updating firmware
CN109976926A (en) * 2019-03-27 2019-07-05 苏州浪潮智能科技有限公司 Method, circuit, terminal and the storage medium of protection BMC renewal process are restarted in a kind of shielding
US10521220B1 (en) * 2018-12-18 2019-12-31 Palantir Technologies Inc. Systems and methods for coordinating the deployment of components to defined user groups

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201616348A (en) * 2014-10-23 2016-05-01 英業達股份有限公司 Server directly updated through baseboard management controller
US10331434B2 (en) * 2016-12-21 2019-06-25 Quanta Computer Inc. System and method for remotely updating firmware
US10521220B1 (en) * 2018-12-18 2019-12-31 Palantir Technologies Inc. Systems and methods for coordinating the deployment of components to defined user groups
CN109976926A (en) * 2019-03-27 2019-07-05 苏州浪潮智能科技有限公司 Method, circuit, terminal and the storage medium of protection BMC renewal process are restarted in a kind of shielding

Also Published As

Publication number Publication date
TW202125226A (en) 2021-07-01

Similar Documents

Publication Publication Date Title
TWI633487B (en) Method and computer system for automatically recovering the bios image file
TWI467375B (en) Computer system with crashed bios data recovering function and recovering method thereof
TWI399647B (en) Method for recovering bios in computer system and computer system thereof
TWI410793B (en) Computer, and method for error-detecting and booting of bios thereof
US20110099544A1 (en) Information processing apparatus and system setting method
US10698679B2 (en) Server with double-firmware storage space and firmware update method therefor
TWI786871B (en) Computer and system bootup method
US20080072030A1 (en) Computer System and Method for Updating Program Code
US9256443B2 (en) Electronic device having updatable bios and bios updating method thereof
TW201327386A (en) Manufacturing system and firmware burning method
TWI712045B (en) Hard disk restoring method
TWI733279B (en) Server device and method for avoiding firmware cannot be updated again thereof
TWI528287B (en) Server system
US11048521B2 (en) Resilient upgradable boot loader with power reset
TWI726477B (en) Server device and method for avoiding firmware cannot be updated again to programmable logic device thereof
CN113760335B (en) Server device and method for avoiding firmware from being unable to be updated again
TWI750215B (en) Bios switching device
US9529581B2 (en) Circuit and method for writing program codes of basic input/output system
JP2008052354A (en) External basic input/output system device
JP6911591B2 (en) Information processing device, control device and control method of information processing device
CN113703816B (en) Server device and method for avoiding firmware from being unable to be updated again
TWI742430B (en) Method of recovering firmware of baseboard management controller automatically
TW202013181A (en) Method for updating firmware of complex programmable logic device
CN113687843B (en) Method for automatically recovering firmware of baseboard management controller
CN112115000B (en) Remote resetting method and system of system component power supply and BMC remote device