Data transmission control method, device and electronic equipment based on LPC bus
By introducing a function expansion device on the LPC bus, target type data transmission between slave devices and storage devices is realized, which solves the problems of complex design and low service efficiency of the LPC master controller when extending DMA and Bus Master functions, and improves data efficiency. Transmission efficiency and modular design.
Patent Information
- Application Number
- CN202410709113.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-03
AI Technical Summary
When the existing LPC bus master controller expands the DMA transmission and Bus Master transmission functions, the design is complex and the service efficiency is low, and the external public DMA module has the problem of low service efficiency.
Provide a data transmission control method and device based on the LPC bus. The function expansion device connects the slave interface, the master interface and the target interface on the LPC bus, receives the transmission request of the LPC master controller, and implements the slave interface through the master interface and the target interface. Target type data transfer between the device and the storage device supports DMA and Bus Master type data transfer.
It simplifies the design of the LPC main controller, improves the modularity of function expansion, reduces the difficulty of DMA and Bus Master transmission functions, improves data transmission efficiency, and avoids major changes to the LPC main controller design.
Smart Images

Figure CN118277319B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bus design, and in particular to a data transmission control method, device and electronic equipment based on an LPC bus. Background Art
[0002] Low Pin Count LPC (Low Pin Count) is a 33MHz 4-bit parallel bus protocol based on Intel standard. The LPC bus connected to the South Bridge chip is used to connect peripherals and perform data transmission with peripherals. Figure 1 As shown in , the LPC bus can connect the south bridge chip and peripherals such as input and output chips, basic input and output systems, and embedded controllers to achieve data transmission between the south bridge chip and peripherals.
[0003] In order to extend the LPC bus to a special type of data transmission, an external control module is usually required to implement the special type of data transmission control between the external control module and the peripheral device. However, in this solution, the external control module is a public general module, which has the defect of low service efficiency.
[0004] Therefore, there is an urgent need for a technical solution that can extend special types of data transmission on the LPC bus. Summary of the invention
[0005] In view of the above problems, the present application provides a method, device and electronic device for controlling data transmission of an LPC bus, so as to achieve the purpose of extending special types of data transmission on the LPC bus. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a data transmission control method based on an LPC bus, which is applied to a function expansion device, wherein the function expansion device at least comprises: a slave interface, a master interface and a target interface; the slave interface is connected to the LPC master controller, the master interface is connected to a first LPC bus, the target interface is connected to a storage device, and a slave device is connected to the first LPC bus;
[0007] Wherein, the method comprises:
[0008] The slave interface receives a first transmission request sent by the LPC master controller;
[0009] The master interface receives the signal state of the low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, and initiates a second transfer request of the target type according to the signal state, so that the target type of data transmission is realized between the storage device and the slave device through the target interface and the master interface.
[0010] In a possible implementation, the slave interface is connected to the LPC master controller via a second LPC bus; or, the slave interface is connected to the LPC master controller via the first LPC bus;
[0011] Wherein, in the case where the slave interface is connected to the LPC master controller through the second LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the method further includes:
[0012] The slave interface sends the first transmission request to the master interface, so that the master interface sends the first transmission request to the slave device through the first LPC bus, so that the slave device responds to the first transmission request;
[0013] Wherein, in the case where the slave interface is connected to the LPC master controller through the first LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the method further includes:
[0014] The function expansion device responds to the first transmission request.
[0015] In a possible implementation, before the slave interface sends the first transmission request to the master interface, the method further includes:
[0016] Detecting whether the main interface is in an idle state;
[0017] If the master interface is in an idle state, the slave interface sends the first transmission request to the master interface;
[0018] If the master interface is not in an idle state, the slave interface stores the first transmission request in a cache area;
[0019] In response to the master interface being in an idle state, the slave interface sends the first transmission request in the cache area to the master interface.
[0020] In a possible implementation, the function expansion device further includes: a register;
[0021] Wherein, in the case where the slave interface is connected to the LPC master controller through the second LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the method further includes:
[0022] determining whether the first transfer request is for the register;
[0023] In a case where the first transfer request is directed to the register, the function expansion device responds to the first transfer request.
[0024] In a possible implementation, the function expansion device further includes: a register;
[0025] Wherein, in the case where the target type of data transmission is a direct memory access DMA type of data transmission, before the master interface receives the signal state of a low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, the method further includes:
[0026] The slave interface receives a register configuration request sent by the LPC master controller, and sends the register configuration request to the register so that the register responds to the register configuration request, wherein the register configuration request is used to set data transmission parameters of the target type;
[0027] The data transmission parameters of the target type are used to implement the data transmission of the target type between the storage device and the slave device through the target interface and the master interface.
[0028] In a possible implementation, when the target type of data transmission is a bus controller type of data transmission, after the master interface initiates a second transmission request of the target type according to the signal state, the method further includes:
[0029] The master interface receives the data transmission parameter of the target type sent by the slave device through the first LPC bus;
[0030] The data transmission parameters of the target type are used to implement the data transmission of the target type between the storage device and the slave device through the target interface and the master interface.
[0031] In a possible implementation, the target type of data transmission includes: direct memory access DMA type of data transmission, or bus controller type of data transmission;
[0032] The signal state indicates whether the slave device requests to use the target channel identifier to implement the data transmission channel of the target type.
[0033] In a possible implementation, when the target type of data transmission is the DMA type of data transmission, the method further includes:
[0034] When the data transmission of the target type is completed, the slave interface feeds back an interrupt signal to the LPC master controller in response to the serial interrupt query request sent by the LPC master controller, and the interrupt signal indicates that the data transmission of the target type is completed.
[0035] In a possible implementation, the function expansion device further includes: a transmission control module; the transmission control module is at least connected between the target interface and the master interface, and the transmission control module is used to implement the target type of data transmission between the storage device and the slave device through the target interface and the master interface;
[0036] The transmission control module initiates an access request to the target interface in response to the second transmission request, so that the target interface reads the first data from the storage device according to the access request and sends the first data to the master interface through the transmission control module, and the master interface sends the first data to the slave device through the first LPC bus;
[0037] or;
[0038] The transmission control module initiates an access request to the target interface in response to the second transmission request, so that the target interface writes the second data into the storage device according to the access request; the second data is transmitted from the slave device to the transmission control module through the master interface and the transmission control module transmits the second data to the target interface.
[0039] A second aspect of the present application provides an electronic device, including:
[0040] A master device, a slave device, a first LPC bus, a storage device, an LPC master controller, and a function expansion device;
[0041] Wherein, the function expansion device at least comprises: a slave interface, a master interface and a target interface; the slave interface is connected to the LPC master controller, the LPC master controller is connected to the master device, the master interface is connected to the first LPC bus, the target interface is connected to a storage device, and the slave device is connected to the first LPC bus;
[0042] The slave interface receives a first transmission request sent by the LPC master controller;
[0043] The master interface receives the signal state of the low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, and initiates a second transfer request of the target type according to the signal state, so that the target type of data transmission is realized between the storage device and the slave device through the target interface and the master interface.
[0044] The third aspect of the present application provides a function expansion device based on a low pin count LPC bus, comprising at least:
[0045] A slave interface, a master interface and a target interface; the slave interface is connected to an LPC master controller, the master interface is connected to a first LPC bus, the target interface is connected to a storage device, and a slave device is connected to the first LPC bus;
[0046] Wherein, the slave interface receives a first transmission request sent by the LPC master controller;
[0047] The master interface receives the signal state of the low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, and initiates a second transfer request of the target type according to the signal state, so that the target type of data transmission is realized between the storage device and the slave device through the target interface and the master interface.
[0048] By means of the above technical solution, in a data transmission control method, device and electronic device based on LPC bus provided by the present application, a function expansion device is connected to the LPC bus, and then the transmission request of the LPC main controller is received by using the slave interface therein, and the target type of data transmission between the slave device and the storage device can be realized by using the master interface and the target interface. It can be seen that in the present application, the LPC main controller can initiate LPC transmission through the function expansion device, and the target type of data transmission can also be actively initiated through the function expansion device. Therefore, the present application can expand the target type of data transmission without affecting the LPC data transmission initiated by the LPC main controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 It is a schematic diagram of the structure of the LPC bus;
[0051] Figure 2 A schematic diagram of the structure of a function expansion device based on an LPC bus provided in an embodiment of the present application;
[0052] Figure 3 Another structural schematic diagram of a function expansion device based on an LPC bus provided in an embodiment of the present application;
[0053] Figure 4 This is a schematic diagram of the structure of deploying a cache area in a function expansion device in an embodiment of the present application;
[0054] Figure 5This is a schematic diagram of the structure of the register deployment of the function expansion device in the embodiment of the present application;
[0055] Figure 6 A schematic diagram of a structure of a function expansion device in an embodiment of the present application that implements DMA type data transmission;
[0056] Figure 7 A schematic diagram of a structure of a function expansion device in an embodiment of the present application that implements Bus Master type data transmission;
[0057] Figure 8 A schematic diagram of a flow chart of a function expansion device implementing a common type of data transmission in an embodiment of the present application;
[0058] Fig. 9 Another schematic diagram of a flow chart of a function expansion device implementing a common type of data transmission in an embodiment of the present application;
[0059] Fig.10 Another schematic diagram of a flow chart of a function expansion device implementing a common type of data transmission in an embodiment of the present application;
[0060] Fig.11 A schematic diagram of a flow chart of a function expansion device implementing target type data transmission in an embodiment of the present application;
[0061] Fig.12 Another schematic diagram of a flow chart of a function expansion device implementing target type data transmission in an embodiment of the present application;
[0062] Fig.13 A flowchart of a DMA-type data transmission interaction implemented by a function expansion device in an embodiment of the present application;
[0063] Fig.14 It is a schematic diagram of the interaction of the function expansion device in the embodiment of the present application to realize the Bus Master type of data transmission;
[0064] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0065] Fig.16 A structural diagram of a function expansion device for an LPC main controller implemented in this application;
[0066] Fig.17 A usage scenario diagram of the function expansion device for the LPC main controller implemented in this application;
[0067] Fig.18 This is a usage scenario diagram of the function expansion device of the present application as a slave device on the LPC bus;
[0068] Fig.19For the function expansion device of the present application to be used as a conversion interface for transmission, the LPC main controller has a waveform diagram of the LPC transmission request;
[0069] Fig. 20 The function expansion device of the present application is used as an LPC bus slave device for transmission, and the LPC master controller has a waveform diagram of the LPC transmission request. DETAILED DESCRIPTION
[0070] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0071] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0072] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0073] LPC (Low Pin Count) is a 33MHz 4bit parallel bus protocol based on Intel standard. It is used to replace the previous ISA bus protocol, but the two have similar performances. They are both used to connect the South Bridge and Super I / O super input and output chips, FLASH basic input and output system BIOS (Basic Input Output System), embedded controller EC (Embedded Controller) and other devices.
[0074] The traditional ISA BUS rate is about 7.159~8.33MHz, and the theoretical peak transmission value provided is 16MB / s. However, the electrical characteristics and signal definition methods of ISA BUS are very different from those of traditional PCI BUS, which makes the South Bridge chip and Super I / O chip waste a lot of pins for processing, and the circuit design of the motherboard is also complicated. For this reason, Intel defined the LPC interface, which changed the address / data separation decoding of the previous ISA BUS to a decoding method similar to the address / data signal line sharing of PCI, greatly reducing the number of signal lines, and the working rate is driven synchronously by the PCI bus rate (the clock is also 33MHz). Although the improved LPC interface still maintains the maximum transmission value of 16MB / s, the signal pins are greatly reduced by 25~30. SuperI / O chips and Flash chips designed with LPC interface can enjoy the benefits of reduced pin count and miniaturization, and the design of the motherboard can also be simplified, which is why it is named LPC-Low Pin Count. Figure 1 The figure shows the location and function of the LPC main controller in the south bridge. It connects peripherals through the LPC bus and exchanges data with peripherals.
[0075] Because the direct memory access DMA (Direct Memory Access) type of data transmission and the bus controller Bus Master type of data transmission of the LPC bus have fewer use scenarios and are complex in design, requiring additional DMA resources and interfaces, the current LPC master controllers do not have DMA type data transmission functions and Bus Master type data transmission functions at the beginning of design, which can be referred to as DMA transmission and Bus Master transmission. However, with the improvement of chip versions or the increase in demand for LPC master controllers on new system-level chips Soc (System on Chip), it is necessary to add DMA transmission and Bus Master transmission functions. This requires the original LPC master controller chip to be redesigned, including the implementation of DMA type and Bus Master type data transmission interfaces, the addition of an embedded DMA type transmission control module (hereinafter referred to as DMA module) or an interface with an external DMA module, and the main interface designed to implement the Bus Master, but it is time-consuming and labor-intensive and the design complexity is greatly increased. The design of DMA function in traditional LPC master controllers usually includes two categories. The first is an external public DMA module, and the LPC main controller can call several channels to perform DMA-type data transfer operations; the second is an embedded DMA module, which configures its internal registers through the configuration port of the LPC main controller. The first design has the characteristic of low service efficiency because the DMA module is public and universal; the second design has a higher design complexity because the DMA module is designed inside the LPC main controller, but it solves the problem of low service efficiency.
[0076] Therefore, it can be concluded that the functional design of DMA transmission and Bus Master transmission in the existing LPC main controller is complex, and adding the functions of DMA transmission and Bus Master transmission requires redesign, which is time-consuming and labor-intensive.
[0077] In view of this, the present application proposes a data transmission control scheme based on the LPC bus, which includes a function expansion device for an LPC master controller and a corresponding data transmission control method based on the LPC bus, which can solve the problem that adding DMA transmission and Bus Master transmission functions to the LPC master controller requires major design changes to the entire LPC master controller, further improve the modularity of chip design, and reduce the difficulty of expanding the LPC master controller to functions such as DMA transmission and Bus Master transmission.
[0078] The following is a detailed introduction to the LPC bus-based data transmission control scheme of the embodiment of the present application in conjunction with the accompanying drawings.
[0079] Reference Figure 2 , Figure 2 A schematic diagram of the structure of a function expansion device based on an LPC bus provided in an embodiment of the present application, wherein the function expansion device can be deployed in an electronic device, and an LPC bus is deployed on a processor in the electronic device. The function expansion device can be deployed as an independent chip in the electronic device, or the function expansion device can also be integrated in a field programmable gate array FPGA (Field Programmable Gate Array) or an application specific integrated circuit ASIC (Application Specific Integrated Circuit). Figure 2 As shown, the function expansion device may include the following structure:
[0080] A slave interface 201, a master interface 202 and a target interface 203;
[0081] The slave interface 201 is connected to the LPC main controller, the LPC main controller is connected to a main device, and the main device may be a processor. For example, the LPC main controller is deployed in a south bridge chip, and the south bridge chip is connected to a central processing unit (CPU).
[0082] In addition, the master interface 202 is connected to the first LPC bus, the target interface 203 is connected to the storage device, and the first LPC bus is connected to a slave device, which may be a Super I / O, FLASH BIOS, EC or other device.
[0083] Among them, the target interface 203 can also be called a sub-protocol interface, the storage device can be a device such as system memory that can store data and can read and write data, and the target interface 203 can support multiple transmission protocols, such as SATA (SerialATA), universal serial bus USB (Universal Serial Bus), high-speed serial computer expansion bus PCI / PCIe (peripheral component interconnect express), bus protocol AXI (Advanced eXtensibleInterface), advanced high-performance midline AHB (Advanced High Performance Bus), peripheral bus APB (Advanced Peripheral Bus), industrial standard architecture ISA (Industry Standard Architecture), integrated circuit bus I2C (Inter-Integrated Circuit), universal asynchronous receiver / transmitter UART (Universal Asynchronous Receiver / Transmitter) and other transmission protocols.
[0084] In one implementation, the slave interface 201 may be connected to the LPC master controller via a second LPC bus, such as Figure 2 Alternatively, the slave interface 201 may be connected to the LPC master controller via a first LPC bus, such as Figure 3 as shown in .
[0085] Based on the above structure, the slave interface 201 is at least used for: receiving a first transmission request sent by the LPC master controller.
[0086] Wherein, when the slave interface 201 is connected to the LPC master controller through the second LPC bus, after the slave interface 201 receives the first transmission request sent by the LPC master controller, the slave interface 201 sends the first transmission request to the master interface 202, so that the master interface 202 sends the first transmission request to the slave device through the first LPC bus, so that the slave device responds to the first transmission request, such as writing the data corresponding to the first transmission request to the slave device or returning the data read from the device to the LPC master controller. At this time, the function expansion device, as a forwarding device, forwards the first transmission request of the LPC master controller to the slave device.
[0087] In the case where the slave interface 201 is connected to the LPC host controller through the first LPC bus, after the slave interface 201 receives the first transmission request sent by the LPC host controller, the function expansion device responds to the first transmission request.
[0088] The master interface 202 is at least used to: receive the signal state of the low pin count bus direct memory access request signal line LDRQ (Low Pincount Bus DMA Request) sent by the slave device through the first LPC bus, and initiate a second transfer request of the target type according to the signal state, so that the target type of data transmission is realized between the storage device and the slave device through the target interface 203 and the master interface 202. For example, write the data from the slave device to the storage device, or transmit the data read from the storage device to the slave device.
[0089] The data transmission protocol between the target interface 203 and the storage device may be the same as or different from the data transmission protocol between the master interface 202 and the slave device.
[0090] It can be seen that the function expansion device can realize common type of data transmission and target type of data transmission through the above structure. Among them, the common type can be understood as the data transmission type initiated by the LPC master controller, such as the data transmission type between the master device and the slave device connected to the LPC master controller. For example, the common type of data transmission can be: data transmission between the CPU and slave devices such as super I / O, EC, bios, etc. The target type can be understood as the DMA type or Bus Master type between the storage device and the slave device. For example, the target type of data transmission can be: DMA type of data transmission, or Bus Master type of data transmission, such as DMA type of data transmission between the system memory and EC, and Bus Master type of data transmission between the system memory and bios.
[0091] In one implementation, the function expansion device may further include a cache area 204. Based on this, before sending the first transmission request to the master interface 202, the slave interface 201 is further used to: detect whether the master interface 202 is in an idle state, if the master interface 202 is in an idle state, the slave interface 201 sends the first transmission request to the master interface 202; and if the master interface 202 is not in an idle state, the slave interface 201 stores the first transmission request in the cache area 204, based on this, in response to the master interface 202 being in an idle state, the slave interface 201 sends the first transmission request in the cache area 204 to the master interface 202.
[0092] The cache area 204 may be deployed in the function expansion device. For example, a random access memory RAM (Random Access Memory) is deployed in the function expansion device, and the storage area in the RAM is the cache area 204. Figure 4As shown in . The cache area 204 is used as a cache space to cache the first transmission request that cannot be transmitted to the slave device in time, until the master interface 202 is in an idle state, the slave interface 201 can read the first transmission request from the cache area 204 and send the first transmission request to the master interface 202, and the master interface 202 sends it to the connected slave device.
[0093] It should be noted that after the slave interface 201 stores the first transmission request in the buffer area 204 , it may also send a waiting message to the LPC master controller to instruct the LPC master controller and the master device to wait for the data transmission result.
[0094] In one implementation, the function expansion device may further include a register 205, such as Figure 5 As shown in , register 205 is used to store data, such as data transmission parameters of the function expansion device, such as data transmission direction of the target type, data transmission address, data size of the data transmission, etc. Based on this, when the slave interface 201 is connected to the LPC master controller through the second LPC bus. After receiving the first transmission request, the slave interface 201 can also determine whether the first transmission request is for the register 205 or the slave device, that is, whether the first transmission request is for the register 205 or for the slave device, wherein:
[0095] In the case where the first transmission request is directed to the register 205, the function expansion device responds to the first transmission request, specifically: the first transmission request is sent from the interface 201 to the register 205, and the register 205 responds to the first transmission request, for example, the data transmission parameters in the first transmission request are written into the register 205, and the data transmission parameters in the register 205 represent and instruct the slave device and the storage device to perform data transmission according to the data transmission parameters in the register 205, or, the corresponding data is read from the register 205 and fed back to the LPC main controller.
[0096] In the case where the first transmission request is for the slave device, the slave interface 201 sends the first transmission request to the master interface 202, and the master interface 202 sends the first transmission request to the slave device to implement data transmission between the master device connected to the LPC master controller and the slave device. For example, the data in the first transmission request is written to the slave device, or the data in the slave device is read and fed back to the master device.
[0097] It should be noted that, when the first transmission request is directed to the register 205 , during the process in which the function expansion device responds to the first transmission request, if the master interface is in an idle state, the slave interface 201 will continue to send the first transmission request to the master interface 202 .
[0098] That is to say, after the slave interface 201 receives the first transmission request sent by the LPC master controller, if the master interface is in an idle state, the slave interface 201 determines whether the first transmission request is for the register 205 or for the slave device during the process of sending the first transmission request to the master interface 202. If the first transmission request is for the register 205, the function expansion device responds to the first transmission request. At this time, the first transmission request continues to be sent to the master interface 202 until the first transmission request is sent to the master interface 202. The master interface 202 can send the first transmission request to the first LPC bus.
[0099] After the slave interface 201 receives the first transmission request sent by the LPC master controller, if the master interface is not in an idle state, the slave interface 201 will not send the first transmission request to the master interface 202, but will store the first transmission request in the cache area and determine whether the first transmission request is for the register 205 or for the slave device. If the first transmission request is for the register 205, the function expansion device responds to the first transmission request. If the first transmission request is for the slave device, the slave interface 201 will wait until the master interface 202 is in an idle state, and then read the first transmission request in the cache area 204 and send it to the master interface 202.
[0100] In one implementation, when the target type of data transmission is direct memory access DMA type data transmission, before the master interface 202 receives the signal state of LDRQ sent by the slave device through the first LPC bus, the slave interface 201 receives a register configuration request sent by the LPC master controller, such as a first transmission request indicating writing data transmission parameters to the register 205. Thereafter, the slave interface 201 sends the register configuration request to the register 205 so that the register 205 responds to the register configuration request. The register configuration request is used to set the data transmission parameters of the target type, for example, writing the data transmission parameters in the register configuration request to the register 205. Based on this, the data transmission parameters of the target type in the register 205 can be used to implement the target type of data transmission between the storage device and the slave device through the target interface 203 and the master interface 202.
[0101] For example, taking the target type as DMA type, the data transmission parameters of the target type may include: data transmission direction of DMA type, data transmission address of DMA type, data size of data transmission of DMA type, etc.
[0102] Based on this, after the slave interface 201 sends the register configuration request to the register 205, the master interface 202 receives the signal state of the LDRQ sent by the slave device through the first LPC bus. The signal state of the LDRQ represents whether the slave device requests to use the target channel identifier to implement the target type of data transmission channel. Therefore, when the signal state of the LDRQ represents that the slave device requests to perform data transmission according to the data transmission channel, the master interface 202 initiates a second transmission request of the target type according to the signal state, so that the target type of data transmission is realized between the storage device and the slave device through the target interface 203 and the master interface 202.
[0103] For example, the LPC master controller sends a register configuration request to the slave interface 201 in the function expansion device, so that the DMA type data transmission parameters, such as the DMA type data transmission direction, the DMA type data transmission address, and the DMA type data transmission data size, are written into the register 205. Based on this, the slave device sends the signal state of LDRQ to the master interface 202, and the signal state of LDRQ indicates that the slave device requests to use the transmission channel No. 3 in the DMA type data transmission channel. After that, the master interface 202 initiates a second DMA type transmission request, so that the system memory connected to the target interface 203 and the slave device connected to the master interface 202 can realize the DMA type data transmission.
[0104] It should be noted that the DMA type data transmission channels include transmission channels 0-7 except No. 4, where transmission channel 4 is used to implement Bus Master type data transmission between the system memory connected to the target interface 203 and the slave device connected to the master interface 202.
[0105] Furthermore, in the case where the target type of data transmission is DMA type data transmission, if the target type of data transmission is completed, the slave interface 201 is also used to feedback an interrupt signal to the LPC master controller in response to the serial interrupt query request sent by the LPC master controller, and the interrupt signal indicates that the target type of data transmission is completed.
[0106] Specifically, a serial interrupt query request SERIRQ (Serial Interrupt Request) bus is configured between each structure in the function expansion device. Through the SERIRQ bus, the serial interrupt query request SERIRQ sent by the LPC main controller is received from the interface 201, and the slave interface 201 responds to the serial interrupt query request, for example, the slave interface 201 feeds back an interrupt signal to the LPC main controller to indicate that the data transmission of the target type is completed.
[0107] It should be noted that the target type of data transmission completion may include the following situations. The types of corresponding interrupt signals may be different depending on the target type of data transmission completion situation:
[0108] DMA type data transfer is successful and completed;
[0109] The function expansion device side does not receive a response signal fed back from the device for a target period of time;
[0110] The function expansion device side did not receive the feedback signal from the device.
[0111] In one implementation, when the target type of data transmission is a bus controller type of data transmission, after the master interface 202 initiates a second transmission request of the target type according to the signal state, the master interface 202 is further used to receive a target type of data transmission parameter sent by the slave device through the first LPC bus. The target type of data transmission parameter sent by the slave device is used to implement the target type of data transmission between the storage device and the slave device through the target interface 203 and the master interface 202.
[0112] For example, taking the target type as the Bus Master type, the slave device sends the Bus Master type data transmission parameters such as data transmission direction, data transmission address and data transmission size to the master interface 202. As a result, the master interface 202 and the sub-protocol interface use transmission channel 4 according to the Bus Master type data transmission parameters to realize the Bus Master type data transmission between the system memory and the slave device.
[0113] In one implementation, the function expansion device may further include: a transmission control module 206. The transmission control module 206 is at least connected between the target interface 203 and the master interface 202, and is used to implement target type data transmission between the storage device and the slave device through the target interface 203 and the master interface 202.
[0114] Among them, the main interface 202 initiates a second transmission request of the target type according to the signal status, which can be specifically: the main interface 202 sends the second transmission request to the transmission control module 206, and the transmission control module 206 initiates an access request to the target interface 203 in response to the second transmission request, so that the target interface 203 reads the first data from the storage device according to the access request and sends the first data to the main interface 202 through the transmission control module 206, and the main interface 202 sends the first data to the slave device through the first LPC bus.
[0115] The first data is data that the slave device needs to read from the storage device.
[0116] Alternatively, the master interface 202 initiates a second transmission request of the target type according to the signal state, which may be specifically: the master interface 202 sends the second transmission request to the transmission control module 206, and the transmission control module 206 initiates an access request to the target interface 203 in response to the second transmission request, so that the target interface 203 writes the second data into the storage device according to the access request. The second data is the data that the slave device needs to write to the storage device, and the second data is transmitted from the slave device to the transmission control module 206 through the master interface 202, and the transmission control module 206 transmits the second data to the target interface 203.
[0117] Before the transmission control module 206 initiates an access request to the target interface 203, the transmission control module 206 first initiates an access request to the master interface 202 in response to the second transmission request, so as to instruct the slave device connected to the master interface 202 to send data transmission parameters of the target type to the master interface 202 through the first LPC bus, such as data transmission address, data transmission direction, data transmission size, etc. The master interface 202 sends the data transmission parameters of the target type to the transmission control module 206. Afterwards, the transmission control module 206 initiates an access request to the target interface 203, so that the target interface 203 writes the second data into the storage device according to the access request.
[0118] Wherein, in the case where the target type of data transmission is the Bus Master type of data transmission, the status flag indicates whether the Bus Master type of data transmission is in progress.
[0119] For example, taking a DMA type data transmission scenario as an example, the transmission control module 206 may be a DMA type transmission control module 261, or may be referred to as a DMA module. Figure 6As shown in , a register 205 is deployed in the DMA module, and the DMA module is deployed between the master interface 202 and the target interface 203, and the DMA module is also connected to the slave interface 201. Based on this, the LPC master controller generates a register configuration request according to the instruction of the master device such as the CPU, and the LPC master controller sends the register configuration request to the slave interface 201, and the slave interface 201 sends the register configuration request to the register 205 of the DMA module to set the DMA type data transmission parameters in the register 205, such as the data transmission direction, data transmission address and data transmission size. After that, the slave device sends the signal state of LDRQ to the master interface 202, and the signal state of LDRQ indicates that the slave device requests to use channel 3 to implement DMA type data transmission. After receiving the signal state of LDRQ sent by the slave device, the master interface 202 initiates a DMA type data transmission request to the DMA module according to the data transmission parameters and signal state in the register 205, and the DMA module initiates a read request or a write request to the target interface 203 in response to the data transmission request. If it is a read request, the target interface 203 reads the first data from the system memory according to the read request and sends the first data to the DMA module, the DMA module sends the first data to the master interface 202, and the master interface 202 sends the first data to the slave device through the first LPC bus. If it is a write request, the target interface 203 writes the second data in the slave device into the storage device according to the write request. The second data of the slave device is transmitted from the slave device to the DMA module through the master interface 202, and the DMA module transmits the second data to the target interface 203.
[0120] For another example, taking a Bus Master type data transmission scenario as an example, the transmission control module 206 may be a Bus Master type transmission control module 262, which may also be referred to as a Bus Master module. Figure 7As shown in . Based on this, the slave device sends the signal state of LDRQ to the master interface 202, and the signal state of LDRQ indicates that the slave device requests channel 4 to implement BusMaster type data transmission. After receiving the signal state of LDRQ sent by the slave device, the master interface 202 initiates a BusMaster type data transmission request to the Bus Master module according to the signal state. In response to the data transmission request, the Bus Master module initiates a read request or a write request to the master interface 202 to instruct the slave device connected to the master interface 202 to send BusMaster type data transmission parameters to the master interface 202 through the first LPC bus, such as data transmission direction, data transmission address and data transmission size, etc. The master interface 202 sends the BusMaster type data transmission parameters to the BusMaster module. If the BusMaster module detects that the BusMaster type data transmission request is a read request according to the data transmission parameters, the BusMaster module reads the second data from the target interface 203 according to the data transmission address in the read request, and the target interface 203 feeds back the second data read from the system memory to the BusMaster module, and the BusMaster module feeds back the second data to the master interface 202, and the master interface 202 sends the second data to the slave device. If the Bus Master module detects that the Bus Master type data transmission request is a write request according to the data transmission parameter, the Bus Master module writes the second data to the system memory connected to the target interface 203 according to the data transmission address in the write request.
[0121] In one implementation, during the target type of data transmission, the slave device can feedback a pause signal or a shutdown signal through the master interface 202, the pause signal is used to pause the target type of data transmission between the slave device and the storage device, and the shutdown signal is used to shut down the target type of data transmission between the slave device and the storage device.
[0122] For example, taking the DMA type data transmission scenario as an example, during the DMA type data transmission process, the slave device can feedback a pause signal or a shutdown signal through the master interface 202. The pause signal is used to pause the DMA type data transmission, and the shutdown signal is used to shut down the DMA type data transmission.
[0123] By means of the above technical solution, in a function expansion device based on the LPC bus provided in an embodiment of the present application, the function expansion device is connected to the LPC bus, and then the transmission request of the LPC main controller is received by using the slave interface therein, and the target type of data transmission between the slave device and the storage device can be realized by using the master interface and the target interface. It can be seen that in this embodiment, the LPC main controller can initiate LPC transmission through the function expansion device, and the target type of data transmission can also be actively initiated through the function expansion device. Therefore, the present application can expand the target type of data transmission without affecting the LPC data transmission initiated by the LPC main controller.
[0124] Based on the above function expansion device, the embodiment of the present application also provides a data transmission control method based on the LPC bus. Figure 2 As an example, refer to the function expansion device shown in Figures 8 to 14 As shown in , they are schematic diagrams of the flow of data transmission implemented by each structure in the function expansion device, wherein: Figure 8 The flow of the common type of data transfer shown is as follows:
[0125] Step 801: The slave interface receives a first transmission request sent by the LPC master controller through the second LPC bus.
[0126] Step 802: The slave interface sends a first transmission request to the master interface.
[0127] Step 803: The master interface sends the first transmission request to the slave device through the first LPC bus, so that the slave device responds to the first transmission request.
[0128] Before step 802, the method in this embodiment further includes the following steps: Fig. 9 As shown in:
[0129] Step 804: Detect whether the main interface is in an idle state. If the main interface is in an idle state, execute step 802. If the main interface is not in an idle state, execute step 805.
[0130] Step 805: The slave interface stores the first transmission request in a cache area;
[0131] Step 806: Feedback a waiting message from the interface to the LPC main controller, where the waiting message is used to instruct the LPC main controller to wait for the data transmission result, and then execute step 807.
[0132] Step 807: determine whether the main interface enters the idle state, if so, execute step 808, if the main interface does not enter the idle state, continue to execute step 807;
[0133] Step 808: The slave interface sends the first transmission request in the cache area to the master interface.
[0134] It should be noted that in step 806, the slave interface may continue to feed back a waiting message to the LPC master controller until the first transmission request in the cache area is completely sent to the master interface in step 808, and no waiting message is fed back to the LPC master controller.
[0135] For example, the slave interface can set the status identifier to the first state to the LPC master controller. The status identifier of the first state represents that the slave interface is sending a first transmission request to the master interface to instruct the LPC master controller to wait for the data transmission result until the slave interface sends the first transmission request in the cache area to the master interface, and the reset status identifier is no longer in the first state.
[0136] Before step 802, the method in this embodiment may further include the following steps: Fig.10 As shown in:
[0137] Step 809: Determine whether the first transmission request is for a register or a slave device. If the first transmission request is for a register, the function expansion device responds to the first transmission request, such as steps 810 and 811, and executes step 804 at the same time. If the first transmission request is for a slave device, execute step 804.
[0138] Step 810: Send a first transfer request from the interface to the register;
[0139] Step 811: Write data corresponding to the first transfer request into the register, such as DMA type data transfer parameters.
[0140] Among them, the register is deployed in the function expansion device.
[0141] It should be noted that based on Figure 3 In the function expansion device shown, the LCP main controller can directly send the first transmission request to the slave device through the first LPC bus.
[0142] in, Fig.11 The flow of data transfer for the target type shown is as follows:
[0143] Step 1101: The master interface receives the signal state of LDRQ sent by the slave device through the first LPC bus.
[0144] Step 1102: The master interface initiates a second transmission request of the target type according to the signal state;
[0145] Step 1103: Target type data transmission is implemented between the storage device and the slave device via the target interface and the master interface.
[0146] Wherein, in the case where the target type is a DMA type, before step 1101, the method in this embodiment may further include the following steps: Fig.12 As shown in:
[0147] Step 1104: Receive a register configuration request sent by the LPC controller from the interface.
[0148] Step 1105: Send a register configuration request from the interface to the register;
[0149] Step 1106: The register responds to the register configuration request, such as setting data transmission parameters of the target type in the register according to the register configuration request.
[0150] Based on this, data transmission of the target type is achieved between the storage device and the slave device according to the data transmission parameters in the register.
[0151] It should be noted that based on Figure 3 The function expansion device shown in the figure can transfer the target type of data between the storage device and the slave device through Fig.11 The process shown is implemented.
[0152] In addition, when the target type is a DMA type, the method in this embodiment may further include the following processing:
[0153] When the target type of data transmission is completed, the slave interface feeds back an interrupt signal to the LPC master controller in response to the serial interrupt query request sent by the LPC master controller.
[0154] The interrupt signal indicates that the data transmission of the target type is completed.
[0155] In addition, when the target type is a Bus Master type, after step 1102, the method in this embodiment may further include the following processing:
[0156] The master interface receives a data transmission parameter of a target type sent by the slave device through the first LPC bus.
[0157] Based on this, data transmission of the target type is achieved between the storage device and the slave device according to the data transmission parameters received by the master interface.
[0158] Based on the above implementation scheme, the function expansion device realizes the target type of data transmission between the storage device and the slave device through the deployed transmission control module. For example, the transmission control module initiates an access request such as a read request to the target interface in response to the second transmission request, so that the target interface reads the first data from the storage device according to the access request and sends the first data to the master interface through the transmission control module, and the master interface sends the first data to the slave device through the first LPC bus; or; the transmission control module initiates an access request to the target interface in response to the second transmission request, so that the target interface writes the second data to the storage device according to the access request; the second data is transmitted from the slave device to the transmission control module through the master interface and the transmission control module transmits the second data to the target interface.
[0159] refer to Figure 5 , the following is the interactive process of the function expansion device to realize DMA type data transmission, such as Fig.13 As shown in:
[0160] Step 1301: The LPC master controller generates a register configuration request according to an instruction from a master device such as a CPU.
[0161] Step 1302: The LPC master controller sends a register configuration request to the slave interface via the second LPC bus.
[0162] Step 1303: Send a register configuration request from the interface to the register of the DMA module.
[0163] Step 1304: Set the DMA type data transfer parameters in the register, such as data transfer direction, data transfer address, and data transfer size.
[0164] Step 1305: The slave device sends a signal state of LDRQ to the master interface via the first LPC bus. The signal state of LDRQ indicates that the slave device requests to use channel 3 to implement DMA type data transmission.
[0165] Step 1306: After receiving the signal state of LDRQ sent by the slave device, the master interface initiates a DMA type data transmission request to the DMA module according to the data transmission parameters and signal state in the register.
[0166] Step 1307: The DMA module initiates a read request or a write request to the target interface in response to the data transfer request. If it is a read request, execute steps 1308 to 1311; if it is a write request, execute steps 1312 to 1315.
[0167] Step 1308: The target interface reads the first data from the system memory according to the read request.
[0168] Step 1309: The target interface sends the first data to the DMA module.
[0169] Step 1310: The DMA module sends the first data to the host interface.
[0170] Step 1311: The master interface sends the first data to the slave device through the first LPC bus.
[0171] Step 1312: The slave device sends the second data to the master interface via the first LPC bus;
[0172] Step 1313: The host interface sends the second data to the DMA module.
[0173] Step 1314: The DMA module transmits the second data to the target interface.
[0174] Step 1315: The target interface writes the second data into the system memory according to the write request.
[0175] refer to Figure 7 , the following is the interactive process of the function expansion device to realize the Bus Master type data transmission, such as Fig.14 As shown in:
[0176] Step 1401: The slave device sends a signal state of LDRQ to the master interface via the first LPC bus. The signal state of LDRQ indicates that the slave device requests channel 4 to implement Bus Master type data transmission.
[0177] Step 1402: After receiving the signal status of LDRQ sent by the slave device, the master interface initiates a Bus Master type data transmission request to the BusMaster module according to the signal status.
[0178] Step 1403: The Bus Master module initiates a read request or a write request to the master interface in response to the data transmission request.
[0179] Step 1404: The master interface receives data transmission parameters of the Bus Master type sent by the slave device via the first LPC bus, such as data transmission direction, data transmission address, and data transmission size.
[0180] Step 1405: The master interface sends the Bus Master type data transmission parameters to the Bus Master module. If the Bus Master module detects that the Bus Master type data transmission request is a read request according to the data transmission parameters, execute steps 1406 to 1410; if the Bus Master module detects that the Bus Master type data transmission request is a write request according to the data transmission parameters, execute steps 1411 to 1412.
[0181] Step 1406: The Bus Master module reads the second data from the target interface according to the data transmission address in the read request.
[0182] Step 1407: The target interface reads second data from the system memory.
[0183] Step 1408: The target interface feeds back the second data read from the system memory to the Bus Master module.
[0184] Step 1409: The Bus Master module feeds back the second data to the main interface.
[0185] Step 1410: The master interface sends the second data to the slave device through the first LPC bus.
[0186] Step 1411: The Bus Master module sends the second data corresponding to the write request to the target interface.
[0187] Step 1412: The target interface writes the second data into the system memory according to the data transmission address in the write request.
[0188] The present application also provides an electronic device in an embodiment. Fig.15 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig.15 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0189] like Fig.15 As shown, the electronic device may include the following structure:
[0190] A master device 1501, a slave device 1502, a first LPC bus 1503, a storage device 1504, an LPC master controller 1505 and a function expansion device 1506;
[0191] The function expansion device 1506 at least includes the following structures: Figure 2 or Figure 3 As shown:
[0192] A slave interface 201, a master interface 202 and a target interface 203;
[0193] The slave interface 201 is connected to the LPC master controller 1505, the LPC master controller 1505 is connected to the master device 1501, the master interface 202 is connected to the first LPC bus 1503, the target interface 203 is connected to the storage device 1504, and the slave device 1502 is connected to the first LPC bus 1503;
[0194] Receive a first transmission request sent by the LPC master controller 1505 from the interface 201;
[0195] The master interface 202 receives the signal state of the low pin count bus direct memory access request signal line LDRQ sent by the slave device 1502 through the first LPC bus 1503, and initiates a second transfer request of the target type according to the signal state, so that the target type of data transmission is realized between the storage device 1504 and the slave device 1502 through the target interface 203 and the master interface 202.
[0196] Among them, the main device refers to a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage device to the random access memory (RAM). When the electronic device is powered on, the RAM also stores various programs and data required for the operation of the electronic device. The processing device, ROM and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.
[0197] Typically, the following devices can be connected to the I / O interface: input devices such as touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices such as liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices such as memory cards, hard disks, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or wired to exchange data. The above is an electronic device with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or provided alternatively.
[0198] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the LPC bus-based data transmission control methods provided in the embodiments of the present application.
[0199] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any LPC bus-based data transmission control method provided in the embodiment of the present application.
[0200] It should be noted that the LPC bus mentioned below refers to the first LPC bus mentioned above.
[0201] Based on the above implementation scheme, the present application proposes a function expansion device and method for an LPC main controller. The core idea is to design a function expansion device chip based on the LPC Spec 1.1 specification, which is used to expand the DMA type data transmission and Bus Master type data transmission functions of the LPC main controller chip, and perform DMA type data transmission or Bus Master type data transmission when the LPC main controller is not working, thereby improving the utilization efficiency of the LPC bus.
[0202] The chip does not occupy an additional bus interface and can be used as the LPC conversion port of the LPC master controller. It can be used as an LPC slave device to be accessed and written by the LPC master controller, and can also be used as an LPC master device to perform DMA type data access and Bus Master type data access to other LPC slave devices, and can also forward the LPC transfer request of the LPC master controller to the LPC bus. The function expansion device distinguishes the access type and access address from the LPC master controller. If the access type is the Memory type and the address is within the register address range of the function expansion device, the register of the function expansion device is accessed, otherwise the transfer request is forwarded to the LPC bus.
[0203] The function expansion device can determine whether to support the Bus Master or DMA function by configuring registers.
[0204] like Fig.16As shown in , the function expansion device has three interfaces. The first is the LPC slave interface, which is used to receive transmission requests from the LPC master controller (including at least three types of read and write requests, namely IO (input and output), storage, and firmware), and can respond to the transmission requests and SERIRQ interrupt query requests of the LPC master controller as an LPC slave device; the second is the LPC master interface, which is used to forward transmission requests from the LPC master controller and initiate DMA read and write requests and Bus Master read and write requests, as well as SERIRQ interrupt query requests, and can receive LDRQ requests from LPC slave devices; the third is the sub-protocol interface (i.e. the target interface in the previous text), and a master interface based on different protocols can be selected according to the Soc design. The sub-protocol interface is used for DMA type or Bus Master type data transmission, and then the data is transferred between the system memory and the LPC slave device.
[0205] The function expansion device complies with the provisions of the LPC1.1 protocol and is used to implement the detection, arbitration, execution and exception handling of input and output, memory, firmware and direct memory access type DMA and Bus Master read and write requests, as well as mode switching, request detection and clearing processing of serial interrupts; the DMA module is used to implement DMA request detection, channel arbitration, DMA service startup and request cancellation processing.
[0206] Preferably, the function expansion device can be implemented using a programmable logic device or a dedicated integrated circuit.
[0207] Fig.17 This is a usage scenario diagram of a function expansion device for an LPC main controller. In this case, the LPC bus connected to the slave interface is different from the LPC bus connected to the master interface. Fig.18 This is a usage scenario diagram of the function expansion device as a slave device on the LPC bus. At this time, the LPC bus connected to the slave interface is the same as the LPC bus connected to the master interface.
[0208] When the LPC master device initiates a transmission request through the LPC slave interface, if the function expansion device is not performing a transmission, the transmission will be directly forwarded to the LPC bus. If the transmission is a memory transmission and the access address is the address of the function expansion device, the function expansion device will respond to the transmission and complete the transmission. This situation is usually used for reading and writing registers in the function expansion device. If the function expansion device is performing a transmission, the LPC slave interface will store the transmission in the RAM. If the transmission is an access to the function expansion device, the data in the RAM is cleared, and the function expansion device responds and completes the transmission. Otherwise, wait for the function expansion device to complete the current transmission, then take out the transmission request from the RAM and send it to the LPC bus. During this period, Long Wait is continuously sent to the LPC master controller until all transmission requests are taken out of the RAM.
[0209] The LPC master interface can directly forward the LPC transfer request in the LPC slave interface or RAM to the LPC bus, or initiate DMA or Bus Master transfer to the LPC bus according to the LDRQ signal status and register configuration.
[0210] For DMA transfer, when the enable register of the channel in DMA is 1, and the LPC slave device performs DMA transfer of the corresponding channel through LDRQ request, the LPC master interface will start to receive transfer requests for the channel from the DMA module. In other words, the DMA module implements read and write access to the memory connected to the slave device and the sub-protocol interface on the LPC bus through the master interface.
[0211] For Bus Master transmission, when the LPC slave device requests Bus Master transmission through the LDRQ signal, the LPC master interface initiates the Bus Master transmission and completes the Bus Master transmission through the sub-protocol interface.
[0212] For the SERIRQ bus, each channel of the function expansion device occupies an interrupt position, and also includes an error interrupt bit. As a slave device on the SERIRQ, the function expansion device can respond to the SERIRQ polling request from the LPC master controller.
[0213] The DMA module is used to implement DMA request detection, channel arbitration, DMA service startup, and request cancellation. The DMA module supports up to 7 channels, including all channels from 0 to 7 except channel 4. It supports 2 devices with DMA function, that is, the bit width of LDRQ is 2. When the software turns on the channel enable of the DMA module in the function expansion device through the LPC master controller, the DMA module will perform DMA operations through the LPC master interface and the sub-protocol interface according to the configuration information in the channel, and after the DMA task of the channel is completed, it will notify the software through the SERIRQ signal to complete the DMA operation. The LPC slave device can respond to READY in the SYNC phase of DMA transmission, or suspend the DMA transmission of the channel by pulling down the ACT field of the channel in the LDRQ signal line. Weighted polling scheduling is used between the channels in the DMA module.
[0214] When the function expansion device is transmitting, if there is no response from the LPC device or the Short-wait and Long-wait times are too long, the function expansion device can cancel the transmission through the Abort mechanism and report an interrupt through the SERIRQ signal.
[0215] The function expansion device in the present application has four usage scenarios, namely: when the function expansion device has no transmission, the LPC main controller has a transmission request; the function expansion device performs DMA transmission; the function expansion device performs Bus Master transmission; when the function expansion device performs transmission, the LPC main controller has an LPC transmission request.
[0216] The first scenario (when the function expansion device has no transmission, the LPC main controller has a transmission request):
[0217] At this time, the function expansion device will not initiate transmission, but directly forwards the transmission request of the LPC main controller to the LPC bus, and transmits the response data on the LPC bus to the LPC main controller.
[0218] The second scenario (DMA transfer by function expansion device):
[0219] The workflow of DMA transmission of the function expansion device is as follows:
[0220] (1) The LPC master controller configures registers of the function expansion device and the LPC slave device through the LPC bus and configures relevant information of DMA transmission;
[0221] (ii) The LPC slave device initiates a DMA transfer request to the function expansion device through LDRQ, indicating that DMA transfer can be performed;
[0222] (III) The function expansion device initiates DMA transmission through the LPC bus and starts DMA handling. For DMA read, it initiates a read request to the sub-protocol bus, and transmits the read data to the LPC slave device through the DMA read request on the LPC bus; for DMA write, it initiates a DMA write request to the memory connected to the sub-protocol interface through the LPC bus, and sends the write data to the memory through the write request on the sub-protocol bus;
[0223] (iv) After the function expansion device completes the DMA transfer task of the channel, it sends an interrupt signal to the LPC main controller through the SERIRQ bus to indicate that the DMA transfer task of the channel is completed.
[0224] During this period, the LPC main controller can access the status register in the function expansion device through the LPC bus to determine the status of the DMA transfer.
[0225] The function expansion device will make a correct response to the SYNC response and LDRQ signal of the LPC slave device according to the protocol requirements.
[0226] Normally, it is recommended that the software first query the status of the status register in the function expansion device when the function expansion device is working, and confirm that the function expansion device has completed all DMA transmission tasks before performing LPC transmission. Otherwise, it may enter the fourth scenario. Fig.19 As shown in the figure, the function expansion device is used as a conversion interface for transmission, and the LPC main controller has a waveform diagram of the LPC transmission request. When the LPC main controller sends a request, it waits for the DMA transmission task on the LPC bus to be completed, and then starts the transmission request on the LPC bus.
[0227] The third scenario (the function expansion device performs Bus Master transmission):
[0228] The workflow of the Bus Master transmission of the function expansion device is as follows:
[0229] 1. The LPC slave device initiates a Bus Master transmission request to the function expansion device through LDRQ, indicating that Bus Master transmission is required.
[0230] (ii) The function expansion device initiates Bus Master transmission through the LPC bus and receives transmission requests from LPC slave devices. For Bus Master write transmission, it directly receives write data from LPC slave devices; for Bus Master read transmission, it responds to long wait in the SYNC stage and waits for read data from the sub-protocol interface;
[0231] (III) Complete Bus Master transmission through the sub-protocol interface. For Bus Master write transmission, the write data from the LPC slave device is sent out; for Bus Master read transmission, after receiving the read request, a read request is initiated on the sub-protocol bus, and the read data is returned to the LPC slave device through the LPC bus.
[0232] The Bus Master transmits a request to occupy channel 4 in the LDRQ.
[0233] During this period, the LPC main controller can access the status register in the function expansion device through the LPC bus to determine the status of the Bus Master transmission.
[0234] The fourth scenario (when the function expansion device is transmitting, the LPC main controller has an LPC transmission request):
[0235] There is a RAM inside the function expansion device. When the function expansion device performs DMA or BusMaster transmission on the LPC bus, the LPC master controller initiates LPC transmission to the LPC bus, and the function expansion device stores the transmission in the RAM until the function expansion device completes the DMA or Bus Master transmission at this time, and then forwards the transmission request in the RAM to the LPC bus in sequence. When the transmission from the LPC master controller enters the SYNC (synchronization) stage, the function expansion device will respond to the LPC master controller with Long Wait, indicating that the transmission on the LPC bus cannot be performed temporarily, until all the transmission requests in the RAM are forwarded to the LPC bus.
[0236] If before this, the LPC main controller cancels the transmission through the Abort mechanism, the function expansion device will not forward the transmission to the LPC bus.
[0237] In addition, the function expansion device of the present application can also be configured as an LPC slave device on the LPC bus, initiate corresponding DMA and Bus Master transmissions when the LPC master controller is not transmitting, and interrupt the ongoing transmission and give up the control of the LPC bus when the LPC master controller pulls down the LFRAME signal to start the transmission. At this time, the function expansion device will not block the transmission of the LPC master controller, nor will it forward the transmission of the LPC master controller. Fig. 20 As shown in FIG. 1 , the function expansion device is used as an LPC bus slave device for transmission, and the LPC main controller has a waveform diagram of a transmission request. When the LPC main controller sends a request, the corresponding request is synchronously transmitted on the LPC bus.
[0238] In summary, this application proposes a function expansion device for an LPC main controller. It can add DMA type and Bus Master type data transmission functions based on the original interface of the LPC main controller without changing the design of the LPC main controller, and does not affect the normal transmission of the LPC main controller. The specific technical implementation is as follows:
[0239] (1) This application proposes a function expansion device to add DMA and Bus Master functions to the LPC master controller, mainly involving: LPC slave interface, LPC master interface, DMA module, Bus Master module, LPC bus, sub-protocol interface, LDRQ signal, SERIRQ signal;
[0240] (2) In the above function expansion device, the LPC slave interface is connected to the LPC master controller and is used to receive requests from the LPC master controller and to hold or forward them; the LPC master interface is used to forward the transmission of the LPC master controller on the LPC bus, or to initiate a DMA or Bus Master transmission request when the LPC master controller has no transmission; both the LPC slave interface and the LPC master interface comply with the provisions of the LPC1.1 protocol and are used to implement the detection, arbitration, execution and exception handling of read and write requests of IO, memory, firmware, DMA and Bus Master cycles, as well as mode switching, request detection and clearing processing of serial interrupts; the DMA module is used to implement the detection of DMA transmission requests of LPC slave devices, internal channel arbitration, DMA services and processing of responses of LPC slave devices.
[0241] (3) The function expansion device does not affect the function of the LPC main controller and does not occupy additional interface signals;
[0242] (4) The function expansion device can notify the LPC main controller through the SERIRQ bus that the DMA transfer task has been completed;
[0243] (5) The function expansion device can be used as a memory type LPC slave device and can be read and written by the LPC master controller through the LPC bus;
[0244] (6) The function expansion device can be configured to work as a conversion interface of the LPC master controller or as a slave device on the LPC bus;
[0245] (7) The LPC slave device interface of the function expansion device supports three cycle types: IO, memory, and firmware. The LPC master device interface supports three cycle types: forwarding IO, memory, and firmware. It supports two cycle types: active DMA and Bus Master. It also implements a 7-channel LPC dedicated DMA controller to simultaneously support two LPC devices with DMA function, namely two LDRQ signal lines.
[0246] (8) The function expansion device can initiate a DMA or Bus Master periodic type transfer request when the LPC main controller is idle, and can also forward the transfer request of the LPC main controller when the function expansion device is idle;
[0247] (9) Based on (6), when the function expansion device, as a conversion interface of the LPC master controller, is performing a DMA or Bus Master cycle type transfer request, it receives a transfer request from the LPC master controller. The function expansion device will respond with a long wait when the LPC master controller transfer enters the SYNC phase, and after completing the current DMA or Bus Master cycle type transfer request, it will forward the LPC master controller transfer request to the LPC bus, and transmit the response of the LPC slave device on the LPC bus to the LPC master controller;
[0248] (10) Based on (6), when the function expansion device is a slave device on the LPC bus and is performing a DMA or BusMaster periodic type transfer request, the bus receives a transfer request from the LPC master controller. The function expansion device will immediately abandon the LPC bus and wait until there is no transfer on the LPC bus before starting the DMA or BusMaster transfer.
[0249] (11) The function expansion device can be used as an independent device or as an IP embedded in a programmable logic device such as an FPGA or an application-specific integrated circuit ASIC;
[0250] (12) The sub-protocol interface of the function expansion device is compatible with multiple protocols and supports multiple protocols such as SATA, USB, PCI / PCIe, AXI, AHB, APB, ISA, I2C, UART, etc.
[0251] It is to be understood that, although the present invention has been disclosed as a preferred embodiment, the above embodiment is not intended to limit the present invention. For any person skilled in the art, without departing from the scope of the technical solution of the present invention, the technical content disclosed above can be used to make many possible changes and modifications to the technical solution of the present invention, or modified into equivalent embodiments of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
[0252] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0253] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0254] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0255] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A data transmission control method based on LPC bus, It is characterized in that Applied to a function expansion device, the function expansion device at least comprises: a slave interface, a master interface and a target interface; the slave interface is connected to an LPC master controller, the master interface is connected to a first LPC bus, the target interface is connected to a storage device, and the first LPC bus is connected to a slave device; Wherein, the method comprises: The slave interface receives a first transmission request sent by the LPC master controller; The master interface receives a signal state of a low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, and initiates a second transfer request of a target type according to the signal state, so that the storage device and the slave device implement data transmission of the target type through the target interface and the master interface; Wherein, the slave interface is connected to the LPC master controller via the second LPC bus; or, the slave interface is connected to the LPC master controller via the first LPC bus; Wherein, in the case where the slave interface is connected to the LPC master controller through the second LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the method further includes: The slave interface sends the first transmission request to the master interface, so that the master interface sends the first transmission request to the slave device through the first LPC bus, so that the slave device responds to the first transmission request; Wherein, in the case where the slave interface is connected to the LPC master controller through the first LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the method further includes: The function expansion device responds to the first transmission request; Before the slave interface sends the first transmission request to the master interface, the method further includes: Detecting whether the main interface is in an idle state; If the master interface is in an idle state, the slave interface sends the first transmission request to the master interface; If the master interface is not in an idle state, the slave interface stores the first transmission request in a cache area; In response to the master interface being in an idle state, the slave interface sends the first transmission request in the cache area to the master interface.
2. The method according to claim 1, It is characterized in that The function expansion device further includes: a register; Wherein, in the case where the slave interface is connected to the LPC master controller through the second LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the method further includes: determining whether the first transfer request is for the register; In a case where the first transfer request is directed to the register, the function expansion device responds to the first transfer request.
3. The method according to claim 1, It is characterized in that The function expansion device further includes: a register; Wherein, in the case where the target type of data transmission is a direct memory access DMA type of data transmission, before the master interface receives the signal state of a low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, the method further includes: The slave interface receives a register configuration request sent by the LPC master controller, and sends the register configuration request to the register so that the register responds to the register configuration request, wherein the register configuration request is used to set data transmission parameters of the target type; The data transmission parameters of the target type are used to implement the data transmission of the target type between the storage device and the slave device through the target interface and the master interface.
4. The method according to claim 1, It is characterized in that In a case where the target type of data transmission is a bus controller type of data transmission, after the master interface initiates a second transmission request of the target type according to the signal state, the method further includes: The master interface receives the data transmission parameter of the target type sent by the slave device through the first LPC bus; The data transmission parameters of the target type are used to implement the data transmission of the target type between the storage device and the slave device through the target interface and the master interface.
5. The method according to claim 1, It is characterized in that The target type of data transmission includes: direct memory access DMA type of data transmission, or bus controller type of data transmission; The signal state indicates whether the slave device requests to use the target channel identifier to implement the data transmission channel of the target type; Wherein, in the case where the target type of data transmission is the DMA type of data transmission, the method further includes: When the data transmission of the target type is completed, the slave interface feeds back an interrupt signal to the LPC master controller in response to the serial interrupt query request sent by the LPC master controller, and the interrupt signal indicates that the data transmission of the target type is completed.
6. The method according to claim 1, It is characterized in that The function expansion device further comprises: a transmission control module; the transmission control module is at least connected between the target interface and the master interface, and the transmission control module is used to realize the data transmission of the target type between the storage device and the slave device through the target interface and the master interface; The transmission control module initiates an access request to the target interface in response to the second transmission request, so that the target interface reads the first data from the storage device according to the access request and sends the first data to the master interface through the transmission control module, and the master interface sends the first data to the slave device through the first LPC bus; or; The transmission control module initiates an access request to the target interface in response to the second transmission request, so that the target interface writes the second data into the storage device according to the access request; the second data is transmitted from the slave device to the transmission control module through the master interface and the transmission control module transmits the second data to the target interface.
7. An electronic device, It is characterized in that include: A master device, a slave device, a first LPC bus, a storage device, an LPC master controller, and a function expansion device; Wherein, the function expansion device at least comprises: a slave interface, a master interface and a target interface; the slave interface is connected to the LPC master controller, the LPC master controller is connected to the master device, the master interface is connected to the first LPC bus, the target interface is connected to a storage device, and the slave device is connected to the first LPC bus; The slave interface receives a first transmission request sent by the LPC master controller; The master interface receives a signal state of a low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, and initiates a second transfer request of a target type according to the signal state, so that the storage device and the slave device implement data transmission of the target type through the target interface and the master interface; Wherein, the slave interface is connected to the LPC master controller via the second LPC bus; or, the slave interface is connected to the LPC master controller via the first LPC bus; Wherein, in the case where the slave interface is connected to the LPC master controller through the second LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the slave interface sends the first transmission request to the master interface, so that the master interface sends the first transmission request to the slave device through the first LPC bus, so that the slave device responds to the first transmission request; Wherein, in the case where the slave interface is connected to the LPC master controller through the first LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the function expansion device responds to the first transmission request; Wherein, before sending the first transmission request to the master interface, the slave interface detects whether the master interface is in an idle state; if the master interface is in an idle state, the slave interface sends the first transmission request to the master interface; if the master interface is not in an idle state, the slave interface stores the first transmission request in a cache area; in response to the master interface being in an idle state, the slave interface sends the first transmission request in the cache area to the master interface.
8. A function expansion device based on LPC bus, It is characterized in that At least: Slave interface, master interface and target interface; The slave interface is connected to the LPC master controller, the master interface is connected to the first LPC bus, the target interface is connected to the storage device, and the first LPC bus is connected to the slave device; Wherein, the slave interface receives a first transmission request sent by the LPC master controller; The master interface receives a signal state of a low pin count bus direct memory access request signal line LDRQ sent by the slave device through the first LPC bus, and initiates a second transfer request of a target type according to the signal state, so that the storage device and the slave device implement data transmission of the target type through the target interface and the master interface; Wherein, the slave interface is connected to the LPC master controller via the second LPC bus; or, the slave interface is connected to the LPC master controller via the first LPC bus; Wherein, in the case where the slave interface is connected to the LPC master controller through the second LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the slave interface sends the first transmission request to the master interface, so that the master interface sends the first transmission request to the slave device through the first LPC bus, so that the slave device responds to the first transmission request; Wherein, in the case where the slave interface is connected to the LPC master controller through the first LPC bus, after the slave interface receives the first transmission request sent by the LPC master controller, the function expansion device responds to the first transmission request; Wherein, before sending the first transmission request to the master interface, the slave interface detects whether the master interface is in an idle state; if the master interface is in an idle state, the slave interface sends the first transmission request to the master interface; if the master interface is not in an idle state, the slave interface stores the first transmission request in a cache area; in response to the master interface being in an idle state, the slave interface sends the first transmission request in the cache area to the master interface.
Citation Information
Patent Citations
Bus data real-time monitoring analysis method, device and system
CN112035302A
Computer system and control method thereof
KR1020050034340A
