SDK中drivers/input/touchscreen/gt9xx/gt9xx.c 文件版本为2.2,当编译环境Linux核心版本大于5.6时,移植GT系列触摸芯片驱动,在编译过程中会发生一个指针类型错误,goodix官方最新版本为2.81,通过加入一个内核版本判断语句避免了这个错误,希望官方更新SDK中该驱动文件。
详细情况见:https://bbs.eeworld.com.cn/thread-1289024-1-1.html
SDK中的GT9XX触摸驱动版本过低引发的编译问题
您好,感谢您的反馈,相比新版的goodix驱动在开发阶段需要测试固件时不需要单独制作固件放置到/lib/firmware下,但是老版驱动对新内核的支持性较差所以Rockchip提供的内核源码默认没有作为menuconfig可选选项放出来,在调试过程中我们使用到了所以将其添加到Kconfig中。如果需要控制GT911可以参考Ultra系列适配的电容屏,直接使用goodix驱动就可以,在有更稳定的驱动的情况下我们一般不对已被替代的方案进行更新
感谢回复,之前没注意到内核还有另一套驱动,已经在内核设置里切换了goodix的驱动了,也参照ultra关于RGB屏幕部分的内容配置了设备树,但是还是无法识别GT911,想请教您下
设备是pico pro max ,使用I2C3m1,SDA和SCL接9号和10号引脚,26号(gpio2 pa2)和27号(gpio2 pa3)引脚作RST和IRQ
设备树参照WIKI设置如下
Code: Select all
&i2c3 {
status="okay";
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c3m1_xfer &tp_rst &tp_irq>;
GT911:touchscreen {
compatible = "goodix,gt911";
reg = <0x14>;
interrupt-parent = <&gpio2>;
interrupts = <RK_PA2 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_LOW>;
};
};
&pinctrl {
touchscreen{
tp_rst:tp-rst {
rockchip,pins = <2 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
};
tp_irq:tp-irq {
rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};
现在怀疑是中断没有正常触发,所以I2C找不到GT911的地址,查看gpio状态如下:
Code: Select all
[root@luckfox input]# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/ff380000.gpio, gpio0:
gpiochip1: GPIOs 32-63, parent: platform/ff530000.gpio, gpio1:
gpio-33 ( |pa-ctl ) out lo
gpio-48 ( |spi0 CS0 ) out hi ACTIVE LOW
gpio-51 ( |fb_st7789v ) out hi
gpiochip2: GPIOs 64-95, parent: platform/ff540000.gpio, gpio2:
gpio-72 ( |backlight ) out hi
gpio-73 ( |fb_st7789v ) out hi
gpiochip3: GPIOs 96-127, parent: platform/ff550000.gpio, gpio3:
gpio-118 ( |work ) out lo
gpiochip4: GPIOs 128-151, parent: platform/ff560000.gpio, gpio4:
您好,使用 i2cdetect 找不到设备一般是RST引脚的设置问题,正常情况下无论是作为0x14 还是 0x5d 都会显示出来,设备树设置正确就会标记为UU,在/dev/input/下就会有对应的eventx. 根据您的设备树来看gpio2 pa3作为RST引脚的设置没有问题,请检查一下接线是否正确,使用
查看一下是否驱动正常加载,这是正常加载的内核信息
Code: Select all
dmesg | grep Goodix
Code: Select all
[ 0.104340] Goodix-TS 3-0014: supply AVDD28 not found, using dummy regulator
[ 0.104514] Goodix-TS 3-0014: supply VDDIO not found, using dummy regulator
[ 0.106306] Goodix-TS 3-0014: ID 911, version: 1060
[ 0.125037] input: Goodix Capacitive TouchScreen as /devices/platform/ff460000.i2c/i2c-3/3-0014/input/input0
接线检查过,万用表也测通了。但驱动是没加载上的,dmesg没有goodix相关字样,dmesg里面有一个INPUT的报错不知道和触摸相关不。
/dev/input下是有event0的,但是运行hexdump /dev/input/event0 内容为空。
用cat /sys/kernel/debug/gpio 打印gpio状态
没显示gpio2 PA3 引脚的状态 不知道是否和这个有关?
Code: Select all
[ 2.167870] udevd[91]: starting version 3.2.7
[ 2.183746] udevd[91]: specified group 'input' unknown
[ 2.184838] udevd[91]: specified group 'kvm' unknown
用cat /sys/kernel/debug/gpio 打印gpio状态
没显示gpio2 PA3 引脚的状态 不知道是否和这个有关?
/dev/input/event0 是 adc 按键的,正常情况下就是没有连接触摸屏驱动和设备树的 compatible = "goodix,gt911" 匹配上也会打印相应的报错信息,/sys/kernel/debug/gpio正常对应的reset引脚也应该显示,我觉得可能是内核选项没有开启或者设备树没有应用成功,使用ls /proc/device-tree/i2c@ff460000/(对应i2c3 )看看是否有touchscreen 节点
使用ls /proc/device-tree/i2c@ff460000/ 下确实有touchscreen,看里面compatible也是goodix,gt911
是不是就证明设备树I2C3部分没问题了,现在看就是reset的GPIO没有成功
按您说的 有touchscreen是不是就排除内核选项的问题了(内核我开启了goodix i2c touchscreen,还有别的要开启吗)
如果是设备树的问题,是不是tp reset的GPIO2 pa3还要在根节点写一下?
类似LCD的reset这样?:
抱歉,我是小白,刚摸索着学习,可能问题有些初级了,耽误了您不少时间,拜谢
是不是就证明设备树I2C3部分没问题了,现在看就是reset的GPIO没有成功
按您说的 有touchscreen是不是就排除内核选项的问题了(内核我开启了goodix i2c touchscreen,还有别的要开启吗)
如果是设备树的问题,是不是tp reset的GPIO2 pa3还要在根节点写一下?
类似LCD的reset这样?:
Code: Select all
/ {
model = "Luckfox Pico Max";
compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1106";
/*LCD_RES*/
gpio1pc3:gpio1pc3 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&gpio1_pc3>;
regulator-name = "gpio1_pc3";
regulator-always-on;
};
您好,引脚默认就是GPIO,在根节点上创建这一步是可以省略的,排除了设备树的问题就需要考虑驱动问题,正常没有任何硬件连接驱动加载在dmesg就会打印
出现这些log后再考虑硬件上的问题,如果方便的化直接发一份启动后的串口输出日志吧,看一下Goodix没有成功加载的原因
Code: Select all
[ 0.189641] Goodix-TS 3-0014: supply AVDD28 not found, using dummy regulator
[ 0.189828] Goodix-TS 3-0014: supply VDDIO not found, using dummy regulator
[ 0.190259] Goodix-TS 3-0014: i2c test failed attempt 1: -2147483644
[ 0.214908] Goodix-TS 3-0014: i2c test failed attempt 2: -2147483644
[ 0.241299] Goodix-TS 3-0014: I2C communication failure: -2147483644
[ 0.241551] Goodix-TS: probe of 3-0014 failed with error -2147483644
Code: Select all
[root@luckfox root]# dmesg
[ 1.235013] fb_st7789v spi0.0: fbtft_write_spi(len=4096): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
[ 1.287391] fb_st7789v spi0.0: fbtft_write_spi(len=2048): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
[ 1.288280] fb_st7789v spi0.0: Display update: 1749 kB/s, fps=9
[ 1.654249] ubi0: scanning is finished
[ 1.659930] ubi0: attached mtd6 (name "rootfs", size 210 MiB)
[ 1.659954] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1.659964] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 1.659973] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1.659985] ubi0: good PEBs: 1680, bad PEBs: 0, corrupted PEBs: 0
[ 1.659994] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 1.660004] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1445342135
[ 1.660016] ubi0: available PEBs: 0, total reserved PEBs: 1680, PEBs reserved for bad PEB handling: 40
[ 1.661152] ALSA device list:
[ 1.661198] #0: rv-acodec
[ 1.661739] ubi0: background thread "ubi_bgt0d" started, PID 58
[ 1.661972] UBIFS (ubi0:0): Mounting in unauthenticated mode
[ 1.677812] UBIFS (ubi0:0): recovery needed
[ 1.731096] UBIFS (ubi0:0): recovery deferred
[ 1.731229] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
[ 1.731250] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 1.731264] UBIFS (ubi0:0): FS size: 206336000 bytes (196 MiB, 1625 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[ 1.731275] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[ 1.731288] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 13DD5103-9593-4C46-845B-FAFD66C5B88B, small LPT model
[ 1.731969] VFS: Mounted root (ubifs filesystem) readonly on device 0:14.
[ 1.732852] devtmpfs: mounted
[ 1.733094] Freeing unused kernel memory: 200K
[ 1.733106] Kernel memory protection not selected by kernel config.
[ 1.733145] Run /sbin/init as init process
[ 1.733154] with arguments:
[ 1.733158] /sbin/init
[ 1.733162] with environment:
[ 1.733166] HOME=/
[ 1.733169] TERM=linux
[ 1.733173] user_debug=31
[ 1.733176] storagemedia=mtd
[ 1.733181] earlycon=uart8250,mmio32,0xff4c0000
[ 1.739655] process '/bin/busybox' started with executable stack
[ 1.806548] UBIFS (ubi0:0): completing deferred recovery
[ 1.903545] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 61
[ 1.924098] UBIFS (ubi0:0): deferred recovery completed
[ 2.183668] udevd[91]: starting version 3.2.7
[ 2.199605] udevd[91]: specified group 'input' unknown
[ 2.200692] udevd[91]: specified group 'kvm' unknown
[ 2.223330] udevd[92]: starting eudev-3.2.7
[ 2.681722] udevd[102]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd0ro': No such file or directory
[ 2.692006] udevd[103]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd1ro': No such file or directory
[ 2.702776] udevd[104]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd2ro': No such file or directory
[ 2.708115] udevd[105]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd3ro': No such file or directory
[ 2.718137] udevd[106]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd4ro': No such file or directory
[ 2.726281] udevd[107]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd5ro': No such file or directory
[ 2.732331] udevd[108]: failed to execute '/lib/udev/mtd_probe' 'mtd_probe /dev/mtd6ro': No such file or directory
[ 3.195994] ubi4: attaching mtd4
[ 3.252809] ubi4: scanning is finished
[ 3.260551] ubi4: attached mtd4 (name "oem", size 30 MiB)
[ 3.260581] ubi4: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 3.260602] ubi4: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 3.260611] ubi4: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 3.260620] ubi4: good PEBs: 240, bad PEBs: 0, corrupted PEBs: 0
[ 3.260630] ubi4: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 3.260640] ubi4: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1029883552
[ 3.260651] ubi4: available PEBs: 0, total reserved PEBs: 240, PEBs reserved for bad PEB handling: 40
[ 3.261963] ubi4: background thread "ubi_bgt4d" started, PID 128
[ 3.308677] UBIFS (ubi4:0): Mounting in unauthenticated mode
[ 3.308897] UBIFS (ubi4:0): background thread "ubifs_bgt4_0" started, PID 133
[ 3.325104] UBIFS (ubi4:0): recovery needed
[ 3.433225] UBIFS (ubi4:0): recovery completed
[ 3.436403] UBIFS (ubi4:0): UBIFS: mounted UBI device 4, volume 0, name "oem"
[ 3.436425] UBIFS (ubi4:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 3.436439] UBIFS (ubi4:0): FS size: 23617536 bytes (22 MiB, 186 LEBs), journal size 4190208 bytes (3 MiB, 33 LEBs)
[ 3.436448] UBIFS (ubi4:0): reserved for root: 0 bytes (0 KiB)
[ 3.436460] UBIFS (ubi4:0): media format: w4/r0 (latest is w5/r0), UUID 12C9756E-57B1-433F-A25F-808868427352, small LPT model
[ 3.487012] ubi5: attaching mtd5
[ 3.506481] ubi5: scanning is finished
[ 3.514120] ubi5: attached mtd5 (name "userdata", size 10 MiB)
[ 3.514146] ubi5: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 3.514157] ubi5: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 3.514168] ubi5: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 3.514178] ubi5: good PEBs: 80, bad PEBs: 0, corrupted PEBs: 0
[ 3.514187] ubi5: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 3.514209] ubi5: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 115902117
[ 3.514219] ubi5: available PEBs: 0, total reserved PEBs: 80, PEBs reserved for bad PEB handling: 40
[ 3.523342] ubi5: background thread "ubi_bgt5d" started, PID 142
[ 3.556966] UBIFS (ubi5:0): Mounting in unauthenticated mode
[ 3.557204] UBIFS (ubi5:0): background thread "ubifs_bgt5_0" started, PID 147
[ 3.573305] UBIFS (ubi5:0): recovery needed
[ 3.624384] UBIFS (ubi5:0): recovery completed
[ 3.627500] UBIFS (ubi5:0): UBIFS: mounted UBI device 5, volume 0, name "userdata"
[ 3.627526] UBIFS (ubi5:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 3.627540] UBIFS (ubi5:0): FS size: 3301376 bytes (3 MiB, 26 LEBs), journal size 1650688 bytes (1 MiB, 13 LEBs)
[ 3.627550] UBIFS (ubi5:0): reserved for root: 0 bytes (0 KiB)
[ 3.627562] UBIFS (ubi5:0): media format: w4/r0 (latest is w5/r0), UUID C97F58C1-398A-4D93-854D-72F672EFA16C, small LPT model
[ 3.788837] rk_dvbm ffa70000.rkdvbm: probe start
[ 3.788900] rk_dvbm ffa70000.rkdvbm: dvbm ctx 81792619
[ 3.791317] rk_dvbm ffa70000.rkdvbm: probe success
[ 3.833830] rkcifhw ffa10000.rkcif: no iommu attached, using non-iommu buffers
[ 3.833862] rkcifhw ffa10000.rkcif: No reserved memory region assign to CIF
[ 3.834844] rkcif rkcif-mipi-lvds: rkcif driver version: v00.01.0a
[ 3.835208] rkcif rkcif-mipi-lvds: attach to cif hw node
[ 3.835232] rkcif rkcif-mipi-lvds: failed to get dphy hw node
[ 3.835244] rkcif rkcif-mipi-lvds: rkcif wait line 0
[ 3.835259] : terminal subdev does not exist
[ 3.835270] : terminal subdev does not exist
[ 3.835280] : terminal subdev does not exist
[ 3.835289] : terminal subdev does not exist
[ 3.835298] : get_remote_sensor: video pad[0] is null
[ 3.835309] : rkcif_update_sensor_info: stream[0] get remote sensor_sd failed!
[ 3.835329] : get_remote_sensor: video pad[0] is null
[ 3.835337] : rkcif_update_sensor_info: stream[0] get remote sensor_sd failed!
[ 3.835346] : get_remote_sensor: video pad[0] is null
[ 3.835353] : rkcif_update_sensor_info: stream[0] get remote sensor_sd failed!
[ 3.835362] : get_remote_sensor: video pad[0] is null
[ 3.835369] : rkcif_update_sensor_info: stream[0] get remote sensor_sd failed!
[ 3.847881] rkcif rkcif-mipi-lvds: No memory-region-thunderboot specified
[ 3.852641] rkcif rkcif-mipi-lvds: Entity type for entity rockchip-mipi-csi2 was not initialized!
[ 3.852953] rockchip-mipi-csi2: Async registered subdev
[ 3.852973] rockchip-mipi-csi2: probe success, v4l2_dev:rkcif-mipi-lvds!
[ 3.897469] rkisp_hw ffa00000.rkisp: is_thunderboot: 0
[ 3.897496] rkisp_hw ffa00000.rkisp: max input:0x0@0fps
[ 3.897510] rkisp_hw ffa00000.rkisp: Missing rockchip,grf property
[ 3.897711] rkisp_hw ffa00000.rkisp: get sram size:258048
[ 3.897727] rkisp_hw ffa00000.rkisp: no iommu attached, using non-iommu buffers
[ 3.897737] rkisp_hw ffa00000.rkisp: No reserved memory region. default cma area!
[ 3.900257] rkisp rkisp-vir0: rkisp driver version: v02.00.00
[ 3.901635] rkisp rkisp-vir0: Entity type for entity rkisp-isp-subdev was not initialized!
[ 3.929179] rockchip-csi2-dphy-hw ff3e8000.csi2-dphy-hw: csi2 dphy hw probe successfully!
[ 3.948826] rockchip-csi2-dphy csi2-dphy0: csi2 dphy0 probe successfully!
[ 4.035405] rkcif rkcif-mipi-lvds: clear unready subdev num: 3
[ 4.035433] rockchip-csi2-dphy0: No link between dphy and sensor
[ 4.036887] rockchip-csi2-dphy0: No link between dphy and sensor
[ 4.036959] rkcif-mipi-lvds: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 4.036976] rkcif-mipi-lvds: Async subdev notifier completed
[ 4.036986] rockchip-csi2-dphy0: No link between dphy and sensor
[ 4.037437] rkcif-mipi-lvds: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 4.037461] rkcif-mipi-lvds: There is not terminal subdev, not synchronized with ISP
[ 4.037501] rockchip-csi2-dphy0: No link between dphy and sensor
[ 4.037527] rkcif-mipi-lvds: rkcif_update_sensor_info: stream[0] get remote terminal sensor failed!
[ 4.037535] rkcif-mipi-lvds: There is not terminal subdev, not synchronized with ISP
[ 4.037978] rkisp rkisp-vir0: clear unready subdev num: 1
[ 4.038295] rkisp-vir0: Async subdev notifier completed
[ 4.079024] rga: rga2, irq = 37, match scheduler
[ 4.079800] rga: rga2 hardware loaded successfully, hw_version:3.3.87975.
[ 4.079925] rga: rga2 probe successfully
[ 4.081120] rga_iommu: IOMMU binding successfully, default mapping core[0x4]
[ 4.082309] rga: Module initialized. v1.2.23
[ 4.167341] mpp_vcodec: loading out-of-tree module taints kernel.
[ 4.182202] mpp_vcodec: init new
[ 4.182577] mpp_service mpp-srv: 3760314f author: Zhihua Wang 2023-01-12 [vcodec]: check chan create when destroy
[ 4.182596] mpp_service mpp-srv: probe start
[ 4.184979] mpp_rkvenc_540c ffa50000.rkvenc: probing start
[ 4.185976] mpp_rkvenc_540c ffa50000.rkvenc: probing finish
[ 4.186424] mpp_vepu_pp ffa60000.rkvenc-pp: probe device
[ 4.186539] mpp_vepu_pp ffa60000.rkvenc-pp: shared_rst_a_pp is not found!
[ 4.186550] vepu_pp_init:528: No aclk reset resource define
[ 4.186561] mpp_vepu_pp ffa60000.rkvenc-pp: shared_rst_h_pp is not found!
[ 4.186568] vepu_pp_init:531: No hclk reset resource define
[ 4.188336] mpp_vepu_pp ffa60000.rkvenc-pp: probing finish
[ 4.188618] mpp_service mpp-srv: probe success
[ 4.218895] RKNPU ff660000.npu: RKNPU: rknpu iommu device-tree entry not found!, using non-iommu mode
[ 4.220537] RKNPU ff660000.npu: RKNPU: Initialized RKNPU driver: v0.8.2 for 20220829
[ 4.220667] RKNPU ff660000.npu: dev_pm_opp_set_regulators: no regulator (rknpu) found: -19
[ 4.406253] rockit_load start
[ 4.418492] rockit_load end
[ 4.709088] rk_gmac-dwmac ffa80000.ethernet eth0: PHY [stmmac-0:02] driver [RK630 PHY] (irq=POLL)
[ 4.709851] dwmac4: Master AXI performs any burst length
[ 4.709887] rk_gmac-dwmac ffa80000.ethernet eth0: No Safety Features support found
[ 4.709907] rk_gmac-dwmac ffa80000.ethernet eth0: PTP not supported by HW
[ 4.710231] rk_gmac-dwmac ffa80000.ethernet eth0: configuring for phy/rmii link mode
[ 5.238479] file system registered
[ 5.287201] using random self ethernet address
[ 5.287236] using random host ethernet address
[ 5.331100] Mass Storage Function, version: 2009/09/11
[ 5.331205] LUN: removable file: (no medium)
[ 5.502210] read descriptors
[ 5.506299] read strings
[ 6.486727] usb0: HOST MAC f2:78:ac:08:aa:36
[ 6.486750] usb0: MAC d6:ee:22:25:4b:eb
[ 6.596938] dwc3 ffb00000.usb: device reset
[ 6.701994] android_work: sent uevent USB_STATE=CONNECTED
[ 6.837935] dwc3 ffb00000.usb: device reset
[ 6.954745] android_work: sent uevent USB_STATE=CONFIGURED
又去确认了下/luckfox-pico/sysdrv/source/kernel/arch/arm/configs/luckfox_rv1106_linux_defconfig里面
有CONFIG_TOUCHSCREEN_GOODIX=y 设置
请问有串口模块吗?dmesg没办法显示全部的内核日志,你的日志是不完整的,用串口日志可以显示所有的内容包括uboot阶段的信息