aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq40xx
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2020-03-09 21:16:43 +0100
committerChristian Lamparter <chunkeey@gmail.com>2020-04-10 15:22:26 +0200
commitc30220d458c0771013f21a16148baa4ea723027b (patch)
tree4866dd1e3420c800940521aa6423f014382de542 /target/linux/ipq40xx
parenta30abb1b6bb66d1caf08c331805163e6fef6f2a1 (diff)
downloadupstream-c30220d458c0771013f21a16148baa4ea723027b.tar.gz
upstream-c30220d458c0771013f21a16148baa4ea723027b.tar.bz2
upstream-c30220d458c0771013f21a16148baa4ea723027b.zip
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 <cezary@eko.one.pl> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Diffstat (limited to 'target/linux/ipq40xx')
-rwxr-xr-xtarget/linux/ipq40xx/base-files/etc/board.d/02_network5
-rwxr-xr-xtarget/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches6
-rw-r--r--target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata2
-rw-r--r--target/linux/ipq40xx/base-files/lib/upgrade/platform.sh15
-rw-r--r--target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts385
-rw-r--r--target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts385
-rw-r--r--target/linux/ipq40xx/image/Makefile39
-rw-r--r--target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch3
-rw-r--r--target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch3
9 files changed, 841 insertions, 2 deletions
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 <cezary@eko.one.pl>.
+// Copyright (c) 2020, Pawel Dembicki <paweldembicki@gmail.com>.
+
+#include "qcom-ipq4019.dtsi"
+#include <dt-bindings/soc/qcom,tcsr.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ 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 = <KEY_WPS_BUTTON>;
+ gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
+ };
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ 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_WIFI_GLB_CFG>;
+ };
+
+ tcsr@194b000 {
+ /* select hostmode */
+ compatible = "qcom,tcsr";
+ reg = <0x194b000 0x100>;
+ qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+ status = "okay";
+ };
+
+ ess_tcsr@1953000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1953000 0x1000>;
+ qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+ };
+
+ tcsr@1957000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1957000 0x100>;
+ qcom,wifi_noc_memtype_m0_m2 = <TCSR_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 <cezary@eko.one.pl>.
+// Copyright (c) 2020, Pawel Dembicki <paweldembicki@gmail.com>.
+
+#include "qcom-ipq4019.dtsi"
+#include <dt-bindings/soc/qcom,tcsr.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ 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 = <KEY_WPS_BUTTON>;
+ gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
+ };
+
+ reset {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ 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_WIFI_GLB_CFG>;
+ };
+
+ tcsr@194b000 {
+ /* select hostmode */
+ compatible = "qcom,tcsr";
+ reg = <0x194b000 0x100>;
+ qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+ status = "okay";
+ };
+
+ ess_tcsr@1953000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1953000 0x1000>;
+ qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+ };
+
+ tcsr@1957000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1957000 0x100>;
+ qcom,wifi_noc_memtype_m0_m2 = <TCSR_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 <john@phrozen.org>
--- 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 <john@phrozen.org>
+ 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 <john@phrozen.org>
--- 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 <john@phrozen.org>
+ 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 \