Method, system, terminal and storage medium for realizing SMI protocol through IO simulation

文档序号:1952539 发布日期:2021-12-10 浏览:13次 中文

阅读说明:本技术 通过io模拟实现smi协议的方法、系统、终端及存储介质 (Method, system, terminal and storage medium for realizing SMI protocol through IO simulation ) 是由 张博昱 于 2021-08-05 设计创作,主要内容包括:本发明涉及通过IO模拟实现SMI协议的方法,包括以下步骤:接收主控芯片发送的网卡配置数据;依据设定数据模拟转换规则,通过IO控制器控制GPIO模拟SMI总线数据发送至网卡PHY;网卡PHY依据接收到的模拟数据进行网卡配置;应用本申请的方式方法,可以通过GPIO来模拟实现SMI协议,达到与网卡PHY通信,而每个设备都有GPIO,所以这样模拟SMI协议,具有通用性,可以使那些没有SMI控制器的设备,也具有与网卡PHY通信的能力,扩展了设备实用性能。(The invention relates to a method for realizing SMI protocol through IO simulation, which comprises the following steps: receiving network card configuration data sent by a main control chip; according to the set data analog conversion rule, the GPIO is controlled by the IO controller to simulate SMI bus data to be sent to the network card PHY; the network card PHY configures the network card according to the received analog data; by applying the method, the SMI protocol can be simulated and realized through the GPIO, so that the communication with the network card PHY is realized, and each device has the GPIO, so that the SMI protocol is simulated, the method has universality, the devices without the SMI controller can also have the communication capability with the network card PHY, and the practical performance of the devices is expanded.)

1. A method for realizing SMI protocol through IO simulation is characterized by comprising the following steps:

the first step is as follows: receiving network card configuration data sent by a main control chip;

the second step is that: according to the set data analog conversion rule, the GPIO is controlled by the IO controller to simulate SMI bus data to be sent to the network card PHY;

the third step: and the network card PHY performs network card configuration according to the received analog data.

2. A method according to claim 1, wherein in the second step, the GPIO simulates the numerical values on the SMI bus in the following manner:

value 1: lowering MDC GPIO, raising MDIO, delaying for 15-25us, and raising MDC GPIO;

value 0: pulling down MDC GPIO, pulling down MDIO, delaying for 15-25us, and pulling up MDC GPIO;

the application instructions are as follows:

3. a method for implementing an SMI protocol via IO emulation according to claim 2, wherein the write mode of the GPIO emulated SMI bus is:

4. a method for implementing an SMI protocol through IO simulation according to claim 2 or 3, wherein the read operation mode of the GPIO simulation SMI bus is as follows:

5. a system for implementing the SMI protocol by IO simulation, for implementing the method for implementing the SMI protocol by IO simulation as claimed in any one of claims 1 to 4, comprising a data receiving unit and a data simulating unit;

the data receiving unit is used for receiving network card configuration data sent by the main control chip;

and the data simulation unit is used for controlling GPIO simulation SMI bus data to be sent to the network card PHY through the IO controller according to the set data simulation conversion rule.

6. A system for implementing an SMI protocol by IO simulation according to claim 5, wherein the data simulation unit comprises a numerical simulation unit for simulating the numerical values 1 and 0 of the SMI bus.

7. A system for implementing an SMI protocol through IO simulation according to claim 6, wherein the data simulation unit includes a write operation simulation unit, and the write operation simulation unit is based on the numerical simulation unit and is configured to implement simulation of a write operation of the SMI bus.

8. A system according to claim 6 or 7, wherein the data simulation unit includes a read operation simulation unit, and the read operation simulation unit is based on the numerical simulation unit and is configured to simulate a read operation of an SMI bus.

9. A terminal for implementing an SMI protocol by IO simulation, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the method according to any of claims 1 to 4.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.

Technical Field

The invention relates to the technical field of android systems, in particular to a method, a system, a terminal and a storage medium for realizing an SMI protocol through IO simulation.

Background

SMI, i.e. serial management interface, also called MII management interface, comprises two signal lines MDC and MDIO, which is a protocol for communicating with the network card PHY. The android device can conveniently communicate with the PHY of the network card through the SMI controller, and different attributes are configured according to requirements.

However, not all devices have SMI controllers, which makes it difficult to communicate with the PHY of the network card and to configure it specifically.

Disclosure of Invention

The technical problem to be solved by the present invention is to provide a method for implementing an SMI protocol through IO simulation, a system for implementing an SMI protocol through IO simulation, a terminal for implementing an SMI protocol through IO simulation, and a computer-readable storage medium, aiming at the above-mentioned defects in the prior art.

The technical scheme adopted by the invention for solving the technical problems is as follows:

a method for realizing SMI protocol through IO simulation is constructed, wherein the method comprises the following steps:

the first step is as follows: receiving network card configuration data sent by a main control chip;

the second step is that: according to the set data analog conversion rule, the GPIO is controlled by the IO controller to simulate SMI bus data to be sent to the network card PHY;

the third step: and the network card PHY performs network card configuration according to the received analog data.

The method for realizing the SMI protocol through IO simulation, provided by the invention, comprises the following steps of:

value 1: lowering MDC GPIO, raising MDIO, delaying for 15-25us, and raising MDC GPIO;

value 0: pulling down MDC GPIO, pulling down MDIO, delaying for 15-25us, and pulling up MDC GPIO;

the application instructions are as follows:

the method for realizing the SMI protocol through IO simulation, provided by the invention, comprises the following steps of:

the method for realizing the SMI protocol through IO simulation, provided by the invention, comprises the following steps of:

