From 77b85a3e184305292e630b6b1447f0e9617c2348 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Fri, 27 Mar 2020 16:56:25 +0800 Subject: [PATCH 1/2] ipq806x: add i2c chips support for m520 (#4055) This commit enable lm75 and pcf8563 for m520. Signed-off-by: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> --- .../ipq806x/base-files/etc/board.d/01_leds | 4 -- .../lib/preinit/05_set_iface_mac_ipq806x.sh | 8 ++-- .../arm/boot/dts/qcom-ipq8064-mtfi-m520.dts | 46 +++++++++---------- .../arm/boot/dts/qcom-ipq8064-mtfi-m520.dts | 46 +++++++++---------- target/linux/ipq806x/image/Makefile | 3 +- 5 files changed, 52 insertions(+), 55 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 82a9e9536f..f8b6c32358 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -33,10 +33,6 @@ netgear,r7800) ucidef_set_led_switch "wan" "WAN" "${boardname}:white:wan" "switch0" "0x20" ucidef_set_led_ide "esata" "eSATA" "${boardname}:white:esata" ;; -ruijie,rg-mtfi-m520) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2g" "phy1tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5g" "phy0tpt" - ;; tplink,c2600) ucidef_set_led_usbport "usb1" "USB 1" "${boardname}:white:usb_2" "usb1-port1" "usb2-port1" ucidef_set_led_usbport "usb2" "USB 2" "${boardname}:white:usb_4" "usb3-port1" "usb4-port1" diff --git a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh index 8087534221..6e3e97d12f 100644 --- a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh +++ b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh @@ -5,10 +5,10 @@ preinit_set_mac_address() { case $(board_name) in ruijie,rg-mtfi-m520) - base_mac=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) - ip link set dev eth0 address $(macaddr_add "$base_mac" +1) - ip link set dev eth1 address $(macaddr_add "$base_mac" +2) - ;; + base_mac=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) + ip link set dev eth0 address $(macaddr_add "$base_mac" +1) + ip link set dev eth1 address $(macaddr_add "$base_mac" +2) + ;; esac } diff --git a/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts b/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts index b89201e578..3b3172ec93 100644 --- a/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts +++ b/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts @@ -134,6 +134,27 @@ }; }; + gsbi2: gsbi@12480000 { + qcom,mode = ; + status = "ok"; + + i2c@124a0000 { + status = "ok"; + + lm75@48 { + status = "okay"; + compatible = "lm75"; + reg = <0x48>; + }; + + pcf8563: rtc@51 { + status = "okay"; + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; + }; + }; + gsbi@16300000 { qcom,mode = ; status = "ok"; @@ -161,10 +182,10 @@ cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; flash: m25p80@0 { - compatible = "jedec,spi-nor"; + compatible = "s25fl256s1"; #address-cells = <1>; #size-cells = <1>; - spi-max-frequency = <51200000>; + spi-max-frequency = <50000000>; reg = <0>; SBL1@0 { @@ -367,27 +388,6 @@ linux,code = ; }; }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - usb_1 { - label = "m520:green:usb_1"; - gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; - }; - - usb_3 { - label = "m520:green:usb_3"; - gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; - }; - - status_green { - label = "m520:green:status"; - gpios = <&qcom_pinmux 9 GPIO_ACTIVE_LOW>; - }; - }; }; &adm_dma { diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts index b89201e578..3b3172ec93 100644 --- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts @@ -134,6 +134,27 @@ }; }; + gsbi2: gsbi@12480000 { + qcom,mode = ; + status = "ok"; + + i2c@124a0000 { + status = "ok"; + + lm75@48 { + status = "okay"; + compatible = "lm75"; + reg = <0x48>; + }; + + pcf8563: rtc@51 { + status = "okay"; + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; + }; + }; + gsbi@16300000 { qcom,mode = ; status = "ok"; @@ -161,10 +182,10 @@ cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; flash: m25p80@0 { - compatible = "jedec,spi-nor"; + compatible = "s25fl256s1"; #address-cells = <1>; #size-cells = <1>; - spi-max-frequency = <51200000>; + spi-max-frequency = <50000000>; reg = <0>; SBL1@0 { @@ -367,27 +388,6 @@ linux,code = ; }; }; - - leds { - compatible = "gpio-leds"; - pinctrl-0 = <&led_pins>; - pinctrl-names = "default"; - - usb_1 { - label = "m520:green:usb_1"; - gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; - }; - - usb_3 { - label = "m520:green:usb_3"; - gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; - }; - - status_green { - label = "m520:green:status"; - gpios = <&qcom_pinmux 9 GPIO_ACTIVE_LOW>; - }; - }; }; &adm_dma { diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index cb39da6f1b..91ec128445 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -275,7 +275,8 @@ define Device/ruijie_rg-mtfi-m520 IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$${BLOCKSIZE} | sysupgrade-tar rootfs=$$$$@ | append-metadata IMAGE/mmcblk0p2-kernel.bin := append-kernel | pad-to $$$${KERNEL_SIZE} IMAGE/mmcblk0p3-rootfs.bin := append-rootfs | pad-rootfs - DEVICE_PACKAGES := ath10k-firmware-qca988x-ct blockd e2fsprogs f2fs-tools kmod-fs-ext4 kmod-fs-f2fs losetup + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs f2fs-tools \ + kmod-hwmon-lm75 kmod-fs-ext4 kmod-fs-f2fs kmod-rtc-pcf8563 losetup endef TARGET_DEVICES += ruijie_rg-mtfi-m520 From 08b73fa42d75dedbdb2ac08d9040a9ec859ba9e7 Mon Sep 17 00:00:00 2001 From: lean Date: Fri, 27 Mar 2020 16:56:59 +0800 Subject: [PATCH 2/2] luci-app-ssr-plus: fix game plus mode --- package/lean/luci-app-ssr-plus/Makefile | 4 ++-- package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 2 +- package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 9f54245d4d..59528a72dd 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus -PKG_VERSION:=174 -PKG_RELEASE:=10 +PKG_VERSION:=175 +PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index a6487bd184..f932fd216c 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -232,7 +232,7 @@ start_rules() { else netflix="0" fi - netflix_ip=$(check_host $(uci_get_by_name $NETFLIX_SERVER server)) + netflix_ip=$(check_host $(uci_get_by_name $NETFLIX_SERVER server 127.0.0.1)) /usr/bin/ssr-rules \ -s "$server" \ -l "$local_port" \ diff --git a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules index b752c58ac3..0279d926a7 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules +++ b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-rules @@ -75,7 +75,6 @@ flush_r() { ipset -X whitelist 2>/dev/null ipset -X blacklist 2>/dev/null ipset -X netflix 2>/dev/null - ipset -X china 2>/dev/null [ -n "$FWI" ] && echo '#!/bin/sh' >$FWI return 0 }