Method, device, equipment and storage medium for enumerating devices of PCIe interface

By detecting the physical link status during the startup phase of the PCIe device and keeping the enumeration resources from being released, combined with the use of preset signals, the problem of PCIe interface device enumeration's strong dependence on the host architecture is solved, achieving efficient and flexible The enumeration process reduces manual debugging costs and timing control requirements.

CN112835839BActive Publication Date: 2024-10-18FIBOCOM WIRELESS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110155005.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-04
Publication Date
2024-10-18
Estimated Expiration
2041-02-04

AI Technical Summary

Technical Problem

PCIe interface device enumeration is highly dependent on different host architectures, resulting in high manual debugging costs and low efficiency. In addition, the device enumeration timing requirements in the existing technology are strict, and it is easy to miss the enumeration, resulting in the release of resources, and the enumeration cannot be completed.

Method used

The PCIe device detects the physical link status during the boot kernel phase. When the connection is not established, it uses the preset enumeration signal to keep the device enumeration resources from being released, and continues to complete the boot. After detecting the preset enumeration signal sent by the host, Complete the enumeration with the host side, and output the preset enumeration preparation signal to complete the synchronous enumeration at any time.

Benefits of technology

It avoids strong dependence on different host architectures, reduces timing control requirements, reduces manual debugging costs, improves enumeration efficiency, and ensures the success rate of enumeration actions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112835839B_ABST
    Figure CN112835839B_ABST
Patent Text Reader

Abstract

The present invention discloses a device enumeration method and apparatus for a PCIe interface, a computer device and a computer-readable storage medium. The method comprises: a PCIe device end detects a physical link state of a PCIe interface at a kernel stage of startup; when the physical link state is that a connection is not established, a preset enumeration signal is detected through the PCIe interface and device enumeration resources are kept not released, and the startup of the PCIe device end is continued; after detecting a preset enumeration signal sent by a PCIe host end, the device enumeration resources are used to complete the enumeration of the PCIe interface with the PCIe host end; the present invention avoids the situation that the enumeration of the PCIe device end is missed and the enumeration cannot be completed; and by detecting the preset enumeration signal, the PCIe host end can complete the synchronous enumeration at any time, thereby avoiding the strong dependence on different host architectures and reducing the timing control requirements for the PCIe host end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method and apparatus for enumerating devices of a PCIe interface, a computer device, and a computer-readable storage medium. Background Art

[0002] With the development of science and technology in modern society, high-speed communication technology between computers (PCs) has been widely used. The PCIe (peripheral component interconnect express, a high-speed serial computer expansion bus standard) interface was first used as an expansion slot interface on PCs to transmit data between high-speed interface devices. With the advent of the 5G era, in order to better meet the network's demand for large data transmission, 5G communication modules need to use the PCIe interface for data transmission, and the hardware characteristics of the PCIe interface determine the characteristics of its high-speed communication interface.

[0003] The hardware characteristics of the PCIe interface also determine the specific conditions required for its enumeration adaptation. Since the PCIe interface is an end-to-end connection topology mode, there must first be a peer PCIe device; secondly, the two PCIe devices need to have their own interface working modes, one PCIe device as the PCIe host end (Root Complex), and the other PCIe device as the PCIe device end (Endpoint); finally, the enumeration of the two PCIe devices requires synchronous timing control requirements.

[0004] At present, when the PCIe device is docked and adapted to various types of PCIe hosts, the PCIe host needs to initiate a specific enumeration timing control signal; that is, when the PCIe device is adapted to the PCIe host, it will adjust the timing matching problem according to the host architecture type of the specific PCIe host. Taking the Qualcomm platform 5G M.2 package module (a 5G communication module) as an example of the PCIe device, when the PCIe host type is an x86 architecture with BIOS control, the PCIe device needs to adapt to the bus device scanning action of the BIOS of the PCIe host; when the PCIe host type is an embedded ARM architecture, the PCIe device needs to adapt to the bus device scanning action when the kernel driver of the PCIe host is loaded; when the PCIe host is some special host, its startup has multiple stages of segmented loading, and the power-on and port enumeration of the PCIe interface are not in the same stage, and enumeration is performed only when used on demand.

