Qualcomm 8155 GPS HAL layer code porting

1. Add gps hal layer code package

        Copy the hal layer code of the ublox gps chip to the apps/LINUX/android/hardware/ublox/ path, the tree diagram is as follows:

 2. Modify the compilation options

        To compile the newly added ublox gps hal layer code into the image, you need to modify the two files msmnile_gvmgh.mk and manifest.xml under the path of apps/LINUX/android/device/qcom/msmnile_gvmgh/. [Note: msmnile_gvmgh is my project name, namely out/target/product/msmnile_gvmgh]

2.1 Modify msmnile_gvmgh.mk

        The gps hal layer source code ublox/gps/hal/Android.mk has the following description:

        The value of HIDL_VERSION is defined in ublox/gps/version.mk:

         Search PLATFORM_SDK_VERSION to know that the value is 30, and the corresponding version name is Android11. According to version.mk, the value of HIDL_VERSION should be 2.1.

        In Android, the specified module is compiled into the final burned image through the PRODUCT_PACKAGES macro. Here, the ublox gps hal layer code is compiled and packaged into the image in the same way. Add the following content at the end of the msmnile_gvmgh.mk file:

#for u-blox GNSS
PRODUCT_PACKAGES += libParser \
			        libAgnss \
			        [email protected] \
			        u-blox.conf

2.2 Modify manifest.xml

        It is stated in the README file of the ublox gps hal layer code package that the manifest.xml file needs to be modified, using the description as a template reference and modifying according to the actual situation of the project.

3. Remove Qualcomm's default GPS function module

        Only by removing the default virtual gps function module in the system, the system can load the real gps function code just compiled into the system.

        Modify the apps/LINUX/android/hardware/qcom/gps/gps_vendor_product.mk file.

4. Add security configuration file

        There are instructions in the README file of the ublox gps hal layer code package, as follows:

        There are multiple Android version configuration files in the u-blox/gps/sepolicy/ directory, my Android version is 11, just select Android-11.

        Add the content in the apps/LINUX/android/device/qcom/sepolicy_vndr/SEpolicy.mk file:

BOARD_SEPOLICY_DIRS += hardware/u-blox/gps/sepolicy/android-11

5. Configure the serial port

5.1 Device tree configuration

        GPS and SoC perform data interaction through uart, so it is necessary to configure the device tree file corresponding to the serial port. If the serial port has been configured and can be used normally, skip this step.

5.2 Qup configuration

        The full name of Qup is qualcomm universal peripherals, that is, Qualcomm universal peripherals. The uart is connected to the qup. My gps uart is connected to the QUP13, so Ken needs to be in tz_8155/trustzone_images/core/settings/buses/qup_accesscontrol/qupv3/config/855 Modify the QUPV3_2_SE3 related configuration of the qupv3_perms_auto[] array in the /QUPAC_Access.c file.

         Each array item has 7 elements, namely PeriphID, ProtocolID, Mode, NsOwner, bAllowFifo, bLoad, bModExcl.

PeriphID - QUP SE ID基于QUP块和块内的SE索引,例如QUPV3_2_SE3表示QUP块2,其SE索引为3;
ProtocolID – 它定义了由QUP固件管理的协议。
Mode – 它定义了QUP固件的默认工作模式。它可以是以下之一:QUPV3_MODE_FIFO = 0,QUPV3_MODE_CPU_DMA = 1, QUPV3_MODE_GSI = 2;
NsOwner - 它定义了负责初始化和运行的QUP SE的所有者;
bAllowFifo - 允许FIFO模式始终设置为TRUE。
bLoad - 加载固件映像总是设置为TRUE。
bModExcl - 模式独占性总是设置为FALSE。

5.3 Ublox gps code configuration

        The ublox/gps/u-blox.conf file is the configuration file of the ublox gps hal layer code. In this file, you can configure the serial device nodes that the HAL layer needs to open and the baud rate of the serial port.

Guess you like

Origin blog.csdn.net/qq_41076734/article/details/125996427