WO2017063577A1 - Firmware upgrade method and apparatus for optical module - Google Patents
Firmware upgrade method and apparatus for optical module Download PDFInfo
- Publication number
- WO2017063577A1 WO2017063577A1 PCT/CN2016/102042 CN2016102042W WO2017063577A1 WO 2017063577 A1 WO2017063577 A1 WO 2017063577A1 CN 2016102042 W CN2016102042 W CN 2016102042W WO 2017063577 A1 WO2017063577 A1 WO 2017063577A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- information
- firmware
- fpga
- program
- storage area
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44536—Selecting among different versions
Definitions
- the present invention relates to an optical communication technology, and more particularly to a firmware upgrade method and apparatus for an optical module.
- the optical module can realize photoelectric conversion, that is, the transmitting end of the optical module can convert the electrical signal into an optical signal, and the receiving end of the optical module can The optical signal is converted into an electrical signal.
- the Microcontroller Unit (MCU) in the optical module cannot meet the high-speed processing requirements of the optical module.
- a Field-Programmable Gate Array (FPGA) is disposed in an optical module to enable the FPGA to perform high-speed signal processing and control of some devices (photoelectric/electro-optical signal conversion, signal acquisition).
- the MCU update information of the upgraded MCU or the FPGA update information of the upgraded FPGA is usually stored in the register of the MCU.
- the embodiment of the present invention provides a firmware upgrade method and device for an optical module, which are used to solve the problem that the optical module cannot work normally.
- an embodiment of the present invention provides a firmware upgrade method for an optical module, including:
- firmware upgrade package includes a program header and a program body
- the program header includes information identifying an upgrade firmware type
- the program body includes update information for upgrading the firmware
- the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU;
- the program body is stored in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
- program header further includes any one of the following or a combination thereof:
- Program header checksum program body ID, program header length, program body length, program body checksum, compile time, or program version number.
- the determined firmware type of the upgrade is an FPGA; the program body includes first FPGA update information;
- the storage medium includes at least a first storage area and a second storage area, and the storage medium passes the MCU and the An FPGA connection, wherein each storage area stores different versions of FPGA update information;
- the method further includes:
- the storage area includes an information area and a file storage area, and the file storage area stores FPGA update information, and the information area stores operation information and submission information.
- the invention also provides a firmware upgrading device for an optical module, comprising:
- An obtaining module configured to obtain a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;
- Determining a module configured to determine an upgraded firmware type according to a program header of the firmware upgrade package, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU;
- a storage module configured to store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
- program header further includes any one of the following or a combination thereof:
- Program header checksum program body ID, program header length, program body length, program body checksum, compile time, or program version number.
- the determining module is further configured to determine, according to the running information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, where the storage medium includes at least a first storage area and a second storage.
- the storage medium is connected to the FPGA through an MCU, and each storage area stores different versions of FPGA update information; determining to store the first FPGA update information in a second storage area.
- the determining module is further configured to determine the second storage area according to operation information and submission information of each storage area in the storage medium, where the second storage area includes first FPGA update information loaded to the FPGA,
- the operation includes information on whether the FPGA can be run, the submission information including information of whether to store all of the information of the FPGA update information to the storage medium; loading the first FPGA update information to the FPGA.
- the storage area includes an information area and a file storage area, and the file storage area stores FPGA update information, and the information area stores operation information and submission information.
- the embodiment of the present invention includes acquiring a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes firmware for upgrading. Update information; determining an upgraded firmware type according to a program header of the firmware upgrade package, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU; storing the program body according to the firmware type In the storage medium corresponding to the determined upgraded firmware type.
- the program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
- a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the firmware upgrade method of the optical module in the foregoing embodiment.
- FIG. 1 is a schematic flowchart of an embodiment of a method for upgrading a firmware of an optical module according to the present invention
- FIG. 2 is a schematic structural diagram of a firmware upgrade package according to an embodiment of a firmware upgrade method of an optical module according to the present invention
- FIG. 3 is a schematic structural diagram of an embodiment of a firmware upgrade system of an optical module according to the present invention.
- FIG. 4 is a schematic structural diagram of a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention
- FIG. 5 is a schematic structural diagram of an information area in a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention
- FIG. 6 is a schematic diagram of a firmware upgrade process according to an embodiment of a method for upgrading a firmware of an optical module according to the present invention
- FIG. 7 is a schematic structural diagram of an embodiment of a firmware upgrading apparatus for an optical module according to the present invention.
- the firmware upgrade loading method of the optical module provided in the embodiment of the present invention may be specifically applied to upgrade the FPGA of the optical module, or when the program is upgraded.
- the firmware upgrade loading method of the optical module provided in this embodiment may be specifically performed by using a firmware upgrade loading device of the optical module, and the firmware upgrade loading device of the optical module may be integrated in the optical module, the MCU of the optical module, or separately set.
- the firmware upgrade loading device of the optical module may be implemented by using software and/or hardware.
- FIG. 1 is a schematic flowchart of a firmware upgrade method of an optical module according to an embodiment of the present invention.
- FIG. 2 is a schematic structural diagram of a firmware upgrade package according to an embodiment of a firmware upgrade method of an optical module according to the present invention.
- the firmware upgrade method of the optical module includes:
- Step 101 Obtain a firmware upgrade package.
- the firmware upgrade package includes a program header and a program body, and the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware.
- Step 102 Determine, according to a program header of the firmware upgrade package, an upgrade firmware type.
- the firmware type in this embodiment includes at least a field programmable gate array FPGA or a micro control unit MCU.
- program header further includes any one of the following or a combination thereof:
- Program header checksum program body ID, program header length, program body length, program body checksum, compile time, or program version number.
- Table 1 shows the structure of the program header, as shown in Table 1 below.
- Step 103 Store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
- the storage medium corresponding to the FPGA is a storage medium connected to the FPGA through the MCU.
- a firmware upgrade package is obtained, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading firmware; Determining a firmware upgrade package, the firmware type determining at least a field programmable gate array FPGA or a micro control unit MCU; storing the program body in a determined upgrade according to the firmware type
- the storage medium corresponding to the firmware type The program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
- the firmware upgrade system of the optical module includes: an MCU, a storage medium, and an FPGA, where the MCU passes through the storage medium and the FPGA respectively.
- Serial Peripheral Interface (SPI) interface connection SPI
- the MCU has a management data input/output (MDIO) interface, and receives the firmware file sent by the host (HOST) through the MDIO interface.
- the SPI interface can communicate with the storage medium, that is, The FPGA file is read from the storage medium, or the FPGA can be used to communicate with the FPGA through the SPI interface, that is, the program is loaded to the FPGA through the SPI interface, wherein the host HOST is a board with an MDIO communication interface, and the firmware file to be upgraded can be prepared.
- the (bin file) is delivered to the MCU according to the CFP upgrade protocol.
- FPGA communicates with the MCU through the SPI interface to achieve high-speed signal processing and optical module control.
- Storage medium communicates with the MCU through the SPI interface to store the FPGA program.
- the determined firmware type of the upgrade is an FPGA; the program body includes the first FPGA update information;
- the storage medium includes at least a first storage area and a second storage area, and the storage medium passes through the MCU and the storage area.
- An FPGA connection where each storage area stores different versions of FPGA update information
- the running information of the storage area that is, the running firmware program described in the operation information in the Information Space area
- the method further includes:
- the first storage area is determined according to the operation information and the submission information of each storage area in the storage medium.
- the first storage area includes first FPGA update information loaded to the field programmable gate array FPGA, the operation information includes information whether it can be run on the FPGA, and the submission information includes whether All information of the FPGA update information is stored to the storage medium.
- the storage medium is connected to the FPGA through an MCU, and each storage area stores different versions of FPGA update information.
- the storage medium in this embodiment is an external storage medium, such as a flash memory (FLASH).
- the storage medium includes two areas, namely, an area A and a B area. If the running bit and the commit bit in the area A are both 1, the firmware of the area A is loaded to the FPGA. On the contrary, the firmware of the B area is loaded. This process is compatible with the description of the CFP_MSA protocol regarding version loading.
- the FPGA chip is set to the SPI boot mode. That is, after the FPGA chip is successfully set to the SPI initialization mode, the storage medium can be obtained through the SPI bus connected to the MCU.
- the FPGA update information corresponding to the running area For example, the first FPGA update information of the first memory area is passed through the RAM of the MCU and loaded into the FPGA via the SPI bus.
- the FPGA can be run, and if successful, the loading process ends, and if it fails, the load is reloaded.
- the FPGA update information stored in another storage area of the storage medium may be The FPGA is loaded.
- FIG. 4 is a schematic structural diagram of a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention.
- FIG. 5 is a schematic structural diagram of an information area in a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention, as shown in FIG.
- the storage medium in this embodiment may include at least two storage areas, and the storage area includes an information area and a file storage area.
- the file storage area stores FPGA update information; the information area stores operation information and submission information.
- the information area includes a run bit for storing operational information, a commit bit for storing the submitted information, and a reserved area.
- FIG. 6 is a schematic diagram of a firmware upgrade process according to an embodiment of a method for upgrading a firmware of an optical module according to the present invention, as shown in FIG. 6.
- Ben The firmware upgrade method in the embodiment includes:
- Step 601 Obtain a firmware upgrade package.
- the optical module first sets the optical module to be busy, and then passes the length of the program body in the program header, and stores the program body in the cache array of the MCU.
- Step 602 Determine, according to a program header in the firmware upgrade package, whether the current firmware program body is the first firmware upgrade package.
- a firmware upgrade program may be carried in multiple firmware programs, usually the first firmware upgrade package carries a program header. If it is determined that the current firmware program body is the first firmware upgrade package, step 603 is performed. If it is determined that the current firmware program body is not the first firmware upgrade package, step 607 is performed.
- Step 603 Determine whether to upgrade the FPGA according to the firmware upgrade package.
- step 604 if it is determined that the FPGA is not upgraded, that is, the MCU is upgraded, step 604 is performed. If it is determined that the FPGA is upgraded, step 605 is performed.
- Step 604 Set a firmware type flag to determine a write address of the MCU.
- Step 605 Determine, according to the operation information of each storage area in the storage medium, a storage area in which the first update upgrade information in the upgrade package is stored.
- the first update upgrade information is stored in the second storage area, and if the second storage area is determined to be stored in the second storage area, The FPGA update information is the currently running FPGA update information, and the first update upgrade information is stored in the first storage area.
- Step 606 Set a firmware type flag to determine a write address of the storage area.
- Step 607 Perform a program check.
- step 608 is performed, and if the program body check result is incorrect, the type of the error generating firmware and the error type are displayed.
- Step 608 Determine to write the program body to the firmware identified by the firmware type flag according to the firmware type flag.
- firmware type flag is an FPGA, it is determined to write the program body to the FPGA. If the firmware type flag is MCU, it is determined to write the program body to the MCU.
- Step 609 Clear the optical module to be busy, and set the register to the ready state.
- FIG. 7 is a schematic structural diagram of an embodiment of a firmware upgrading apparatus for an optical module according to the present invention, as shown in FIG. 7.
- the firmware upgrading apparatus includes: an obtaining module 71, a determining module 72, and a storage module 73. among them,
- the obtaining module 71 is configured to obtain a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;
- a determining module 72 configured to determine an upgraded firmware type according to a program header of the firmware upgrade package, the firmware class
- the type includes at least a field programmable gate array FPGA or a micro control unit MCU;
- the storage module 73 is configured to store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
- a firmware upgrade package is obtained, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading firmware; Determining a firmware upgrade package, the firmware type determining at least a field programmable gate array FPGA or a micro control unit MCU; storing the program body in a determined upgrade according to the firmware type
- the storage medium corresponding to the firmware type identified by the program header The program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
- program header further includes any one of the following or a combination thereof:
- Program header checksum program body ID, program header length, program body length, program body checksum, compile time, or program version number.
- the determining module 72 is further configured to determine, according to the operation information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, where the storage medium is at least a first storage area and a second storage area, the storage medium being connected to the FPGA by an MCU, the storage areas storing different versions of FPGA update information; determining to store the first FPGA update information to a second storage In the district.
- the determining module 72 is further configured to determine the second storage area according to the running information and the submission information of each storage area in the storage medium, where the second storage area includes First FPGA update information loaded to the FPGA, the run information including information capable of running on the FPGA, the commit information including information of whether to store all information of the FPGA update information to the storage medium; loading the FPGA The first FPGA updates information.
- the storage area includes an information area and a file storage area, and the file storage area stores FPGA update information, and the information area stores operation information and submission information.
- the foregoing technical solution of the embodiment of the present invention may be applied to a firmware upgrade process of a module, by acquiring a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, where the program header includes information identifying an upgrade firmware type.
- the program body includes update information for upgrading firmware; determining, according to a program header of the firmware upgrade package, an upgraded firmware type, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU; Type, will The program body is stored in a storage medium corresponding to the determined upgraded firmware type.
- the program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Disclosed are a firmware upgrade method and apparatus for an optical module. The method comprises: obtaining a firmware upgrade package, the firmware upgrade package comprising a program header and a program body, the program header comprising information identifying a type of to-be-upgraded firmware, and the program body comprising update information for the to-be-upgraded firmware; determining the type of the to-be-upgraded firmware according to the program header of the firmware upgrade package, the type of the firmware comprising at least a field programmable gate array (FPGA) or a microcontroller unit (MCU); and storing, according to the type of the firmware, the program body to a storage medium corresponding to the determined type of the to-be-upgraded firmware. Program bodies for different types of firmware are stored in storage media corresponding to the types of the firmware, so that multiple versions of program bodies can be stored in storage media, to enable an optical module to normally operate and improve operation efficiency of the optical module.
Description
本发明涉及光通信技术,尤指一种光模块的固件升级方法及装置。The present invention relates to an optical communication technology, and more particularly to a firmware upgrade method and apparatus for an optical module.
随着通信技术的发展,光模块广泛的应用在通信技术的各个方面,其中,光模块可以实现光电转换,即光模块的发送端可以将电信号转换成光信号,光模块的接收端可以将光信号转换成电信号。With the development of communication technology, optical modules are widely used in various aspects of communication technology. Among them, the optical module can realize photoelectric conversion, that is, the transmitting end of the optical module can convert the electrical signal into an optical signal, and the receiving end of the optical module can The optical signal is converted into an electrical signal.
在光模块速率提升,即光模块速率从10G、40G提升到100G的同时,光模块中的微控制单元(Microcontroller Unit,简称MCU)已经无法实现光模块的高速处理的需求。现有技术中,将现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)设置在光模块中,以使FPGA完成高速信号的处理和一些器件(光电/电光信号转换、信号采集)的控制。进而,在对光模块的升级过程中,通常将升级MCU的MCU更新信息或升级FPGA的FPGA更新信息均存储的在MCU的寄存器中。While the optical module speed is increased, that is, the optical module rate is increased from 10G to 40G to 100G, the Microcontroller Unit (MCU) in the optical module cannot meet the high-speed processing requirements of the optical module. In the prior art, a Field-Programmable Gate Array (FPGA) is disposed in an optical module to enable the FPGA to perform high-speed signal processing and control of some devices (photoelectric/electro-optical signal conversion, signal acquisition). . Further, during the upgrade of the optical module, the MCU update information of the upgraded MCU or the FPGA update information of the upgraded FPGA is usually stored in the register of the MCU.
然而,在升级FPGA的过程中,本领域技术人员发现,由于寄存器的存储空间有限,无法同时存储多个版本的FPGA更新信息,从而在当前存储的FPGA更新信息无法正常加载时,可能导致光模块无法正常工作。However, in the process of upgrading the FPGA, those skilled in the art have found that due to the limited storage space of the register, multiple versions of the FPGA update information cannot be stored at the same time, so that the optical module may be caused when the currently stored FPGA update information cannot be loaded normally. can not work normally.
发明内容Summary of the invention
为了解决上述技术问题,本发明实施例提供了一种光模块的固件升级方法及装置,用以解决光模块无法正常工作的问题。In order to solve the above technical problem, the embodiment of the present invention provides a firmware upgrade method and device for an optical module, which are used to solve the problem that the optical module cannot work normally.
为了达到本发明实施例目的,本发明实施例提供了一种光模块的固件升级方法,包括:In order to achieve the purpose of the embodiments of the present invention, an embodiment of the present invention provides a firmware upgrade method for an optical module, including:
获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;Obtaining a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;
根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;Determining an upgraded firmware type according to a program header of the firmware upgrade package, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU;
根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中。The program body is stored in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
进一步的,所述程序头,还包括以下任意一项或其组合:Further, the program header further includes any one of the following or a combination thereof:
程序头检验和、程序体标识、程序头长度、程序体长度、程序体检验和、编译时间、或程序版本号。
Program header checksum, program body ID, program header length, program body length, program body checksum, compile time, or program version number.
进一步的,根据所述固件升级包的程序头,所确定的升级的固件类型为FPGA;所述程序体包括第一FPGA更新信息;Further, according to the program header of the firmware upgrade package, the determined firmware type of the upgrade is an FPGA; the program body includes first FPGA update information;
所述根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中,包括:And storing, according to the firmware type, the program body in a storage medium corresponding to the determined upgraded firmware type, including:
根据存储介质中各存储区的运行信息,确定当前运行的FPGA更新信息存储在第一存储区,所述存储介质至少包括第一存储区和第二存储区,所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息;Determining, according to the operation information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, the storage medium includes at least a first storage area and a second storage area, and the storage medium passes the MCU and the An FPGA connection, wherein each storage area stores different versions of FPGA update information;
确定将所述第一FPGA更新信息存储到第二存储区中。Determining to store the first FPGA update information into the second storage area.
进一步的,所述获取固件升级包之后,还包括:Further, after the obtaining the firmware upgrade package, the method further includes:
根据存储介质中各存储区的运行信息和提交信息,确定所述第二存储区,所述第二存储区包括向FPGA加载的第一FPGA更新信息,所述运行信息包括是否能够在所述FPGA运行的信息,所述提交信息包括是否将FPGA更新信息的全部信息存储到存储介质的信息;Determining, according to operation information and submission information of each storage area in the storage medium, the second storage area, where the second storage area includes first FPGA update information loaded to an FPGA, and the operation information includes whether the FPGA can be Running information, the submission information including information of whether to store all information of the FPGA update information to the storage medium;
向所述FPGA加载所述第一FPGA更新信息。Loading the first FPGA update information to the FPGA.
进一步的,所述存储区包括信息区和文件存储区,所述文件存储区存储FPGA更新信息,所述信息区存储运行信息和提交信息。Further, the storage area includes an information area and a file storage area, and the file storage area stores FPGA update information, and the information area stores operation information and submission information.
本发明还提供了一种光模块的固件升级装置,包括:The invention also provides a firmware upgrading device for an optical module, comprising:
获取模块,设置为获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;An obtaining module, configured to obtain a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;
确定模块,设置为根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;Determining a module, configured to determine an upgraded firmware type according to a program header of the firmware upgrade package, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU;
存储模块,设置为根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中。And a storage module configured to store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
进一步的,所述程序头,还包括以下任意一项或其组合:Further, the program header further includes any one of the following or a combination thereof:
程序头检验和、程序体标识、程序头长度、程序体长度、程序体检验和、编译时间、或程序版本号。Program header checksum, program body ID, program header length, program body length, program body checksum, compile time, or program version number.
进一步的,所述确定模块,还设置为根据存储介质中各存储区的运行信息,确定当前运行的FPGA更新信息存储在第一存储区,所述存储介质至少包括第一存储区和第二存储区,所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息;确定将所述第一FPGA更新信息存储到第二存储区中。Further, the determining module is further configured to determine, according to the running information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, where the storage medium includes at least a first storage area and a second storage. The storage medium is connected to the FPGA through an MCU, and each storage area stores different versions of FPGA update information; determining to store the first FPGA update information in a second storage area.
进一步的,所述确定模块,还设置为根据存储介质中各存储区的运行信息和提交信息,确定所述第二存储区,所述第二存储区包括向FPGA加载的第一FPGA更新信息,所述运行
信息包括是否能够在所述FPGA运行的信息,所述提交信息包括是否将FPGA更新信息的全部信息存储到存储介质的信息;向所述FPGA加载所述第一FPGA更新信息。Further, the determining module is further configured to determine the second storage area according to operation information and submission information of each storage area in the storage medium, where the second storage area includes first FPGA update information loaded to the FPGA, The operation
The information includes information on whether the FPGA can be run, the submission information including information of whether to store all of the information of the FPGA update information to the storage medium; loading the first FPGA update information to the FPGA.
进一步的,所述存储区包括信息区和文件存储区,所述文件存储区存储FPGA更新信息,所述信息区存储运行信息和提交信息。Further, the storage area includes an information area and a file storage area, and the file storage area stores FPGA update information, and the information area stores operation information and submission information.
与现有技术相比,本发明实施例包括获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;根据所述固件类型,将所述程序体存储在与确定的升级的固件类型对应的存储介质中。实现了将不同固件类型的程序体存储在与该固件类型对应的存储介质中,从而可以在存储介质中存储多个版本的程序体,以使光模块正常工作,进而提高了光模块的工作效率。Compared with the prior art, the embodiment of the present invention includes acquiring a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes firmware for upgrading. Update information; determining an upgraded firmware type according to a program header of the firmware upgrade package, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU; storing the program body according to the firmware type In the storage medium corresponding to the determined upgraded firmware type. The program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
在本发明实施例中,还提供了一种计算机存储介质,该计算机存储介质可以存储有执行指令,该执行指令用于执行上述实施例中的光模块的固件升级方法的实现。In an embodiment of the present invention, a computer storage medium is further provided, and the computer storage medium may store an execution instruction for executing the firmware upgrade method of the optical module in the foregoing embodiment.
本发明实施例的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the embodiments of the invention will be set forth in the description in the description which The objectives and other advantages of the invention may be realized and obtained by means of the structure particularly pointed in the appended claims.
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification, which together with the embodiments of the present application are used to explain the technical solutions of the present invention, and do not constitute a limitation of the technical solutions of the present invention.
图1为本发明光模块的固件升级方法一实施例的流程示意图;1 is a schematic flowchart of an embodiment of a method for upgrading a firmware of an optical module according to the present invention;
图2为本发明光模块的固件升级方法一实施例的固件升级包的结构示意图;2 is a schematic structural diagram of a firmware upgrade package according to an embodiment of a firmware upgrade method of an optical module according to the present invention;
图3为本发明光模块的固件升级***一实施例的结构示意图;3 is a schematic structural diagram of an embodiment of a firmware upgrade system of an optical module according to the present invention;
图4为本发明光模块的固件升级***一实施例的存储介质的结构示意图;4 is a schematic structural diagram of a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention;
图5为本发明光模块的固件升级***一实施例的存储介质中信息区的结构示意图;5 is a schematic structural diagram of an information area in a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention;
图6为本发明光模块的固件升级方法一实施例的固件升级流程示意图;6 is a schematic diagram of a firmware upgrade process according to an embodiment of a method for upgrading a firmware of an optical module according to the present invention;
图7为本发明光模块的固件升级装置一实施例的结构示意图。FIG. 7 is a schematic structural diagram of an embodiment of a firmware upgrading apparatus for an optical module according to the present invention.
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
本发明实施例提供的光模块的固件升级加载方法具体可以应用于对光模块的FPGA进行版本升级,或程序升级时。本实施例提供的光模块的固件升级加载方法具体可以通过光模块的固件升级加载装置来执行,该光模块的固件升级加载装置可以集成在光模块中、光模块的MCU中,或者单独设置,其中,该光模块的固件升级加载装置可以采用软件和/或硬件的方式来实现。以下对本实施例提供的光模块的固件升级方法及其装置进行详细地说明。The firmware upgrade loading method of the optical module provided in the embodiment of the present invention may be specifically applied to upgrade the FPGA of the optical module, or when the program is upgraded. The firmware upgrade loading method of the optical module provided in this embodiment may be specifically performed by using a firmware upgrade loading device of the optical module, and the firmware upgrade loading device of the optical module may be integrated in the optical module, the MCU of the optical module, or separately set. The firmware upgrade loading device of the optical module may be implemented by using software and/or hardware. The firmware upgrade method and device of the optical module provided in this embodiment are described in detail below.
图1为本发明光模块的固件升级方法一实施例的流程示意图,图2为本发明光模块的固件升级方法一实施例的固件升级包的结构示意图,如图1所示,本发明提供的光模块的固件升级方法,包括:1 is a schematic flowchart of a firmware upgrade method of an optical module according to an embodiment of the present invention. FIG. 2 is a schematic structural diagram of a firmware upgrade package according to an embodiment of a firmware upgrade method of an optical module according to the present invention. The firmware upgrade method of the optical module includes:
步骤101、获取固件升级包。Step 101: Obtain a firmware upgrade package.
在本实施例中,如图2所示,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息。In this embodiment, as shown in FIG. 2, the firmware upgrade package includes a program header and a program body, and the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware.
步骤102、根据所述固件升级包的程序头,确定升级的固件类型。Step 102: Determine, according to a program header of the firmware upgrade package, an upgrade firmware type.
本实施例中的所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU。The firmware type in this embodiment includes at least a field programmable gate array FPGA or a micro control unit MCU.
需要说明的是,所述程序头,还包括以下任意一项或其组合:It should be noted that the program header further includes any one of the following or a combination thereof:
程序头检验和、程序体标识、程序头长度、程序体长度、程序体检验和、编译时间、或程序版本号。Program header checksum, program body ID, program header length, program body length, program body checksum, compile time, or program version number.
具体的,表1为程序头结构,如下述表1所示,Specifically, Table 1 shows the structure of the program header, as shown in Table 1 below.
表1Table 1
步骤103、根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中。Step 103: Store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
需要说明的是,与FPGA对应的存储介质为通过MCU与所述FPGA连接的存储介质。It should be noted that the storage medium corresponding to the FPGA is a storage medium connected to the FPGA through the MCU.
在本实施例中,获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;根据所述固件类型,将所述程序体存储在与确定的升级的固件类型对应的存储介质中。实现了将不同固件类型的程序体存储在与该固件类型对应的存储介质中,从而可以在存储介质中存储多个版本的程序体,以使光模块正常工作,进而提高了光模块的工作效率。In this embodiment, a firmware upgrade package is obtained, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading firmware; Determining a firmware upgrade package, the firmware type determining at least a field programmable gate array FPGA or a micro control unit MCU; storing the program body in a determined upgrade according to the firmware type The storage medium corresponding to the firmware type. The program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
图3为本发明光模块的固件升级***一实施例的结构示意图,如图3所示,该光模块的固件升级***包括:MCU、存储介质和FPGA,其中,MCU分别与存储介质与FPGA通过串行外设接口(Serial Peripheral Interface,简称SPI)接口连接。具体的,3 is a schematic structural diagram of an embodiment of a firmware upgrade system of an optical module according to the present invention. As shown in FIG. 3, the firmware upgrade system of the optical module includes: an MCU, a storage medium, and an FPGA, where the MCU passes through the storage medium and the FPGA respectively. Serial Peripheral Interface (SPI) interface connection. specific,
MCU:具有管理数据输入输出(Management Data Input/Output,简称MDIO)接口,通过该MDIO接口接收由主机(HOST)下发的固件文件,进一步的,可以通过SPI接口与存储介质进行通信,即,从存储介质中读取FPGA文件,或者,还可以通过SPI接口与FPGA进行通信,即通过SPI接口给FPGA加载程序,其中,主机HOST是具有MDIO通讯接口的单板,能将准备升级的固件文件(bin文件)按照CFP升级协议下发至MCU。The MCU has a management data input/output (MDIO) interface, and receives the firmware file sent by the host (HOST) through the MDIO interface. Further, the SPI interface can communicate with the storage medium, that is, The FPGA file is read from the storage medium, or the FPGA can be used to communicate with the FPGA through the SPI interface, that is, the program is loaded to the FPGA through the SPI interface, wherein the host HOST is a board with an MDIO communication interface, and the firmware file to be upgraded can be prepared. The (bin file) is delivered to the MCU according to the CFP upgrade protocol.
FPGA:与MCU之间通过SPI接口通信,实现高速信号处理、光模块控制。FPGA: communicates with the MCU through the SPI interface to achieve high-speed signal processing and optical module control.
存储介质:与MCU之间通过SPI接口通信,存放FPGA程序。Storage medium: communicates with the MCU through the SPI interface to store the FPGA program.
进一步的,在上述实施例的基础上,根据所述固件升级包的程序头,所确定的升级的固件类型为FPGA;所述程序体包括所述第一FPGA更新信息;Further, based on the foregoing embodiment, according to the program header of the firmware upgrade package, the determined firmware type of the upgrade is an FPGA; the program body includes the first FPGA update information;
所述根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中,包括:And storing, according to the firmware type, the program body in a storage medium corresponding to the determined upgraded firmware type, including:
根据所述存储介质中各存储区的运行信息,确定当前运行的FPGA更新信息存储在第一存储区所述存储介质至少包括第一存储区和第二存储区,所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息;
Determining, according to the operation information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, the storage medium includes at least a first storage area and a second storage area, and the storage medium passes through the MCU and the storage area. An FPGA connection, where each storage area stores different versions of FPGA update information;
确定将所述第一FPGA更新信息存储到第二存储区中。Determining to store the first FPGA update information into the second storage area.
举例来讲,升级过程中,根据存储区的运行信息,即信息(Information Space)区域中运行信息描述的正在运行的固件程序,确定将当前接收的FPGA更新信息存放在哪一个存储区。例如:正在运行的固件程序存放在第一存储区,则接收到的固件升级程序放在第二存储区,反之,如果正在运行的固件程序存放在第二存储区,则接收到的固件升级程序存放在第一存储区。For example, during the upgrade process, according to the running information of the storage area, that is, the running firmware program described in the operation information in the Information Space area, it is determined in which storage area the currently received FPGA update information is stored. For example, if the running firmware program is stored in the first storage area, the received firmware upgrade program is placed in the second storage area, and if the running firmware program is stored in the second storage area, the received firmware upgrade program is received. Stored in the first storage area.
进一步的,在上述实施例的基础上,所述获取固件升级包之后,还可以包括:Further, after the obtaining the firmware upgrade package, the method further includes:
根据存储介质中各存储区的运行信息和提交信息,确定第一存储区。The first storage area is determined according to the operation information and the submission information of each storage area in the storage medium.
在本实施例中,所述第一存储区包括向现场可编程门阵列FPGA加载的第一FPGA更新信息,所述运行信息包括是否能够在所述FPGA运行的信息,所述提交信息包括是否将FPGA更新信息的全部信息存储到存储介质。所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息。举例来讲,本实施例中的存储介质是一个外挂的存储介质,如,闪存(FLASH)。In this embodiment, the first storage area includes first FPGA update information loaded to the field programmable gate array FPGA, the operation information includes information whether it can be run on the FPGA, and the submission information includes whether All information of the FPGA update information is stored to the storage medium. The storage medium is connected to the FPGA through an MCU, and each storage area stores different versions of FPGA update information. For example, the storage medium in this embodiment is an external storage medium, such as a flash memory (FLASH).
具体的,在光模块上电加载固件过程中,可以通过判断各存储区的运行信息和提交信息,确定将哪一个区的程序加载至FPGA。比如:该存储介质包括两个区,即A区和B区,若A区的中的运行信息(Running bit)与提交信息(Commit bit)均为1,则加载A区的固件程序到FPGA。反之加载B区的固件程序,此过程兼容CFP_MSA协议关于版本加载的描述。Specifically, in the process of electrically loading the firmware on the optical module, it may be determined by determining the operation of each storage area and the submission information, and which program of the area is loaded into the FPGA. For example, the storage medium includes two areas, namely, an area A and a B area. If the running bit and the commit bit in the area A are both 1, the firmware of the area A is loaded to the FPGA. On the contrary, the firmware of the B area is loaded. This process is compatible with the description of the CFP_MSA protocol regarding version loading.
根据所述第一存储区,向所述FPGA加载所述第一FPGA更新信息。Loading the first FPGA update information to the FPGA according to the first storage area.
举例来讲,光模块上电后,将FPGA芯片设置为SPI初始化(SPI boot)模式,也就是说,在成功设置FPGA芯片为SPI初始化模式之后,可以通过与MCU连接的SPI总线,获得存储介质中对应运行区域的FPGA更新信息。例如,将第一存储区的第一FPGA更新信息通过MCU的RAM中,以及通过SPI总线加载到FPGA。For example, after the optical module is powered on, the FPGA chip is set to the SPI boot mode. That is, after the FPGA chip is successfully set to the SPI initialization mode, the storage medium can be obtained through the SPI bus connected to the MCU. The FPGA update information corresponding to the running area. For example, the first FPGA update information of the first memory area is passed through the RAM of the MCU and loaded into the FPGA via the SPI bus.
进一步的,在将第一FPGA更新信息加载到FPGA之后,可以运行FPGA,若成功则结束加载流程,若失败重新加载。Further, after the first FPGA update information is loaded into the FPGA, the FPGA can be run, and if successful, the loading process ends, and if it fails, the load is reloaded.
需要说明的是,在加载过程中,或加载后的运行过程中,确定第一FPGA更新信息是无法正常加载的FPGA更新信息之后,可以将存储介质中另一存储区中存储的FPGA更新信息向FPGA进行加载。It should be noted that, during the loading process or during the loading process, after determining that the first FPGA update information is the FPGA update information that cannot be loaded normally, the FPGA update information stored in another storage area of the storage medium may be The FPGA is loaded.
图4为本发明光模块的固件升级***一实施例的存储介质的结构示意图,图5为本发明光模块的固件升级***一实施例的存储介质中信息区的结构示意图,如图4所示,本实施例中的存储介质可以包括至少两个存储区,所述存储区包括信息区和文件存储区。所述文件存储区存储FPGA更新信息;所述信息区存储运行信息和提交信息。如图5所示,信息区包括用于存储运行信息的运行位、于存储提交信息的提交位、以及预留区。4 is a schematic structural diagram of a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention. FIG. 5 is a schematic structural diagram of an information area in a storage medium according to an embodiment of a firmware upgrade system of an optical module according to the present invention, as shown in FIG. The storage medium in this embodiment may include at least two storage areas, and the storage area includes an information area and a file storage area. The file storage area stores FPGA update information; the information area stores operation information and submission information. As shown in FIG. 5, the information area includes a run bit for storing operational information, a commit bit for storing the submitted information, and a reserved area.
图6为本发明光模块的固件升级方法一实施例的固件升级流程示意图,如图6所示。本
实施例中的固件升级方法包括:FIG. 6 is a schematic diagram of a firmware upgrade process according to an embodiment of a method for upgrading a firmware of an optical module according to the present invention, as shown in FIG. 6. Ben
The firmware upgrade method in the embodiment includes:
步骤601、获取固件升级包。Step 601: Obtain a firmware upgrade package.
具体的,光模块获取固件升级包之后,首先将光模块置忙,接着,通过程序头中程序体长度,并将程序体存储在MCU的缓存数组中。Specifically, after obtaining the firmware upgrade package, the optical module first sets the optical module to be busy, and then passes the length of the program body in the program header, and stores the program body in the cache array of the MCU.
步骤602、根据固件升级包中的程序头,确定当前固件程序体是否是第一固件升级包。Step 602: Determine, according to a program header in the firmware upgrade package, whether the current firmware program body is the first firmware upgrade package.
具体的,一个固件的升级程序可能携带在多个固件程序体中,通常第一个固件升级包携带有程序头。若确定当前固件程序体是第一固件升级包,则执行步骤603,若确定当前固件程序体不是第一固件升级包,则执行步骤607。Specifically, a firmware upgrade program may be carried in multiple firmware programs, usually the first firmware upgrade package carries a program header. If it is determined that the current firmware program body is the first firmware upgrade package, step 603 is performed. If it is determined that the current firmware program body is not the first firmware upgrade package, step 607 is performed.
步骤603、根据固件升级包,确定是否对FPGA进行升级。Step 603: Determine whether to upgrade the FPGA according to the firmware upgrade package.
具体的,若确定不是对FPGA进行升级,即对MCU升级,则执行步骤604,若确定是对FPGA进行升级,则执行步骤605。Specifically, if it is determined that the FPGA is not upgraded, that is, the MCU is upgraded, step 604 is performed. If it is determined that the FPGA is upgraded, step 605 is performed.
步骤604、设置固件类型标志,确定MCU的写入地址。Step 604: Set a firmware type flag to determine a write address of the MCU.
步骤605、根据所述存储介质中各存储区的运行信息,确定将升级包中第一更新升级信息存储的存储区。Step 605: Determine, according to the operation information of each storage area in the storage medium, a storage area in which the first update upgrade information in the upgrade package is stored.
具体的,若确定第一存储区中存储的第二FPGA更新信息为当前运行的FPGA更新信息,则将第一更新升级信息存储到第二存储区,若确定第二存储区中存储的第二FPGA更新信息为当前运行的FPGA更新信息,则将第一更新升级信息存储到第一存储区。Specifically, if it is determined that the second FPGA update information stored in the first storage area is the currently running FPGA update information, the first update upgrade information is stored in the second storage area, and if the second storage area is determined to be stored in the second storage area, The FPGA update information is the currently running FPGA update information, and the first update upgrade information is stored in the first storage area.
步骤606、设置固件类型标志,确定存储区的写入地址。Step 606: Set a firmware type flag to determine a write address of the storage area.
步骤607、进行程序体检验。Step 607: Perform a program check.
具体的,若程序体检验结果正确,则执行步骤608,若程序体检验结果不正确,则显示产生错误的固件类型及错误类型。Specifically, if the program body check result is correct, step 608 is performed, and if the program body check result is incorrect, the type of the error generating firmware and the error type are displayed.
步骤608、根据固件类型标志,确定将程序体写入固件类型标志所标识的固件。Step 608: Determine to write the program body to the firmware identified by the firmware type flag according to the firmware type flag.
具体的,若固件类型标志为FPGA,则确定将程序体写入FPGA。若固件类型标志为MCU,则确定将程序体写入MCU。Specifically, if the firmware type flag is an FPGA, it is determined to write the program body to the FPGA. If the firmware type flag is MCU, it is determined to write the program body to the MCU.
步骤609、清除光模块置忙,将寄存器置为准备状态。Step 609: Clear the optical module to be busy, and set the register to the ready state.
图7为本发明光模块的固件升级装置一实施例的结构示意图,如图7所示。该固件升级装置,包括:获取模块71、确定模块72和存储模块73。其中,FIG. 7 is a schematic structural diagram of an embodiment of a firmware upgrading apparatus for an optical module according to the present invention, as shown in FIG. 7. The firmware upgrading apparatus includes: an obtaining module 71, a determining module 72, and a storage module 73. among them,
获取模块71,设置为获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;The obtaining module 71 is configured to obtain a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;
确定模块72,设置为根据所述固件升级包的程序头,确定升级的固件类型,所述固件类
型至少包括现场可编程门阵列FPGA或微控制单元MCU;a determining module 72, configured to determine an upgraded firmware type according to a program header of the firmware upgrade package, the firmware class
The type includes at least a field programmable gate array FPGA or a micro control unit MCU;
存储模块73,设置为根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中。The storage module 73 is configured to store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
在本实施例中,获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;根据所述固件类型,将所述程序体存储在与确定的升级所述程序头标识的固件类型对应的存储介质中。实现了将不同固件类型的程序体存储在与该固件类型对应的存储介质中,从而可以在存储介质中存储多个版本的程序体,以使光模块正常工作,进而提高了光模块的工作效率。In this embodiment, a firmware upgrade package is obtained, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading firmware; Determining a firmware upgrade package, the firmware type determining at least a field programmable gate array FPGA or a micro control unit MCU; storing the program body in a determined upgrade according to the firmware type The storage medium corresponding to the firmware type identified by the program header. The program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
需要说明的是,所述程序头,还包括以下任意一项或其组合:It should be noted that the program header further includes any one of the following or a combination thereof:
程序头检验和、程序体标识、程序头长度、程序体长度、程序体检验和、编译时间、或程序版本号。Program header checksum, program body ID, program header length, program body length, program body checksum, compile time, or program version number.
进一步的,在上述实施例的基础上,所述确定模块72,还设置为根据存储介质中各存储区的运行信息,确定当前运行的FPGA更新信息存储在第一存储区,所述存储介质至少包括第一存储区和第二存储区,所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息;确定将所述第一FPGA更新信息存储到第二存储区中。Further, based on the foregoing embodiment, the determining module 72 is further configured to determine, according to the operation information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, where the storage medium is at least a first storage area and a second storage area, the storage medium being connected to the FPGA by an MCU, the storage areas storing different versions of FPGA update information; determining to store the first FPGA update information to a second storage In the district.
更进一步的,在上述实施例的基础上,所述确定模块72,还设置为根据存储介质中各存储区的运行信息和提交信息,确定所述第二存储区,所述第二存储区包括向FPGA加载的第一FPGA更新信息,所述运行信息包括是否能够在所述FPGA运行的信息,所述提交信息包括是否将FPGA更新信息的全部信息存储到存储介质的信息;向所述FPGA加载所述第一FPGA更新信息。Further, on the basis of the foregoing embodiment, the determining module 72 is further configured to determine the second storage area according to the running information and the submission information of each storage area in the storage medium, where the second storage area includes First FPGA update information loaded to the FPGA, the run information including information capable of running on the FPGA, the commit information including information of whether to store all information of the FPGA update information to the storage medium; loading the FPGA The first FPGA updates information.
在本实施例中,所述存储区包括信息区和文件存储区,所述文件存储区存储FPGA更新信息,所述信息区存储运行信息和提交信息。In this embodiment, the storage area includes an information area and a file storage area, and the file storage area stores FPGA update information, and the information area stores operation information and submission information.
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。While the embodiments of the present invention have been described above, the described embodiments are merely for the purpose of understanding the invention and are not intended to limit the invention. Any modification and variation in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention. The scope defined by the appended claims shall prevail.
本发明实施例的上述技术方案,可以应用于模块的固件升级过程中,通过获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;根据所述固件类型,将
所述程序体存储在与确定的升级的固件类型对应的存储介质中。实现了将不同固件类型的程序体存储在与该固件类型对应的存储介质中,从而可以在存储介质中存储多个版本的程序体,以使光模块正常工作,进而提高了光模块的工作效率。
The foregoing technical solution of the embodiment of the present invention may be applied to a firmware upgrade process of a module, by acquiring a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, where the program header includes information identifying an upgrade firmware type. The program body includes update information for upgrading firmware; determining, according to a program header of the firmware upgrade package, an upgraded firmware type, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU; Type, will
The program body is stored in a storage medium corresponding to the determined upgraded firmware type. The program body of different firmware types is stored in a storage medium corresponding to the firmware type, so that multiple versions of the program body can be stored in the storage medium, so that the optical module works normally, thereby improving the working efficiency of the optical module. .
Claims (10)
- 一种光模块的固件升级方法,包括:A firmware upgrade method for an optical module includes:获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;Obtaining a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;根据所述固件升级包的程序头,确定升级的固件类型,所述固件类型至少包括现场可编程门阵列FPGA或微控制单元MCU;Determining an upgraded firmware type according to a program header of the firmware upgrade package, the firmware type including at least a field programmable gate array FPGA or a micro control unit MCU;根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中。The program body is stored in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
- 根据权利要求1所述的方法,其中,所述程序头,还包括以下任意一项或其组合:The method of claim 1, wherein the program header further comprises any one of the following or a combination thereof:程序头检验和、程序体标识、程序头长度、程序体长度、程序体检验和、编译时间、或程序版本号。Program header checksum, program body ID, program header length, program body length, program body checksum, compile time, or program version number.
- 根据权利要求2所述的方法,其中,根据所述固件升级包的程序头,所确定的升级的固件类型为FPGA;所述程序体包括第一FPGA更新信息;The method of claim 2, wherein the determined upgraded firmware type is an FPGA according to a program header of the firmware upgrade package; the program body includes first FPGA update information;所述根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中,包括:And storing, according to the firmware type, the program body in a storage medium corresponding to the determined upgraded firmware type, including:根据存储介质中各存储区的运行信息,确定当前运行的FPGA更新信息存储在第一存储区,所述存储介质至少包括第一存储区和第二存储区,所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息;Determining, according to the operation information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, the storage medium includes at least a first storage area and a second storage area, and the storage medium passes the MCU and the An FPGA connection, wherein each storage area stores different versions of FPGA update information;确定将所述第一FPGA更新信息存储到第二存储区中。Determining to store the first FPGA update information into the second storage area.
- 根据权利要求1-3任一项所述的方法,其中,所述获取固件升级包之后,还包括:The method according to any one of claims 1-3, wherein after the obtaining the firmware upgrade package, the method further comprises:根据存储介质中各存储区的运行信息和提交信息,确定所述第二存储区,所述第二存储区包括向FPGA加载的第一FPGA更新信息,所述运行信息包括是否能够在所述FPGA运行的信息,所述提交信息包括是否将FPGA更新信息的全部信息存储到存储介质的信息;Determining, according to operation information and submission information of each storage area in the storage medium, the second storage area, where the second storage area includes first FPGA update information loaded to an FPGA, and the operation information includes whether the FPGA can be Running information, the submission information including information of whether to store all information of the FPGA update information to the storage medium;向所述FPGA加载所述第一FPGA更新信息。Loading the first FPGA update information to the FPGA.
- 根据权利要求4所述的方法,其中,所述存储区包括信息区和文件存储区,所述文件存储区存储FPGA更新信息,所述信息区存储运行信息和提交信息。The method of claim 4 wherein said storage area comprises an information area and a file storage area, said file storage area storing FPGA update information, said information area storing operational information and submission information.
- 一种光模块的固件升级装置,包括:A firmware upgrade device for an optical module, comprising:获取模块,设置为获取固件升级包,所述固件升级包包括程序头和程序体,所述程序头包括标识升级固件类型的信息,所述程序体包括用于升级固件的更新信息;An obtaining module, configured to obtain a firmware upgrade package, where the firmware upgrade package includes a program header and a program body, the program header includes information identifying an upgrade firmware type, and the program body includes update information for upgrading the firmware;确定模块,设置为根据所述固件升级包的程序头,确定升级的固件类型,所述固件 类型至少包括现场可编程门阵列FPGA或微控制单元MCU;Determining a module, configured to determine an upgraded firmware type according to a program header of the firmware upgrade package, the firmware Type includes at least a field programmable gate array FPGA or a micro control unit MCU;存储模块,设置为根据所述固件类型,将所述程序体存储在与所确定的升级的固件类型对应的存储介质中。And a storage module configured to store the program body in a storage medium corresponding to the determined upgraded firmware type according to the firmware type.
- 根据权利要求6所述的装置,其中,所述程序头,还包括以下任意一项或其组合:The apparatus according to claim 6, wherein said program header further comprises any one of the following or a combination thereof:程序头检验和、程序体标识、程序头长度、程序体长度、程序体检验和、编译时间、或程序版本号。Program header checksum, program body ID, program header length, program body length, program body checksum, compile time, or program version number.
- 根据权利要求7所述的装置,其中,所述确定模块,还设置为根据存储介质中各存储区的运行信息,确定当前运行的FPGA更新信息存储在第一存储区,所述存储介质至少包括第一存储区和第二存储区,所述存储介质通过MCU与所述FPGA连接,所述各存储区存储不同版本的FPGA更新信息;确定将所述第一FPGA更新信息存储到第二存储区中。The device according to claim 7, wherein the determining module is further configured to determine, according to operation information of each storage area in the storage medium, that the currently running FPGA update information is stored in the first storage area, the storage medium includes at least a first storage area and a second storage area, the storage medium is connected to the FPGA by an MCU, the storage areas storing different versions of FPGA update information; determining to store the first FPGA update information to a second storage area in.
- 根据权利要求6-8任一项所述的装置,其中,所述确定模块,还设置为根据存储介质中各存储区的运行信息和提交信息,确定所述第二存储区,所述第二存储区包括向FPGA加载的第一FPGA更新信息,所述运行信息包括是否能够在所述FPGA运行的信息,所述提交信息包括是否将FPGA更新信息的全部信息存储到存储介质的信息;向所述FPGA加载所述第一FPGA更新信息。The apparatus according to any one of claims 6-8, wherein the determining module is further configured to determine the second storage area according to operation information and submission information of each storage area in the storage medium, the second The storage area includes first FPGA update information loaded to the FPGA, the operation information including information capable of running on the FPGA, the submission information including information of whether to store all information of the FPGA update information to the storage medium; The FPGA loads the first FPGA update information.
- 根据权利要求9所述的装置,其中,所述存储区包括信息区和文件存储区,所述文件存储区存储FPGA更新信息,所述信息区存储运行信息和提交信息。 The apparatus of claim 9, wherein the storage area comprises an information area and a file storage area, the file storage area storing FPGA update information, the information area storing operation information and submission information.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510665944.5 | 2015-10-15 | ||
CN201510665944.5A CN106598632B (en) | 2015-10-15 | 2015-10-15 | Firmware upgrading method and device for optical module |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017063577A1 true WO2017063577A1 (en) | 2017-04-20 |
Family
ID=58517109
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/102042 WO2017063577A1 (en) | 2015-10-15 | 2016-10-13 | Firmware upgrade method and apparatus for optical module |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106598632B (en) |
WO (1) | WO2017063577A1 (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107967160A (en) * | 2017-12-22 | 2018-04-27 | 杭州迪普科技股份有限公司 | A kind of method and device that operating system file is updated by Boot Loader |
CN108803442A (en) * | 2018-07-25 | 2018-11-13 | 武汉光迅科技股份有限公司 | A kind of optical mode block code download apparatus and method |
CN110609695A (en) * | 2019-09-17 | 2019-12-24 | 青岛海信宽带多媒体技术有限公司 | Optical module firmware upgrading method and system and optical module |
CN110704365A (en) * | 2019-08-20 | 2020-01-17 | 浙江大华技术股份有限公司 | Reconstruction device based on FPGA |
CN111552491A (en) * | 2020-04-22 | 2020-08-18 | 北京小马智行科技有限公司 | Method, device and storage medium for upgrading firmware of transfer equipment of mobile carrier |
CN113076117A (en) * | 2020-01-03 | 2021-07-06 | 北京猎户星空科技有限公司 | OTA (over the air) upgrading method and device, electronic equipment and storage medium |
CN113672246A (en) * | 2021-08-27 | 2021-11-19 | 广东九联科技股份有限公司 | Optical module upgrading device, system and method |
CN114036097A (en) * | 2021-10-09 | 2022-02-11 | 中国航空工业集团公司洛阳电光设备研究所 | Domestic FPGA (field programmable Gate array) logic online upgrading method for improving maintainability of photoelectric product |
CN114466260A (en) * | 2020-11-10 | 2022-05-10 | 青岛海信宽带多媒体技术有限公司 | Optical module upgrading method and optical module |
US20230027611A1 (en) * | 2021-07-26 | 2023-01-26 | Realtek Semiconductor Corporation | Power supply device, power supply system and non-transitory computer-readable recording medium |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108958765B (en) * | 2018-06-12 | 2022-12-09 | 新华三技术有限公司 | Method and device for upgrading optical module firmware |
CN110018854B (en) * | 2019-03-26 | 2021-10-22 | 联想(北京)有限公司 | Firmware matching method, equipment and computer readable storage medium |
CN110298145B (en) * | 2019-06-28 | 2022-03-18 | 兆讯恒达科技股份有限公司 | Firmware program loading protection method based on public key cryptographic algorithm |
CN110737452A (en) * | 2019-09-30 | 2020-01-31 | 清能德创电气技术(北京)有限公司 | FPGA firmware online upgrading method and system |
CN110851162A (en) * | 2019-11-11 | 2020-02-28 | 深圳忆联信息***有限公司 | SSD (solid State disk) firmware upgrading method and device compatible with RAID and non-RAID |
CN111176702B (en) * | 2019-12-16 | 2023-08-08 | 京信网络***股份有限公司 | Firmware upgrading method, device, computer equipment and storage medium |
CN111142914B (en) * | 2019-12-31 | 2021-05-28 | 南京中科晶上通信技术有限公司 | ZYNQ-based firmware upgrading method and computer-readable storage medium |
CN112925538B (en) * | 2021-01-27 | 2024-05-03 | 国网北京市电力公司 | Equipment updating method, system and device |
CN114915345B (en) * | 2021-01-29 | 2023-12-01 | 青岛海信宽带多媒体技术有限公司 | Optical module |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101290579A (en) * | 2008-06-16 | 2008-10-22 | 四川长虹电器股份有限公司 | Reconfigurable software unit upgrading method |
CN102065118A (en) * | 2010-09-16 | 2011-05-18 | 深圳市九洲电器有限公司 | Method for updating network equipment and device for implementing method |
CN102223256A (en) * | 2011-07-26 | 2011-10-19 | 烽火通信科技股份有限公司 | Method and system for multi-ONU (optical network unit) automatic upgrading in GPON (gigabit-capable passive optical network) access system |
CN103218244A (en) * | 2013-05-17 | 2013-07-24 | 烽火通信科技股份有限公司 | Software updating and upgrading method of communication equipment |
CN104579719A (en) * | 2013-10-10 | 2015-04-29 | 中兴通讯股份有限公司 | A method and system for updating firmware, upper computer and optical module |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20070002887A (en) * | 2005-06-30 | 2007-01-05 | 주식회사 대우일렉트로닉스 | Apparatus and method for upgrading a firmware in an electronic equipment |
JP5224361B2 (en) * | 2008-11-12 | 2013-07-03 | 古河電気工業株式会社 | Optical module and control method thereof |
CN102722384A (en) * | 2012-05-25 | 2012-10-10 | 深圳市共进电子股份有限公司 | On-line upgrading method and upgrading system for optical module firmware |
CN103207800A (en) * | 2013-04-24 | 2013-07-17 | 厦门亿联网络技术股份有限公司 | Method for safely and flexibly upgrading firmware |
-
2015
- 2015-10-15 CN CN201510665944.5A patent/CN106598632B/en active Active
-
2016
- 2016-10-13 WO PCT/CN2016/102042 patent/WO2017063577A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101290579A (en) * | 2008-06-16 | 2008-10-22 | 四川长虹电器股份有限公司 | Reconfigurable software unit upgrading method |
CN102065118A (en) * | 2010-09-16 | 2011-05-18 | 深圳市九洲电器有限公司 | Method for updating network equipment and device for implementing method |
CN102223256A (en) * | 2011-07-26 | 2011-10-19 | 烽火通信科技股份有限公司 | Method and system for multi-ONU (optical network unit) automatic upgrading in GPON (gigabit-capable passive optical network) access system |
CN103218244A (en) * | 2013-05-17 | 2013-07-24 | 烽火通信科技股份有限公司 | Software updating and upgrading method of communication equipment |
CN104579719A (en) * | 2013-10-10 | 2015-04-29 | 中兴通讯股份有限公司 | A method and system for updating firmware, upper computer and optical module |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107967160B (en) * | 2017-12-22 | 2021-04-27 | 杭州迪普科技股份有限公司 | Method and device for updating operating system file through Boot Loader |
CN107967160A (en) * | 2017-12-22 | 2018-04-27 | 杭州迪普科技股份有限公司 | A kind of method and device that operating system file is updated by Boot Loader |
CN108803442A (en) * | 2018-07-25 | 2018-11-13 | 武汉光迅科技股份有限公司 | A kind of optical mode block code download apparatus and method |
CN110704365A (en) * | 2019-08-20 | 2020-01-17 | 浙江大华技术股份有限公司 | Reconstruction device based on FPGA |
CN110609695A (en) * | 2019-09-17 | 2019-12-24 | 青岛海信宽带多媒体技术有限公司 | Optical module firmware upgrading method and system and optical module |
CN113076117A (en) * | 2020-01-03 | 2021-07-06 | 北京猎户星空科技有限公司 | OTA (over the air) upgrading method and device, electronic equipment and storage medium |
CN113076117B (en) * | 2020-01-03 | 2024-05-07 | 北京猎户星空科技有限公司 | OTA upgrading method and device, electronic equipment and storage medium |
CN111552491A (en) * | 2020-04-22 | 2020-08-18 | 北京小马智行科技有限公司 | Method, device and storage medium for upgrading firmware of transfer equipment of mobile carrier |
CN114466260A (en) * | 2020-11-10 | 2022-05-10 | 青岛海信宽带多媒体技术有限公司 | Optical module upgrading method and optical module |
CN114466260B (en) * | 2020-11-10 | 2023-11-03 | 青岛海信宽带多媒体技术有限公司 | Optical module upgrading method and optical module |
US20230027611A1 (en) * | 2021-07-26 | 2023-01-26 | Realtek Semiconductor Corporation | Power supply device, power supply system and non-transitory computer-readable recording medium |
US11991011B2 (en) * | 2021-07-26 | 2024-05-21 | Realtek Semiconductor Corporation | Power supply device, power supply system and non-transitory computer-readable recording medium |
CN113672246A (en) * | 2021-08-27 | 2021-11-19 | 广东九联科技股份有限公司 | Optical module upgrading device, system and method |
CN114036097A (en) * | 2021-10-09 | 2022-02-11 | 中国航空工业集团公司洛阳电光设备研究所 | Domestic FPGA (field programmable Gate array) logic online upgrading method for improving maintainability of photoelectric product |
CN114036097B (en) * | 2021-10-09 | 2024-03-01 | 中国航空工业集团公司洛阳电光设备研究所 | Domestic FPGA logic online upgrading method for improving maintenance of photoelectric product |
Also Published As
Publication number | Publication date |
---|---|
CN106598632A (en) | 2017-04-26 |
CN106598632B (en) | 2022-02-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017063577A1 (en) | Firmware upgrade method and apparatus for optical module | |
USRE49424E1 (en) | Semiconductor device | |
US9569226B2 (en) | Baseboard management controller and method of loading firmware | |
CN104579719B (en) | A kind of upgrade method and system, host computer and optical module of firmware | |
CN109656844B (en) | AT24xx EEPROM driving method and device | |
US20100095044A1 (en) | Motherboard system, storage device for booting up thereof and connector | |
WO2017202338A1 (en) | Method and system for loading drive to set-top box | |
US10274919B2 (en) | Method, device and computer program product for programming a plurality of control units | |
US20130346650A1 (en) | Controller, electronic equipment unit, and usb device control method | |
CN112015477B (en) | PCIE link splitting method, system and expansion device | |
CN110727466B (en) | Multi-grain multi-core computer platform and starting method thereof | |
CN104461589A (en) | Single-chip microcomputer updating method and system | |
CN101667133B (en) | Method for updating firmware and chip updating firmware by using same | |
CN111158731A (en) | CPLD-based network card firmware upgrading device and method | |
KR20150072963A (en) | Multisystem, and method of booting the same | |
EP3896931B1 (en) | Spark shuffle-based remote direct memory access system and method | |
US10203962B2 (en) | Tigersharc DSP boot management chip and method | |
CN107908418B (en) | Method for upgrading logic program of fiber channel node card and fiber channel bus equipment | |
US20220405179A1 (en) | Memory controller, test device and link identification method | |
CN115905095A (en) | USB drive-free communication method, device, electronic equipment and storage medium | |
CN113010195B (en) | System upgrading method, storage medium and terminal equipment | |
CN110888689B (en) | Touch screen drive loading method, storage medium and terminal equipment | |
CN101908016A (en) | Method for managing debugging information and break point of multi-core embedded device | |
US9418038B2 (en) | Method and system for accessing data | |
WO2018171335A1 (en) | Set-top box upgrade data selection method and system, and set-top box |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16854953 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16854953 Country of ref document: EP Kind code of ref document: A1 |