[0005] In the prior art, the device enumeration of the PCIE interface is as follows: Figure 1As shown, for each specific host, the PCIe device side is required to complete the device enumeration during the power-on process; if the enumeration of the PCIe device side is missed, the corresponding resources (such as clock resources) are released, and the enumeration can no longer be completed, which places high requirements on the timing of the PCIe host side; and each time a different type of PCIe host side is adapted, tedious and time-consuming debugging is required, and the timing of each debugging cannot be fully compatible with the application of different scenarios of different PCIe host sides, which greatly increases the labor cost and is inefficient.

[0006] Therefore, how to avoid the strong dependence of device enumeration of PCIe interface on different host architectures, reduce the manual debugging cost for different hosts, and improve enumeration efficiency are problems that need to be solved urgently. Summary of the invention

[0007] The purpose of the present invention is to provide a device enumeration method, apparatus, computer equipment and computer-readable storage medium for a PCIe interface, so as to avoid strong dependence on different host architectures, reduce manual debugging costs and improve enumeration efficiency.

[0008] In order to solve the above technical problems, the present invention provides a device enumeration method of a PCIe interface, comprising:

[0009] The PCIe device detects the physical link status of the PCIe interface during the kernel phase of booting.

[0010] When the physical link state is that the connection is not established, detecting a preset enumeration signal through the PCIe interface and keeping the device enumeration resources from being released, and continuing to complete the power-on startup of the PCIe device end;

[0011] After detecting the preset enumeration signal sent by the PCIe host, the device enumeration resource is used to complete the enumeration of the PCIe interface with the PCIe host.

[0012] Optionally, the PCIe device end further includes, before detecting the physical link status of the PCIe interface during the kernel phase of booting up:

[0013] The PCIe device side configures the device tree and selects the PCIe device side mode during the preset startup phase.

[0014] Optionally, when the PCIe device end is specifically a Qualcomm 5G M.2 packaging module, the preset power-on startup phase is specifically the SBL phase of power-on startup.

[0015] Optionally, the method further includes:

[0016] When the preset enumeration signal is not detected, detecting the physical link state at a preset time interval;

[0017] When the physical link state is that the connection is not established, the device enumeration resource is kept not released, and the preset enumeration signal is detected through the PCIe interface.

[0018] Optionally, the method further includes:

[0019] When the physical link state is that the connection is not established, a preset enumeration preparation signal is output through the PCIe interface.

[0020] Optionally, the PCIe interface outputs a preset enumeration preparation signal, including:

[0021] The preset signal of the PCIe interface is adjusted to a low level; wherein the preset enumeration preparation signal is the preset signal of the low level.

[0022] Optionally, when the PCIe device end is specifically a Qualcomm 5G M.2 packaging module, the preset signal is specifically a PWAKE# signal, and the preset enumeration signal is specifically a PERST# interrupt signal.

[0023] The present invention also provides a device enumeration device for a PCIe interface, which is applied to a PCIe device end and includes:

[0024] The link detection unit is used to detect the physical link status of the PCIe interface during the kernel stage of booting;

[0025] A signal detection unit, configured to detect a preset enumeration signal through the PCIe interface and keep the device enumeration resources from being released when the physical link state is that the connection is not established, and continue to complete the startup of the PCIe device end;

[0026] The enumeration unit is used to complete the enumeration of the PCIe interface with the PCIe host by using the device enumeration resource after detecting the preset enumeration signal sent by the PCIe host.

[0027] The present invention also provides a computer device, comprising:

[0028] Memory for storing computer programs;

[0029] A processor is used to implement the steps of the device enumeration method of the PCIe interface as described above when executing the computer program.

[0030] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the device enumeration method of the PCIe interface as described above are implemented.

