Hypervisor touch architecture-passthrough introduction

In another article, we have introduced one of the Hypervisor touch architectures ( Qualcomm Q+A hypervisor touch framework introduction ), this article will introduce another Hypervisor touch solution.

Hypervisor touch Passthrough solution

work process

The two elements i2c/irq required for the touch driver to work are passed through from the QVM to the LA side at the beginning of the Guest OS startup.

#QUPv3 QUPV3_1_SE0(QUP_SE_7) I2C Passthrough
pass loc mem:0x89C000,0x4000,rw=0x89C000
pass intr gic:640=640

pass intr gic:241=241

Among them: pass loc mem:0x89C000,0x4000,rw=0x89C000 refers to the register address of the i2c controller that needs passthrough, pass intr gic:640=640 refers to the interrupt number of the i2c controller, pass intr gic:241=241 refers to the interrupt number of the direct interrupt, which is used for transparent transmission of GPIO interrupts. These values ​​can be obtained from pinmux and gpio_tlmm_dir_intr_8155.xml configuration files.

Data transmission link process:

1. The touch screen is interrupted by touch

2. The interrupt handling function of the touch driver in Guest OS la is triggered

3. The interrupt processing function reads the touch data through i2c

4. The interrupt processing function parses the read touch data and reports it to the input subsystem

5. The upper layer application obtains the touch coordinates through the event device node

It can be seen that this solution works exactly the same as the conventional linux driver, the only difference is that there is an additional layer of qvm passthrough process.

software configuration

QNX configuration

diff --git a/qnx_ap/boards/core/dalconfig/adp_star_sda8155/config/gpio_tlmm_dir_intr_8155.xml b/qnx_ap/boards/core/dalconfig/adp_star_sda8155/config/gpio_tlmm_dir_intr_8155.xml
index e1f1504..8f58a65 100755
--- a/qnx_ap/boards/core/dalconfig/adp_star_sda8155/config/gpio_tlmm_dir_intr_8155.xml
+++ b/qnx_ap/boards/core/dalconfig/adp_star_sda8155/config/gpio_tlmm_dir_intr_8155.xml
@@ -24,8 +24,8 @@
 <driver name="tlmm_drv">
 
    <device id=DALDEVICEID_GPIOINT_DIR_CON_0>
-     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
-        <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         13   </props>
+     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       0   </props>
+        <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         0       </props>
    </device>
    <device id=DALDEVICEID_GPIOINT_DIR_CON_1>
      <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
diff --git a/qnx_ap/target/hypervisor/host/build_files/system.build.tmpl b/qnx_ap/target/hypervisor/host/build_files/system.build.tmpl
index 5196c3f..36ded3c 100755
--- a/qnx_ap/target/hypervisor/host/build_files/system.build.tmpl
+++ b/qnx_ap/target/hypervisor/host/build_files/system.build.tmpl
@@ -444,8 +444,13 @@ pass intr gic:617=617
 #pass loc mem:0x880000,0x4000,rw=0x880000
 #pass intr gic:633=633
 
+#QUPv3 QUPV3_1_SE0(QUP_SE_7) I2C Passthrough
+pass loc mem:0x89C000,0x4000,rw=0x89C000
+pass intr gic:640=640
+
 # Wake up GPIO
 pass intr gic:248=248
+pass intr gic:241=241
 
 # PCIe0 pass-through
 pass loc mem:0x1c00000,0x4000,rw=0x1c00000

android kernel configuration

diff --git a/arch/arm64/boot/dts/qcom/sa8155-vm.dtsi b/arch/arm64/boot/dts/qcom/sa8155-vm.dtsi
index 938597bd2..b9bb7e757 100755
--- a/arch/arm64/boot/dts/qcom/sa8155-vm.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8155-vm.dtsi
@@ -653,5 +653,23 @@
 #include "pm8150-vm.dtsi"
 
 &tlmm {
-       dirconn-list = <37 216 1>;
+       dirconn-list =  <37 216 1>,
+                       <13 209 1>,
+                       <66 210 1>;
+};
+&qupv3_se7_i2c {
+       status = "ok";
+};
+
+&soc {
+       atmel_mxt_64lt@4B{
+               compatible = "atmel,maxtouch";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x4b 1>;
+               interrupts = <0 782 0x0>;
+               interrupt-names = "atmel_irq";
+               atmel,irq-gpio = <&tlmm 14 0x0>;
+               status = "okay";
+       };
 };

The passthrough of i2c is relatively easy to understand. It should be noted that the interrupt transparent transmission here uses the direct interrupt method, and this method only has a maximum of 8 interrupt sources on the 8155, which are configured in the file gpio_tlmm_dir_intr_8155.xml. This direct interrupt method is generally used in early versions. With the iterative update of the version, more interrupt transparent transmission will be supported, such as the way of gpio to irq.

gpio_tlmm_dir_intr_8155.xml configuration

<driver name="tlmm_drv">

   <device id=DALDEVICEID_GPIOINT_DIR_CON_0>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       0   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         0   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_1>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       0   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         0   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_2>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         15   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_3>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         16   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_4>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         38   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_5>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         97   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_6>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       1   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         30   </props>
   </device>
   <device id=DALDEVICEID_GPIOINT_DIR_CON_7>
     <props name="IRQ_ENABLED" type=DALPROP_ATTR_TYPE_UINT32>       0   </props>
     <props name="TLMM_GPIO" type=DALPROP_ATTR_TYPE_UINT32>         0   </props>
   </device>
   
</driver>

In the configuration here, each node represents an interrupt

Comparison of two solutions

Share-devices Passthrough
QNX and LA can receive touch data at the same time Only the LA side can receive touch data
Data transmission link is longer Data transmission link is shorter

Regarding the touch delay of the Share-devices method, we have recently conducted a measurement, and the measurement method is:

1. Measure the interrupt trigger t1 at the serializer interrupt pin

2. After receiving the touch event on the android side, pull the GPIO level to get t2

t2 - t1 is about 4ms, not particularly long, of course, it is definitely not as fast as the passthrough method.

Guess you like

Origin blog.csdn.net/kill150/article/details/130196371