From 8ce138607edd2035852f6d51f45a17e4db4f28d6 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 29 Mar 2020 21:07:37 +0200 Subject: [PATCH 1/3] apm821xx: use the real default HZ value from upstream With the "real HZ" debate out of the way, let's actually use the apm821xx's default upstream config file at arch/powerpc/configs/44x/bluestone_defconfig. From what I can tell, it sets NO_HZ (well, this platform was for NAS, so this is a bit unexpected) and remove any specific HZ_$VALUE symbol. Sadly, Daniel Engberg didn't run any before/after netperf tests, because it would have been such a slam dunk across the boards. In case of the apm821xx the tcp tx/rx performance improved ~14% (from 600Mbps to 700Mps). This now causes the emac to drop frames too, so let's see if this is causes more problems or not. This patch includes a refresh of the configuration too. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/config-5.4 | 87 ++------------------------------ 1 file changed, 3 insertions(+), 84 deletions(-) diff --git a/target/linux/apm821xx/config-5.4 b/target/linux/apm821xx/config-5.4 index 106a142627..f2caef0e26 100644 --- a/target/linux/apm821xx/config-5.4 +++ b/target/linux/apm821xx/config-5.4 @@ -3,9 +3,7 @@ CONFIG_44x=y CONFIG_460EX=y CONFIG_4xx=y CONFIG_4xx_SOC=y -# CONFIG_ADIN_PHY is not set # CONFIG_ADVANCED_OPTIONS is not set -# CONFIG_AL_FIC is not set CONFIG_APM821xx=y CONFIG_APOLLO3G=y # CONFIG_ARCHES is not set @@ -48,7 +46,6 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y CONFIG_AUDIT_ARCH=y -# CONFIG_BACKLIGHT_CLASS_DEVICE is not set # CONFIG_BAMBOO is not set # CONFIG_BLK_DEV_INITRD is not set CONFIG_BLK_MQ_PCI=y @@ -57,36 +54,28 @@ CONFIG_BLUESTONE=y CONFIG_BOOKE=y CONFIG_BOOKE_WDT=y # CONFIG_CANYONLANDS is not set -CONFIG_CC_CAN_LINK=y -CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_KASAN_GENERIC=y -CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs noinitrd" CONFIG_CMDLINE_BOOL=y CONFIG_COMPAT_32BIT_TIME=y -# CONFIG_COUNTER is not set CONFIG_CPU_BIG_ENDIAN=y CONFIG_CRC16=y # CONFIG_CRC32_SARWATE is not set CONFIG_CRC32_SLICEBY8=y CONFIG_CRYPTO_ACOMP2=y -# CONFIG_CRYPTO_ADIANTUM is not set CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_AKCIPHER2=y CONFIG_CRYPTO_AUTHENC=y CONFIG_CRYPTO_CCM=y CONFIG_CRYPTO_CFB=y CONFIG_CRYPTO_CTR=y CONFIG_CRYPTO_DEFLATE=y -# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set CONFIG_CRYPTO_DEV_PPC4XX=y CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_ECRDSA is not set CONFIG_CRYPTO_ESSIV=y CONFIG_CRYPTO_GCM=y CONFIG_CRYPTO_GF128MUL=y @@ -96,8 +85,6 @@ CONFIG_CRYPTO_HASH2=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_KPP2=y -CONFIG_CRYPTO_LIB_AES=y CONFIG_CRYPTO_LIB_SHA256=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_MANAGER=y @@ -112,11 +99,8 @@ CONFIG_CRYPTO_RNG_DEFAULT=y CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_SHA1_PPC=y CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_STREEBOG is not set -# CONFIG_CRYPTO_XXHASH is not set CONFIG_DATA_SHIFT=12 CONFIG_DEBUG_MISC=y -# CONFIG_DEBUG_PLIST is not set CONFIG_DMA_DIRECT_REMAP=y CONFIG_DMA_REMAP=y CONFIG_DTC=y @@ -125,18 +109,13 @@ CONFIG_EARLY_PRINTK=y # CONFIG_EBONY is not set CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y -# CONFIG_EEPROM_EE1004 is not set # CONFIG_EIGER is not set CONFIG_ETEXT_SHIFT=12 -# CONFIG_EXFAT_FS is not set CONFIG_EXTRA_TARGETS="uImage" -# CONFIG_FIELDBUS_DEV is not set CONFIG_FIXED_PHY=y CONFIG_FORCE_PCI=y CONFIG_FREEZER=y # CONFIG_FSL_LBC is not set -# CONFIG_FS_VERITY is not set -# CONFIG_FW_LOADER_COMPRESS is not set CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GCC_PLUGINS=y # CONFIG_GCC_PLUGIN_CYC_COMPLEXITY is not set @@ -164,13 +143,9 @@ CONFIG_GENERIC_TIME_VSYSCALL=y # CONFIG_GEN_RTC is not set # CONFIG_GLACIER is not set CONFIG_GPIOLIB=y -# CONFIG_GPIO_AMD_FCH is not set -# CONFIG_GPIO_CADENCE is not set CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y -# CONFIG_GPIO_GW_PLD is not set CONFIG_GPIO_SYSFS=y -# CONFIG_HABANA_AI is not set CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y @@ -213,19 +188,12 @@ CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_RSEQ=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING=y -# CONFIG_HEADERS_INSTALL is not set -# CONFIG_HEADER_TEST is not set CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_PPC4XX=y -CONFIG_HZ=1000 -CONFIG_HZ_1000=y -CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y CONFIG_I2C_CHARDEV=y CONFIG_I2C_IBM_IIC=y -# CONFIG_I2C_NVIDIA_GPU is not set -# CONFIG_I3C is not set CONFIG_IBM_EMAC=y CONFIG_IBM_EMAC_EMAC4=y CONFIG_IBM_EMAC_POLL_WEIGHT=32 @@ -235,14 +203,7 @@ CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256 CONFIG_IBM_EMAC_TAH=y CONFIG_IBM_EMAC_TXB=128 # CONFIG_ICON is not set -# CONFIG_IGC is not set -# CONFIG_IKHEADERS is not set CONFIG_ILLEGAL_POINTER_VALUE=0 -# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set -# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set -CONFIG_INIT_STACK_NONE=y -# CONFIG_INTERCONNECT is not set -# CONFIG_IO_URING is not set CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y @@ -251,47 +212,31 @@ CONFIG_ISA_DMA_API=y # CONFIG_JFFS2_FS is not set # CONFIG_KATMAI is not set CONFIG_KERNEL_START=0xc0000000 -# CONFIG_LCD_CLASS_DEVICE is not set -# CONFIG_LEDS_AN30259A is not set -# CONFIG_LEDS_LM3532 is not set -# CONFIG_LEDS_TRIGGER_AUDIO is not set CONFIG_LEDS_TRIGGER_MTD=y CONFIG_LEDS_TRIGGER_PATTERN=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y -# CONFIG_LOCK_EVENT_COUNTS is not set CONFIG_LOWMEM_SIZE=0x30000000 -CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity" CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y # CONFIG_MATH_EMULATION is not set CONFIG_MDIO_BUS=y -# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set CONFIG_MDIO_DEVICE=y CONFIG_MEMFD_CREATE=y -# CONFIG_MFD_MAX77650 is not set -# CONFIG_MFD_STMFX is not set -# CONFIG_MFD_STPMIC1 is not set -# CONFIG_MFD_TQMX86 is not set CONFIG_MIGRATION=y -# CONFIG_MISC_ALCOR_PCI is not set CONFIG_MODULES_USE_ELF_RELA=y CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y CONFIG_MTD_CFI_ADV_OPTIONS=y # CONFIG_MTD_CFI_GEOMETRY is not set -# CONFIG_MTD_HYPERBUS is not set -# CONFIG_MTD_RAW_NAND is not set # CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NEED_SG_DMA_LENGTH=y -# CONFIG_NET_SCH_TAPRIO is not set -CONFIG_NET_VENDOR_GOOGLE=y -CONFIG_NET_VENDOR_PENSANDO=y -# CONFIG_NI_XGE_MANAGEMENT_ENET is not set CONFIG_NOT_COHERENT_CACHE=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y CONFIG_NR_IRQS=512 -# CONFIG_NULL_TTY is not set CONFIG_NVMEM=y CONFIG_NVMEM_SYSFS=y CONFIG_OF=y @@ -320,14 +265,9 @@ CONFIG_PHYLIB=y CONFIG_PHYSICAL_START=0x00000000 CONFIG_PHYS_64BIT=y CONFIG_PHYS_ADDR_T_64BIT=y -# CONFIG_PHY_CADENCE_DP is not set -# CONFIG_PHY_CADENCE_DPHY is not set -# CONFIG_PHY_FSL_IMX8MQ_USB is not set -# CONFIG_PHY_MIXEL_MIPI_DPHY is not set CONFIG_PLUGIN_HOSTCC="g++" CONFIG_PM=y CONFIG_PM_AUTOSLEEP=y -# CONFIG_PM_DEBUG is not set CONFIG_PM_SLEEP=y CONFIG_PM_WAKELOCKS=y CONFIG_PM_WAKELOCKS_GC=y @@ -363,14 +303,9 @@ CONFIG_PPC_PAGE_SHIFT=12 # CONFIG_PPC_PTDUMP is not set CONFIG_PPC_UDBG_16550=y CONFIG_PPC_WERROR=y -# CONFIG_PRINTK_CALLER is not set -# CONFIG_PSI is not set CONFIG_PTE_64BIT=y -# CONFIG_PVPANIC is not set # CONFIG_RAINIER is not set -# CONFIG_RANDOM_TRUST_BOOTLOADER is not set CONFIG_RAS=y -# CONFIG_REED_SOLOMON_TEST is not set CONFIG_RSEQ=y # CONFIG_SAM440EP is not set # CONFIG_SCOM_DEBUGFS is not set @@ -378,12 +313,9 @@ CONFIG_RSEQ=y CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_FSL=y CONFIG_SERIAL_8250_SHARE_IRQ=y -# CONFIG_SERIAL_FSL_LINFLEXUART is not set CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SERIAL_OF_PLATFORM=y -# CONFIG_SERIAL_SIFIVE is not set CONFIG_SGL_ALLOC=y -# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set CONFIG_SIMPLE_GPIO=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y @@ -393,30 +325,17 @@ CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TAISHAN is not set CONFIG_TASK_SIZE=0xc0000000 -# CONFIG_TEST_BLACKHOLE_DEV is not set -# CONFIG_TEST_MEMCAT_P is not set -# CONFIG_TEST_MEMINIT is not set -# CONFIG_TEST_STACKINIT is not set -# CONFIG_TEST_STRSCPY is not set -# CONFIG_TEST_VMALLOC is not set -# CONFIG_TEST_XARRAY is not set CONFIG_THREAD_INFO_IN_TASK=y CONFIG_THREAD_SHIFT=13 CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y -# CONFIG_TI_CPSW_PHY_SEL is not set -# CONFIG_UNICODE is not set -# CONFIG_USB_CONN_GPIO is not set CONFIG_USB_SUPPORT=y -# CONFIG_VALIDATE_FS_PARSER is not set CONFIG_VDSO32=y # CONFIG_VIRTIO_MENU is not set # CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set # CONFIG_WARP is not set CONFIG_WATCHDOG_CORE=y -CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_WNDR4700 is not set -# CONFIG_XILINX_SDFEC is not set # CONFIG_XILINX_SYSACE is not set # CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set CONFIG_XZ_DEC_BCJ=y From a30abb1b6bb66d1caf08c331805163e6fef6f2a1 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Tue, 14 Jan 2020 22:22:59 +0800 Subject: [PATCH 2/3] ipq40xx: add support for MobiPromo CM520-79F MobiPromo CM520-79F is an AC1300 dual band router based on IPQ4019 Specification: SoC/Wireless: QCA IPQ4019 RAM: 512MiB Flash: 128MiB SLC NAND Ethernet PHY: QCA8075 Ethernet ports: 1x WAN, 2x LAN LEDs: 7 LEDs 2 (USB, CAN) are GPIO other 5 (2.4G, 5G, LAN1, LAN2, WAN) are connected to a shift register Button: Reset Flash instruction: Disassemble the router, connect UART pins like this: GND TX RX [x x . . x .] [. . . . . .] (QCA8075 and IPQ4019 below) Baud-rate: 115200 Set up TFTP server: IP 192.168.1.188/24 Power on the router and interrupt the booting with UART console env backup (in case you want to go back to stock and need it there): printenv (Copy the output to somewhere save) Set bootenv: setenv set_ubi 'set mtdids nand0=nand0; set mtdparts mtdparts=nand0:0x7480000@0xb80000(fs); ubi part fs' setenv bootkernel 'ubi read 0x84000000 kernel; bootm 0x84000000#config@1' setenv cm520_boot 'run set_ubi; run bootkernel' setenv bootcmd 'run cm520_boot' setenv bootargs saveenv Boot initramfs from TFTP: tftpboot openwrt-ipq40xx-generic-mobipromo_cm520-79f-initramfs-fit-zImage.itb bootm After initramfs image is booted, backup rootfs partition in case of reverting to stock image cat /dev/mtd12 > /tmp/mtd12.bin Then fetch it via SCP Upload nand-factory.ubi to /tmp via SCP, then run mtd erase rootfs mtd write /tmp/*nand-factory.ubi rootfs reboot To revert to stock image, restore default bootenv in uboot UART console setenv bootcmd 'bootipq' printenv use the saved dump you did back when you installed OpenWrt to verify that there are no other differences from back in the day. saveenv upload the backed up mtd12.bin and run tftpboot mtd12.bin nand erase 0xb80000 0x7480000 nand write 0x84000000 0xb80000 0x7480000 The BOOTCONFIG may have been configured to boot from alternate partition (rootfs_1) instead In case of this, set it back to rootfs: cd /tmp cat /dev/mtd7 > mtd7.bin echo -ne '\x0b' | dd of=mtd7.bin conv=notrunc bs=1 count=1 seek=4 for i in 28 48 68 108; do dd if=/dev/zero of=mtd7.bin conv=notrunc bs=1 count=1 seek=$i done mtd write mtd7.bin BOOTCONFIG mtd write mtd7.bin BOOTCONFIG1 Signed-off-by: DENG Qingfang [renamed volume to ubi to support autoboot, as per David Lam's test in PR#2432] Signed-off-by: Christian Lamparter --- package/firmware/ipq-wifi/Makefile | 2 + .../board-mobipromo_cm520-79f.qca4019 | Bin 0 -> 24308 bytes .../ipq40xx/base-files/etc/board.d/01_leds | 5 + .../ipq40xx/base-files/etc/board.d/02_network | 5 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 + .../base-files/lib/upgrade/platform.sh | 1 + .../arm/boot/dts/qcom-ipq4019-cm520-79f.dts | 354 ++++++++++++++++++ .../arm/boot/dts/qcom-ipq4019-cm520-79f.dts | 354 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 12 + .../901-arm-boot-add-dts-files.patch | 3 +- .../901-arm-boot-add-dts-files.patch | 3 +- 11 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-mobipromo_cm520-79f.qca4019 create mode 100644 target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts create mode 100644 target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 12e000bac8..f767d49294 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -33,6 +33,7 @@ ALLWIFIBOARDS:= \ engenius_emd1 \ ezviz_cs-w3-wd1200g-eup \ linksys_ea8300 \ + mobipromo_cm520-79f \ qxwlan_e2600ac ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) @@ -102,6 +103,7 @@ $(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200)) $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1)) $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) +$(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-mobipromo_cm520-79f.qca4019 b/package/firmware/ipq-wifi/board-mobipromo_cm520-79f.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..d717af12fe24a0060af79dc5b0fe7993114a1c86 GIT binary patch literal 24308 zcmeHPdr(tX8b1jj>e9ju0TJ*LLVyHAfPfk#%2OI3f<;9FECN*|sZkz=hoK90d{Bsp zKrI*|Xc?48Q$)ta2gG7+?ToVf$NsUif3%%_bZ6FG+tKc{GrNm>?hSz?B$`N=2Do21 z=X~e8=R4;+znmoZ-t*(Wofsb)zef-eo)(&r5ucd^q*5t>QWA#c0BnJ&NLI0}u%w7x zBo&9gQz9-66(86Zj@OEg7M35ts@!mPWnsCv@W`=ki90uO!$Y@3Cre4tmj?Txg$YVX zB;Zg-iORzI4C#Sc0RU^A-Jk*h6@WJ*am{qbV$rd#0Emo?{PEc{5}&#X{QQ@5vAW~{ zJ9tgGXYALa9SOXE0*}qqW?Ji={d{J3Bc!Ip_%hg zU~rai+GJaKU9yz3-y>mspsX|b471#;pmQ*{Gx`jz!o9Gsu}~IW6tsIo%H5VDwL8S@ zT#xNv^w)fpafVZ|;ho!qRh>JVLaTg>N6(g2Z$HS&LZa`$c1aRWuKV_@ec}#5Bwimg8!pa}r%hM7f9vWM^ll)9HS2 zgr9zT_WkrUb_T>_1qNts|NZ_?-|5@1h8tX*$&QZygY8`58#d?v{Q1)-+O~@rF5Y$N z5Ii4&T4`PL5SB0_M_)pi3& z$q$;_I_4{YKO=XoQYa{eLwQ6&yisqCx6loBL%h%gG=Y=wC;>@DQ#q-^I5Z9spj?#8 z;XdLbThXnYt-^3L9O0p}L8z{nR%c`4^Jk+X)OqiZC6KtI?oZtjAJm8ABTPgSpC%${ zXc{L?7>PzcjYMM57*32(`zGk;_)uEt7d^+8ZRrQ9A^jA%K+*eYF{v7TR2EcS4(FuA z94uJ^1WE)-W)L8jh8bWC%qtQl0|bZ)fdGL3fdGL3fdGNP3PxZZcOBwKd5ilNl0n(R z-GanYR_g?07PVd(xv!t=F8!@5=Z~>QCpH^n1;2&F)U8C|`8=_*gT-oY$XYNzilyz$ z_h6Stgn1>3(Z>M5vRctI`q;SSgtFOec&D3&+NTDC3khKc!T9V{gW=7@XP25?E=s+i z;s65Nzhl({5CMW9KgSQUff$eqMTZG1TPP8LPWSbt8%aB~&$rU)d2I~9=aImVM*(Pe zMo4i{05Df0fDibN1*;H1_8_m#gQc4rzUinJ385}G1YQigP|4&2a0deJE|VQse+1<+ z6x}?>pe)2D%!XgCJ)>WlD}#dq8NX!G?%Zkj>a@Fa!d-i^^9l}>C|cS(x_WxA4GoWu zjeqvwtH;(K(A&qe?#y+`v)+88uts@+ zSY^gFj@m>0J@uXk&2yJ$z31>;lxEr+oByem&yDSd^{%d|sjeOu7egwHVH;~|D{>o` zn6xEJ#12uiBy8KXK^g$q4ZomeUSx3f4Nhl7)|Z9*V=ArK%CSaAr<@#RhN?f>(Szkd78H-ChvXgT;8-~PqF{{H7D zPyPmN=J@t}epI-YuRlHg?;mW>!8gUX4-4aPu!QY1V0X;v_>RNEHTFjQ20R_^5ZFXB zwZI6zz4q$z?%YM@3REq*ccRa<*XlTATC^5D$JVYs*B;XsNVg9ZW@9(G#~&MBVa(M` zeO~l!Uyo?oRh9BAQP|hFG)h&iJYU4q+*DnVmx+>jftnF@uR<;n@qDrW5xaXYmxA`zwY*qYy}TIEtv0*{6{j86s!1H73;o+Zzkx~=X~ z$RxW(ThzA|7bN9^Bpw$!w8;MN>7=$x*;qv(`W3It3a&6w&#JS0CXq2U9J`v(7S`Y+8yPNErJmpT z8=s@+da{}$j?*Nr>0k68ZjGxCl&;TL4Dapco%gGyNE-U{ySS%O8Kr3KTG@rT_gUqX zz4r&iZL#$MhrRM^2lrkIZSbyqvv6Rz>f^X(X6?EXg);qA#4(S3Z|u0$U(~v_j`prc z?&r7U0~yNT6P{A_b=j4eMtUV>e`9CH>8MICk&EEQ;QkMJ@B2wT^83`{?xb@x8B)+c zSfS#dqL;aeM!UmNSUlibQUPA%>jIC3erF{qkac(qg9 zuw52%$UUv^+R=+KCj-i<`4{^OJL8-DD=7Kxed3G!(*YIkd1ssVy%!~+=ThQE1}eJJ z&oZmL4zAdRLrk1NU>P8=(5G*}XJE~V2|R`y3V3e#(>DSG8SoE2d4m?Gl&Gzc&kD;U6ud&$}Cg3Mb1Og@zm`AsNZq&?DvWKnP8HKUZs;}hRy$dGs2EZ@1eCE-)~HZ*S{gN$dLiKO*im(f|Me literal 0 HcmV?d00001 diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds index dd7f35a0a3..0a128e8cbc 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -43,6 +43,11 @@ engenius,ens620ext) ucidef_set_led_netdev "lan1" "LAN1" "${boardname}:green:lan1" "eth0" ucidef_set_led_netdev "lan2" "LAN2" "${boardname}:green:lan2" "eth1" ;; +mobipromo,cm520-79f) + ucidef_set_led_netdev "wan" "WAN" "${boardname}:blue:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "${boardname}:blue:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "${boardname}:blue:lan2" "switch0" "0x08" + ;; netgear,ex6100v2 |\ netgear,ex6150v2) ucidef_set_led_wlan "wlan2g" "WLAN2G" "ex61x0v2:green:router" "phy0tpt" diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 44cb9f9d12..13e2722f79 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -73,6 +73,11 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0u@eth0" "3:lan" "4:lan" ;; + mobipromo,cm520-79f) + ucidef_add_switch "switch0" \ + "0u@eth0" "3:lan:2" "4:lan:1" + ucidef_set_interface_wan "eth1" + ;; qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2) ucidef_set_interfaces_lan_wan "eth0" "eth1" diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index c65fa30474..dd301b1e30 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -51,6 +51,7 @@ case "$FIRMWARE" in ezviz,cs-w3-wd1200g-eup |\ glinet,gl-b1300 |\ linksys,ea6350v3 |\ + mobipromo,cm520-79f |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x1000 0x2f20 ;; @@ -132,6 +133,7 @@ case "$FIRMWARE" in ezviz,cs-w3-wd1200g-eup |\ glinet,gl-b1300 |\ linksys,ea6350v3 |\ + mobipromo,cm520-79f |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x5000 0x2f20 ;; diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 377f65ea42..7aabeeeea0 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -54,6 +54,7 @@ platform_do_upgrade() { avm,fritzrepeater-3000 |\ cilab,meshpoint-one |\ engenius,eap2200 |\ + mobipromo,cm520-79f |\ qxwlan,e2600ac-c2) nand_do_upgrade "$1" ;; diff --git a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts new file mode 100644 index 0000000000..f4c1685f47 --- /dev/null +++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts @@ -0,0 +1,354 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MobiPromo CM520-79F"; + compatible = "mobipromo,cm520-79f"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <1000>; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + ranges; + + sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + usb { + label = "cm520-79f:blue:usb"; + gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>; + }; + + led_sys: can { + label = "cm520-79f:blue:can"; + gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "cm520-79f:blue:wan"; + gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "cm520-79f:blue:lan1"; + gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "cm520-79f:blue:lan2"; + gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "cm520-79f:blue:wlan2g"; + gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "cm520-79f:blue:wlan5g"; + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + status = "okay"; +}; + +&blsp1_uart2 { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + mtd-mac-address = <&art 0x1006>; +}; + +&gmac1 { + mtd-mac-address = <&art 0x5006>; +}; + +&nand { + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "MIBIB"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "BOOTCONFIG"; + reg = <0x200000 0x100000>; + }; + + partition@300000 { + label = "QSEE"; + reg = <0x300000 0x100000>; + read-only; + }; + + partition@400000 { + label = "QSEE_1"; + reg = <0x400000 0x100000>; + read-only; + }; + + partition@500000 { + label = "CDT"; + reg = <0x500000 0x80000>; + read-only; + }; + + partition@580000 { + label = "CDT_1"; + reg = <0x580000 0x80000>; + read-only; + }; + + partition@600000 { + label = "BOOTCONFIG1"; + reg = <0x600000 0x80000>; + }; + + partition@680000 { + label = "APPSBLENV"; + reg = <0x680000 0x80000>; + }; + + partition@700000 { + label = "APPSBL"; + reg = <0x700000 0x200000>; + read-only; + }; + + partition@900000 { + label = "APPSBL_1"; + reg = <0x900000 0x200000>; + read-only; + }; + + art: partition@b00000 { + label = "ART"; + reg = <0xb00000 0x80000>; + read-only; + }; + + partition@b80000 { + label = "ubi"; + reg = <0xb80000 0x7480000>; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio52", "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio54", "gpio55", "gpio56", + "gpio57", "gpio60", "gpio61", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio68", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; diff --git a/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts b/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts new file mode 100644 index 0000000000..f4c1685f47 --- /dev/null +++ b/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts @@ -0,0 +1,354 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MobiPromo CM520-79F"; + compatible = "mobipromo,cm520-79f"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <1000>; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + ranges; + + sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + usb { + label = "cm520-79f:blue:usb"; + gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>; + }; + + led_sys: can { + label = "cm520-79f:blue:can"; + gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "cm520-79f:blue:wan"; + gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "cm520-79f:blue:lan1"; + gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "cm520-79f:blue:lan2"; + gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "cm520-79f:blue:wlan2g"; + gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "cm520-79f:blue:wlan5g"; + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + status = "okay"; +}; + +&blsp1_uart2 { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + mtd-mac-address = <&art 0x1006>; +}; + +&gmac1 { + mtd-mac-address = <&art 0x5006>; +}; + +&nand { + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "MIBIB"; + reg = <0x100000 0x100000>; + read-only; + }; + + partition@200000 { + label = "BOOTCONFIG"; + reg = <0x200000 0x100000>; + }; + + partition@300000 { + label = "QSEE"; + reg = <0x300000 0x100000>; + read-only; + }; + + partition@400000 { + label = "QSEE_1"; + reg = <0x400000 0x100000>; + read-only; + }; + + partition@500000 { + label = "CDT"; + reg = <0x500000 0x80000>; + read-only; + }; + + partition@580000 { + label = "CDT_1"; + reg = <0x580000 0x80000>; + read-only; + }; + + partition@600000 { + label = "BOOTCONFIG1"; + reg = <0x600000 0x80000>; + }; + + partition@680000 { + label = "APPSBLENV"; + reg = <0x680000 0x80000>; + }; + + partition@700000 { + label = "APPSBL"; + reg = <0x700000 0x200000>; + read-only; + }; + + partition@900000 { + label = "APPSBL_1"; + reg = <0x900000 0x200000>; + read-only; + }; + + art: partition@b00000 { + label = "ART"; + reg = <0xb00000 0x80000>; + read-only; + }; + + partition@b80000 { + label = "ubi"; + reg = <0xb80000 0x7480000>; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio52", "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + pulldowns { + pins = "gpio54", "gpio55", "gpio56", + "gpio57", "gpio60", "gpio61", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio68", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 4bbdda5d8a..c47eec51a0 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -452,6 +452,18 @@ define Device/meraki_mr33 endef TARGET_DEVICES += meraki_mr33 +define Device/mobipromo_cm520-79f + $(call Device/FitzImage) + $(call Device/UbiFit) + DEVICE_VENDOR := MobiPromo + DEVICE_MODEL := CM520-79F + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += mobipromo_cm520-79f + define Device/netgear_ex61x0v2 $(call Device/DniImage) DEVICE_DTS_CONFIG := config@4 diff --git a/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch index 81e33b15a9..24965cf264 100644 --- a/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -785,11 +785,44 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -785,11 +785,45 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -36,6 +36,7 @@ Signed-off-by: John Crispin qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ ++ qcom-ipq4019-cm520-79f.dtb \ + qcom-ipq4019-eap2200.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index a63f0da85d..a17314240f 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,44 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,45 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -36,6 +36,7 @@ Signed-off-by: John Crispin qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ ++ qcom-ipq4019-cm520-79f.dtb \ + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ From c30220d458c0771013f21a16148baa4ea723027b Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Mon, 9 Mar 2020 21:16:43 +0100 Subject: [PATCH 3/3] ipq40xx: add support for Cell C RTL30VW Cell C RTL30VW is a LTE router with tho gigabit ethernets and integrated QMI mPCIE modem. This is stripped version of ASKEY RTL0030VW. Hardware: Specification: -CPU: IPQ4019 -RAM: 256MB -Flash: NAND 128MB + NOR 16MB -WiFi: Integrated bgn/ac -LTE: mPCIe card (Modem chipset MDM9230) -LAN: 2 Gigabit Ports -USB: 2x USB2.0 -Serial console: RJ-45 115200 8n1 -Unsupported VoIP Known issues: None so far. Instruction install: There are two methods: Factory web-gui and serial + tftp. Web-gui: 1. Apply factory image via stock web-gui. Serial + initramfs: 1. Rename OpenWrt initramfs image to "image" 2. Connect serial console (115200,8n1) 3. Set IP to different than 192.168.1.11, but 24 bit mask, eg. 192.168.1.4. 4. U-Boot commands: sf probe && sf read 0x80000000 0x180000 0x10000 setenv serverip 192.168.1.4 set fdt_high 0x85000000 tftpboot 0x84000000 image bootm 0x84000000 5. Install sysupgrade image via "sysupgrade -n" Back to stock: All is needed is swap 0x4c byte in mtd8 from 0 to 1 or 1 to 0, do firstboot and factory reset with OFW: 1. read mtd8: dd if=/dev/mtd8 of=/tmp/mtd8 2. go to tmp: cd /tmp/ 3. write first part of partition: dd if=mtd8 of=mtd8.new bs=1 count=76 4. check which layout uses bootloader: cat /proc/mtd 5a. If first are kernel_1 and rootfs_1 write 0: echo -n -e '\x00' >> mtd8.new 5b. If first are kernel and rootfs write 1: echo -n -e '\x01' >> mtd8.new 6. fill with rest of data: dd if=mtd8 bs=1 skip=77 >> mtd8.new 7. CHECK IF mtd8.new HAVE CHANGED ONLY ONE BYTE! e.g with: hexdump mtd8.new 8. write new mtd8 to flash: mtd write mtd8.new /dev/mtd8 9. do firstboot 10.reboot 11. Do back to factory defaults in OFW GUI. Based on work: Cezary Jackiewicz Signed-off-by: Pawel Dembicki --- package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-cellc_rtl30vw.qca4019 | Bin 0 -> 24316 bytes .../ipq40xx/base-files/etc/board.d/02_network | 5 + .../base-files/etc/board.d/03_gpio_switches | 6 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 + .../base-files/lib/upgrade/platform.sh | 15 + .../arm/boot/dts/qcom-ipq4019-rtl30vw.dts | 385 ++++++++++++++++++ .../arm/boot/dts/qcom-ipq4019-rtl30vw.dts | 385 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 39 ++ .../901-arm-boot-add-dts-files.patch | 3 +- .../901-arm-boot-add-dts-files.patch | 3 +- 11 files changed, 843 insertions(+), 2 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-cellc_rtl30vw.qca4019 create mode 100644 target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts create mode 100644 target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index f767d49294..d70854f1a5 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -28,6 +28,7 @@ ALLWIFIBOARDS:= \ 8dev_habanero-dvk \ aruba_ap-303 \ avm_fritzrepeater-1200 \ + cellc_rtl30vw \ dlink_dap2610 \ engenius_eap2200 \ engenius_emd1 \ @@ -98,6 +99,7 @@ endef $(eval $(call generate-ipq-wifi-package,8dev_habanero-dvk,8devices Habanero DVK)) $(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303)) $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200)) +$(eval $(call generate-ipq-wifi-package,cellc_rtl30vw, Cell C RTL30VW)) $(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610)) $(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200)) $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1)) diff --git a/package/firmware/ipq-wifi/board-cellc_rtl30vw.qca4019 b/package/firmware/ipq-wifi/board-cellc_rtl30vw.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..2fff2bf5fc7ce41c624ef14f5ed5d5f2df2015b3 GIT binary patch literal 24316 zcmeHPTTl~O8a`mSsHk)J_&hB&GIg&!COSJ(mYbTN4k{}v0Tgug+CwoSH~@q_~r$+S+i@Q|5SLh)WnsWRQ8?2DHV(<=&0DuR&fhw$y-?ci8bW1%83GXlD{G?psT z;jml1ZO}DaB6u>^d%01g$d^P7WmoX`_@q1>s5+Ze zE-VVbp5JNwCik4ECb0C|k$U}}3z7AlqtC8unlg^?G8u_a2di4Ls>1g9q~E@!?3TCv zsy?9n;aFW?)Ttm1qj+_pL}hD6z|CXh<}KS02Fuq!ATY@Mi9g#CpRu!I_Ofc>1rY!) zF0QVwE=0XygPWV1`?Porbu<*qU!2YpFhfH4@F$cP9L(nh^LPa`PcVIjVl^ApSy2Q! zI_m27?!_`BVDn~ocQTYj7|Q4If?$W~@t^k}KCqxh+6ZHymxn8j_FvOb7hubuoMq)| z%_zJcfzxYFwT}{oh$NVnunQ6go;5(O=RLHp&*UF>llx@k3>(OeA|LL$c5; zQ5KehrXX@ujEY6#mtrIlO%x?!(P%UxL1&UM4A@p@a*|4CvZB;^$HyK>7%1Z{0|`I_ zL;+YDn)Wsg$wsq9*;p(Z`!*IyLX$*E7E7w$>!{*>lF_Kq{IQBqa!XpP&%gDE7PsO69G~nrKJD_{Pn4@8GsnTM<9<1 z5^s2r&too9XqUMOU&}m%e}jc+O~spr0FP!j?ht(c&Fi1RPe1)^Y6+bvl&oC@e!1(# zbfuNS9S8tiTxp))K)C_Myy6E?mSV#S;fHJg_>T*<;bEa6pR$lUcjR6jxjTpD?JYc5 zTvo2@xYB*Ce{g8@?)ZbpfBNCaSB}47v5)82mFub*4NUu>7`@fJ6KdK6#bmAKT~O2h zCnjz+?|?cE;({J)AKg`R8mz5E?b$QVDL8brz3cidd}8u13+ZbMmD$xWKQIvv$`Nre zCP@E~j$kMz!mxA@_aP3EqEe9*i(9t)>)EJ|Xg*>e1f^$)Gmsp5yf_}&MOX9?ulaMB zzvs;DYPrR6lyjf(QO>qr1BH|L(nk%)m>1+vY3UlGo|9dRAu+ye%KVY6^J96%H=FE2;R z#*HhnIdr~(+MxwRiHF54*^6d$IiIn?L ztdMxn{rHu|?S++U>-WXdHg(>p#xX;Tjx*J2tiZDkVqM_mgrQ4&yeLBwI(ZKt)M-^k z5)ScqV%NIE1z@Vv*oZ3(DZ0q1t41w;z#!8_;p2vWm8vL55;6Hl!)0w{kxarR91QyK za4^+lJcA!I9OYQsKlB>t_gOI0mTmx!T5r&eutxULTu0yyjVI;-_vJ zJMjixp-PHR>UveR^4$VIQ-liD0Wu{+50R3=*oIeV(~Cl;28@^RYTZ87F8n*4UR5WT z3j!t|7_OR93L;Xv-Xnk!x{Y7qrP^I`Hgs*pm0FoR0RMxbPgN;Tl|&i8!v}PYs{Il+ z;n3G33awGObkZ4-?UAPZVWKgvJTHM^~-Nm4}cKgfOK`#s<7l zE0!~-zBZo36;MNr5Ahoi%M=Ov=Kkb0L%k|Z?oUR5Yj8xI@KT>j$({p9p+upy00L{_ z)L39?lzH7EFmb-=x4UB^IsWc9Th#{>#KD1EJ!`u%T7<{hC0-fd4<5O=Q_DZ*TlDA7 z21RmY7|YM?{?(?6ESWee!0%FjL3_+eu4-G(^E>LxDb1mk{)b-lDDx7+!+ZgF(sxoV zPZLE320j=%-j#A%SWVyebXeJ$+{{<|9eUPRQ!I-Q<@k9$x~V=Um!mvyhORf~OiV3n z|CZek@046lJjJbG9e8X|AIwXS2tjD$19jEA#h^qk1?`u4OR6dweYK%hi+fel%yx|IUHus*JVd`XGMrv?2GOD zzl>Ay4$xEX4cA=DxhSajJF;$19BSbd0&4()rTzyF4@Z>HRPF57=G;-9?9mr9nP@Dq1yTBzTMse;}`djn=&;LIU C>x%IJ literal 0 HcmV?d00001 diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 13e2722f79..0e4b947c5f 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -63,6 +63,11 @@ ipq40xx_setup_interfaces() engenius,eap2200) ucidef_set_interface_lan "eth0 eth1" ;; + cellc,rtl30vw) + ucidef_set_interface_lan "eth0" + ucidef_add_switch "switch0" \ + "0u@eth0" "3:lan" "4:lan" + ;; ezviz,cs-w3-wd1200g-eup) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ diff --git a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches index e46a297ea7..c255707f91 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches @@ -7,6 +7,12 @@ board_config_update board=$(board_name) case "$board" in +cellc,rtl30vw) + ucidef_add_gpio_switch "w_disable" "W_DISABLE mPCIE pin" "398" "1" + ucidef_add_gpio_switch "pmd_resin_n" "PMD_RESIN_N pin" "399" "1" + ucidef_add_gpio_switch "mcpie_vcc" "LTE power" "400" "0" + ucidef_add_gpio_switch "usb_vcc" "USB power" "401" "0" + ;; cilab,meshpoint-one) ucidef_add_gpio_switch "poe_passtrough" "POE passtrough enable" "413" "1" ;; diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index dd301b1e30..814d5b0371 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -80,6 +80,7 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; + cellc,rtl30vw |\ compex,wpj419 |\ compex,wpj428 |\ engenius,eap1300 |\ @@ -162,6 +163,7 @@ case "$FIRMWARE" in /usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \ /usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") ;; + cellc,rtl30vw |\ compex,wpj419 |\ compex,wpj428 |\ engenius,eap1300 |\ diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 7aabeeeea0..d3effdf7e2 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -29,6 +29,17 @@ EOF return 0; } +askey_do_upgrade() { + local tar_file="$1" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs + + nand_do_upgrade "$1" +} + zyxel_do_upgrade() { local tar_file="$1" @@ -78,6 +89,10 @@ platform_do_upgrade() { CI_KERNPART="linux" nand_do_upgrade "$1" ;; + cellc,rtl30vw) + CI_UBIPART="ubifs" + askey_do_upgrade "$1" + ;; compex,wpj419) nand_do_upgrade "$1" ;; diff --git a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts new file mode 100644 index 0000000000..2f17424e55 --- /dev/null +++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts @@ -0,0 +1,385 @@ +// SPDX-License-Identifier: ISC +// Copyright (c) 2015, The Linux Foundation. All rights reserved. +// Copyright (c) 2019, Cezary Jackiewicz . +// Copyright (c) 2020, Pawel Dembicki . + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Cell C RTL30VW"; + compatible = "cellc,rtl30vw"; + + aliases { + led-boot = &led_power_blue; + led-failsafe = &led_power_red; + led-running = &led_power_blue; + led-upgrade = &led_power_red; + }; + + chosen { + bootargs-append = "ubi.mtd=ubifs root=/dev/ubiblock0_0 rootfstype=squashfs ro"; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + num-chipselects = <1>; + + mosi-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + cs-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + sck-gpios = <&tlmm 58 GPIO_ACTIVE_LOW>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <2>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_blue: power_blue { + gpios = <&led_gpio 0 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:power"; + default-state = "on"; + }; + + led_power_red: power_red { + gpios = <&led_gpio 1 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:red:power"; + }; + + tp28 { + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + label = "rtl30vw:ext:tp28"; + default-state = "keep"; + }; + + tp27 { + gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; + label = "rtl30vw:ext:tp27"; + default-state = "keep"; + }; + + wlan2g { + gpios = <&led_gpio 8 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:wlan2g"; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + gpios = <&led_gpio 9 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:wlan5g"; + linux,default-trigger = "phy1tpt"; + }; + + wps { + gpios = <&led_gpio 10 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:wps"; + }; + + voip { + gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:voip"; + }; + + s1 { + gpios = <&led_gpio 12 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s1"; + }; + + s2 { + gpios = <&led_gpio 13 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s2"; + }; + + s3 { + gpios = <&led_gpio 14 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s3"; + }; + + s4 { + gpios = <&led_gpio 15 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s4"; + }; + + signal { + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:red:signal"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 59 GPIO_ACTIVE_HIGH>; + + flash@0 { + /*"n25q128a11" is required for proper nand recognition in u-boot. */ + compatible = "jedec,spi-nor", "n25q128a11"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0x80000>; + read-only; + }; + + partition@170000 { + label = "0:ART"; + reg = <0x170000 0x10000>; + read-only; + }; + + partition@180000 { + label = "0:BOOTCONFIG"; + reg = <0x180000 0x10000>; + read-only; + }; + }; + }; + + flash@1 { + /* + * Factory U-boot looks in 0:BOOTCONFIG partition for active + * partitions settings and mangle partition config. So kernel + * /kernel_1 and rootfs/rootfs_1 pairs can be swaped. + * It isn't a problem but we never can be sure where OFW put + * factory images. "spinand,mt29f" value is required for proper + * nand recognition in u-boot. + */ + compatible = "spi-nand","spinand,mt29f"; + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "rootfs"; + reg = <0x400000 0x2000000>; + }; + + partition@2400000 { + label = "kernel_1"; + reg = <0x2400000 0x400000>; + }; + + partition@2800000 { + label = "rootfs_1"; + reg = <0x2800000 0x2000000>; + }; + + partition@4800000 { + label = "ubifs"; + reg = <0x4800000 0x3800000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "cellc,rtl30vw"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "cellc,rtl30vw"; +}; diff --git a/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts b/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts new file mode 100644 index 0000000000..2f17424e55 --- /dev/null +++ b/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts @@ -0,0 +1,385 @@ +// SPDX-License-Identifier: ISC +// Copyright (c) 2015, The Linux Foundation. All rights reserved. +// Copyright (c) 2019, Cezary Jackiewicz . +// Copyright (c) 2020, Pawel Dembicki . + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Cell C RTL30VW"; + compatible = "cellc,rtl30vw"; + + aliases { + led-boot = &led_power_blue; + led-failsafe = &led_power_red; + led-running = &led_power_blue; + led-upgrade = &led_power_red; + }; + + chosen { + bootargs-append = "ubi.mtd=ubifs root=/dev/ubiblock0_0 rootfstype=squashfs ro"; + }; + + led_spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + num-chipselects = <1>; + + mosi-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + cs-gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + sck-gpios = <&tlmm 58 GPIO_ACTIVE_LOW>; + + led_gpio: led_gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <2>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_blue: power_blue { + gpios = <&led_gpio 0 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:power"; + default-state = "on"; + }; + + led_power_red: power_red { + gpios = <&led_gpio 1 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:red:power"; + }; + + tp28 { + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + label = "rtl30vw:ext:tp28"; + default-state = "keep"; + }; + + tp27 { + gpios = <&led_gpio 7 GPIO_ACTIVE_LOW>; + label = "rtl30vw:ext:tp27"; + default-state = "keep"; + }; + + wlan2g { + gpios = <&led_gpio 8 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:wlan2g"; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + gpios = <&led_gpio 9 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:wlan5g"; + linux,default-trigger = "phy1tpt"; + }; + + wps { + gpios = <&led_gpio 10 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:wps"; + }; + + voip { + gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:voip"; + }; + + s1 { + gpios = <&led_gpio 12 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s1"; + }; + + s2 { + gpios = <&led_gpio 13 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s2"; + }; + + s3 { + gpios = <&led_gpio 14 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s3"; + }; + + s4 { + gpios = <&led_gpio 15 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:blue:s4"; + }; + + signal { + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + label = "rtl30vw:red:signal"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + }; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 59 GPIO_ACTIVE_HIGH>; + + flash@0 { + /*"n25q128a11" is required for proper nand recognition in u-boot. */ + compatible = "jedec,spi-nor", "n25q128a11"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "0:MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "0:QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "0:CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "0:DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "0:APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "0:APPSBL"; + reg = <0xf0000 0x80000>; + read-only; + }; + + partition@170000 { + label = "0:ART"; + reg = <0x170000 0x10000>; + read-only; + }; + + partition@180000 { + label = "0:BOOTCONFIG"; + reg = <0x180000 0x10000>; + read-only; + }; + }; + }; + + flash@1 { + /* + * Factory U-boot looks in 0:BOOTCONFIG partition for active + * partitions settings and mangle partition config. So kernel + * /kernel_1 and rootfs/rootfs_1 pairs can be swaped. + * It isn't a problem but we never can be sure where OFW put + * factory images. "spinand,mt29f" value is required for proper + * nand recognition in u-boot. + */ + compatible = "spi-nand","spinand,mt29f"; + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "rootfs"; + reg = <0x400000 0x2000000>; + }; + + partition@2400000 { + label = "kernel_1"; + reg = <0x2400000 0x400000>; + }; + + partition@2800000 { + label = "rootfs_1"; + reg = <0x2800000 0x2000000>; + }; + + partition@4800000 { + label = "ubifs"; + reg = <0x4800000 0x3800000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "cellc,rtl30vw"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "cellc,rtl30vw"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index c47eec51a0..bf69953eac 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -53,6 +53,14 @@ define Device/DniImage IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | append-rootfs | pad-rootfs | append-metadata endef +define Build/append-rootfshdr + mkimage -A $(LINUX_KARCH) \ + -O linux -T filesystem \ + -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n root.squashfs -d $(IMAGE_ROOTFS) $@.new + dd if=$@.new bs=64 count=1 >> $(IMAGE_KERNEL) +endef + define Build/mkmylofw_32m $(eval device_id=$(word 1,$(1))) $(eval revision=$(word 2,$(1))) @@ -69,6 +77,15 @@ define Build/mkmylofw_32m @mv $@.new $@ endef +define Build/qsdk-ipq-factory-nand-askey + $(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\ + askey_kernel $(IMAGE_KERNEL) \ + askey_fs $(IMAGE_ROOTFS) \ + ubifs $@ + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new + @mv $@.new $@ +endef + define Build/SenaoFW -$(STAGING_DIR_HOST)/bin/mksenaofw \ -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \ @@ -228,6 +245,28 @@ define Device/avm_fritzrepeater-3000 endef TARGET_DEVICES += avm_fritzrepeater-3000 +define Device/cellc_rtl30vw + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | uImage lzma | pad-to 2048 + KERNEL_NAME := Image + KERNEL_IN_UBI := + IMAGES := nand-factory.bin nand-sysupgrade.bin + IMAGE/nand-factory.bin := append-rootfshdr | append-ubi | qsdk-ipq-factory-nand-askey + IMAGE/nand-sysupgrade.bin := append-rootfshdr | sysupgrade-tar | append-metadata + DEVICE_VENDOR := Cell C + DEVICE_MODEL := RTL30VW + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@5 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 57344k + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi ipq-wifi-cellc_rtl30vw +endef +TARGET_DEVICES += cellc_rtl30vw + define Device/cilab_meshpoint-one $(call Device/8dev_jalapeno-common) DEVICE_VENDOR := Crisis Innovation Lab diff --git a/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch index 24965cf264..2af342c4be 100644 --- a/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -785,11 +785,45 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -785,11 +785,46 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -46,6 +46,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-map-ac2200.dtb \ + qcom-ipq4019-e2600ac-c1.dtb \ + qcom-ipq4019-e2600ac-c2.dtb \ ++ qcom-ipq4019-rtl30vw.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ + qcom-ipq4028-wpj428.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index a17314240f..46af5fb5c9 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,45 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,46 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -46,6 +46,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-e2600ac-c1.dtb \ + qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ ++ qcom-ipq4019-rtl30vw.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ + qcom-ipq4028-wpj428.dtb \