[0031] A device enumeration method for a PCIe interface provided by the present invention comprises: a PCIe device end detects a physical link state of a PCIe interface at a kernel stage of startup; when the physical link state is that a connection is not established, a preset enumeration signal is detected through the PCIe interface and device enumeration resources are kept not released, and the startup of the PCIe device end is continued; after detecting a preset enumeration signal sent by a PCIe host end, the device enumeration resources are used to complete the enumeration of the PCIe interface with the PCIe host end;

[0032] It can be seen that when the present invention detects that the physical link state of the PCIe interface is not connected during the kernel stage of the PCIe device end startup, the preset enumeration signal is detected through the PCIe interface and the device enumeration resources are kept not released, thereby avoiding the situation where the enumeration of the PCIe device end power-on is missed and the enumeration cannot be completed; and after detecting the preset enumeration signal sent by the PCIe host end, the device enumeration resources are used to complete the enumeration of the PCIe interface with the PCIe host end, so that the PCIe host end can complete the synchronous enumeration action at any time by initiating the preset enumeration signal, avoiding the strong dependence on different host architectures, reducing the timing control requirements for the PCIe host end, reducing the manual debugging cost, and improving the enumeration efficiency. In addition, the present invention also provides a device enumeration device, computer equipment and computer-readable storage medium of a PCIe interface, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0034] Figure 1 A schematic diagram of a device enumeration method for a PCIe interface in the prior art;

[0035] Figure 2 A flowchart of a method for enumerating devices on a PCIe interface provided by an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of a device enumeration method for a PCIe interface provided by an embodiment of the present invention;

[0037] Figure 4 A flowchart of another PCIe interface device enumeration method provided by an embodiment of the present invention;

[0038] Figure 5 A schematic diagram of a flow chart of another method for enumerating devices on a PCIe interface provided by an embodiment of the present invention;

[0039] Figure 6 A structural block diagram of a device enumeration apparatus for a PCIe interface provided by an embodiment of the present invention;

[0040] Figure 7 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] Please refer to Figure 2 , Figure 2 A flowchart of a method for enumerating a device on a PCIe interface provided by an embodiment of the present invention. The method may include:

[0043] Step 101: The PCIe device detects the physical link status of the PCIe interface during the kernel phase of booting.

[0044] Among them, the PCIe device end in this embodiment can be a PCIe device with a PCIe interface (such as a 5G communication module), and when the PCIe device is connected to another PCIe device through the PCIe interface, the PCIe device acts as a PCIe device end, and the other connected PCIe device acts as a PCIe host end.

[0045] Specifically, the specific device type of the PCIe device end in this step can be set by the designer according to practical scenarios and user needs. For example, the PCIe device end can be a 5G communication module, such as a Qualcomm 5G M.2 packaging module, that is, the Qualcomm 5G M.2 packaging module can be used as a PCIe device end to complete the enumeration of the PCIe interface with the PCIe host end.

[0046] It can be understood that the purpose of this step is to determine whether the physical link of the PCIe interface has established a connection (Linkup), that is, whether the enumeration of the PCIe device has been completed, by detecting the physical link status of the PCIe interface of the PCIe device side during the kernel stage of booting up the PCIe device side; thereby, when the physical link status is established, it is determined that the timing of the PCIe host side has adapted to identify the PCIe information of the PCIe device side and the enumeration of the PCIe device has been completed; when the physical link status is not established, it is determined that the timing of the PCIe host side has not adapted to identify the PCIe information of the PCIe device side.

[0047] Specifically, in this step, when the PCIe device side is booted to the kernel stage with the official software version, it can use the driver set in the kernel (such as the PCIe driver) to detect the physical link status of the current PCIe interface; if the physical link status is to establish a connection (Linkup), that is, the enumeration of the PCIe device has occurred, then continue to complete the booting of the PCIe device side; if the physical link status is that the connection is not established, you can go to step 102.

[0048] It should be noted that the device enumeration method of the PCIe interface provided in this embodiment can be applied to the PCIe device side, that is, the PCIe device as the PCIe device side can execute the method provided in this embodiment, establish a physical link connection of the PCIe interface with another PCIe device as the PCIe host side, and complete the enumeration of the PCIe interface. Correspondingly, before this step, the PCIe device can also determine the PICe interface working mode; when the PICe interface working mode is the PCIe device side mode, enter this step; wherein the PICe interface working mode can be the PCIe device side mode or the PCIe host mode;

