Graphics card initialization method, device, medium, equipment and GPU
Patent Information
- Application Number
- CN202311491516.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-11-09
AI Technical Summary
[0003]相关技术的这种显卡初始化方法依赖于预先烧写到闪存中的程序,在闪存的存储内容为空或者存储内容损坏的情况下显卡无法正常启动
[0035]通过上述技术方案将原本固化在闪存中的PCIE初始化程序固化在GPU中,构成第一引导加载程序。这样,当闪存内容损坏或者为空时,可以通过GPU初始化PCIE接口,以在显卡的闪存上固化的第二引导加载程序处于非正常状态时,接收显卡外部发送的闪存固件包,并利用接收到的闪存固件包更新闪存中的第二引导加载程序。由此,在显卡使用过程中,无需物理卸载闪存就可以按需求实现对闪存中第二引导加载程序的更新,从而有效提升项目开发的调试进度,确保显卡的正常初始化。
Smart Images

Figure CN117453259B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a graphics card initialization method, apparatus, medium, device, and GPU. Background Technology
[0002] In the current graphics card initialization process, the GPU typically loads the relevant programs of the Basic Input Output System (BIOS) from the external flash memory (Flash ROM) based on the Serial Peripheral Interface (SPI), and then initializes the PCIe (Peripheral Component Interconnect Express) interface on this basis, thereby receiving CPU instructions and displaying the corresponding screen.
[0003] This graphics card initialization method relies on a program pre-written into the flash memory. If the flash memory is empty or corrupted, the graphics card cannot boot properly. However, updating the flash memory often requires removing it from the slot or the motherboard—a physical unloading process—before rewriting the flash memory. This increases the time and cost of program updates. Summary of the Invention
[0004] The purpose of this disclosure is to provide a graphics card initialization method, apparatus, medium, device, and GPU to solve problems in the related art.
[0005] To achieve the above objectives, a first aspect of this disclosure provides a graphics card initialization method applied to a GPU, wherein the GPU is configured with a first bootloader, the first bootloader including a PCIe initialization program, the PCIe initialization program being used to initialize the PCIe interface, the method comprising:
[0006] Run the PCIe initialization program to initialize the PCIe interface;
[0007] In response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state, the flash memory firmware package is received based on the PCIe interface;
[0008] The second bootloader is updated using the flash firmware package.
[0009] Optionally, the GPU includes a system management controller, and the flash firmware package is received by the system management controller via the PCIe interface; the method further includes:
[0010] The system management controller performs verification processing on the flash firmware package;
[0011] Updating the second bootloader using the flash firmware package includes:
[0012] The second bootloader is updated using the verified flash firmware package.
[0013] Optionally, before receiving the flash firmware package via the PCIe interface, in response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state, the method further includes:
[0014] The identifier value is read based on the preset address of the flash memory, and the identifier value is used to determine the storage state of the flash memory;
[0015] If the read identifier value indicates that the storage state of the flash memory is abnormal, or if the identifier value is not read, it is determined that the second bootloader program embedded on the flash memory is in an abnormal state.
[0016] Optionally, after updating the second bootloader using the flash firmware package, the method further includes:
[0017] If initializing the graphics card according to the flash memory firmware package fails, the identifier value stored in the preset address of the flash memory is modified to an abnormal preset value, which indicates that the storage state of the flash memory is abnormal; or,
[0018] In the event that the graphics card fails to be initialized according to the flash firmware package, the switch used to short-circuit the target data line is closed, and the target data line is used to read the identifier value stored in the preset address.
[0019] Optionally, after updating the second bootloader using the flash firmware package, the method further includes:
[0020] Modify the identifier value stored in the preset address of the flash memory to a normal preset value, whereby the normal preset value indicates that the storage state of the flash memory is normal; or,
[0021] The switch for shorting the target data line is turned on, and the target data line is used to read the identifier value stored in the preset address.
[0022] Optionally, updating the second bootloader using the flash firmware package includes:
[0023] The flash firmware package is sent to a designated register in the flash memory to update the second bootloader, wherein the designated register is a register in the flash memory where the second bootloader is embedded.
[0024] Optionally, running the PCIe initialization program to initialize the PCIe interface includes:
[0025] Run the PCIe initialization program to configure the PCIe interface's transmission rate to match the motherboard's transmission rate.
[0026] A second aspect of this disclosure provides a graphics card initialization device applied to a GPU, wherein a first bootloader is configured on the GPU, the first bootloader including a PCIe initialization program, the PCIe initialization program being used to initialize the PCIe interface, and the graphics card initialization device comprising:
[0027] The runtime module is used to run the PCIE initialization program to initialize the PCIE interface;
[0028] The response module is used to receive the flash firmware package via the PCIe interface in response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state.
[0029] An update module is used to update the second bootloader using the flash firmware package.
[0030] A third aspect of this disclosure provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the graphics card initialization method provided in any of the first aspects of this disclosure.
[0031] A fourth aspect of this disclosure provides an electronic device, including:
[0032] A memory on which computer programs are stored;
[0033] A processor for executing the computer program in the memory to implement the steps of the graphics card initialization method provided in any of the first aspects.
[0034] A fifth aspect of this disclosure provides a GPU for implementing the steps of the graphics card initialization method provided in any of the first aspects of this disclosure.
[0035] The above technical solution embeds the PCIe initialization program, originally stored in flash memory, into the GPU, forming the first bootloader. This allows the GPU to initialize the PCIe interface when the flash memory is corrupted or empty. If the second bootloader, stored in the graphics card's flash memory, is in an abnormal state, the GPU can receive a flash firmware package sent externally to the graphics card and update the second bootloader in the flash memory using the received firmware package. Therefore, during graphics card use, the second bootloader in the flash memory can be updated as needed without physically unloading the flash memory, effectively improving the debugging progress of project development and ensuring the normal initialization of the graphics card.
[0036] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0037] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:
[0038] Figure 1 This is a flowchart illustrating a graphics card initialization method according to an exemplary embodiment.
[0039] Figure 2 This is a schematic diagram illustrating an update of a flash firmware package according to an exemplary embodiment.
[0040] Figure 3 This is a flowchart illustrating a graphics card initialization method according to another exemplary embodiment.
[0041] Figure 4 This is a block diagram illustrating a graphics card initialization device according to an exemplary embodiment.
[0042] Figure 5 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0043] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0044] The initialization process for a graphics card, according to relevant technologies, may include: after power-on, a reset signal (Reset) is sent to the PCIe interface via the motherboard interface. Then, the GPU runs a primary bootloader to configure the IP and initialize the SPI interface, which is used for communication with the flash memory. Based on this, a secondary bootloader, i.e., the BIOS program, is read from the flash memory via the SPI interface, and the PCIe interface is initialized based on this BIOS program. This allows the GPU to receive CPU instructions and display the corresponding screen through the PCIe interface.
[0045] As mentioned earlier, the BIOS program of current graphics cards is usually embedded in the flash memory outside the GPU. This means that the initialization of the graphics card depends on the program pre-programmed into the flash memory. Updating the flash memory content often requires physically unloading the flash memory before it can be programmed through a programmer. This affects the debugging progress of project development, and the pre-programming of the flash memory before it is put into use also increases the time and cost.
[0046] In view of this, the present disclosure provides a graphics card initialization method, apparatus, medium, device, and GPU. The program used to initialize the PCIe interface, originally stored in the BIOS program embedded in flash memory, is embedded in the GPU, thus forming a first bootloader with PCIe initialization functionality. In this way, when the flash memory is damaged or empty, the PCIe interface can be initialized via the GPU. When the second bootloader embedded in the graphics card's flash memory is in an abnormal state, a flash memory firmware package sent externally to the graphics card is received, and the second bootloader in the flash memory is updated using the received firmware package. Therefore, during graphics card use, the second bootloader in the flash memory can be updated as needed without physically unloading the flash memory, effectively improving the debugging progress of project development, ensuring normal graphics card initialization, and eliminating the need for pre-burning of the flash memory; instead, the flash memory can be updated as needed during use.
[0047] Figure 1 This is a flowchart illustrating a graphics card initialization method according to an exemplary embodiment. For example... Figure 1 As shown, this graphics card initialization method can be applied to a GPU, which is configured with a first bootloader. This first bootloader includes a PCIe initialization program used to initialize the PCIe interface. Therefore, the graphics card initialization method can include the following steps:
[0048] Step S101: Run the PCIE initialization program to initialize the PCIE interface.
[0049] It should be noted that the first bootloader may include a first-level bootloader as described in related technologies. The PCIe initialization program may be a program in the BIOS used to initialize the PCIe interface, and the corresponding firmware of the PCIe initialization program may include a PCIe controller and a physical interface (PHY). In this embodiment, the PCIe controller and physical interface are embedded in the GPU, thereby enabling the initialization of the PCIe interface without reading the BIOS program from flash memory during graphics card initialization. For example, the corresponding PCIe initialization program is run based on the PCIe controller and physical interface to configure the PCIe interface.
[0050] In step S102, in response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state, the flash firmware package is received via the PCIe interface.
[0051] The second bootloader can be a secondary bootloader in the related art, or it can be a secondary bootloader that has uninstalled the PCIe initialization program.
[0052] In this embodiment, data from outside the graphics card can be received via the initialized PCIe interface, such as a flash ROM image. The data sent from outside the graphics card can refer to data sent by the CPU. The flash firmware image can be used to write to the flash memory to update the second bootloader in the flash memory, and the updated flash memory can be used to initialize the graphics card.
[0053] Step S103: Update the second bootloader using the flash firmware package.
[0054] It's easy to understand that the flash firmware package can be burned into the flash memory for use in the subsequent graphics card initialization process.
[0055] The technical solution provided in this disclosure embeds the PCIe initialization program, originally stored in flash memory, into the GPU. This allows the GPU to initialize the PCIe interface when the flash memory is corrupted or empty. Furthermore, it enables the GPU to receive flash firmware packages sent externally to the graphics card when the second bootloader, stored in the graphics card's flash memory, is in an abnormal state. Consequently, during graphics card use, the second bootloader in the flash memory can be updated as needed without physically unloading it, effectively improving project development and debugging progress, ensuring proper graphics card initialization, and eliminating the need for pre-programming the flash memory; updates can be performed on demand during use.
[0056] Optionally, the GPU may also include a system management controller (SMC), and the flash firmware package may be received by the system management controller via a PCIe interface.
[0057] Based on this, the technical solution provided in the embodiments of this disclosure may further include:
[0058] The system management controller verifies the flash firmware package.
[0059] The system management controller can be a microcontroller embedded in the GPU. In one possible implementation, a preset verification procedure can be used to perform security verification on the flash firmware package to ensure its security. The preset verification procedure can be determined according to the actual situation, and this disclosure does not impose specific limitations on it.
[0060] Therefore, step S103 above may include:
[0061] Update the second bootloader using the verified flash firmware package.
[0062] This allows for updates to the flash memory without physically unloading it, further ensuring the security of external data on the graphics card. This effectively improves the debugging progress of project development and ensures the normal initialization of the graphics card.
[0063] It's easy to understand that, without needing to consider the security of the received flash firmware package, there's no need to perform security verification on the flash firmware package through the system management controller. Instead, the relevant SPI registers can be exposed to the PCIe configuration space, and the GPU can directly send the flash firmware package to the flash memory through the PCIe interface. This can further improve project development efficiency.
[0064] Therefore, step S103 above may include:
[0065] Send the flash firmware package to the designated register in the flash memory to update the second bootloader.
[0066] The designated register can be a register in the flash memory that contains the second bootloader, such as the aforementioned SPI-related registers. This eliminates the need for security verification of the flash firmware package via the system management controller in environments without security concerns, allowing the flash firmware package to be directly written to the relevant registers, thereby further improving flash update efficiency.
[0067] Figure 2 This is a schematic diagram illustrating an update of a flash firmware package according to an exemplary embodiment. For example... Figure 2As shown, the graphics card 200 is inserted into the PCIe slot 210, which is located on the motherboard 220. The motherboard 220 also houses the CPU 230. The graphics card 200 includes a GPU 202 and flash memory 204. Based on this, the GPU 202 runs a PCIe initialization program to initialize the PCIe interface and receives flash memory firmware packages from outside the graphics card based on the initialized PCIe interface. These flash memory firmware packages can be sent by the user via the CPU 230 and received by the GPU 202 via the motherboard 220. Afterwards, the GPU 202 can perform security verification on the received flash memory firmware package through its embedded system management controller and update the flash memory 204 using the verified firmware package. Therefore, during graphics card use, updates to the flash memory 204 can be performed as needed without physically unloading it.
[0068] It should be noted that while the CPU202 receives data from the graphics card via the PCIe interface, the GPU202 can also communicate with the motherboard 220 via the PCIe interface to receive data from the graphics card. Due to the transmission rate limitations of the motherboard 220, during communication between the GPU202 and the motherboard 220 via the PCIe interface, the transmission rate of the PCIe interface can be configured to match the transmission rate of the motherboard 220, such as the Gen1 rate. Depending on the transmission rate of the motherboard 220 used, the PCIe interface can be configured to the corresponding transmission rate to ensure compatibility with the motherboard.
[0069] It should also be noted that an identifier value can be set in the preset address of flash memory 204 to represent the storage state of flash memory 204, thereby controlling the update of flash memory 204 according to the identifier value.
[0070] The preset address can be determined according to the actual situation, and this disclosure does not impose specific limitations on it. For example, it can be the starting address (0x00) of the flash memory 204. The storage state of the flash memory 204 can include normal and abnormal. An abnormal storage state of the flash memory 204 can include the storage content of the flash memory 204 being empty or the storage content being corrupted. The identifier value can be preset according to the actual situation, and this disclosure does not impose specific limitations on it. For example, the preset value for normal storage state of the flash memory can be 0x1ED5, and the preset value for abnormal storage state of the flash memory can be 0x2EED.
[0071] Optionally, prior to step S102 above, the technical solution provided in this disclosure embodiment may further include:
[0072] The identifier value is read based on the preset address of the flash memory, and the identifier value is used to determine the storage state of the flash memory;
[0073] If the read flag value indicates an abnormal storage state of the flash memory, or if no flag value is read, it is determined that the second bootloader embedded in the flash memory is in an abnormal state.
[0074] It is understood that before the GPU reads the identifier value stored at the preset address of the flash memory, the GPU can run a first bootloader to initialize the SPI interface. This allows the identification value stored at the preset address of the flash memory to be read based on the SPI interface, thereby determining the storage state of the flash memory. The data line provided by the SPI interface for reading data stored at the preset address can be used as the target data line. Therefore, in this embodiment of the disclosure, the target data line can be used to read the identifier value stored at the preset address.
[0075] In one possible implementation, a short-circuit switch can be connected to the target data line, thereby controlling whether the corresponding data can be read from the target data line. For example, if the graphics card initialization fails based on the content stored in the flash memory, the switch for shorting the target data line can be closed. It is easy to understand that when the short-circuit switch is closed, the target data line is short-circuited, thus preventing the reading of the identifier value stored at a preset address in the flash memory. This inability to read the identifier value indicates that the content stored in the flash memory is corrupted. When the short-circuit switch is open, the target data line is open, allowing the reading of the identifier value stored at the preset address in the flash memory. This ability to read the identifier value, and the fact that the read identifier value is a normal preset value, indicates that the content stored in the flash memory is normal.
[0076] It should be noted that if the flash memory has not been pre-programmed, or if the target data line used to read the identifier value is short-circuited, the GPU cannot read the identifier value from the default address of the flash memory. Therefore, the failure to read the identifier value indicates that the flash memory content is empty or corrupted, meaning the second bootloader embedded in the flash memory is in an abnormal state. If the flash memory has been pre-programmed, and the initialization of the graphics card based on the flash memory content failed before this read, the identifier value at the default address of the flash memory is modified to an abnormal default value indicating an abnormal storage state before this read. Therefore, when the read identifier value indicates an abnormal flash memory storage state, it indicates that the flash memory content is corrupted, meaning the second bootloader embedded in the flash memory is in an abnormal state.
[0077] It is understandable that if the read flag value indicates an abnormal storage state of the flash memory, or if no flag value is read, it can be determined that the content stored in the flash memory is corrupted or empty, meaning the second bootloader embedded in the flash memory is in an abnormal state. Therefore, a flash memory firmware package sent externally to the graphics card can be received via the PCIe interface, and this firmware package can be used to update the second bootloader in the flash memory.
[0078] Furthermore, if the flash memory has already been programmed, and the graphics card initialization based on the flash memory's stored content did not fail before this read, or if the flash memory firmware package currently programmed into the flash memory has not yet been used to initialize the graphics card for the first time, then the default address identifier value of the flash memory will be modified to a normal default value indicating a normal storage status before this read. Therefore, if the read identifier value indicates a normal flash memory storage status, the graphics card initialization and BIOS signature verification process can proceed normally.
[0079] Optionally, after step S103 above, the technical solution provided by the embodiments of this disclosure may further include:
[0080] Modify the identifier value stored in the preset address of the flash memory to the normal preset value; or, control the switch used to short-circuit the target data line to turn on.
[0081] It should be noted that the flash memory firmware package received by the GPU is used to update the contents of the flash memory. Therefore, after the flash memory firmware package is written to the graphics card's flash memory, the identifier value stored at the preset address of the flash memory can be modified to the normal preset value. Alternatively, if the graphics card initialization fails based on the contents of the flash memory before reading the identifier value stored at the preset address, and the flash memory contents are characterized by corruption by closing the switch used to short-circuit the target data line, then after the flash memory firmware package used to update the flash memory is written to the flash memory, the switch used to short-circuit the target data line can be opened to restore the target data line's continuity, thus indicating that the flash memory's storage state is normal.
[0082] In one possible implementation, if the graphics card is successfully initialized according to the flash memory firmware package, the identifier value stored in the preset address of the flash memory can be modified to a normal preset value, or the switch used to short-circuit the target data line can be turned on to restore the target data line to its normal operation.
[0083] Optionally, after step S103 above, the technical solution provided by the embodiments of this disclosure may further include:
[0084] In the event that the graphics card fails to initialize according to the flash firmware package, the identifier value stored in the default address of the flash memory is modified to an abnormal default value, or the switch used to short-circuit the target data line is controlled to close.
[0085] It is easy to understand that if the graphics card fails to initialize based on the flash firmware package, it can indicate that the contents of the flash firmware package are corrupted. Therefore, the identifier value stored in the preset address of the flash memory can be modified to an abnormal preset value, or the switch used to short-circuit the target data line can be closed to short-circuit the target data line. This indicates that the contents currently stored in the flash memory are corrupted, so that the next time the graphics card is initialized, the step of receiving a new flash firmware package can be triggered based on the read abnormal preset value or the failure to read the identifier value, so as to continue the debugging work of the project.
[0086] Furthermore, it should be noted that the preset address for the aforementioned storage identifier value is typically not used to store the flash firmware package. In another possible implementation, the preset address can be used to store the flash firmware package. Based on this, a normal preset value can be set as the identifier value at a preset location within the flash firmware package. Thus, after the flash firmware package is written to the flash memory, the value at the preset location within the flash firmware package can be used to determine that the flash memory's storage status is normal, and the graphics card boot process can continue.
[0087] Figure 3 This is a flowchart illustrating a graphics card initialization method according to another exemplary embodiment.
[0088] like Figure 3 As shown, the graphics card initialization method may include the following steps:
[0089] Step S301: Initialize the PCIe interface and SPI interface, and configure the transmission rate of the PCIe interface to Gen1.
[0090] It is understandable that the SPI interface can be initialized by running the first bootloader embedded in the GPU, and the PCIE interface can be initialized by the PCIE initializer in the first bootloader, thereby completing the initialization of the PCIE interface and the SPI interface.
[0091] Step S302: Read the identifier value stored at the starting address of the flash memory based on the SPI interface, and determine whether the identifier value is equal to the normal preset value. If yes, proceed to step S303; otherwise, proceed to step S304.
[0092] Step S303: Perform normal graphics card initialization.
[0093] In this step, you can refer to relevant technologies to initialize the graphics card, which will not be elaborated here.
[0094] Step S304: Enter flash memory content update mode.
[0095] In step S3041, the system management controller receives the flash firmware package via the PCIe interface and uses the flash firmware package to update the flash memory.
[0096] In step S3042, the system management controller modifies the identifier value stored in the first address of the flash memory to the normal preset value and enters the restart process.
[0097] The restart process can refer to returning to step S301 or step S302 to re-initialize the graphics card.
[0098] The above technical solution embeds the PCIe initialization program, originally stored in flash memory, into the GPU. This allows the GPU to initialize the PCIe interface and receive flash firmware packages sent externally to the graphics card when the flash memory is damaged or empty. Consequently, flash memory updates can be performed as needed during graphics card use without physically unloading it, effectively improving project development and debugging progress, ensuring proper graphics card initialization, and eliminating the need for pre-programming the flash memory—updating it only as required during use.
[0099] Based on the same concept, this disclosure also provides a graphics card initialization device 400, see reference. Figure 4 , Figure 4 This is a block diagram illustrating a graphics card initialization device 400 according to an exemplary embodiment. Figure 4 As shown, the graphics card initialization device 400 can be applied to a GPU. The GPU is equipped with a first bootloader, which includes a PCIe initialization program used to initialize the PCIe interface. The graphics card initialization device 400 includes:
[0100] Module 401 is used to run the PCIE initialization program to initialize the PCIE interface;
[0101] Response module 402 is used to respond to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state, based on the PCIe interface flash memory firmware package;
[0102] Update module 403 is used to update the second bootloader using the flash firmware package.
[0103] The above technical solution embeds the PCIe initialization program, originally stored in flash memory, into the GPU. This allows the GPU to initialize the PCIe interface and receive flash firmware packages sent externally to the graphics card when the flash memory is damaged or empty. Consequently, flash memory updates can be performed as needed during graphics card use without physically unloading it, effectively improving project development and debugging progress, ensuring proper graphics card initialization, and eliminating the need for pre-programming the flash memory—updating it only as required during use.
[0104] Optionally, the GPU includes a system management controller, the flash firmware package is received by the system management controller via the PCIe interface, and the graphics card initialization device 400 may further include a verification module for:
[0105] The system management controller verifies the flash firmware package.
[0106] Based on this, module 403 is updated for:
[0107] Update the second bootloader using the verified flash firmware package.
[0108] Optionally, the graphics card initialization device 400 may further include a determining module, which is used for:
[0109] In response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state, before receiving the flash firmware package via the PCIe interface, an identifier value is read based on a preset address of the flash memory. This identifier value is used to determine the storage state of the flash memory.
[0110] If the read flag value indicates an abnormal storage state of the flash memory, or if no flag value is read, it is determined that the second bootloader embedded in the flash memory is in an abnormal state.
[0111] Optionally, the graphics card initialization device 400 may further include a first modification module, which is used for:
[0112] After updating the second bootloader using the flash firmware package, if the graphics card initialization fails based on the flash firmware package, the identifier value stored at the default address of the flash memory is modified to an abnormal default value, which indicates that the flash memory's storage state is abnormal; or,
[0113] After updating the second bootloader using the flash firmware package, if the graphics card initialization fails according to the flash firmware package, the switch used to short the target data line is closed, and the target data line is used to read the identifier value stored in the preset address.
[0114] Optionally, the graphics card initialization device 400 may further include a second modification module, which is used for:
[0115] After updating the second bootloader using the flash firmware package, the identifier value stored at the default address in the flash memory is modified to a normal default value, which indicates that the flash memory's storage status is normal; or,
[0116] After updating the second bootloader using the flash firmware package, the switch controlling the shorting of the target data line is turned on, and the target data line is used to read the identifier value stored in the preset address.
[0117] Optionally, update module 403 is used for:
[0118] The flash firmware package is sent to a designated register in the flash memory to update the second bootloader, wherein the designated register is a register in the flash memory that contains the second bootloader.
[0119] Optionally, the running module 401 is used for:
[0120] Run the PCIe initialization program to configure the PCIe interface's transfer rate to match the motherboard's transfer rate.
[0121] Regarding the graphics card initialization device 400 in the above embodiments, the specific methods by which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0122] Figure 5 This is a block diagram illustrating an electronic device 500 according to an exemplary embodiment. For example... Figure 5 As shown, the electronic device 500 may include a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input / output (I / O) interface 504, and a communication component 505.
[0123] The processor 501 controls the overall operation of the electronic device 500 to complete all or part of the steps in the aforementioned graphics card initialization method. The memory 502 stores various types of data to support the operation of the electronic device 500. This data may include, for example, instructions for any application or method operating on the electronic device 500, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. Multimedia component 503 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 502 or transmitted via communication component 505. The audio component also includes at least one speaker for outputting audio signals. I / O interface 504 provides an interface between processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 505 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0124] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the graphics card initialization method described above.
[0125] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the graphics card initialization method described above. For example, the computer-readable storage medium may be the memory 502 including the program instructions described above, which may be executed by the processor 501 of the electronic device 500 to complete the graphics card initialization method described above.
[0126] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described graphics card initialization method when executed by the programmable device.
[0127] Based on the same concept, this disclosure also provides a GPU for implementing the above-described graphics card initialization method.
[0128] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0129] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0130] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A graphics card initialization method, characterized in that, Applied to a GPU, the GPU is configured with a first bootloader, the first bootloader including a PCIe initialization program, the PCIe initialization program being used to initialize the PCIe interface, the method including: Run the PCIe initialization program to initialize the PCIe interface; In response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state, the flash memory firmware package is received based on the PCIe interface; The second bootloader is updated using the flash firmware package.
2. The graphics card initialization method according to claim 1, characterized in that, The GPU includes a system management controller, and the flash firmware package is received by the system management controller via the PCIe interface; the method further includes: The system management controller performs verification processing on the flash firmware package; Updating the second bootloader using the flash firmware package includes: The second bootloader is updated using the verified flash firmware package.
3. The graphics card initialization method according to claim 1, characterized in that, Before receiving the flash firmware package via the PCIe interface, in response to a second bootloader embedded in the graphics card's flash memory being in an abnormal state, the method further includes: The identifier value is read based on the preset address of the flash memory, and the identifier value is used to determine the storage state of the flash memory; If the read identifier value indicates that the storage state of the flash memory is abnormal, or if the identifier value is not read, it is determined that the second bootloader program embedded on the flash memory is in an abnormal state.
4. The graphics card initialization method according to claim 1, characterized in that, After updating the second bootloader using the flash firmware package, the method further includes: If initializing the graphics card according to the flash memory firmware package fails, the identifier value stored in the preset address of the flash memory is modified to an abnormal preset value, which indicates that the storage state of the flash memory is abnormal; or, In the event that the graphics card fails to be initialized according to the flash firmware package, the switch used to short-circuit the target data line is closed, and the target data line is used to read the identifier value stored in the preset address.
5. The graphics card initialization method according to claim 1, characterized in that, After updating the second bootloader using the flash firmware package, the method further includes: Modify the identifier value stored in the preset address of the flash memory to a normal preset value, whereby the normal preset value indicates that the storage state of the flash memory is normal; or, The switch for shorting the target data line is turned on, and the target data line is used to read the identifier value stored in the preset address.
6. The graphics card initialization method according to any one of claims 1-5, characterized in that, Updating the second bootloader using the flash firmware package includes: The flash firmware package is sent to a designated register in the flash memory to update the second bootloader, wherein the designated register is a register in the flash memory where the second bootloader is embedded.
7. The graphics card initialization method according to any one of claims 1-5, characterized in that, The step of running the PCIe initialization program to initialize the PCIe interface includes: Run the PCIe initialization program to configure the PCIe interface's transmission rate to match the motherboard's transmission rate.
8. A graphics card initialization device, characterized in that, Applied to a GPU, the GPU is configured with a first bootloader, the first bootloader including a PCIe initialization program, the PCIe initialization program being used to initialize the PCIe interface, the device comprising: The runtime module is used to run the PCIE initialization program to initialize the PCIE interface; The response module is used to receive the flash firmware package via the PCIe interface in response to the second bootloader embedded in the flash memory of the graphics card being in an abnormal state. An update module is used to update the second bootloader using the flash firmware package.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-7.
11. A GPU, characterized in that, The GPU is used to implement the graphics card initialization method according to any one of claims 1-7.
Citation Information
Patent Citations
Peer-to-peer communication for graphics processing units
CN110870263A
Initialization of GPU using ROM-based initialization unit and programmable microcontroller
US20130191692A1