This patch has something still wrong, since Teltonika RUT240 gives this error:
# sysupgrade -v openwrt-ar71xx-generic-rut200-squashfs-factory.bin
Invalid image, not supported on this device.
Image check 'platform_check_image' failed.
| CONFIG_TARGET_ar71xx=y | |
| CONFIG_TARGET_ar71xx_generic=y | |
| CONFIG_TARGET_ar71xx_generic_DEVICE_rut200=y | |
| CONFIG_BUSYBOX_CUSTOM=y | |
| CONFIG_BUILD_PATENTED=y | |
| CONFIG_BUSYBOX_CONFIG_ARP=y | |
| CONFIG_BUSYBOX_CONFIG_ARPING=y | |
| CONFIG_BUSYBOX_CONFIG_DEVMEM=y | |
| # CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MTIME is not set | |
| # CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_NEWER is not set | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_MIME_CHARSET="" | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE=y | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_TELNET_TTYPE=y | |
| # CONFIG_BUSYBOX_CONFIG_FEATURE_USE_SENDFILE is not set | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION=y | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS=y | |
| CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR=y | |
| # CONFIG_BUSYBOX_CONFIG_FLOCK is not set | |
| CONFIG_BUSYBOX_CONFIG_FTPPUT=y | |
| CONFIG_BUSYBOX_CONFIG_HOSTID=y | |
| # CONFIG_BUSYBOX_CONFIG_IP is not set | |
| CONFIG_BUSYBOX_CONFIG_LSUSB=y | |
| CONFIG_BUSYBOX_CONFIG_MICROCOM=y | |
| CONFIG_BUSYBOX_CONFIG_NSLOOKUP=y | |
| CONFIG_BUSYBOX_CONFIG_SENDMAIL=y | |
| # CONFIG_BUSYBOX_CONFIG_SHA256SUM is not set | |
| CONFIG_BUSYBOX_CONFIG_TELNET=y | |
| CONFIG_BUSYBOX_CONFIG_TELNETD=y | |
| # CONFIG_BUSYBOX_CONFIG_TRACEROUTE6 is not set | |
| CONFIG_BUSYBOX_CONFIG_USLEEP=y | |
| CONFIG_BUSYBOX_CONFIG_VCONFIG=y | |
| CONFIG_BUSYBOX_CONFIG_WGET=y | |
| CONFIG_KERNEL_BUILD_DOMAIN="m2m.center" | |
| CONFIG_KERNEL_BUILD_USER="jhh" | |
| CONFIG_KERNEL_CC_STACKPROTECTOR_NONE=y | |
| # CONFIG_KERNEL_CC_STACKPROTECTOR_REGULAR is not set | |
| # CONFIG_KERNEL_IPV6_MROUTE is not set | |
| CONFIG_KERNEL_MIPS_FPU_EMULATOR=y | |
| CONFIG_LIBCURL_COOKIES=y | |
| CONFIG_LIBCURL_FILE=y | |
| CONFIG_LIBCURL_FTP=y | |
| CONFIG_LIBCURL_HTTP=y | |
| CONFIG_LIBCURL_NO_SMB="!" | |
| CONFIG_LIBCURL_OPENSSL=y | |
| CONFIG_LIBCURL_PROXY=y | |
| CONFIG_LUCI_SRCDIET=y | |
| CONFIG_MOSQUITTO_PASSWD=y | |
| CONFIG_OPENSSL_WITH_DEPRECATED=y | |
| CONFIG_OPENSSL_WITH_EC=y | |
| CONFIG_OPENSSL_WITH_NPN=y | |
| CONFIG_OPENSSL_WITH_PSK=y | |
| CONFIG_OPENSSL_WITH_SRP=y | |
| CONFIG_OPENSSL_WITH_SSL3=y | |
| CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y | |
| CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y | |
| CONFIG_OPENVPN_openssl_ENABLE_HTTP=y | |
| CONFIG_OPENVPN_openssl_ENABLE_LZ4=y | |
| CONFIG_OPENVPN_openssl_ENABLE_LZO=y | |
| CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y | |
| CONFIG_OPENVPN_openssl_ENABLE_PF=y | |
| CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y | |
| CONFIG_OPENVPN_openssl_ENABLE_SERVER=y | |
| CONFIG_OPENVPN_openssl_ENABLE_SMALL=y | |
| CONFIG_OPENVPN_openssl_ENABLE_SOCKS=y | |
| # CONFIG_PACKAGE_ATH_DFS is not set | |
| CONFIG_PACKAGE_bash=m | |
| CONFIG_PACKAGE_bind-client=y | |
| CONFIG_PACKAGE_bind-libs=y | |
| CONFIG_PACKAGE_block-mount=y | |
| CONFIG_PACKAGE_ca-bundle=y | |
| CONFIG_PACKAGE_chat=y | |
| CONFIG_PACKAGE_comgt=y | |
| CONFIG_PACKAGE_comgt-ncm=y | |
| CONFIG_PACKAGE_curl=y | |
| CONFIG_PACKAGE_ddns-scripts=y | |
| # CONFIG_PACKAGE_dnsmasq is not set | |
| CONFIG_PACKAGE_dnsmasq-dhcpv6=y | |
| CONFIG_PACKAGE_ebtables=y | |
| CONFIG_PACKAGE_etherwake=y | |
| CONFIG_PACKAGE_getopt=y | |
| CONFIG_PACKAGE_gpsd=y | |
| CONFIG_PACKAGE_ip-tiny=y | |
| CONFIG_PACKAGE_ip6tables-mod-nat=y | |
| CONFIG_PACKAGE_ipset=y | |
| CONFIG_PACKAGE_iptables-mod-conntrack-extra=y | |
| CONFIG_PACKAGE_iptables-mod-filter=y | |
| CONFIG_PACKAGE_iptables-mod-ipopt=y | |
| CONFIG_PACKAGE_iptables-mod-ipsec=y | |
| CONFIG_PACKAGE_iptables-mod-nat-extra=y | |
| CONFIG_PACKAGE_iptables-mod-quota2=y | |
| CONFIG_PACKAGE_kmod-crypto-aead=y | |
| CONFIG_PACKAGE_kmod-crypto-authenc=y | |
| CONFIG_PACKAGE_kmod-crypto-cbc=y | |
| CONFIG_PACKAGE_kmod-crypto-deflate=y | |
| CONFIG_PACKAGE_kmod-crypto-des=y | |
| CONFIG_PACKAGE_kmod-crypto-ecb=y | |
| CONFIG_PACKAGE_kmod-crypto-echainiv=y | |
| CONFIG_PACKAGE_kmod-crypto-hash=y | |
| CONFIG_PACKAGE_kmod-crypto-hmac=y | |
| CONFIG_PACKAGE_kmod-crypto-iv=y | |
| CONFIG_PACKAGE_kmod-crypto-manager=y | |
| CONFIG_PACKAGE_kmod-crypto-md5=y | |
| CONFIG_PACKAGE_kmod-crypto-null=y | |
| CONFIG_PACKAGE_kmod-crypto-pcompress=y | |
| CONFIG_PACKAGE_kmod-crypto-rng=y | |
| CONFIG_PACKAGE_kmod-crypto-sha1=y | |
| CONFIG_PACKAGE_kmod-crypto-sha256=y | |
| CONFIG_PACKAGE_kmod-crypto-wq=y | |
| CONFIG_PACKAGE_kmod-ebtables=y | |
| CONFIG_PACKAGE_kmod-ebtables-ipv4=y | |
| CONFIG_PACKAGE_kmod-ebtables-watchers=y | |
| CONFIG_PACKAGE_kmod-fs-autofs4=y | |
| CONFIG_PACKAGE_kmod-fs-msdos=y | |
| CONFIG_PACKAGE_kmod-fs-ntfs=y | |
| CONFIG_PACKAGE_kmod-fs-vfat=y | |
| CONFIG_PACKAGE_kmod-gre=y | |
| CONFIG_PACKAGE_kmod-ifb=y | |
| CONFIG_PACKAGE_kmod-ip6-tunnel=y | |
| CONFIG_PACKAGE_kmod-ipsec=y | |
| CONFIG_PACKAGE_kmod-ipsec4=y | |
| CONFIG_PACKAGE_kmod-ipsec6=y | |
| CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y | |
| CONFIG_PACKAGE_kmod-ipt-filter=y | |
| CONFIG_PACKAGE_kmod-ipt-ipopt=y | |
| CONFIG_PACKAGE_kmod-ipt-ipsec=y | |
| CONFIG_PACKAGE_kmod-ipt-ipset=y | |
| CONFIG_PACKAGE_kmod-ipt-nat-extra=y | |
| CONFIG_PACKAGE_kmod-ipt-nat6=y | |
| CONFIG_PACKAGE_kmod-ipt-quota2=y | |
| CONFIG_PACKAGE_kmod-iptunnel=y | |
| CONFIG_PACKAGE_kmod-iptunnel4=y | |
| CONFIG_PACKAGE_kmod-iptunnel6=y | |
| CONFIG_PACKAGE_kmod-l2tp=y | |
| CONFIG_PACKAGE_kmod-lib-crc-itu-t=y | |
| CONFIG_PACKAGE_kmod-lib-crc16=y | |
| CONFIG_PACKAGE_kmod-lib-crc7=y | |
| CONFIG_PACKAGE_kmod-lib-textsearch=y | |
| CONFIG_PACKAGE_kmod-lib-zlib-deflate=y | |
| CONFIG_PACKAGE_kmod-lib-zlib-inflate=y | |
| CONFIG_PACKAGE_kmod-mii=y | |
| CONFIG_PACKAGE_kmod-mmc=y | |
| CONFIG_PACKAGE_kmod-mppe=y | |
| CONFIG_PACKAGE_kmod-nf-nat6=y | |
| CONFIG_PACKAGE_kmod-nfnetlink=y | |
| CONFIG_PACKAGE_kmod-nls-cp437=y | |
| CONFIG_PACKAGE_kmod-nls-iso8859-1=y | |
| CONFIG_PACKAGE_kmod-nls-utf8=y | |
| CONFIG_PACKAGE_kmod-pppol2tp=y | |
| CONFIG_PACKAGE_kmod-pptp=y | |
| CONFIG_PACKAGE_kmod-sched-connmark=y | |
| CONFIG_PACKAGE_kmod-sched-core=y | |
| CONFIG_PACKAGE_kmod-scsi-cdrom=y | |
| CONFIG_PACKAGE_kmod-scsi-core=y | |
| CONFIG_PACKAGE_kmod-tun=y | |
| CONFIG_PACKAGE_kmod-udptunnel4=y | |
| CONFIG_PACKAGE_kmod-udptunnel6=y | |
| CONFIG_PACKAGE_kmod-usb-acm=y | |
| CONFIG_PACKAGE_kmod-usb-net=y | |
| CONFIG_PACKAGE_kmod-usb-net-cdc-ether=y | |
| CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=y | |
| CONFIG_PACKAGE_kmod-usb-net-qmi-wwan=y | |
| CONFIG_PACKAGE_kmod-usb-serial=y | |
| CONFIG_PACKAGE_kmod-usb-serial-ftdi=y | |
| CONFIG_PACKAGE_kmod-usb-serial-option=y | |
| CONFIG_PACKAGE_kmod-usb-serial-wwan=y | |
| CONFIG_PACKAGE_kmod-usb-storage=y | |
| CONFIG_PACKAGE_kmod-usb-wdm=y | |
| CONFIG_PACKAGE_libcares=y | |
| CONFIG_PACKAGE_libcurl=y | |
| CONFIG_PACKAGE_libevent2=y | |
| CONFIG_PACKAGE_libgmp=y | |
| CONFIG_PACKAGE_libgps=y | |
| CONFIG_PACKAGE_libipset=y | |
| CONFIG_PACKAGE_libiwinfo-lua=y | |
| CONFIG_PACKAGE_libltdl=y | |
| CONFIG_PACKAGE_liblua=y | |
| CONFIG_PACKAGE_liblucihttp=y | |
| CONFIG_PACKAGE_liblucihttp-lua=y | |
| CONFIG_PACKAGE_liblzo=y | |
| CONFIG_PACKAGE_libmnl=y | |
| CONFIG_PACKAGE_libmosquitto-ssl=y | |
| CONFIG_PACKAGE_libncurses=y | |
| CONFIG_PACKAGE_libnfnetlink=y | |
| CONFIG_PACKAGE_libopenssl=y | |
| CONFIG_PACKAGE_libpcap=y | |
| CONFIG_PACKAGE_libpcre=y | |
| CONFIG_PACKAGE_libreadline=y | |
| CONFIG_PACKAGE_librt=y | |
| CONFIG_PACKAGE_libsqlite3=y | |
| CONFIG_PACKAGE_libstdcpp=y | |
| CONFIG_PACKAGE_libubus-lua=y | |
| CONFIG_PACKAGE_libuci-lua=y | |
| CONFIG_PACKAGE_libusb-1.0=y | |
| CONFIG_PACKAGE_libustream-openssl=y | |
| CONFIG_PACKAGE_libuuid=y | |
| CONFIG_PACKAGE_lsqlite3=y | |
| CONFIG_PACKAGE_lua=y | |
| CONFIG_PACKAGE_lua-md5=y | |
| CONFIG_PACKAGE_luasec=y | |
| CONFIG_PACKAGE_luasocket=y | |
| CONFIG_PACKAGE_luci=y | |
| CONFIG_PACKAGE_luci-app-ddns=y | |
| CONFIG_PACKAGE_luci-app-firewall=y | |
| CONFIG_PACKAGE_luci-app-mwan3=y | |
| CONFIG_PACKAGE_luci-app-ntpc=y | |
| CONFIG_PACKAGE_luci-app-qos=y | |
| CONFIG_PACKAGE_luci-app-wol=y | |
| CONFIG_PACKAGE_luci-base=y | |
| CONFIG_PACKAGE_luci-lib-ip=y | |
| CONFIG_PACKAGE_luci-lib-json=y | |
| CONFIG_PACKAGE_luci-lib-jsonc=y | |
| CONFIG_PACKAGE_luci-lib-nixio=y | |
| CONFIG_PACKAGE_luci-mod-admin-full=y | |
| CONFIG_PACKAGE_luci-proto-ipv6=y | |
| CONFIG_PACKAGE_luci-proto-ppp=y | |
| CONFIG_PACKAGE_luci-proto-qmi=y | |
| CONFIG_PACKAGE_luci-ssl-openssl=y | |
| CONFIG_PACKAGE_luci-theme-bootstrap=y | |
| CONFIG_PACKAGE_mii-tool=m | |
| CONFIG_PACKAGE_miniupnpd=y | |
| CONFIG_PACKAGE_mosquitto-ssl=y | |
| CONFIG_PACKAGE_mwan3=y | |
| CONFIG_PACKAGE_nano=m | |
| CONFIG_PACKAGE_node=m | |
| CONFIG_PACKAGE_nping=y | |
| CONFIG_PACKAGE_ntpclient=y | |
| CONFIG_PACKAGE_odhcpd=y | |
| # CONFIG_PACKAGE_odhcpd-ipv6only is not set | |
| CONFIG_PACKAGE_odhcpd_full_ext_cer_id=0 | |
| CONFIG_PACKAGE_openssh-client=m | |
| CONFIG_PACKAGE_openssh-client-utils=m | |
| CONFIG_PACKAGE_openssh-keygen=m | |
| CONFIG_PACKAGE_openssh-sftp-client=m | |
| CONFIG_PACKAGE_openssl-util=y | |
| CONFIG_PACKAGE_openvpn-openssl=y | |
| # CONFIG_PACKAGE_openwrt-keyring is not set | |
| # CONFIG_PACKAGE_ppp-mod-pppoe is not set | |
| CONFIG_PACKAGE_privoxy=y | |
| CONFIG_PACKAGE_qos-scripts=y | |
| CONFIG_PACKAGE_quagga=y | |
| CONFIG_PACKAGE_quagga-bgpd=y | |
| CONFIG_PACKAGE_quagga-libospf=y | |
| CONFIG_PACKAGE_quagga-libzebra=y | |
| CONFIG_PACKAGE_quagga-ospfd=y | |
| CONFIG_PACKAGE_quagga-ripd=y | |
| CONFIG_PACKAGE_quagga-vtysh=y | |
| CONFIG_PACKAGE_quagga-watchquagga=y | |
| CONFIG_PACKAGE_quagga-zebra=y | |
| CONFIG_PACKAGE_relayd=y | |
| CONFIG_PACKAGE_resolveip=y | |
| CONFIG_PACKAGE_rpcd=y | |
| CONFIG_PACKAGE_rpcd-mod-file=y | |
| CONFIG_PACKAGE_rpcd-mod-iwinfo=y | |
| CONFIG_PACKAGE_rpcd-mod-rpcsys=y | |
| CONFIG_PACKAGE_rpcd-mod-rrdns=y | |
| CONFIG_PACKAGE_sqlite3-cli=m | |
| CONFIG_PACKAGE_stunnel=y | |
| CONFIG_PACKAGE_tc=y | |
| CONFIG_PACKAGE_tcpdump-mini=y | |
| CONFIG_PACKAGE_terminfo=y | |
| CONFIG_PACKAGE_uclibcxx=y | |
| CONFIG_PACKAGE_uhttpd=y | |
| CONFIG_PACKAGE_uhttpd-mod-lua=y | |
| CONFIG_PACKAGE_uhttpd-mod-ubus=y | |
| CONFIG_PACKAGE_uqmi=y | |
| # CONFIG_PACKAGE_usign is not set | |
| CONFIG_PACKAGE_wpad=y | |
| # CONFIG_PACKAGE_wpad-mini is not set | |
| CONFIG_PACKAGE_wwan=y | |
| CONFIG_PACKAGE_zlib=y | |
| CONFIG_PKG_CC_STACKPROTECTOR_NONE=y | |
| # CONFIG_PKG_CHECK_FORMAT_SECURITY is not set | |
| # CONFIG_PKG_FORTIFY_SOURCE_1 is not set | |
| CONFIG_PKG_FORTIFY_SOURCE_NONE=y | |
| # CONFIG_PKG_RELRO_FULL is not set | |
| CONFIG_PKG_RELRO_NONE=y | |
| # CONFIG_SIGNED_PACKAGES is not set | |
| CONFIG_SQLITE_FTS3=y | |
| CONFIG_SQLITE_RTREE=y | |
| CONFIG_uhttpd_lua=y | |
| # CONFIG_MOSQUITTO_LWS is not set | |
| CONFIG_PACKAGE_kmod-pppoe=y | |
| # CONFIG_PACKAGE_libcap is not set | |
| # CONFIG_PACKAGE_libwebsockets-openssl is not set |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/base-files/etc/board.d/01_leds openwrt-1806-rut2xx/target/linux/ar71xx/base-files/etc/board.d/01_leds | |
| --- openwrt-1806-orig/target/linux/ar71xx/base-files/etc/board.d/01_leds 2019-06-04 07:03:28.302995547 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/base-files/etc/board.d/01_leds 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -720,6 +720,10 @@ rut900) | |
| ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08" | |
| ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04" | |
| ;; | |
| +rut200) | |
| + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" | |
| + ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10" | |
| + ;; | |
| smart-300) | |
| ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" | |
| ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/base-files/etc/board.d/02_network openwrt-1806-rut2xx/target/linux/ar71xx/base-files/etc/board.d/02_network | |
| --- openwrt-1806-orig/target/linux/ar71xx/base-files/etc/board.d/02_network 2019-06-04 07:03:28.302995547 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/base-files/etc/board.d/02_network 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -476,6 +476,11 @@ ar71xx_setup_interfaces() | |
| ucidef_add_switch "switch0" \ | |
| "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" | |
| ;; | |
| + rut200) | |
| + ucidef_set_interfaces_lan_wan "eth0.1" "eth1" | |
| + ucidef_add_switch "switch0" \ | |
| + "0@eth0" "2:lan:1" | |
| + ;; | |
| tellstick-znet-lite) | |
| ucidef_set_interface_wan "eth0" | |
| ucidef_set_interface_raw "wlan" "wlan0" "dhcp" | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/base-files/etc/diag.sh openwrt-1806-rut2xx/target/linux/ar71xx/base-files/etc/diag.sh | |
| --- openwrt-1806-orig/target/linux/ar71xx/base-files/etc/diag.sh 2019-06-04 07:03:28.302995547 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/base-files/etc/diag.sh 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -47,6 +47,7 @@ get_status_led() { | |
| dr342|\ | |
| dr344|\ | |
| rut900|\ | |
| + rut200|\ | |
| tew-632brp|\ | |
| tl-wr942n-v1|\ | |
| wpj344|\ | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/base-files/lib/ar71xx.sh openwrt-1806-rut2xx/target/linux/ar71xx/base-files/lib/ar71xx.sh | |
| --- openwrt-1806-orig/target/linux/ar71xx/base-files/lib/ar71xx.sh 2019-06-04 07:03:28.302995547 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/base-files/lib/ar71xx.sh 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -1121,6 +1121,9 @@ ar71xx_board_detect() { | |
| *"RUT900") | |
| name="rut900" | |
| ;; | |
| + *"RUT200") | |
| + name="rut200" | |
| + ;; | |
| *"RW2458N") | |
| name="rw2458n" | |
| ;; | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/base-files/lib/upgrade/platform.sh openwrt-1806-rut2xx/target/linux/ar71xx/base-files/lib/upgrade/platform.sh | |
| --- openwrt-1806-orig/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 2019-06-04 07:03:28.302995547 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -423,6 +423,7 @@ platform_check_image() { | |
| re355|\ | |
| re450|\ | |
| rut900|\ | |
| + rut200|\ | |
| smart-300|\ | |
| som9331|\ | |
| tellstick-znet-lite|\ | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt | |
| --- openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 2019-06-04 07:03:28.302995547 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -1442,6 +1442,16 @@ config ATH79_MACH_RUT9XX | |
| select ATH79_DEV_WMAC | |
| select GPIO_PCA953X | |
| +config ATH79_MACH_RUT2XX | |
| + bool "Teltonika RUT200 series support" | |
| + select SOC_AR933X | |
| + select ATH79_DEV_ETH | |
| + select ATH79_DEV_GPIO_BUTTONS | |
| + select ATH79_DEV_LEDS_GPIO | |
| + select ATH79_DEV_M25P80 | |
| + select ATH79_DEV_USB | |
| + select ATH79_DEV_WMAC | |
| + | |
| config ATH79_MACH_RW2458N | |
| bool "Redwave RW2458N board support" | |
| select SOC_AR724X | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/mach-rut2xx.c openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/mach-rut2xx.c | |
| --- openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/mach-rut2xx.c 1970-01-01 02:00:00.000000000 +0200 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/mach-rut2xx.c 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -0,0 +1,97 @@ | |
| +/* | |
| + * Teltonika RUT200 series boards support | |
| + * | |
| + * Copyright (C) 2018 Piotr Dymacz <pepe2k@gmail.com> | |
| + * | |
| + * 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 <linux/gpio.h> | |
| + | |
| +#include <asm/mach-ath79/ath79.h> | |
| +#include <asm/mach-ath79/ar71xx_regs.h> | |
| + | |
| +#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" | |
| + | |
| +#define RUT2XX_GPIO_LED_LAN1 14 | |
| +#define RUT2XX_GPIO_LED_WAN 17 | |
| +#define RUT2XX_GPIO_LED_2G 8 | |
| +#define RUT2XX_GPIO_LED_3G 24 | |
| +#define RUT2XX_GPIO_LED_4G 21 | |
| + | |
| +#define RUT2XX_GPIO_BTN_RESET 22 | |
| + | |
| +#define RUT2XX_WMAC_CALDATA_OFFSET 0x1000 | |
| + | |
| +#define RUT2XX_KEYS_POLL_INTERVAL 20 | |
| +#define RUT2XX_KEYS_DEBOUNCE_INTERVAL (3 * RUT2XX_KEYS_POLL_INTERVAL) | |
| + | |
| +static struct gpio_led rut200_leds_gpio[] __initdata = { | |
| + { | |
| + .name = "rut200:green:lan1", | |
| + .gpio = RUT2XX_GPIO_LED_LAN1, | |
| + .active_low = 0, | |
| + }, { | |
| + .name = "rut200:green:status", | |
| + .gpio = RUT2XX_GPIO_LED_4G, | |
| + .active_low = 0, | |
| + }, { | |
| + .name = "rut200:green:wan", | |
| + .gpio = RUT2XX_GPIO_LED_WAN, | |
| + .active_low = 0, | |
| + }, | |
| +}; | |
| + | |
| +static struct gpio_keys_button rut200_gpio_keys[] __initdata = { | |
| + { | |
| + .desc = "reset", | |
| + .type = EV_KEY, | |
| + .code = KEY_RESTART, | |
| + .debounce_interval = RUT2XX_KEYS_DEBOUNCE_INTERVAL, | |
| + .gpio = RUT2XX_GPIO_BTN_RESET, | |
| + .active_low = 0, | |
| + }, | |
| +}; | |
| + | |
| +static void __init rut200_setup(void) | |
| +{ | |
| + u8 *art = (u8 *) KSEG1ADDR(0x1f030000); | |
| + u8 *mac = (u8 *) KSEG1ADDR(0x1f020000); | |
| + u8 wlan_mac[ETH_ALEN]; | |
| + | |
| + ath79_register_m25p80(NULL); | |
| + | |
| + ath79_register_mdio(0, 0x0); | |
| + | |
| + /* LAN */ | |
| + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); | |
| + ath79_register_eth(1); | |
| + | |
| + /* WAN */ | |
| + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); | |
| + ath79_register_eth(0); | |
| + | |
| + | |
| + ath79_register_leds_gpio(-1, ARRAY_SIZE(rut200_leds_gpio), | |
| + rut200_leds_gpio); | |
| + | |
| + ath79_register_gpio_keys_polled(1, RUT2XX_KEYS_POLL_INTERVAL, | |
| + ARRAY_SIZE(rut200_gpio_keys), | |
| + rut200_gpio_keys); | |
| + | |
| + ath79_init_mac(wlan_mac, mac, 2); | |
| + ath79_register_wmac(art + RUT2XX_WMAC_CALDATA_OFFSET, wlan_mac); | |
| + | |
| + ath79_register_usb(); | |
| +} | |
| + | |
| +MIPS_MACHINE(ATH79_MACH_RUT2XX, "RUT200", "Teltonika RUT200", rut200_setup); | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h | |
| --- openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h 2019-06-04 07:03:28.310995931 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -230,6 +230,7 @@ enum ath79_mach_type { | |
| ATH79_MACH_RE450, /* TP-LINK RE450 */ | |
| ATH79_MACH_RME_EG200, /* eTactica EG200 */ | |
| ATH79_MACH_RUT9XX, /* Teltonika RUT900 series */ | |
| + ATH79_MACH_RUT2XX, /* Teltonika RUT200 series */ | |
| ATH79_MACH_RW2458N, /* Redwave RW2458N */ | |
| ATH79_MACH_SC1750, /* Abicom SC1750 */ | |
| ATH79_MACH_SC300M, /* Abicom SC300M */ | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/Makefile openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/Makefile | |
| --- openwrt-1806-orig/target/linux/ar71xx/files/arch/mips/ath79/Makefile 2019-06-04 07:03:28.306995739 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/files/arch/mips/ath79/Makefile 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -193,6 +193,7 @@ obj-$(CONFIG_ATH79_MACH_RE355) += mach | |
| obj-$(CONFIG_ATH79_MACH_RE450) += mach-re450.o | |
| obj-$(CONFIG_ATH79_MACH_RME_EG200) += mach-rme-eg200.o | |
| obj-$(CONFIG_ATH79_MACH_RUT9XX) += mach-rut9xx.o | |
| +obj-$(CONFIG_ATH79_MACH_RUT2XX) += mach-rut2xx.o | |
| obj-$(CONFIG_ATH79_MACH_RW2458N) += mach-rw2458n.o | |
| obj-$(CONFIG_ATH79_MACH_SC1750) += mach-sc1750.o | |
| obj-$(CONFIG_ATH79_MACH_SC300M) += mach-sc300m.o | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/generic/config-default openwrt-1806-rut2xx/target/linux/ar71xx/generic/config-default | |
| --- openwrt-1806-orig/target/linux/ar71xx/generic/config-default 2019-06-04 07:03:28.310995931 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/generic/config-default 2019-06-04 07:04:32.322046661 +0300 | |
| @@ -141,6 +141,7 @@ CONFIG_ATH79_MACH_RE355=y | |
| CONFIG_ATH79_MACH_RE450=y | |
| CONFIG_ATH79_MACH_RME_EG200=y | |
| CONFIG_ATH79_MACH_RUT9XX=y | |
| +CONFIG_ATH79_MACH_RUT2XX=y | |
| CONFIG_ATH79_MACH_RW2458N=y | |
| CONFIG_ATH79_MACH_SC1750=y | |
| CONFIG_ATH79_MACH_SC300M=y | |
| diff -purN openwrt-1806-orig/target/linux/ar71xx/image/generic.mk openwrt-1806-rut2xx/target/linux/ar71xx/image/generic.mk | |
| --- openwrt-1806-orig/target/linux/ar71xx/image/generic.mk 2019-06-04 07:03:28.314996122 +0300 | |
| +++ openwrt-1806-rut2xx/target/linux/ar71xx/image/generic.mk 2019-06-04 17:35:39.866078679 +0300 | |
| @@ -888,6 +888,29 @@ define Device/rut900 | |
| endef | |
| TARGET_DEVICES += rut900 | |
| +define Device/rut200 | |
| + DEVICE_TITLE := Teltonika RUT200 | |
| + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 -uboot-envtools | |
| + BOARDNAME := RUT200 | |
| + SUPPORTED_DEVICES := rut200 | |
| + IMAGE_SIZE := 15552k | |
| + MTDPARTS := spi0.0:128k(u-boot)ro,64k(config)ro,64k(art)ro,15552k(firmware),576k(event-log)ro | |
| + TPLINK_HWID := 0x32200002 | |
| + TPLINK_HWREV := 0x1 | |
| + TPLINK_HEADER_VERSION := 1 | |
| + CONSOLE := ttyATH0,115200 | |
| + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header | |
| + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | |
| + IMAGES := sysupgrade.bin factory.bin | |
| + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\ | |
| + pad-rootfs | teltonika-fw-fake-checksum | append-string RUT200019999 | append-string master |\ | |
| + append-md5sum-bin | check-size $$$$(IMAGE_SIZE) | |
| + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\ | |
| + append-rootfs | pad-rootfs | append-metadata |\ | |
| + check-size $$$$(IMAGE_SIZE) | |
| +endef | |
| +TARGET_DEVICES += rut200 | |
| + | |
| define Device/mc-mac1200r | |
| $(Device/tplink-8mlzma) | |
| DEVICE_TITLE := Mercury MAC1200R |