[0049] That is to say, the PCIe device can determine whether it is a PCIe device end or a PCIe host end by determining the PICe interface working mode. Specifically, the specific method for the PCIe device to determine the PICe interface working mode can be set by the designer according to the practical scenario and user needs, such as being implemented in the same or similar manner as the PICe interface working mode determination method in the prior art; in order to further facilitate the PCIe device to determine the PICe interface working mode, the PCIe device as the PCIe device end in this embodiment can configure the device tree and select the PCIe device end (Endpoint) mode in a preset power-on startup phase (such as an SBL phase) before the kernel phase of power-on startup; by adding the device tree configuration process in the preset power-on startup phase, the PCIe device as the PCIe device end can directly determine itself as a PCIe device end.

[0050] Step 102: When the physical link state is that the connection is not established, a preset enumeration signal is detected through the PCIe interface, the device enumeration resources are kept not released, and the power-on startup of the PCIe device side is continued.

[0051] It can be understood that the purpose of this step is that when the physical link state of the PCIe interface of the PCIe device side is that the connection is not established, that is, when no valid PCIe device enumeration is found, the PCIe host side determines whether it is currently necessary to perform PCIe device enumeration by detecting the preset enumeration signal of the PCIe interface; by keeping the device enumeration resources (such as clock resources) from being released, the enumeration can be completed quickly when the preset enumeration signal is detected subsequently, thereby avoiding the situation in the prior art that the PCIe host side misses the enumeration of the PCIe device side when it is powered on and cannot complete the enumeration; and by continuing to complete the power-on startup of the PCIe device side, the normal completion of the power-on startup of the PCIe device side is guaranteed, avoiding the dependence of the PCIe device side on completing the enumeration of the PCIe interface during the power-on phase, so that the PCIe device side can still enumerate the PCIe interface after the power-on is completed.

[0052] Specifically, the specific method in which the PCIe device side detects the preset enumeration signal through the PCIe interface in this step, that is, the specific signal setting of the preset enumeration signal of the PCIe interface, can be set by the designer according to practical scenarios and user needs. For example, when the PCIe device side is a Qualcomm 5G M.2 packaging module, the preset enumeration signal can be specifically a PERST# interrupt signal, that is, the PCIe device side can register the PERST# interrupt interface of the PCIe interface, and when the PERST# interrupt signal sent by the PCIe host side through the PCIe interface is detected, it is determined that the PCIe host side needs to enumerate the PCIe device.

[0053] Correspondingly, in the case where the preset enumeration signal sent by the PCIe host is not detected in this step, the preset enumeration signal can be detected again through the PCIe interface after waiting for a preset time, such as detecting the physical link state of the PCIe interface at a preset time interval; when the physical link state is that the connection is not established, the device enumeration resources are kept from being released, and the preset enumeration signal is detected through the PCIe interface, so as to perform a timed detection of the preset enumeration signal by periodically querying the physical link state of the PCIe interface; or the preset enumeration signal is directly detected through the PCIe interface at a preset time interval. This embodiment does not impose any restrictions on this.

[0054] Furthermore, the method provided in this embodiment may also include outputting a preset enumeration ready signal through the PCIe interface when the physical link state is that the connection is not established, so as to notify the PCIe host end of the information that the PCIe interface of the PCIe device end is ready by outputting the preset enumeration ready signal to the PCIe host end, and reminding the PCIe host end that it can send the preset enumeration signal at any time to complete the synchronous enumeration action.

[0055] Step 103: After detecting the preset enumeration signal sent by the PCIe host, the device enumeration resource is used to complete the enumeration of the PCIe interface with the PCIe host.

