From fa04fff88d5111cc727beae285bc52e0e2fc712d Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 17 Jun 2016 15:35:49 +0200 Subject: [PATCH] ar71xx-generic: Add support for OpenMesh MR1750v2 The new MR1750v2 device support is only available in LEDE master. The relevant patches have to backported to add support for them in Gluon Signed-off-by: Sven Eckelmann --- docs/index.rst | 2 +- .../files/lib/gluon/upgrade/010-primary-mac | 2 +- ...el-support-for-the-OpenMesh-MR1750v2.patch | 33 ++++++++++ ...ce-support-for-the-OpenMesh-MR1750v2.patch | 62 +++++++++++++++++++ ...sysupgrade-for-the-OpenMesh-MR1750v2.patch | 40 ++++++++++++ ...tchdog-add-OpenMesh-MR1750v2-support.patch | 21 +++++++ ...vtools-add-OpenMesh-MR1750v2-support.patch | 20 ++++++ ....bin-for-the-OpenMesh-MR1750v2-board.patch | 20 ++++++ ...x-add-MR1750v2-to-the-MR1750-profile.patch | 27 ++++++++ targets/ar71xx-generic/profiles.mk | 1 + 10 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch create mode 100644 patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch create mode 100644 patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch create mode 100644 patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch create mode 100644 patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch create mode 100644 patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch create mode 100644 patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch diff --git a/docs/index.rst b/docs/index.rst index c25ce8f8..42079ee5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -133,7 +133,7 @@ ar71xx-generic * OpenMesh - - MR1750 + - MR1750 (v1, v2) - MR600 (v1, v2) - MR900 (v1, v2) - OM2P (v1, v2) diff --git a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac index 849b7a34..75d60d16 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac +++ b/package/gluon-core/files/lib/gluon/upgrade/010-primary-mac @@ -27,7 +27,7 @@ if platform.match('ar71xx', 'generic', {'tl-wdr3600', 'tl-wdr4300'}) then elseif platform.match('ar71xx', 'generic', {'unifi-outdoor-plus', 'carambola2', 'mr600', 'mr600v2', 'mr900', 'mr900v2', - 'mr1750', + 'mr1750', 'mr1750v2', 'om2p', 'om2pv2', 'om2p-hs', 'om2p-hsv2', 'om2p-hsv3', 'om2p-lc', diff --git a/patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch new file mode 100644 index 00000000..1122b7b9 --- /dev/null +++ b/patches/openwrt/0103-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch @@ -0,0 +1,33 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:54 +0200 +Subject: ar71xx: add kernel support for the OpenMesh MR1750v2 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637058/ + +diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +index e3c04e7..18101ce 100644 +--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c ++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c +@@ -168,3 +168,4 @@ static void __init mr1750_setup(void) + } + + MIPS_MACHINE(ATH79_MACH_MR1750, "MR1750", "OpenMesh MR1750", mr1750_setup); ++MIPS_MACHINE(ATH79_MACH_MR1750V2, "MR1750v2", "OpenMesh MR1750v2", mr1750_setup); +diff --git a/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch b/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch +new file mode 100644 +index 0000000..de732ec +--- /dev/null ++++ b/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch +@@ -0,0 +1,10 @@ ++--- a/arch/mips/ath79/machtypes.h +++++ b/arch/mips/ath79/machtypes.h ++@@ -76,6 +76,7 @@ enum ath79_mach_type { ++ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ ++ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ ++ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ +++ ATH79_MACH_MR1750V2, /* OpenMesh MR1750v2 */ ++ ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ ++ ATH79_MACH_MR600, /* OpenMesh MR600 */ ++ ATH79_MACH_MR900, /* OpenMesh MR900 */ diff --git a/patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch new file mode 100644 index 00000000..3c99224d --- /dev/null +++ b/patches/openwrt/0104-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch @@ -0,0 +1,62 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:55 +0200 +Subject: ar71xx: add user-space support for the OpenMesh MR1750v2 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637059/ + +diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh +index aa02212..f182d60 100644 +--- a/target/linux/ar71xx/base-files/etc/diag.sh ++++ b/target/linux/ar71xx/base-files/etc/diag.sh +@@ -143,7 +143,8 @@ get_status_led() { + mr600v2) + status_led="mr600:blue:power" + ;; +- mr1750) ++ mr1750 | \ ++ mr1750v2) + status_led="mr1750:blue:power" + ;; + mr900 | \ +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index 5767f48..032acc9 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -243,7 +243,8 @@ mr600) + ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt" + ;; + +-mr1750) ++mr1750 | \ ++mr1750v2) + ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0" + ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt" + ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt" +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +index 89a2184..b8ae576 100755 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +@@ -335,6 +335,7 @@ eap7660d |\ + el-mini |\ + loco-m-xw |\ + mr1750 |\ ++mr1750v2 |\ + mr600 |\ + mr600v2 |\ + mr900 |\ +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index dc51b03..5119b36 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -568,6 +568,9 @@ ar71xx_board_detect() { + *MR1750) + name="mr1750" + ;; ++ *MR1750v2) ++ name="mr1750v2" ++ ;; + *MR600) + name="mr600" + ;; diff --git a/patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch new file mode 100644 index 00000000..51ba8566 --- /dev/null +++ b/patches/openwrt/0105-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch @@ -0,0 +1,40 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:56 +0200 +Subject: ar71xx: enable sysupgrade for the OpenMesh MR1750v2 + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637060/ + +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +index 0e8ea27..95d39bf 100644 +--- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +@@ -81,6 +81,7 @@ platform_check_image_openmesh() + ;; + MR1750) + [ "$board" = "mr1750" ] && break ++ [ "$board" = "mr1750v2" ] && break + echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" + return 1 + ;; +diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +index 9b26e73..f33419f 100755 +--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +@@ -298,6 +298,7 @@ platform_check_image() { + return 0; + ;; + mr1750 | \ ++ mr1750v2 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ +@@ -534,6 +535,7 @@ platform_do_upgrade() { + platform_do_upgrade_dir825b "$ARGV" + ;; + mr1750 | \ ++ mr1750v2 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ diff --git a/patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch b/patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch new file mode 100644 index 00000000..c5ee90df --- /dev/null +++ b/patches/openwrt/0106-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch @@ -0,0 +1,21 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:57 +0200 +Subject: package/om-watchdog: add OpenMesh MR1750v2 support + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637062/ + +diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init +index bf8a124..8a1b66e 100644 +--- a/package/kernel/om-watchdog/files/om-watchdog.init ++++ b/package/kernel/om-watchdog/files/om-watchdog.init +@@ -28,7 +28,7 @@ boot() { + "mr600v2") + service_start /sbin/om-watchdog 15 + ;; +- "mr900"|"mr900v2"|"mr1750") ++ "mr900"|"mr900v2"|"mr1750"|"mr1750v2") + service_start /sbin/om-watchdog 16 + ;; + esac diff --git a/patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch b/patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch new file mode 100644 index 00000000..5b51bfda --- /dev/null +++ b/patches/openwrt/0107-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch @@ -0,0 +1,20 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:58 +0200 +Subject: package/uboot-envtools: add OpenMesh MR1750v2 support + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637064/ + +diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx +index 81c6481..459e73d 100644 +--- a/package/boot/uboot-envtools/files/ar71xx ++++ b/package/boot/uboot-envtools/files/ar71xx +@@ -22,6 +22,7 @@ eap300v2 | \ + hornet-ub | \ + hornet-ub-x2 | \ + mr1750 | \ ++mr1750v2 | \ + mr600 | \ + mr600v2 | \ + mr900 | \ diff --git a/patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch b/patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch new file mode 100644 index 00000000..ad8aaca9 --- /dev/null +++ b/patches/openwrt/0108-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch @@ -0,0 +1,20 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:03:59 +0200 +Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh MR1750v2 board + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637063/ + +diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +index d925a85..0e93feb 100644 +--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata ++++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +@@ -72,6 +72,7 @@ case "$FIRMWARE" in + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ;; + mr1750 | \ ++ mr1750v2 | \ + om5p-acv2) + ath10kcal_extract "ART" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) diff --git a/patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch b/patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch new file mode 100644 index 00000000..dfcb7b43 --- /dev/null +++ b/patches/openwrt/0109-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch @@ -0,0 +1,27 @@ +From: Sven Eckelmann +Date: Fri, 20 May 2016 18:04:00 +0200 +Subject: ar71xx: add MR1750v2 to the MR1750 profile + +Signed-off-by: Sven Eckelmann + +Forwarded: https://patchwork.ozlabs.org/patch/637065/ + +diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk +index ddd3f8d..e245e6c 100644 +--- a/target/linux/ar71xx/generic/profiles/openmesh.mk ++++ b/target/linux/ar71xx/generic/profiles/openmesh.mk +@@ -61,12 +61,12 @@ endef + $(eval $(call Profile,MR900)) + + define Profile/MR1750 +- NAME:=OpenMesh MR1750 ++ NAME:=OpenMesh MR1750/MR1750v2 + PACKAGES:=kmod-ath9k kmod-ath10k ath10k-firmware-qca988x + endef + + define Profile/MR1750/Description +- Package set optimized for the OpenMesh MR1750. ++ Package set optimized for the OpenMesh MR1750/MR1750v2. + endef + + $(eval $(call Profile,MR1750)) diff --git a/targets/ar71xx-generic/profiles.mk b/targets/ar71xx-generic/profiles.mk index 88c6fc92..bf1d0114 100644 --- a/targets/ar71xx-generic/profiles.mk +++ b/targets/ar71xx-generic/profiles.mk @@ -313,6 +313,7 @@ $(eval $(call GluonModel,OMEGA,onion-omega,onion-omega)) # MR1750 $(eval $(call GluonProfile,MR1750,om-watchdog uboot-envtools kmod-ath10k ath10k-firmware-qca988x-ct)) $(eval $(call GluonModel,MR1750,mr1750,openmesh-mr1750)) +$(eval $(call GluonModelAlias,MR1750,openmesh-mr1750,openmesh-mr1750v2)) # MR600 $(eval $(call GluonProfile,MR600,om-watchdog uboot-envtools))