From d119cba48a46519fc5d7fbd3bf4c64e7a049fcf1 Mon Sep 17 00:00:00 2001 From: Dark4MD Date: Mon, 23 Aug 2021 14:37:45 +0200 Subject: [PATCH] JT-OR750i now Upstream --- ...and-16M-Variants-migration-to-ath79.patch} | 0 ...ric-Add-support-for-Joy-IT-JT-OR750i.patch | 386 ------------------ 2 files changed, 386 deletions(-) rename patches/{0004-added-TL-WR841ND-N-8M-and-16M-Variants-migration-to-ath79.patch => 0003-added-TL-WR841ND-N-8M-and-16M-Variants-migration-to-ath79.patch} (100%) delete mode 100644 patches/0003-ar71xx-generic-Add-support-for-Joy-IT-JT-OR750i.patch diff --git a/patches/0004-added-TL-WR841ND-N-8M-and-16M-Variants-migration-to-ath79.patch b/patches/0003-added-TL-WR841ND-N-8M-and-16M-Variants-migration-to-ath79.patch similarity index 100% rename from patches/0004-added-TL-WR841ND-N-8M-and-16M-Variants-migration-to-ath79.patch rename to patches/0003-added-TL-WR841ND-N-8M-and-16M-Variants-migration-to-ath79.patch diff --git a/patches/0003-ar71xx-generic-Add-support-for-Joy-IT-JT-OR750i.patch b/patches/0003-ar71xx-generic-Add-support-for-Joy-IT-JT-OR750i.patch deleted file mode 100644 index 47b9be5..0000000 --- a/patches/0003-ar71xx-generic-Add-support-for-Joy-IT-JT-OR750i.patch +++ /dev/null @@ -1,386 +0,0 @@ -From ca0ec7ffd9cc45a22f0dfbd1c1fedd89d0481936 Mon Sep 17 00:00:00 2001 -From: CodeFetch -Date: Sat, 2 Jan 2021 04:27:14 +0100 -Subject: [PATCH 1/1] ar71xx-generic: Add support for Joy-IT JT-OR750i - -Signed-off-by: aiyion.prime ---- - .../luasrc/lib/gluon/upgrade/010-primary-mac | 2 +- - ...1xx-Add-support-for-Joy-IT-JT-OR750i.patch | 331 ++++++++++++++++++ - targets/ar71xx-generic | 9 + - 3 files changed, 341 insertions(+), 1 deletion(-) - create mode 100644 patches/openwrt/0018-ar71xx-Add-support-for-Joy-IT-JT-OR750i.patch - -diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac -index 18694936..e03661a4 100755 ---- a/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac -+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/010-primary-mac -@@ -66,7 +66,7 @@ local primary_addrs = { - 'archer-c7', - 'archer-c7-v4', - 'archer-c7-v5', -- 'carambola2', -+ 'carambola2', 'jt-or750i', - 'koala', - 'mr600', - 'mr600v2', -diff --git a/patches/openwrt/0018-ar71xx-Add-support-for-Joy-IT-JT-OR750i.patch b/patches/openwrt/0018-ar71xx-Add-support-for-Joy-IT-JT-OR750i.patch -new file mode 100644 -index 00000000..615d236d ---- /dev/null -+++ b/patches/openwrt/0018-ar71xx-Add-support-for-Joy-IT-JT-OR750i.patch -@@ -0,0 +1,331 @@ -+From: CodeFetch -+Date: Sat, 2 Jan 2021 05:25:56 +0100 -+Subject: ar71xx: Add support for Joy-IT JT-OR750i -+ -+Signed-off-by: aiyion.prime -+ -+diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx -+index 04c986ee5805ffd5d1d9dfa8a6b3abb7e5309823..e97524864933e491647150de379c6799d03f3ce2 100644 -+--- a/package/boot/uboot-envtools/files/ar71xx -++++ b/package/boot/uboot-envtools/files/ar71xx -+@@ -38,6 +38,7 @@ gl-ar300m|\ -+ gl-ar750|\ -+ hornet-ub|\ -+ hornet-ub-x2|\ -++jt-or750i|\ -+ jwap230|\ -+ koala|\ -+ mr1750|\ -+diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds -+index bd589c1cff2e2c0bc477a6cfe1654395dfa43860..ff76d7f1452830d75184cb36124bb9dd1b9ae289 100755 -+--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds -++++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds -+@@ -111,14 +111,19 @@ n5q) -+ ;; -+ esac -+ ;; -+-archer-c25-v1) -++archer-c25-v1|\ -++jt-or750i) -+ ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0" -+- ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt" -+- ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt" -+ ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10" -+ ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08" -+ ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04" -+- ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02" -++ case "$board" in -++ archer-c25-v1) -++ ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02" -++ ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt" -++ ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt" -++ ;; -++ esac -+ ;; -+ archer-c5|\ -+ archer-c7) -+diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network -+index 44fce970c0fd8b4811242fac0b53764a09244a2f..48e34a90dc2c7a625f22d9565e419eb401ae6e08 100755 -+--- a/target/linux/ar71xx/base-files/etc/board.d/02_network -++++ b/target/linux/ar71xx/base-files/etc/board.d/02_network -+@@ -472,6 +472,7 @@ ar71xx_setup_interfaces() -+ ucidef_add_switch "switch0" \ -+ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth1" -+ ;; -++ jt-or750i|\ -+ routerstation-pro) -+ ucidef_set_interfaces_lan_wan "eth1.1" "eth0" -+ ucidef_add_switch "switch0" \ -+diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -+index 29bf2ada40a02fe06744296bb58d67e76332214d..5bff5102b748200c92baa84bcce028f0852cbe1f 100644 -+--- a/target/linux/ar71xx/base-files/etc/diag.sh -++++ b/target/linux/ar71xx/base-files/etc/diag.sh -+@@ -265,6 +265,9 @@ get_status_led() { -+ ja76pf2) -+ status_led="jjplus:green:led1" -+ ;; -++ jt-or750i) -++ status_led="$board:inv_red:status" -++ ;; -+ jwap230) -+ status_led="$board:green:led1" -+ ;; -+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 b7b7b3a7ba8495c6d4e9ebb492a493c19a49d619..1a29c2fdaf0a885495c5500baf04886c7367c2b5 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 -+@@ -76,6 +76,7 @@ case "$FIRMWARE" in -+ dlan-pro-1200-ac|\ -+ e1700ac-v2|\ -+ e600gac-v2|\ -++ jt-or750i|\ -+ minibox-v3.2|\ -+ oolite-v5.2|\ -+ oolite-v5.2-dev|\ -+diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -+index 044ef4eae5e1cd2f04bacc5b0c18a151f2fe1253..f5521ad2a07214cede4d937185c7d9b7dbdc542b 100755 -+--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -+@@ -974,6 +974,9 @@ ar71xx_board_detect() { -+ *"JA76PF2") -+ name="ja76pf2" -+ ;; -++ *"JT-OR750i") -++ name="jt-or750i" -++ ;; -+ *"JWAP003") -+ name="jwap003" -+ ;; -+diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+index f44cdb061f749ce9a4066fdcf6429670af1b8214..9cb851e7c31e146ecf14713cc7a07c4d5e4ec814 100755 -+--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -++++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+@@ -276,6 +276,7 @@ platform_check_image() { -+ gl-usb150|\ -+ hiwifi-hc6361|\ -+ hornet-ub-x2|\ -++ jt-or750i|\ -+ jwap230|\ -+ lbe-m5|\ -+ lima|\ -+diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14 -+index 9a524fae4316caa10431bd6b3b4dadbe8660f14c..a4ca5ff699f1e78b817922c24f5c4e72217f89de 100644 -+--- a/target/linux/ar71xx/config-4.14 -++++ b/target/linux/ar71xx/config-4.14 -+@@ -137,6 +137,7 @@ CONFIG_ATH79=y -+ # CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set -+ # CONFIG_ATH79_MACH_HORNET_UB is not set -+ # CONFIG_ATH79_MACH_JA76PF is not set -++# CONFIG_ATH79_MACH_JT_OR750I is not set -+ # CONFIG_ATH79_MACH_JWAP003 is not set -+ # CONFIG_ATH79_MACH_JWAP230 is not set -+ # CONFIG_ATH79_MACH_KOALA is not set -+diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt -+index 6fd78c46a09c40d82822c62b521486a22c5f27a6..a95698b4dba89a6502f0f67c85b012ab7756a301 100644 -+--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt -++++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt -+@@ -988,6 +988,17 @@ config ATH79_MACH_JA76PF -+ select ATH79_DEV_M25P80 -+ select ATH79_DEV_USB -+ -++config ATH79_MACH_JT_OR750I -++ bool "Joy-IT OR750i support" -++ select SOC_QCA953X -++ select ATH79_DEV_AP9X_PCI if PCI -++ select ARH79_DEV_ETH -++ select ARH79_DEV_GPIO_BUTTONS -++ select ATH79_DEV_LEDS_GPIO -++ select ATH79_DEV_M25P80 -++ select ATH79_DEV_USB -++ select ATH79_DEV_WMAC -++ -+ config ATH79_MACH_JWAP003 -+ bool "jjPlus JWAP003 board support" -+ select SOC_AR71XX -+diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile -+index 0265b3d818135b3917f221173c59a85cc8d6cdb7..a15b50ba394ec0d19fd68dbfddbb378e058561ac 100644 -+--- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile -++++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile -+@@ -147,6 +147,7 @@ obj-$(CONFIG_ATH79_MACH_HIVEAP_121) += mach-hiveap-121.o -+ obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361) += mach-hiwifi-hc6361.o -+ obj-$(CONFIG_ATH79_MACH_HORNET_UB) += mach-hornet-ub.o -+ obj-$(CONFIG_ATH79_MACH_JA76PF) += mach-ja76pf.o -++obj-$(CONFIG_ATH79_MACH_JT_OR750I) += mach-jt-or750i.o -+ obj-$(CONFIG_ATH79_MACH_JWAP003) += mach-jwap003.o -+ obj-$(CONFIG_ATH79_MACH_JWAP230) += mach-jwap230.o -+ obj-$(CONFIG_ATH79_MACH_KOALA) += mach-koala.o -+diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-jt-or750i.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-jt-or750i.c -+new file mode 100644 -+index 0000000000000000000000000000000000000000..7ce8abb4d21a3cbb61ecec784ae7f177505e1bca -+--- /dev/null -++++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-jt-or750i.c -+@@ -0,0 +1,122 @@ -++/* -++ * Joy-IT JT-OR750i board support -++ * -++ * Copyright (C) 2019 Vincent Wiemann -++ * -++ * This program is free software; you can redistribute it and/or modify it -++ * under the terms of the GNU General Public License version 2 as published -++ * by the Free Software Foundation. -++ */ -++ -++#include -++#include -++ -++#include -++#include -++ -++#include "common.h" -++#include "dev-eth.h" -++#include "dev-gpio-buttons.h" -++#include "dev-leds-gpio.h" -++#include "dev-m25p80.h" -++#include "dev-usb.h" -++#include "dev-wmac.h" -++#include "machtypes.h" -++#include "pci.h" -++ -++/* ath10k GPIO is not used as a WLAN-LED, but as a status LED with default -++ * state "on" together with the inverted red status LED for signalling e.g. -++ * failsafe mode -++ */ -++#define OR750I_GPIO_LED_STATUS_GREEN 506 -++#define OR750I_GPIO_LED_STATUS_RED 13 -++#define OR750I_GPIO_LED_LAN1 16 -++#define OR750I_GPIO_LED_LAN2 15 -++#define OR750I_GPIO_LED_LAN3 14 -++#define OR750I_GPIO_LED_WAN 4 -++ -++#define OR750I_GPIO_BTN_RESET 17 -++ -++#define OR750I_KEYS_POLL_INTERVAL 20 /* msec */ -++#define OR750I_KEYS_DEBOUNCE_INTERVAL (3 * OR750I_KEYS_POLL_INTERVAL) -++ -++#define OR750I_WMAC2G_CALDATA_OFFSET 0x1000 -++#define OR750I_WMAC5G_CALDATA_OFFSET 0x5000 -++ -++static struct gpio_led or750i_gpio_leds[] __initdata = { -++ { -++ .name = "jt-or750i:green:lan1", -++ .gpio = OR750I_GPIO_LED_LAN1, -++ .active_low = 1, -++ }, { -++ .name = "jt-or750i:green:lan2", -++ .gpio = OR750I_GPIO_LED_LAN2, -++ .active_low = 1, -++ }, { -++ .name = "jt-or750i:green:lan3", -++ .gpio = OR750I_GPIO_LED_LAN3, -++ .active_low = 1, -++ }, { -++ .name = "jt-or750i:green:wan", -++ .gpio = OR750I_GPIO_LED_WAN, -++ .active_low = 1, -++ }, { /* Inverted active_low, because a red status LED looks broken */ -++ .name = "jt-or750i:inv_red:status", -++ .gpio = OR750I_GPIO_LED_STATUS_RED, -++ .active_low = 0, -++ .default_state = 0, -++ } -++}; -++ -++static struct gpio_keys_button or750i_gpio_keys[] __initdata = { -++ { -++ .desc = "reset", -++ .type = EV_KEY, -++ .code = KEY_RESTART, -++ .debounce_interval = OR750I_KEYS_DEBOUNCE_INTERVAL, -++ .gpio = OR750I_GPIO_BTN_RESET, -++ .active_low = 1, -++ } -++}; -++ -++static void __init or750i_setup(void) -++{ -++ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); -++ -++ ath79_register_m25p80(NULL); -++ -++ ath79_setup_ar933x_phy4_switch(false, false); -++ -++ ath79_register_mdio(0, 0x0); -++ -++ /* WAN */ -++ ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); -++ ath79_eth0_data.duplex = DUPLEX_FULL; -++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; -++ ath79_eth0_data.phy_mask = BIT(4); -++ ath79_eth0_data.speed = SPEED_100; -++ ath79_register_eth(0); -++ -++ /* LAN */ -++ ath79_init_mac(ath79_eth1_data.mac_addr, art + 6, 0); -++ ath79_eth1_data.duplex = DUPLEX_FULL; -++ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; -++ ath79_switch_data.phy4_mii_en = 1; -++ ath79_switch_data.phy_poll_mask |= BIT(4); -++ ath79_register_eth(1); -++ -++ ath79_register_gpio_keys_polled(-1, OR750I_KEYS_POLL_INTERVAL, -++ ARRAY_SIZE(or750i_gpio_keys), -++ or750i_gpio_keys); -++ -++ ath79_register_leds_gpio(-1, ARRAY_SIZE(or750i_gpio_leds), -++ or750i_gpio_leds); -++ -++ ath79_register_usb(); -++ -++ ath79_register_wmac(art + OR750I_WMAC2G_CALDATA_OFFSET, NULL); -++ -++ ath79_register_pci(); -++} -++ -++MIPS_MACHINE(ATH79_MACH_JT_OR750I, "JT-OR750I", "Joy-IT JT-OR750i", or750i_setup); -+diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h -+index 900b4ec87b1b8a3bf6def552974ce930df750acd..f704b7e0bf3ec2e13bef99cef2612813bcaeb432 100644 -+--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h -++++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h -+@@ -149,6 +149,7 @@ enum ath79_mach_type { -+ ATH79_MACH_HORNET_UB, /* ALFA Networks Hornet-UB */ -+ ATH79_MACH_JA76PF, /* jjPlus JA76PF */ -+ ATH79_MACH_JA76PF2, /* jjPlus JA76PF2 */ -++ ATH79_MACH_JT_OR750I, /* Joy-IT JT-OR750i */ -+ ATH79_MACH_JWAP003, /* jjPlus JWAP003 */ -+ ATH79_MACH_JWAP230, /* jjPlus JWAP230 */ -+ ATH79_MACH_KOALA, /* OCEDO Koala */ -+diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default -+index 25b58ae91e9919fce6f63f9b8fb2adef8239ef82..cd7dbe002e5c1ab0a717ef8956e7eca11084e755 100644 -+--- a/target/linux/ar71xx/generic/config-default -++++ b/target/linux/ar71xx/generic/config-default -+@@ -105,6 +105,7 @@ CONFIG_ATH79_MACH_GS_OOLITE_V5_2=y -+ CONFIG_ATH79_MACH_HIWIFI_HC6361=y -+ CONFIG_ATH79_MACH_HORNET_UB=y -+ CONFIG_ATH79_MACH_JA76PF=y -++CONFIG_ATH79_MACH_JT_OR750I=y -+ CONFIG_ATH79_MACH_JWAP003=y -+ CONFIG_ATH79_MACH_JWAP230=y -+ CONFIG_ATH79_MACH_KOALA=y -+diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk -+index 7347b21cfe98929ad9ae49a06c4786cedb24f907..d41ce99182015a75bc019a2e843ba3ced2e3f592 100644 -+--- a/target/linux/ar71xx/image/generic.mk -++++ b/target/linux/ar71xx/image/generic.mk -+@@ -543,6 +543,18 @@ define Device/gl-usb150 -+ endef -+ TARGET_DEVICES += gl-usb150 -+ -++define Device/jt-or750i -++ DEVICE_TITLE := Joy-IT JT-OR750i -++ DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 kmod-usb-core kmod-usb2 -++ BOARDNAME := JT-OR750I -++ IMAGE_SIZE := 16000k -++ MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro -++ SUPPORTED_DEVICES := jt-or750i -++ IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\ -++ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) -++endef -++TARGET_DEVICES += jt-or750i -++ -+ define Device/lan-turtle -+ $(Device/tplink-16mlzma) -+ DEVICE_TITLE := Hak5 LAN Turtle -diff --git a/targets/ar71xx-generic b/targets/ar71xx-generic -index df7dbd97..4967a75e 100644 ---- a/targets/ar71xx-generic -+++ b/targets/ar71xx-generic -@@ -131,6 +131,15 @@ device('gl.inet-gl-usb150', 'gl-usb150', { - }) - - -+-- Joy-IT -+ -+device('joy-it-jt-or750i', 'jt-or750i', { -+ factory = false, -+ packages = ATH10K_PACKAGES_QCA9887, -+}) -+ -+ -+ - -- Linksys by Cisco - - device('linksys-wrt160nl', 'wrt160nl', { --- -2.29.2 -