[0056] It can be understood that in this step, after detecting the preset enumeration signal sent by the PCIe host, the PCIe device side can determine that the PCIe host side currently needs to enumerate the PCIe device, so that the device enumeration resources can be used to train the physical link of the PCIe interface. When the training is completed, the enumeration of the PCIe interface of the PCIe host side is completed.

[0057] Correspondingly, such as Figure 3 As shown, the PCIe host side (PCIe host A or PCIe host B) can initiate a preset enumeration signal through the PCIe interface whenever the PCIe interface needs to be used, and use the enumerated host timing adaptation to identify the PCIe information of the PCIe device side to complete the enumeration of the PCIe device, so that PCIe hosts of different architecture types only need to ensure the synchronous adaptation of the kernel driver enumeration of the PCIe device side. There are no strict requirements on the timing of the PCIe host side at other times, that is, the enumeration can be completed during the PCIe host side startup phase, and it can also be completed when the PCIe host side needs to use the PCIe interface, which increases flexibility.

[0058] Specifically, in this embodiment, the PCIe host side can initiate a preset enumeration signal through the PCIe interface to trigger the enumeration of the PCIe interface after determining that the PCIe device side has completed the enumeration preparation, so as to ensure the enumeration success rate of the PCIe interface. For example, the PCIe host side can initiate a preset enumeration signal through the PCIe interface to trigger the enumeration of the PCIe interface after receiving a preset enumeration preparation signal through the PCIe interface or after a certain period of time after startup.

[0059] In the present embodiment, when the embodiment of the present invention detects that the physical link state of the PCIe interface is not connected during the kernel stage of power-on of the PCIe device end, the preset enumeration signal is detected through the PCIe interface and the device enumeration resources are kept not released, thereby avoiding the situation where the enumeration of the PCIe device end is missed and the enumeration cannot be completed; and after detecting the preset enumeration signal sent by the PCIe host end, the device enumeration resources are used to complete the enumeration of the PCIe interface with the PCIe host end, so that the PCIe host end can complete the synchronous enumeration action at any time by initiating the preset enumeration signal, thereby avoiding the strong dependence on different host architectures, reducing the timing control requirements for the PCIe host end, reducing the manual debugging cost, and improving the enumeration efficiency.

[0060] Please refer to Figure 4 , Figure 4 A flowchart of another PCIe interface device enumeration method provided by an embodiment of the present invention. The method may include:

[0061] Step 201: During a preset startup phase, the PCIe device configures a device tree and selects a PCIe device mode.

[0062] The preset startup phase in this step may be a startup phase before the kernel phase in the startup process of the pre-set PCIe device end.

[0063] Specifically, the specific settings of the preset power-on startup stage in this step can be set by the designer according to practical scenarios and user needs. For example, when the PCIe device end is a Qualcomm 5G M.2 package module, the preset power-on startup stage can be the SBL (Second BootLoader stage) stage of the power-on startup of the Qualcomm 5G M.2 package module. When the Qualcomm 5G M.2 package module is powered on with the official software version, the device tree can be configured in the SBL stage, and the PCIe device end (Endpoint) mode can be selected; Figure 5 As shown, this embodiment enables the Qualcomm 5G M.2 packaging module to determine that it can serve as a PCIe device end by adding a configuration device tree process in the SBL stage of the Qualcomm 5G M.2 packaging module.

[0064] Step 202: During the kernel phase of booting up the computer, the physical link status of the PCIe interface is detected.

[0065] Specifically, in this step, when the PCIe device side is powered on to the kernel stage, the driver set in the kernel (such as the PCIe driver) can be used to detect the physical link status of the current PCIe interface; if the physical link status of the PCIe interface is to establish a connection (Linkup), it can be determined that the enumeration of the PCIe device has occurred, that is, the host timing of the PCIe host side has been adapted to identify the PCIe information of the PCIe device side, such as the PCIe information of the Qualcomm 5G M.2 packaging module as the PCIe device side.

[0066] Step 203: When the physical link state is that the connection is not established, a preset enumeration preparation signal is output through the PCIe interface.

