octeon/generic: ubnt,erlite: define profile
authorFabian Groffen <grobian@gentoo.org>
Sat, 25 Jan 2025 08:30:59 +0000 (09:30 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 16 Feb 2025 15:06:10 +0000 (16:06 +0100)
Currently the erlite install shows Model as EBNT_E100, uses eth0 as lan,
eth1 as wan, and doesn't use eth2.

- define dts for this device, such that we get a cleaner naming here
- fix handing of this device to inlude eth2
- change eth0 to wan, like er-4/usg/etc as it once was intended

Fixes: https://github.com/openwrt/openwrt/issues/14946
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Link: https://github.com/openwrt/openwrt/pull/17758
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/octeon/base-files/etc/board.d/01_network
target/linux/octeon/base-files/lib/preinit/01_sysinfo
target/linux/octeon/base-files/lib/preinit/79_move_config
target/linux/octeon/base-files/lib/upgrade/platform.sh
target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn5020_ubnt_edgerouter-lite.dts [new file with mode: 0644]
target/linux/octeon/image/Makefile

index 2443c90d60a6e3dc5f941ab3760265c8e3eb1379..10af4e8d415c1cfb8e6c48dbad852e6560ace1ee 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2025 OpenWrt.org
 #
 
 . /lib/functions/uci-defaults.sh
@@ -8,6 +8,7 @@ board_config_update
 
 case "$(board_name)" in
 itus,shield-router|\
+ubnt,erlite|\
 ubnt,usg)
        ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
        ;;
index 923e3824c71e990de8cc28472004801df353c36c..53ac1fe63a18b7e5451101d4383f0abc5b0881ad 100644 (file)
@@ -14,8 +14,11 @@ do_sysinfo_octeon() {
        esac
 
        case "$machine" in
-       "UBNT_E100"*)
-               name="erlite"
+       "UBNT_E100"*|\
+       "UBNT_E300"*|\
+       "UBNT_USG"*)
+               # let generic 02_sysinfo handle it since device has its own device tree
+               return 0
                ;;
 
        "UBNT_E200"*)
@@ -26,12 +29,6 @@ do_sysinfo_octeon() {
                name="erpro"
                ;;
 
-       "UBNT_E300"*|\
-       "UBNT_USG"*)
-               # let generic 02_sysinfo handle it since device has its own device tree
-               return 0
-               ;;
-
        "ITUS_SHIELD"*)
                name="itus,shield-router"
                ;;
index db99e02ce8e44caa29c73ed8d237bcca9ea2a410..cb7bdd26f30744aa06200cf85cd1717696bf271c 100644 (file)
@@ -25,7 +25,7 @@ octeon_move_config() {
        . /lib/functions.sh
 
        case "$(board_name)" in
-               erlite|\
+               ubnt,erlite|\
                ubnt,usg)
                        move_config "/dev/sda1" "vfat"
                        ;;
index b8a856712b81358bef252adf27013caa20687159..62f97e86e471fff27687b704bfe8f9d145e09af7 100755 (executable)
@@ -47,7 +47,7 @@ platform_copy_config_helper() {
 
 platform_copy_config() {
        case "$(board_name)" in
-       erlite|\
+       ubnt,erlite|\
        ubnt,usg)
                platform_copy_config_helper /dev/sda1 vfat
                ;;
@@ -132,7 +132,7 @@ platform_do_upgrade() {
        ubnt,edgerouter-6p)
                kernel=/dev/mmcblk0p1
                ;;
-       erlite|\
+       ubnt,erlite|\
        ubnt,usg)
                kernel=/dev/sda1
                ;;
@@ -161,10 +161,10 @@ platform_check_image() {
 
        case "$board" in
        er | \
-       erlite | \
        itus,shield-router | \
        ubnt,edgerouter-4 | \
        ubnt,edgerouter-6p | \
+       ubnt,erlite | \
        ubnt,usg | \
        cisco,vedge1000)
                local kernel_length=$(tar xf $tar_file $board_dir/kernel -O | wc -c 2> /dev/null)
diff --git a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn5020_ubnt_edgerouter-lite.dts b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn5020_ubnt_edgerouter-lite.dts
new file mode 100644 (file)
index 0000000..147a258
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Device tree source for Ubiquity Edgerouter Lite
+ */
+
+/include/ "ubnt_e100.dts"
+
+/ {
+       compatible = "ubnt,erlite", "cavium,cn5020";
+       model = "Ubiquiti Edgerouter Lite";
+};
index dec04809150aeef56b9fa39f3041eb49fdffd4ec..7b20247f1f8abfc2df655561713fb12dc535f052 100644 (file)
@@ -79,18 +79,21 @@ ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eepr
 define Device/ubnt_edgerouter-lite
   DEVICE_VENDOR := Ubiquiti
   DEVICE_MODEL := EdgeRouter Lite
-  BOARD_NAME := erlite
+  DEVICE_DTS := cn5020_ubnt_edgerouter-lite
+  KERNEL := kernel-bin | patch-cmdline | append-dtb-to-elf
+  KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
   CMDLINE := $(ERLITE_CMDLINE)
-  SUPPORTED_DEVICES += erlite
+  SUPPORTED_DEVICES += erlite ubnt,erlite
 endef
 TARGET_DEVICES += ubnt_edgerouter-lite
 
 define Device/ubnt_unifi-usg
-  $(Device/ubnt_edgerouter-lite)
+  DEVICE_VENDOR := Ubiquiti
   DEVICE_MODEL := UniFi Security Gateway
   BOARD_NAME := ubnt,usg
   DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio
   DEVICE_DTS := cn5020_ubnt_usg
+  CMDLINE := $(ERLITE_CMDLINE)
   KERNEL += | append-dtb-to-elf
   SUPPORTED_DEVICES += ubnt,usg
 endef