修改目录
kernel-5.10
device/rockchip/rk356x/
frameworks/base
system/core
dts配置
kernel-5.10
&uart4 {
status = "okay";
pinctrl-0 = <&uart4m0_xfer>;
+ gnss {
+ //compatible = "u-blox,neo-8";
+ dma-names = "!tx", "!rx";
+ vcc-supply = <&vcc3v3_gps>;
+ enable-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
+ gps-rst-gpios = <&gpio3 RK_PC7 GPIO_ACTIVE_HIGH>;
+ current-speed = <115200>;
+ };
+
};
ystem/core需将最新驱动更新,并且完全删除之前的gps配置
hardware\interfaces\gnss\2.0\default\ 下安卓接口代码修改
安卓6.0以上,需打开selinux关于串口、网络等的操作权限,否则hal获取不了串口数据。特别是user版本固件不能修改selinux权限为许可,需增加串口设备和vndbinder设备和tty_devies/serial_device等设备ioctl read write open等权限,才能正常启动GPS服务,才会读取到串口数据,要不然可能会启动服务失败导致so崩溃,编译前的修改参考:
在system/sepolicy/vendor/hal_gnss_default.te最后,增加:
allow hal_gnss_default vndbinder_device:chr_file { getattr ioctl read write open map };
allow hal_gnss_default serial_device:chr_file { getattr ioctl read write open map };
allow hal_gnss_default console_device:chr_file { getattr ioctl read write open map };
allow hal_gnss_default ttyS_device:chr_file { getattr ioctl read write open map };