[0067] It can be understood that the purpose of this step is that when the PCIe device detects that the physical link state of the current PCIe interface is not connected, that is, no valid PCIe device enumeration is found, it controls the output of the preset enumeration preparation signal of the PCIe interface to trigger the PCIe host to prompt the PCIe device side that the PCIe device side is ready and waits for the PCIe host side to be ready before initiating the preset enumeration signal.

[0068] Specifically, the specific method for the PCIe device end to output the preset enumeration preparation signal through the PCIe interface in this step can be set by the designer according to practical scenarios and user needs, such as the preset enumeration preparation signal can be a preset signal of the PCIe interface that is pulled down or raised to often trigger the PCIe host end. For example, the PCIe device end can adjust the preset signal of the PCIe interface to a low level, that is, pull down the preset signal to often trigger the PCIe host end; wherein the preset enumeration preparation signal is a low-level preset signal; correspondingly, the PCIe host standby end can determine that the PCIe device end has completed the enumeration preparation when the low-level preset signal is detected through the PCIe interface. The preset enumeration preparation signal can also be a preset interrupt signal of the PCIe interface. As long as the PCIe device end can output the preset enumeration preparation signal to the PCIe host end through the PCIe interface, triggering the PCIe host end to prompt that the PCIe device end is ready, this embodiment does not impose any restrictions on this.

[0069] Specifically, when the PCIe device is a Qualcomm 5G M.2 package module, Figure 5 As shown, the above-mentioned preset signal can be specifically the PWAKE# signal of the PCIe interface. In this step, the core of the Qualcomm 5G M.2 packaging module can drive and control the PWAKE# signal to be pulled low, so that after the PCIe host detects the low PWAKE# signal through the PCIe interface, it can be determined that the Qualcomm 5G M.2 packaging module is ready.

[0070] Step 204: Detect a preset enumeration signal through the PCIe interface and keep the device enumeration resources from being released, and continue to complete the startup of the PCIe device end.

[0071] Step 205: After detecting the preset enumeration signal sent by the PCIe host, the device enumeration resource is used to complete the enumeration of the PCIe interface with the PCIe host.

[0072] Specifically, step 204 and step 205 are similar to step 102 and step 103, and are not described in detail here.

[0073] Correspondingly, when the preset enumeration preparation signal is a preset signal for always triggering the PCIe host end to pull down or pull up the PCIe interface, in this step, the PCIe device end can also stop outputting the preset enumeration preparation signal through the PCIe interface, such as Figure 5 As shown, when the preset enumeration preparation signal is a low PWAKE# signal (ie, the preset signal), the PCIe device side can detect the PERST# interrupt signal (ie, the preset enumeration signal) triggered by the PCIe host side and control the high PWAKE# signal.

[0074] Step 206: When the preset enumeration signal is not detected, the physical link status is detected at a preset time interval.

[0075] It can be understood that in this embodiment, when the preset enumeration signal is not detected, the physical link status of the PCIe interface is detected at preset time intervals, thereby periodically detecting the preset enumeration signal of the PCIe interface when the physical link status is not connected, and continuing to detect the preset enumeration signal of the PCIe interface until the preset enumeration signal sent by the PCIe host is detected to enter step 205, thereby completing the enumeration of the PCIe interface.

[0076] Specifically, when the PCIe device is a Qualcomm 5G M.2 package module, Figure 5 As shown, the Qualcomm 5G M.2 packaging module can periodically detect the physical link status of the PCIe interface and wait for the PERST# interrupt signal triggered by the PCIe host when the PERST# interrupt signal (i.e., the preset enumeration signal) triggered by the PCIe host is not detected.

[0077] Step 207: When the physical link state is that the connection is not established, the device enumeration resources are kept not released, a preset enumeration preparation signal is output through the PCIe interface, and the preset enumeration signal is detected.

[0078] It can be understood that this step can be that when the PCIe device detects the physical link of the PCIe interface at preset time intervals, each time it detects that the physical link status is not connected, it continues to keep the device enumeration resources from being released, and detects the preset enumeration signal through the PCIe interface, waiting for the PERST# interrupt signal triggered by the PCIe host end, so that after detecting the preset enumeration signal, it enters step 205 to complete the enumeration of the PCIe interface.

