Skip to content

Commit 23f7784

Browse files
authored
Merge pull request #63 from ivanivanivanivanivanivan/khadas-vims-4.9.y
Khadas vims 4.9.y
2 parents 45e9225 + dae0369 commit 23f7784

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+24405
-6
lines changed

arch/arm64/boot/dts/amlogic/kvim3_linux.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,7 @@
14441444

14451445
&pcie_A {
14461446
reset-gpio = <&gpio GPIOA_8 GPIO_ACTIVE_HIGH>;
1447+
wake-gpio = <&gpio GPIOA_7 GPIO_ACTIVE_HIGH>;
14471448
status = "disabled";
14481449
};
14491450

arch/arm64/boot/dts/amlogic/kvim3l_linux.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,7 @@
17961796

17971797
&pcie_A {
17981798
reset-gpio = <&gpio GPIOA_8 GPIO_ACTIVE_HIGH>;
1799+
wake-gpio = <&gpio GPIOA_7 GPIO_ACTIVE_HIGH>;
17991800
status = "disabled";
18001801
};
18011802

arch/arm64/configs/kvims_defconfig

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,68 @@ CONFIG_USB_DWC3_HOST=y
617617
CONFIG_USB_SERIAL=y
618618
CONFIG_USB_SERIAL_CONSOLE=y
619619
CONFIG_USB_SERIAL_GENERIC=y
620-
CONFIG_USB_SERIAL_CH341=y
621-
CONFIG_USB_SERIAL_CP210X=y
622-
CONFIG_USB_SERIAL_FTDI_SIO=y
623-
CONFIG_USB_SERIAL_PL2303=y
624-
CONFIG_USB_SERIAL_OPTION=y
620+
CONFIG_USB_SERIAL_SIMPLE=m
621+
CONFIG_USB_SERIAL_AIRCABLE=m
622+
CONFIG_USB_SERIAL_ARK3116=m
623+
CONFIG_USB_SERIAL_BELKIN=m
624+
CONFIG_USB_SERIAL_CH341=m
625+
CONFIG_USB_SERIAL_WHITEHEAT=m
626+
CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
627+
CONFIG_USB_SERIAL_CP210X=m
628+
CONFIG_USB_SERIAL_CYPRESS_M8=m
629+
CONFIG_USB_SERIAL_EMPEG=m
630+
CONFIG_USB_SERIAL_FTDI_SIO=m
631+
CONFIG_USB_SERIAL_VISOR=m
632+
CONFIG_USB_SERIAL_IPAQ=m
633+
CONFIG_USB_SERIAL_IR=m
634+
CONFIG_USB_SERIAL_EDGEPORT=m
635+
CONFIG_USB_SERIAL_EDGEPORT_TI=m
636+
CONFIG_USB_SERIAL_F81232=m
637+
CONFIG_USB_SERIAL_GARMIN=m
638+
CONFIG_USB_SERIAL_IPW=m
639+
CONFIG_USB_SERIAL_IUU=m
640+
CONFIG_USB_SERIAL_KEYSPAN_PDA=m
641+
CONFIG_USB_SERIAL_KEYSPAN=m
642+
CONFIG_USB_SERIAL_KEYSPAN_MPR=y
643+
CONFIG_USB_SERIAL_KEYSPAN_USA28=y
644+
CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
645+
CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
646+
CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
647+
CONFIG_USB_SERIAL_KEYSPAN_USA19=y
648+
CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
649+
CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
650+
CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
651+
CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
652+
CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
653+
CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
654+
CONFIG_USB_SERIAL_KLSI=m
655+
CONFIG_USB_SERIAL_KOBIL_SCT=m
656+
CONFIG_USB_SERIAL_MCT_U232=m
657+
CONFIG_USB_SERIAL_METRO=m
658+
CONFIG_USB_SERIAL_MOS7720=m
659+
CONFIG_USB_SERIAL_MOS7840=m
660+
CONFIG_USB_SERIAL_MXUPORT=m
661+
CONFIG_USB_SERIAL_NAVMAN=m
662+
CONFIG_USB_SERIAL_PL2303=m
663+
CONFIG_USB_SERIAL_OTI6858=m
664+
CONFIG_USB_SERIAL_QCAUX=m
665+
CONFIG_USB_SERIAL_QUALCOMM=m
666+
CONFIG_USB_SERIAL_SPCP8X5=m
667+
CONFIG_USB_SERIAL_SAFE=m
668+
CONFIG_USB_SERIAL_SAFE_PADDED=y
669+
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
670+
CONFIG_USB_SERIAL_SYMBOL=m
671+
CONFIG_USB_SERIAL_TI=m
672+
CONFIG_USB_SERIAL_CYBERJACK=m
673+
CONFIG_USB_SERIAL_XIRCOM=m
674+
CONFIG_USB_SERIAL_OPTION=m
675+
CONFIG_USB_SERIAL_OMNINET=m
676+
CONFIG_USB_SERIAL_OPTICON=m
677+
CONFIG_USB_SERIAL_XSENS_MT=m
678+
CONFIG_USB_SERIAL_WISHBONE=m
679+
CONFIG_USB_SERIAL_SSU100=m
680+
CONFIG_USB_SERIAL_QT2=m
681+
CONFIG_USB_SERIAL_DEBUG=m
625682
CONFIG_USB_ISP1301=y
626683
CONFIG_USB_GADGET=y
627684
CONFIG_USB_CONFIGFS=y
@@ -670,6 +727,7 @@ CONFIG_PWM=y
670727
CONFIG_ANDROID=y
671728
CONFIG_MALI_MIDGARD=m
672729
CONFIG_MALI_EXPERT=y
730+
CONFIG_PCIE_RM500Q=m
673731
CONFIG_EXT3_FS=y
674732
CONFIG_EXT3_FS_POSIX_ACL=y
675733
CONFIG_EXT3_FS_SECURITY=y

