Method for enabling optional read-only memory function, computer device and medium
The data processing unit simulates the generation of the fast peripheral device interconnect topology structure and the option read-only memory base address register for configuring the uplink port, which solves the problem of option read-only memory function update and management under the expansion of device scale and type complexity, and realizes flexible The functions are turned on and off, improving the system operation efficiency.
Patent Information
- Application Number
- CN202411241604.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-09-05
AI Technical Summary
The prior art is difficult to meet the need for rapid updates and adjustments to the option read-only memory function, especially in the case of expanded device size and complex types, and it is difficult for users to flexibly turn on or off different option read-only memory functions.
The data processing unit simulates the generation of the fast peripheral device interconnect topology, configure the option read-only memory base address register of the uplink port, load the option read-only memory program of the fast peripheral device interconnect device to the host memory, and realize the enablement of the option read-only memory function and flexible management.
It saves time and cost of configuring the option read-only memory base address register, reduces the impact of equipment business, and realizes the flexible function of turning on and off the option read-only memory according to user needs, improving system operation efficiency.
Smart Images

Figure CN118760404B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for enabling an option read-only memory function, a computer device, and a medium. Background Art
[0002] Option ROM is used to store the initialization code or system startup code of the device. The Basic Input Output System (BIOS) scans whether the option ROM function of the device is enabled during the scanning phase. If the option ROM function is enabled, the structure pointer including the starting address and the size of the occupied storage space is obtained, and then copied to the memory for execution. If the option ROM function is not enabled, the general option ROM program may be used to implement the device startup and system initialization. The option ROM function of the Peripheral Component Interconnect Express (PCIE) device is generally solidified on the device side, such as in the flash memory, and waits for the BIOS to load. Considering the increasing scale of devices and the complexity of device types, as well as user customization needs and manufacturer-defined device initialization options, it may be necessary to frequently update or adjust the option ROM function of the device. In addition, in some scenarios, the option ROM function on the device side may not be required to run, or the user does not want to enable certain functions.
[0003] To this end, the present application provides a method for enabling an option read-only memory function, a computer device, and a medium, which can meet the needs of the option read-only memory function of a device that is frequently updated or adjusted, and can also flexibly and dynamically turn on and off different option read-only memory functions according to user needs. Summary of the invention
[0004] In a first aspect, the present application provides a method for enabling an option read-only memory function. The enabling method comprises: simulating and generating a quick peripheral device interconnect topology structure through a data processing unit, wherein the quick peripheral device interconnect topology structure comprises at least one upstream port connected to a root port, at least one downstream port connected to the at least one upstream port, and at least one quick peripheral device interconnect device mounted to the at least one downstream port; configuring the option read-only memory base address register of each of the at least one upstream port through the data processing unit, so that the option read-only memory base address register of each of the at least one upstream port is loaded with the option read-only memory base address registers of all the quick peripheral device interconnect devices mounted to the downstream ports of the at least one downstream port connected to the upstream port. The method comprises: loading the option ROM program of each of the at least one peripheral device interconnect express device into the option ROM base address register of each of the at least one upstream port; in response to the option ROM function of one or more peripheral device interconnect express devices in the at least one peripheral device interconnect express device being enabled, reading the option ROM program of each of the one or more peripheral device interconnect express devices from the option ROM base address register of each of the at least one upstream port, and then loading the read option ROM program of each of the one or more peripheral device interconnect express devices into the host memory for enabling the option ROM function of the one or more peripheral device interconnect express devices.
[0005] Through the first aspect of the present application, by improving the option read-only memory base address register of the upstream port, it is realized that by configuring the option read-only memory base address register of the upstream port, the time and cost of configuring the option read-only memory base address register of the device side for each quick peripheral device interconnect device are saved; according to the user's customized activation requirements, the option read-only memory program corresponding to the quick peripheral device interconnect device with the option read-only memory function activated can be loaded into the host memory, thereby realizing flexible and dynamic activation and deactivation of different option read-only memory functions according to user requirements; and because the quick peripheral device interconnect topology structure is simulated and generated by the data processing unit, This means that the flash memory or firmware upgrade at the device level is not involved. Therefore, during the entire process of updating or adjusting, the impact on the device's own business is reduced, which can meet the needs of the option read-only memory function of the device that is frequently updated or adjusted. Moreover, during the process of user updating the configuration, because the content of the option read-only memory program is loaded based on the user's latest configuration only involves the option read-only memory base address register of the upstream port, and does not need to involve the option read-only memory base address register at the device level, the operation of the system simulator of the data processing unit is not interrupted. In this way, there is no need to interrupt the system operation to reflect the user's latest configuration, which effectively improves the system operation efficiency.
[0006] In a possible implementation of the first aspect of the present application, the loading order in which the option read-only memory programs of each of the at least one peripheral device interconnect express devices are loaded into the option read-only memory base address registers of each of the at least one upstream port is configurable, and the loading order is determined at least based on the device type.
[0007] In a possible implementation manner of the first aspect of the present application, the data processing unit is further used to simulate and generate at least one set register, and the at least one set register is used to indicate whether the option read-only memory program of the previous peripheral device interconnect express device in the at least one peripheral device interconnect express device has been loaded, so as to start loading the option read-only memory program of the subsequent peripheral device interconnect express device in the at least one peripheral device interconnect express device.
[0008] In a possible implementation manner of the first aspect of the present application, a header identifier of the option read-only memory program of each of the at least one peripheral device interconnect express devices loaded into the option read-only memory base address register of each of the at least one upstream port is used to indicate whether it is the last option read-only memory program.
[0009] In a possible implementation manner of the first aspect of the present application, the option ROM base address register of each of the at least one upstream port includes a fixed initial address, and loading starts from the fixed initial address until the header identifier indicates that it is the last option ROM program.
[0010] In a possible implementation manner of the first aspect of the present application, whether the option read-only memory function of the one or more peripheral device interconnect express devices is enabled is determined based on a user customization requirement.
[0011] In a possible implementation manner of the first aspect of the present application, different types of peripheral device interconnect express devices in the at least one peripheral device interconnect express device have different option read-only memory programs.
[0012] In a possible implementation manner of the first aspect of the present application, the enabling method further includes: in response to the option read-only memory function of the one or more peripheral device interconnect express devices being turned off and the option read-only memory function of at least one other peripheral device interconnect express device being turned on, restarting the host, then reading the option read-only memory program of the at least one other peripheral device interconnect express device from the option read-only memory base address register of each of the at least one upstream port, and then loading the read option read-only memory program of the at least one other peripheral device interconnect express device into the host memory to enable the option read-only memory function of the at least one other peripheral device interconnect express device.
[0013] In a possible implementation manner of the first aspect of the present application, the one or more peripheral device interconnect express devices include a first peripheral device interconnect express device, and the enabling method further includes: reading a first option read-only memory program associated with the first peripheral device interconnect express device from an option read-only memory base address register of the first peripheral device interconnect express device, and then loading the first option read-only memory program into the host memory to enable a first option read-only memory function of the first peripheral device interconnect express device corresponding to the first option read-only memory program.
[0014] In a possible implementation manner of the first aspect of the present application, the first option ROM function is necessary for starting the first peripheral device interconnect express device and needs to be run during the startup phase of a basic input / output system.
[0015] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.
[0016] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A flowchart of a method for enabling an option read-only memory function provided in an embodiment of the present application;
[0020] Figure 2 A reference provided for the embodiments of this application Figure 1 A schematic diagram of a data processing unit showing a method for enabling the optional read-only memory function;
[0021] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0023] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0024] Figure 1The flowchart of a method for enabling an option read-only memory function provided in an embodiment of the present application is as follows. Figure 1 As shown, the enabling method includes the following steps.
[0025] Step S110: simulating and generating a peripheral device interconnection express topology structure through a data processing unit, wherein the peripheral device interconnection express topology structure includes at least one upstream port connected to a root port, at least one downstream port connected to the at least one upstream port, and at least one peripheral device interconnection express device connected to the at least one downstream port.
[0026] Step S120: configuring the option ROM base address register of each of the at least one upstream port through the data processing unit, so that the option ROM base address register of each of the at least one upstream port is loaded with the option ROM programs of all the peripheral device interconnect express devices connected to the downstream port of the at least one downstream port connected to the upstream port, thereby loading the option ROM program of each of the at least one peripheral device interconnect express devices into the option ROM base address register of each of the at least one upstream port.
[0027] Step S130: In response to the option ROM function of one or more peripheral device interconnect express devices in the at least one peripheral device interconnect express device being enabled, reading the option ROM programs of the one or more peripheral device interconnect express devices from the option ROM base address register of the at least one upstream port, and then loading the read option ROM programs of the one or more peripheral device interconnect express devices into the host memory to enable the option ROM function of the one or more peripheral device interconnect express devices.
[0028] Figure 1The method for enabling the option read-only memory function shown can be applied to the scenario of a data processing unit (DPU). The data processing unit simulates multiple different types of standard peripheral component interconnect express (PCIE) devices to the host. These PCIE devices may need to perform device initialization and system startup in a specific manner based on user customization requirements and manufacturer customization requirements. As mentioned above, considering the increasing scale of devices and the complexity of device types, as well as user customization requirements and manufacturer customization of device initialization options, it may be necessary to frequently update or adjust the option read-only memory function of the device, and in some scenarios, the option read-only memory function on the device side may not be required to run, or the user does not want to enable certain functions. Therefore, if the option read-only memory function of the PCIE device itself is solidified in the flash memory and waits for the host's basic input output system (BIOS) to load, it is not conducive to meeting the need for the option read-only memory function of the device that is frequently updated or adjusted, and it is also difficult to flexibly and dynamically turn on and off different option read-only memory functions according to user needs. For this reason, Figure 1 The method for enabling the option ROM function shown in the figure comprises: in step S110, simulating and generating a peripheral device interconnect express topology structure through a data processing unit, wherein the peripheral device interconnect express topology structure comprises at least one upstream port connected to a root port, at least one downstream port connected to the at least one upstream port, and at least one peripheral device interconnect express device mounted to the at least one downstream port; and in step S120, configuring the option ROM base address register of each of the at least one upstream port through the data processing unit, so that the option ROM base address register of each of the at least one upstream port is loaded with the option ROM programs of all the peripheral device interconnect express devices mounted to the downstream port of the at least one downstream port connected to the upstream port, thereby loading the option ROM program of the at least one peripheral device interconnect express device into the option ROM base address register of the at least one upstream port.
[0029] See also Figure 1, the quick peripheral device interconnect topology structure generated by the simulation of the data processing unit is also the PCIE topology structure, which includes an upstream port for connecting to the root port of the drive side of the host, and then can interact with the host through the PCIE bus, and also includes a downstream port connected to the upstream port, so that the quick peripheral device interconnect device generated by the simulation of the data processing unit can be mounted through the downstream port. In the application scenario of a single host, the single host has a root port, and a single device such as a PCIE device is mounted under the root port, or a single upstream port such as an upstream port of a bridge device is mounted under the root port. In the application scenario of multiple hosts, different upstream ports are mounted in the root ports of different hosts. Therefore, the DPU generally simulates and generates one upstream port in the single-host application scenario, and generally simulates and generates multiple upstream ports in the multi-host application scenario. When the BIOS of the host scans, all the quick peripheral device interconnect devices mounted to the downstream port connected to the upstream port are enumerated through the upstream port, and the option read-only memory program of these devices is obtained to complete the device initialization and system startup. To this end, by improving the option ROM base address register of the upstream port, the option ROM base address register of the upstream port is configured, thereby saving the time and cost of configuring the option ROM base address register of the device side for each quick peripheral device interconnect device. The option ROM base address register of each of the at least one upstream port is configured so that the option ROM base address register of each of the at least one upstream port is loaded with the option ROM programs of all the quick peripheral device interconnect devices connected to the downstream port of the at least one downstream port connected to the upstream port, thereby loading the option ROM programs of the at least one quick peripheral device interconnect device to the option ROM base address register of the at least one upstream port. In this way, for all the quick peripheral device interconnect devices connected to the downstream port connected to a certain upstream port, the option ROM programs of these quick peripheral device interconnect devices are loaded and stored in the option ROM base address register of the upstream port simulated and generated by the data processing unit, and are therefore stored in the disk of the system simulator of the data processing unit, that is, in the physical memory of the data processing unit. This means that according to the user's customized activation requirements, for example, the option ROM function of one or two of the three quick peripheral device interconnect devices connected to the same downstream port can be enabled, so that the option ROM program corresponding to the quick peripheral device interconnect device with the option ROM function enabled is loaded into the host memory, thereby realizing flexible and dynamic activation and deactivation of different option ROM functions according to user requirements.In this way, during the process of device initialization such as system startup and system restart, the option read-only memory program in the option read-only memory base address register of the upstream port can be selectively loaded in combination with the latest user needs, and if the user does not want to enable certain functions, such as for the purpose of energy saving, etc., it can be selected not to load certain option read-only memory programs according to user needs.
[0030] Continue reading Figure 1In step S130, in response to the option ROM function of one or more PID Express devices in the at least one PID Express device being enabled, the option ROM programs of the one or more PID Express devices are read from the option ROM base address registers of the at least one upstream port, and then the read option ROM programs of the one or more PID Express devices are loaded into the host memory to enable the option ROM functions of the one or more PID Express devices. In this way, it is possible to flexibly and dynamically enable and disable different option ROM functions according to user needs, and the user can specify which device's option ROM programs are to be loaded, and the user can customize the enabling or disabling of the option ROM functions of specific devices. The user can also choose not to enable certain option ROM functions and not to load certain option ROM programs. Furthermore, by managing and maintaining the option ROM program stored in the option ROM base address register of the upstream port through the data processing unit, it is convenient to update or adjust, such as upgrading the version, rolling back the version, flashing the firmware, etc. Moreover, because it is carried out through the upstream port in the quick peripheral device interconnection topology structure simulated and generated by the data processing unit, it means that there is no flash memory or firmware upgrade at the device level, so during the entire process of updating or adjusting, the impact on the device's own business is reduced. Furthermore, if the user changes the original configuration, for example, wants to turn off the option ROM function of some devices that are currently turned on, or wants to turn on the option ROM function of some devices that are currently turned off, the system simulator of the data processing unit can provide corresponding switches for each device, and the user only needs to customize these switches to notify the system simulator how to flexibly and dynamically turn on and off different option ROM functions according to user needs. In this way, the system simulator will read the option ROM programs of all the PIC devices connected to the downstream port from the disk, and then determine whether the switch corresponding to the PIC device is turned on. If it is turned on, for example, the option ROM function of one or more PIC devices in the at least one PIC device is turned on, then the content of the option ROM program based on the user's latest configuration is loaded into the host memory for operation, thereby enabling the option ROM function based on the user's latest configuration. In addition, in the process of user updating configuration, because the content of the option ROM program loaded based on the user's latest configuration only involves the option ROM base address register of the upstream port, and does not need to involve the option ROM base address register of the device level, the operation of the system simulator of the data processing unit is not interrupted, so that there is no need to interrupt the system operation to reflect the user's latest configuration, which effectively improves the system operation efficiency.
[0031] Continue reading Figure 1 , Figure 1 The method for enabling the option ROM function shown in the figure proposes that the system simulator simulates the upstream port and configures the option ROM base address register of the upstream port to implement the option ROM function. The system simulator manages and maintains the option ROM function switches of all PCIE devices. The system simulator traverses all option ROM function sets, sequentially loads the option ROM program whose option ROM function switch is set to be turned on into the memory of the system simulator, and can also set the header identifier of the option ROM program to indicate whether it is the last option ROM program. In this way, when the BIOS on the host side scans the upstream port in the system startup phase, the system simulator returns the option ROM program in which the option ROM function switch in the memory of the system simulator is set to be turned on. This means that in response to the option ROM function of one or more peripheral device interconnect express devices in the at least one peripheral device interconnect express device being turned on, the option ROM programs of the one or more peripheral device interconnect express devices are read from the option ROM base address registers of the at least one upstream port, and then the read option ROM programs of the one or more peripheral device interconnect express devices are loaded into the host memory to enable the option ROM functions of the one or more peripheral device interconnect express devices.
[0032] In conclusion, Figure 1The method for enabling the option read-only memory function shown in the figure improves the option read-only memory base address register of the upstream port, thereby realizing the configuration of the option read-only memory base address register of the upstream port, thereby saving the time and cost of configuring the option read-only memory base address register of the device side for each quick peripheral device interconnect device; according to the user's customized activation requirements, the option read-only memory program corresponding to the quick peripheral device interconnect device with the option read-only memory function activated can be loaded into the host memory, thereby realizing the flexible and dynamic activation and deactivation of different option read-only memory functions according to user requirements; and because the quick peripheral device interconnect is simulated and generated by the data processing unit, the option read-only memory program corresponding to the quick peripheral device interconnect device with the option read-only memory function activated can be loaded into the host memory. This means that the flash memory or firmware upgrade at the device level is not involved. Therefore, during the entire process of updating or adjusting, the impact on the device's own business is reduced, which can meet the needs of the option read-only memory function of the device that is frequently updated or adjusted. Moreover, during the user's configuration update, because the content of the option read-only memory program is loaded based on the user's latest configuration only involves the option read-only memory base address register of the upstream port, and does not need to involve the option read-only memory base address register at the device level, the operation of the system simulator of the data processing unit is not interrupted. In this way, there is no need to interrupt the system operation to reflect the user's latest configuration, which effectively improves the system operation efficiency.
[0033] Figure 2 A reference provided for the embodiments of this application Figure 1 Schematic diagram of a data processing unit showing a method for enabling the optional read-only memory function. Figure 2 As shown, in a multi-host application scenario, multiple hosts have their own root ports, and root port A210 and root port B212 are used to connect the host driver side 202 and the host logic side 204. On the host logic side 204, the data processing unit 206 simulates and generates a quick peripheral device interconnect topology structure. The quick peripheral device interconnect topology structure includes at least one upstream port connected to the root port (root port A210 and root port B212), at least one downstream port connected to the at least one upstream port, and at least one quick peripheral device interconnect device connected to the at least one downstream port. Figure 2As shown, the upstream port A220 is connected to the root port A210, and the upstream port B230 is connected to the root port B212. The downstream port A240 and the downstream port B242 are connected to the upstream port A220, and the option read-only memory base address register A222 of the upstream port A220 is also configured through the data processing unit 206. The downstream port C246 is connected to the upstream port B230, and the option read-only memory base address register B232 of the upstream port B230 is also configured through the data processing unit 206. The device A250 is mounted on the downstream port A240, the device B252 and the device C254 are mounted on the downstream port B242, and the device D256 and the device E258 are mounted on the downstream port C246.
[0034] See also Figure 1 and Figure 2 It can be seen that the data processing unit 206 can simulate and generate multiple devices. These devices may have different device types and therefore have different option read-only memory program contents. In addition, considering user customization needs and manufacturer-defined device initialization options, even two devices of the same device type or product model may need to use different option read-only memory program contents. With the increasing expansion of device scale and the complexity of device types, the quick peripheral device interconnection topology structure simulated and generated by the data processing unit may also have a more complex design. For example, there may be more upstream ports and more downstream ports, and the correspondence between these devices and the downstream ports and upstream ports is also complex and changeable. Therefore, if the device-level option read-only memory base address register is relied upon to meet the needs of device initialization and system startup, it is not conducive to improving system operation efficiency, and it is also difficult to meet the needs of the option read-only memory function of devices that are frequently updated or adjusted. Reference Figure 1 The option ROM function is shown as the enabling method. Figure 2The data processing unit 206 shown in the figure realizes that by configuring the option read-only memory base address register of the upstream port, the option read-only memory base address register of the upstream port is improved, thereby saving the time and cost of configuring the option read-only memory base address register of the device side for each quick peripheral device interconnect device; according to the user's customized activation requirements, the option read-only memory program corresponding to the quick peripheral device interconnect device with the option read-only memory function activated can be loaded into the host memory, thereby realizing flexible and dynamic activation and deactivation of different option read-only memory functions according to user requirements; and because the quick peripheral device interconnect topology is simulated and generated by the data processing unit This means that the flash memory or firmware upgrade at the device level is not involved. Therefore, during the entire process of updating or adjusting, the impact on the device's own business is reduced, which can meet the needs of the option read-only memory function of the device that is frequently updated or adjusted. Moreover, in the process of user updating the configuration, because the content of the option read-only memory program is loaded based on the user's latest configuration only involves the option read-only memory base address register of the upstream port, and does not need to involve the option read-only memory base address register at the device level, the operation of the system simulator of the data processing unit is not interrupted. In this way, there is no need to interrupt the system operation to reflect the user's latest configuration, which effectively improves the system operation efficiency.
[0035] See also Figure 1 and Figure 2In a possible implementation, the order in which the option ROM program of each of the at least one peripheral device interconnect express device is loaded into the option ROM base address register of each of the at least one upstream port is configurable, and the loading order is at least determined based on the device type. In some embodiments, the data processing unit is also used to simulate and generate at least one set register, and the at least one set register is used to indicate whether the option ROM program of the previous peripheral device interconnect express device in the at least one peripheral device interconnect express device has been loaded, so as to start loading the option ROM program of the subsequent peripheral device interconnect express device in the at least one peripheral device interconnect express device. In this way, on the basis of realizing the flexible and dynamic opening and closing of different option ROM functions according to user needs, the loading order can also be configured. This means that by configuring the loading order, the driver of a certain device type can be loaded preferentially, which is conducive to optimizing the loading efficiency. Furthermore, by setting the set register, it is realized that only after the option ROM program of the first quick peripheral device interconnect device is loaded, the corresponding set register is set, and then the option ROM program of the subsequent quick peripheral device interconnect device in the at least one quick peripheral device interconnect device can be loaded, which is beneficial to optimizing the efficiency of device initialization and system startup and restart. For example, the first quick peripheral device interconnect device may be a device type with a faster loading speed, and the subsequent quick peripheral device interconnect device may be a device type with a slower loading speed. By optimizing the loading sequence, the option ROM program of the device type with a simpler loading speed can be loaded first, which is beneficial to optimizing the overall loading process and also beneficial to error correction when loading errors occur.
[0036] In a possible implementation, the header identifier of the option read-only memory program of each of the at least one quick peripheral device interconnect devices loaded into the option read-only memory base address register of each of the at least one upstream port is used to indicate whether it is the last option read-only memory program. In some embodiments, the option read-only memory base address register of each of the at least one upstream port includes a fixed initial address, and loading starts from the fixed initial address until the header identifier indicates that it is the last option read-only memory program. In this way, the method for enabling the option read-only memory function proposes that the system simulator simulates the upstream port and configures the option read-only memory base address register of the upstream port to implement the option read-only memory function. The system simulator manages and maintains the option read-only memory function switches of all PCIE devices. The system simulator traverses all option read-only memory function sets, sequentially loads the option read-only memory programs whose option read-only memory function switches are set to be turned on into the memory of the system simulator, and can also set the header identifier of the option read-only memory program to indicate whether it is the last option read-only memory program. In this way, the system operation efficiency is improved.
[0037] In a possible implementation, the one or more OPROM functions of the PI Express device are enabled based on user customization requirements, so that different OPROM functions can be flexibly and dynamically enabled and disabled according to user requirements.
[0038] In a possible implementation, different types of the at least one peripheral device interconnect express device have different optional read-only memory programs. In this way, adaptation to complex and changing application scenarios and an ever-expanding device scale is achieved.
[0039] In a possible implementation manner, the enabling method further includes: in response to the option ROM function of the one or more peripheral device interconnect express devices being turned off and the option ROM function of at least one other peripheral device interconnect express device being turned on, restarting the host, then reading the option ROM program of the at least one other peripheral device interconnect express device from the option ROM base address register of each of the at least one upstream port, and then loading the read option ROM program of the at least one other peripheral device interconnect express device into the host memory to enable the option ROM function of the at least one other peripheral device interconnect express device. In this way, if the user changes the original configuration, for example, wants to turn off the option ROM function of some devices that are currently turned on, or wants to turn on the option ROM function of some devices that are currently turned off, the system simulator of the data processing unit can provide a corresponding switch for each device, and the user only needs to customize these switches to notify the system simulator how to flexibly and dynamically turn on and off different option ROM functions according to user needs. In this way, the system simulator will read the option ROM programs of all the PIC devices connected to the downstream port from the disk, and then determine whether the switch corresponding to the PIC device is turned on. If it is turned on, for example, the option ROM function of one or more PIC devices in the at least one PIC device is turned on, then the content of the option ROM program based on the user's latest configuration is loaded into the host memory for operation, thereby enabling the option ROM function based on the user's latest configuration. In addition, in the process of user updating configuration, because the content of the option ROM program loaded based on the user's latest configuration only involves the option ROM base address register of the upstream port, and does not need to involve the option ROM base address register of the device level, the operation of the system simulator of the data processing unit is not interrupted, so that there is no need to interrupt the system operation to reflect the user's latest configuration, which effectively improves the system operation efficiency.
[0040] In a possible implementation manner, the one or more peripheral device interconnect express devices include a first peripheral device interconnect express device, and the enabling method further includes: reading a first option read-only memory program associated with the first peripheral device interconnect express device from an option read-only memory base address register of the first peripheral device interconnect express device, and then loading the first option read-only memory program into the host memory for enabling a first option read-only memory function of the first peripheral device interconnect express device corresponding to the first option read-only memory program. In some embodiments, the first option read-only memory function is necessary for the startup of the first peripheral device interconnect express device and needs to be run during the startup phase of the basic input and output system. As mentioned above, by improving the option read-only memory base address register of the upstream port, the option read-only memory base address register of the upstream port is configured, thereby saving the time and cost of configuring the option read-only memory base address register of the device side for each peripheral device interconnect express device. In this way, on the basis of optimizing the enabling of the option read-only memory function by improving the option read-only memory base address register of the upstream port, the device-level option read-only memory function of some devices, such as the first option read-only memory function corresponding to the first option read-only memory program, can also be retained. The first option read-only memory function may be a critical function that needs to be run in the BIOS stage, and the user is not allowed to turn it off when customized. Therefore, by loading the first option read-only memory program into the host memory to enable the first option read-only memory function corresponding to the first option read-only memory program of the first quick peripheral device interconnect device, the BIOS is forced to load and run, thereby avoiding turning off the function due to the user's customized needs. In this way, not only can different option read-only memory functions be flexibly and dynamically turned on and off according to user needs, but also security, data privacy and other requirements can be met, providing security protection and misoperation protection for user customization needs.
[0041] Figure 33 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.
[0042] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0043] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0044] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.
[0045] The bus 340 may be a peripheral component interconnect express (PCIE) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0046] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.
[0047] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0048] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0049] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0050] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for enabling an option read-only memory function, characterized in that: The enabling method comprises: Simulating and generating a peripheral device interconnection express topology structure through a data processing unit, wherein the peripheral device interconnection express topology structure includes at least one upstream port connected to a root port, at least one downstream port connected to the at least one upstream port, and at least one peripheral device interconnection express device connected to the at least one downstream port; By means of the data processing unit, the option ROM base address register of each of the at least one upstream port is configured, so that the option ROM base address register of each of the at least one upstream port is loaded with the option ROM programs of all the peripheral device interconnect express devices connected to the downstream port of the at least one downstream port connected to the upstream port, thereby loading the option ROM program of each of the at least one peripheral device interconnect express devices into the option ROM base address register of each of the at least one upstream port; In response to the option ROM function of one or more PIDI Express devices in the at least one PIDI Express device being enabled, reading the option ROM programs of the one or more PIDI Express devices from the option ROM base address registers of the at least one upstream port, and then loading the read option ROM programs of the one or more PIDI Express devices into the host memory to enable the option ROM functions of the one or more PIDI Express devices. The order in which the option ROM programs of the at least one peripheral device interconnect express device are loaded into the option ROM base address register of the at least one upstream port is configurable, and the loading order is determined based on at least one device type. The header identifier of the option ROM program of each of the at least one peripheral device interconnect express devices loaded into the option ROM base address register of each of the at least one upstream port is used to indicate whether it is the last option ROM program. The enabling method further includes: In response to the option ROM functions of the one or more peripheral device interconnect express devices being turned off and the option ROM function of at least one other peripheral device interconnect express device being turned on, the host is restarted, then, the option ROM program of the at least one other peripheral device interconnect express device is read from the option ROM base address register of each of the at least one upstream port, and then, the read option ROM program of the at least one other peripheral device interconnect express device is loaded into the host memory to enable the option ROM function of the at least one other peripheral device interconnect express device.
2. The enabling method according to claim 1, characterized in that: The data processing unit is further used for simulating and generating at least one setting register, wherein the at least one setting register is used for indicating whether the option read-only memory program of the preceding peripheral device interconnect express device in the at least one peripheral device interconnect express device has been loaded completely, so as to start loading the option read-only memory program of the subsequent peripheral device interconnect express device in the at least one peripheral device interconnect express device.
3. The enabling method according to claim 1, characterized in that: The option ROM base address register of each of the at least one upstream port comprises a fixed initial address, and loading starts from the fixed initial address until the header identifier indicates that it is the last option ROM program.
4. The enabling method according to claim 1, characterized in that: The enabling of the option read-only memory functions of the one or more peripheral device interconnect express devices is determined based on user customization requirements.
5. The enabling method according to claim 1, characterized in that: The different device types of the at least one peripheral device interconnect express device have different option ROM programs.
6. The enabling method according to claim 1, characterized in that: The one or more peripheral device interconnect express devices include a first peripheral device interconnect express device, and the enabling method further includes: A first option ROM program associated with the first peripheral device interconnect express device is read from an option ROM base address register of the first peripheral device interconnect express device, and then the first option ROM program is loaded into the host memory to enable a first option ROM function of the first peripheral device interconnect express device corresponding to the first option ROM program.
7. The enabling method according to claim 6, characterized in that: The first option ROM function is necessary for starting up the first PDI Express device and needs to be run during a startup phase of a basic input / output system.
8. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 7.
