Method for transmitting VPP address based on GPIO, electronic equipment and storage medium
Through a GPIO-based method, pulse signals and data tables are used to map VPP addresses, and CRC checks are added to solve the problems of long cycles and low reliability when obtaining VPP addresses from frequency signals, achieving efficient and reliable VPP address acquisition and transmission. .
Patent Information
- Application Number
- CN202410795278.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-18
AI Technical Summary
In the prior art, when obtaining the VPP address through frequency signals, the cycle is long and the reliability is low. It is easily affected by electromagnetic interference and noise, resulting in signal distortion or errors, which reduces the efficiency and reliability of obtaining the VPP address.
Using a GPIO-based method, the first logic device sends pulse signals and request commands to the second logic device, uses a pre-stored data table to map the GPIO interface and VPP address, adds a CRC check to ensure the reliability of data transmission, and Determine valid GPIO interfaces in the polling sequence.
It shortens the time to obtain the VPP address, increases the information transmission rate, avoids frequency restrictions, increases the reliability of data transmission, avoids judgment errors when frequency is critical, and flexibly expands the number of GPIOs.
Smart Images

Figure CN118796741A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, electronic device and storage medium for transmitting a VPP address based on GPIO. Background Art
[0002] In recent years, with the rapid development of industries such as cloud computing, big data, and the Internet of Things, the demand for data storage in servers has increased dramatically. Among them, the virtual pin port (VPP) address is an important parameter used in the server to manage and configure the hot-swap function of non-volatile memory express interface solid-state drives (NVMe SSDs). Through the VPP address, the system can identify and control the status of NVMe SSD devices, such as turning on the NVMe SSD.
[0003] At present, the main way to obtain the VPP address is to send different frequencies to the mainboard CPLD through GPIO through the backplane CPLD, or the mainboard CPLD sends different frequencies to the backplane CPLD through GPIO. The party receiving the frequency data finds out the VPP address based on the detected frequency and the mapping table between the frequency and the VPP address.
[0004] However, the party receiving the data needs to sample and analyze the frequency signal, which takes a certain amount of time. When the frequency signal period is long, the sampling time will increase accordingly, resulting in a longer period for obtaining the VPP address. In addition, the frequency signal may be affected by electromagnetic interference, noise and other factors during transmission, resulting in signal distortion or error, reducing the reliability of the VPP address. Summary of the invention
[0005] The present application provides a method, electronic device and storage medium for transmitting a VPP address based on GPIO, so as to solve the problem of long cycle and low reliability when obtaining a VPP address through a frequency signal.
[0006] In a first aspect, the present application provides a method for transmitting a VPP address based on GPIO, which is applied to an electronic device, wherein the electronic device includes a first logic device and a second logic device, and the first logic device and the second logic device are connected through a plurality of general purpose input and output interfaces GPIO, and the method includes:
[0007] A pulse signal sent by the first logic device to all GPIO interfaces of the first logic device;
[0008] The first logic device sends a request command to the second logic device through the GPIO interface according to the polling order of the GPIO interface, wherein the request command is used to request a virtual port VPP address;
[0009] After receiving the request command, the second logic device determines the VPP address corresponding to the GPIO interface receiving the request command according to a pre-stored data table, wherein the data table includes a mapping relationship between each GPIO interface and the VPP address;
[0010] The first logic device receives the response information returned by the second logic device, and obtains the VPP addresses of all valid GPIO interfaces, wherein the response information includes the VPP address corresponding to the GPIO interface through which the second logic device receives the request command.
[0011] Optionally, the encoding format of the response information includes a multi-byte data portion and at least 1 byte of check bits.
[0012] Optionally, the data portion of the multiple bytes stores VPP addresses corresponding to multiple GPIO interfaces, and each byte stores a VPP address corresponding to a GPIO interface.
[0013] Optionally, the encoding format of the response information further includes a default identification bit corresponding to each byte, and the default identification bit is used to distinguish different GPIO interfaces in the byte data or different data types in the byte data.
[0014] Optionally, the response information also includes a cyclic redundancy check code CRC;
[0015] Accordingly, the method further includes:
[0016] The second logic device calculates the CRC by a preset CRC algorithm according to the VPP address in the response information;
[0017] After receiving the response information, the first logic device calculates the CRC to be checked by using a preset CRC algorithm according to the VPP address in the response information;
[0018] If the CRC to be checked is the same as the CRC, it is determined that the VPP address in the response information is credible;
[0019] If the CRC to be checked is not the same as the CRC, it is determined that the VPP address in the response information is unreliable.
[0020] Optionally, the method further includes:
[0021] The second logic device receives a pulse signal transmitted from the GPIO interface and determines a valid GPIO interface according to the pulse signal;
[0022] After the first logic device sends the request command to the second logic device through the GPIO interface, if no response message is received within a preset time period, the GPIO interface that does not receive the response message is determined to be an invalid GPIO interface.
[0023] Optionally, the request command includes an identifier of a requested VPP address and an identifier of a requested register data;
[0024] Accordingly, the method further includes:
[0025] The second logic device obtains register data according to the identifier of the request register data;
[0026] Write the register data into the response information.
[0027] Optionally, the transmission rate between the first logic device and the second logic device is any one of the following baud rates: 9600, 115200, 25000.
[0028] Optionally, the method further includes:
[0029] The first logic device sends a lighting signal to a corresponding second logic device according to the VPP addresses of all valid GPIO interfaces obtained;
[0030] The second logic device that receives the lighting signal lights up the hard disk indicator light according to the lighting signal.
[0031] In a second aspect, the present application further provides an electronic device, comprising: a first logic device and a second logic device, wherein the first logic device and the second logic device are connected via a plurality of general purpose input and output interfaces GPIO;
[0032] The electronic device is used to implement the method as described in any one of the first aspects.
[0033] Optionally, the first logic device is any one of the following devices: a mainboard management controller BMC, a central processing unit CPU, a mainboard complex programmable logic device MB CPLD, a field programmable gate array FPGA;
[0034] The second logic device is a backplane complex programmable logic device BP CPLD.
[0035] In a third aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, they are used to implement the method as described in any one of the first aspects.
[0036] In a fourth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any one of the first aspects above.
[0037] The present application provides a method, electronic device and storage medium for transmitting VPP addresses based on GPIO, the method comprising: a first logic device sends a pulse signal to all GPIO interfaces of the first logic device; the first logic device sends a request command to a second logic device through the GPIO interface according to the polling order of the GPIO interface, the request command is used to request the virtual port VPP address; after receiving the request command, the second logic device determines the VPP address corresponding to the GPIO interface receiving the request command according to a pre-stored data table, the data table includes a mapping relationship between each GPIO interface and the VPP address; the first logic device receives the response information returned by the second logic device, and obtains the VPP addresses of all valid GPIO interfaces, the response information includes the VPP address corresponding to the GPIO interface of the second logic device receiving the request command. The method can transmit information at a higher rate, and compared with the method of determining the VPP address by different frequencies, the time for obtaining the VPP address is shortened; the number of GPIOs connected by the method is no longer limited by the frequency, and can be flexibly expanded; in addition, the method directly transmits the request command, which can avoid the situation in the prior art where the frequency is at the critical point of the two sets of frequency ranges, and increase the reliability of the transmitted data. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0039] Figure 1 A schematic diagram of the hardware architecture of a back panel lighting in the prior art provided by this application;
[0040] Figure 2 A schematic diagram of the mapping relationship between frequency and VPP address in the prior art provided by this application;
[0041] Figure 3 A flowchart of a method for transmitting a VPP address based on GPIO provided in the present application;
[0042] Figure 4 A flowchart of a second embodiment of the method for transmitting a VPP address based on GPIO provided in the present application;
[0043] Figure 5 A schematic diagram of the encoding format of the MB CPLD initiating a request command provided in this application;
[0044] Figure 6A schematic diagram of the encoding format of the BP CPLD reply response information provided in this application;
[0045] Figure 7 A flowchart of a third embodiment of the method for transmitting a VPP address based on GPIO provided in the present application;
[0046] Figure 8 A schematic diagram of the structure of the electronic device provided in this application.
[0047] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0049] First, the nouns involved in this application are introduced:
[0050] Complex Programmable Logic Device (CPLD) is a digital integrated circuit that can be programmed by the user to implement specific logic functions, such as control logic, interface circuits, and data processing.
[0051] The Virtual Pin Port (VPP) address is an important parameter for managing and configuring the hot-swap function of the Non-Volatile Memory Express (NVMe) SSD. Through this address, the system can identify and control the status and operation of the device, such as turning on the NVMe SSD.
[0052] Cyclic Redundancy Check (CRC): It is used to detect errors in data transmission or storage. It generates a checksum by performing specific mathematical operations on the data. The receiver can verify the integrity of the data through the same operation.
[0053] General-Purpose Input / Output (GPIO) is a programmable digital signal pin that can be used as both an input pin and an output pin. GPIO is widely used in microcontrollers and single-chip microcomputers to connect and control various external devices.
[0054] Central Processing Unit (CPU): The core processing unit of a computer system, responsible for executing instructions in a computer program.
[0055] Serial communication bus standard (Inter-Integrated Circuit, referred to as: I2C): The I2C bus uses two wires (SDA and SCL) for data transmission, supports multi-host and multi-slave communication, and can be used to connect peripheral devices such as sensors, storage, and displays.
[0056] Figure 1 A schematic diagram of the hardware architecture of a back panel lighting system in the prior art provided in this application is shown as follows: Figure 1 As shown, in a server, switch or other electronic device, the mainboard is equipped with different numbers of NVMe backplanes, and the mainboard and the backplane are connected through multiple GPIO communication lines. The mainboard CPLD (BP CPLD) relies on the frequency sent by the backplane CPLD (MB CPLD) to distinguish different NVMe backplanes. The mainboard can determine a unique VPP address based on the frequency of the sent signal. The VPP address ultimately points to the address or identifier of the NVMeSSD mounted on the backplane under the CPU. After determining the VPP address, the CPU can send a lighting signal, which is sent to the BP CPLD through the MB CPLD. The BP CPLD lights up the backplane light on the corresponding port. The frequency generation module (Generate Frequency) in the BP CPLD generates a specific frequency signal and sends it to the mainboard. After determining the VPP address, the mainboard stores it in a register (Register, abbreviated as: REG).
[0057] It is also possible that the BP CPLD depends on the frequency sent by the mainboard MB CPLD to determine a unique VPP address. How to determine it depends on the hardware design.
[0058] However, in the above process of determining the VPP address, the VPP address corresponding to the GPIO interface needs to be determined according to the frequency of GPIO transmission.
[0059] Figure 2 This is a schematic diagram of the mapping relationship between frequency and VPP address in the prior art provided by this application. Figure 2As shown, multiple frequency ranges are set, each frequency range represents a VPP address, and the middle value of the frequency range is the standard frequency.
[0060] Determining the VPP address based on the frequency range has the following disadvantages:
[0061] 1. The party receiving the data needs to sample and analyze the frequency signal. This process takes a certain amount of time. When the period of the frequency signal is long, the sampling time will also increase accordingly, resulting in a longer period for obtaining the VPP address.
[0062] 2. When the transmission frequency is in the vicinity of two frequency ranges, misjudgment may occur.
[0063] 3. Frequency signals may be affected by electromagnetic interference, noise and other factors during transmission, resulting in signal distortion or error, and may also affect the sampling and analysis process, resulting in low data reliability.
[0064] 4. Due to frequency limitations, the number of GPIOs that can be used is limited.
[0065] 5. The amount of data that can be obtained is small, and the data transmission is slow. For example, when the frequency is 20Hz, the time of a single cycle is 0.05 seconds. Assuming that the GPIO transmission rate is 1Mbps, 60 data is sent through GPIO at a frequency of 20Hz, and 250KB of data transmission takes about 2s.
[0066] In view of the above problems, the present application provides a method for transmitting VPP addresses based on GPIO. A fixed baud rate is determined by a preset protocol between the MB CPLD and the BP CPLD, and a request for obtaining the VPP address and the VPP address can be directly transmitted. Therefore, the VPP address of each valid GPIO channel can be obtained by polling. In this way, the problems caused by the method of using different frequencies to represent different VPP addresses in the prior art can be avoided.
[0067] The hardware architecture of the present application is the same as the hardware architecture in the prior art, and the hardware architecture includes a first logic device and a second logic device, and the first logic device and the second logic device are connected through multiple general purpose input and output interfaces GPIO. The first logic device can be MB CPLD, motherboard management controller BMC, central processing unit CPU, motherboard complex programmable logic device MB CPLD, field programmable gate array FPGA, etc., and the second logic device is BP CPLD. The hardware architecture can be applied to any electronic device such as a server and a switch. In the following embodiments, MB CPLD is introduced as the first logic device.
[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0069] Figure 3 The flowchart of the first embodiment of the method for transmitting the VPP address based on GPIO provided in this application is as follows: Figure 3 As shown, the following steps are included:
[0070] S101. A first logic device sends a pulse signal to all GPIO interfaces of the first logic device.
[0071] In this embodiment, MB CPLD represents the first logic device, and BP CPLD represents the second logic device.
[0072] In this step, after the electronic device is powered on, both the MB CPLD and the BP CPLD are in an idle (IDLE) state, waiting for the MB CPLD to initiate a release pulse. In this IDLE state, all GPIO interfaces of the MB CPLD are configured as output states, which means that the MB CPLD can send signals through these GPIO interfaces. All GPIO interfaces of the BP CPLD are set to a high-impedance state, which means that the GPIO interface will not drive any signal and will not affect other signals on the bus. This configuration is used to wait for the MB CPLD to initiate a release pulse signal.
[0073] By setting the GPIO interface of BP CPLD to high impedance, bus signal conflicts can be avoided and the integrity of signal transmission can be ensured. In addition, the GPIO interface of MB CPLD is configured as output state, so that MB CPLD can clearly control the transmission of signals, ensure the coordination and synchronization of the system, and ensure that the two CPLDs communicate and operate at the right time, avoiding unnecessary signal interference and misoperation.
[0074] MB CPLD sends a pulse signal to all GPIO interfaces. The pulse signal can be a release pulse signal, for example, the pulse width is 100 microseconds, indicating that the high level lasts for 100 microseconds and then returns to a low level. The purpose of sending the pulse signal is to initialize all GPIO interfaces and ensure that they are in a known state for subsequent communication and data transmission.
[0075] The pulse signal may also be a low level pulse, or other forms of pulse signals.
[0076] The pulse time can be set as needed and is not limited here.
[0077] The second logic device receives the pulse signal transmitted from the GPIO interface, and determines a valid GPIO interface according to the pulse signal.
[0078] The BP CPLD receives the pulse signal through the GPIO interface to which it is connected. Multiple BP CPLDs may be connected to the MB CPLD, and each BP CPLD needs to receive the pulse signal.
[0079] In one implementation, the BP CPLD may directly detect the level state of the GPIO pin, and if the pin is at a high level, it is considered that a pulse signal is received.
[0080] In another implementation, the BP CPLD may be configured to detect a rising edge or a falling edge on a GPIO pin to capture changes in a pulse signal.
[0081] The interface that successfully receives the pulse signal is determined as a valid GPIO interface on the BP CPLD side. For example, if a GPIO interface of the BP CPLD detects a high-level signal within a predetermined time window, the interface is considered valid.
[0082] S102: The first logic device sends a request command to the second logic device through the GPIO interface according to the polling order of the GPIO interface, where the request command is used to request a virtual port VPP address.
[0083] In this step, first, the polling order rule for polling the GPIO interface needs to be determined. The polling rule is preset based on the hardware design, for example, in the order of the interface number from small to large. MB CPLD sends a request command to each GPIO interface in turn according to the determined polling order. The request command is usually a data packet in a specific format, which contains an instruction to request the VPP address.
[0084] S103 . After receiving the request command, the second logic device determines the VPP address corresponding to the GPIO interface that receives the request command according to a pre-stored data table, where the data table includes a mapping relationship between each GPIO interface and the VPP address.
[0085] During the system design phase, developers need to determine the mapping relationship between each GPIO interface and its corresponding VPP address, and store this information in a data table. This data table can be stored in various formats, such as simple key-value pairs, data structures, or databases. After building the mapping relationship, store this data table in the internal memory of the BP CPLD, or load it into the BP CPLD through an external storage medium (such as EEPROM or Flash). In this way, the BP CPLD can directly access this data table when it receives a request command.
[0086] When the BP CPLD receives a request command, it needs to parse the command to determine which GPIO interface the request command comes from. Using the parsed GPIO interface information, it searches for the corresponding VPP address in the pre-built data table. This search process is usually a simple key-value search operation.
[0087] S104: The first logic device receives the response information returned by the second logic device, and obtains the VPP addresses of all valid GPIO interfaces. The response information includes the VPP address corresponding to the GPIO interface of which the second logic device receives the request command.
[0088] In one implementation, each time the BP CPLD receives a request command sent by a GPIO interface, it generates a response message for the request command and returns it to the MB CPLD. The response message only includes the VPP address corresponding to the GPIO interface that receives the request command, and does not include other VPP addresses.
[0089] Once the BP CPLD determines the VPP address corresponding to the request command, the BP CPLD can generate a response message, which includes the VPP address and possible other related information, such as the query success or failure status.
[0090] MB CPLD sends a request command to the next GPIO interface in the polling order to obtain the VPP address corresponding to the next GPIO interface until the polling of all GPIO interfaces is completed to obtain the VPP addresses of all valid GPIO interfaces.
[0091] If during the polling process, a GPIO interface does not receive a response message from the interface within a preset time period after sending a request command, the GPIO interface is determined to be an invalid interface, and the request command continues to be sent to the next GPIO interface according to the polling rules.
[0092] In another implementation, each time the BP CPLD receives a request command sent by a GPIO interface, it does not generate a response message immediately, but generates a response message when a preset condition is met, and the response message includes the VPP addresses corresponding to all GPIO interfaces that received the request command within this time period. The preset condition can be that if no other request command is received after a preset time after receiving the request command, the preset condition is met.
[0093] Optionally, the transmission rate of the request command and the response information between the two logic devices is any of the following baud rates: 9600, 115200, 25000, and can also be set to other transmission rates as needed. The transmission rate is adjustable.
[0094] The present embodiment provides a method for transmitting a VPP address based on GPIO, the method comprising: a first logic device sends a pulse signal to all GPIO interfaces of the first logic device; a second logic device receives the pulse signal transmitted from the GPIO interface; the first logic device sends a request command to the second logic device through the GPIO interface according to the polling order of the GPIO interface, the request command is used to request the virtual port VPP address; after receiving the request command, the second logic device determines the VPP address corresponding to the GPIO interface receiving the request command according to a pre-stored data table, the data table includes a mapping relationship between each GPIO interface and the VPP address; the first logic device receives the response information returned by the second logic device, and obtains the VPP addresses of all valid GPIO interfaces, the response information includes the VPP address corresponding to the GPIO interface receiving the request command by the second logic device. The method can transmit information at a higher rate, and compared with the method of determining the VPP address by different frequencies, the time for obtaining the VPP address is shortened; the number of GPIOs connected by the method is no longer limited by the frequency, and can be flexibly expanded; in addition, the method directly transmits the request command, which can avoid the situation in the prior art where the frequency is at the critical point of the two sets of frequency ranges, and increase the reliability of the transmitted data.
[0095] In order to further increase the stability and reliability of the transmitted data, a cyclic redundancy check code CRC is added to transmit the data.
[0096] Figure 4 The flowchart of the second embodiment of the method for transmitting the VPP address based on GPIO provided in this application is as follows: Figure 4 As shown, the method comprises the following steps:
[0097] S201. The MB CPLD sends a request command to the BP CPLD through the GPIO interface, where the request command is used to request a VPP address.
[0098] This step is the same as the process of sending the request command in the first embodiment, and will not be repeated here. This embodiment only introduces the data communication and verification process of a polling process.
[0099] S202. The BP CPLD calculates CRC using a preset algorithm according to the VPP address in the response information.
[0100] In this step, a preset CRC algorithm is used to perform CRC calculation on the VPP address in the response information. The CRC algorithm is an algorithm that processes data to generate a fixed-length checksum, such as CRC-8, CRC-16 or CRC-32.
[0101] In one implementation, the request command only requests the VPP address, and the response information only includes the VPP address, and the CRC algorithm only calculates the VPP address.
[0102] In one implementation, the request command not only requests the VPP address, but also requests other data. The BP CPLD obtains the corresponding data according to the command of the requested data to generate a response message, and calculates all the data in the response message except the CRC itself through the CRC algorithm. The calculated CRC check code and the requested data constitute the response message.
[0103] S203 . After receiving the response information, the MB CPLD calculates the CRC to be checked by using a preset algorithm according to the VPP address in the response information.
[0104] The MB CPLD receives the response information from the BP CPLD and extracts the VPP address therein. The MB CPLD uses the same preset CRC algorithm as the BP CPLD to perform CRC calculation on the VPP address in the response information and generates a CRC value to be verified.
[0105] If the response information includes other data, the preset CRC algorithm performs CRC calculation on all data in the response information to generate a CRC value to be checked.
[0106] S204: Determine whether the CRC to be checked is the same as the CRC in the response information.
[0107] If the CRC to be checked is the same as the CRC in the response information, execute step S205;
[0108] If the CRC to be checked is not the same as the CRC in the response information, execute step S206.
[0109] S205: Determine whether the VPP address in the response information is credible.
[0110] S206: Determine that the VPP address in the response information is untrustworthy.
[0111] That is, it is determined that the GPIO interface that receives the response information is invalid.
[0112] By adding CRC check, the reliability of data transmission can be increased to ensure that the VPP address sent by the BP CPLD is the same as the VPP address received by the MBCPLD.
[0113] Based on the above-mentioned embodiment 2, Figure 5 This is a schematic diagram of the encoding format of the MB CPLD initiating the request command provided in this application. Figure 6 The schematic diagram of the coding format of the BP CPLD reply response information provided in this application. Both the request command and the response information include the CRC check bit, which occupies 1 byte of coding length.
[0114] exist Figure 5 In the command, Start is the start flag of the request command, which is used to indicate the start of the data. Byte0 is the first byte of the command, which contains specific command information, such as the identifier of the requested VPP address, or the identifier of the requested register data. CRC: This is a cyclic redundancy check code used to verify the entire command. Stop is the end flag of the request command, which is used to indicate the end of the data.
[0115] exist Figure 6 In the command, Start is the start flag of the request command, which is used to indicate the start of the data. Byte0-Byte30 contains specific data, such as the VPP address, or the register data requested by the MB CPLD. CRC is used to verify the cyclic redundancy check code of the entire command. Stop is the end flag of the request command, which is used to indicate the end of the data.
[0116] The data of Byte0-Byte30 in the response information is determined according to the request in the request command.
[0117] In one implementation, the BP CPLD generates a response message every time it receives a command requesting a VPP address, and the response message only includes data of a VPP address. For example, if only a VPP address is requested, the VPP address is written into Byte0.
[0118] In another implementation, after receiving the command requesting the VPP address, the BP CPLD will feedback all the VPP addresses from the beginning when the preset condition is met, and the generated response message includes multiple VPP addresses, and each byte in the 31 bytes includes a VPP address. If the VPP address is less than 31, the other free bytes are written with 0, or no data is written.
[0119] Based on the above two methods, if other data is requested in the request command, such as reset data, power data, version data, GPIO status data, etc. in the register, different bytes are written in sequence, and 0 is written to the byte without data.
[0120] On the basis of the above-mentioned methods, the encoding format of the response information may also include a default identification bit corresponding to each byte, and the default identification bit is used to distinguish different GPIO interfaces in the byte or different data types in the byte. For example, when the response information includes multiple VPP addresses, according to the pre-defined default identification bit of the GPIO interface, a default identification bit can be added after the VPP address to identify the GPIO interface to which the VPP address belongs. For another example, if the request command also includes reset data and power data in the register, a default identification bit is added after the byte corresponding to the 31 bytes of data to distinguish different data types.
[0121] Multiple bytes from Byte0 to Byte30 can transmit data, and the required data can be requested in the request command as needed to achieve adaptive data transmission.
[0122] Above Figure 6 It only shows a response information encoding format. Figure 6 In the coding format of the response message, the data part occupies 31 bytes and the check bit occupies 1 byte. The coding format of the response information can also adopt other formats, and the data part in the coding format can also occupy 61 bytes, or 127 bytes, or other number of bytes. The check bit can also adopt a check bit of multiple bytes, such as two check bits, three check bits, etc.
[0123] In summary, the encoding format of the response information adopts a data portion of multiple bytes and a check bit of at least one byte, and the specific number of bytes adopted can be set according to actual needs.
[0124] In the communication mode where BP CPLD and MB CPLD send a request command once and reply to a request command once, the following situation may be encountered: when the pulse signal is sent, a GPIO interface fails to work normally, but resumes normal operation in the subsequent polling, resulting in the effective GPIO interface determined by BP CPLD being different from the effective GPIO interface determined by MB CPLD.
[0125] This may be caused by poor contact, which results in the pulse signal not being transmitted or recognized normally. It may also be caused by electromagnetic interference or other external interference sources, which results in the GPIO pulse signal being interfered with and not being transmitted or recognized normally. These situations may cause the GPIO interface to not work properly at certain times, but it can resume normal operation after the interference is eliminated or reduced.
[0126] Therefore, it can be considered that the GPIO interface where this situation occurs may be caused by poor contact, and the interface can be considered as an invalid GPIO interface.
[0127] Figure 7 The flowchart of the third embodiment of the method for transmitting the VPP address based on GPIO provided in this application is as follows: Figure 7 As shown, the method comprises the following steps:
[0128] S301. BP CPLD receives a request command.
[0129] S302: The BP CPLD determines whether the GPIO interface receiving the request command is a valid GPIO interface determined according to the pulse signal.
[0130] The BP CPLD records all valid GPIO interfaces determined according to the pulse signal and the GPIO interfaces that receive the request command.
[0131] If it is a valid GPIO interface, execute step S303.
[0132] If it is not a valid GPIO interface, execute step S304.
[0133] S303: According to the request in the request command, obtain corresponding data, generate response information and send it to the MB CPLD.
[0134] S304 , generating response information indicating that the GPIO interface is an invalid GPIO interface, and sending the response information to the MB CPLD.
[0135] Accordingly, the MB CPLD receives the response information and extracts the data in the response information, which indicates the GPIO interface.
[0136] The method for transmitting the VPP address based on GPIO provided in this embodiment can determine unstable GPIO pins and use them as invalid GPIO pins, thereby improving the efficiency of data transmission.
[0137] After the MB CPLD determines the VPP addresses of all valid GPIOs, the backplane lighting operation can be performed according to the VPP addresses.
[0138] Assume that three valid GPIO interfaces are determined in the MB CPLD, and they correspond to the following VPP addresses:
[0139] GPIO1 corresponds to VPP address 0x1000;
[0140] GPIO2 corresponds to VPP address 0x2000;
[0141] GPIO3 corresponds to VPP address 0x3000;
[0142] Now, the backplane lighting operation needs to be executed according to these VPP addresses. The lighting operation is usually implemented by writing a specific value to a specific VPP address.
[0143] First, after the MB CPLD determines the VPP address of the valid GPIO interface, it will send a lighting signal to the BP CPLD. The lighting signal includes a specific lighting value and a specific VPP address to be lit. The lighting signal can be a lighting signal received by the MB CPLD from the CPU side through I2C, or it can be a lighting signal generated by the MB CPLD side.
[0144] After receiving the lighting signal from the BP CPLD, the BP CPLD performs the lighting operation according to the VPP address. Specifically, a specific value is written into the VPP address to trigger the LED or other indicator light on the backplane.
[0145] For example, assuming that writing a value of 0xFF to a given VPP address will light up the corresponding LED, the BPCPLD will write a value of 0xFF to addresses 0x1000, 0x2000, and 0x3000, respectively, to light up the corresponding LED.
[0146] Different written values correspond to different lighting strategies and display different lighting states, such as displaying different colors.
[0147] Once these write operations are completed, the corresponding LED on the backplane will light up, indicating that the corresponding GPIO interface is valid.
[0148] By using this method, the lighting operation can be performed after the effective GPIO interface is quickly determined, and the speed of the lighting operation is also improved.
[0149] This embodiment further provides an MB CPLD, and the MB CPLD includes:
[0150] The sending module is used to send pulse signals to all GPIO interfaces;
[0151] A receiving module, used for receiving a pulse signal transmitted from a GPIO interface and determining a valid GPIO interface according to the pulse signal;
[0152] Optionally, the MB CPLD further includes a determination module, and the determination module is used to:
[0153] After receiving the response information, the CRC to be checked is calculated by a preset CRC algorithm according to the VPP address in the response information;
[0154] If the CRC to be checked is the same as the CRC, it is determined that the VPP address in the response information is credible;
[0155] If the CRC to be checked is not the same as the CRC, it is determined that the VPP address in the response information is unreliable.
[0156] Optionally, the determination module is further configured to:
[0157] After the request command is sent to the second logic device through the GPIO interface, if no response message is received within a preset time period, the GPIO interface that has not received the response message is determined to be an invalid GPIO interface.
[0158] Optionally, the sending module is further used to: send the lighting signal to the corresponding second logic device according to the VPP addresses of all valid GPIO interfaces obtained.
[0159] The MB CPLD provided in this embodiment can execute the method on the MB CPLD side provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0160] This embodiment further provides a BP CPLD, and the BP CPLD includes:
[0161] A receiving module, used for receiving a pulse signal transmitted from a GPIO interface and determining a valid GPIO interface according to the pulse signal;
[0162] A query module, configured to determine, after receiving the request command, a VPP address corresponding to the GPIO interface receiving the request command according to a pre-stored data table, wherein the data table includes a mapping relationship between each GPIO interface and the VPP address;
[0163] A generation module, used for generating response information;
[0164] A sending module, used to send the response information to the first logic device through the GPIO interface that receives the request command, wherein the response information includes a VPP address corresponding to the GPIO interface that receives the request command;
[0165] Optionally, the BP CPLD further includes a calculation module, the calculation module being used to calculate the CRC by a preset CRC algorithm according to the VPP address in the response information;
[0166] Optionally, the BP CPLD further includes an acquisition module, the acquisition module being used to acquire register data according to the identifier of the request register data;
[0167] The generating module is further used to write the register data into the response information.
[0168] Optionally, the BP CPLD further includes a lighting module, and the lighting module is used to light up the hard disk indicator light according to the lighting signal.
[0169] The BP CPLD provided in this embodiment can execute the method on the BP CPLD side provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
[0170] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this application. The electronic device can be an electronic device such as a switch or a server connected to a storage hard disk. Figure 8 As shown, the electronic device 80 provided in this embodiment includes: a first logic device 801 and a second logic device 802, wherein the first logic device 801 and the second logic device 802 are connected via a communication line 803 of a plurality of general purpose input and output interfaces GPIO;
[0171] The electronic device also includes at least one processor 804 .
[0172] Optionally, the device 80 further includes an I2C bus 805 , wherein the processor 804 is connected to the first logic device 801 via the I2C communication component 805 .
[0173] Optionally, the first logic device is any one of the following devices: a mainboard management controller BMC, a central processing unit CPU, a mainboard complex programmable logic device MB CPLD, a field programmable gate array FPGA;
[0174] The second logic device is a backplane complex programmable logic device BP CPLD.
[0175] The electronic device can execute the method in the above embodiment. The specific implementation process can refer to the above method embodiment. The implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0176] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0177] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0178] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0179] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor, a first logic device or a second logic device.
[0180] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the processor, the first logic device or the second logic device executes the computer-executable instructions, the above method is implemented.
[0181] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0182] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0183] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0184] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0185] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0186] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0187] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0188] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for transmitting a VPP address based on GPIO, characterized in that: Applied to an electronic device, the electronic device includes a first logic device and a second logic device, the first logic device and the second logic device are connected via a plurality of general purpose input and output interfaces GPIO, the method includes: A pulse signal sent by the first logic device to all GPIO interfaces of the first logic device; The first logic device sends a request command to the second logic device through the GPIO interface according to the polling order of the GPIO interface, wherein the request command is used to request a virtual port VPP address; After receiving the request command, the second logic device determines the VPP address corresponding to the GPIO interface receiving the request command according to a pre-stored data table, wherein the data table includes a mapping relationship between each GPIO interface and the VPP address; The first logic device receives the response information returned by the second logic device, and obtains the VPP addresses of all valid GPIO interfaces, wherein the response information includes the VPP address corresponding to the GPIO interface through which the second logic device receives the request command.
2. The method according to claim 1, characterized in that: The encoding format of the response information includes a data portion of multiple bytes and a check bit of at least 1 byte.
3. The method according to claim 2, characterized in that The data portion of the multiple bytes stores VPP addresses corresponding to multiple GPIO interfaces, and each byte stores a VPP address corresponding to a GPIO interface.
4. The method according to claim 3, characterized in that The encoding format of the response information also includes a default identification bit corresponding to each byte, and the default identification bit is used to distinguish different GPIO interfaces in the byte data or different data types in the byte data.
5. The method according to any one of claims 1 to 4, characterized in that: The response information also includes a cyclic redundancy check code CRC; Accordingly, the method further includes: The second logic device calculates the CRC by a preset CRC algorithm according to the VPP address in the response information; After receiving the response information, the first logic device calculates the CRC to be checked by using a preset CRC algorithm according to the VPP address in the response information; If the CRC to be checked is the same as the CRC, it is determined that the VPP address in the response information is credible; If the CRC to be checked is not the same as the CRC, it is determined that the VPP address in the response information is unreliable.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The second logic device receives a pulse signal transmitted from the GPIO interface and determines a valid GPIO interface according to the pulse signal; After the first logic device sends the request command to the second logic device through the GPIO interface, if no response message is received within a preset time period, the GPIO interface that does not receive the response message is determined to be an invalid GPIO interface.
7. The method according to any one of claims 1 to 4, characterized in that: The request command includes an identifier of a requested VPP address and an identifier of a requested register data; Accordingly, the method further includes: The second logic device obtains register data according to the identifier of the request register data; Write the register data into the response information.
8. The method according to any one of claims 1 to 4, characterized in that: The transmission rate between the first logic device and the second logic device is any one of the following baud rates: 9600, 115200, 25000.
9. An electronic device, characterized in that: The electronic device comprises: a first logic device and a second logic device, wherein the first logic device and the second logic device are connected via a plurality of general purpose input and output interfaces GPIO; The electronic device is used to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed.