drivers/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,6 @@ source "drivers/tee/Kconfig"
208208

209209
source "drivers/gpu/arm/Kconfig"
210210

211+
source "drivers/pcie_mhi/Kconfig"
212+
211213
endmenu

drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,4 @@ obj-$(CONFIG_NVMEM) += nvmem/
177177
obj-$(CONFIG_FPGA) += fpga/
178178
obj-$(CONFIG_TEE) += tee/
179179
obj-$(CONFIG_AMLOGIC_DRIVER) += amlogic/
180+
obj-$(CONFIG_PCIE_RM500Q) += pcie_mhi/

drivers/amlogic/wifi/wifi_dt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static long wifi_power_ioctl(struct file *filp,
332332
mdelay(200);
333333
set_usb_wifi_power(1);
334334
mdelay(200);
335-
pci_reinit();
335+
// pci_reinit();
336336
WIFI_INFO("Set sdio wifi power up!\n");
337337
break;
338338
case WIFI_POWER_DOWN:

drivers/pcie_mhi/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
config PCIE_RM500Q
2+
tristate "Quectel 5G Module"
3+
default n
4+
help
5+
QUECTEL 5G Module with PCIe
6+

drivers/pcie_mhi/Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ccflags-y += -g
2+
obj-$(CONFIG_PCIE_RM500Q) += pcie_mhi.o
3+
pcie_mhi-objs := core/mhi_init.o core/mhi_main.o core/mhi_pm.o core/mhi_boot.o core/mhi_dtr.o controllers/mhi_qti.o
4+
pcie_mhi-objs += devices/mhi_uci.o
5+
6+
ifeq (1,1)
7+
pcie_mhi-objs += devices/mhi_netdev_quectel.o
8+
else
9+
pcie_mhi-objs += devices/mhi_netdev.o
10+
pcie_mhi-objs += devices/rmnet_handler.o
11+
endif
12+
13+
PWD := $(shell pwd)
14+
ifeq ($(ARCH),)
15+
ARCH := $(shell uname -m)
16+
endif
17+
ifeq ($(CROSS_COMPILE),)
18+
CROSS_COMPILE :=
19+
endif
20+
ifeq ($(KDIR),)
21+
KDIR := /lib/modules/$(shell uname -r)/build
22+
endif
23+
24+
pcie_mhi: clean
25+
$(MAKE) ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(KDIR) M=$(PWD) modules
26+
#cp pcie_mhi.ko /tftpboot/
27+
28+
clean:
29+
$(MAKE) ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(KDIR) M=$(PWD) clean
30+
find . -name *.o.ur-safe | xargs rm -f
31+
32+
install: pcie_mhi
33+
sudo cp pcie_mhi.ko /lib/modules/${shell uname -r}/kernel/drivers/pci/
34+
sudo depmod

drivers/pcie_mhi/README

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
1. porting pcie_mhi driver as next
2+
3+
$ git diff drivers/Makefile
4+
diff --git a/drivers/Makefile b/drivers/Makefile
5+
index 77fbc52..e45837e 100644
6+
--- a/drivers/Makefile
7+
+++ b/drivers/Makefile
8+
@@ -184,3 +184,4 @@ obj-$(CONFIG_FPGA) += fpga/
9+
obj-$(CONFIG_FSI) += fsi/
10+
obj-$(CONFIG_TEE) += tee/
11+
obj-$(CONFIG_MULTIPLEXER) += mux/
12+
+obj-y += pcie_mhi/
13+
14+
$ tree drivers/pcie_mhi/ -L 1
15+
drivers/pcie_mhi/
16+
controllers
17+
core
18+
devices
19+
Makefile
20+
21+
2. check RG500 attach pcie_mhi driver successful
22+
23+
root@OpenWrt:/# lspci
24+
00:00.0 Class 0604: 17cb:0302
25+
01:00.0 Class ff00: 17cb:0306
26+
27+
root@OpenWrt:~# dmesg | grep mhi
28+
[ 138.483252] mhi_init Quectel_Linux_PCIE_MHI_Driver_V1.3.0.6
29+
[ 138.492350] mhi_pci_probe pci_dev->name = 0000:01:00.0, domain=0, bus=1, slot=0, vendor=17CB, device=0306
30+
31+
3. how to use, see next logs
32+
33+
log/QXDM_OVER_PCIE.txt
34+
log/AT_OVER_PCIE.txt
35+
log/MBIM_OVER_PCIE.txt
36+
log/QMI_OVER_PCIE.txt

drivers/pcie_mhi/ReleaseNote.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Release Notes
2+
3+
[V1.3.3]
4+
Date: 5/18/2022
5+
enhancement:
6+
fix:
7+
1. Fix not synchronize access rp/wp when mhi_queue_xxx and mhi_process_xxx_ring run on different CPU
8+
9+
[V1.3.2]
10+
Date: 12/16/2021
11+
enhancement:
12+
1. support Linux Kernel V5.14
13+
2. mhi_netdev_quectel.c do not print log in softirq context
14+
15+
[V1.3.1]
16+
Date: 9/26/2021
17+
enhancement:
18+
fix:
19+
20+
[V1.3.0.19]
21+
Date: 9/18/2021
22+
enhancement:
23+
1. support sdx62 (17cb:0308)
24+
2. support IPQ5018's NSS
25+
3. use 'qsdk/qca/src/data-kernel/drivers/rmnet-nss/rmnet_nss.c' instead myself rmnet_nss.c
26+
and pcie_mhi.ko must load after then rmnet_nss.ko
27+
4. allow bhi irq is not 0 (for ipq5018)
28+
fix:
29+
30+
[V1.3.0.18]
31+
Date: 4/14/2021
32+
enhancement:
33+
1. support mbim multiple call, usage:
34+
# insmod pcie_mhi.ko mhi_mbim_enabeld=1 qmap_mode=4
35+
# quectel-mbim-proxy -d /dev/mhi_MBIM &
36+
# quectel-CM -n X
37+
fix:
38+
39+
[V1.3.0.17]
40+
Date: 3/11/2021
41+
enhancement:
42+
fix:
43+
1. fix CPU loading very high when TPUT test when only one MSI interrupt
44+
2. fix error on latest X24 modem
45+
46+
[V1.3.0.16]
47+
Date: 11/18/2020
48+
enhancement:
49+
fix:
50+
1. add ring size to 32, for in-bound chan, if one ring is full, modem will not generate MSI interrupt for all chan
51+
52+
[V1.3.0.15]
53+
Date: 10/30/2020
54+
enhancement:
55+
1. support multi-modems, named as /dev/mhi_<chan_name>X
56+
fix:
57+
1. fix compile error on kernel v5.8
58+
59+
[V1.3.0.14]
60+
Date: 10/9/2020
61+
enhancement:
62+
1. suppport EM120&EM160
63+
fix:
64+
1. fix compile error on kernel v5.6
65+
2. support runtime suspend
66+
67+
[V1.3.0.13]
68+
Date: 9/7/2020
69+
enhancement:
70+
1. suppport EM120&EM160
71+
fix:
72+
1. fix error on X55 + PCIE2.0(e.g IPQ4019)
73+
2. support runtime suspend
74+
75+
[V1.3.0.12]
76+
Date: 7/7/2020
77+
enhancement:
78+
1. suppport create only none netcard (enabled by marco MHI_NETDEV_ONE_CARD_MODE),
79+
fix:

0 commit comments

Comments
 (0)