Method and electronic device for realizing forced connection of GMAC port
By detecting the fixed-link node in the ACPI node and obtaining the forced setting parameters, the problem of forced connection of the GMAC port under UEFI firmware is solved, and the flexibility of forced connection of the GMAC port and switch initialization configuration under UEFI firmware is achieved.
Patent Information
- Application Number
- CN202311290499.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-09-28
AI Technical Summary
Existing technology cannot achieve forced connectivity of the GMAC port under UEFI firmware, which limits system development selectivity and switch initialization configuration flexibility.
By obtaining the ACPI node when the GMAC driver loads and configures the PHY, detecting the fixed-link node, pausing the MII bus registration of the PHY, obtaining the mandatory setting parameters in the ACPI description when the PHY is initialized, and registering the fixed PHY associated with the GMAC, the enforcement is achieved. Link mode settings.
It enables GMAC port forced connectivity under UEFI firmware, provides a diversity of development options, and allows initial configuration by upgrading the switch's bin file, avoiding the need to change the UEFI firmware each time.
Smart Images

Figure CN117376126B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for implementing forced connection of a GMAC port and an electronic device. Background Art
[0002] The domestic Feiteng platform uboot firmware is equipped with the system to implement forced initialization of the GMAC controller under the system according to the device node description, but the UEFI ACPI description still does not support the function.
[0003] Specifically, the current system driver does not support obtaining UEFI ACPI descriptions to implement GMAC (Gigabit Media Access Controller) forced link gigabit full-duplex function. The existing technology can only implement GMAC forced link under the uboot device tree description. If UEFI firmware is used, it cannot support forced GMAC link, which hinders development. Summary of the invention
[0004] In view of the above technical problems, the present invention provides a method for implementing forced connection of a GMAC port and an electronic device to solve the firmware update problem of a complex system in the prior art.
[0005] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0006] According to one aspect of the present invention, a method for implementing forced connectivity of a GMAC port is provided, the method comprising:
[0007] When the GMAC driver loads and configures the PHY, it obtains the ACPI node of the corresponding network interface and checks whether there is a fixed-link node;
[0008] If the fixed-link node exists under the ACPI node, suspending the MII bus registration of the PHY;
[0009] When initializing the PHY, it is detected whether the fixed-link node exists. If so, the parameters for forcibly setting the fixed link mode under the ACPI description are obtained, and the fixed_PHY is registered according to the obtained parameters, and the registered fixed_PHY is associated with the corresponding GMAC.
[0010] Furthermore, the parameters include half-full-duplex and rate.
[0011] According to another aspect of the present invention, there is provided an electronic device, comprising:
[0012] A processor, the processor being used to obtain an ACPI node corresponding to a network interface and detect whether a fixed-link node exists when a GMAC driver loads and configures a PHY;
[0013] If the fixed-link node exists under the ACPI node, suspending the MII bus registration of the PHY;
[0014] When initializing the PHY, it is detected whether the fixed-link node exists. If so, the parameters for forcibly setting the fixed link mode under the ACPI description are obtained, and the fixed_PHY is registered according to the obtained parameters, and the registered fixed_PHY is associated with the corresponding GMAC.
[0015] Furthermore, the parameters include half-full-duplex and rate.
[0016] The technical solution of the present invention has the following beneficial effects:
[0017] By adopting the method of the present invention, it is not necessary to select the uboot firmware as the development, and the UEFI firmware can also be selected, so that there is a variety of choices to suit different scenarios;
[0018] The method of the present invention is used with a switch that can manage itself. During the debugging stage, the initialization configuration of the switch can be realized by upgrading the bin file of the switch without changing the uefi firmware every time.
[0019] Furthermore, the developer can inform the system of the method of the present invention through the UEFI firmware ACPI description according to the needs, so that the system correctly loads the corresponding PHY driver according to the description to achieve forced link connectivity. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 The figure is a flow chart of the principle of the method of the embodiment of this specification. DETAILED DESCRIPTION
[0021] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0022] like Figure 1 As shown, the embodiment of this specification provides a method for implementing forced connectivity of a GMAC port, the method specifically comprising steps S101-S103:
[0023] In step S101, when the GMAC driver loads and configures the PHY, the ACPI node of the corresponding network interface is obtained to detect whether a fixed-link node exists.
[0024] Among them, GMAC (Gigabit Media Access Controller) refers to the Ethernet physical layer interface. In the operating system, the ACPI node is a hierarchical structure used to represent and organize hardware devices and their functions. By analyzing the ACPI node, the device information and configuration can be obtained. The fixed-link node is a node in the ACPI description, which is used to represent a network card with fixed link characteristics, specifically indicating that the network card does not need to determine the link mode and parameters through automatic negotiation.
[0025] In step S102, if the fixed-link node exists under the ACPI node, the MII bus registration of the PHY is suspended.
[0026] Specifically, if there is a fixed-link node in the ACPI description of the network card, it means that the network card has a fixed link feature. At this time, it is not necessary to register the MII (Media Independent Interface) bus of the ordinary PHY (PHYsical Layer). Among them, PHY is the converter between the network interface controller and the physical medium, and MII is the interface standard for connecting PHY and MAC (Media Access Control).
[0027] In step S103, when initializing the PHY, it is detected whether the fixed-link node exists. If so, the parameters for forcibly setting the fixed link mode under the ACPI description are obtained, and the fixed_PHY is registered according to the obtained parameters, and the registered fixed_PHY is associated with the corresponding GMAC.
[0028] Specifically, when initializing PHY, it is also necessary to determine whether there is a fixed-link node. If it exists, obtain the relevant mandatory link parameters from the ACPI description, such as half-duplex mode, rate, etc. Then, according to the obtained parameters, correctly register the corresponding fixed_PHY and associate it with the corresponding GMAC (Gigabit Media Access Controller). fixed_PHY refers to fixed PHY, which is a PHY instance hard-coded in the driver and can represent a PHY device with fixed link characteristics. In half-duplex mode, the communicating parties can send and receive data alternately, but cannot send and receive at the same time. Rate refers to the transmission rate of the network interface.
[0029] Based on the above method, you do not have to choose uboot firmware for development, you can also choose UEFI firmware, so that there is a variety of choices to suit different scenarios; the above method is used with a switch that can manage itself. During the debugging phase, the initialization configuration of the switch can be achieved by upgrading the bin file of the switch without changing the uefi firmware every time; further, the developer can inform the system of the above method through the UEFI firmware ACPI description according to needs, so that the system can correctly load the corresponding PHY driver according to the description to achieve forced link connectivity.
[0030] Based on the same content, in one embodiment, an electronic device is provided, including:
[0031] A processor, the processor being used to obtain an ACPI node corresponding to a network interface and detect whether a fixed-link node exists when a GMAC driver loads and configures a PHY;
[0032] If the fixed-link node exists under the ACPI node, suspending the MII bus registration of the PHY;
[0033] When initializing the PHY, it is detected whether the fixed-link node exists. If so, the parameters for forcibly setting the fixed link mode under the ACPI description are obtained, and the fixed_PHY is registered according to the obtained parameters, and the registered fixed_PHY is associated with the corresponding GMAC.
[0034] The contents not explained in the device embodiment can refer to the method embodiment, and the details not disclosed can refer to the implementation method content of the method part, so they will not be repeated here.
[0035] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention. In addition, those skilled in the art can understand that although some embodiments described herein include certain features included in other embodiments instead of other features, the combination of features of different embodiments means that they are within the scope of the present invention and form different embodiments. For example, in the above claims, any one of the embodiments claimed for protection can be used in any combination. The information disclosed in this background technology section is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as admitting or suggesting in any form that the information constitutes prior art known to those skilled in the art.
Claims
1. A method for implementing forced connectivity of a GMAC port, characterized in that: The method comprises: When the Gigabit Ethernet Media Network Controller (GMAC) driver loads the configuration port physical layer (PHY), obtain the organizational hardware device and function (ACPI) node of the corresponding network interface and detect whether there is a fixed-link mode (fixed-link) node; If the fixed-link node exists under the ACPI node, suspending the media independent interface (MII) bus registration of the PHY; When initializing the PHY, it is detected whether the fixed-link node exists. If so, the parameters for forcibly setting the fixed link mode under the ACPI description are obtained, and the fixed physical layer (fixed_PHY) is registered according to the obtained parameters, and the registered fixed_PHY is associated with the corresponding GMAC.
2. The method for implementing forced connection of GMAC ports according to claim 1, characterized in that: The parameters include half-duplex, full-duplex, and rate.
3. An electronic device for realizing forced connection of a GMAC port, characterized in that: include: A processor, wherein the processor is used to execute the method for implementing the forced connectivity of the GMAC port as described in claim 1.
4. The electronic device for implementing forced connection of GMAC ports according to claim 3, characterized in that: The parameters include half-duplex, full-duplex, and rate.
Citation Information
Patent Citations
Method and apparatus for loading port driver of network appliance physical layer
CN101222526A
Network port state update method based on built-in GMAC network controller of Feiteng processor
CN108632084A