[0079] In this embodiment, the embodiment of the present invention outputs a preset enumeration preparation signal through the PCIe interface when the physical link state is that the connection is not established, so that the PCIe host side can understand the information that the PCIe interface of the PCIe device side is ready through the preset enumeration preparation signal, and ensure that the PCIe host side initiates the preset enumeration signal at any time thereafter to complete the synchronous enumeration action, thereby ensuring the enumeration success rate of the PCIe interface.

[0080] Corresponding to the above method embodiment, an embodiment of the present invention further provides a device enumeration apparatus for a PCIe interface. The device enumeration apparatus for a PCIe interface described below and the device enumeration method for a PCIe interface described above can refer to each other.

[0081] Please refer to Figure 6 , Figure 6 This is a structural block diagram of a device enumeration apparatus for a PCIe interface provided by an embodiment of the present invention. The apparatus is applied to a PCIe device end and may include:

[0082] The link detection unit 10 is used to detect the physical link status of the PCIe interface during the kernel stage of booting;

[0083] The signal detection unit 20 is used to detect the preset enumeration signal through the PCIe interface and keep the device enumeration resources from being released when the physical link state is that the connection is not established, and continue to complete the startup of the PCIe device end;

[0084] The enumeration unit 30 is used to complete the enumeration of the PCIe interface with the PCIe host by using the device enumeration resource after detecting the preset enumeration signal sent by the PCIe host.

[0085] Optionally, the device may further include:

[0086] The device tree configuration unit is used to configure the device tree and select the PCIe device side mode in the preset boot phase before the kernel phase.

[0087] Optionally, when the PCIe device end is specifically a Qualcomm 5G M.2 packaging module, the preset power-on startup phase is specifically an SBL phase of power-on startup.

[0088] Optionally, the device may further include:

[0089] A timing detection unit, configured to detect the physical link status at a preset time interval when no preset enumeration signal is detected;

[0090] The signal waiting unit is used to keep the device enumeration resources from being released when the physical link state is that the connection is not established, and detect the preset enumeration signal through the PCIe interface.

[0091] Optionally, the device may further include:

[0092] The signal output unit is used to output a preset enumeration preparation signal through the PCIe interface when the physical link state is that the connection is not established.

[0093] Optionally, the signal output unit may be specifically configured to adjust a preset signal of the PCIe interface to a low level; wherein the preset enumeration preparation signal is a preset signal of a low level.

[0094] Optionally, when the PCIe device end is specifically a Qualcomm 5G M.2 packaging module, the preset signal is specifically a PWAKE# signal, and the preset enumeration signal is specifically a PERST# interrupt signal.

[0095] In this embodiment, the embodiment of the present invention uses the signal detection unit 20 to detect that the physical link state of the PCIe interface is not connected during the kernel stage of the power-on startup of the PCIe device end. The preset enumeration signal is detected through the PCIe interface and the device enumeration resources are kept not released, thereby avoiding the situation where the enumeration of the PCIe device end is missed and the enumeration cannot be completed; and after the preset enumeration signal sent by the PCIe host end is detected by the enumeration unit 30, the device enumeration resources are used to complete the enumeration of the PCIe interface with the PCIe host end, so that the PCIe host end can complete the synchronous enumeration action at any time by initiating the preset enumeration signal, avoiding the strong dependence on different host architectures, reducing the timing control requirements for the PCIe host end, reducing the manual debugging cost, and improving the enumeration efficiency.

[0096] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer device. The computer device described below and the device enumeration method of the PCIe interface described above can refer to each other.

[0097] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The computer device may include:

[0098] A memory D1, for storing computer programs;

[0099] The processor D2 is used to implement the steps of the device enumeration method of the PCIe interface provided by the above method embodiment when executing a computer program.

