diff options
-rw-r--r-- | package/boot/uboot-envtools/files/ath79 | 1 | ||||
-rw-r--r-- | target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts | 181 | ||||
-rwxr-xr-x | target/linux/ath79/generic/base-files/etc/board.d/01_leds | 6 | ||||
-rwxr-xr-x | target/linux/ath79/generic/base-files/etc/board.d/02_network | 8 | ||||
-rw-r--r-- | target/linux/ath79/image/generic.mk | 45 |
5 files changed, 239 insertions, 2 deletions
diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index c0873c6e0d..11fdb07272 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -19,6 +19,7 @@ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,ecb1750|\ +engenius,ens202ext-v1|\ etactica,eg200|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts new file mode 100644 index 0000000000..a58d45a840 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +#include "ar9341.dtsi" + +/ { + model = "Engenius ENS202EXT v1"; + compatible = "engenius,ens202ext-v1", "qca,ar9341"; + + aliases { + serial0 = &uart; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset"; + linux,code = <KEY_RESTART>; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "ens202ext-v1:amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan { + label = "ens202ext-v1:amber:wlan"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + rssilow { + label = "ens202ext-v1:red:rssilow"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "ens202ext-v1:amber:rssimedium"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "ens202ext-v1:green:rssihigh"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + }; + + firmware1: partition@230000 { + label = "firmware1"; + reg = <0x230000 0xbc0000>; + }; + + partition@df0000 { + label = "failsafe"; + reg = <0xdf0000 0x200000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 97edb2ecda..23d38aca22 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -144,6 +144,12 @@ dlink,dap-1365-a1) dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; +engenius,ens202ext-v1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:amber:rssimedium" "wlan0" "33" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "67" "100" + ;; engenius,ews511ap) ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth1" ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth0" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 02eef4955e..601e66e886 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -187,6 +187,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan:3" "3:lan:2" ;; + engenius,ens202ext-v1) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" + ;; engenius,ews511ap) ucidef_set_interface_lan "eth0 eth1" "dhcp" ;; @@ -373,7 +378,8 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_binary "Board data" 2) label_mac=$lan_mac ;; - alfa-network,ap121f) + alfa-network,ap121f|\ + engenius,ens202ext-v1) label_mac=$(mtd_get_mac_binary art 0x1002) ;; arduino,yun) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 909c68befa..e6995fa645 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -6,7 +6,7 @@ include ./common-yuncore.mk DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += KERNEL_INITRAMFS_PREFIX -DEVICE_VARS += DAP_SIGNATURE +DEVICE_VARS += DAP_SIGNATURE ENGENIUS_IMGNAME define Build/add-elecom-factory-initramfs $(eval edimax_model=$(word 1,$(1))) @@ -50,6 +50,23 @@ define Build/cybertan-trx -rm $@-empty.bin endef +# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to +# sysupgrade, as otherwise it will implant the old configuration from +# OEM firmware when writing rootfs from factory.bin +define Build/engenius-tar-gz + -[ -f "$@" ] && \ + mkdir -p $@.tmp && \ + echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ + echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ + $(CP) $(KDIR)/loader-$(DEVICE_NAME).uImage \ + $@.tmp/openwrt-$(word 1,$(1))-uImage-lzma.bin && \ + $(CP) $@ $@.tmp/openwrt-$(word 1,$(1))-root.squashfs && \ + $(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \ + $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \ + -C $@.tmp . | gzip -9n > $@ && \ + rm -rf $@.tmp +endef + define Build/mkdapimg2 $(STAGING_DIR_HOST)/bin/mkdapimg2 \ -i $@ -o $@.new \ @@ -805,6 +822,32 @@ define Device/engenius_ecb1750 endef TARGET_DEVICES += engenius_ecb1750 +define Device/engenius_loader_okli + DEVICE_VENDOR := EnGenius + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + LOADER_TYPE := bin + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \ + uImage lzma + IMAGES += factory.bin + IMAGE/factory.bin := append-squashfs-fakeroot-be | pad-to $$$$(BLOCKSIZE) | \ + append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + check-size | engenius-tar-gz $$$$(ENGENIUS_IMGNAME) +endef + +define Device/engenius_ens202ext-v1 + $(Device/engenius_loader_okli) + SOC := ar9341 + DEVICE_MODEL := ENS202EXT + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := rssileds + IMAGE_SIZE := 12032k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := senao-ens202ext +endef +TARGET_DEVICES += engenius_ens202ext-v1 + define Device/engenius_epg5000 SOC := qca9558 DEVICE_VENDOR := EnGenius |