a system for realizing SMI protocol through IO simulation is used for realizing the method for realizing SMI protocol through IO simulation, and comprises a data receiving unit and a data simulation unit;

the data receiving unit is used for receiving network card configuration data sent by the main control chip;

and the data simulation unit is used for controlling GPIO simulation SMI bus data to be sent to the network card PHY through the IO controller according to the set data simulation conversion rule.

The system for realizing the SMI protocol through IO simulation comprises a data simulation unit, wherein the data simulation unit comprises a numerical simulation unit, and the numerical simulation unit is used for simulating numerical values 1 and 0 of an SMI bus.

The system for realizing the SMI protocol through IO simulation is characterized in that the data simulation unit comprises a write operation simulation unit, and the write operation simulation unit is used for simulating the write operation of the SMI bus based on the numerical simulation unit.

The system for realizing the SMI protocol through IO simulation is characterized in that the data simulation unit comprises a read operation simulation unit, and the read operation simulation unit is used for simulating the read operation of the SMI bus based on the numerical simulation unit.

A terminal for implementing an SMI protocol by IO simulation, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described above.

A computer-readable storage medium, in which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the steps of the method as set forth above.

The invention has the beneficial effects that: by applying the method, the SMI protocol can be simulated and realized through the GPIO, so that the communication with the network card PHY is realized, and each device has the GPIO, so that the SMI protocol is simulated, the method has universality, the devices without the SMI controller can also have the communication capability with the network card PHY, and the practical performance of the devices is expanded.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described with reference to the accompanying drawings and embodiments, wherein the drawings in the following description are only part of the embodiments of the present invention, and for those skilled in the art, other drawings can be obtained without inventive efforts according to the accompanying drawings:

FIG. 1 is a flowchart of a method for implementing an SMI protocol via IO emulation according to a preferred embodiment of the present invention;

FIG. 2 is a schematic diagram of a method for implementing the SMI protocol by IO simulation according to the preferred embodiment of the present invention;

FIG. 3 is a schematic block diagram of a system for implementing the SMI protocol by IO emulation according to a preferred embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without inventive step, are within the scope of the present invention.

As shown in fig. 1, the method for implementing an SMI protocol through IO simulation in the preferred embodiment of the present invention includes the following steps:

s01: receiving network card configuration data sent by a main control chip;

s02: according to the set data analog conversion rule, the GPIO is controlled by the IO controller to simulate SMI bus data to be sent to the network card PHY;

s03: the network card PHY configures the network card according to the received analog data;

by applying the method, the SMI protocol can be simulated and realized through the GPIO, so that the communication with the network card PHY is realized, and each device has the GPIO, so that the SMI protocol is simulated, the method has universality, the devices without the SMI controller can also have the communication capability with the network card PHY, and the practical performance of the devices is expanded.

The background description is as follows:

in the SMI bus protocol, there are 2 signal lines: MDC and MDIO;

an MDC signal line which is a clock signal line;

2, MDIO signal line as data line;

3. a numerical signal 1 consisting of MDC low level + MDIO high level;

4. a value signal 0 consisting of MDC low level + MDIO low level;

a complete set of SMI bus protocols consists of:

1. a preamble consisting of a 32-bit value of 1;

2. a start code consisting of an array 01 of 2 bits;

3. an operation code consisting of 2-bit numerical values, 10 for reading and 01 for writing;

4. the PHY address of the network card consists of 5-bit PHY addresses;

5. the network card register address consists of a 5-bit register address;

turn around, consisting of 2 bits;

data, consisting of 16-bit data values;

preferably, in the second step, the mode of the GPIO simulating the numerical values on the SMI bus is as follows:

value 1: lowering MDC GPIO, raising MDIO, delaying for 15-25us, and raising MDC GPIO;

value 0: pulling down MDC GPIO, pulling down MDIO, delaying for 15-25us, and pulling up MDC GPIO;

the application instructions are as follows:

preferably, the write operation mode of the GPIO analog SMI bus is:

preferably, the read operation mode of the GPIO analog SMI bus is:

a system for implementing the SMI protocol through IO simulation, which is used for implementing the above method for implementing the SMI protocol through IO simulation, as shown in fig. 3, includes a data receiving unit 1 and a data simulating unit 2;

the data receiving unit 1 is used for receiving network card configuration data sent by the main control chip;

the data simulation unit 2 is used for controlling GPIO simulation SMI bus data to be sent to the network card PHY through the IO controller according to a set data simulation conversion rule;

by applying the method, the SMI protocol can be simulated and realized through the GPIO, so that the communication with the network card PHY is realized, and each device has the GPIO, so that the SMI protocol is simulated, the method has universality, the devices without the SMI controller can also have the communication capability with the network card PHY, and the practical performance of the devices is expanded.

Preferably, the data simulation unit 2 includes a numerical simulation unit 20, and the numerical simulation unit 20 is configured to simulate the numerical values 1 and 0 of the SMI bus; for a specific code execution manner, reference may be made to the above description, which is not described herein again.

Preferably, the data simulation unit 2 includes a write operation simulation unit 21, and the write operation simulation unit 21 is based on a numerical simulation unit and is configured to simulate a write operation of the SMI bus; for a specific code execution manner, reference may be made to the above description, which is not described herein again.

Preferably, the data simulation unit 2 includes a read operation simulation unit 22, and the read operation simulation unit 22 is based on a numerical simulation unit and is used for simulating the read operation of the SMI bus; for a specific code execution manner, reference may be made to the above description, which is not described herein again.

A terminal for implementing an SMI protocol by IO simulation, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the steps of the method as described above.

A computer-readable storage medium, in which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the steps of the method as set forth above.

It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:硬件识别方法、装置、电子设备和计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!