System, processor, method, server and medium for establishing high-speed serial connection
By partitioning different firmware files in flash, ensuring switching to backup firmware files when PCIe connection fails, solving the problem of processor connection failure, improving connection success rate and simplifying the firmware update process.
Patent Information
- Application Number
- CN202410685466.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-05-30
AI Technical Summary
During the processor verification stage, PCIe connection often fails due to firmware version problems. The existing technology is difficult to effectively solve the problem of such connection failures, especially when the firmware cannot be upgraded remotely, which requires a cumbersome offline burning process.
Using the flash partition scheme, the first partition stores firmware files with newer functions, and the second partition stores ensure that firmware files with high-speed serial connections can be established. When the initial attempt fails, it automatically switches to the firmware files of the second partition for connection, and Receive and replace the firmware file of the first partition via a high-speed serial connection.
Improve the success rate of high-speed serial connection, realize emergency handling of firmware that cannot be established and normal upgrades of connected firmware, simplifying the firmware update process.
Smart Images

Figure CN118246034B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic equipment, and more particularly to a system, a processor, a method, a server and a medium for establishing a high-speed serial connection. Background Art
[0002] High-speed serial connections can be used for point-to-point dual-channel high-bandwidth transmission. The connected devices can be allocated exclusive channel bandwidth and usually do not share bus bandwidth. For example, the bus bandwidth of the Peripheral Component Interconnect Express (PCIe) bus is divided by length and can include PCIe X1, PCIe X2, PCIeX4, PCIe X8, PCIe X16, etc.
[0003] Currently, during the verification phase of a processor (e.g., a graphics processor), it is often necessary to verify different features of PCIe (e.g., different speeds and address translation methods, etc.), so the processor firmware must often be upgraded. However, when there is a problem with the firmware version, the processor's PCIe connection may fail (Link fail). Summary of the invention
[0004] The present invention provides a system, a processor, a method, a server and a medium for establishing a high-speed serial connection, so as to improve the success rate of the high-speed serial connection.
[0005] The technical solution of the embodiment of the present invention is as follows:
[0006] A system for establishing a high-speed serial connection, comprising:
[0007] A flash memory comprising a first partition and a second partition, wherein the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is suitable for establishing a high-speed serial connection;
[0008] The first processor is used to read the first firmware file from the first partition when receiving a startup command, and attempt to establish a high-speed serial connection with the second processor based on the first firmware file; when the attempt fails, read the second firmware file from the second partition, and establish a high-speed serial connection with the second processor based on the second firmware file.
[0009] In one embodiment, the first processor is used to, after establishing a high-speed serial connection with the second processor based on the second firmware file, receive a firmware upgrade instruction containing a third firmware file from the second processor based on the high-speed serial connection, and send the third firmware file to the first partition based on the firmware upgrade instruction, wherein the third firmware file is obtained by the second processor via a remote access method or a local access method; and the flash memory is used to replace the first firmware file in the first partition with the third firmware file.
[0010] In one embodiment, the first processor is used to receive a firmware upgrade instruction containing a fourth firmware file from the second processor based on the high-speed serial connection after successfully attempting to establish a high-speed serial connection with the second processor, and send the fourth firmware file to the first partition based on the firmware upgrade instruction, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method; and the flash memory is used to replace the first firmware file in the first partition with the fourth firmware file.
[0011] A processor, comprising:
[0012] High-speed serial communication interface;
[0013] A serial peripheral device interface connected to a flash memory, wherein the flash memory comprises a first partition and a second partition, the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is suitable for establishing a high-speed serial connection;
[0014] A processing unit is used to read a first firmware file from the first partition via the serial peripheral device interface when a startup command is received; based on the first firmware file, attempt to establish a high-speed serial connection between the high-speed serial communication interface and a second processor outside the processor; when the attempt fails, read the second firmware file from the second partition via the serial peripheral device interface, and establish a high-speed serial connection between the high-speed serial communication interface and the second processor based on the second firmware file.
[0015] In one embodiment, it includes:
[0016] A timer, used for timing when the attempt starts, and issuing a timing arrival instruction when a pre-configured timing time is reached;
[0017] The processing unit is configured to detect a high-speed serial connection status between the high-speed serial communication interface and the second processor when receiving the timing arrival instruction, wherein when the high-speed serial connection status is failure, confirming that the attempt has failed.
[0018] An artificial intelligence (AI) server, comprising:
[0019] processor;
[0020] An AI computing module is connected to the processor via a high-speed serial communication interface and connected to a flash memory via a serial peripheral device interface, wherein the flash memory includes a first partition and a second partition, the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is suitable for establishing a high-speed serial connection;
[0021] The AI computing module is used to read the first firmware file from the first partition via the serial peripheral device interface when receiving a startup command; based on the first firmware file, attempt to establish a high-speed serial connection between the high-speed serial communication interface and the processor; when the attempt fails, read the second firmware file from the second partition via the serial peripheral device interface, and establish a high-speed serial connection between the high-speed serial communication interface and the processor based on the second firmware file.
[0022] In one embodiment, the AI computing module is used to, after establishing a high-speed serial connection with the processor based on the second firmware file, receive a firmware upgrade instruction containing a third firmware file from the processor based on the high-speed serial connection, and send the third firmware file to the first partition to replace the first firmware file with the third firmware file in the first partition, wherein the third firmware file is obtained by the processor via remote access or local access.
[0023] In one embodiment, the AI computing module is used to receive a firmware upgrade instruction containing a fourth firmware file from the processor based on the high-speed serial connection after successfully attempting to establish a high-speed serial connection with the processor, and send the fourth firmware file to the first partition to replace the first firmware file with the fourth firmware file in the first partition, wherein the fourth firmware file is obtained by the processor via a remote access method or a local access method.
[0024] A method for establishing a high-speed serial connection, the method being applicable to a first processor, the method comprising:
[0025] Upon receiving a start command, reading a first firmware file from a first partition of a flash memory connected to the first processor, wherein the flash memory further comprises a second partition, wherein a second firmware file is stored in the second partition, and the second firmware file is suitable for establishing a high-speed serial connection;
[0026] attempting to establish a high-speed serial connection with a second processor based on the first firmware file;
[0027] When the attempt fails, reading a second firmware file from the second partition;
[0028] A high-speed serial connection is established with the second processor based on the second firmware file.
[0029] In one embodiment, it includes:
[0030] After establishing a high-speed serial connection with the second processor based on the second firmware file, receiving a firmware upgrade instruction including a third firmware file from the second processor based on the high-speed serial connection;
[0031] The third firmware file is sent to the first partition to replace the first firmware file with the third firmware file in the first partition, wherein the third firmware file is obtained by the second processor via a remote access method or a local access method.
[0032] In one embodiment, it includes:
[0033] After successfully attempting to establish a high-speed serial connection with the second processor, receiving a firmware upgrade instruction including a fourth firmware file based on the high-speed serial connection;
[0034] Based on the firmware upgrade instruction, the fourth firmware file is sent to the first partition to replace the first firmware file in the first partition with the fourth firmware file, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method.
[0035] A device for establishing a high-speed serial connection, the device being applicable to a first processor, the device comprising:
[0036] A first reading module, configured to read a first firmware file from a first partition of a flash memory connected to the first processor upon receiving a start command, wherein the flash memory further comprises a second partition, a second firmware file is stored in the second partition, and the second firmware file is suitable for establishing a high-speed serial connection;
[0037] An attempt to establish module, used for attempting to establish a high-speed serial connection with a second processor based on the first firmware file;
[0038] a second reading module, configured to read a second firmware file from the second partition when the attempt fails;
[0039] An establishing module is used to establish a high-speed serial connection with a second processor based on the second firmware file.
[0040] An electronic device, comprising:
[0041] Memory;
[0042] processor;
[0043] The memory stores an application program executable by the processor, which is used to enable the processor to execute the method for establishing a high-speed serial connection as described in any one of the above items.
[0044] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, cause the processor to execute any of the above methods for establishing a high-speed serial connection.
[0045] It can be seen from the above technical solution that in the implementation mode of the present invention: the flash memory includes a first partition and a second partition, the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is suitable for establishing a high-speed serial connection; the first processor is used to read the first firmware file from the first partition when receiving a startup command, and try to establish a high-speed serial connection with the second processor based on the first firmware file; when the attempt fails, read the second firmware file from the second partition, and establish a high-speed serial connection with the second processor based on the second firmware file. It can be seen that by storing respective firmware files in different partitions of the flash memory, the success rate of establishing a high-speed serial connection is improved, and it is also beneficial to upgrade the firmware file.
[0046] Moreover, emergency processing of the first firmware file that has been confirmed to be unable to establish a high-speed serial connection and normal upgrading of the first firmware file that has been confirmed to be able to establish a high-speed serial connection can also be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of establishing a PCIe connection for an AI server in the related art.
[0048] Figure 2 FIG. 4 is an exemplary structural diagram of a system for establishing a high-speed serial connection according to an embodiment of the present invention.
[0049] Figure 3 is an exemplary structural diagram of a processor according to an embodiment of the present invention.
[0050] Figure 4 FIG. 4 is an exemplary schematic diagram of establishing a PCIe connection for an AI server according to an embodiment of the present invention.
[0051] Figure 5 An exemplary flow chart of a method for establishing a high-speed serial connection according to an embodiment of the present invention.
[0052] Figure 6 FIG. 1 is an exemplary structural diagram of an apparatus for establishing a high-speed serial connection according to an embodiment of the present invention.
[0053] Figure 7 is an exemplary structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings.
[0055] For the sake of brevity and intuitiveness in description, the scheme of the present invention is explained below by describing several representative implementations. A large number of details in the implementations are only used to help understand the scheme of the present invention. However, it is obvious that the technical scheme of the present invention may not be limited to these details when implemented. In order to avoid unnecessarily obscuring the scheme of the present invention, some implementations are not described in detail, but only a framework is given. Hereinafter, "including" means "including but not limited to", and "according to..." means "at least according to..., but not limited to only according to...". Due to the language habits of Chinese, when the number of a component is not specifically specified below, it means that the component can be one or more, or can be understood as at least one.
[0056] Figure 1 A schematic diagram of establishing a PCIe connection for an AI server in the related art.
[0057] exist Figure 1 In the example, the flash memory connected to the AI server is a complete independent partition. The flash memory contains the firmware file that is expected to be used to establish the PCIe connection. For example, the firmware file can be pre-burned into the flash memory through a burner, or the latest version of the firmware file can be downloaded to the flash memory through remote upgrade or other methods.
[0058] When the graphics processing unit (GPU) in the AI server is powered on or hot-started, the GPU accesses the flash memory via the SPI interface controlled by the SPI controller to read the firmware file. The GPU then uses the read firmware file to configure the PCIe controller in the AI server (for example, based on the firmware file, complete the initialization and parameter setting of the PCIe controller) and communicate normally with the operating system.
[0059] When the firmware file read from the flash memory works properly, a PCIe connection can be established between the GPU and the CPU in the AI server, that is, a normal PCIe connection is established (Link up). When the firmware file read from the flash memory does not work properly (for example, a version defect problem), a PCIe connection cannot be established between the GPU and the CPU in the AI server, that is, a PCIe connection fails (Link fail). At this point, even if it is known that the firmware file in the flash memory does not work properly, since it is impossible to use the PCIe connection to remotely upgrade the firmware file, an offline burner has to be used to burn the correct, working firmware file in the flash memory, which has the disadvantage of cumbersome operation.
[0060] In an embodiment of the present invention, the flash memory is divided into two areas (a first partition and a second partition), and a firmware file with more functions and a newer version can be saved in the first partition (however, due to the newer version and more functions, it may not be confirmed, so the firmware file has the possibility of not being able to establish a high-speed serial connection). A firmware file that ensures that a high-speed serial connection can be established is saved in the second partition (for example, a firmware file with an older version and verified). When power is turned on or hot-started, the firmware file is read from the first partition by default and started, and then within a predetermined time (for example, one second) it is checked whether the high-speed serial connection is successfully established. If successful, it is processed normally and thus more functions can be enjoyed (for example, more control functions for PCIe connection); if the high-speed serial connection fails to be established, the second partition is automatically accessed to complete the high-speed serial connection establishment process using the firmware file in the second partition. When performing an online upgrade of the firmware file in the flash memory, address control is used to ensure that only the firmware file in the first partition is upgraded, and the firmware file in the second partition is not upgraded, thereby ensuring that the firmware file in the second partition that ensures that a high-speed serial connection can be established will not be damaged.
[0061] The above disclosure details the technical defects existing in the related art, the causes of the technical defects, and the thinking and analysis process of overcoming the technical defects. In fact, the cognition of the above technical defects is not common knowledge in the field, but a novel discovery made by the inventor in his research. In addition, the cause tracing of the technical defects and the thinking and analysis process of overcoming the technical defects are also the gradual analysis results of the inventor in the actual research process, and are not common knowledge in the field.
[0062] Figure 2 FIG. 1 is an exemplary structural diagram of a system for establishing a high-speed serial connection according to an embodiment of the present invention. Figure 2 As shown, the system 30 includes:
[0063] The flash memory 32 includes a first partition 33 and a second partition 34, wherein the first partition 33 stores a first firmware file 35, and the second partition 34 stores a second firmware file 36, and the second firmware file 36 is suitable for establishing a high-speed serial connection; the first processor 31 is used to read the first firmware file 35 from the first partition 33 when receiving a startup command (such as power-on or hot start), and try to establish a high-speed serial connection with the second processor 37 based on the first firmware file 35; when the attempt to establish a high-speed serial connection with the second processor 37 based on the first firmware file 35 fails, read the second firmware file 36 from the second partition 34, and establish a high-speed serial connection with the second processor 37 based on the second firmware file 36.
[0064] Here, the first firmware file 35 is usually a firmware file with a newer version and more functions. However, due to the newer version and more functions of the first firmware file 35, there is usually a lack of functional verification of the first firmware file 35. The first firmware file 35 may fail to properly configure the high-speed serial controller in the first processor 31, and thus may cause the first processor 31 to be unable to establish a high-speed serial connection with the second processor 37.
[0065] Different from the first firmware file 35, the second firmware file 36 is a firmware file that ensures that the high-speed serial controller in the first processor 31 can be normally configured so that the first processor 31 can normally establish a high-speed serial connection with the second processor 37. For example, the first firmware file 36 can be an older version of a verified firmware file.
[0066] The high-speed serial connection between the first processor 31 and the second processor 37 can be implemented as: PCIe connection or SXM connection, etc. Among them: SXM is an interface designed for high-performance computing (HPC) and AI applications, which uses NVLink technology to achieve high-speed connection between GPUs or between GPUs and CPUs. In addition, the flash memory 32 and the first processor 31 can be connected via SPI or Inter-Integrated Circuit (IIC), etc.
[0067] The first processor 31 and the second processor 37 can be implemented as: a central processing unit (CPU), a graphics processing unit (GPU), a tensor processing unit (TPU), a neural network processor (NPU), a deep learning processor (DPU), an accelerated processing unit (APU), and a general-purpose computing on graphics processing unit (GPGPU).
[0068] The above exemplarily describes typical examples of the first processor 31, the second processor 37, the high-speed serial connection between the first processor 31 and the second processor 37, and the connection between the flash memory 32 and the first processor 31. Those skilled in the art will appreciate that such description is merely exemplary and is not intended to limit the scope of protection of the embodiments of the present invention.
[0069] The space sizes of the first partition 33 and the second partition 34 may be the same or different. The access addresses of the first partition 33 and the second partition 34 may be pre-stored in the first processor 31, so as to achieve accurate access to the first partition 33 and the second partition 34 based on their respective access addresses. For example, it is assumed that the address space range of the first partition 33 is 0~0x1999; the address space range of the second partition 34 is 0x2000~0x3999. When the first processor 31 expects to read the first firmware file 35, the first firmware file 35 is read from the first partition 33 based on the address space range: 0~0x1999. When the first processor 31 expects to read the second firmware file 36, the second firmware file 36 is read from the second partition 34 based on the address space range: 0x2000~0x3999.
[0070] In one embodiment, the first processor 31 is used to receive a firmware upgrade instruction containing a third firmware file from the second processor 37 based on the high-speed serial connection after establishing a high-speed serial connection with the second processor 37 based on the second firmware file 36, and send the third firmware file to the first partition 33 based on the firmware upgrade instruction, wherein the third firmware file is obtained by the second processor 37 via a remote access method or a local access method; the flash memory 32 is used to replace the first firmware file 35 in the first partition 33 with the third firmware file.
[0071] It can be seen that when the attempt to establish a high-speed serial connection with the second processor 37 based on the first firmware file 35 fails, the first processor 31 reads the second firmware file 36 from the second partition 34, and establishes a high-speed serial connection with the second processor 37 based on the second firmware file 36. Then, the first processor 31 obtains the third firmware file from the second processor 37 via the high-speed serial connection established based on the second firmware file 36. The third firmware file can be read by the second processor 37 from the local storage medium connected to itself, or it can be obtained by the second processor 37 in a remote access manner via a network connection such as the Internet. Therefore, the first firmware file 35 in the first partition 33 is replaced by the third firmware file, thereby replacing the first firmware file 35 that has been confirmed to be unable to establish a high-speed serial connection. The replacement process here can be regarded as an emergency treatment of the first firmware file 35 that has been confirmed to be unable to establish a high-speed serial connection. Therefore, the third firmware file can be implemented as a firmware file with an older version. For example, the version of the third firmware file is older than the first firmware file 35, and the version of the third firmware file is higher than the second firmware file 36.
[0072] In one embodiment, the first processor 31 is used to receive a firmware upgrade instruction containing a fourth firmware file from the second processor 37 based on the high-speed serial connection after successfully attempting to establish a high-speed serial connection with the second processor 37, and send the fourth firmware file to the first partition 33 based on the firmware upgrade instruction, wherein the fourth firmware file is obtained by the second processor 37 via a remote access method or a local access method; the flash memory 32 is used to replace the first firmware file 33 in the first partition 33 with the fourth firmware file.
[0073] It can be seen that when the attempt to establish a high-speed serial connection with the second processor 37 based on the first firmware file 35 is successful, the first processor 31 uses the high-speed serial connection with the second processor 37 established based on the first firmware file 35 to obtain the fourth firmware file from the second processor 37. The fourth firmware file can be read by the second processor 37 from the local storage medium connected to itself, or it can be obtained by the second processor 37 in a remote access manner via a network connection such as the Internet. The first firmware file 35 in the first partition 33 is replaced by the fourth firmware file, thereby achieving an upgrade of the first firmware file 35. The replacement process here can be regarded as a normal upgrade process for the first firmware file 35 that has been confirmed to be able to establish a high-speed serial connection. Therefore, the fourth firmware file can be implemented as a firmware file with a newer version. For example, the version of the fourth firmware file is newer than the first firmware file 35, and the version of the fourth firmware file is higher than the second firmware file 36.
[0074] Therefore, based on the embodiments of the present invention, emergency processing of the first firmware file 35 that has been confirmed to be unable to establish a high-speed serial connection and normal upgrade of the first firmware file 35 that has been confirmed to be able to establish a high-speed serial connection can also be achieved.
[0075] The embodiment of the present invention further provides a processor. Figure 3 FIG. 1 is an exemplary structural diagram of a processor according to an embodiment of the present invention. Figure 3 The processor includes:
[0076] A high-speed serial communication interface; a serial peripheral device interface connected to a flash memory, wherein the flash memory includes a first partition and a second partition, a first firmware file is stored in the first partition, a second firmware file is stored in the second partition, and the second firmware file is suitable for establishing a high-speed serial connection; a processing unit, which is used to read the first firmware file from the first partition via the serial peripheral device interface when a startup command is received; based on the first firmware file, attempt to establish a high-speed serial connection between the high-speed serial communication interface and a second processor outside the processor; when the attempt fails, read the second firmware file from the second partition via the serial peripheral device interface, and establish a high-speed serial connection between the high-speed serial communication interface and the second processor based on the second firmware file.
[0077] In one embodiment, the processor includes:
[0078] A timer is used to count when an attempt starts and to issue a timing arrival instruction when a preconfigured timing time is reached; a processing unit is used to detect the high-speed serial connection status between the high-speed serial communication interface and the second processor when the timing arrival instruction is received, wherein when the high-speed serial connection status is failure, confirming that the attempt has failed.
[0079] The embodiments of the present invention can be applied to a variety of application environments. For example, it can be applied to an AI server to establish various types of high-speed serial connections for the AI server.
[0080] Figure 4 FIG. 1 is an exemplary schematic diagram of establishing a PCIe connection for an AI server according to an embodiment of the present invention. Figure 4 In the example, the AI server 20 includes: a CPU 12 and a GPU 10.
[0081] The flash memory 11 connected to the AI server 20 via SPI includes a first partition and a second partition. The first partition stores a first firmware file, and the second partition stores a second firmware file, which is suitable for establishing a high-speed serial connection. The first firmware file is usually a firmware file with more functions and a newer version; the second firmware file is usually a firmware file with an older version and has been verified.
[0082] GPU10 includes: a processing unit, a PCIe controller, an SPI controller and a timer. The connection lines between the SPI controller and the flash memory include: (1) SPI_CLK: clock line; (2) SPI_ MOSI (Master Output Slave Input): used to indicate the unidirectional transmission of the master device output and the slave device input; (3) SPI_ MISO (Master Input Slave Output): used to indicate the unidirectional transmission of the master device input and the slave device output; (4) SPI_CS (Chip Select): chip select signal.
[0083] The processing unit is used to read the first firmware file from the first partition via the SPI connection controlled by the SPI controller when receiving a startup command (such as when the AI server 20 is powered on or hot-started), and attempt to establish a high-speed serial connection with CPU12 based on the first firmware file (for example, initialize the PCIe controller and configure PCIe connection properties, etc.). When the attempt to establish a high-speed serial connection with CPU12 based on the first firmware file fails, the processing unit reads the second firmware file from the second partition via the SPI connection controlled by the SPI controller, and establishes a high-speed serial connection with CPU12 based on the second firmware file. Wherein: the timer is used to count at the beginning of the attempt, and when the pre-configured timing time is reached, the timing arrival instruction is issued; the processing unit is used to detect the PCIe status between the PCIe controller and CPU12 when the timing arrival instruction is received, wherein when the PCIe status is failed, the attempt is confirmed to have failed.
[0084] When the attempt to establish a high-speed serial connection with CPU12 based on the first firmware file fails, the processing unit in GPU10 reads the second firmware file from the second partition and establishes a high-speed serial connection with CPU12 based on the second firmware file. Then, the processing unit obtains the third firmware file from CPU12 via the high-speed serial connection established based on the second firmware file. The third firmware file can be read by CPU12 from a local storage medium connected to itself, or it can be obtained by CPU12 in a remote access manner via a network connection such as the Internet. Therefore, the first firmware file in the first partition is replaced with the third firmware file, thereby replacing the first firmware file that has been confirmed to be unable to establish a high-speed serial connection. The replacement process here can be regarded as an emergency treatment of the first firmware file that has been confirmed to be unable to establish a high-speed serial connection. Therefore, the third firmware file can be implemented as a firmware file with an older version. For example, the version of the third firmware file is older than the first firmware file, and the version of the third firmware file is higher than the second firmware file.
[0085] When the attempt to establish a high-speed serial connection with CPU12 based on the first firmware file is successful, the processing unit obtains a fourth firmware file from CPU12 using the high-speed serial connection with CPU12 established based on the first firmware file. The fourth firmware file can be read by CPU12 from a local storage medium connected to itself, or it can be obtained by CPU12 in a remote access manner via a network connection such as the Internet. The first firmware file in the first partition is replaced by the fourth firmware file, thereby achieving an upgrade of the first firmware file. The replacement process here can be regarded as a normal upgrade process for the first firmware file that has been confirmed to be able to establish a high-speed serial connection. Therefore, the fourth firmware file can be implemented as a firmware file with a newer version. For example, the version of the fourth firmware file is newer than the first firmware file, and the version of the fourth firmware file is higher than the second firmware file.
[0086] Therefore, based on the embodiments of the present invention, emergency processing of the first firmware file that has been confirmed to be unable to establish a high-speed serial connection and normal upgrade of the first firmware file that has been confirmed to be able to establish a high-speed serial connection can also be achieved.
[0087] The embodiment of the present invention also provides a method for establishing a high-speed serial connection. Figure 5 FIG. 1 is an exemplary flow chart of a method for establishing a high-speed serial connection according to an embodiment of the present invention. The method is applicable to a first processor. Figure 5 As shown, the method includes:
[0088] Step 501: upon receiving a start command, a first firmware file is read from a first partition of a flash memory connected to a first processor, wherein the flash memory further comprises a second partition in which a second firmware file is stored, and the second firmware file is suitable for establishing a high-speed serial connection.
[0089] Step 502: Try to establish a high-speed serial connection with a second processor based on the first firmware file.
[0090] Step 503: When the attempt fails, read the second firmware file from the second partition.
[0091] Step 504: Establish a high-speed serial connection with the second processor based on the second firmware file.
[0092] In one embodiment, the method includes: after establishing a high-speed serial connection with a second processor based on a second firmware file, receiving a firmware upgrade instruction containing a third firmware file from the second processor based on the high-speed serial connection; sending the third firmware file to a first partition to replace the first firmware file in the first partition with the third firmware file, wherein the third firmware file is obtained by the second processor via a remote access method or a local access method.
[0093] In one embodiment, the method includes: after successfully attempting to establish a high-speed serial connection with a second processor, receiving a firmware upgrade instruction containing a fourth firmware file based on the high-speed serial connection; based on the firmware upgrade instruction, sending the fourth firmware file to the first partition to replace the first firmware file in the first partition with the fourth firmware file, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method.
[0094] Figure 6 FIG. 1 is an exemplary structural diagram of an apparatus for establishing a high-speed serial connection according to an embodiment of the present invention. Figure 6 As shown, the device 600 is applicable to the first processor. The device 600 includes: a first reading module 601, which is used to read a first firmware file from a first partition of a flash memory connected to the first processor when receiving a startup command, wherein the flash memory also includes a second partition, and a second firmware file is stored in the second partition, and the second firmware file is suitable for establishing a high-speed serial connection; an attempt to establish a module 602, which is used to attempt to establish a high-speed serial connection with the second processor based on the first firmware file; a second reading module 603, which is used to read the second firmware file from the second partition when the attempt fails; and an establishment module 604, which is used to establish a high-speed serial connection with the second processor based on the second firmware file.
[0095] In summary, in an embodiment of the present invention: the flash memory includes a first partition and a second partition, the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is suitable for establishing a high-speed serial connection; the first processor is used to read the first firmware file from the first partition when receiving a startup command, and try to establish a high-speed serial connection with the second processor based on the first firmware file; when the attempt fails, read the second firmware file from the second partition, and establish a high-speed serial connection with the second processor based on the second firmware file. By storing respective firmware files in different partitions of the flash memory (especially storing the second firmware file that ensures that a high-speed serial connection can be established in the second partition), the success rate of establishing a high-speed serial connection is improved, and it is also beneficial to upgrade the firmware file. Moreover, emergency processing of the first firmware file that has been confirmed to be unable to establish a high-speed serial connection and normal upgrading of the first firmware file that has been confirmed to be able to establish a high-speed serial connection can also be achieved.
[0096] The embodiment of the present invention further provides an electronic device having a processor-memory architecture. Figure 7 is a structural diagram of an electronic device according to an embodiment of the present invention. Figure 7As shown, the electronic device includes a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. When the computer program is executed by the processor 701, any of the above methods for establishing a high-speed serial connection is implemented. Among them, the memory 702 can be specifically implemented as a variety of storage media such as an electrically erasable programmable read-only memory (EEPROM), a flash memory (Flash memory), and a programmable program read-only memory (PROM). The processor 701 can be implemented as including one or more central processing units or one or more field programmable gate arrays, wherein the field programmable gate array integrates one or more central processing unit cores. Specifically, the central processing unit or the central processing unit core can be implemented as a CPU, a GPU, a GPGPU, an MCU or a DSP, and the like.
[0097] It should be noted that not all steps and modules in the above-mentioned processes and structure diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The division of each module is only for the convenience of describing the functional division adopted. In actual implementation, a module can be implemented by multiple modules, and the functions of multiple modules can also be implemented by the same module. These modules can be located in the same device or in different devices. The hardware modules in each embodiment can be implemented mechanically or electronically. For example, a hardware module may include a specially designed permanent circuit or logic device (such as a dedicated processor, such as an FPGA or ASIC) for performing a specific operation. For example, specific operations can be performed in various types of chips (for example, artificial intelligence chips). The hardware module may also include a programmable logic device or circuit (such as a general-purpose processor or other programmable processor) temporarily configured by software for performing specific operations. As for the specific mechanical method, or the use of a dedicated permanent circuit, or the use of a temporarily configured circuit (such as configured by software) to implement the hardware module, it can be determined based on cost and time considerations.
[0098] The present invention also provides a machine-readable storage medium, storing instructions for a machine to perform a method as described in the present application. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code for implementing the functions of any of the embodiments described in the above embodiments is stored, and the computer (or CPU or MPU) of the system or device reads out and executes the program code stored in the storage medium. In addition, the operating system operated on the computer can also be made to complete part or all of the actual operations by instructions based on the program code. The program code read out from the storage medium can also be written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then the CPU installed on the expansion board or the expansion unit is made to perform part and all of the actual operations based on the instructions of the program code, thereby realizing the functions of any of the embodiments described in the above embodiments. The storage medium implementation for providing the program code includes a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card and a ROM. Alternatively, the program code can be downloaded from a server computer or a cloud by a communication network.
[0099] In this article, "schematic" means "serving as an example, instance or explanation", and any diagram or implementation method described as "schematic" in this article should not be interpreted as a more preferred or more advantageous technical solution. In order to make the drawings concise, only the parts related to the present invention are schematically shown in each figure, and do not represent the actual structure of the product. In addition, in order to make the drawings concise and easy to understand, in some figures, only one of the parts with the same structure or function is schematically drawn, or only one of them is marked. In this article, "one" does not mean that the number of the relevant parts of the present invention is limited to "only one", and "one" does not mean that the number of the relevant parts of the present invention is "more than one". In this article, "upper", "lower", "front", "back", "left", "right", "inside", "outside", etc. are only used to indicate the relative position relationship between the relevant parts, rather than to limit the absolute position of these relevant parts.
[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A system for establishing a high-speed serial connection, characterized in that: include: A flash memory comprising a first partition and a second partition, wherein the first partition stores a first firmware file, and the second partition stores a second firmware file, wherein the second firmware file is a firmware file that ensures that a high-speed serial connection can be established; The first processor is configured to read the first firmware file from the first partition upon receiving a startup command, and attempt to establish a high-speed serial connection with the second processor based on the first firmware file; When the attempt fails, reading the second firmware file from the second partition, and establishing a high-speed serial connection with the second processor based on the second firmware file; the first processor is configured to, after establishing a high-speed serial connection with the second processor based on the second firmware file, receive a firmware upgrade instruction including a third firmware file from the second processor based on the high-speed serial connection, and send the third firmware file to the first partition based on the firmware upgrade instruction, wherein the third firmware file is obtained by the second processor via a remote access method or a local access method; The flash memory is used to replace the first firmware file that has been confirmed to be unable to establish a high-speed serial connection with the third firmware file in the first partition; wherein the version of the third firmware file is older than the first firmware file, and the version of the third firmware file is higher than the second firmware file; The first processor is configured to, after successfully attempting to establish a high-speed serial connection with the second processor, receive a firmware upgrade instruction including a fourth firmware file from the second processor based on the high-speed serial connection, and send the fourth firmware file to the first partition based on the firmware upgrade instruction, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method; The flash memory is used to replace the first firmware file with the fourth firmware file in the first partition; The version of the fourth firmware file is newer than that of the first firmware file.
2. A processor, characterized in that: include: High-speed serial communication interface; A serial peripheral device interface is connected to a flash memory, wherein the flash memory comprises a first partition and a second partition, the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is a firmware file that ensures that a high-speed serial connection can be established; a processing unit, configured to read a first firmware file from the first partition via the serial peripheral device interface when receiving a start command; Based on the first firmware file, attempting to establish a high-speed serial connection between the high-speed serial communication interface and a second processor other than the processor; When the attempt fails, reading the second firmware file from the second partition via the serial peripheral device interface, and establishing a high-speed serial connection between the high-speed serial communication interface and the second processor based on the second firmware file; After establishing a high-speed serial connection with the second processor based on the second firmware file, receiving a firmware upgrade instruction including a third firmware file from the second processor based on the high-speed serial connection, and sending the third firmware file to the first partition based on the firmware upgrade instruction, thereby replacing the first firmware file confirmed to be unable to establish a high-speed serial connection with the third firmware file in the first partition; The third firmware file is obtained by the second processor via a remote access method or a local access method; wherein the version of the third firmware file is older than the first firmware file, and the version of the third firmware file is higher than the second firmware file; After successfully attempting to establish a high-speed serial connection with the second processor, a firmware upgrade instruction containing a fourth firmware file is received from the second processor based on the high-speed serial connection, and based on the firmware upgrade instruction, the fourth firmware file is sent to the first partition, and the first firmware file is replaced with the fourth firmware file in the first partition, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method; and the version of the fourth firmware file is newer than the first firmware file.
3. The processor according to claim 2, characterized in that include: A timer, used for timing when the attempt starts, and issuing a timing arrival instruction when a pre-configured timing time is reached; The processing unit is configured to detect a high-speed serial connection status between the high-speed serial communication interface and the second processor when receiving the timing arrival instruction, wherein when the high-speed serial connection status is failure, confirming that the attempt has failed.
4. An artificial intelligence server, characterized in that: include: processor; an artificial intelligence computing module, connected to the processor via a high-speed serial communication interface, and connected to a flash memory via a serial peripheral device interface, wherein the flash memory includes a first partition and a second partition, the first partition stores a first firmware file, the second partition stores a second firmware file, and the second firmware file is a firmware file that ensures that a high-speed serial connection can be established; wherein the artificial intelligence computing module is used to read the first firmware file from the first partition via the serial peripheral device interface when receiving a startup command; Based on the first firmware file, attempting to establish a high-speed serial connection between the high-speed serial communication interface and the processor; When the attempt fails, reading the second firmware file from the second partition via the serial peripheral device interface, and establishing a high-speed serial connection between the high-speed serial communication interface and the processor based on the second firmware file; After establishing a high-speed serial connection with the second processor based on the second firmware file, receiving a firmware upgrade instruction including a third firmware file from the second processor based on the high-speed serial connection, and sending the third firmware file to the first partition based on the firmware upgrade instruction, thereby replacing the first firmware file confirmed to be unable to establish a high-speed serial connection with the third firmware file in the first partition; The third firmware file is obtained by the second processor via a remote access method or a local access method; wherein the version of the third firmware file is older than the first firmware file, and the version of the third firmware file is higher than the second firmware file; After successfully attempting to establish a high-speed serial connection with the second processor, a firmware upgrade instruction containing a fourth firmware file is received from the second processor based on the high-speed serial connection, and based on the firmware upgrade instruction, the fourth firmware file is sent to the first partition, and the first firmware file is replaced with the fourth firmware file in the first partition, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method; and the version of the fourth firmware file is newer than the first firmware file.
5. A method for establishing a high-speed serial connection, characterized in that: The method is applicable to a first processor, and the method comprises: Upon receiving a start command, reading a first firmware file from a first partition of a flash memory connected to the first processor, wherein the flash memory further comprises a second partition, in which a second firmware file is stored, and the second firmware file is a firmware file that ensures that a high-speed serial connection can be established; attempting to establish a high-speed serial connection with a second processor based on the first firmware file; When the attempt fails, reading a second firmware file from the second partition; establishing a high-speed serial connection with a second processor based on the second firmware file; after establishing a high-speed serial connection with the second processor based on the second firmware file, receiving a firmware upgrade instruction containing a third firmware file from the second processor based on the high-speed serial connection; sending the third firmware file to the first partition so as to replace the first firmware file confirmed to be unable to establish a high-speed serial connection with the third firmware file in the first partition, wherein the third firmware file is obtained by the second processor via a remote access method or a local access method; wherein the version of the third firmware file is older than that of the first firmware file, and the version of the third firmware file is higher than that of the second firmware file; After successfully attempting to establish a high-speed serial connection with the second processor, a firmware upgrade instruction containing a fourth firmware file is received from the second processor based on the high-speed serial connection, and based on the firmware upgrade instruction, the fourth firmware file is sent to the first partition, and the first firmware file is replaced with the fourth firmware file in the first partition, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method; and the version of the fourth firmware file is newer than the first firmware file.
6. A device for establishing a high-speed serial connection, characterized in that: The device is applicable to a first processor, and the device comprises: A first reading module is used to read a first firmware file from a first partition of a flash memory connected to the first processor upon receiving a startup command, wherein the flash memory further includes a second partition, in which a second firmware file is stored, and the second firmware file is a firmware file that ensures that a high-speed serial connection can be established; an attempt to establish a module, configured to attempt to establish a high-speed serial connection with a second processor based on the first firmware file; wherein after the attempt to establish the high-speed serial connection with the second processor is successful, a firmware upgrade instruction containing a fourth firmware file is received from the second processor based on the high-speed serial connection; based on the firmware upgrade instruction, the fourth firmware file is sent to the first partition, and the first firmware file is replaced by the fourth firmware file in the first partition, wherein the fourth firmware file is obtained by the second processor via a remote access method or a local access method; and the version of the fourth firmware file is newer than the first firmware file 35; a second reading module, configured to read a second firmware file from the second partition when the attempt fails; an establishing module, configured to establish a high-speed serial connection with a second processor based on the second firmware file; after establishing the high-speed serial connection with the second processor based on the second firmware file, receiving a firmware upgrade instruction including a third firmware file from the second processor based on the high-speed serial connection; sending the third firmware file to the first partition so as to replace the first firmware file confirmed to be unable to establish a high-speed serial connection with the third firmware file in the first partition, wherein the third firmware file is obtained by the second processor via a remote access method or a local access method; The version of the third firmware file is older than the first firmware file, and the version of the third firmware file is higher than the second firmware file.
7. An electronic device, characterized in that: include: Memory; processor; The memory stores an application program executable by the processor, which is used to enable the processor to execute the method for establishing a high-speed serial connection as claimed in claim 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the processor executes the method for establishing a high-speed serial connection as claimed in claim 5.
Citation Information
Patent Citations
Firmware upgrading method, nonvolatile memory, computer storage medium and terminal
CN112925679A
Firmware detection method and device, electronic equipment, storage medium and program product
CN116501573A
Basic input and output system upgrading method and device, computer equipment and medium
CN117112460A
Firmware upgrading and restoring method and device, equipment and storage medium
CN117311764A
Server starting method and device, storage medium and electronic equipment
CN118051277A
