sa8155可以继承android与qnx的双系统功能,中间就要涉及到外设的共享使用,可以通过passthrouth 模式来使用
比如USB1需要在android端使用(USB1默认在qnx使用)
a、qnx端system.build.tmpl做如下配置:
#usb1 controller passthrough
pass loc mem:0x0a800000,0x100000,rw=0x0a800000 #USB1 core_base
pass loc mem:0x88e3000,0x1000,rw=0x88e3000 #USB1 hsusb_phy_base
pass loc mem:0x88eb000,0x3000,rw=0x88eb000 #USB1 qmp_phy_base
pass loc mem:0x00780000,0x1000,rw=0x00780000 #USB1 phy_rcal_reg
pass intr gic:523=523 #USB1 dp_hs_phy_irq
pass intr gic:167=167 #USB1 pwr_event_irq
pass intr gic:519=519 #USB1 ss_phy_irq
pass intr gic:522=522 #USB1 dm_hs_phy_irq
pass intr gic:170=170 #USB1 dwc3
至于这个地址值,可以看android端的sa8155-vm-usb.dtsi文件:usb1: ssusb@a800000 {
...
interrupts-extended = <&pdc 11 IRQ_TYPE_EDGE_RISING>,
<&intc GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 7 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 10 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "dp_hs_phy_irq", "pwr_event_irq",
"ss_phy_irq", "dm_hs_phy_irq";
qcom,use-pdc-interrupts;
qcom,default-mode-host;
qcom,ignore-wakeup-src-in-hostmode;.....
}
其他几个地址依次类推。
还有GIC(中断号)需要注意,
523是如何计算出来的还不清楚,不过应该是根据pdc的一个base值然后加上11得到523,所以pdc的base值是512.
而intc的base值32(167-135)。
其他的如果在android使用uart功能(QUPv3 SE13)
pass loc mem:0xcc0000,0x6000,r=0xcc0000
pass loc mem:0xc8c000,0x4000,rw=0xc8c000
pass intr gic:617=617
这个0xcc0000与0xc8c000对应sm8150-qupv3.dtsi文件:
qupv3_0: qcom,qupv3_0_geni_se@8c0000 {
compatible = "qcom,qupv3-geni-se";
reg = <0x8c0000 0x6000>;
qcom,msm-bus,num-paths = <1>;
qcom,msm-bus,vectors-bus-ids =
<MASTER_QUP_0 SLAVE_EBI1>;
iommus = <&apps_smmu 0xc3 0x0>;
qcom,iommu-dma = "bypass";
status = "ok";
};
qupv3_se13_4uart: qcom,qup_uart@0xc8c000 {
compatible = "qcom,msm-geni-serial-hs";
reg = <0xc8c000 0x4000>;
reg-names = "se_phys";
clock-names = "se-clk", "m-ahb", "s-ahb";
clocks = <&gcc GCC_QUPV3_WRAP2_S3_CLK>,
<&gcc GCC_QUPV3_WRAP_2_M_AHB_CLK>,
<&gcc GCC_QUPV3_WRAP_2_S_AHB_CLK>;
pinctrl-names = "default", "active", "sleep";
pinctrl-0 = <&qupv3_se13_default_ctsrtsrx>,
<&qupv3_se13_default_tx>;
pinctrl-1 = <&qupv3_se13_ctsrx>, <&qupv3_se13_rts>,
<&qupv3_se13_tx>;
pinctrl-2 = <&qupv3_se13_ctsrx>, <&qupv3_se13_rts>,
<&qupv3_se13_tx>;
interrupts-extended = <&intc GIC_SPI 585 IRQ_TYPE_LEVEL_HIGH>,
<&tlmm 46 0>;
qcom,wrapper-core = <&qupv3_2>;
qcom,wakeup-byte = <0xFD>;
status = "disabled";
};
gic 值同上分析,最后还需要在sa8155-vm-lv.dtsi添加使能uart设备配置信息
&qupv3_se13_4uart {
status = "ok";
};# QUPv3 SE10 I2C Passthrough
pass loc mem:0xac0000,0x6000,rw=0xac0000
pass loc mem:0xa88000,0x4000,rw=0xa88000
pass intr gic:387=387