forked from openwrt/openwrt
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
octeon: add support for Ubiquiti UniFi Security Gateway
Ubiquiti UniFi Security Gateway (USG) is largely identical to the EdgeRouter Lite (ERLite-3) apart from a different board ID and two dome leds. Device data (from WikiDev): CPU: Cavium Octeon Plus CN5020 @500mhz 2-cores Ethernet: 3x Atheros AR8035-A GbE PHY's Flash: On-board 4MB Flash Storage: Internal 3.8GB USB Flash (Kingston ID) drive w/ 1.5GB free for use occupies single internal USB port. Serial: 1x RJ45 port on front panel. 115200, 8N1 Buttons: 1x Reset Flash instructions are identical to EdgeRouter Lite. Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
- Loading branch information
Showing
8 changed files
with
211 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn5020_ubnt_usg.dts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Device tree source for Ubiquity UniFi Security Gateway. | ||
* | ||
* Written for EdgeRouter Lite by: Aaro Koskinen <aaro.koskinen@iki.fi> | ||
* Adapted for USG by: Clemens Hopfer <openwrt@wireloss.net> | ||
*/ | ||
|
||
/include/ "octeon_3xxx.dtsi" | ||
#include <dt-bindings/gpio/gpio.h> | ||
#include <dt-bindings/input/input.h> | ||
|
||
/ { | ||
compatible = "ubnt,usg"; | ||
model = "Ubiquiti UniFi Security Gateway"; | ||
|
||
soc@0 { | ||
smi0: mdio@1180000001800 { | ||
phy5: ethernet-phy@5 { | ||
reg = <5>; | ||
compatible = "ethernet-phy-ieee802.3-c22"; | ||
}; | ||
phy6: ethernet-phy@6 { | ||
reg = <6>; | ||
compatible = "ethernet-phy-ieee802.3-c22"; | ||
}; | ||
phy7: ethernet-phy@7 { | ||
reg = <7>; | ||
compatible = "ethernet-phy-ieee802.3-c22"; | ||
}; | ||
}; | ||
|
||
pip: pip@11800a0000000 { | ||
interface@0 { | ||
ethernet@0 { | ||
phy-handle = <&phy7>; | ||
rx-delay = <0>; | ||
tx-delay = <0x10>; | ||
}; | ||
ethernet@1 { | ||
phy-handle = <&phy6>; | ||
rx-delay = <0>; | ||
tx-delay = <0x10>; | ||
}; | ||
ethernet@2 { | ||
phy-handle = <&phy5>; | ||
rx-delay = <0>; | ||
tx-delay = <0x10>; | ||
}; | ||
}; | ||
}; | ||
|
||
uart0: serial@1180000000800 { | ||
clock-frequency = <500000000>; | ||
}; | ||
|
||
usbn: usbn@1180068000000 { | ||
refclk-frequency = <12000000>; | ||
refclk-type = "crystal"; | ||
}; | ||
|
||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
|
||
led_dome_white: led-0 { | ||
label = "white:dome"; | ||
gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
led_dome_blue: led-1 { | ||
label = "blue:dome"; | ||
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; | ||
|
||
keys { | ||
compatible = "gpio-keys-polled"; | ||
poll-interval = <20>; | ||
|
||
key-restart { | ||
label = "reset"; | ||
linux,code = <KEY_RESTART>; | ||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>; | ||
debounce-interval = <60>; | ||
}; | ||
}; | ||
|
||
aliases { | ||
pip = &pip; | ||
led-boot = &led_dome_white; | ||
led-failsafe = &led_dome_blue; | ||
led-running = &led_dome_blue; | ||
led-upgrade = &led_dome_blue; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
target/linux/octeon/patches-5.10/150-ubnt_usg_support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h | ||
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h | ||
@@ -296,6 +296,7 @@ enum cvmx_board_types_enum { | ||
CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, | ||
CVMX_BOARD_TYPE_UBNT_E100 = 20002, | ||
CVMX_BOARD_TYPE_UBNT_E200 = 20003, | ||
+ CVMX_BOARD_TYPE_UBNT_USG = 20004, | ||
CVMX_BOARD_TYPE_UBNT_E220 = 20005, | ||
CVMX_BOARD_TYPE_ITUS_SHIELD = 20006, | ||
CVMX_BOARD_TYPE_UBNT_E300 = 20300, | ||
@@ -399,6 +400,7 @@ static inline const char *cvmx_board_typ | ||
/* Customer private range */ | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) | ||
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_USG) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_ITUS_SHIELD) | ||
--- a/arch/mips/cavium-octeon/octeon-platform.c | ||
+++ b/arch/mips/cavium-octeon/octeon-platform.c | ||
@@ -634,6 +634,7 @@ static void __init octeon_rx_tx_delay(in | ||
} | ||
break; | ||
case CVMX_BOARD_TYPE_UBNT_E100: | ||
+ case CVMX_BOARD_TYPE_UBNT_USG: | ||
if (iface == 0 && port <= 2) { | ||
_octeon_rx_tx_delay(eth, 0x0, 0x10); | ||
return; | ||
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c | ||
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c | ||
@@ -170,6 +170,7 @@ int cvmx_helper_board_get_mii_address(in | ||
else | ||
return -1; | ||
case CVMX_BOARD_TYPE_UBNT_E100: | ||
+ case CVMX_BOARD_TYPE_UBNT_USG: | ||
if (ipd_port >= 0 && ipd_port <= 2) | ||
return 7 - ipd_port; | ||
else | ||
@@ -337,6 +338,7 @@ enum cvmx_helper_board_usb_clock_types _ | ||
case CVMX_BOARD_TYPE_LANAI2_G: | ||
case CVMX_BOARD_TYPE_NIC10E_66: | ||
case CVMX_BOARD_TYPE_UBNT_E100: | ||
+ case CVMX_BOARD_TYPE_UBNT_USG: | ||
return USB_CLOCK_TYPE_CRYSTAL_12; | ||
case CVMX_BOARD_TYPE_NIC10E: | ||
return USB_CLOCK_TYPE_REF_12; |
46 changes: 46 additions & 0 deletions
46
target/linux/octeon/patches-5.15/150-ubnt_usg_support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h | ||
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h | ||
@@ -296,6 +296,7 @@ enum cvmx_board_types_enum { | ||
CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, | ||
CVMX_BOARD_TYPE_UBNT_E100 = 20002, | ||
CVMX_BOARD_TYPE_UBNT_E200 = 20003, | ||
+ CVMX_BOARD_TYPE_UBNT_USG = 20004, | ||
CVMX_BOARD_TYPE_UBNT_E220 = 20005, | ||
CVMX_BOARD_TYPE_ITUS_SHIELD = 20006, | ||
CVMX_BOARD_TYPE_UBNT_E300 = 20300, | ||
@@ -399,6 +400,7 @@ static inline const char *cvmx_board_typ | ||
/* Customer private range */ | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) | ||
+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_USG) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) | ||
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_ITUS_SHIELD) | ||
--- a/arch/mips/cavium-octeon/octeon-platform.c | ||
+++ b/arch/mips/cavium-octeon/octeon-platform.c | ||
@@ -634,6 +634,7 @@ static void __init octeon_rx_tx_delay(in | ||
} | ||
break; | ||
case CVMX_BOARD_TYPE_UBNT_E100: | ||
+ case CVMX_BOARD_TYPE_UBNT_USG: | ||
if (iface == 0 && port <= 2) { | ||
_octeon_rx_tx_delay(eth, 0x0, 0x10); | ||
return; | ||
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c | ||
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c | ||
@@ -170,6 +170,7 @@ int cvmx_helper_board_get_mii_address(in | ||
else | ||
return -1; | ||
case CVMX_BOARD_TYPE_UBNT_E100: | ||
+ case CVMX_BOARD_TYPE_UBNT_USG: | ||
if (ipd_port >= 0 && ipd_port <= 2) | ||
return 7 - ipd_port; | ||
else | ||
@@ -337,6 +338,7 @@ enum cvmx_helper_board_usb_clock_types _ | ||
case CVMX_BOARD_TYPE_LANAI2_G: | ||
case CVMX_BOARD_TYPE_NIC10E_66: | ||
case CVMX_BOARD_TYPE_UBNT_E100: | ||
+ case CVMX_BOARD_TYPE_UBNT_USG: | ||
return USB_CLOCK_TYPE_CRYSTAL_12; | ||
case CVMX_BOARD_TYPE_NIC10E: | ||
return USB_CLOCK_TYPE_REF_12; |