rockchip rk3368(px5)车载开发之路4,使能GPS模块UC6226(1.驱动层)

本系列记载作者来到一个新的车载后装市场小公司,负责从新开始维护一套代码的心路过程。系统使用瑞芯微的rk3368芯片,版本是PX5_Android_8.0_release_20180726,从无到有的每个patch修改以及思考。其中着重点是驱动和系统相关,由于涉及到公司保密,所以APP部分暂时不贴过多的代码,只是针对系统bug进行记录。

2020_02_13 ---- 2020_02_14
GPS芯片为外来芯片,非瑞芯微SDK原生支持,所以需要经过仔细的调试和检查。
原理图:
UC6226
需要注意控制的地方也就是i2c,reset对应gpio,一个LDO,一个LDO对应的gpio开关,还有一个主要注意的就是Safeboot引脚(此处datasheet有写,需要配置成固定电平而不是悬空,以增加GPS的稳定性。)
dts中有两部分代码,分别是rfkill和uart0的使能和配置。

diff --git a/arch/arm64/boot/dts/rockchip/rk3368-px5-evb-android.dts b/arch/arm64/boot/dts/rockchip/rk3368-px5-evb-android.dts
index 1a618d3..f139462 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368-px5-evb-android.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3368-px5-evb-android.dts
@@ -249,7 +249,17 @@

                status = "okay";
        };
+       wireless-gps {
+               compatible = "gps-platdata";

+               keep_bt_power_on;
+               GPS,power_gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
+               GPS,rst = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
+               GPS,safeboot = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
+
+               status = "okay";
+       };
+
        gpio_det: gpio-det {
                compatible = "gpio-detection";
                status = "okay";
@@ -1212,6 +1222,12 @@
        status = "okay";
 };

+&uart0 {
+        pinctrl-names = "default";
+        pinctrl-0 = <&uart0_xfer>;
+        status = "okay";
+};
+
 &uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart1_xfer &uart1_cts>;

还有就是自己编写的rfkill文件,对应于设备的电源管理,reset管理等等。

/*
 * Copyright (C) 2016 ROCKCHIP, Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值