From 1e54d20241626cbfae99a1f3ef405689e573139b Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 19 Jun 2021 16:32:38 +0800 Subject: [PATCH] ipq40xx: some typo and bug fixes (#7080) --- .../ipq40xx/base-files/etc/board.d/01_leds | 3 +- .../ipq40xx/base-files/etc/board.d/02_network | 16 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 8 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 +- .../base-files/etc/init.d/mt7615_reboot | 3 +- .../lib/preinit/05_set_iface_mac_ipq40xx.sh | 14 +- .../base-files/lib/upgrade/platform.sh | 10 +- .../arm/boot/dts/qcom-ipq4019-c526a-128m.dts | 25 -- .../arch/arm/boot/dts/qcom-ipq4019-c526a.dts | 303 ++++++++++++++- .../arm/boot/dts/qcom-ipq4019-r619ac-128m.dts | 14 + .../arch/arm/boot/dts/qcom-ipq4019-r619ac.dts | 365 +----------------- ...19-c526a.dtsi => qcom-ipq4019-r619ac.dtsi} | 197 +++++++--- target/linux/ipq40xx/image/Makefile | 24 +- .../901-arm-boot-add-dts-files.patch | 2 +- 14 files changed, 492 insertions(+), 495 deletions(-) delete mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a-128m.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts rename target/linux/ipq40xx/files/arch/arm/boot/dts/{qcom-ipq4019-c526a.dtsi => qcom-ipq4019-r619ac.dtsi} (58%) 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 695ae6486..f74b04490 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -75,7 +75,8 @@ netgear,ex6200v2) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:router" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:client" "phy1tpt" ;; -p2w,r619ac) +p2w,r619ac |\ +p2w,r619ac-128m) ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy1tpt" ;; 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 439787b60..2014ca3e5 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -76,8 +76,7 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0t@eth0" "3:lan" "4:lan" "5:wan" ;; - hiwifi,c526a|\ - hiwifi,c526a-128m) + hiwifi,c526a) ucidef_add_switch "switch0" \ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:wan" ;; @@ -99,6 +98,7 @@ ipq40xx_setup_interfaces() "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" ;; p2w,r619ac|\ + p2w,r619ac-128m|\ zyxel,nbg6617) ucidef_add_switch "switch0" \ "0t@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan:5" @@ -118,7 +118,7 @@ ipq40xx_setup_macs() case "$board" in 8dev,habanero-dvk) - label_mac=$(mtd_get_mac_binary "ART" 4102) + label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; asus,rt-acrh17|\ asus,rt-ac58u) @@ -132,7 +132,7 @@ ipq40xx_setup_macs() wan_mac=$(macaddr_add "$lan_mac" -1) ;; cilab,meshpoint-one) - label_mac=$(mtd_get_mac_binary "ART" 4102) + label_mac=$(mtd_get_mac_binary "ART" 0x1006) ;; dlink,dap-2610) lan_mac=$(mtd_get_mac_ascii bdcfg lanmac) @@ -153,10 +153,9 @@ ipq40xx_setup_macs() lan_mac=$(macaddr_add "$wan_mac" 1) ;; ezviz,cs-w3-wd1200g-eup) - label_mac=$(mtd_get_mac_binary "ART" 6) + label_mac=$(mtd_get_mac_binary "ART" 0x6) ;; - hiwifi,c526a|\ - hiwifi,c526a-128m) + hiwifi,c526a) lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") wan_mac=$(macaddr_add "$lan_mac" 1) ;; @@ -164,7 +163,8 @@ ipq40xx_setup_macs() wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) lan_mac=$(macaddr_add "$wan_mac" 1) ;; - p2w,r619ac) + p2w,r619ac|\ + p2w,r619ac-128m) wan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_add "$wan_mac" 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 2ed46243d..dad5c7b48 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 @@ -67,6 +67,7 @@ case "$FIRMWARE" in linksys,ea6350v3 |\ mobipromo,cm520-79f |\ p2w,r619ac |\ + p2w,r619ac-128m |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x1000 0x2f20 ;; @@ -130,8 +131,7 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) ;; - hiwifi,c526a|\ - hiwifi,c526a-128m) + hiwifi,c526a) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii bdinfo "Vfac_mac ") +2) ;; @@ -171,6 +171,7 @@ case "$FIRMWARE" in linksys,ea6350v3 |\ mobipromo,cm520-79f |\ p2w,r619ac |\ + p2w,r619ac-128m |\ qcom,ap-dk01.1-c1) caldata_extract "ART" 0x5000 0x2f20 ;; @@ -233,8 +234,7 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) ;; - hiwifi,c526a|\ - hiwifi,c526a-128m) + hiwifi,c526a) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii bdinfo "Vfac_mac ") +3) ;; diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index ecef7944e..0be00f5eb 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -12,8 +12,7 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case "$board" in - hiwifi,c526a|\ - hiwifi,c526a-128m) + hiwifi,c526a) [ "$PHYNBR" -eq 0 ] && \ mtd_get_mac_ascii bdinfo "Vfac_mac " > /sys${DEVPATH}/macaddress ;; diff --git a/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot b/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot index b358c5a5b..47c35a217 100755 --- a/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot +++ b/target/linux/ipq40xx/base-files/etc/init.d/mt7615_reboot @@ -6,8 +6,7 @@ stop() { . /lib/functions.sh case $(board_name) in - hiwifi,c526a|\ - hiwifi,c526a-128m) + hiwifi,c526a) rmmod mt7615e ;; esac diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index 330466891..d06ba7e9a 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -3,17 +3,17 @@ preinit_set_mac_address() { case $(board_name) in asus,map-ac2200) - base_mac=$(mtd_get_mac_binary_ubi Factory 4102) - ip link set dev eth0 address $(macaddr_add "$base_mac" +1) + base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) + ip link set dev eth0 address $(macaddr_add "$base_mac" 1) ;; asus,rt-acrh17|\ asus,rt-ac58u) CI_UBIPART=UBI_DEV - base_mac=$(mtd_get_mac_binary_ubi Factory 4102) - ip link set dev eth0 address $(macaddr_add "$base_mac" +1) + base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006) + ip link set dev eth0 address $(macaddr_add "$base_mac" 1) ;; ezviz,cs-w3-wd1200g-eup) - ip link set dev eth0 address $(mtd_get_mac_binary "ART" 6) + ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6) ;; engenius,eap2200) base_mac=$(cat /sys/class/net/eth0/address) @@ -23,12 +23,12 @@ preinit_set_mac_address() { ip link set dev eth0 address "${base_mac}" ;; meraki,mr33) - mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102) + mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) [ -n "$mac_lan" ] && ip link set dev eth0 address "$mac_lan" ;; zyxel,nbg6617) base_mac=$(cat /sys/class/net/eth0/address) - ip link set dev eth0 address $(macaddr_add "$base_mac" +2) + ip link set dev eth0 address $(macaddr_add "$base_mac" 2) ;; esac } diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 995a566df..49fb4e3de 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -181,10 +181,9 @@ platform_do_upgrade() { century,wr142ac-nand |\ cilab,meshpoint-one |\ hiwifi,c526a |\ - hiwifi,c526a-128m |\ mobipromo,cm520-79f |\ qxwlan,e2600ac-c2) - nand_do_upgrade "$ARGV" + nand_do_upgrade "$1" ;; alfa-network,ap120c-ac) part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')" @@ -218,7 +217,8 @@ platform_do_upgrade() { askey_do_upgrade "$1" ;; compex,wpj419|\ - p2w,r619ac) + p2w,r619ac|\ + p2w,r619ac-128m) nand_do_upgrade "$1" ;; linksys,ea6350v3 |\ @@ -232,13 +232,13 @@ platform_do_upgrade() { openmesh,a42 |\ openmesh,a62) PART_NAME="inactive" - platform_do_upgrade_openmesh "$ARGV" + platform_do_upgrade_openmesh "$1" ;; zyxel,nbg6617) zyxel_do_upgrade "$1" ;; *) - default_do_upgrade "$ARGV" + default_do_upgrade "$1" ;; esac } diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a-128m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a-128m.dts deleted file mode 100644 index a125b1c03..000000000 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a-128m.dts +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "qcom-ipq4019-c526a.dtsi" - -/ { - model = "HiWiFi C526A 128M"; - compatible = "hiwifi,c526a-128m"; -}; - -&nand { - status = "okay"; - - nand@0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "ubi"; - reg = <0x0 0x8000000>; - }; - }; - }; -}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts index 1b1ca4d57..74e0b1259 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dts @@ -1,10 +1,227 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qcom-ipq4019-c526a.dtsi" +#include "qcom-ipq4019.dtsi" +#include +#include +#include / { model = "HiWiFi C526A"; compatible = "hiwifi,c526a"; + + aliases { + led-boot = &led_boot; + led-failsafe = &led_boot; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + 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"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: blue { + label = "blue:sys"; + gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; + }; + + led_boot: red { + label = "red:sys"; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&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@170000 { + label = "ART"; + reg = <0x170000 0x10000>; + read-only; + }; + + partition@180000 { + label = "bdinfo"; + reg = <0x180000 0x10000>; + read-only; + }; + + partition@190000 { + label = "debug"; + reg = <0x190000 0x10000>; + read-only; + }; + + partition@1a0000 { + label = "oem"; + reg = <0x1a0000 0x20000>; + read-only; + }; + + factory: partition@1c0000 { + label = "Factory"; + reg = <0x1c0000 0x10000>; + read-only; + }; + + partition@1d0000 { + label = "hw_panic"; + reg = <0x1d0000 0x10000>; + read-only; + }; + + partition@1e0000 { + label = "upgrade_config"; + reg = <0x1e0000 0x10000>; + read-only; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; }; &nand { @@ -18,18 +235,80 @@ partition@0 { label = "ubi"; - reg = <0x0 0x2c00000>; - }; - - partition@2c00000 { - label = "hiwifi_rootfs"; - reg = <0x2c00000 0x2c00000>; - }; - - partition@5800000 { - label = "hiwifi_opt"; - reg = <0x5800000 0x2800000>; + reg = <0x0 0x8000000>; }; }; }; }; + +&pcie0 { + status = "okay"; + perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; + }; +}; + +&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; + }; + }; + + serial_0_pins: serial0-pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + ieee80211-freq-limit = <5470000 5875000>; + qcom,ath10k-calibration-variant = "C526A"; +}; + +&wifi1 { + status = "okay"; + ieee80211-freq-limit = <5170000 5350000>; + qcom,ath10k-calibration-variant = "C526A"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts new file mode 100644 index 000000000..4c3ad862d --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac-128m.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-r619ac.dtsi" + +/ { + model = "P&W R619AC 128M"; + compatible = "p2w,r619ac-128m"; +}; + +&rootfs_part1 { + reg = <0x0 0x8000000>; +}; + +/delete-node/ &rootfs_part2; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts index 861af2831..d257e4b26 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dts @@ -1,371 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qcom-ipq4019.dtsi" -#include -#include -#include +#include "qcom-ipq4019-r619ac.dtsi" / { model = "P&W R619AC"; compatible = "p2w,r619ac"; - - aliases { - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - label-mac-device = &gmac0; - }; - - chosen { - bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; - }; - - soc { - rng@22000 { - status = "okay"; - }; - - mdio@90000 { - status = "okay"; - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - }; - - 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"; - }; - - usb3@8af8800 { - status = "okay"; - }; - - crypto@8e3a000 { - status = "okay"; - }; - - watchdog@b017000 { - status = "okay"; - }; - - ess-switch@c000000 { - status = "okay"; - }; - - edma@c080000 { - status = "okay"; - }; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - led_sys: sys { - label = "blue:sys"; - gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "phy0tpt"; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "phy1tpt"; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; -}; - -&blsp_dma { - status = "okay"; -}; - -&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>; - }; - - partition@40000 { - label = "MIBIB"; - reg = <0x40000 0x20000>; - }; - - partition@60000 { - label = "QSEE"; - reg = <0x60000 0x60000>; - }; - - partition@c0000 { - label = "CDT"; - reg = <0xc0000 0x10000>; - }; - - partition@d0000 { - label = "DDRPARAMS"; - reg = <0xd0000 0x10000>; - }; - - partition@e0000 { - label = "APPSBLENV"; - reg = <0xe0000 0x10000>; - }; - - partition@f0000 { - label = "APPSBL"; - reg = <0xf0000 0x80000>; - }; - - partition@1 { - label = "Bootloader"; - reg = <0x0 0x170000>; - }; - - partition@170000 { - label = "ART"; - reg = <0x170000 0x10000>; - read-only; - }; - - partition@180000 { - label = "unused"; - reg = <0x180000 0xe80000>; - }; - }; - }; -}; - -&blsp1_uart1 { - pinctrl-0 = <&serial_0_pins>; - pinctrl-names = "default"; - status = "okay"; -}; - -&cryptobam { - status = "okay"; -}; - -&nand { - status = "okay"; - - nand@0 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "rootfs"; - reg = <0x0 0x8000000>; - }; - }; - }; -}; - -&pcie0 { - status = "okay"; - pinctrl-0 = <&pcie_pins>; - pinctrl-names = "default"; - perst-gpio = <&tlmm 4 GPIO_ACTIVE_HIGH>; - wake-gpio = <&tlmm 40 GPIO_ACTIVE_HIGH>; - - /* Free slot for use */ - bridge@0,0 { - reg = <0x00000000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - ranges; - }; -}; - -&qpic_bam { - status = "okay"; -}; - -&sdhci { - pinctrl-0 = <&sd_0_pins>; - pinctrl-names = "default"; - vqmmc-supply = <&vqmmc>; - status = "okay"; -}; - -&tlmm { - pcie_pins: pcie_pinmux { - mux { - pins = "gpio2"; - function = "gpio"; - bias-pull-down; - output-low; - }; - }; - - 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 { - mux { - pins = "gpio16", "gpio17"; - function = "blsp_uart0"; - bias-disable; - }; - }; - - led_pins: led_pinmux { - mux { - pins = "gpio32", "gpio39", "gpio50"; - function = "gpio"; - bias-pull-up; - output-low; - }; - - mux_1 { - pins = "gpio52"; - function = "gpio"; - bias-pull-up; - output-high; - }; - - mux_2 { - pins = "gpio61"; - function = "gpio"; - bias-pull-down; - output-high; - }; - }; -}; - -ðphy0 { - qcom,single-led-1000; - qcom,single-led-100; - qcom,single-led-10; -}; - -ðphy1 { - qcom,single-led-1000; - qcom,single-led-100; - qcom,single-led-10; -}; - -ðphy2 { - qcom,single-led-1000; - qcom,single-led-100; - qcom,single-led-10; -}; - -ðphy3 { - qcom,single-led-1000; - qcom,single-led-100; - qcom,single-led-10; -}; - -ðphy4 { - qcom,single-led-1000; - qcom,single-led-100; - qcom,single-led-10; -}; - -&usb3_ss_phy { - status = "okay"; -}; - -&usb3_hs_phy { - status = "okay"; -}; - -&usb2_hs_phy { - status = "okay"; -}; - -&vqmmc { - status = "okay"; -}; - -&wifi0 { - status = "okay"; - qcom,ath10k-calibration-variant = "R619AC"; -}; - -&wifi1 { - status = "okay"; - qcom,ath10k-calibration-variant = "R619AC"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi similarity index 58% rename from target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dtsi rename to target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi index 86a1056fb..d8b68ab33 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-c526a.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi @@ -7,14 +7,15 @@ / { aliases { - led-boot = &led_boot; - led-failsafe = &led_boot; + led-boot = &led_sys; + led-failsafe = &led_sys; led-running = &led_sys; led-upgrade = &led_sys; + label-mac-device = &gmac0; }; chosen { - bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1"; + bootargs-append = " root=/dev/ubiblock0_1 rootfstype=squashfs"; }; soc { @@ -83,16 +84,24 @@ leds { compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; - led_sys: blue { + led_sys: sys { label = "blue:sys"; - gpios = <&tlmm 36 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 39 GPIO_ACTIVE_HIGH>; }; - led_boot: red { - label = "red:sys"; - gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; - panic-indicator; + wlan2g { + label = "blue:wlan2g"; + gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "blue:wlan5g"; + gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; }; }; @@ -166,6 +175,12 @@ read-only; }; + partition@1 { + label = "Bootloader"; + reg = <0x0 0x170000>; + read-only; + }; + partition@170000 { label = "ART"; reg = <0x170000 0x10000>; @@ -173,39 +188,8 @@ }; partition@180000 { - label = "bdinfo"; - reg = <0x180000 0x10000>; - read-only; - }; - - partition@190000 { - label = "debug"; - reg = <0x190000 0x10000>; - read-only; - }; - - partition@1a0000 { - label = "oem"; - reg = <0x1a0000 0x20000>; - read-only; - }; - - factory: partition@1c0000 { - label = "Factory"; - reg = <0x1c0000 0x10000>; - read-only; - }; - - partition@1d0000 { - label = "hw_panic"; - reg = <0x1d0000 0x10000>; - read-only; - }; - - partition@1e0000 { - label = "upgrade_config"; - reg = <0x1e0000 0x10000>; - read-only; + label = "unused"; + reg = <0x180000 0xe80000>; }; }; }; @@ -221,23 +205,41 @@ status = "okay"; }; +&nand { + status = "okay"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + rootfs_part1: partition@0 { + label = "rootfs"; + reg = <0x0 0x4000000>; + }; + + rootfs_part2: partition@4000000 { + label = "reserve"; + reg = <0x4000000 0x4000000>; + }; + }; + }; +}; + &pcie0 { status = "okay"; - perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; - wake-gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&pcie_pins>; + pinctrl-names = "default"; + perst-gpio = <&tlmm 4 GPIO_ACTIVE_HIGH>; + wake-gpio = <&tlmm 40 GPIO_ACTIVE_HIGH>; + /* Free slot for use */ bridge@0,0 { reg = <0x00000000 0 0 0 0>; #address-cells = <3>; #size-cells = <2>; ranges; - - wifi@1,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - ieee80211-freq-limit = <2400000 2500000>; - }; }; }; @@ -245,7 +247,23 @@ status = "okay"; }; +&sdhci { + pinctrl-0 = <&sd_0_pins>; + pinctrl-names = "default"; + vqmmc-supply = <&vqmmc>; + status = "okay"; +}; + &tlmm { + pcie_pins: pcie_pinmux { + mux { + pins = "gpio2"; + function = "gpio"; + bias-pull-down; + output-low; + }; + }; + mdio_pins: mdio_pinmux { mux_1 { pins = "gpio6"; @@ -260,6 +278,20 @@ }; }; + 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 { mux { pins = "gpio16", "gpio17"; @@ -267,6 +299,59 @@ bias-disable; }; }; + + led_pins: led_pinmux { + mux { + pins = "gpio32", "gpio39", "gpio50"; + function = "gpio"; + bias-pull-up; + output-low; + }; + + mux_1 { + pins = "gpio52"; + function = "gpio"; + bias-pull-up; + output-high; + }; + + mux_2 { + pins = "gpio61"; + function = "gpio"; + bias-pull-down; + output-high; + }; + }; +}; + +ðphy0 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy1 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy2 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy3 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy4 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; }; &usb3_ss_phy { @@ -281,14 +366,16 @@ status = "okay"; }; +&vqmmc { + status = "okay"; +}; + &wifi0 { status = "okay"; - ieee80211-freq-limit = <5470000 5875000>; - qcom,ath10k-calibration-variant = "C526A"; + qcom,ath10k-calibration-variant = "R619AC"; }; &wifi1 { status = "okay"; - ieee80211-freq-limit = <5170000 5350000>; - qcom,ath10k-calibration-variant = "C526A"; + qcom,ath10k-calibration-variant = "R619AC"; }; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index a0820290a..3b7b2d349 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -522,13 +522,6 @@ define Device/hiwifi_c526a endef TARGET_DEVICES += hiwifi_c526a -define Device/hiwifi_c526a-128m - $(call Device/hiwifi_c526a) - DEVICE_VARIANT := 128M - DEVICE_DTS := qcom-ipq4019-c526a-128m -endef -TARGET_DEVICES += hiwifi_c526a-128m - define Device/hugo_ac1200 $(call Device/FitImage) DEVICE_VENDOR := Hugo @@ -686,19 +679,32 @@ define Device/openmesh_a62 endef TARGET_DEVICES += openmesh_a62 -define Device/p2w_r619ac +define Device/p2w_r619ac-common $(call Device/FitzImage) $(call Device/UbiFit) DEVICE_VENDOR := P&W DEVICE_MODEL := R619AC - DEVICE_DTS := qcom-ipq4019-r619ac DEVICE_DTS_CONFIG := config@10 BLOCKSIZE := 128k PAGESIZE := 2048 DEVICE_PACKAGES := ipq-wifi-p2w_r619ac endef + +define Device/p2w_r619ac + $(call Device/p2w_r619ac-common) + DEVICE_DTS := qcom-ipq4019-r619ac + IMAGES += nand-factory.bin + IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand +endef TARGET_DEVICES += p2w_r619ac +define Device/p2w_r619ac-128m + $(call Device/p2w_r619ac-common) + DEVICE_VARIANT := 128M + DEVICE_DTS := qcom-ipq4019-r619ac-128m +endef +TARGET_DEVICES += p2w_r619ac-128m + define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP-DK01.1 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 5695b81da..6b6af5865 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 @@ -39,7 +39,6 @@ Signed-off-by: John Crispin qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ + qcom-ipq4019-c526a.dtb \ -+ qcom-ipq4019-c526a-128m.dtb \ + qcom-ipq4019-cm520-79f.dtb \ + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ @@ -52,6 +51,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-r619ac.dtb \ ++ qcom-ipq4019-r619ac-128m.dtb \ + qcom-ipq4019-rtl30vw.dtb \ + qcom-ipq4019-rt-acrh17.dtb \ + qcom-ipq4019-u4019-32m.dtb \