本系列调试说明记录了Linux在全志T113-S3/S4平台上的移植过程,说明过程中可能会技术瑕疵,希望大家提供宝贵意见。
本文移植的硬件平台来自于盈鹏飞嵌入式的SBC-T113S(处理器是T113-S3)主板。
SBC-T113S产品特性:
- 采用Allwinner公司Cortex-A7双核T113-S3/S4处理器,运行最高速度为1.2GHZ;
- 内置64-bit XuanTie C906 RISC-V协处理器(仅T113-S4支持);
- 支持JPEG/MJPEG视频编码,最大分辨率1080p@60fps;支持多格式1080P@60fps视频解码 (H.265,H.264, MPEG-1/2/4);
- 支持RGB666/LVDS/MIPI-DSI,分辨率最高1920x1080;
- 支持128-256M Bytes DDR3 SDRAM,其中T113-S3内置128MB;T113-S4内置256MB;
- 支持SPI NAND存储和启动(默认:256MB;最大1GB)或者EMMC启动(默认:4GB,最大32GB);
- 支持一路USB2.0 OTG(设计为TYPE-A接口);支持二路USB2.0 HOST;
- 支持七路RS232通信或者6路RS232和1路RS485(隔离);
- 支持一路CAN BUS通信(隔离);
- 支持一路10/100M以太网;
- 稳定的操作系统的支持,可预装LINUX 5.4或者OpenWRT;
- 经典尺寸主板,尺寸为120*100MM;
产品功能评估图:
产品尺寸:
以下为 T113 触摸适配USB I2C说明:
查看所有输入设备
sh-4.4# cat /proc/bus/input/devices
物理按键ADC
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-keyboard"
P: Phys=sunxikbd/input0
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=1000 800 c0000 0 0 10000000
电阻屏幕
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="2009c00.rtp"
P: Phys=sun4i_ts/input0
S: Sysfs=/devices/platform/soc@3000000/2009c00.rtp/input/input1
U: Uniq=
H: Handlers=event1
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=3
高精度数模转换模块
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="sunxi-gpadc0"
P: Phys=sunxigpadc0/input0
S: Sysfs=/devices/virtual/input/input2
U: Uniq=
H: Handlers=kbd event2
B: PROP=0
B: EV=100003
B: KEY=200000 0 0 0 0 0 0 0 8c0000 0 0 10000000
GPIO 输入事件
I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name="gpio_event"
P: Phys=gpio_event/input1
S: Sysfs=/devices/platform/rp_power/input/input3
U: Uniq=
H: Handlers=event3
B: PROP=0
B: EV=1
麦克风输入事件
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="audiocodec sunxi Audio Jack"
P: Phys=ALSA
S: Sysfs=/devices/platform/soc@3000000/2030340.sound/sound/card0/input4
U: Uniq=
H: Handlers=kbd event4
B: PROP=0
B: EV=23
B: KEY=40 0 0 0 0 0 0 0 0 0 0 4 0 0 0 c0000 0 0 0
B: SW=14
USB鼠标
I: Bus=0003 Vendor=0000 Product=3825 Version=0111
N: Name=" USB OPTICAL MOUSE"
P: Phys=usb-sunxi-ehci-1.2/input0
S: Sysfs=/devices/platform/soc@3000000/4200000.ehci1-controller/usb1/1-1/1-1.2/1-1.2:1.0/0003:0000:3825.0001/input/input5
U: Uniq=
H: Handlers=event5
B: PROP=0
B: EV=17
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=903
B: MSC=10
电容屏触摸
I: Bus=0003 Vendor=222a Product=0001 Version=0110
N: Name="ILITEK ILITEK-TP Touchscreen"
P: Phys=usb-sunxi-ehci-1.3/input0
S: Sysfs=/devices/platform/soc@3000000/4200000.ehci1-controller/usb1/1-1/1-1.3/1-1.3:1.0/0003:222A:0001.0002/input/input6
U: Uniq=
H: Handlers=event6
B: PROP=0
B: EV=1b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=100 3
B: MSC=10
I: Bus=0003 Vendor=222a Product=0001 Version=0110
N: Name="ILITEK ILITEK-TP Mouse"
P: Phys=usb-sunxi-ehci-1.3/input0
S: Sysfs=/devices/platform/soc@3000000/4200000.ehci1-controller/usb1/1-1/1-1.3/1-1.3:1.0/0003:222A:0001.0002/input/input8
U: Uniq=
H: Handlers=event7
B: PROP=0
B: EV=1b
B: KEY=1f0000 0 0 0 0 0 0 0 0
B: ABS=3
B: MSC=10
查看输入设备-2
sh-4.4# ls -al dev/input/*
crw-rw---- 1 root root 13, 64 Jan 1 00:00 dev/input/event0
crw-rw---- 1 root root 13, 65 Jan 1 00:00 dev/input/event1
crw-rw---- 1 root root 13, 66 Jan 1 00:00 dev/input/event2
crw-rw---- 1 root root 13, 67 Jan 1 00:00 dev/input/event3
crw-rw---- 1 root root 13, 68 Jan 1 00:00 dev/input/event4
crw-rw---- 1 root root 13, 69 Jan 1 00:00 dev/input/event5
crw------- 1 root root 13, 70 Jan 1 00:00 dev/input/event6
crw------- 1 root root 13, 71 Jan 1 00:00 dev/input/event7
dev/input/by-id:
total 0
drwxr-xr-x 2 root root 100 Jan 1 00:00 .
drwxr-xr-x 4 root root 240 Jan 1 00:00 ..
lrwxrwxrwx 1 root root 9 Jan 1 00:00 usb-0000_USB_OPTICAL_MOUSE-event-mouse -> ../event5
lrwxrwxrwx 1 root root 9 Jan 1 00:00 usb-ILITEK_ILITEK-TP-event-if00 -> ../event6
lrwxrwxrwx 1 root root 9 Jan 1 00:00 usb-ILITEK_ILITEK-TP-event-mouse -> ../event7
dev/input/by-path:
total 0
drwxr-xr-x 2 root root 160 Jan 1 00:00 .
drwxr-xr-x 4 root root 240 Jan 1 00:00 ..
lrwxrwxrwx 1 root root 9 Jan 1 00:00 platform-2009c00.rtp-event -> ../event1
lrwxrwxrwx 1 root root 9 Jan 1 00:00 platform-2030340.sound-event -> ../event4
lrwxrwxrwx 1 root root 9 Jan 1 00:00 platform-4200000.ehci1-controller-usb-0:1.2:1.0-event-mouse -> ../event5
lrwxrwxrwx 1 root root 9 Jan 1 00:00 platform-4200000.ehci1-controller-usb-0:1.3:1.0-event -> ../event6
lrwxrwxrwx 1 root root 9 Jan 1 00:00 platform-4200000.ehci1-controller-usb-0:1.3:1.0-event-mouse -> ../event7
lrwxrwxrwx 1 root root 9 Jan 1 00:00 platform-rp_power-event -> ../event3
查看输入事件
sh-4.4# hexdump dev/input/event6
0000000 01ef 0000 cb47 0009 0004 0004 0042 000d
0000010 01ef 0000 cb47 0009 0001 014a 0001 0000
0000020 01ef 0000 cb47 0009 0003 0000 1a31 0000
0000030 01ef 0000 cb47 0009 0003 0001 1990 0000
0000040 01ef 0000 cb47 0009 0000 0000 0000 0000
0000050 01ef 0000 b199 000a 0003 0000 1a2a 0000
QT 环境变量
if [ -d $QTDIR ];then export QT_ROOT=$QTDIR
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib/cedarx/:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_FONTDIR=$QT_ROOT/fonts
#TouchDevice=gt9xxnew_ts
for InputDevices in /sys/class/input/input*
do DeviceName=`cat $InputDevices/name`
# USB ILITEK
if [ $DeviceName == "ILITEK ILITEK-TP" ];then TouchDeviceNum=${InputDevices##*input}
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event$TouchDeviceNum
echo "add "/dev/input/event$TouchDeviceNum "to Qt Application."
break fi
# I2C Goodix
if [ $DeviceName == "gt9xxnew_ts" ];then TouchDeviceNum=${InputDevices##*input}
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event$TouchDeviceNum
echo "add "/dev/input/event$TouchDeviceNum "to Qt Application."
break fi done export QT_QPA_PLATFORM=eglfs
export QT_QPA_GENERIC_PLUGINS=evdevtouch
export QT_QPA_EGLFS_INTEGRATION=eglfs_mali
#export QT_QPA_FB_HIDECURSOR=1
#export QT_QPA_EGLFS_HIDECURSOR=1
#export QT_QPA_EGLFS_ROTATION=90
export QWS_MOUSE_PROTO=
export DBUS_SESSION_BUS_ADDRESS=`cat /tmp/dbusaddr`
mkdir -p /dev/shm
ulimit -c unlimited
#debug Launcher &
debug MediaUI &
echo "find qt5 installed done"
fi
驱动源码
多点触摸
kernel/linux-5.4/drivers/hid/hid-multitouch.c
单点触摸
汇顶I2C触摸
kernel/linux-5.4/drivers/input/touchscreen/gt9xxnew$ tree
├── goodix_tool.c
├── gt9xx.c
├── gt9xxdup.c
├── GT9XXF Firmware Headers
│ ├── GT910
│ │ └── gt9xx_firmware.h
│ ├── GT9150
│ │ └── gt9xx_firmware.h
│ ├── GT950
│ │ └── gt9xx_firmware.h
│ ├── GT960F
│ │ └── gt9xx_firmware.h
│ ├── GT963
│ │ └── gt9xx_firmware.h
│ ├── GT968F
│ │ └── gt9xx_firmware.h
│ └── readme.txt
├── gt9xx_firmware.h
├── gt9xx.h
├── gt9xx_update.c
├── Kconfig
└── Makefile
修改QT触摸方向
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event$TouchDeviceNum:rotate=90