[0100] That is to say, the device enumeration method of the PCIe interface provided in the above method embodiment can be applied to the computer device provided in this embodiment; accordingly, the computer device provided in this embodiment can be specifically a module (or module) that can be used as a PCIe device end to implement the device enumeration function of the PCIe interface or a terminal device containing a module, etc. The terminal device can be specifically a mobile terminal and / or a smart device, etc. The mobile terminal can be specifically at least one of a mobile phone, a tablet computer and a laptop computer, etc. The smart device can be specifically at least one of a smart watch, a smart refrigerator, a smart speaker, a smart washing machine and a smart TV, etc. The module can be specifically at least one of a 2G communication module, a 3G communication module, a 4G communication module and a 5G communication module (such as a Qualcomm 5G M.2 packaging module).

[0101] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium described below and the device enumeration method of the PCIe interface described above can refer to each other.

[0102] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the device enumeration method for a PCIe interface of the above method embodiment.

[0103] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or any other computer-readable storage medium that can store program codes.

[0104] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device, computer device and computer-readable storage medium disclosed in the embodiment, since they correspond to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0105] The above is a detailed introduction to a device enumeration method, apparatus, computer device and computer-readable storage medium for a PCIe interface provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A method for enumerating devices of a PCIe interface, characterized in that: include: During the kernel phase of booting, the PCIe device uses the driver set in the kernel to detect the physical link status of the PCIe interface; When the physical link state is that the connection is not established, detecting a preset enumeration signal through the PCIe interface and keeping the device enumeration resources from being released, and continuing to complete the power-on startup of the PCIe device end; After detecting the preset enumeration signal sent by the PCIe host, using the device enumeration resource to complete the enumeration of the PCIe interface with the PCIe host; Also includes: When the preset enumeration signal is not detected, detecting the physical link state at a preset time interval; When the physical link state is that the connection is not established, the device enumeration resource is kept not released, and the preset enumeration signal is detected through the PCIe interface.

2. The device enumeration method of the PCIe interface according to claim 1, characterized in that: The PCIe device end, at the kernel stage of booting up, before detecting the physical link status of the PCIe interface, further includes: The PCIe device side configures the device tree and selects the PCIe device side mode during the preset startup phase.

3. The device enumeration method of the PCIe interface according to claim 2, characterized in that: When the PCIe device end is specifically a Qualcomm 5G M.2 packaging module, the preset power-on startup phase is specifically the SBL phase of power-on startup.

4. The device enumeration method of the PCIe interface according to any one of claims 1 to 3, characterized in that: Also includes: When the physical link state is that the connection is not established, a preset enumeration preparation signal is output through the PCIe interface.

5. The device enumeration method of the PCIe interface according to claim 4, characterized in that: The PCIe interface outputs a preset enumeration preparation signal, including: The preset signal of the PCIe interface is adjusted to a low level; wherein the preset enumeration preparation signal is the preset signal of the low level.

6. The device enumeration method of the PCIe interface according to claim 5, characterized in that: When the PCIe device end is specifically a Qualcomm 5G M.2 packaging module, the preset signal is specifically a PWAKE# signal, and the preset enumeration signal is specifically a PERST# interrupt signal.

7. A device enumeration apparatus for a PCIe interface, characterized in that: Applied to PCIe device side, including: The link detection unit is used to detect the physical link status of the PCIe interface by using the driver set in the kernel during the kernel stage of booting; A signal detection unit, configured to detect a preset enumeration signal through the PCIe interface and keep the device enumeration resources from being released when the physical link state is that the connection is not established, and continue to complete the startup of the PCIe device end; An enumeration unit, configured to complete the enumeration of the PCIe interface with the PCIe host by using the device enumeration resource after detecting the preset enumeration signal sent by the PCIe host; It also includes: a timing detection unit, configured to detect the physical link state at a preset time interval when the preset enumeration signal is not detected; The signal waiting unit is used to keep the device enumeration resources from being released when the physical link state is that the connection is not established, and detect the preset enumeration signal through the PCIe interface.

8. A computer device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the device enumeration method for the PCIe interface as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device enumeration method of the PCIe interface according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Processing system and processing method

    CN106326160A