From 89deb1ff0bf374250a3967164c52530325d0a8c6 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Sat, 10 Apr 2021 09:33:08 +0800 Subject: [PATCH] Delete ipq_r619ac and add new antrouter l1000 Delete ipq_r619ac and add new antrouter l1000 motherboard with three built-in lte ec20. Fixed the problem of Ipq40xx generating image. --- .../ipq40xx/base-files/etc/board.d/01_leds | 81 ++++ .../ipq40xx/base-files/etc/board.d/02_network | 33 +- .../base-files/etc/board.d/03_gpio_switches | 24 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 46 +- .../base-files/etc/init.d/adjust_network | 19 + .../ipq40xx/base-files/lib/adjust_network.sh | 89 ++++ .../ipq40xx/base-files/lib/upgrade/linksys.sh | 122 +++++ .../base-files/lib/upgrade/openmesh.sh | 106 +++++ .../base-files/lib/upgrade/platform.sh | 22 +- ...019-r619ac.dtsi => qcom-ipq4019-l1000.dts} | 422 +++++++++++------- .../arm/boot/dts/qcom-ipq4019-r619ac-128m.dts | 18 - .../arch/arm/boot/dts/qcom-ipq4019-r619ac.dts | 12 - .../ipq40xx/image/{Makefile => generic.mk} | 190 +++++--- .../901-arm-boot-add-dts-files.patch | 15 +- 14 files changed, 919 insertions(+), 280 deletions(-) create mode 100755 root/target/linux/ipq40xx/base-files/etc/board.d/01_leds create mode 100755 root/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches mode change 100644 => 100755 root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata create mode 100755 root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network create mode 100755 root/target/linux/ipq40xx/base-files/lib/adjust_network.sh create mode 100755 root/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh create mode 100755 root/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh mode change 100644 => 100755 root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh rename root/target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4019-r619ac.dtsi => qcom-ipq4019-l1000.dts} (50%) mode change 100644 => 100755 delete mode 100644 root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts delete mode 100644 root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts rename root/target/linux/ipq40xx/image/{Makefile => generic.mk} (83%) mode change 100644 => 100755 root/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch diff --git a/root/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/root/target/linux/ipq40xx/base-files/etc/board.d/01_leds new file mode 100755 index 00000000..90aef777 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -0,0 +1,81 @@ +# +# Copyright (C) 2015 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +alfa-network,ap120c-ac) + ucidef_set_led_netdev "wan" "WAN" "amber:wan" "eth1" + ;; +asus,rt-ac58u) + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" + ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e" + ;; +avm,fritzbox-4040) + ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" "phy1tpt" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x1e" + ;; +avm,fritzbox-7530 |\ +glinet,gl-b1300) + ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" + ;; +edgecore,oap100) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy1tpt" + ;; +engenius,eap1300) + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "yellow:wlan5g" "phy1tpt" + ucidef_set_led_default "mesh" "MESH" "blue:mesh" "0" + ;; +engenius,eap2200) + ucidef_set_led_netdev "lan1" "LAN1" "blue:lan1" "eth0" + ucidef_set_led_netdev "lan2" "LAN2" "blue:lan2" "eth1" + ;; +engenius,ens620ext) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt" + ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth0" + ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth1" + ;; +mobipromo,cm520-79f) + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x08" + ;; +pangu,l1000) + ucidef_set_led_default "power" "POWER" "blue:power" "1" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy1tpt" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" + ucidef_set_led_netdev "4g1" "4g1" "blue:4g1" "4g1" + ucidef_set_led_netdev "4g2" "4g2" "blue:4g2" "4g2" + ucidef_set_led_netdev "4g3" "4g3" "blue:4g3" "4g3" + ;; +netgear,ex6100v2 |\ +netgear,ex6150v2) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:router" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:client" "phy1tpt" + ;; +qxwlan,e2600ac-c1 |\ +qxwlan,e2600ac-c2) + ucidef_set_led_wlan "wlan2g" "WLAN0" "green:wlan0" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN1" "green:wlan1" "phy1tpt" + ;; +zyxel,nbg6617 |\ +zyxel,wre6606) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt" + ;; +esac + +board_config_flush + +exit 0 \ No newline at end of file diff --git a/root/target/linux/ipq40xx/base-files/etc/board.d/02_network b/root/target/linux/ipq40xx/base-files/etc/board.d/02_network index 0ac8b59a..6be4f23d 100755 --- a/root/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/root/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -1,4 +1,3 @@ -#!/bin/sh # # Copyright (c) 2015 The Linux Foundation. All rights reserved. # Copyright (c) 2011-2015 OpenWrt.org @@ -16,7 +15,10 @@ ipq40xx_setup_interfaces() 8dev,jalapeno|\ alfa-network,ap120c-ac|\ engenius,emr3500|\ - engenius,ens620ext) + engenius,ens620ext|\ + luma,wrtq-329acn|\ + plasmacloud,pa1200|\ + plasmacloud,pa2200) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; aruba,ap-303|\ @@ -38,13 +40,13 @@ ipq40xx_setup_interfaces() ;; asus,map-ac2200|\ cilab,meshpoint-one|\ + edgecore,ecw5211|\ + edgecore,oap100|\ openmesh,a42|\ openmesh,a62) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; asus,rt-ac58u|\ - p2w,r619ac-128m|\ - p2w,r619ac|\ zyxel,nbg6617) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ @@ -52,7 +54,9 @@ ipq40xx_setup_interfaces() ;; avm,fritzbox-4040|\ linksys,ea6350v3|\ - linksys,ea8300) + pangu,l1000|\ + linksys,ea8300|\ + linksys,mr8300) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" @@ -61,7 +65,10 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" ;; - avm,fritzrepeater-3000|\ + avm,fritzrepeater-3000) + ucidef_add_switch "switch0" \ + "0u@eth0" "4:lan:1" "5:lan:2" + ;; compex,wpj419|\ compex,wpj428|\ engenius,eap2200) @@ -77,11 +84,15 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0u@eth0" "3:lan" "4:lan" ;; + devolo,magic-2-wifi-next) + ucidef_set_interface_lan "eth0 eth1 eth2" + ;; ezviz,cs-w3-wd1200g-eup) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "switch0" \ "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan" ;; + glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-s1300) ucidef_set_interfaces_lan_wan "eth0" "eth1" @@ -121,9 +132,7 @@ ipq40xx_setup_macs() 8dev,habanero-dvk) label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; - asus,rt-ac58u|\ - p2w,r619ac-128m|\ - p2w,r619ac) + asus,rt-ac58u) CI_UBIPART=UBI_DEV wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006) @@ -132,6 +141,10 @@ ipq40xx_setup_macs() cilab,meshpoint-one) label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; + devolo,magic-2-wifi-next) + lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0) + label_mac=$lan_mac + ;; dlink,dap-2610) lan_mac=$(mtd_get_mac_ascii bdcfg lanmac) label_mac=$lan_mac @@ -170,4 +183,4 @@ ipq40xx_setup_interfaces $board ipq40xx_setup_macs $board board_config_flush -exit 0 +exit 0 \ No newline at end of file diff --git a/root/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches b/root/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 00000000..a15f60b8 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,24 @@ +. /lib/functions/uci-defaults.sh + +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" + ;; +compex,wpj428) + ucidef_add_gpio_switch "sim_card_select" "SIM card select" "3" "0" + ;; +esac + +board_config_flush + +exit 0 \ No newline at end of file diff --git a/root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata old mode 100644 new mode 100755 index 4b69c79f..f48e7719 --- a/root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -36,10 +36,12 @@ case "$FIRMWARE" in ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x32) ;; engenius,eap2200 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa2200) caldata_extract "0:ART" 0x9000 0x2f20 ;; - linksys,ea8300) + linksys,ea8300 |\ + linksys,mr8300) caldata_extract "ART" 0x9000 0x2f20 # OEM assigns 4 sequential MACs ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4)) @@ -53,12 +55,11 @@ case "$FIRMWARE" in alfa-network,ap120c-ac |\ cilab,meshpoint-one |\ ezviz,cs-w3-wd1200g-eup |\ + glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-s1300 |\ linksys,ea6350v3 |\ mobipromo,cm520-79f |\ - p2w,r619ac-128m |\ - p2w,r619ac |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x1000 0x2f20 ;; @@ -95,15 +96,24 @@ case "$FIRMWARE" in cellc,rtl30vw |\ compex,wpj419 |\ compex,wpj428 |\ + edgecore,ecw5211 |\ + edgecore,oap100 |\ engenius,eap1300 |\ engenius,eap2200 |\ + luma,wrtq-329acn|\ openmesh,a42 |\ openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) caldata_extract "0:ART" 0x1000 0x2f20 ;; + devolo,magic-2-wifi-next) + caldata_extract "ART" 0x1000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress0) + ;; dlink,dap-2610) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac) @@ -120,7 +130,12 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) ;; - linksys,ea8300) + linksys,ea8300 |\ + linksys,mr8300) + caldata_extract "ART" 0x1000 0x2f20 + ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2) + ;; + pangu,l1000) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2) ;; @@ -148,12 +163,11 @@ case "$FIRMWARE" in alfa-network,ap120c-ac |\ cilab,meshpoint-one |\ ezviz,cs-w3-wd1200g-eup |\ + glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-s1300 |\ linksys,ea6350v3 |\ mobipromo,cm520-79f |\ - p2w,r619ac-128m |\ - p2w,r619ac |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x5000 0x2f20 ;; @@ -190,15 +204,24 @@ case "$FIRMWARE" in cellc,rtl30vw |\ compex,wpj419 |\ compex,wpj428 |\ + edgecore,ecw5211 |\ + edgecore,oap100 |\ engenius,eap1300 |\ engenius,eap2200 |\ + luma,wrtq-329acn|\ openmesh,a42 |\ openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) caldata_extract "0:ART" 0x5000 0x2f20 ;; + devolo,magic-2-wifi-next) + caldata_extract "ART" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress1) + ;; dlink,dap-2610) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a) @@ -215,7 +238,12 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) ;; - linksys,ea8300) + linksys,ea8300 |\ + linksys,mr8300) + caldata_extract "ART" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3) + ;; + pangu,l1000) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3) ;; @@ -239,4 +267,4 @@ case "$FIRMWARE" in *) exit 1 ;; -esac +esac \ No newline at end of file diff --git a/root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network b/root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network new file mode 100755 index 00000000..02af8198 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=11 +STOP=98 + +adjust_smp_affinity() { + test -f /lib/adjust_network.sh && { + . /lib/adjust_network.sh + + adjust_eth_queue + adjust_edma_smp_affinity + adjust_radio_smp_affinity + } +} + +boot() { + adjust_smp_affinity +} diff --git a/root/target/linux/ipq40xx/base-files/lib/adjust_network.sh b/root/target/linux/ipq40xx/base-files/lib/adjust_network.sh new file mode 100755 index 00000000..99423022 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/lib/adjust_network.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# this scripts is used for adjust cpu's choice of interrupts. +# + +################################################ +# Adjust smp_affinity of edma +# Globals: +# None +# Arguments: +# None +# Returns: +# None +# Remark: +# execute only once on start-up. +################################################ +adjust_edma_smp_affinity() { + grep -q edma_eth_ /proc/interrupts || return 0 + local nr=`cat /proc/cpuinfo | grep processor | wc -l` + local cpu=0 + local tx_irq_num + + for tx_num in `seq 0 1 15` ; do + cpu=`printf "%x" $((1<<((tx_num/4+0)%nr)))` + tx_irq_num=`grep -m1 edma_eth_tx$tx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '` + [ -n "$tx_irq_num" ] && echo $cpu > /proc/irq/$tx_irq_num/smp_affinity + done + + for rx_num in `seq 0 1 7` ; do + cpu=`printf "%x" $((1<<((rx_num/2)%nr)))` + rx_irq_num=`grep -m1 edma_eth_rx$rx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '` + [ -n "$rx_irq_num" ] && echo $cpu > /proc/irq/$rx_irq_num/smp_affinity + done +} + +################################################ +# Adjust smp_affinity of ath10k for 2G and 5G +# Globals: +# None +# Arguments: +# None +# Returns: +# None +# Remark: +# execute only once on start-up. +################################################ +adjust_radio_smp_affinity() { + local irqs="`grep -E 'ath10k' /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`" + local nr=`cat /proc/cpuinfo | grep processor | wc -l` + local idx=2 + + for irq in $irqs; do + cpu=`printf "%x" $((1<<((idx)%nr)))` + echo $cpu > /proc/irq/$irq/smp_affinity + idx=$((idx+1)) + done +} + +################################################ +# Adjust queue of eth +# Globals: +# None +# Arguments: +# None +# Returns: +# None +# Remark: +# Each network reboot needs to be executed. +################################################ +adjust_eth_queue() { + local nr=`cat /proc/cpuinfo | grep processor | wc -l` + local idx=0 + + for epath in /sys/class/net/eth[0-9]*; do + test -e $epath || break + echo $epath | grep -q "\." && continue + eth=`basename $epath` + idx=0 + for exps in /sys/class/net/$eth/queues/rx-[0-9]*/rps_cpus; do + test -e $exps || break + cpu=`printf "%x" $((1<<((idx+1)%nr)))` + idx=$((idx+1)) + echo $cpu > $exps + echo 256 > `dirname $exps`/rps_flow_cnt + done + which ethtool >/dev/null 2>&1 && ethtool -K $eth gro off + done + + echo 1024 > /proc/sys/net/core/rps_sock_flow_entries +} diff --git a/root/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh b/root/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh new file mode 100755 index 00000000..de09d34a --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh @@ -0,0 +1,122 @@ +linksys_get_target_firmware() { + local cur_boot_part mtd_ubi0 + + cur_boot_part="$(/usr/sbin/fw_printenv -n boot_part)" + if [ -z "${cur_boot_part}" ]; then + mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num) + case "$(grep -E "^mtd${mtd_ubi0}:" /proc/mtd | cut -d '"' -f 2)" in + kernel|rootfs) + cur_boot_part=1 + ;; + alt_kernel|alt_rootfs) + cur_boot_part=2 + ;; + esac + >&2 printf "Current boot_part='%s' selected from ubi0/mtd_num='%s'" \ + "${cur_boot_part}" "${mtd_ubi0}" + fi + + # OEM U-Boot for EA6350v3, EA8300 and MR8300; bootcmd= + # if test $auto_recovery = no; + # then bootipq; + # elif test $boot_part = 1; + # then run bootpart1; + # else run bootpart2; + # fi + + case "$cur_boot_part" in + 1) + fw_setenv -s - <<-EOF + boot_part 2 + auto_recovery yes + EOF + printf "alt_kernel" + return + ;; + 2) + fw_setenv -s - <<-EOF + boot_part 1 + auto_recovery yes + EOF + printf "kernel" + return + ;; + *) + return + ;; + esac +} + +linksys_get_root_magic() { + (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null +} + +platform_do_upgrade_linksys() { + local magic_long="$(get_magic_long "$1")" + + local rm_oem_fw_vols="squashfs ubifs" # from OEM [alt_]rootfs UBI + local vol + + mkdir -p /var/lock + local part_label="$(linksys_get_target_firmware)" + touch /var/lock/fw_printenv.lock + + if [ -z "$part_label" ]; then + echo "cannot find target partition" + exit 1 + fi + + local target_mtd=$(find_mtd_part "$part_label") + + [ "$magic_long" = "73797375" ] && { + CI_KERNPART="$part_label" + if [ "$part_label" = "kernel" ]; then + CI_UBIPART="rootfs" + else + CI_UBIPART="alt_rootfs" + fi + + local mtdnum="$(find_mtd_index "$CI_UBIPART")" + if [ ! "$mtdnum" ]; then + echo "cannot find ubi mtd partition $CI_UBIPART" + return 1 + fi + + local ubidev="$(nand_find_ubi "$CI_UBIPART")" + if [ ! "$ubidev" ]; then + ubiattach -m "$mtdnum" + sync + ubidev="$(nand_find_ubi "$CI_UBIPART")" + fi + + if [ "$ubidev" ]; then + for vol in $rm_oem_fw_vols; do + ubirmvol "/dev/$ubidev" -N "$vol" 2>/dev/null + done + fi + + # complete std upgrade + nand_upgrade_tar "$1" + } + + [ "$magic_long" = "27051956" ] && { + # This magic is for a uImage (which is a sysupgrade image) + # check firmwares' rootfs types + local oldroot="$(linksys_get_root_magic "$target_mtd")" + local newroot="$(linksys_get_root_magic "$1")" + + if [ "$newroot" = "55424923" ] && [ "$oldroot" = "55424923" ]; then + # we're upgrading from a firmware with UBI to one with UBI + # erase everything to be safe + # - Is that really needed? Won't remove (or comment) the if, + # because it may be needed in a future device. + #mtd erase $part_label + #get_image "$1" | mtd -n write - $part_label + echo "writing \"$1\" UBI image to \"$part_label\" (UBI)..." + get_image "$1" | mtd write - "$part_label" + else + echo "writing \"$1\" image to \"$part_label\"" + get_image "$1" | mtd write - "$part_label" + fi + } +} diff --git a/root/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/root/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh new file mode 100755 index 00000000..8e02186e --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh @@ -0,0 +1,106 @@ +# The U-Boot loader of the OpenMesh devices requires image sizes and +# checksums to be provided in the U-Boot environment. +# The OpenMesh devices come with 2 main partitions - while one is active +# sysupgrade will flash the other. The boot order is changed to boot the +# newly flashed partition. If the new partition can't be booted due to +# upgrade failures the previously used partition is loaded. + +platform_do_upgrade_openmesh() { + local tar_file="$1" + local restore_backup + local primary_kernel_mtd + + local setenv_script="/tmp/fw_env_upgrade" + + local kernel_mtd="$(find_mtd_index $PART_NAME)" + local kernel_offset="$(cat /sys/class/mtd/mtd${kernel_mtd}/offset)" + local total_size="$(cat /sys/class/mtd/mtd${kernel_mtd}/size)" + + # detect to which flash region the new image is written to. + # + # 1. check what is the mtd index for the first flash region on this + # device + # 2. check if the target partition ("inactive") has the mtd index of + # the first flash region + # + # - when it is: the new bootseq will be 1,2 and the first region is + # modified + # - when it isnt: bootseq will be 2,1 and the second region is + # modified + # + # The detection has to be done via the hardcoded mtd partition because + # the current boot might be done with the fallback region. Let us + # assume that the current bootseq is 1,2. The bootloader detected that + # the image in flash region 1 is corrupt and thus switches to flash + # region 2. The bootseq in the u-boot-env is now still the same and + # the sysupgrade code can now only rely on the actual mtd indexes and + # not the bootseq variable to detect the currently booted flash + # region/image. + # + # In the above example, an implementation which uses bootseq ("1,2") to + # detect the currently booted image would assume that region 1 is booted + # and then overwrite the variables for the wrong flash region (aka the + # one which isn't modified). This could result in a device which doesn't + # boot anymore to Linux until it was reflashed with ap51-flash. + local next_boot_part="1" + case "$(board_name)" in + openmesh,a42) + primary_kernel_mtd=8 + ;; + openmesh,a62) + primary_kernel_mtd=10 + ;; + *) + echo "failed to detect primary kernel mtd partition for board" + return 1 + ;; + esac + [ "$kernel_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + local kernel_length=$(tar xf $tar_file ${board_dir}/kernel -O | wc -c) + local rootfs_length=$(tar xf $tar_file ${board_dir}/root -O | wc -c) + # rootfs without EOF marker + rootfs_length=$((rootfs_length-4)) + + local kernel_md5=$(tar xf $tar_file ${board_dir}/kernel -O | md5sum); kernel_md5="${kernel_md5%% *}" + # md5 checksum of rootfs with EOF marker + local rootfs_md5=$(tar xf $tar_file ${board_dir}/root -O | dd bs=1 count=$rootfs_length | md5sum); rootfs_md5="${rootfs_md5%% *}" + + # + # add tar support to get_image() to use default_do_upgrade() instead? + # + + # take care of restoring a saved config + [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}" + + mtd -q erase inactive + tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME + tar xf $tar_file ${board_dir}/kernel -O | mtd -n write - $PART_NAME + + # prepare new u-boot env + if [ "$next_boot_part" = "1" ]; then + echo "bootseq 1,2" > $setenv_script + else + echo "bootseq 2,1" > $setenv_script + fi + + printf "kernel_size_%i 0x%08x\n" $next_boot_part $kernel_length >> $setenv_script + printf "vmlinux_start_addr 0x%08x\n" ${kernel_offset} >> $setenv_script + printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script + printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script + + printf "rootfs_size_%i 0x%08x\n" $next_boot_part $((total_size-kernel_length)) >> $setenv_script + printf "rootfs_start_addr 0x%08x\n" $((kernel_offset+kernel_length)) >> $setenv_script + printf "rootfs_size 0x%08x\n" ${rootfs_length} >> $setenv_script + printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script + + # store u-boot env changes + mkdir -p /var/lock + fw_setenv -s $setenv_script || { + echo "failed to update U-Boot environment" + return 1 + } +} diff --git a/root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh old mode 100644 new mode 100755 index f874aa4b..396bc5d9 --- a/root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -59,6 +59,7 @@ platform_do_upgrade() { case "$(board_name)" in 8dev,jalapeno |\ aruba,ap-303 |\ + pangu,l1000 |\ aruba,ap-303h |\ aruba,ap-365 |\ avm,fritzbox-7530 |\ @@ -66,8 +67,14 @@ platform_do_upgrade() { avm,fritzrepeater-3000 |\ buffalo,wtr-m2133hp |\ cilab,meshpoint-one |\ + edgecore,ecw5211 |\ + edgecore,oap100 |\ engenius,eap2200 |\ + glinet,gl-ap1300 |\ + luma,wrtq-329acn |\ mobipromo,cm520-79f |\ + p2w,r619ac-64m |\ + p2w,r619ac-128m |\ qxwlan,e2600ac-c2) nand_do_upgrade "$1" ;; @@ -95,13 +102,12 @@ platform_do_upgrade() { CI_UBIPART="ubifs" askey_do_upgrade "$1" ;; - compex,wpj419|\ - p2w,r619ac-128m|\ - p2w,r619ac) + compex,wpj419) nand_do_upgrade "$1" ;; linksys,ea6350v3 |\ - linksys,ea8300) + linksys,ea8300 |\ + linksys,mr8300) platform_do_upgrade_linksys "$1" ;; meraki,mr33) @@ -109,9 +115,11 @@ platform_do_upgrade() { nand_do_upgrade "$1" ;; openmesh,a42 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa1200 |\ + plasmacloud,pa2200) PART_NAME="inactive" - platform_do_upgrade_openmesh "$1" + platform_do_upgrade_dualboot_datachk "$1" ;; zyxel,nbg6617) zyxel_do_upgrade "$1" @@ -120,4 +128,4 @@ platform_do_upgrade() { default_do_upgrade "$1" ;; esac -} +} \ No newline at end of file diff --git a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi b/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-l1000.dts old mode 100644 new mode 100755 similarity index 50% rename from root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi rename to root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-l1000.dts index 81018dd0..9a6059a9 --- a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi +++ b/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-l1000.dts @@ -1,4 +1,8 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* SPDX-License-Identifier: GPL-2.0-or-later OR MIT + * + * Copyright (c) 2018 Peng Zhang + * + */ #include "qcom-ipq4019.dtsi" #include @@ -6,12 +10,26 @@ #include / { - aliases { - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - label-mac-device = &gmac0; + + model = "GZ841902_55860.com"; + compatible = "pangu,l1000", "qcom,ipq4019"; + + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; /* 512MB */ + }; + + aliases { + sdhc1 = &sdhci; + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + chosen { + bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; }; soc { @@ -23,6 +41,8 @@ status = "okay"; pinctrl-0 = <&mdio_pins>; pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; }; ess-psgmii@98000 { @@ -36,9 +56,11 @@ }; tcsr@194b000 { + /* select hostmode */ compatible = "qcom,tcsr"; reg = <0x194b000 0x100>; qcom,usb-hsphy-mode-select = ; + status = "okay"; }; ess_tcsr@1953000 { @@ -71,6 +93,15 @@ ess-switch@c000000 { status = "okay"; + switch_lan_bmp = <0x18>; + switch_wan_bmp = <0x20>; + }; + + i2c@78b7000 { /* BLSP1 QUP2 */ + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + + status = "okay"; }; edma@c080000 { @@ -78,29 +109,6 @@ }; }; - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_sys: sys { - label = "r619ac:blue:sys"; - gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "r619ac:blue:wlan2g"; - gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "phy0tpt"; - }; - - wlan5g { - label = "r619ac:blue:wlan5g"; - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "phy1tpt"; - }; - }; - keys { compatible = "gpio-keys"; @@ -110,90 +118,63 @@ linux,code = ; }; }; -}; -&blsp_dma { - status = "okay"; -}; + leds { + compatible = "gpio-leds"; -&blsp1_spi1 { - status = "okay"; - - flash@0 { - reg = <0>; - compatible = "jedec,spi-nor"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "SBL1"; - reg = <0x0 0x40000>; - read-only; - }; - - partition@40000 { - label = "MIBIB"; - reg = <0x40000 0x20000>; - read-only; - }; - - partition@60000 { - label = "QSEE"; - reg = <0x60000 0x60000>; - read-only; - }; - - partition@c0000 { - label = "CDT"; - reg = <0xc0000 0x10000>; - read-only; - }; - - partition@d0000 { - label = "DDRPARAMS"; - reg = <0xd0000 0x10000>; - read-only; - }; - - partition@e0000 { - label = "APPSBLENV"; - reg = <0xe0000 0x10000>; - read-only; - }; - - partition@f0000 { - label = "APPSBL"; - reg = <0xf0000 0x80000>; - read-only; - }; - - partition@1 { - label = "Bootloader"; - reg = <0x0 0x170000>; - read-only; - }; - - partition@170000 { - label = "ART"; - reg = <0x170000 0x10000>; - read-only; - }; - - partition@180000 { - label = "unused"; - reg = <0x180000 0xe80000>; - }; + power: status { + label = "blue:status"; + gpios = <&tlmm 3 GPIO_ACTIVE_LOW>; }; + + wlan2g { + label = "blue:wlan2g"; + gpios = <&tlmm 1 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "bule:wlan5g"; + gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "bule:wan"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + }; + 4g1 { + label = "bule:4g1"; + gpios = <&tlmm 44 GPIO_ACTIVE_LOW>; + }; + 4g2 { + label = "bule:4g2"; + gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; + }; + 4g3 { + label = "bule:4g3"; + gpios = <&tlmm 46 GPIO_ACTIVE_LOW>; + }; + usb { + label = "bule:usb"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + trigger-sources = <&usb2>, <&usb3>; + linux,default-trigger = "usbport"; + }; }; }; -&blsp1_uart1 { - pinctrl-0 = <&serial_0_pins>; +&vqmmc { + status = "okay"; +}; + +&sdhci { + status = "okay"; + pinctrl-0 = <&sd_pins>; pinctrl-names = "default"; + cd-gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + vqmmc-supply = <&vqmmc>; +}; + +&blsp_dma { status = "okay"; }; @@ -201,7 +182,72 @@ status = "okay"; }; +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + SBL1@0 { + label = "SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + MIBIB@40000 { + label = "MIBIB"; + reg = <0x40000 0x20000>; + }; + + QSEE@60000 { + label = "QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + CDT@c0000 { + label = "CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + DDRPARAMS@d0000 { + label = "DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + APPSBLENV@e0000 { + label = "APPSBLENV"; + reg = <0xe0000 0x10000>; + }; + + APPSBL@f0000 { + label = "APPSBL"; + reg = <0xf0000 0x80000>; + }; + + ART@170000 { + label = "ART"; + reg = <0x170000 0x10000>; + }; + }; + }; +}; + &nand { + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; status = "okay"; nand@0 { @@ -210,14 +256,9 @@ #address-cells = <1>; #size-cells = <1>; - rootfs_part1: partition@0 { + rootfs@0 { label = "rootfs"; - reg = <0x0 0x4000000>; - }; - - rootfs_part2: partition@4000000 { - label = "unused1"; - reg = <0x4000000 0x4000000>; + reg = <0x0 0x8000000>; }; }; }; @@ -227,43 +268,20 @@ status = "okay"; }; -&sdhci { - pinctrl-0 = <&sd_0_pins>; +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&blsp1_uart2 { + pinctrl-0 = <&serial_1_pins>; pinctrl-names = "default"; - vqmmc-supply = <&vqmmc>; 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; - }; - }; - - sd_0_pins: sd_0_pinmux { - mux_1 { - pins = "gpio23", "gpio24", "gpio25", "gpio26", "gpio28"; - function = "sdio"; - drive-strength = <10>; - }; - - mux_2 { - pins = "gpio27"; - function = "sdio"; - drive-strength = <16>; - }; - }; - - serial_0_pins: serial0-pinmux { + serial_pins: serial_pinmux { mux { pins = "gpio16", "gpio17"; function = "blsp_uart0"; @@ -271,31 +289,101 @@ }; }; - led_pins: led_pinmux { - mux { - pins = "gpio32", "gpio39", "gpio50"; - function = "gpio"; - bias-pull-up; - output-low; - }; - + mdio_pins: mdio_pinmux { mux_1 { - pins = "gpio52"; - function = "gpio"; + pins = "gpio6"; + function = "mdio"; bias-pull-up; + }; + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_1_pins: serial1_pinmux { + mux { + pins = "gpio8", "gpio9", + "gpio10", "gpio11"; + function = "blsp_uart1"; + bias-disable; + }; + }; + + i2c_0_pins: i2c-0-pinmux { + mux { + pins = "gpio20", "gpio21"; + function = "blsp_i2c0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + }; + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + }; + pinconf { + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pinconf_cs { + pins = "gpio12"; + drive-strength = <2>; + bias-disable; output-high; }; + }; - mux_2 { - pins = "gpio61"; - function = "gpio"; + 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; - output-high; + }; + }; + + sd_pins: sd_pins { + pinmux { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", + "gpio28", "gpio29", "gpio30", "gpio31"; + drive-strength = <10>; + }; + + pinmux_sd_clk { + function = "sdio"; + pins = "gpio27"; + drive-strength = <16>; + }; + + pinmux_sd7 { + function = "sdio"; + pins = "gpio32"; + drive-strength = <10>; + bias-disable; }; }; }; -&usb3_ss_phy { +&usb2_hs_phy { status = "okay"; }; @@ -303,20 +391,16 @@ status = "okay"; }; -&usb2_hs_phy { - status = "okay"; -}; - -&vqmmc { +&usb3_ss_phy { status = "okay"; }; &wifi0 { status = "okay"; - qcom,ath10k-calibration-variant = "R619AC"; + qcom,ath10k-calibration-variant = "PANGU-L1000"; }; &wifi1 { status = "okay"; - qcom,ath10k-calibration-variant = "R619AC"; -}; + qcom,ath10k-calibration-variant = "PANGU-L1000"; +}; \ No newline at end of file diff --git a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts b/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts deleted file mode 100644 index b51378a7..00000000 --- a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qcom-ipq4019-r619ac.dtsi" - -/ { - model = "P&W R619AC 128M"; - compatible = "p2w,r619ac-128m"; - - chosen { - bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; - }; -}; - -&rootfs_part1 { - reg = <0x0 0x8000000>; -}; - -/delete-node/ &rootfs_part2; diff --git a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts b/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts deleted file mode 100644 index 31010dd1..00000000 --- a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qcom-ipq4019-r619ac.dtsi" - -/ { - model = "P&W R619AC"; - compatible = "p2w,r619ac"; - - chosen { - bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; - }; -}; diff --git a/root/target/linux/ipq40xx/image/Makefile b/root/target/linux/ipq40xx/image/generic.mk similarity index 83% rename from root/target/linux/ipq40xx/image/Makefile rename to root/target/linux/ipq40xx/image/generic.mk index 44b6da6d..148110e4 100644 --- a/root/target/linux/ipq40xx/image/Makefile +++ b/root/target/linux/ipq40xx/image/generic.mk @@ -1,23 +1,8 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION DEVICE_VARS += WRGG_DEVNAME WRGG_SIGNATURE -define Device/Default - PROFILES := Default - KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) - KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs - KERNEL_PREFIX := $$(IMAGE_PREFIX) - KERNEL_LOADADDR := 0x80208000 - DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) - IMAGES := sysupgrade.bin - IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata - IMAGE/sysupgrade.bin/squashfs := -endef - define Device/FitImage KERNEL_SUFFIX := -fit-uImage.itb KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb @@ -130,6 +115,21 @@ define Device/8dev_jalapeno endef TARGET_DEVICES += 8dev_jalapeno +define Device/pangu_l1000 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := PANGU + DEVICE_MODEL := L1000 + SOC := qcom-ipq4019 + DEVICE_DTS := qcom-ipq4019-l1000 + KERNEL_INSTALL := 1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + BOARD_NAME := l1000 + DEVICE_PACKAGES := ipq-wifi-pangu_l1000 +endef +TARGET_DEVICES += pangu_l1000 + define Device/alfa-network_ap120c-ac $(call Device/FitImage) $(call Device/UbiFit) @@ -156,6 +156,7 @@ endef define Device/aruba_ap-303 $(call Device/aruba_glenmorangie) DEVICE_MODEL := AP-303 + DEVICE_PACKAGES += uboot-envtools endef TARGET_DEVICES += aruba_ap-303 @@ -168,7 +169,7 @@ TARGET_DEVICES += aruba_ap-303h define Device/aruba_ap-365 $(call Device/aruba_glenmorangie) DEVICE_MODEL := AP-365 - DEVICE_PACKAGES += kmod-hwmon-ad7418 + DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools endef TARGET_DEVICES += aruba_ap-365 @@ -317,6 +318,25 @@ define Device/compex_wpj428 endef TARGET_DEVICES += compex_wpj428 +define Device/devolo_magic-2-wifi-next + $(call Device/FitImage) + DEVICE_VENDOR := devolo + DEVICE_MODEL := Magic 2 WiFi next + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + + # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image + # it will bootm it, just like we want for the initramfs. + KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\ + append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00' + + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools +endef +TARGET_DEVICES += devolo_magic-2-wifi-next + define Device/dlink_dap-2610 $(call Device/FitImageLzma) DEVICE_VENDOR := D-Link @@ -344,6 +364,32 @@ define Device/dlink_dap-2610 endef TARGET_DEVICES += dlink_dap-2610 +define Device/edgecore_ecw5211 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := ECW5211 + SOC := qcom-ipq4018 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools +endef +TARGET_DEVICES += edgecore_ecw5211 + +define Device/edgecore_oap100 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Edgecore + DEVICE_MODEL := OAP100 + SOC := qcom-ipq4019 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGES := nand-sysupgrade.bin + DEVICE_DTS_CONFIG := config@ap.dk07.1-c1 + DEVICE_PACKAGES := ipq-wifi-edgecore_oap100 kmod-usb-acm kmod-usb-net kmod-usb-net-cdc-qmi uqmi +endef +TARGET_DEVICES += edgecore_oap100 + define Device/engenius_eap1300 $(call Device/FitImage) DEVICE_VENDOR := EnGenius @@ -437,6 +483,21 @@ define Device/ezviz_cs-w3-wd1200g-eup endef TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup +define Device/glinet_gl-ap1300 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AP1300 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 131072k + KERNEL_INSTALL := 1 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 +endef +TARGET_DEVICES += glinet_gl-ap1300 + define Device/glinet_gl-b1300 $(call Device/FitImage) DEVICE_VENDOR := GL.iNet @@ -515,6 +576,34 @@ define Device/linksys_ea8300 endef TARGET_DEVICES += linksys_ea8300 +define Device/linksys_mr8300 + $(call Device/FitzImage) + DEVICE_VENDOR := Linksys + DEVICE_MODEL := MR8300 + SOC := qcom-ipq4019 + KERNEL_SIZE := 3072k + IMAGE_SIZE := 87040k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300 + DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += linksys_mr8300 + +define Device/luma_wrtq-329acn + $(call Device/FitImage) + DEVICE_VENDOR := Luma Home + DEVICE_MODEL := WRTQ-329ACN + SOC := qcom-ipq4018 + DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools + IMAGE_SIZE := 76632k + BLOCKSIZE := 128k + PAGESIZE := 2048 +endef +TARGET_DEVICES += luma_wrtq-329acn + define Device/meraki_mr33 $(call Device/FitImage) DEVICE_VENDOR := Cisco Meraki @@ -540,6 +629,7 @@ TARGET_DEVICES += mobipromo_cm520-79f define Device/netgear_ex61x0v2 $(call Device/DniImage) + DEVICE_VENDOR := NETGEAR DEVICE_DTS_CONFIG := config@4 NETGEAR_BOARD_ID := EX6150v2series NETGEAR_HW_ID := 29765285+16+0+128+2x2 @@ -549,7 +639,6 @@ endef define Device/netgear_ex6100v2 $(call Device/netgear_ex61x0v2) - DEVICE_VENDOR := Netgear DEVICE_MODEL := EX6100 DEVICE_VARIANT := v2 endef @@ -557,7 +646,6 @@ TARGET_DEVICES += netgear_ex6100v2 define Device/netgear_ex6150v2 $(call Device/netgear_ex61x0v2) - DEVICE_VENDOR := Netgear DEVICE_MODEL := EX6150 DEVICE_VARIANT := v2 endef @@ -593,9 +681,40 @@ define Device/openmesh_a62 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools endef - TARGET_DEVICES += openmesh_a62 +define Device/plasmacloud_pa1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA1200 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@pc.pa1200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200 +endef +TARGET_DEVICES += plasmacloud_pa1200 + +define Device/plasmacloud_pa2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@pc.pa2200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools +endef +TARGET_DEVICES += plasmacloud_pa2200 + define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP-DK01.1 @@ -627,35 +746,6 @@ define Device/qcom_ap-dk04.1-c1 endef TARGET_DEVICES += qcom_ap-dk04.1-c1 -define Device/p2w_r619ac - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := P&W - DEVICE_MODEL := R619AC - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@10 - BLOCKSIZE := 128k - PAGESIZE := 2048 - IMAGES += nand-factory.bin - IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand - DEVICE_PACKAGES := ipq-wifi-p2w_r619ac -endef -TARGET_DEVICES += p2w_r619ac - -define Device/p2w_r619ac-128m - $(call Device/FitzImage) - $(call Device/UbiFit) - DEVICE_VENDOR := P&W - DEVICE_MODEL := R619AC - DEVICE_VARIANT := 128M - SOC := qcom-ipq4019 - DEVICE_DTS_CONFIG := config@10 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_PACKAGES := ipq-wifi-p2w_r619ac -endef -TARGET_DEVICES += p2w_r619ac-128m - define Device/qxwlan_e2600ac-c1 $(call Device/FitImage) DEVICE_VENDOR := Qxwlan @@ -729,6 +819,4 @@ define Device/zyxel_wre6606 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers endef -TARGET_DEVICES += zyxel_wre6606 - -$(eval $(call BuildImage)) +TARGET_DEVICES += zyxel_wre6606 \ No newline at end of file diff --git a/root/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/root/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch old mode 100644 new mode 100755 index ade7a675..79daa03f --- a/root/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/root/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,52 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,59 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -18,19 +18,25 @@ Signed-off-by: John Crispin + qcom-ipq4018-ap120c-ac.dtb \ + qcom-ipq4018-dap-2610.dtb \ + qcom-ipq4018-cs-w3-wd1200g-eup.dtb \ ++ qcom-ipq4018-magic-2-wifi-next.dtb \ + qcom-ipq4018-ea6350v3.dtb \ + qcom-ipq4018-eap1300.dtb \ ++ qcom-ipq4018-ecw5211.dtb \ + qcom-ipq4018-emd1.dtb \ + qcom-ipq4018-emr3500.dtb \ + qcom-ipq4018-ens620ext.dtb \ + qcom-ipq4018-ex6100v2.dtb \ + qcom-ipq4018-ex6150v2.dtb \ + qcom-ipq4018-fritzbox-4040.dtb \ ++ qcom-ipq4018-gl-ap1300.dtb \ + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-nbg6617.dtb \ ++ qcom-ipq4019-oap100.dtb \ ++ qcom-ipq4018-pa1200.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ + qcom-ipq4018-wre6606.dtb \ ++ qcom-ipq4018-wrtq-329acn.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c3.dtb \ @@ -43,12 +49,12 @@ Signed-off-by: John Crispin + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \ -+ qcom-ipq4019-r619ac.dtb \ -+ qcom-ipq4019-r619ac-128m.dtb \ + qcom-ipq4019-map-ac2200.dtb \ ++ qcom-ipq4019-mr8300.dtb \ + qcom-ipq4019-e2600ac-c1.dtb \ + qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ ++ qcom-ipq4019-pa2200.dtb \ + qcom-ipq4019-rtl30vw.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ @@ -60,6 +66,7 @@ Signed-off-by: John Crispin + qcom-ipq4029-gl-b1300.dtb \ + qcom-ipq4029-gl-s1300.dtb \ + qcom-ipq4029-mr33.dtb \ ++ qcom-ipq4019-l1000.dtb \ qcom-ipq8064-ap148.dtb \ qcom-msm8660-surf.dtb \ - qcom-msm8960-cdp.dtb \ + qcom-msm8960-cdp.dtb \ \ No newline at end of file