高通msm8937的BLSP学习

1.基础概念

(1)   Bus Access Module (BAM),总线访问模块

BAM is used to move data to/from the peripheral buffers.

(2)   BAM Low-Speed Peripheral (BLSP),低速接口的总线访问模块

(3)   QUP:Qualcomm Universal Peripheral,高通统一的外设

2.Msm8937 BLSP

BLSP是高通对于低速接口的一种管理方式,8937 平台含有两个BLSP(BAM Low-Speed Peripheral) 块,对应于12个BLSP端口。 每一个BLSP块含有最多六个Qualcomm Universal Peripheral (QUP)和六个UART cores、其中SPI和IC2核心集成到一个名字为QUP核心,并且共享同一个FIFO,而UART_DM单独集成并有自己的FIFO,所有的这3个core共享同一个总线接口,也就是对外共用相同的I/O接口,比如:

但是对于只使用两个UART引脚的UART_DM,比如只用到GPIO_4(TX)和GPIO_5(RX),也是使用两个引脚的I2C接口这时也可以同时使用:

通过相关手册查询到每个外设属于BLSP多少。

3. 确认我们使用的I2C对应哪个BLSP和QUP

比如我们采用SDA---GPIO6,SCL---GPIO7,

(1)   到msm8937-pinctrl.dsti确认GPIO6和GPIO7对应设备树中是哪组I2C

其实从上图可知道是第1个BLSP的第2个QUDP,但我们从设备树上找到相关的

(2)   通过i2c_2_active找到msm8937.dtsi下有引用

这里可知是采用BLSP1的QUP2,I2C核基准地址是0x78b6000

(3)   Lk部分确定所用的I2C对应的BLSP和QUP

来看bootable\bootloader\lk\platform\msm_shared\include\blsp_qup.h下的定义

从这里可以看出QUP是从QUP_ID_0开始,那么我们的使用的GPIO6和GPIO7的I2C对应QUP_ID_1,使用示例如下:

4. QUP基地址和IRQs

BLSP routes the following interrupts from its subcores:

BAM_IRQ – Indicates that a BAM operation has completed

PERIPHERAL_IRQ – Driven by UART or QUP; shared at the peripheral level for status updates and errors of the peripheral; a status register in the peripheral core allows software to distinguish between interrupt sources

参考:

高通无人机8074 BLSP接口说明

http://huaqianlee.github.io/2016/04/27/Uav/Qualcomm-uav-blsp-port/

高通APQ8074 spi 接口配置

https://blog.csdn.net/jumper511/article/details/25622833

猜你喜欢

转载自blog.csdn.net/LoongEmbedded/article/details/83070030