Link training method and electronic equipment
By determining target equalization parameters that match hardware characteristics in electronic devices for link training, the problems of training failure and excessive training time in the prior art are solved, and a more efficient link training effect is achieved.
Patent Information
- Application Number
- CN202510900885.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-03
AI Technical Summary
In the prior art, when an electronic device is started up, fixed initial equalization parameters are used for link training, which may cause training failure or take too long and fail to adapt to the characteristics of the current communication link.
By responding to the target instruction, the target equalization parameter is determined from the equalization parameters related to the target hardware characteristics of the electronic device, and the communication link training is performed based on the parameter, including obtaining characteristic information and storing the corresponding relationship to select the matching equalization parameter.
The success probability of link training is improved, the time of the training process is shortened, the characteristics of the current communication link are adapted, and the efficiency of the communication link is improved.
Smart Images

Figure CN120743816A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of link training, and in particular to a link training method and electronic equipment. Background Art
[0002] An electronic device includes multiple components connected via a communication link. When the device is started, these components will perform link training on the connected communication link to determine equalization parameters suitable for the current communication link, and then communicate according to the determined equalization parameters.
[0003] In related technologies, components involved in link training have pre-written and fixed initial equalization parameters. Each time link training begins, the components perform training based on these initial equalization parameters. This approach suffers from the problem that the initial training parameters may not be appropriate for the current communication link, making training prone to failure or excessive training time. Summary of the Invention
[0004] To this end, this application discloses the following technical solutions:
[0005] A first aspect of the present application provides a link training method, the method comprising:
[0006] In response to a target instruction, determining a target equalization parameter from at least one equalization parameter; the at least one equalization parameter includes an equalization parameter related to a target hardware characteristic of the electronic device, the target instruction indicating the initiation of link training or the failure of link training;
[0007] A communication link between a first component and a second component is trained based on the target equalization parameter; the electronic device includes the first component and the second component.
[0008] Optionally, determining a target equalization parameter from at least one equalization parameter includes:
[0009] Obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device;
[0010] determining an equalization parameter among at least one equalization parameter that matches the characteristic information as the target equalization parameter;
[0011] The electronic device stores a first correspondence between target hardware and equalization parameters under different characteristics.
[0012] Optionally, obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device includes:
[0013] At least one of a first characteristic parameter, a second characteristic parameter, and a third characteristic parameter is read from a memory of an electronic device; the first characteristic parameter characterizes the link length of the communication link, the second characteristic parameter characterizes the mainboard material, and the third characteristic parameter characterizes the quality of a slot for communication on the first component or the second component.
[0014] The link length, motherboard material and / or slot quality have a corresponding relationship with the equalization parameter.
[0015] Optionally, the relationship between link length, motherboard material, and / or slot quality and equalization parameters includes:
[0016] Link length is positively correlated with physical loss;
[0017] The motherboard material grade is negatively correlated with physical loss;
[0018] Slot quality is negatively correlated with physical loss;
[0019] Physical losses are positively correlated with the corresponding target balancing parameters.
[0020] Optionally, determining a target equalization parameter from at least one equalization parameter includes:
[0021] Determine the target hardware's physical loss of the signal;
[0022] Determining the target equalization parameter based on the physical loss; processing a signal with the target equalization parameter to compensate for the physical loss;
[0023] The electronic device stores a second correspondence between physical signal loss and equalization parameters of target hardware under different characteristics.
[0024] Optionally, determining the physical loss of the signal by the target hardware includes:
[0025] The physical loss of the signal by the target hardware is determined according to feedback information of the second component obtained through interaction between the first component and the second component.
[0026] Optionally, the feedback information includes at least one of the following:
[0027] detection information indicating whether a communication link connection between the first component and the second component is available;
[0028] rate information indicating a transmission rate of a communication link between the first component and the second component;
[0029] Status information indicating a component status of the second component.
[0030] A second aspect of the present application provides an electronic device, the electronic device comprising a first component, a second component, and target hardware;
[0031] The target hardware characteristic satisfies a first condition, where the first condition indicates that the characteristic does not change or that the characteristic changes but does not affect a link training result between the first component and the second component.
[0032] at least one equalization parameter is stored in the first firmware of the first component and / or in the firmware of the second component;
[0033] The at least one equalization parameter is related to a target hardware characteristic of the target hardware.
[0034] Optionally, it further includes a first controller;
[0035] The storage space corresponding to the first controller stores a first correspondence between target hardware and equalization parameters under different characteristics, or stores a second correspondence between physical loss of a signal by the target hardware and equalization parameters under different characteristics;
[0036] The first controller is configured to, upon obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device, determine an equalization parameter that matches the characteristic information according to the first corresponding relationship as the target equalization parameter;
[0037] Alternatively, the first controller is configured to, when determining the physical loss of the target hardware for the signal, determine an equalization parameter that matches the physical loss according to the second corresponding relationship as the target equalization parameter.
[0038] Optionally, a second controller is also included;
[0039] In a case where the link between the first component and the second component is trained by the second controller, the storage space corresponding to the first controller further stores at least one equalization parameter;
[0040] The first controller is configured to write the target equalization parameter into the second controller, so that the second controller performs link training based on the target equalization parameter. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0042] Figure 1This is a flow chart of a link training method provided by an embodiment of the present application;
[0043] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0044] Figure 3 is a structural diagram of another electronic device provided in an embodiment of the present application;
[0045] Figure 4 This is a structural diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] This embodiment provides a link training method, see Figure 1 , the method includes the following steps.
[0048] S101 , in response to a target instruction, determining a target equalization parameter from at least one equalization parameter; the at least one equalization parameter includes an equalization parameter related to a target hardware characteristic of the electronic device, and the target instruction indicates starting link training or link training failure.
[0049] The method of this embodiment can be executed by either the first component or the second component at either end of any communication link in the electronic device, or can be executed by the first controller or the second controller in the electronic device to which the first component or the second component belongs.
[0050] The first component and the second component may communicate with each other via a high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) or other communication standards.
[0051] The first component may be a host component in the electronic device, such as a central processing unit (CPU). In this case, the second component may be an end device component in the electronic device, such as a solid state drive.
[0052] Alternatively, the first component may be a terminal-type component, and the second component may be a host-type component.
[0053] The communication link between the first component and the second component is equivalent to various signal transmission lines connecting two components in an electronic device.
[0054] like Figure 4 As shown, the second controller is located between the two components and is connected to the two components respectively, and is used to process the signal sent by any component, thereby compensating for the loss of the signal when it is transmitted on the communication link, so that the signal received by the component at the other end meets certain quality requirements, avoiding the signal quality being too poor and the inability to correctly identify the signal.
[0055] The second controller can be of any type. In some embodiments, it can be a retimer chip, an integrated circuit used to recover and retime high-speed signals. A retimer receives high-speed signals from the transmitter (i.e., the first component). These signals may be subject to attenuation, distortion, or timing deviations due to long-distance transmission or high-speed data transmission. The retimer then performs processing operations such as equalization, amplification, and filtering on the received signals to restore signal strength and clarity, and then transmits the processed signals to the receiver (i.e., the second component).
[0056] like Figure 4 As shown, the second controller can also communicate with the first controller, and based on the communication connection, the first controller can provide at least one balancing parameter to the second controller.
[0057] The first controller and the second controller may communicate with each other via a two-wire serial bus (Inter-Integrated Circuit, I2C) interface, or may communicate via a microcontroller communication management protocol (System Management Bus, SMBUS), or may communicate via other interfaces or protocols.
[0058] The first controller may be any type of controller, such as an embedded controller (EC) or a microcontroller unit (MCU).
[0059] The target instruction representing the initiation of link training can be obtained in various situations, for example, obtaining the target instruction each time the electronic device is powered on and started, or actively generating the target instruction to initiate link training when the first component or the second component is connected to the electronic device, or obtaining the target instruction each time it is determined that the communication quality of the communication link is poor and does not meet the preset conditions.
[0060] Target hardware can be understood as any hardware component in an electronic device that affects the quality of the communication link between the first and second components. This includes, but is not limited to, the baseboard (also known as the motherboard) on which the first and second components reside, the slots for connecting the first and second components, and the physical link between the first and second components (equivalent to the wire connecting the two for signal transmission). Target hardware characteristics refer to any one or more of these characteristics of the target hardware.
[0061] The at least one balancing parameter may include only one balancing parameter or multiple balancing parameters. In the case where only one balancing parameter is included, the balancing parameter may be determined as the target balancing parameter. In the case where multiple balancing parameters are included, one balancing parameter may be selected from the multiple balancing parameters as the target balancing parameter according to a certain strategy.
[0062] S102 : Training a communication link between a first component and a second component based on a target equalization parameter; the electronic device includes a first component and a second component.
[0063] Each equalization parameter can contain one or more sub-parameters. Any two different equalization parameters may not have exactly the same sub-parameter values. For example, an equalization parameter may include sub-parameters such as Main Cursor, Pre-Cursor, and Post-Cursor. Any two different equalization parameters may also have different pre-overshoot and / or de-emphasis values.
[0064] The process of training the communication link based on the target equalization parameters can be:
[0065] After the first component and the second component establish a physical connection, they can negotiate and enter link training mode. The goal of link training is to ensure that the communication link can operate stably at a target rate by selecting optimal equalization parameters. The target rate can be related to the performance of the first component or the performance of the second component. For example, the target rate can be the rate of PCIe Gen3 or PCIe Gen4.
[0066] After starting training, the first component may transmit a test signal to the second component based on the target equalization parameters and in accordance with the communication protocol specification (e.g., PCIe specification);
[0067] The second component can evaluate the signal quality of the test signal by evaluating the bit error rate (BER) of the received test signal and checking whether the test signal can be reliably decoded, thereby obtaining an evaluation result;
[0068] The second component feeds back the evaluation results to the transmitter via the Link Training and Status State Machine (LTSSM). This feedback generally indicates whether the signal quality of the test signal sent based on the target equalization parameters meets the preset quality requirements and whether the target equalization parameters need to be adjusted.
[0069] The first component may adjust the target equalization parameters based on the feedback from the second component, and then repeat the above process based on the adjusted target equalization parameters;
[0070] The second component may also adjust parameters of the second component itself related to the communication link based on the evaluation result;
[0071] If the signal quality of the test signal sent based on the target equalization parameters still cannot meet the quality conditions when the duration of the training process reaches the preset duration threshold, it is determined that the training based on the target equalization parameters has failed. If the signal quality of the test signal sent based on the target equalization parameters can meet the quality conditions before the duration of the training process reaches the preset duration threshold, it is determined that the training based on the target equalization parameters is successful, the link training is completed, and the first component and the second component can communicate based on the target equalization parameters.
[0072] The beneficial effects of this embodiment are:
[0073] Through the method of this embodiment, the communication link can be trained based on the target link parameters related to the target hardware characteristics. Compared with fixed initial equalization parameters, the target link parameters related to the target hardware characteristics are more likely to be applicable to the communication link between the current first component and the second component. Therefore, training based on the target link parameters is conducive to improving the probability of training success and shortening the training process.
[0074] A first optional method of determining the target equalization parameter from at least one equalization parameter may be:
[0075] Obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device;
[0076] determining an equalization parameter among the at least one equalization parameter that matches the characteristic information as a target equalization parameter;
[0077] The electronic device stores a first correspondence between target hardware and equalization parameters under different characteristics.
[0078] The first correspondence may include multiple equalization parameters and a set of reference characteristic information corresponding to each equalization parameter. The reference characteristic information corresponding to the equalization parameter indicates that if the target hardware characteristics match the reference characteristic information, the signal quality transmitted on the communication link based on the equalization parameter is better than other equalization parameters. Therefore, compared with other equalization parameters, the communication link training based on the equalization parameter has a greater probability of successful training.
[0079] As some examples, the first correspondence may include equalization parameters P1, P2, and P3, P1 corresponds to reference characteristic information 1, P2 corresponds to reference characteristic information 2, and P3 corresponds to reference characteristic information 3. When determining the target equalization parameter, if the obtained characteristic information matches the reference characteristic information 2, P2 may be determined as the target equalization parameter.
[0080] The first correspondence relationship may be determined by the manufacturer through testing before the electronic device leaves the factory and pre-written into any memory of the electronic device. Alternatively, the electronic device may obtain the first correspondence relationship during use by downloading it online or reading it from other storage media (such as a CD, USB flash drive, etc.).
[0081] For example, for a target hardware characteristic, the communication link of an electronic device having the target hardware characteristic can be tested to determine an equalization parameter in the communication link that can be successfully trained and has the best communication status indicator of the communication link after successful training. The characteristic information of the target hardware characteristic is used as reference characteristic information, and the reference characteristic information and the equalization parameter are recorded in the electronic device as a set of first correspondences.
[0082] Both feature information and reference feature information can include several parameters that characterize the target hardware's characteristics. Matching feature information and reference feature information can be defined as the same value for the parameter in the feature information and the corresponding parameter in the reference feature information, or as the difference between the value of the parameter in the feature information and the corresponding parameter in the reference feature information being within a preset acceptable range.
[0083] The beneficial effect of this embodiment is that, by selecting matching target equalization parameters based on characteristic information characterizing target hardware characteristics, the target equalization parameters most suitable for the current communication link can be directly determined from at least one equalization parameter, thereby further shortening the time required to train the communication link.
[0084] An optional way to obtain characteristic information that can characterize target hardware characteristics of an electronic device may be:
[0085] At least one of a first characteristic parameter, a second characteristic parameter, and a third characteristic parameter is read from a memory of an electronic device; the first characteristic parameter characterizes the link length of the communication link, the second characteristic parameter characterizes the mainboard material, and the third characteristic parameter characterizes the quality of a slot for communication on the first component or the second component.
[0086] The characteristic information includes any one or more of the first characteristic parameter, the second characteristic parameter and the third characteristic parameter, and the link length, the mainboard material and / or the slot quality have a corresponding relationship with the equalization parameter.
[0087] The first characteristic parameter may include a length parameter. For example, the first characteristic parameter may be that the length of the communication link between the first component and the second component is 80 mm. It is understood that physical loss is inevitable as signals are transmitted in a communication link, and the longer the transmission distance, the greater the physical loss. Therefore, link length is positively correlated with physical loss.
[0088] The second characteristic parameter may include one or more parameters related to the motherboard material. For example, the second characteristic parameter may include the dielectric constant value (ie, Dk value) and the dissipation factor value (ie, Df value) of the motherboard of the electronic device.
[0089] The dielectric constant, also called the dielectric constant, permittivity, or dielectric constant, is a coefficient that represents the insulation capability characteristics. Generally, the signal transmission rate of the communication link set on the motherboard is inversely proportional to the square root of the motherboard's dielectric constant. The smaller the Dk value, the smaller the physical loss of the communication link and the faster the signal transmission speed. The larger the Dk value, the greater the physical loss of the communication link and the slower the signal transmission speed.
[0090] Dissipation factor, also known as damping factor, internal friction, or loss tangent, is the tangent of the phase difference between the strain and stress cycles of a material under an alternating force field. It is also equal to the ratio of the material's loss modulus to its storage modulus. It represents the ratio of the energy flowing into the conductor near the material to the energy transmitted along the signal path. A smaller motherboard's dissipation factor indicates lower physical losses in the communication link and faster signal transmission speeds. A larger dissipation factor indicates greater physical losses in the communication link and slower signal transmission speeds.
[0091] The second characteristic parameter may also include a mainboard material grade parameter. The higher the mainboard material grade, the smaller the corresponding dielectric constant value and dissipation factor value, and the smaller the physical loss of the communication link. Therefore, the mainboard material grade is negatively correlated with the physical loss.
[0092] The third characteristic parameter may include one or more parameters related to the slot quality, such as an interface size parameter and a component compatibility parameter.
[0093] The interface size parameter represents the size of the interface on the motherboard of an electronic device for connecting to a first component or a second component. The interface size parameter is negatively correlated with slot quality: a larger interface size parameter indicates lower slot quality, while a smaller interface size parameter indicates higher slot quality. In some examples, the interface size parameter can be any of x1, x4, x8, and x16.
[0094] Generally, when the interface size parameter is larger, the corresponding interface will have longer and more complex internal routing, and these dense routings are more likely to generate electromagnetic interference. Therefore, the larger the interface size parameter, the greater the physical loss of the communication link. That is, the interface size parameter and physical loss are positively correlated.
[0095] The component compatibility parameter reflects the ability of the motherboard interface to be compatible with components of different manufacturers and types. The stronger the component compatibility, the more components of different manufacturers and types the interface can be compatible with, and the higher the slot quality. The weaker the component compatibility, the worse the slot quality. In other words, component compatibility and slot quality are positively correlated.
[0096] Stronger interface component compatibility generally means a higher degree of electrical characteristic and signal rate matching between the interface and connected components, and lower physical losses due to electrical characteristic and signal rate mismatches. Conversely, weaker interface component compatibility generally means a lower degree of matching, and higher physical losses due to electrical characteristic and signal rate mismatches. Therefore, component compatibility and physical losses are negatively correlated: stronger component compatibility results in lower physical losses, while weaker component compatibility results in higher physical losses.
[0097] In summary, the slot quality reflected by the third characteristic parameter is negatively correlated with the physical loss. The better the slot quality, the smaller the physical loss, and the worse the slot quality, the greater the physical loss.
[0098] In this embodiment, the relevant manufacturers can write any one or more of the above-mentioned first characteristic parameters, second characteristic parameters and third characteristic parameters of the electronic device into a specific memory during the production process, so that the above-mentioned characteristic parameters can be read when training the communication link according to the above-mentioned method.
[0099] Alternatively, if the electronic device has corresponding sensors capable of detecting any one or more of the above characteristic parameters, the corresponding characteristic parameters may also be detected through these sensors.
[0100] Another optional way to obtain characteristic information that can characterize target hardware characteristics of the electronic device may be:
[0101] Any one or more characteristic parameters are obtained based on feedback information of the second component obtained through interaction between the first component and the second component.
[0102] Characteristic parameters affect the physical loss of the communication link, and physical loss further affects the information obtained from the interaction between the two components. For example, the feedback information from the second component can indicate the actual transmission rate of the signal on the communication link. When the physical loss is large, the actual transmission rate may be much lower than the expected transmission rate related to the component performance.
[0103] Therefore, it is possible to determine in advance through experiments what feedback information the second component will output under different characteristic parameters, thereby determining the correspondence between the feedback information and the characteristic parameters, and writing this correspondence into the memory of the electronic device. When training according to the method of this embodiment, one can first select any equalization parameter for a training run. During the training process, feedback information from the second component is obtained when the two components interact, and the one or more characteristic parameters are determined based on the correspondence between the feedback information and the characteristic parameters.
[0104] Optionally, the relationship between link length, motherboard material, and / or slot quality and equalization parameters includes:
[0105] Link length is positively correlated with physical loss;
[0106] The motherboard material grade is negatively correlated with physical loss;
[0107] Slot quality is negatively correlated with physical loss;
[0108] Physical losses are positively correlated with the corresponding target balancing parameters.
[0109] The impact of link length, motherboard material grade, and slot quality on physical loss has been described above and is not repeated here.
[0110] After successful training based on the target equalization parameters, the first component, the second component, or another component (eg, a second controller) may process a signal sent from the first component or the second component based on the target equalization parameters.
[0111] One purpose of processing signals based on equalization parameters is to increase the strength of the transmitted signal, ensuring that the signal received by the other end, even after attenuation due to physical loss in the communication link, still maintains sufficient strength, thereby preventing the signal from being too weak to be correctly identified. The greater the physical loss in the communication link, the greater the attenuation of the signal after transmission through the communication link. To ensure that the attenuated signal still maintains sufficient strength, it is necessary to increase the signal strength more significantly based on the equalization parameters. The larger the value of the equalization parameters, the greater the improvement in signal strength. Therefore, in this embodiment, the magnitude of the physical loss can be positively correlated with the corresponding equalization parameters.
[0112] Based on the above relationship, in the first corresponding relationship stored in the memory, the link length represented by the reference characteristic information can be positively correlated with the corresponding equalization parameter. Assuming that other information is the same, the longer the link length represented by the reference characteristic information, the larger the equalization parameter corresponding to the reference characteristic information in the first corresponding relationship.
[0113] The slot quality represented by the reference characteristic information may be negatively correlated with the corresponding equalization parameter. Assuming other information is the same, the better the slot quality represented by the reference characteristic information, the smaller the equalization parameter corresponding to the reference characteristic information in the first corresponding relationship.
[0114] The motherboard material grade represented by the reference characteristic information may be negatively correlated with the corresponding equalization parameter. Assuming other information is the same, the higher the motherboard material grade represented by the reference characteristic information, the smaller the equalization parameter corresponding to the reference characteristic information in the first corresponding relationship.
[0115] Moreover, the longer the link length represented by the characteristic information of the current electronic device, the larger the target equalization parameter determined; the better the slot quality represented by the characteristic information of the current electronic device, the smaller the target equalization parameter determined; the higher the mainboard material grade represented by the characteristic information of the current electronic device, the smaller the target equalization parameter determined.
[0116] A second optional method of determining the target equalization parameter from at least one equalization parameter may be:
[0117] Determine the target hardware's physical loss of the signal;
[0118] Determining target equalization parameters based on physical loss; processing signals with the target equalization parameters can compensate for the physical loss;
[0119] The electronic device stores a second correspondence between the physical loss of the signal and the equalization parameter under different characteristics of the target hardware.
[0120] The target hardware's physical signal loss can be represented by different loss levels, with higher loss levels indicating greater physical loss and lower loss levels indicating less physical loss. The second correspondence can include multiple equalization parameters and the corresponding loss level for each equalization parameter. A loss level can correspond to only one equalization parameter or multiple equalization parameters.
[0121] For example, loss levels can be divided into low and high, representing increasing physical losses. In the second correspondence, a low loss level can correspond to two equalization parameters, denoted as P1 and P2, while a high loss level can correspond to one equalization parameter, denoted as P3. Higher loss levels correspond to larger equalization parameters.
[0122] The magnitude of the physical loss can be expressed by the intensity attenuation of the signal after transmission through the communication link. The above two loss levels can correspond to two intensity attenuation amplitude ranges. The higher the level, the larger the upper and lower limits of the corresponding range.
[0123] The loss level corresponding to each balancing parameter in the second corresponding relationship may be determined based on the magnitude of the physical loss that can be compensated by the balancing parameter. The higher the corresponding loss level, the greater the physical loss that can be compensated.
[0124] The method for determining the loss level corresponding to an equalization parameter can be to set up communication links with different loss levels in a test environment, process the signals transmitted in the communication links based on the equalization parameters, and if the signal quality of the signals received at both ends of the communication link after processing can meet the preset quality conditions, then the loss level of the communication link is determined to be the loss level corresponding to the equalization parameter.
[0125] When determining the target equalization parameters, you can first determine the current loss level of the communication link between the first component and the second component, match the current loss level with the loss level of each equalization parameter in the second corresponding relationship, and find the equalization parameter corresponding to the current loss level.
[0126] If the current loss level in the second correspondence corresponds to only one equalization parameter, this equalization parameter is determined as the target equalization parameter. If the current loss level in the second correspondence corresponds to multiple equalization parameters, any equalization parameter that has not been used to train the communication link in this training is determined as the target equalization parameter.
[0127] The beneficial effect of this embodiment is that, according to the current physical loss of the communication link, a matching target equalization parameter is selected, and the target equalization parameter most suitable for the current communication link can be directly determined from at least one equalization parameter, thereby further shortening the time for training the communication link.
[0128] Alternatively, one way to determine the target hardware's physical loss of the signal could be:
[0129] The physical loss of the signal by the target hardware is determined based on feedback information of the second component obtained through interaction between the first component and the second component.
[0130] The physical loss of the target hardware to the signal can be expressed by the loss level of the communication link, for example, by the two loss levels of low and high mentioned above. Determining the physical loss of the target hardware to the signal is equivalent to determining the loss level of the communication link.
[0131] In this embodiment, the third corresponding relationship between the feedback information and the loss level of the physical loss can be determined in advance through experiments, and the third corresponding relationship can be written into the memory of the electronic device in advance.
[0132] The method for determining the third correspondence may be: in a test environment, setting up communication links with different loss levels; for each communication link with a loss level, controlling the first component and the second component at both ends of the communication link to communicate, collecting feedback information output by the second component and changing with the loss level, and determining these feedback information and the loss level of the communication link as a set of third correspondences.
[0133] According to the third correspondence, after obtaining the feedback information of the second component, the feedback information of the second component can be compared with the feedback information recorded in the third correspondence. Based on the degree of matching between the feedback information of the second component and the feedback information recorded in the third correspondence, the loss level corresponding to the feedback information with the highest degree of matching is determined as the loss level of the current communication link.
[0134] Specifically, if the feedback information of the second component is consistent with a certain feedback information recorded in the third corresponding relationship, the loss level corresponding to the feedback information in the third corresponding relationship may be determined as the loss level of the current communication link;
[0135] If the feedback information of the second component is different from each piece of feedback information recorded in the third correspondence, the target equalization parameter may be determined based on other methods.
[0136] The advantage of determining physical loss using the above method is that, during the use of an electronic device, the target hardware of the electronic device may be replaced based on user modification requirements, resulting in changes in the target hardware characteristics. Using the above method, even if the target hardware characteristics change, the current actual loss level can be dynamically determined based on feedback from the modified second component, thereby accurately determining the target equalization parameters suitable for the current communication link based on this loss level.
[0137] Optionally, the feedback information includes any one or more of the following types of feedback information:
[0138] The first feedback information may be detection information indicating whether the communication link connection between the first component and the second component is available;
[0139] The second feedback information may be rate information indicating a transmission rate of a communication link between the first component and the second component;
[0140] The third feedback information may be status information indicating the component status of the second component.
[0141] After the first component and the second component establish a physical connection, the first component can send a detection signal to the second component through the communication link between the two within a certain detection time to detect whether the electrical connection of the communication link is normal. If the electrical connection of the communication link is detected to be normal within the detection time, it is determined that the communication link connection between the first component and the second component is available. If the electrical connection of the communication link is detected to be abnormal within the detection time, it is determined that the communication link connection between the first component and the second component is unavailable.
[0142] Among them, the communication link connection is unavailable, which may be due to excessive physical loss of the communication link, resulting in the detection signal sent to the second component via the communication link not being recognized and responded to by the second component. Therefore, if the first feedback information indicates that the communication link connection between the first component and the second component is available, it can be determined that the loss level of the current communication link is low. If the first feedback information indicates that the communication link connection between the first component and the second component is unavailable, it can be determined that the loss level of the current communication link is high.
[0143] The second feedback information may include information about the transmission rate of the communication link between the first component and the second component. After obtaining the second feedback information, the transmission rate corresponding to the second feedback information may be compared with the expected transmission rate. If the transmission rate corresponding to the second feedback information is less than the expected transmission rate, the loss level may be determined to be high. If the transmission rate corresponding to the second feedback information is equal to the expected transmission rate, the loss level may be determined to be low. The expected transmission rate may be the highest transmission rate supported by the first component and the second component.
[0144] For example, assuming that the first component and the second component support a maximum transmission rate of PCIe Gen4, the expected transmission rate is PCIe Gen4. If the communication link between the first component and the second component can only support a transmission rate of PCIe Gen3, which is lower than the expected transmission rate PCIe Gen4, the loss level is determined to be high. If the communication link can support the transmission rate of PCIe Gen4, the loss level is determined to be low.
[0145] Optionally, multiple loss levels can be further divided. When the transmission rate of a communication link is lower than the expected transmission rate, a specific loss level is determined based on the deviation between the two. For example, if the expected transmission rate is PCIe Gen4 and the communication link can only support the transmission rate of PCIe Gen2, the loss level is determined to be high. If the communication link can only support the transmission rate of PCIe Gen3, the loss level is determined to be medium.
[0146] The third feedback information can specifically indicate whether the second component has successfully loaded the resources required for communication. If the third feedback information indicates that the second component has successfully loaded the resources, it can be determined that the second component is compatible with the interface of the motherboard. In this case, the physical loss is small, so the loss level can be determined to be low. If the third feedback information indicates that the second component has not successfully loaded the resources, it can be determined that the second component is a special type of component and may not be compatible with the interface of the motherboard. In this case, the physical loss is large, so the loss level can be determined to be high.
[0147] In some optional embodiments, the physical loss may be determined by directly reading a pre-written strength attenuation amplitude from a memory and comparing the read strength attenuation amplitude with the strength attenuation amplitude intervals corresponding to different loss levels to determine the loss level. The strength attenuation amplitude represents the degree of signal strength attenuation after the signal is transmitted through the communication link.
[0148] A third optional manner of determining the target equalization parameter from at least one equalization parameter may be:
[0149] Obtaining feedback information of the second component obtained through interaction between the first component and the second component;
[0150] The equalization parameter matched with the feedback information is determined as the target equalization parameter.
[0151] Because the feedback information provided by the second component is also related to the target hardware characteristics of the electronic device, the electronic device can directly store the correspondence between the feedback information and the equalization parameters, which is recorded as a fourth correspondence. The fourth correspondence can include several possible feedback information and the equalization parameters corresponding to each feedback information.
[0152] The method for determining the fourth correspondence relationship can be to conduct experiments on several communication links with different target hardware characteristics, record the feedback information related to the target hardware characteristics output by the second component in each communication link, and the equalization parameters used by the communication link when the training is successful, and record the feedback information and equalization parameters of the same communication link as a set of correspondence relationships, thereby obtaining the fourth correspondence relationship.
[0153] The fourth correspondence may include any one or more of the following:
[0154] If the first feedback information indicates that the communication link connection is available, the corresponding equalization parameter may be an equalization parameter with a shorter detection time, such as an equalization parameter with a detection time of 200 milliseconds;
[0155] If the first feedback information indicates that the communication link connection is unavailable, the corresponding equalization parameter may be an equalization parameter with a longer detection time, such as an equalization parameter with a detection time of 400 milliseconds;
[0156] If the transmission rate corresponding to the second feedback information is lower than the expected transmission rate, the corresponding equalization parameter may be an equalization parameter having a larger pre-emphasis value or a post-emphasis value;
[0157] If the transmission rate corresponding to the second feedback information is equal to the expected transmission rate, the corresponding equalization parameter may be an equalization parameter having a smaller value of the pre-emphasis value or the post-emphasis value;
[0158] If the third feedback information indicates that the second component successfully loaded the resource, the corresponding equalization parameter may be a general equalization parameter applicable to a conventional component;
[0159] If the third feedback information indicates that the second component fails to load the resource, the corresponding equalization parameter may be a special equalization parameter determined through pre-tests and applicable to a special component.
[0160] Based on the fourth correspondence, after obtaining the feedback information of the second component, the feedback information of the second component and the feedback information in the fourth correspondence are matched, and the equalization parameter corresponding to the successfully matched feedback information in the fourth correspondence is determined as the target equalization parameter.
[0161] In some optional embodiments, the step of determining the target equalization parameters may be repeated multiple times. For example, during the first training, based on the characteristic information, physical loss, or feedback information, the equalization parameters with the highest degree of matching are determined as the target equalization parameters, and the communication link is trained based on the target equalization parameters. If the training fails, the equalization parameters with the highest degree of matching can be determined again based on the characteristic information, physical loss, or feedback information from the remaining equalization parameters that have not been used for training as the target equalization parameters. Training is then repeated based on the newly determined target equalization parameters, and so on, until training is successful or all equalization parameters have been tried.
[0162] If the matching degrees corresponding to the remaining multiple equalization parameters are the same, the equalization parameters may be selected for training in sequence according to information such as the equalization parameter number and the cumulative number of times the equalization parameter has been used for training.
[0163] Optionally, if all currently recorded equalization parameters have been used to train the communication link and all training has failed, multiple alternative equalization parameters can be determined therefrom, and the multiple sub-parameters contained in these alternative equalization parameters can be reorganized to obtain reorganized equalization parameters, and the communication link can be trained based on the reorganized equalization parameters.
[0164] The method for determining alternative equalization parameters can be to select N equalization parameters from large to small as alternative equalization parameters based on the matching degree of characteristic information, physical loss or feedback information, where N is a preset integer greater than 1, and its value can be set as needed, for example, to 2, 3 or other values, without limitation.
[0165] Of the above methods for determining the target equalization parameters, only one may be applied, or any number of them may be applied simultaneously.
[0166] For example, the target equalization parameter may be determined based on the three aforementioned methods simultaneously. If the target equalization parameter determined by the three methods is the same equalization parameter, the communication link is trained based on the target equalization parameter.
[0167] If the target equalization parameters determined by the three methods are not the same equalization parameters, the communication link can be trained with each target equalization parameter in turn. For example, training is first performed based on the target equalization parameters determined by the first method. If the training is successful, the training ends. If the training fails, training is then performed based on the target equalization parameters determined by the second method. If the training is successful, the training ends. If the training fails, training is then performed based on the target equalization parameters determined by the third method.
[0168] The correspondences involved in the aforementioned embodiments, including the first correspondence, the second correspondence, the third correspondence and the fourth correspondence, as well as the equalization parameters involved in these correspondences, can be stored in any one or more of the following locations: the first firmware of the first component, the second firmware of the second component, the first controller, and the second controller.
[0169] As an example, when the first component is a CPU, the first firmware may be a Basic Input Output System (BIOS); when the second component is a solid state drive (SSD), the second firmware may be firmware built into the SSD for providing data reading and writing functions.
[0170] When the above correspondence is stored in the first firmware of the first component, the first component can determine the target equalization parameters according to the aforementioned method, and then train the communication link based on the target equalization parameters.
[0171] When the above correspondence is stored in the second firmware of the second component, the second component can determine the target equalization parameters according to the aforementioned method and transmit the target equalization parameters to the first component, so that the first component trains the communication link based on the target equalization parameters. Alternatively, the second component can directly train the communication link based on the target equalization parameters.
[0172] When the above correspondence is stored in the first controller, the first controller may determine the target equalization parameter according to the aforementioned method and provide it to the first component or the second controller, so that the first component or the second controller trains the communication link based on the target equalization parameter.
[0173] When the above correspondence is stored in the second controller, the second controller may determine the target equalization parameter according to the aforementioned method, and then the second controller trains the communication link based on the target equalization parameter.
[0174] During use, the electronic device can obtain one or more communication status indicators that can reflect the communication status of the communication link, and update any one or more of the first corresponding relationship, the second corresponding relationship, and the fourth corresponding relationship based on these communication status indicators.
[0175] Taking the update of the first corresponding relationship as an example, after P2 is determined as the target equalization parameter based on the characteristic information and the first corresponding relationship, the communication link is trained based on P2. During the training, any one or more sub-parameters contained in P2 are fine-tuned to obtain the fine-tuned equalization parameter P2'. By comparison, it is found that the communication status indicator when communicating according to P2' is better than the communication status indicator when communicating according to P2. Therefore, P2 in the first corresponding relationship can be updated to P2', so that training can be performed according to P2' when the communication link is trained next time.
[0176] Communication status indicators include, but are not limited to, any one or more indicators such as link transmission rate, number of abnormal recovery times, bit error rate, etc., and may also include other indicators in related technologies that can reflect communication status, without limitation.
[0177] Link transmission rate: When the first component and the second component communicate based on the PCIe protocol, the link transmission rate may be a PCIe rate.
[0178] The number of abnormal recovery times, that is, the cumulative number of times the communication link between the first component and the second component enters abnormal recovery.
[0179] The communication status indicator may be detected by any one of the first component, the second component, the first controller, and the second controller.
[0180] In some embodiments, after the training is successful and the communication link is determined to be stable, the equalization parameters applied in the current communication link can be recorded in the memory of the electronic device. When the electronic device is turned on again, the recorded equalization parameters can be read from the memory and used to train the communication link to shorten the training time.
[0181] The memory may be non-volatile memory (NVRAM) or other memory.
[0182] This embodiment also provides an electronic device, see Figure 2 , the electronic device includes a first component 201, a second component 202 and target hardware 203;
[0183] The target hardware characteristics of the target hardware 203 meet a first condition, where the first condition indicates that the characteristics do not change or the characteristics change but do not affect the link training result between the first component 201 and the second component 202 .
[0184] For example, the target hardware 203 may include any one or more of a motherboard, a slot (also referred to as an interface) on the motherboard, and a physical link.
[0185] At least one equalization parameter is stored in the first firmware of the first component 201 and / or the firmware of the second component 202;
[0186] The at least one equalization parameter is related to a target hardware characteristic of the target hardware 203 .
[0187] In some optional embodiments, see Figure 3 , the electronic device further includes a first controller 301;
[0188] The storage space corresponding to the first controller 301 stores a first correspondence between the target hardware 203 and the equalization parameters under different characteristics, or stores a second correspondence between the physical loss of the signal by the target hardware 203 and the equalization parameters under different characteristics;
[0189] The first controller 301 is configured to, upon obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device, determine an equalization parameter that matches the characteristic information according to the first corresponding relationship as a target equalization parameter;
[0190] Alternatively, the first controller 301 is configured to, when determining the physical loss of the signal by the target hardware 203 , determine an equalization parameter that matches the physical loss as the target equalization parameter according to the second corresponding relationship.
[0191] In some optional embodiments, the electronic device further includes a second controller 401;
[0192] In the case where the link between the first component 201 and the second component 202 is trained by the second controller 401 , the storage space corresponding to the first controller 301 also stores at least one equalization parameter;
[0193] The first controller 301 is configured to write the target equalization parameters into the second controller 401 , so that the second controller 401 performs link training based on the target equalization parameters.
[0194] The working principle of the electronic device in the above embodiment can be found in the relevant steps of the link training method in the above embodiment, and will not be described in detail.
[0195] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other.
[0196] For the convenience of description, the above systems or devices are described as being divided into various modules or units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0197] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application or certain parts of the embodiments.
[0198] Finally, it should be noted that, in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0199] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A link training method, the method comprising: determining a target equalization parameter from at least one equalization parameter in response to the target instruction; The at least one equalization parameter includes an equalization parameter related to a target hardware characteristic of the electronic device, and the target instruction represents the start of link training or the failure of link training; A communication link between a first component and a second component is trained based on the target equalization parameter; the electronic device includes the first component and the second component.
2. The method according to claim 1, wherein determining the target equalization parameter from at least one equalization parameter comprises: Obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device; determining an equalization parameter among at least one equalization parameter that matches the characteristic information as the target equalization parameter; The electronic device stores a first correspondence between target hardware and equalization parameters under different characteristics.
3. The method according to claim 2, wherein obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device comprises: Reading at least one of the first characteristic parameter, the second characteristic parameter, and the third characteristic parameter from a memory of the electronic device; The first characteristic parameter characterizes the link length of the communication link, the second characteristic parameter characterizes the mainboard material, and the third characteristic parameter characterizes the quality of the slot for communication on the first component or the second component; The link length, motherboard material and / or slot quality have a corresponding relationship with the equalization parameter.
4. The method according to claim 3, wherein the corresponding relationship between the link length, motherboard material and / or slot quality and the equalization parameter comprises: Link length is positively correlated with physical loss; The motherboard material grade is negatively correlated with physical loss; Slot quality is negatively correlated with physical loss; Physical losses are positively correlated with the corresponding target balancing parameters.
5. The method according to claim 1, wherein determining the target equalization parameter from at least one equalization parameter comprises: Determine the target hardware's physical loss of the signal; determining the target balancing parameter based on the physical loss; The target equalization parameter processing signal can compensate for the physical loss; The electronic device stores a second correspondence between physical signal loss and equalization parameters of target hardware under different characteristics.
6. The method according to claim 5, wherein determining the physical loss of the target hardware to the signal comprises: The physical loss of the signal by the target hardware is determined according to feedback information of the second component obtained through interaction between the first component and the second component.
7. The method according to claim 6, wherein the feedback information comprises at least one of the following: detection information indicating whether a communication link connection between the first component and the second component is available; rate information indicating a transmission rate of a communication link between the first component and the second component; Status information indicating a component status of the second component.
8. An electronic device comprising a first component, a second component, and target hardware; The target hardware characteristic satisfies a first condition, where the first condition indicates that the characteristic does not change or that the characteristic changes but does not affect the link training result between the first component and the second component; at least one equalization parameter is stored in the first firmware of the first component and / or in the firmware of the second component; The at least one equalization parameter is related to a target hardware characteristic of the target hardware.
9. The apparatus of claim 8, further comprising a first controller; The storage space corresponding to the first controller stores a first correspondence between target hardware and equalization parameters under different characteristics, or stores a second correspondence between physical loss of a signal by the target hardware and equalization parameters under different characteristics; The first controller is configured to, upon obtaining characteristic information capable of characterizing target hardware characteristics of the electronic device, determine an equalization parameter that matches the characteristic information according to the first corresponding relationship as the target equalization parameter; Alternatively, the first controller is configured to, when determining the physical loss of the target hardware for the signal, determine an equalization parameter that matches the physical loss according to the second corresponding relationship as the target equalization parameter.
10. The apparatus of claim 9, further comprising a second controller; In a case where the link between the first component and the second component is trained by the second controller, the storage space corresponding to the first controller further stores at least one equalization parameter; The first controller is configured to write the target equalization parameter into the second controller, so that the second controller performs link training based on the target equalization parameter.