Implementation method of link self-negotiation based on Ethernet protocol
By using a link auto-negotiation method based on the Ethernet protocol, an auto-negotiation subsystem is instantiated, page data is read, the state machine is managed, and link quality is monitored in real time. This solves the problem of low efficiency in traditional link negotiation and improves link performance and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHONGYIN MICROELECTRONICS NANJING CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-05-19
AI Technical Summary
Traditional link negotiation methods cannot be dynamically adjusted according to actual network conditions and equipment capabilities, resulting in low link negotiation efficiency and affecting performance and stability.
This paper provides a link auto-negotiation method based on the Ethernet protocol. By instantiating the auto-negotiation subsystem, reading page data with a microcontroller, managing the state machine with the auto-negotiation module, and monitoring link quality in real time and dynamically adjusting parameters, the paper achieves real-time management and optimization of link quality.
It improves the efficiency and stability of link negotiation, and can dynamically adjust the negotiation strategy according to the actual network conditions and equipment capabilities to ensure that the link always maintains good performance.
Smart Images

Figure CN121750765B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of link negotiation technology, specifically to an implementation method of link auto-negotiation based on the Ethernet protocol. Background Technology
[0002] With the development of Ethernet technology, the demand for interconnection between network devices is increasing. However, traditional link negotiation methods often use fixed negotiation strategies and parameter settings during the negotiation process, which cannot be dynamically adjusted according to the actual network conditions and device capabilities. Furthermore, when monitoring and managing the quality of multi-channel links, it is impossible to obtain the link quality indicators of each channel in real time, resulting in low link negotiation efficiency and thus affecting the performance and stability of the entire link. Summary of the Invention
[0003] This application provides a link auto-negotiation implementation method based on the Ethernet protocol, which solves the technical problems of low link negotiation efficiency and poor link performance and stability in existing methods.
[0004] The technical solution to the above-mentioned technical problems in this application is as follows:
[0005] On the one hand, this application provides a method for implementing link auto-negotiation based on the Ethernet protocol, the method comprising:
[0006] Based on the identifier of the configuration register according to the SerDes IP protocol, determine and instantiate the auto-negotiation subsystem;
[0007] The microcontroller in the auto-negotiation subsystem reads page data pre-stored in static random access memory, configures and sends auto-negotiation frames.
[0008] The auto-negotiation module is used to perform auto-negotiation state machine management. Based on the page exchange and signal parsing results with the peer device, the optimal link parameters are negotiated and determined.
[0009] The microcontroller monitors the link quality indicators of multiple channels in real time. If the link quality indicators are lower than the preset threshold, the page data in the static random access memory is dynamically modified and a renegotiation process is triggered.
[0010] Based on the negotiation results, the SerDes transmitter and receiver parameters are reconfigured, and the final link parameters are notified to the external system chip through the interrupt controller, thus completing the link auto-negotiation and system initialization.
[0011] This application provides one or more technical solutions, which have at least the following technical effects or advantages:
[0012] This application provides a method for implementing link auto-negotiation based on the Ethernet protocol. First, the auto-negotiation subsystem is instantiated based on the protocol configuration register, ensuring accurate activation of the auto-negotiation function under the Ethernet protocol and avoiding unnecessary resource consumption under non-Ethernet protocols. Second, the microcontroller reads page data from the static random access memory and configures the transmission of auto-negotiation frames. Differential Manchester encoding and dynamic adjustment of timing parameters ensure that the auto-negotiation frames meet the physical layer transmission requirements of the target rate, improving the accuracy and efficiency of negotiation. Third, the auto-negotiation module performs state machine management, determining optimal link parameters through page switching and signal parsing. During state transitions such as capability exchange and parameter confirmation, it accurately identifies the combination of communication capabilities supported by both parties, selects the link parameters corresponding to the highest communication rate, and possesses an error recovery mechanism, enhancing the reliability of negotiation. Finally, the microcontroller monitors link quality indicators in real time. When the indicators fall below a preset threshold, it dynamically modifies page data and triggers renegotiation. It can dynamically adjust the communication rate and related configurations according to the actual link conditions, ensuring that the link always maintains good performance. Finally, based on the negotiation results, the SerDes transmitter and receiver parameters are reconfigured, and the external system chip is notified to complete the system initialization, enabling the entire link system to be put into use quickly and stably.
[0013] Through the above technical solution, this application can dynamically adjust the negotiation strategy and parameters according to the actual network conditions and equipment capabilities, monitor and manage the quality of multi-channel links in real time, improve the efficiency of link negotiation and the overall performance and stability of the links, and has high practicality and promotion value. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart illustrating an implementation method for link auto-negotiation based on the Ethernet protocol provided in an embodiment of this application. Detailed Implementation
[0016] This application provides a link auto-negotiation method based on the Ethernet protocol to address the technical problems of low link negotiation efficiency and poor link performance and stability in existing systems.
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0019] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessarily obscuring the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0020] Examples, such as Figure 1 As shown, this application embodiment provides a link auto-negotiation implementation method based on the Ethernet protocol, including:
[0021] S10: Based on the identifier of the configuration register according to the SerDes IP protocol, determine and instantiate the auto-negotiation subsystem;
[0022] In this embodiment, the identifier on the protocol configuration register in the SerDes IP responsible for data transmission is first determined. If the Ethernet protocol is displayed, the small module that can negotiate transmission parameters with the peer is automatically enabled, namely the self-negotiation subsystem, which includes a mini controller, negotiation components, and data storage space. If the protocol configuration register does not display the Ethernet protocol, the data transmission module is not enabled, and only the core components retain the most basic data transmission and reception functions.
[0023] If the protocol configuration register indicates Ethernet protocol, the auto-negotiation subsystem is instantiated. During instantiation, the microcontroller, auto-negotiation module, and static random access memory (SRAM) are associated and initialized. The microcontroller, as the system's control core, coordinates the work of each module; the auto-negotiation module focuses on managing the auto-negotiation state machine; and SRAM stores the page data required for negotiation.
[0024] Specifically, step S10 in the method includes:
[0025] The protocol type field of the protocol configuration register is parsed. If the protocol type is Ethernet, the auto-negotiation subsystem is automatically instantiated. The auto-negotiation subsystem includes a microcontroller, an auto-negotiation module, and static random access memory.
[0026] If the protocol type is not Ethernet, only the basic SerDes transmit and receive functions are retained, and the auto-negotiation subsystem is not instantiated.
[0027] In this embodiment, firstly, the Ethernet protocol is identified based on the identifier in the protocol configuration register, thereby determining whether to enable the auto-negotiation subsystem. The auto-negotiation subsystem includes a microcontroller, an auto-negotiation module, and static random access memory. The auto-negotiation subsystem is instantiated under the Ethernet protocol, and the microcontroller, auto-negotiation module, and static random access memory are associated and initialized.
[0028] The microcontroller coordinates the work of each module, ensuring the orderly progress of the auto-negotiation process. The auto-negotiation module manages the auto-negotiation state machine, determining the optimal link parameters through state transitions and page swapping. Static random access memory (SRAM) provides stable data storage support for the negotiation process, guaranteeing reliable reading and storage of page data.
[0029] Furthermore, if the protocol type is not Ethernet, the auto-negotiation subsystem will not be instantiated to avoid unnecessary resource consumption and system overhead. In this case, only the basic SerDes transmit and receive functions are retained to ensure that the device can still perform basic data transmission and reception operations and maintain the basic operation of the system in a non-Ethernet protocol environment.
[0030] The above design ensures the effective implementation of link auto-negotiation under the Ethernet protocol while also adapting to non-Ethernet protocol usage scenarios, thus improving the device's compatibility and adaptability. Simultaneously, by not activating the auto-negotiation subsystem under non-Ethernet protocols, potential system failure risks are reduced, enhancing the overall system stability and reliability.
[0031] Then only the basic SerDes send and receive functions are retained, and the auto-negotiation subsystem is not instantiated.
[0032] S20: The microcontroller in the auto-negotiation subsystem reads the page data pre-stored in the static random access memory, configures and sends the auto-negotiation frame;
[0033] In this embodiment, pre-stored page data is first extracted from the static random access memory. The page data contains link parameter information supported by the device, such as communication rate, duplex mode, forward error correction configuration, etc.
[0034] The microcontroller configures the auto-negotiation frame based on the page data. During configuration, it uses the existing differential Manchester encoding method to encode the data to meet the transmission requirements of the physical layer. Simultaneously, the microcontroller dynamically adjusts the timing parameters of the auto-negotiation frame to ensure it conforms to the physical layer's transmission specifications at the target rate.
[0035] Secondly, after configuration, the microcontroller controls the relevant hardware to send out the auto-negotiation frame. During transmission, the transmitted signal is monitored in real time to ensure that the signal strength and quality meet the requirements. If an abnormal signal is detected, the microcontroller will promptly adjust the transmission power or other parameters to ensure that the auto-negotiation frame is accurately sent to the peer device.
[0036] Furthermore, after sending the self-negotiation frame, the microcontroller starts a timer to wait for a response from the peer device. If no response is received from the peer device within the specified time, the microcontroller will resend the self-negotiation frame, attempting to send it a certain number of times. If no response is received after multiple attempts, the negotiation is considered to have failed, and further investigation into link failures or the status of the peer device is required.
[0037] Specifically, step S20 in the method includes:
[0038] Read page data from the base page and extended page sequentially from the static random access memory;
[0039] Differential Manchester encoding is performed on the page data, and the timing parameters during the encoding process are dynamically adjusted according to the current link rate to obtain an auto-negotiation frame that meets the physical layer transmission requirements of the target rate.
[0040] The auto-negotiation state machine is started, and the auto-negotiation frames are sent in the order of the preset negotiation priority, while the response signal of the peer device is monitored.
[0041] In this embodiment, firstly, page data of the base page and extended page are read sequentially from the static random access memory. This data includes link parameter information supported by the device, such as communication rate, duplex mode, and forward error correction configuration. The communication rate covers multiple selectable rate levels, the duplex mode is divided into full-duplex and half-duplex, and the forward error correction configuration can enhance the reliability of data transmission.
[0042] Secondly, the page data is processed using differential Manchester encoding. During encoding, the microcontroller dynamically adjusts the timing parameters based on the current link rate to obtain auto-negotiation frames that meet the physical layer transmission requirements of the target rate, ensuring that the auto-negotiation frames can be transmitted stably and accurately at different link rates.
[0043] Furthermore, Differential Manchester coding is an encoding method that combines data information and clock signals. Its characteristic is that the signal undergoes a transition within each bit period, using the direction of the transition to represent 0s and 1s in the data. Differential Manchester coding not only effectively reduces signal interference but also allows the clock signal to be recovered at the receiving end by detecting the transitions, thereby achieving synchronous data transmission. The microcontroller adjusts timing parameters during the encoding process according to the current link rate, such as the length of the bit period and the timing of the transitions, so that the signal characteristics of the auto-negotiation frame match the transmission specifications of the physical layer at the target rate.
[0044] Secondly, when sending a self-negotiation frame, the self-negotiation state machine is initiated. The self-negotiation state machine is a finite state automaton that sends self-negotiation frames according to a preset negotiation priority order. During transmission, the microcontroller monitors the response signal from the peer device. If a response signal is received from the peer device, the microcontroller parses the signal to determine the link parameters and capabilities supported by the peer device. By comparing the link parameters supported by the local and peer devices, the microcontroller can filter out parameter combinations supported by both, providing a basis for subsequent negotiation to determine the optimal link parameters.
[0045] However, if no response signal is received from the peer device within the specified time after sending the self-negotiation frame, the microcontroller will resend the self-negotiation frame and record the number of retransmissions. When the number of retransmissions reaches the preset maximum number of attempts, if no response is still received from the peer device, the microcontroller will determine that the negotiation has failed. At this time, the system will trigger the corresponding fault handling mechanism, such as issuing an alarm to notify maintenance personnel, or attempting to automatically troubleshoot link faults, such as checking whether the link connection is normal and whether the device is working properly.
[0046] This includes sequentially reading page data from the static random access memory (SRAM) for the base page and extended page, including:
[0047] Read the device capability parameters, which include at least the communication rate, duplex mode, and forward error correction support capability;
[0048] Read priority parameters, which include at least the page sending priority and negotiation timeout settings;
[0049] Read the constraint parameters, which include at least the minimum communication rate requirement and the maximum bit error rate tolerance;
[0050] The basic page mainly includes device capability parameters and page sending priority, while the extended page mainly includes extended device capability parameters, constraint parameters, and negotiation timeout settings.
[0051] In this embodiment, firstly, a base page is read from the static random access memory (SRAM). The base page primarily contains device capability parameters and page transmission priority. The device capability parameters are then obtained; the device supports speeds such as 10Mbps, 100Mbps, and 1Gbps. The microcontroller can negotiate an appropriate communication speed based on actual conditions. Full-duplex mode allows the device to send and receive data simultaneously, improving data transmission efficiency; half-duplex mode, however, only allows sending or receiving operations at a time. Forward error correction support can detect and correct errors during data transmission, enhancing data transmission reliability.
[0052] Secondly, the priority parameter is read. The page sending priority determines the order in which different page data is sent during the negotiation process. The negotiation timeout setting specifies the maximum time to wait for a response from the other device, avoiding long and meaningless waits.
[0053] Next, read the extended page. The extended device capability parameters reflect the negotiable range of the device. The extended page mainly includes extended device capability parameters, constraint parameters, and negotiation timeout settings. The constraint parameters include at least the minimum communication rate requirement and the maximum bit error rate tolerance. The minimum communication rate requirement ensures that the negotiated link parameters can meet the basic communication needs of the device, and the maximum bit error rate tolerance ensures the quality of data transmission.
[0054] After reading the page data, the microcontroller configures the auto-negotiation frame based on the page data. When using differential Manchester encoding, the timing parameters during the encoding process are dynamically adjusted based on the device capability parameters and the current link rate to ensure that the signal characteristics of the auto-negotiation frame can better adapt to the transmission specifications of the target rate physical layer.
[0055] S30: Utilize the auto-negotiation module to perform auto-negotiation state machine management, and negotiate to determine the optimal link parameters based on the page exchange and signal parsing results with the peer device;
[0056] In this embodiment, the auto-negotiation module manages the auto-negotiation process according to the logical flow of the auto-negotiation state machine. When exchanging pages with the peer device, the local device sends the link parameter information supported by the local device to the peer device through auto-negotiation frames, and simultaneously receives auto-negotiation frames sent by the peer device and parses the parameter information.
[0057] Secondly, analyze the link parameters supported by the peer device, such as communication rate, duplex mode, and forward error correction configuration. By comparing these parameters with those supported by the local device, identify the parameter combinations supported by both devices.
[0058] For example, regarding communication speed, the auto-negotiation module will prioritize the higher speed supported by both parties to improve data transmission efficiency. If the local device supports 10Mbps, 100Mbps, and 1Gbps, while the remote device supports 100Mbps and 1Gbps, then the auto-negotiation module will prioritize 1Gbps as the negotiated speed.
[0059] Furthermore, since full-duplex mode allows for simultaneous data transmission and reception, significantly improving data transmission efficiency, the auto-negotiation module prioritizes negotiating full-duplex mode. If neither party supports full-duplex mode, half-duplex mode is considered.
[0060] For forward error correction configuration, the auto-negotiation module will negotiate based on actual needs and the capabilities of both devices. If the data transmission environment is complex and prone to interference and errors, enabling forward error correction can enhance data transmission reliability; if the transmission environment is relatively stable, this function can be disabled to save system resources.
[0061] Specifically, the self-negotiation module also sorts different parameter combinations according to a preset priority order. During the negotiation process, it first tries to negotiate parameter combinations with higher priority. If the negotiation is successful, the parameter combination is determined to be the optimal link parameter; if the negotiation fails, it continues to try the next parameter combination with the next higher priority.
[0062] During the negotiation process, the self-negotiation state machine is continuously updated, and corresponding operations are performed based on different states. For example, while waiting for a response from the peer device, the self-negotiation module continuously monitors whether a response signal is received from the peer; if a response signal is received, it enters the state of parsing the signal and comparing parameters.
[0063] Through the above methods, the self-negotiation module can negotiate and determine the optimal link parameters based on the page exchange and signal parsing results with the peer device, thereby improving the performance and stability of the link and meeting the data transmission needs of different application scenarios.
[0064] Specifically, step S30 in the method includes:
[0065] The auto-negotiation module controls the state transitions of the auto-negotiation state machine, sequentially completing the transitions between the capability exchange state, parameter confirmation state, and link ready state.
[0066] In the capability exchange state, the sending end sends the basic page and extended page containing the local capability to the peer device through the sending end framing logic, and at the same time, the receiving end parses the received peer page data through the receiving end unlocking logic.
[0067] Based on the parsed peer device capability parameters, compare them item by item with the capability parameters supported by the local device to identify the combination of communication capabilities supported by both parties.
[0068] From the identified combinations of commonly supported communication capabilities, link parameter combinations are selected in descending order of communication rate, and the optimal link parameters are confirmed in the parameter confirmation state. The optimal link parameters are the link parameter combinations corresponding to the highest communication rate commonly supported by both parties.
[0069] When a response timeout or verification error occurs during page exchange, the error recovery process is automatically triggered, and the unacknowledged page data is resent.
[0070] In this embodiment, the auto-negotiation module first enters the capability exchange state by controlling the state transition of the auto-negotiation state machine. In the capability exchange state, the sending end's framing logic assembles the base page containing its own capabilities and the extended page into a frame and sends it to the peer device. Simultaneously, the receiving end's unlocking logic actively parses the received peer page data to obtain the peer device's capability information.
[0071] Secondly, based on the parsed peer device capability parameters, the self-negotiation module compares each parameter with the local supported capability parameters to identify common communication capability combinations, including communication rate, duplex mode, and forward error correction support. For example, both devices may support 100Mbps and 1Gbps for communication rate; both may support full-duplex and half-duplex for duplex mode; and both may have common support options for forward error correction configuration.
[0072] Next, from the identified combinations of commonly supported communication capabilities, the auto-negotiation module selects link parameter combinations in descending order of communication speed, including communication speed, duplex mode, and forward error correction support. During parameter confirmation, the optimal link parameters are confirmed; these are the link parameter combinations corresponding to the highest communication speed jointly supported by both parties. For example, if both parties support 100Mbps and 1Gbps, the link parameter combination corresponding to 1Gbps is preferentially selected as the optimal link parameter combination.
[0073] However, during page exchange, if a response timeout or verification error occurs, the self-negotiation module automatically triggers an error recovery process. By resending the unacknowledged page data, it ensures that both parties can accurately exchange information and continue negotiation. During the resending process, the transmitted signals are more rigorously monitored and adjusted to improve signal quality and stability, reducing the possibility of errors recurring.
[0074] After completing the capability exchange and parameter confirmation states, the auto-negotiation state machine will enter the link-ready state. In this state, final configuration and adjustments are made based on the confirmed optimal link parameters to ensure that the link can transmit data with optimal performance. Simultaneously, the auto-negotiation module continuously monitors the link status, and if any anomalies are detected, timely measures are taken to adjust or renegotiate to ensure the stability and reliability of the link.
[0075] S40: The microcontroller monitors the link quality indicators of multiple channels in real time. If the link quality indicators are lower than the preset threshold, the page data in the static random access memory is dynamically modified and a renegotiation process is triggered.
[0076] In this embodiment, the microcontroller monitors the link quality indicators of multiple channels in real time. The link quality indicators include, but are not limited to, bit error rate, signal strength, and packet loss rate.
[0077] Bit error rate reflects the proportion of errors that occur during data transmission. An excessively high bit error rate will reduce the reliability of data transmission. Signal strength directly affects the transmission distance and stability of data. If the signal strength is too low, data loss or transmission interruption may occur. Packet loss rate reflects the proportion of data packets lost during transmission. An excessively high packet loss rate will seriously affect the efficiency of data transmission.
[0078] When the link quality index of a certain channel is detected to be lower than a preset threshold, the microcontroller will react. First, it will dynamically modify the page data in the static random access memory. For example, if the bit error rate is too high, the microcontroller will adjust the forward error correction configuration to enhance data error correction capabilities; if the signal strength is too low, it will appropriately increase the transmission power and other related parameters.
[0079] After modifying the page data, the microcontroller triggers a renegotiation process. This renegotiation process is similar to the previous auto-negotiation process, but it is based on the modified page data. The auto-negotiation module will again follow the logic flow of the auto-negotiation state machine to exchange pages and resolve signals with the peer device. During this process, it will redetermine the link parameter combinations supported by both parties and select the optimal link parameters.
[0080] During the renegotiation process, the microcontroller performs more rigorous encoding and verification on the sent self-negotiation frames to ensure data accuracy and integrity. Simultaneously, when receiving response signals from the peer device, it performs more detailed parsing and analysis to avoid recurring issues that previously led to link quality degradation.
[0081] If the renegotiation process is successful, the link will transmit data according to the newly determined optimal link parameters, thereby improving link performance and stability. If the renegotiation process fails, the microcontroller will further investigate the problem, possibly attempting multiple renegotiations or issuing an alert to notify maintenance personnel for manual intervention, to ensure the link can return to normal operation as soon as possible.
[0082] Specifically, step S40 in the method includes:
[0083] The microcontroller periodically collects bit error rate, signal amplitude and clock jitter parameters of multiple channels, and performs weighted calculations on each parameter to obtain a comprehensive link quality index.
[0084] The comprehensive link quality index is compared with a preset quality threshold. When the comprehensive link quality index is lower than the preset quality threshold for multiple consecutive periods, it is determined that the link quality does not meet the requirements.
[0085] Based on the judgment results, the communication rate of page data in the static random access memory is modified, and the supported communication rate is adjusted to a level below the current communication rate.
[0086] The auto-negotiation module is triggered to restart the auto-negotiation process, and a new round of link parameter negotiation is conducted with the peer device using the modified page data. The modification of the page data includes at least a downgrade adjustment of the communication rate parameters and an update of the corresponding forward error correction configuration.
[0087] In this embodiment, the microcontroller first periodically collects bit error rate, signal amplitude, and clock jitter parameters from multiple channels. The bit error rate reflects the accuracy of data transmission, signal amplitude monitoring helps determine signal strength and stability, and clock jitter reflects the accuracy and stability of the clock signal. The microcontroller performs weighted calculations on the collected parameters to obtain a comprehensive link quality index. Different parameters are assigned different weights based on their impact on link quality; for example, the bit error rate has a greater impact on data transmission reliability, so it is given a higher weight.
[0088] For example, the weights of bit error rate, signal amplitude, and clock jitter are 0.6, 0.3, and 0.1, respectively. If the bit error rate of a certain channel is 0.01, the signal amplitude is 0.8, and the clock jitter is 0.05, then the comprehensive link quality index = 0.01 × 0.6 + 0.8 × 0.3 + 0.05 × 0.1 = 0.251.
[0089] Secondly, the obtained comprehensive link quality index is compared with a preset quality threshold. When the comprehensive link quality index is lower than the preset quality threshold for several consecutive periods, the microcontroller determines that the link quality does not meet the requirements. This determination process avoids misjudgment due to index fluctuations caused by random factors, ensuring the accuracy and reliability of the determination results.
[0090] If the link quality is determined to be unsatisfactory, the microcontroller will adjust the communication rate of page data in the static random access memory (SRAM) based on this result. The supported communication rate will be adjusted to a level below the current rate, for example, from 1Gbps to 100Mbps. Simultaneously, the corresponding forward error correction configuration will be updated to accommodate the adjusted communication rate. Lower communication rates may require stronger forward error correction capabilities to ensure data transmission accuracy.
[0091] Finally, the microcontroller triggers the auto-negotiation module to restart the auto-negotiation process. In this new round of link parameter negotiation, the auto-negotiation module uses the modified page data to exchange pages and resolve signals with the peer device. Following the logic of the auto-negotiation state machine again, it determines the link parameter combinations supported by both sides and selects the optimal link parameters from them.
[0092] S50: Based on the negotiation results, reconfigure the transmitting and receiving parameters of SerDes, and notify the external system chip of the final link parameters through the interrupt controller, thus completing the link auto-negotiation and system initialization.
[0093] In this embodiment, after negotiating the link parameters, the transmitting and receiving parameters of the SerDes are reconfigured based on the optimal link parameters obtained through negotiation. For the transmitting end, parameters such as signal transmission power, modulation method, and encoding format are adjusted to ensure that the signal can be transmitted accurately and efficiently. For example, if the negotiated communication rate is high, it may be necessary to increase the transmission power to ensure the signal strength during transmission.
[0094] For the receiving end, adjustments are made to the receiver sensitivity, equalizer parameters, and clock recovery circuit to ensure accurate reception and interpretation of signals sent from the transmitting end. For example, the receiver sensitivity is adjusted according to the signal strength and transmission distance to ensure stable signal reception in different environments; and equalizer parameters are adjusted to compensate for signal distortion and attenuation during transmission, thereby improving signal quality.
[0095] Furthermore, after reconfiguring the parameters of the SerDes transmitter and receiver, the interrupt controller notifies the external system chip of the finalized link parameters. Upon receiving the parameters, the external system chip performs system initialization operations to enable the entire system to operate normally under the new link parameters.
[0096] During the notification process to the external system chip, the interrupt controller performs data transmission. It packages and encodes the link parameters and sends them to the external system chip via a specific communication interface. Simultaneously, it sets the appropriate interrupt flags to ensure that the external system chip can respond and process the parameters promptly.
[0097] After link auto-negotiation and system initialization are completed, the entire system will enter a stable operating state. During subsequent operation, the microcontroller will continue to monitor link quality indicators in real time, and will promptly trigger a renegotiation process if any link quality issues are detected.
[0098] Specifically, step S50 in the method includes:
[0099] The microcontroller reads the optimal link parameters determined through negotiation, reconfigures the working clock and pre-emphasis parameters of the SerDes transmitter according to the target communication rate, and simultaneously configures the equalizer parameters and clock data recovery circuit of the receiver.
[0100] Based on the duplex mode configuration and forward error correction enable status, set the working mode of the corresponding functional modules of SerDes.
[0101] The interrupt controller sends an interrupt request to an external system chip and passes the optimal link parameters in the interrupt service routine.
[0102] After receiving the configuration confirmation signal from the external system chip, the link auto-negotiation and system initialization process is completed.
[0103] In this embodiment, the microcontroller first reads the negotiated optimal link parameters. Based on the target communication rate, it reconfigures the operating clock and pre-emphasis parameters of the SerDes transmitter. Adjusting the operating clock directly affects the data transmission rate and timing. The pre-emphasis parameters are set to compensate for high-frequency attenuation during transmission and improve signal quality. For example, at higher communication rates, the pre-emphasis amplitude needs to be increased to ensure accurate signal recognition even after long-distance transmission.
[0104] Simultaneously, the equalizer parameters and clock data recovery circuit at the receiving end are configured. Adjusting the equalizer parameters can compensate for signal distortion and attenuation during transmission, allowing the receiving end to better recover the original signal. The clock data recovery circuit is used to extract an accurate clock signal from the received signal, ensuring correct data sampling and parsing.
[0105] Then, based on the full-duplex mode configuration and forward error correction enabled status, the operating mode of the corresponding SerDes functional modules is set. If the negotiated mode is full-duplex, then SerDes needs to support both data transmission and reception simultaneously, and the functional modules need to be configured accordingly to achieve bidirectional communication. If forward error correction is enabled, the relevant error correction modules need to be activated, and parameters need to be set according to the negotiated error correction configuration to enhance the reliability of data transmission.
[0106] Next, the interrupt controller sends an interrupt request to the external system chip. When sending the interrupt request, it operates according to a specific protocol and format to ensure that the external system chip can correctly recognize and respond to it. Simultaneously, the negotiated optimal link parameters are passed in the interrupt service routine. These optimal link parameters are packaged and encoded, and then passed to the external system chip through the interrupt service routine's interface so that it can perform subsequent system initialization operations.
[0107] Finally, wait for the configuration confirmation signal from the external system chip. Upon receiving this signal, it indicates that the external system chip has successfully received the link parameters and completed the corresponding configuration, thus completing the link auto-negotiation and system initialization process.
[0108] Specifically, the process involves reading the negotiated optimal link parameters through the microcontroller, reconfiguring the SerDes transmitter's operating clock and pre-emphasis parameters according to the target communication rate, and simultaneously configuring the receiver's equalizer parameters and clock data recovery circuit, including:
[0109] Calculate and set the clock division ratio of the SerDes transmitter phase-locked loop based on the target communication rate, and obtain a transmission clock that matches the target rate;
[0110] Based on the channel characteristics corresponding to the target communication rate, configure the pre-emphasis coefficient of the transmitting driver;
[0111] Based on the target communication rate, set the gain parameter of the continuous-time linear equalizer at the receiving end, and simultaneously configure the bandwidth parameter of the clock data recovery circuit at the receiving end so that the bandwidth parameter matches the target communication rate.
[0112] The configuration values of the pre-emphasis coefficient and the equalizer gain parameter are positively correlated with the target communication rate.
[0113] In this embodiment, firstly, the clock division ratio of the phase-locked loop (PLL) at the SerDes transmitter is calculated and set according to the target communication rate. The PLL at the SerDes transmitter generates a stable clock signal, and the setting of the clock division ratio directly affects the frequency of the transmission clock. By calculating and setting the division ratio, a transmission clock matching the target rate is obtained, ensuring that data is transmitted at an accurate rate. For example, when the target communication rate is high, a suitable division ratio is set to increase the transmission clock frequency accordingly to meet the requirements of high-speed data transmission.
[0114] For example, the reference clock chip has a fixed base speed, such as 100 MHz; the parallel bit length is the number of data bits that the SerDes transmitter can transmit simultaneously per clock cycle, such as 8 bits; and the multiplication factor is an integer supported by the chip that can speed up the reference clock, such as 10.
[0115] First, calculate the required transmission clock using the formula: "Required transmission clock = Target communication rate / Parallel bit width". To achieve a transmission rate of 1000 megabits per second with a parallel bit width of 8, the required transmission clock is 1000 megabits per second / 8 = 125 megahertz.
[0116] Then, the PLL frequency division ratio is calculated using the formula: "PLL frequency division ratio = (reference clock × multiplication factor) / required transmission clock". With a reference clock of 100 MHz, a multiplication factor of 10, and a required transmission clock of 125 MHz, the frequency division ratio is (100 MHz × 10) / 125 MHz = 8. Setting the frequency division ratio to 8 yields a transmission clock that matches the target rate.
[0117] Secondly, based on the channel characteristics corresponding to the target communication rate, the pre-emphasis coefficient of the transmitter driver is configured. Different communication rates face varying degrees of high-frequency attenuation during transmission through the channel, and the pre-emphasis coefficient configuration can compensate for this attenuation. For higher target communication rates, the high-frequency components of the signal are more easily attenuated during transmission, therefore the pre-emphasis coefficient needs to be increased to enhance the high-frequency components of the signal, ensuring that the signal can still be accurately identified after long-distance transmission; while for lower communication rates, the pre-emphasis coefficient can be appropriately decreased. Furthermore, channel characteristics, such as the length and material of the transmission line, and channel characteristics with high loss, are considered, and the pre-emphasis coefficient is adjusted accordingly.
[0118] Next, the gain parameters of the continuous-time linear equalizer at the receiving end are set according to the target communication rate. The continuous-time linear equalizer compensates for signal distortion and attenuation during transmission; adjusting the gain parameters allows the receiver to better recover the original signal. When the target communication rate changes, the signal distortion and attenuation will also differ, requiring corresponding adjustments to the gain parameters. Simultaneously, the bandwidth parameters of the clock data recovery circuit at the receiving end are configured to match the target communication rate. The bandwidth parameters of the clock data recovery circuit affect the ability to extract an accurate clock signal from the received signal, and thus influence data sampling and parsing.
[0119] Furthermore, the configuration values of the pre-emphasis coefficient and equalizer gain parameter are positively correlated with the target communication rate. As the target communication rate increases, both the pre-emphasis coefficient and equalizer gain parameter need to be increased accordingly to ensure the quality and accuracy of the signal during high-speed transmission.
[0120] The above configuration method enables SerDes to achieve stable and efficient data transmission at different communication rates, providing a strong guarantee for the normal operation of the entire system.
[0121] In summary, compared to existing technologies, this application precisely adjusts the transmitting end's operating clock, pre-emphasis parameters, and the receiving end's equalizer parameters and clock data recovery circuit according to the target communication rate, enabling SerDes to transmit data stably and efficiently at different communication rates. Furthermore, by notifying the external system chip of the final link parameters through the interrupt controller, it ensures that the entire system can quickly complete initialization and enter a stable operating state under the new link parameters.
[0122] In summary, the embodiments of this application have at least the following technical effects:
[0123] This application provides a method for implementing link auto-negotiation based on the Ethernet protocol. First, the auto-negotiation subsystem is instantiated based on the protocol configuration register, ensuring accurate activation of the auto-negotiation function under the Ethernet protocol and avoiding unnecessary resource consumption under non-Ethernet protocols. Second, the microcontroller reads page data from the static random access memory and configures the transmission of auto-negotiation frames. Differential Manchester encoding and dynamic adjustment of timing parameters ensure that the auto-negotiation frames meet the physical layer transmission requirements of the target rate, improving the accuracy and efficiency of negotiation. Third, the auto-negotiation module performs state machine management, determining optimal link parameters through page switching and signal parsing. During state transitions such as capability exchange and parameter confirmation, it accurately identifies the combination of communication capabilities supported by both parties, selects the link parameters corresponding to the highest communication rate, and possesses an error recovery mechanism, enhancing the reliability of negotiation. Finally, the microcontroller monitors link quality indicators in real time. When the indicators fall below a preset threshold, it dynamically modifies page data and triggers renegotiation. It can dynamically adjust the communication rate and related configurations according to the actual link conditions, ensuring that the link always maintains good performance. Finally, based on the negotiation results, the SerDes transmitter and receiver parameters are reconfigured, and the external system chip is notified to complete system initialization, enabling the entire link system to be quickly and stably put into use. Through the above technical solution, this application can dynamically adjust negotiation strategies and parameters according to actual network conditions and equipment capabilities, monitor and manage multi-channel link quality in real time, improve the efficiency of link negotiation and the overall performance and stability of the link, and has high practicality and promotional value.
[0124] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0125] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0126] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.
Claims
1. A method for implementing link auto-negotiation based on the Ethernet protocol, characterized in that, The method includes: Based on the identifier of the configuration register according to the SerDes IP protocol, determine and instantiate the auto-negotiation subsystem; The microcontroller in the auto-negotiation subsystem reads page data pre-stored in static random access memory, configures and sends auto-negotiation frames. The auto-negotiation module is used to perform auto-negotiation state machine management. Based on the page exchange and signal parsing results with the peer device, the optimal link parameters are negotiated and determined. The microcontroller monitors the link quality indicators of multiple channels in real time. If the link quality indicators are lower than the preset threshold, the page data in the static random access memory is dynamically modified and a renegotiation process is triggered. Based on the negotiation results, the SerDes transmitter and receiver parameters are reconfigured, and the final link parameters are notified to the external system chip through the interrupt controller, thus completing the link auto-negotiation and system initialization. The process of reading page data pre-stored in static random access memory through the microcontroller in the auto-negotiation subsystem, configuring and sending auto-negotiation frames includes: Read page data from the base page and extended page sequentially from the static random access memory; Differential Manchester encoding is performed on the page data, and the timing parameters during the encoding process are dynamically adjusted according to the current link rate to obtain an auto-negotiation frame that meets the physical layer transmission requirements of the target rate. Start the self-negotiation state machine, send the self-negotiation frames in the order of the preset negotiation priority, and monitor the response signal of the peer device at the same time; Page data of the base page and extended page are read sequentially from static random access memory, including: Read the device capability parameters, which include at least the communication rate, duplex mode, and forward error correction support capability; Read priority parameters, which include at least the page sending priority and negotiation timeout settings; Read the constraint parameters, which include at least the minimum communication rate requirement and the maximum bit error rate tolerance; The basic page mainly includes device capability parameters and page sending priority, while the extended page mainly includes extended device capability parameters, constraint parameters, and negotiation timeout settings. The auto-negotiation module performs auto-negotiation state machine management, negotiating and determining optimal link parameters based on page exchange and signal parsing results with the peer device, including: The auto-negotiation module controls the state transitions of the auto-negotiation state machine, sequentially completing the transitions between the capability exchange state, parameter confirmation state, and link ready state. In the capability exchange state, the sending end sends the basic page and extended page containing the local capability to the peer device through the sending end framing logic, and at the same time, the receiving end parses the received peer page data through the receiving end unlocking logic; Based on the parsed peer device capability parameters, compare them item by item with the capability parameters supported by the local device to identify the combination of communication capabilities supported by both parties. From the identified combinations of commonly supported communication capabilities, link parameter combinations are selected in descending order of communication rate, and the optimal link parameters are confirmed in the parameter confirmation state. The optimal link parameters are the link parameter combinations corresponding to the highest communication rate commonly supported by both parties. When a response timeout or verification error occurs during page exchange, the error recovery process is automatically triggered, and the unacknowledged page data is resent.
2. The method for implementing link auto-negotiation based on Ethernet protocol according to claim 1, characterized in that, Based on the identifier in the SerDes IP protocol configuration register, determine and instantiate the auto-negotiation subsystem, including: The protocol type field of the protocol configuration register is parsed. If the protocol type is Ethernet, the auto-negotiation subsystem is automatically instantiated. The auto-negotiation subsystem includes a microcontroller, an auto-negotiation module, and static random access memory. If the protocol type is not Ethernet, only the basic SerDes transmit and receive functions are retained, and the auto-negotiation subsystem is not instantiated.
3. The method for implementing link auto-negotiation based on Ethernet protocol according to claim 1, characterized in that, The microcontroller monitors the link quality indicators of multiple channels in real time. If the link quality indicator is lower than a preset threshold, it dynamically modifies the page data in the static random access memory and triggers a renegotiation process, including: The microcontroller periodically collects bit error rate, signal amplitude and clock jitter parameters of multiple channels, and performs weighted calculations on each parameter to obtain a comprehensive link quality index. The comprehensive link quality index is compared with a preset quality threshold. When the comprehensive link quality index is lower than the preset quality threshold for multiple consecutive periods, it is determined that the link quality does not meet the requirements. Based on the judgment results, the communication rate of page data in the static random access memory is modified, and the supported communication rate is adjusted to a level below the current communication rate. The auto-negotiation module is triggered to restart the auto-negotiation process, and a new round of link parameter negotiation is conducted with the peer device using the modified page data. The modification of the page data includes at least a downgrade adjustment of the communication rate parameters and an update of the corresponding forward error correction configuration.
4. The method for implementing link auto-negotiation based on Ethernet protocol according to claim 1, characterized in that, Based on the negotiation results, the SerDes transmitter and receiver parameters are reconfigured, and the final link parameters are notified to the external system chip via the interrupt controller, completing the link auto-negotiation and system initialization, including: The microcontroller reads the optimal link parameters determined through negotiation, reconfigures the working clock and pre-emphasis parameters of the SerDes transmitter according to the target communication rate, and simultaneously configures the equalizer parameters and clock data recovery circuit of the receiver. Based on the duplex mode configuration and forward error correction enable status, set the working mode of the corresponding functional modules of SerDes. The interrupt controller sends an interrupt request to an external system chip and passes the optimal link parameters in the interrupt service routine. After receiving the configuration confirmation signal from the external system chip, the link auto-negotiation and system initialization process is completed.
5. The method for implementing link auto-negotiation based on Ethernet protocol according to claim 4, characterized in that, The microcontroller reads the negotiated optimal link parameters, reconfigures the SerDes transmitter's operating clock and pre-emphasis parameters according to the target communication rate, and simultaneously configures the receiver's equalizer parameters and clock data recovery circuit, including: Calculate and set the clock division ratio of the SerDes transmitter phase-locked loop based on the target communication rate, and obtain a transmission clock that matches the target rate; Based on the channel characteristics corresponding to the target communication rate, configure the pre-emphasis coefficient of the transmitting driver; Based on the target communication rate, set the gain parameter of the continuous-time linear equalizer at the receiving end, and simultaneously configure the bandwidth parameter of the clock data recovery circuit at the receiving end so that the bandwidth parameter matches the target communication rate. The configuration values of the pre-emphasis coefficient and the equalizer gain parameter are positively correlated with the target communication rate.