diff --git a/include/image-commands.mk b/include/image-commands.mk index eebc22d741f..7e4bcacafaf 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -633,6 +633,14 @@ define Build/sysupgrade-tar $@ endef +define Build/tplink-image-2022 + $(TOPDIR)/scripts/tplink-mkimage-2022.py \ + --create $@.new \ + --rootfs $@ \ + --support "$(TPLINK_SUPPORT_STRING)" + @mv $@.new $@ +endef + define Build/tplink-safeloader -$(STAGING_DIR_HOST)/bin/tplink-safeloader \ -B $(TPLINK_BOARD_ID) \ diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 1cda04d0c58..f034d0754cc 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .70 -LINUX_KERNEL_HASH-6.6.70 = 84d23ee07fb26febbcb6d1295ba15efdc67ac382b4137b2c8853146c10fd2f97 +LINUX_VERSION-6.6 = .71 +LINUX_KERNEL_HASH-6.6.71 = 219715ba2dcfa6539fba09ad3f9212772f3507189eb60d77f8e89b06c32e724e diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 61939be6de9..5b52c3b3959 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot -PKG_VERSION:=2024.07 +PKG_VERSION:=2025.01 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 @@ -17,7 +17,7 @@ PKG_SOURCE_URL:= \ https://ftp.denx.de/pub/u-boot \ https://mirror.cyberbits.eu/u-boot \ ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f +PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION) diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq60xx b/package/boot/uboot-envtools/files/qualcommax_ipq60xx index eec99ce8f97..77c96da24ac 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq60xx +++ b/package/boot/uboot-envtools/files/qualcommax_ipq60xx @@ -25,6 +25,10 @@ netgear,wax214) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" ;; +tplink,eap610-outdoor) + idx="$(find_mtd_index 0:appsblenv)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" yuncore,fap650) idx="$(find_mtd_index 0:appsblenv)" [ -n "$idx" ] && \ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 679a1442115..9821e39a85f 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -55,6 +55,7 @@ ALLWIFIBOARDS:= \ redmi_ax6 \ skspruce_wia3300-20 \ spectrum_sax1v1k \ + tplink_eap610-outdoor \ tplink_eap620hd-v1 \ tplink_eap660hd-v1 \ wallys_dr40x9 \ @@ -185,6 +186,7 @@ $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze)) $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) $(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20)) $(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K)) +$(eval $(call generate-ipq-wifi-package,tplink_eap610-outdoor,TPLink EAP610-Outdoor)) $(eval $(call generate-ipq-wifi-package,tplink_eap620hd-v1,TP-Link EAP620 HD v1)) $(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1)) $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 44c73586cac..58c18a9088b 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=https://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/patches/763-radius-wispr.patch b/package/network/services/hostapd/patches/763-radius-wispr.patch index da81a623e76..f5c4668e13b 100644 --- a/package/network/services/hostapd/patches/763-radius-wispr.patch +++ b/package/network/services/hostapd/patches/763-radius-wispr.patch @@ -36,7 +36,7 @@ sm->eap_if->aaaFail = true; --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h -@@ -95,6 +95,7 @@ struct sta_info { +@@ -94,6 +94,7 @@ struct sta_info { u8 supported_rates[WLAN_SUPP_RATES_MAX]; int supported_rates_len; u8 qosinfo; /* Valid when WLAN_STA_WMM is set */ diff --git a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch index cbd6298d9d3..f197b71bd7b 100644 --- a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch +++ b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch @@ -25,7 +25,7 @@ + --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h -@@ -408,23 +408,8 @@ int ap_sta_re_add(struct hostapd_data *h +@@ -409,23 +409,8 @@ int ap_sta_re_add(struct hostapd_data *h void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta); diff --git a/package/network/services/hostapd/patches/804-hostapd-Fix-clearing-up-settings-for-color-switch.patch b/package/network/services/hostapd/patches/804-hostapd-Fix-clearing-up-settings-for-color-switch.patch new file mode 100644 index 00000000000..87d68911c79 --- /dev/null +++ b/package/network/services/hostapd/patches/804-hostapd-Fix-clearing-up-settings-for-color-switch.patch @@ -0,0 +1,28 @@ +From 161327f91d956771996c96ea1b6e4e1cb8dc074c Mon Sep 17 00:00:00 2001 +From: Stone Zhang +Date: Mon, 14 Oct 2024 18:47:32 +0800 +Subject: [PATCH] hostapd: Fix clearing up settings for color switch + +Settings for color switch (struct cca_settings settings) +is used without zero clearing, which causes the member +settings->ubpr->unsol_bcast_probe_resp_intervalettings +to be a random value. It is againsts the NLA policy of +NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT and causes +BSS color switch failure. + +Fixes: 654d2395dddf ("BSS coloring: Handling of collision events and triggering CCA") +Signed-off-by: Stone Zhang +--- + src/ap/hostapd.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -4813,6 +4813,7 @@ static void hostapd_switch_color_timeout + struct cca_settings settings; + int ret; + ++ os_memset(&settings, 0, sizeof(settings)); + hostapd_cleanup_cca_params(bss); + bss->cca_color = r; + bss->cca_count = 10; diff --git a/scripts/tplink-mkimage-2022.py b/scripts/tplink-mkimage-2022.py new file mode 100755 index 00000000000..4db69409c9e --- /dev/null +++ b/scripts/tplink-mkimage-2022.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python3 + +'''A program for manipulating tplink2022 images. + +A tplink2022 is an image format encountered on TP-Link devices around the year +2022. This was seen at least on the EAP610-Outdoor. The format is a container +for a rootfs, and has optional fields for the "software" version. It also + requires a "support" string that describes the list of compatible devices. + +This module is intended for creating such images with an OpenWRT UBI image, but +also supports analysis and extraction of vendor images. Altough tplink2022 +images can be signed, this program does not support signing image. + +To get an explanation of the commandline arguments, run this program with the +"--help" argument. +''' + +import argparse +import hashlib +import os +import pprint +import struct + +def decode_header(datafile): + '''Read the tplink2022 image header anbd decode it into a dictionary''' + header = {} + fmt = '>2I' + + datafile.seek(0x1014) + raw_header = datafile.read(8) + fields = struct.unpack(fmt, raw_header) + + header['rootfs_size'] = fields[0] + header['num_items'] = fields[1] + header['items'] = [] + + rootfs = {} + rootfs['name'] = 'rootfs.ubi' + rootfs['offset'] = 0 + rootfs['size'] = header['rootfs_size'] + header['items'].append(rootfs) + + for _ in range(header['num_items']): + entry = datafile.read(0x2c) + fmt = '>I32s2I' + fields = struct.unpack(fmt, entry) + + section = {} + section['name'] = fields[1].decode("utf-8").rstrip('\0') + section['type'] = fields[0] + section['offset'] = fields[2] + section['size'] = fields[3] + header['items'].append(section) + return header + +def extract(datafile): + '''Extract the sections of the tplink2022 image to separate files''' + header = decode_header(datafile) + + pretty = pprint.PrettyPrinter(indent=4, sort_dicts=False) + pretty.pprint(header) + + for section in header['items']: + datafile.seek(0x1814 + section['offset']) + section_contents = datafile.read(section['size']) + + with open(f"{section['name']}.bin", 'wb') as section_file: + section_file.write(section_contents) + + with open('leftover.bin', 'wb') as extras_file: + extras_file.write(datafile.read()) + +def get_section_contents(section): + '''I don't remember what this does. It's been a year since I wrote this''' + if section.get('data'): + data = section['data'] + elif section.get('file'): + with open(section['file'], 'rb') as section_file: + data = section_file.read() + else: + data = bytes() + + if section['size'] != len(data): + raise ValueError("Wrong section size", len(data)) + + return data + +def write_image(output_image, header): + '''Write a tplink2022 image with the contents in the "header" dictionary''' + with open(output_image, 'w+b') as out_file: + # header MD5 + salt = [ 0x7a, 0x2b, 0x15, 0xed, + 0x9b, 0x98, 0x59, 0x6d, + 0xe5, 0x04, 0xab, 0x44, + 0xac, 0x2a, 0x9f, 0x4e + ] + + out_file.seek(4) + out_file.write(bytes(salt)) + + # unknown section + out_file.write(bytes([0xff] * 0x1000)) + + # Table of contents + raw_header = struct.pack('>2I', header['rootfs_size'], + header['num_items']) + out_file.write(raw_header) + + for section in header['items']: + if section['name'] == 'rootfs.ubi': + continue + + hdr = struct.pack('>I32s2I', + section.get('type', 0), + section['name'].encode('utf-8'), + section['offset'], + section['size'] + ) + + out_file.write(hdr) + + for section in header['items']: + out_file.seek(0x1814 + section['offset']) + out_file.write(get_section_contents(section)) + + size = out_file.tell() + + out_file.seek(4) + md5_sum = hashlib.md5(out_file.read()) + + out_file.seek(0) + out_file.write(struct.pack('>I16s', size, md5_sum.digest())) + +def encode_soft_verson(): + '''Not sure of the meaning of version. Also doesn't appear to be needed.''' + return struct.pack('>4B1I2I', 0xff, 1, 0 ,0, 0x2020202, 30000, 1) + +def create_image(output_image, root, support): + '''Create an image with a ubi "root" and a "support" string.''' + header = {} + + header['rootfs_size'] = os.path.getsize(root) + header['items'] = [] + + rootfs = {} + rootfs['name'] = 'rootfs.ubi' + rootfs['file'] = root + rootfs['offset'] = 0 + rootfs['size'] = header['rootfs_size'] + header['items'].append(rootfs) + + support_list = {} + support_list['name'] = 'support-list' + support_list['data'] = support.replace(" ", "\r\n").encode('utf-8') + support_list['offset'] = header['rootfs_size'] + support_list['size'] = len(support_list['data']) + header['items'].append(support_list) + + sw_version = {} + sw_version['name'] = 'soft-version' + sw_version['type'] = 1 + sw_version['data'] = encode_soft_verson() + sw_version['offset'] = support_list['offset'] + support_list['size'] + sw_version['size'] = len(sw_version['data']) + header['items'].append(sw_version) + + header['num_items'] = len(header['items']) - 1 + write_image(output_image, header) + +def main(args): + '''We support image analysis,extraction, and creation''' + if args.extract: + with open(args.image, 'rb') as image: + extract(image) + elif args.create: + if not args.rootfs or not args.support: + raise ValueError('To create an image, specify rootfs and support list') + create_image(args.image, args.rootfs, args.support) + else: + with open(args.image, 'rb') as image: + header = decode_header(image) + + pretty = pprint.PrettyPrinter(indent=4, sort_dicts=False) + pretty.pprint(header) + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='EAP extractor') + parser.add_argument('--info', action='store_true') + parser.add_argument('--extract', action='store_true') + parser.add_argument('--create', action='store_true') + parser.add_argument('image', type=str, + help='Name of image to create or decode') + parser.add_argument('--rootfs', type=str, + help='When creating an EAP image, UBI image with rootfs and kernel') + parser.add_argument('--support', type=str, + help='String for the "support-list" section') + + main(parser.parse_args()) diff --git a/target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch b/target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch index 7333ebbdf26..187715a5cc3 100644 --- a/target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch +++ b/target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch @@ -26,15 +26,15 @@ Signed-off-by: Christian Marangi const struct clk_ops pcie_ops; int (*hw_init)(struct platform_device *pdev, struct clk_hw_onecell_data *clk_data); -@@ -525,8 +526,6 @@ static void en7523_register_clocks(struc +@@ -504,8 +505,6 @@ static void en7523_register_clocks(struc + u32 rate; + int i; - hw = en7523_register_pcie_clk(dev, np_base); - clk_data->hws[EN7523_CLK_PCIE] = hw; -- - clk_data->num = EN7523_NUM_CLOCKS; - } - - static int en7523_clk_hw_init(struct platform_device *pdev, +- + for (i = 0; i < ARRAY_SIZE(en7523_base_clks); i++) { + const struct en_clk_desc *desc = &en7523_base_clks[i]; + u32 reg = desc->div_reg ? desc->div_reg : desc->base_reg; @@ -587,8 +586,6 @@ static void en7581_register_clocks(struc hw = en7523_register_pcie_clk(dev, base); diff --git a/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch b/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch index 24c4dbde786..d116bb9ee05 100644 --- a/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch +++ b/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch @@ -103,29 +103,27 @@ Signed-off-by: Christian Marangi host->bus_clk = devm_clk_get_optional(&pdev->dev, "bus_clk"); if (IS_ERR(host->bus_clk)) -@@ -2740,11 +2767,14 @@ static int msdc_drv_probe(struct platfor - goto host_free; +@@ -2731,10 +2758,13 @@ static int msdc_drv_probe(struct platfor + return PTR_ERR(host->pins_default); } - host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs"); - if (IS_ERR(host->pins_uhs)) { -- ret = PTR_ERR(host->pins_uhs); - dev_err(&pdev->dev, "Cannot find pinctrl uhs!\n"); -- goto host_free; +- return PTR_ERR(host->pins_uhs); + /* AN7581 doesn't have state_uhs pins */ + if (!device_is_compatible(&pdev->dev, "airoha,an7581-mmc")) { + host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs"); + if (IS_ERR(host->pins_uhs)) { -+ ret = PTR_ERR(host->pins_uhs); + dev_err(&pdev->dev, "Cannot find pinctrl uhs!\n"); -+ goto host_free; ++ return PTR_ERR(host->pins_uhs); + } } /* Support for SDIO eint irq ? */ -@@ -2825,6 +2855,12 @@ static int msdc_drv_probe(struct platfor +@@ -2815,6 +2845,12 @@ static int msdc_drv_probe(struct platfor dev_err(&pdev->dev, "Cannot ungate clocks!\n"); - goto release_mem; + goto release_clk; } + + /* AN7581 without regulator require tune to OCR values */ diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index fe1d3186cff..8e38c9f5fba 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -62,16 +62,26 @@ gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; }; }; + + reg_power_usb: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &usb { - dr_mode = "host"; status = "okay"; + + dr_mode = "host"; + vbus-supply = <®_power_usb>; }; &usb_phy { status = "okay"; - gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; }; &spi { diff --git a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts index a2b6edbd5e7..4a4f455acf0 100644 --- a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts +++ b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts @@ -29,12 +29,6 @@ gpio-export,name = "usb-alarm"; gpios = <&gpio 20 GPIO_ACTIVE_LOW>; }; - - usb-power { - gpio-export,name = "usb-power"; - gpio-export,output = <0>; - gpios = <&gpio 23 GPIO_ACTIVE_LOW>; - }; }; keys { @@ -57,6 +51,14 @@ linux,default-trigger = "phy0tpt"; }; }; + + reg_power_usb: regulator { + compatible = "regulator-fixed"; + regulator-name = "power_usb"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; }; ð0 { @@ -123,6 +125,8 @@ &usb { status = "okay"; + + vbus-supply = <®_power_usb>; }; &usb_phy { diff --git a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts index c2c54b46629..ee59cecabb3 100644 --- a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts +++ b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts @@ -36,6 +36,7 @@ sim-tray { label = "sim-tray"; + linux,input-type = ; linux,code = ; gpios = <&gpio 20 GPIO_ACTIVE_LOW>; debounce-interval = <60>; @@ -68,7 +69,7 @@ }; signal-strength-4 { - label = "green:signal-strength4"; + label = "green:signal-strength-4"; gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; }; @@ -82,6 +83,11 @@ gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; }; + 4g { + label = "green:4g"; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + lan { function = LED_FUNCTION_LAN; color = ; @@ -95,17 +101,6 @@ gpios = <&gpio 17 GPIO_ACTIVE_LOW>; /* GPIO 14 - ACTIVE HIGH for hwrev 0 */ }; - - /* 4G LED - GPIO21 ACTIVE_HIGH for RUT240 */ - }; - - reg_usb_vbus: reg_usb_vbus { - compatible = "regulator-fixed"; - regulator-name = "usb_vbus"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; - enable-active-high; }; }; @@ -193,19 +188,9 @@ &usb { dr_mode = "host"; - vbus-supply = <®_usb_vbus>; status = "okay"; }; -&gpio { - modem-power { - gpio-hog; - output-low; - gpios = <18 GPIO_ACTIVE_HIGH>; - line-name = "modem-power"; - }; -}; - &usb_phy { status = "okay"; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index d5b41dc0b80..fe71b7b3c40 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -48,6 +48,11 @@ dlink,dir-835-a1) librerouter,librerouter-v1) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "513" "0" ;; +teltonika,rut230-v1) + ucidef_add_gpio_switch "DOUT" "DOUT" "524" "0" + ucidef_add_gpio_switch "modem_pwr" "Modem power" "531" "1" + ucidef_add_gpio_switch "modem_rst" "Modem reset" "530" "0" + ;; teltonika,rut955) ucidef_add_gpio_switch "sim_sel" "SIM select" "542" "1" ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "543" "0" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 8c2e352edb2..b6084e137c9 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -3068,8 +3068,11 @@ define Device/teltonika_rut230-v1 DEVICE_VENDOR := Teltonika DEVICE_MODEL := RUT230 DEVICE_VARIANT := v1 - DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-acm kmod-usb-net-qmi-wwan \ - uqmi -uboot-envtools + DEVICE_ALT0_VENDOR := Teltonika + DEVICE_ALT0_MODEL := RUT240 + DEVICE_ALT0_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 kmod-usb-acm \ + kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi -uboot-envtools IMAGE_SIZE := 15552k TPLINK_HWID := 0x32200002 TPLINK_HWREV := 0x1 diff --git a/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch index b50e4b51a45..1c1b2f2ca1b 100644 --- a/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch +++ b/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch @@ -51,7 +51,7 @@ Signed-off-by: John Crispin obj-$(CONFIG_PHY_LPC18XX_USB_OTG) += phy-lpc18xx-usb-otg.o --- /dev/null +++ b/drivers/phy/phy-ar7100-usb.c -@@ -0,0 +1,127 @@ +@@ -0,0 +1,117 @@ +/* + * Copyright (C) 2018 John Crispin + * @@ -144,16 +144,6 @@ Signed-off-by: John Crispin + if (IS_ERR(priv->phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->phy), "failed to create PHY"); + -+ priv->gpio = of_get_named_gpio(pdev->dev.of_node, "gpios", 0); -+ if (gpio_is_valid(priv->gpio)) { -+ int ret = devm_gpio_request(&pdev->dev, priv->gpio, dev_name(&pdev->dev)); -+ if (ret) -+ return dev_err_probe(&pdev->dev, ret, "failed to request gpio"); -+ -+ gpio_export_with_name(gpio_to_desc(priv->gpio), 0, dev_name(&pdev->dev)); -+ gpio_set_value(priv->gpio, 1); -+ } -+ + phy_set_drvdata(priv->phy, priv); + + phy_provider = devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate); @@ -181,7 +171,7 @@ Signed-off-by: John Crispin +MODULE_LICENSE("GPL"); --- /dev/null +++ b/drivers/phy/phy-ar7200-usb.c -@@ -0,0 +1,120 @@ +@@ -0,0 +1,111 @@ +/* + * Copyright (C) 2015 Alban Bedel + * @@ -268,15 +258,6 @@ Signed-off-by: John Crispin + if (IS_ERR(priv->phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->phy), "failed to create PHY"); + -+ priv->gpio = of_get_named_gpio(pdev->dev.of_node, "gpios", 0); -+ if (gpio_is_valid(priv->gpio)) { -+ int ret = devm_gpio_request(&pdev->dev, priv->gpio, dev_name(&pdev->dev)); -+ if (ret) -+ return dev_err_probe(&pdev->dev, ret, "failed to request gpio"); -+ gpio_export_with_name(gpio_to_desc(priv->gpio), 0, dev_name(&pdev->dev)); -+ gpio_set_value(priv->gpio, 1); -+ } -+ + phy_set_drvdata(priv->phy, priv); + + phy_provider = devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate); 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 1ede544aacc..092f9da4407 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 @@ -43,6 +43,17 @@ preinit_set_mac_address() { ip link set dev sw-eth1 address "$base_mac" ip link set dev sw-eth2 address $(macaddr_add "$base_mac" 1) ;; + teltonika,rutx50) + # Vendor Bootloader removes nvmem-cells from partition, + # so this needs to be done here. + base_mac="$(mtd_get_mac_binary 0:CONFIG 0x0)" + ip link set dev eth0 address "$base_mac" + ip link set dev lan1 address "$base_mac" + ip link set dev lan2 address "$base_mac" + ip link set dev lan3 address "$base_mac" + ip link set dev lan4 address "$base_mac" + ip link set dev wan address "$(macaddr_add "$base_mac" 1)" + ;; zyxel,nbg6617) base_mac=$(cat /sys/class/net/eth0/address) ip link set dev eth0 address $(macaddr_add "$base_mac" 2) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-rutx50.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-rutx50.dts index 56d920a6dde..ae244bd126a 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-rutx50.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-rutx50.dts @@ -29,7 +29,7 @@ gpio_modem_power { gpio-export,name = "modem_power"; - gpio-export,output = <0>; + gpio-export,output = <1>; gpios = <&shift_io 9 GPIO_ACTIVE_HIGH>; }; @@ -103,11 +103,13 @@ led-10 { label = "green:wifi2g"; gpios = <&shift_io 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; }; led-11 { label = "green:wifi5g"; gpios = <&shift_io 13 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; }; }; diff --git a/target/linux/lantiq/image/tp-link_legacy.mk b/target/linux/lantiq/image/tp-link_legacy.mk index b76ce241691..099c942e947 100644 --- a/target/linux/lantiq/image/tp-link_legacy.mk +++ b/target/linux/lantiq/image/tp-link_legacy.mk @@ -36,6 +36,12 @@ define Device/tplink_tdw8980 $(Device/lantiqTpLink) DEVICE_MODEL := TD-W8980 DEVICE_VARIANT := v1 + DEVICE_ALT0_VENDOR := TP-LINK + DEVICE_ALT0_MODEL := TD-W9980 + DEVICE_ALT0_VARIANT := v1 + DEVICE_ALT1_VENDOR := TP-LINK + DEVICE_ALT1_MODEL := TD-W9980B + DEVICE_ALT1_VARIANT := v1 TPLINK_FLASHLAYOUT := 8Mltq TPLINK_HWID := 0x89800001 TPLINK_HWREV := 14 diff --git a/target/linux/lantiq/image/vr9.mk b/target/linux/lantiq/image/vr9.mk index 9afcc6d3a97..a020ec85f9b 100644 --- a/target/linux/lantiq/image/vr9.mk +++ b/target/linux/lantiq/image/vr9.mk @@ -292,6 +292,11 @@ define Device/bt_homehub-v5a DEVICE_VENDOR := British Telecom (BT) DEVICE_MODEL := Home Hub 5 DEVICE_VARIANT := Type A + DEVICE_ALT0_VENDOR := British Telecom (BT) + DEVICE_ALT0_MODEL := Business Hub 5 + DEVICE_ALT0_VARIANT := Type A + DEVICE_ALT1_VENDOR := Plusnet + DEVICE_ALT1_MODEL := Hub One BOARD_NAME := BTHOMEHUBV5A DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader \ kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic-openssl kmod-usb-dwc2 diff --git a/target/linux/lantiq/xrx200_legacy/config-6.6 b/target/linux/lantiq/xrx200_legacy/config-6.6 index c8650c4e87f..9bb65cff07d 100644 --- a/target/linux/lantiq/xrx200_legacy/config-6.6 +++ b/target/linux/lantiq/xrx200_legacy/config-6.6 @@ -1,4 +1,3 @@ -CONFIG_AT803X_PHY=y CONFIG_BLK_MQ_PCI=y CONFIG_CONTEXT_TRACKING=y CONFIG_CONTEXT_TRACKING_IDLE=y @@ -7,7 +6,6 @@ CONFIG_CPU_MIPSR2_IRQ_VI=y CONFIG_CPU_RMAP=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_ZSTD=y CONFIG_EXTRA_FIRMWARE="lantiq/xrx200_phy11g_a14.bin lantiq/xrx200_phy11g_a22.bin lantiq/xrx200_phy22f_a14.bin lantiq/xrx200_phy22f_a22.bin" @@ -17,7 +15,6 @@ CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y CONFIG_GRO_CELLS=y CONFIG_HWMON=y CONFIG_HW_RANDOM=y -CONFIG_ICPLUS_PHY=y CONFIG_IFX_VPE_EXT=y CONFIG_INPUT=y CONFIG_INPUT_EVDEV=y @@ -47,6 +44,7 @@ CONFIG_NET_SWITCHDEV=y CONFIG_NLS=y CONFIG_NR_CPUS=2 CONFIG_PADATA=y +CONFIG_PAHOLE_HAS_LANG_EXCLUDE=y CONFIG_PCI=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_LANTIQ=y @@ -57,7 +55,6 @@ CONFIG_PHY_LANTIQ_VRX200_PCIE=y CONFIG_POWER_RESET_GPIO=y CONFIG_POWER_SUPPLY=y CONFIG_POWER_SUPPLY_HWMON=y -CONFIG_QCOM_NET_PHYLIB=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_REGULATOR=y diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts new file mode 100644 index 00000000000..0808eb9557a --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000h-v1.dts @@ -0,0 +1,337 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include + +#include "mt7981.dtsi" + +/ { + model = "Cudy WR3000H v1"; + compatible = "cudy,wr3000h-v1", "mediatek,mt7981-spim-snand-rfb"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + phyreset { + gpio-export,name = "phyreset"; + gpio-export,output = <1>; + gpios = <&pio 3 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: led@0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + }; + + + led_internet { + function = LED_FUNCTION_WAN_ONLINE; + color = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led_wps { + function = LED_FUNCTION_WPS; + color = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led_wlan2g { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wlan5g { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_lan1 { + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + color = ; + gpios = <&pio 8 GPIO_ACTIVE_LOW>; + }; + + led_lan2 { + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led_lan3 { + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + color = ; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led_lan4 { + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + color = ; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + led_wan { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 0>; + label = "lan"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 1>; + label = "wan"; + }; + +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; + phy6: ethernet-phy@6 { + compatible = "ethernet-phy-ieee802.3-c22"; // [RTL8221B-VB-CG 2.5Gbps PHY (C22)] + reg = <6>; + phy-mode = "2500base-x"; + }; + +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "bdinfo"; + reg = <0x380000 0x0040000>; + read-only; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@3C0000 { + label = "FIP"; + reg = <0x3C0000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x5C0000 0x4000000>; + compatible = "linux,ubi"; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts b/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts index e805554a134..81634c7c08d 100644 --- a/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts +++ b/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts @@ -87,9 +87,8 @@ reset-post-delay-us = <1000000>; phy6: phy@6 { - compatible = "maxlinear,gpy211", "ethernet-phy-ieee802.3-c45"; + compatible = "ethernet-phy-ieee802.3-c45"; reg = <6>; - phy-mode = "2500base-x"; }; switch@1f { diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index c4a91279136..2c9ea422517 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -38,6 +38,14 @@ cudy,re3000-v1) cudy,wr3000-v1) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; +cudy,wr3000h-v1) + ucidef_set_led_netdev "lan1" "lan1" "white:lan-1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan2" "lan2" "white:lan-2" "lan2" "link tx rx" + ucidef_set_led_netdev "lan3" "lan3" "white:lan-3" "lan3" "link tx rx" + ucidef_set_led_netdev "lan4" "lan4" "white:lan-4" "lan4" "link tx rx" + ucidef_set_led_netdev "wan" "wan" "white:wan" "wan" "link tx rx" + ucidef_set_led_netdev "internet" "internet" "white:wan-online" "wan" "link" + ;; glinet,gl-x3000|\ glinet,gl-xe3000) ucidef_set_led_default "power" "POWER" "green:power" "1" diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 849d7953c47..a0495115e73 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -74,6 +74,7 @@ case "$board" in cudy,re3000-v1|\ cudy,tr3000-v1|\ cudy,wr3000s-v1|\ + cudy,wr3000h-v1|\ cudy,wr3000-v1) addr=$(mtd_get_mac_binary bdinfo 0xde00) # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 3bfed4f893a..e15d0369fd2 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -124,6 +124,10 @@ platform_do_upgrade() { CI_KERNPART="linux" nand_do_upgrade "$1" ;; + cudy,wr3000h-v1) + CI_UBIPART="ubi" + nand_do_upgrade "$1" + ;; cudy,re3000-v1|\ cudy,wr3000-v1|\ yuncore,ax835) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 678bb145214..04fc7cfce85 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -762,6 +762,23 @@ define Device/cudy_wr3000s-v1 endef TARGET_DEVICES += cudy_wr3000s-v1 +define Device/cudy_wr3000h-v1 + DEVICE_VENDOR := Cudy + DEVICE_MODEL := WR3000H + DEVICE_VARIANT := v1 + DEVICE_DTS := mt7981b-cudy-wr3000h-v1 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += R59 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +endef +TARGET_DEVICES += cudy_wr3000h-v1 + define Device/dlink_aquila-pro-ai-m30-a1 DEVICE_VENDOR := D-Link DEVICE_MODEL := AQUILA PRO AI M30 diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network index 680af1ce673..8cf1c0e4261 100644 --- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network @@ -13,7 +13,8 @@ mvebu_setup_interfaces() case "$board" in ctera,c200-v2|\ - synology,ds213j) + synology,ds213j|\ + wd,cloud-mirror-gen2) ucidef_set_interface_lan "eth0" "dhcp" ;; cznic,turris-omnia) @@ -94,6 +95,12 @@ mvebu_setup_macs() lan_mac=$label_mac wan_mac=$label_mac ;; + wd,cloud-mirror-gen2) + # mac address is on ubi "config" or ubi "reserve2" in text file. + # ubi "reserve2" /dev/mtd7 is twice small and only contains basic OEM factory info + label_mac=$(macaddr_canonicalize $(strings /dev/mtd7|grep -E '([0-9A-F]{2}[:])')) + lan_mac=$label_mac + ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh index 70678622d34..13d8e77c93c 100755 --- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh @@ -31,7 +31,8 @@ platform_do_upgrade() { CI_ROOT_UBIPART=ubi nand_do_upgrade "$1" ;; - buffalo,ls421de) + buffalo,ls421de|\ + wd,cloud-mirror-gen2) nand_do_upgrade "$1" ;; ctera,c200-v2) diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-wd_cloud-mirror-gen2.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-wd_cloud-mirror-gen2.dts new file mode 100644 index 00000000000..50936e72adf --- /dev/null +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-wd_cloud-mirror-gen2.dts @@ -0,0 +1,368 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Device Tree file for Western Digital My Cloud Mirror Gen 2 + * (BWVZ/Grand Teton) + * + * Copyright (C) 2020 + * + * Based on the code from: + * + * Copyright (C) 2019 Evgeny Kolesnikov + * Copyright (C) 2016 Martin Mueller + * Copyright (C) 2013 Gregory CLEMENT + * Copyright (C) 2014 Thomas Petazzoni + * + */ + +/dts-v1/; +#include +#include +#include +#include "armada-385.dtsi" + +/ { + model = "WD MyCloud Mirror Gen 2 (BWVZ/Grand Teton)"; + compatible = "wd,cloud-mirror-gen2", "marvell,armada385", "marvell,armada380"; + + aliases { + led-boot = &led_boot; + led-failsafe = &led_boot; + led-upgrade = &led_boot; + }; + + chosen { + stdout-path = "serial0:115200n8"; + append-rootblock = "nullparameter="; /* override the bootloader args */ + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x20000000>; /* 512 MB */ + }; + + soc { + ranges = ; + + internal-regs { + timer@c200 { + status = "okay"; + }; + + i2c0: i2c@11000 { + status = "okay"; + clock-frequency = <100000>; + }; + + i2c1: i2c@11100 { + status = "okay"; + clock-frequency = <100000>; + }; + + serial@12000 { + status = "okay"; + }; + + /* Connected to Welltrend 6703F-OG240WT MCU + * which controls power, fan and other things + */ + serial@12100 { + status = "okay"; + }; + + pinctrl@18000 { + /* use only one pin for UART1, as mpp20 is used by sata0 */ + uart1_pins: uart-pins-1 { + marvell,pins = "mpp19"; + marvell,function = "ua1"; + }; + + xhci0_vbus_pins: xhci0-vbus-pins { + marvell,pins = "mpp26"; + marvell,function = "gpio"; + }; + + xhci1_vbus_pins: xhci1-vbus-pins { + marvell,pins = "mpp27"; + marvell,function = "gpio"; + }; + + sata0_pins: sata-pins-0 { + marvell,pins = "mpp55"; + marvell,function = "sata0"; + }; + + sata1_pins: sata-pins-1 { + marvell,pins = "mpp56"; + marvell,function = "sata1"; + }; + + sata_leds: sata-leds { + marvell,pins = "mpp43", "mpp52", "mpp53", "mpp54"; + marvell,function = "gpio"; + }; + + btn_pins: btn-pins { + marvell,pins = "mpp50"; + marvell,function = "gpio"; + }; + }; + + usb@58000 { + status = "okay"; + }; + + phy: mdio@72004 { + phy0: ethernet-phy@0 { + /* Init ETH LEDs */ + marvell,reg-init = <3 16 0 0x101e>; + reg = <0>; + }; + }; + + sata@a8000 { + status = "okay"; + }; + + nand-controller@d0000 { + status = "okay"; + + nand: nand@0 { + reg = <0>; + label = "pxa3xx_nand-0"; + nand-rb = <0>; + marvell,nand-keep-config; + #marvell,nand-enable-arbiter; //optional + nand-on-flash-bbt; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@00000000 { + label = "U-Boot"; + reg = <0x00000000 0x00500000>; /* 5 MB */ + read-only; + }; + + partition@00500000 { + label = "kernel"; + reg = <0x00500000 0x00500000>; /* 5 MB */ + }; + + partition@00a00000 { + label = "uRamdisk"; + reg = <0x00a00000 0x00500000>; /* 5 MB */ + read-only; + }; + + partition@00f00000 { + label = "ubi"; + reg = <0x00f00000 0x0b900000>; /* 185 MB */ + }; + + partition@c800000 { + label = "rescue fw"; + reg = <0x0c800000 0x00f00000>; /* 15 MB */ + read-only; + }; + + partition@d70000 { + label = "config"; + reg = <0x0d700000 0x01400000>; /* 20 MB */ + read-only; + }; + + partition@eb00000 { + label = "reserve1"; + reg = <0x0eb00000 0x00a00000>; /* 10 MB */ + read-only; + }; + + partition@f500000 { + label = "reserve2"; + reg = <0x0f500000 0x00a00000>; /* 10 MB */ + read-only; + }; + }; + }; + }; + + usb3@f0000 { + usb-phy = <&usb3_0_phy>; + status = "okay"; + }; + + usb3@f8000 { + usb-phy = <&usb3_1_phy>; + status = "okay"; + }; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&sata_leds>; + + led_boot: s1red { + label = "red:hdd1"; + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + s2red { + label = "red:hdd2"; + gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>; + }; + s1blue { + label = "blue:hdd1"; + gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "ata1"; + }; + s2blue { + label = "blue:hdd2"; + gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; + linux,default-trigger = "ata2"; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&btn_pins>; + + reset { + label = "reset"; + linux,code = ; // Restart=0x198, Power=0x116 + gpios = <&gpio1 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + wakeup-source; + }; + }; + + usb3_0_phy: usb3_0_phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <®_usb3_0_vbus>; + }; + + usb3_1_phy: usb3_1_phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <®_usb3_1_vbus>; + }; + + reg_usb3_0_vbus: usb3-vbus0 { + compatible = "regulator-fixed"; + regulator-name = "usb3-vbus0"; + pinctrl-names = "default"; + pinctrl-0 = <&xhci0_vbus_pins>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + gpio = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + reg_usb3_1_vbus: usb3-vbus1 { + compatible = "regulator-fixed"; + regulator-name = "usb3-vbus1"; + pinctrl-names = "default"; + pinctrl-0 = <&xhci1_vbus_pins>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + gpio = <&gpio0 27 GPIO_ACTIVE_HIGH>; + }; + + reg_sata0: pwr-sata0 { + compatible = "regulator-fixed"; + regulator-name = "pwr_en_sata0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + enable-active-high; + regulator-boot-on; + gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>; + }; + + reg_5v_sata0: v5-sata0 { + compatible = "regulator-fixed"; + regulator-name = "v5.0-sata0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_sata0>; + }; + + reg_12v_sata0: v12-sata0 { + compatible = "regulator-fixed"; + regulator-name = "v12.0-sata0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + vin-supply = <®_sata0>; + }; + + reg_sata1: pwr-sata1 { + compatible = "regulator-fixed"; + regulator-name = "pwr_en_sata1"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + enable-active-high; + regulator-boot-on; + gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>; + }; + + reg_5v_sata1: v5-sata1 { + compatible = "regulator-fixed"; + regulator-name = "v5.0-sata1"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_sata1>; + }; + + reg_12v_sata1: v12-sata1 { + compatible = "regulator-fixed"; + regulator-name = "v12.0-sata1"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + vin-supply = <®_sata1>; + }; +}; + +&bm { + status = "okay"; +}; + +&bm_bppi { + status = "okay"; +}; + +ð2 { + status = "okay"; + phy = <&phy0>; + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <0>; + bm,pool-short = <1>; +}; + +&ahci0 { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + sata-port@0 { + reg = <0>; + target-supply = <®_sata0>; + #thermal-sensor-cells = <0>; + }; + + sata-port@1 { + reg = <1>; + target-supply = <®_sata1>; + #thermal-sensor-cells = <1>; + }; +}; diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 1caee943330..1b6b67d2bf8 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -448,3 +448,20 @@ define Device/synology_ds213j -ppp -kmod-nft-offload -dnsmasq -odhcpd-ipv6only endef TARGET_DEVICES += synology_ds213j + +define Device/wd_cloud-mirror-gen2 + $(Device/NAND-128K) + DEVICE_VENDOR := Western Digital + DEVICE_MODEL := MyCloud Mirror Gen 2 (BWVZ/Grand Teton) + DEVICE_PACKAGES += -uboot-envtools coreutils-stty mkf2fs e2fsprogs \ + partx-utils kmod-hwmon-drivetemp -ppp -kmod-nft-offload -dnsmasq \ + -odhcpd-ipv6only + DEVICE_DTS := armada-385-wd_cloud-mirror-gen2 + KERNEL_SIZE := 5120k + KERNEL := kernel-bin | append-dtb | uImage none + KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none + IMAGES += image-cfs-factory.bin uImage-factory.bin + IMAGE/image-cfs-factory.bin := append-ubi + IMAGE/uImage-factory.bin := append-kernel +endef +TARGET_DEVICES += wd_cloud-mirror-gen2 diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-eap610-outdoor.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-eap610-outdoor.dts new file mode 100644 index 00000000000..165fc3ef1b1 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-eap610-outdoor.dts @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq6018.dtsi" +#include "ipq6018-cp-cpu.dtsi" +#include "ipq6018-ess.dtsi" + +#include +#include +#include + +/ { + model = "TP-Link EAP610-Outdoor"; + compatible = "tplink,eap610-outdoor", "qcom,ipq6018"; + + aliases { + serial0 = &blsp1_uart3; + led-boot = &led_sys_green; + led-failsafe = &led_sys_amber; + led-running = &led_sys_green; + led-upgrade = &led_sys_amber; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " ubi.block=0,rootfs root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys_amber: led-0 { + function = "system"; + color = ; + gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; + }; + + led_sys_green: led-1 { + function = "system"; + color = ; + gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-restart { + compatible = "gpio-restart"; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + open-source; + }; +}; + +&blsp1_uart3 { + pinctrl-0 = <&serial_3_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio64"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio65"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + led_enable { + gpio-hog; + output-high; + gpios = <36 GPIO_ACTIVE_HIGH>; + line-name = "enable-leds"; + }; +}; + +&dp5 { + phy-handle = <&rtl8211f_4>; + phy-mode = "sgmii"; + label = "lan"; + status = "okay"; +}; + +&edma { + status = "okay"; +}; + +&mdio { + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 77 GPIO_ACTIVE_LOW>; + reset-delay-us = <10000>; + reset-post-delay-us = <50000>; + status = "okay"; + + rtl8211f_4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch { + switch_lan_bmp = ; + switch_mac_mode1 = ; + status = "okay"; + + qcom,port_phyinfo { + port@4 { + port_id = <5>; + phy_address = <4>; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + }; +}; + +&wifi { + ieee80211-freq-limit = <2402000 5835000>; + qcom,ath11k-calibration-variant = "TP-Link-EAP610-Outdoor"; + status = "okay"; +}; diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk index 0b7cd413c36..c7e0be1181e 100644 --- a/target/linux/qualcommax/image/ipq60xx.mk +++ b/target/linux/qualcommax/image/ipq60xx.mk @@ -68,6 +68,24 @@ define Device/qihoo_360v6 endef TARGET_DEVICES += qihoo_360v6 +define Device/tplink_eap610-outdoor + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := EAP610-Outdoor + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := ipq6018 + DEVICE_PACKAGES := ipq-wifi-tplink_eap610-outdoor + IMAGES += web-ui-factory.bin + IMAGE/web-ui-factory.bin := append-ubi | tplink-image-2022 + TPLINK_SUPPORT_STRING := SupportList: \ + EAP610-Outdoor(TP-Link|UN|AX1800-D):1.0 \ + EAP610-Outdoor(TP-Link|JP|AX1800-D):1.0 \ + EAP610-Outdoor(TP-Link|CA|AX1800-D):1.0 +endef +TARGET_DEVICES += tplink_eap610-outdoor + define Device/yuncore_fap650 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network index ecc9e57117b..44c0ba7049e 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network @@ -23,6 +23,9 @@ ipq60xx_setup_interfaces() qihoo,360v6) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; + tplink,eap610-outdoor) + ucidef_set_interface_lan "lan" "dhcp" + ;; linksys,mr7350|\ yuncore,fap650) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" @@ -51,6 +54,10 @@ ipq60xx_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) label_mac=$lan_mac ;; + tplink,eap610-outdoor) + label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0) + lan_mac=$label_mac + ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 3380cc8653f..cf3e400586b 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -32,6 +32,13 @@ case "$FIRMWARE" in ath11k_patch_mac $(macaddr_add $label_mac 2) 1 ath11k_set_macflag ;; + tplink,eap610-outdoor) + caldata_from_file "/tmp/factory_data/radio" 0 0x10000 + label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0) + ath11k_patch_mac $label_mac 1 + ath11k_patch_mac $(macaddr_add $label_mac 1) 0 + ath11k_set_macflag + ;; yuncore,fap650) caldata_extract "0:art" 0x1000 0x20000 ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/preinit/09_mount_factory_data b/target/linux/qualcommax/ipq60xx/base-files/lib/preinit/09_mount_factory_data new file mode 100644 index 00000000000..97608db55dd --- /dev/null +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/preinit/09_mount_factory_data @@ -0,0 +1,19 @@ +#!/bin/sh + +preinit_mount_factory_data() { + local mtd_path + + . /lib/functions.sh + . /lib/functions/system.sh + + case $(board_name) in + tplink,eap610-outdoor) + mtd_path=$(find_mtd_chardev "factory_data") + ubiattach --dev-path="$mtd_path" --devn=1 + mkdir /tmp/factory_data + mount -o ro,noatime -t ubifs ubi1:ubi_factory_data /tmp/factory_data + ;; + esac +} + +boot_hook_add preinit_main preinit_mount_factory_data diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh index 411570715c2..f9d446ff1f7 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh @@ -4,6 +4,79 @@ REQUIRE_IMAGE_METADATA=1 RAMFS_COPY_BIN='fw_printenv fw_setenv head' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' +remove_oem_ubi_volume() { + local oem_volume_name="$1" + local oem_ubivol + local mtdnum + local ubidev + + mtdnum=$(find_mtd_index "$CI_UBIPART") + if [ ! "$mtdnum" ]; then + return + fi + + ubidev=$(nand_find_ubi "$CI_UBIPART") + if [ ! "$ubidev" ]; then + ubiattach --mtdn="$mtdnum" + ubidev=$(nand_find_ubi "$CI_UBIPART") + fi + + if [ "$ubidev" ]; then + oem_ubivol=$(nand_find_volume "$ubidev" "$oem_volume_name") + [ "$oem_ubivol" ] && ubirmvol "/dev/$ubidev" --name="$oem_volume_name" + fi +} + +tplink_get_boot_part() { + local cur_boot_part + local args + + # Try to find rootfs from kernel arguments + read -r args < /proc/cmdline + for arg in $args; do + local ubi_mtd_arg=${arg#ubi.mtd=} + case "$ubi_mtd_arg" in + rootfs|rootfs_1) + echo "$ubi_mtd_arg" + return + ;; + esac + done + + # Fallback to u-boot env (e.g. when running initramfs) + cur_boot_part="$(/usr/sbin/fw_printenv -n tp_boot_idx)" + case $cur_boot_part in + 1) + echo rootfs_1 + ;; + 0|*) + echo rootfs + ;; + esac +} + +tplink_do_upgrade() { + local new_boot_part + + case $(tplink_get_boot_part) in + rootfs) + CI_UBIPART="rootfs_1" + new_boot_part=1 + ;; + rootfs_1) + CI_UBIPART="rootfs" + new_boot_part=0 + ;; + esac + + fw_setenv -s - <<-EOF + tp_boot_idx $new_boot_part + EOF + + remove_oem_ubi_volume ubi_rootfs + nand_do_upgrade "$1" +} + platform_check_image() { return 0; } @@ -55,6 +128,9 @@ platform_do_upgrade() { qihoo,360v6) nand_do_upgrade "$1" ;; + tplink,eap610-outdoor) + tplink_do_upgrade "$1" + ;; yuncore,fap650) [ "$(fw_printenv -n owrt_env_ver 2>/dev/null)" != "7" ] && yuncore_fap650_env_setup local active="$(fw_printenv -n owrt_slotactive 2>/dev/null)" diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts index 4b124c92954..af6292980b8 100644 --- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts @@ -30,18 +30,21 @@ }; internet { - label = "green:internet"; + function = LED_FUNCTION_WAN; + color = ; gpios = <&gpio 38 GPIO_ACTIVE_LOW>; }; wifi2 { - label = "green:wifi2"; + function = LED_FUNCTION_WLAN_2GHZ; + color = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; wifi5 { - label = "green:wifi5"; + function = LED_FUNCTION_WLAN_5GHZ; + color = ; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1711.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1711.dts new file mode 100644 index 00000000000..c0350eb4942 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1711.dts @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "mt7628an.dtsi" + +#include +#include +#include + +/ { + compatible = "keenetic,kn-1711", "mediatek,mt7628an-soc"; + model = "Keenetic KN-1711"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + regulator-usb { + compatible = "regulator-fixed"; + regulator-name = "USB-power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + internet { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + }; + + wifi2 { + function = LED_FUNCTION_WLAN_2GHZ; + color = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wifi5 { + function = LED_FUNCTION_WLAN_5GHZ; + color = ; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + + keys { + compatible = "gpio-keys"; + + fn { + label = "fn"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "restart"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0 0x1CC0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2s", "i2c", "gpio", "refclk", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <104000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "rf-eeprom"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; + }; + + firmware1: partition@50000 { + label = "firmware_1"; + reg = <0x50000 0xe60000>; + }; + + partition@eb0000 { + label = "config_1"; + reg = <0xeb0000 0x40000>; + read-only; + }; + + partition@ef0000 { + label = "storage"; + reg = <0xef0000 0x100000>; + read-only; + }; + + partition@ff0000 { + label = "dump"; + reg = <0xff0000 0x10000>; + read-only; + }; + + partition@1000000 { + label = "u-state"; + reg = <0x1000000 0x30000>; + read-only; + }; + + partition@1030000 { + label = "u-config_res"; + reg = <0x1030000 0x10000>; + read-only; + }; + + partition@1040000 { + label = "rf-eeprom_res"; + reg = <0x1040000 0x10000>; + read-only; + }; + + firmware2: partition@1050000 { + label = "firmware_2"; + reg = <0x1050000 0xe60000>; + }; + + partition@1EB0000 { + label = "Config_2"; + reg = <0x1eb0000 0x40000>; + read-only; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x3e>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_400>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts index 972c88eadd0..84127a88e04 100644 --- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts @@ -27,6 +27,7 @@ regulator-max-microvolt = <5000000>; gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-always-on; }; leds { @@ -44,17 +45,18 @@ gpios = <&gpio 38 GPIO_ACTIVE_LOW>; }; - fn { - function = LED_FUNCTION_USB; + wifi2 { + function = LED_FUNCTION_WLAN_2GHZ; color = ; gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; }; - wifi { - function = LED_FUNCTION_WLAN; + wifi5 { + function = LED_FUNCTION_WLAN_5GHZ; color = ; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt","phy1tpt"; + linux,default-trigger = "phy1tpt"; }; }; @@ -93,7 +95,7 @@ partition@0 { compatible = "denx,uimage"; label = "firmware"; - reg = <0x0 0x1CC0000>; + reg = <0x0 0x1cc0000>; }; }; }; @@ -160,21 +162,21 @@ reg = <0x50000 0xe60000>; }; - partition@EB0000 { + partition@eb0000 { label = "config_1"; - reg = <0xEB0000 0x40000>; + reg = <0xeb0000 0x40000>; read-only; }; - partition@EF0000 { + partition@ef0000 { label = "storage"; - reg = <0xEF0000 0x100000>; + reg = <0xef0000 0x100000>; read-only; }; - partition@FF0000 { + partition@ff0000 { label = "dump"; - reg = <0xFF0000 0x10000>; + reg = <0xff0000 0x10000>; read-only; }; @@ -198,12 +200,12 @@ firmware2: partition@1050000 { label = "firmware_2"; - reg = <0x1050000 0xE60000>; + reg = <0x1050000 0xe60000>; }; - partition@1EB0000 { + partition@1eb0000 { label = "Config_2"; - reg = <0x1EB0000 0x40000>; + reg = <0x1eb0000 0x40000>; read-only; }; }; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 20db6a0d5a9..1a2c17066c7 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -367,6 +367,18 @@ define Device/keenetic_kn-1613 endef TARGET_DEVICES += keenetic_kn-1613 +define Device/keenetic_kn-1711 + BLOCKSIZE := 64k + IMAGE_SIZE := 13434880 + DEVICE_VENDOR := Keenetic + DEVICE_MODEL := KN-1711 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb2 + IMAGES += factory.bin + IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to $$$$(BLOCKSIZE) | \ + check-size | zyimage -d 0x801711 -v "KN-1711" +endef +TARGET_DEVICES += keenetic_kn-1711 + define Device/keenetic_kn-1713 BLOCKSIZE := 64k IMAGE_SIZE := 13434880 diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index e13c5db50e6..b87062ae3c5 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -59,8 +59,9 @@ hiwifi,hc5761a) ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x10" ;; keenetic,kn-1613|\ +keenetic,kn-1711|\ keenetic,kn-1713) - ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x01" + ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x01" ;; mediatek,linkit-smart-7688) ucidef_set_led_wlan "wifi" "wifi" "orange:wifi" "phy0tpt" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 994ed0009b5..496bb809ef9 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -45,6 +45,7 @@ ramips_setup_interfaces() hilink,hlk-7628n|\ hilink,hlk-7688a|\ hiwifi,hc5861b|\ + keenetic,kn-1711|\ kroks,kndrt31r16|\ skylab,skw92a|\ tplink,archer-c20-v4|\ diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/04_led_migration b/target/linux/ramips/mt76x8/base-files/etc/board.d/04_led_migration new file mode 100644 index 00000000000..c845fadd734 --- /dev/null +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/04_led_migration @@ -0,0 +1,16 @@ +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +keenetic,kn-1613) + migrate_leds 'green:internet=green:wan' + ;; +esac + +remove_devicename_leds + +migrations_apply system + +exit 0 diff --git a/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi b/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi index 262dd83d21c..ddd46c4cf64 100644 --- a/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi +++ b/target/linux/realtek/dts/rtl8380_hpe_1920-8g.dtsi @@ -4,13 +4,6 @@ #include "rtl83xx_hpe_1920.dtsi" / { - gpio1: rtl8231-gpio { - compatible = "realtek,rtl8231-gpio"; - #gpio-cells = <2>; - gpio-controller; - indirect-access-bus-id = <0>; - }; - i2c0: i2c-gpio-0 { compatible = "i2c-gpio"; sda-gpios = <&gpio1 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; @@ -46,6 +39,24 @@ }; }; +&mdio_aux { + status = "okay"; + + gpio1: expander@0 { + compatible = "realtek,rtl8231"; + reg = <0>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&gpio1 0 0 37>; + + led-controller { + compatible = "realtek,rtl8231-leds"; + status = "disabled"; + }; + }; +}; + ðernet0 { mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; diff --git a/target/linux/realtek/dts/rtl8382_hpe_1920.dtsi b/target/linux/realtek/dts/rtl8382_hpe_1920.dtsi index af168067d4d..20d8693a3be 100644 --- a/target/linux/realtek/dts/rtl8382_hpe_1920.dtsi +++ b/target/linux/realtek/dts/rtl8382_hpe_1920.dtsi @@ -4,12 +4,6 @@ #include "rtl83xx_hpe_1920.dtsi" / { - gpio1: rtl8231-gpio { - compatible = "realtek,rtl8231-gpio"; - #gpio-cells = <2>; - gpio-controller; - indirect-access-bus-id = <0>; - }; i2c0: i2c-gpio-0 { compatible = "i2c-gpio"; @@ -84,6 +78,24 @@ }; }; +&mdio_aux { + status = "okay"; + + gpio1: expander@0 { + compatible = "realtek,rtl8231"; + reg = <0>; + + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&gpio1 0 0 37>; + + led-controller { + compatible = "realtek,rtl8231-leds"; + status = "disabled"; + }; + }; +}; + ðernet0 { mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; diff --git a/target/linux/rockchip/armv8/config-6.6 b/target/linux/rockchip/armv8/config-6.6 index 1761a33b5c0..052efaccc39 100644 --- a/target/linux/rockchip/armv8/config-6.6 +++ b/target/linux/rockchip/armv8/config-6.6 @@ -551,12 +551,7 @@ CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y CONFIG_POWER_SUPPLY_HWMON=y CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_BUILD=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y +CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PRINTK_TIME=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_VMCORE=y diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index c204c7522e7..da6eb516b75 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.31.3 +PKG_VERSION:=3.31.4 PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION))) PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake @@ -15,7 +15,7 @@ PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v$(PKG_VERSION_MAJOR)/ -PKG_HASH:=fac45bc6d410b49b3113ab866074888d6c9e9dc81a141874446eb239ac38cb87 +PKG_HASH:=a6130bfe75f5ba5c73e672e34359f7c0a1931521957e8393a5c2922c8b0f7f25 HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index 0a1712bc678..18d7ea2caad 100644 --- a/tools/mkimage/Makefile +++ b/tools/mkimage/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mkimage -PKG_VERSION:=2024.07 +PKG_VERSION:=2025.01 PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ https://mirror.cyberbits.eu/u-boot \ https://ftp.denx.de/pub/u-boot \ ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f +PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)