rb750gr3|\
rt-n14u|\
ubnt-erx|\
+ ubnt-erx-sfp|\
ur-326n4g|\
wrtnode|\
wrtnode2p | \
--- /dev/null
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+. /lib/ramips.sh
+
+board_config_update
+
+board=$(ramips_board_name)
+
+case "$board" in
+ubnt-erx)
+ ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "0"
+ ;;
+ubnt-erx-sfp)
+ ucidef_add_gpio_switch "poe_power_port0" "PoE Power Port0" "496"
+ ucidef_add_gpio_switch "poe_power_port1" "PoE Power Port1" "497"
+ ucidef_add_gpio_switch "poe_power_port2" "PoE Power Port2" "498"
+ ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "499"
+ ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "500"
+ ;;
+esac
+
+board_config_flush
+
+exit 0
*"UBNT-ERX")
name="ubnt-erx"
;;
+ *"UBNT-ERX-SFP")
+ name="ubnt-erx-sfp"
+ ;;
*"UR-326N4G")
name="ur-326n4g"
;;
# these boards use metadata images
return 0
;;
- ubnt-erx)
+ ubnt-erx|\
+ ubnt-erx-sfp)
nand_do_platform_check "$board" "$1"
return $?;
;;
local board=$(ramips_board_name)
case "$board" in
- ubnt-erx)
+ ubnt-erx|\
+ ubnt-erx-sfp)
platform_upgrade_ubnt_erx "$ARGV"
;;
esac
case "$board" in
hc5962|\
r6220|\
- ubnt-erx)
+ ubnt-erx|\
+ ubnt-erx-sfp)
nand_do_upgrade "$ARGV"
;;
*)
--- /dev/null
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "ubiquiti,edgerouterx";
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x10000000>;
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,57600";
+ };
+
+ gpio-keys-polled {
+ compatible = "gpio-keys-polled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ poll-interval = <20>;
+
+ reset {
+ label = "reset";
+ gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+ðernet {
+ mtd-mac-address = <&factory 0x22>;
+};
+
+&nand {
+ status = "okay";
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x80000>;
+ read-only;
+ };
+
+ partition@80000 {
+ label = "u-boot-env";
+ reg = <0x80000 0x60000>;
+ read-only;
+ };
+
+ factory: partition@e0000 {
+ label = "factory";
+ reg = <0xe0000 0x60000>;
+ };
+
+ partition@140000 {
+ label = "kernel1";
+ reg = <0x140000 0x300000>;
+ };
+
+ partition@440000 {
+ label = "kernel2";
+ reg = <0x440000 0x300000>;
+ };
+
+ partition@740000 {
+ label = "ubi";
+ reg = <0x740000 0xf7c0000>;
+ };
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "uart2", "uart3", "i2c", "pcie", "rgmii2", "jtag";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&spi0 {
+ /* This board has 2Mb spi flash soldered in and visible
+ from manufacturer's firmware.
+ But this SoC shares spi and nand pins,
+ and current driver does't handle this sharing well */
+ status = "disabled";
+
+ m25p80@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <1>;
+ spi-max-frequency = <10000000>;
+ m25p,chunked-io = <32>;
+
+ partition@0 {
+ label = "spi";
+ reg = <0x0 0x200000>;
+ read-only;
+ };
+ };
+};
+
+&xhci {
+ status = "disabled";
+};
--- /dev/null
+/dts-v1/;
+
+#include "UBNT-ER-e50.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ model = "UBNT-ERX-SFP";
+ compatible = "ubiquiti,edgerouterx-sfp";
+
+ i2c-gpio {
+ compatible = "i2c-gpio";
+ gpios = <&gpio0 3 GPIO_ACTIVE_HIGH /* sda */
+ &gpio0 4 GPIO_ACTIVE_HIGH /* scl */
+ >;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pca9555@25 {
+ compatible = "pca9555";
+ reg = <0x25>;
+ };
+ };
+};
/dts-v1/;
-#include "mt7621.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "UBNT-ER-e50.dtsi"
/ {
model = "UBNT-ERX";
-
- memory@0 {
- device_type = "memory";
- reg = <0x0 0x10000000>;
- };
-
- chosen {
- bootargs = "console=ttyS0,57600";
- };
-
- gpio-keys-polled {
- compatible = "gpio-keys-polled";
- #address-cells = <1>;
- #size-cells = <0>;
- poll-interval = <20>;
-
- reset {
- label = "reset";
- gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
- linux,code = <KEY_RESTART>;
- };
- };
-};
-
-ðernet {
- mtd-mac-address = <&factory 0x22>;
-};
-
-&nand {
- status = "okay";
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x80000>;
- read-only;
- };
-
- partition@80000 {
- label = "u-boot-env";
- reg = <0x80000 0x60000>;
- read-only;
- };
-
- factory: partition@e0000 {
- label = "factory";
- reg = <0xe0000 0x60000>;
- };
-
- partition@140000 {
- label = "kernel1";
- reg = <0x140000 0x300000>;
- };
-
- partition@440000 {
- label = "kernel2";
- reg = <0x440000 0x300000>;
- };
-
- partition@740000 {
- label = "ubi";
- reg = <0x740000 0xf7c0000>;
- };
-};
-
-&pinctrl {
- state_default: pinctrl0 {
- gpio {
- ralink,group = "uart2", "uart3", "i2c", "pcie", "rgmii2", "jtag";
- ralink,function = "gpio";
- };
- };
-};
-
-&spi0 {
- /* This board has 2Mb spi flash soldered in and visible
- from manufacturer's firmware.
- But this SoC shares spi and nand pins,
- and current driver does't handle this sharing well */
- status = "disabled";
-
- m25p80@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "jedec,spi-nor";
- reg = <1>;
- spi-max-frequency = <10000000>;
- m25p,chunked-io = <32>;
-
- partition@0 {
- label = "spi";
- reg = <0x0 0x200000>;
- read-only;
- };
- };
-};
-
-&xhci {
- status = "disabled";
};
endef
TARGET_DEVICES += ubnt-erx
+define Device/ubnt-erx-sfp
+ DTS := UBNT-ERX-SFP
+ FILESYSTEMS := squashfs
+ KERNEL_SIZE := 3145728
+ KERNEL := $(KERNEL_DTB) | uImage lzma
+ IMAGES := sysupgrade.tar
+ KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
+ IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
+ DEVICE_TITLE := Ubiquiti EdgeRouter X-SFP
+ DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
+endef
+TARGET_DEVICES += ubnt-erx-sfp
+
define Device/vr500
DTS := VR500
IMAGE_SIZE := 66453504