aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621/base-files
diff options
context:
space:
mode:
authorPiotr Dymacz <pepe2k@gmail.com>2019-11-03 12:12:44 +0100
committerPiotr Dymacz <pepe2k@gmail.com>2019-11-14 01:37:54 +0100
commite68539aca43a560077364de27eb220f1d85ca3ef (patch)
treed6f7e79382b0b351b36117cecbdefbbc1ca0c764 /target/linux/ramips/mt7621/base-files
parent44d7a14a83dbe359593c5ae7e71513c3e596b6b8 (diff)
downloadupstream-e68539aca43a560077364de27eb220f1d85ca3ef.tar.gz
upstream-e68539aca43a560077364de27eb220f1d85ca3ef.tar.bz2
upstream-e68539aca43a560077364de27eb220f1d85ca3ef.zip
ramips: add support for ALFA Network Quad-E4G
ALFA Network Quad-E4G is a universal Wi-Fi/4G platform, which offers three miniPCIe (PCIe, USB 2.0, SIM) and a single M.2 B-key (dual-SIM, USB 3.0) slots, RTC and five Gigabit Ethernet ports with PoE support. Specification: - MT7621A (880 MHz) - 256/512 MB of RAM (DDR3) - 16/32+ MB of FLASH (SPI NOR) - optional second SPI flash (8-pin WSON/SOIC) - 1x microSD (SDXC) flash card reader - 5x 10/100/100 Mbps Ethernet, with passive PoE support (24 V) in LAN1 - optional 802.3at/af PoE module for WAN - 3x miniPCIe slot (with PCIe and USB 2.0 buses, micro SIM and 5 V) - 1x M.2/NGFF B-key 3042 (USB 3.0/2.0, mini + micro SIM) - RTC (TI BQ32002, I2C bus) with backup battery (CR2032) - external hardware watchdog (EM Microelectronic EM6324) - 1x USB 2.0 Type-A - 1x micro USB Type-B for system serial console (Holtek HT42B534) - 11x LED (5 for Ethernet, 5 driven by GPIO, 1x power indicator) - 3x button (reset, user1, user2) - 1x I2C (4-pin, 2.54 mm pitch) header on PCB - 4x SIM (6-pin, 2.00 mm pitch) headers on PCB - 2x UART2/3 (4-pin, 2.54 mm pitch) headers on PCB - 1x mechanical power switch - 1x DC jack with lock (24 V) Other: - U-Boot selects default SIM slot, based on value of 'default_sim' env variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This board has additional logic circuit for M.2 SIM switching. The 'sim-select' will work only if both SIM slots are occupied. Otherwise, always slot with SIM inside is selected, no matter 'sim-select' value. - U-Boot enables power in all three miniPCIe and M.2 slots before loading the kernel - this board supports 'dual image' feature (controlled by 'dual_image' U-Boot environment variable) - all three miniPCIe slots have additional 5 V supply on pins 47 and 49 - the board allows to install up to two oversized miniPCIe cards (vendor has dedicated MediaTek MT7615N/D cards for this board) - this board has additional logic circuit controlling PERSTn pins inside miniPCIe slots. By default, PERSTn (GPIO19) is routed to all miniPCIe slots but setting GPIO22 to high allows PERSTn control per slot, using GPIO23-25 (value is inverted) You can use the 'sysupgrade' image directly in vendor firmware which is based on OpenWrt (make sure to not preserve settings - use 'sysupgrade -n -F ...' command). Alternatively, use web recovery mode in U-Boot: 1. Power the device with reset button pressed, the modem LED will start blinking slowly and after ~3 seconds, when it starts blinking faster, you can release the button. 2. Setup static IP 192.168.1.2/24 on your PC. 3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Diffstat (limited to 'target/linux/ramips/mt7621/base-files')
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/etc/board.d/02_network24
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/etc/init.d/bootcount4
-rwxr-xr-xtarget/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh14
3 files changed, 31 insertions, 11 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 0de3804cdb..420780a101 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -37,6 +37,18 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
;;
+ alfa-network,quad-e4g|\
+ netgear,r6220|\
+ netgear,r6260|\
+ netgear,r6350|\
+ netgear,r6850|\
+ netgear,wndr3700-v5|\
+ netis,wf-2881|\
+ wevo,11acnas|\
+ wevo,w2914ns-v2)
+ ucidef_add_switch "switch0" \
+ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
+ ;;
asiarf,ap7621-001)
ucidef_add_switch "switch0" "0:lan" "4:wan" "6@eth0"
;;
@@ -106,17 +118,6 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "6@eth0"
;;
- netgear,r6220|\
- netgear,r6260|\
- netgear,r6350|\
- netgear,r6850|\
- netgear,wndr3700-v5|\
- netis,wf-2881|\
- wevo,11acnas|\
- wevo,w2914ns-v2)
- ucidef_add_switch "switch0" \
- "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
- ;;
xiaomi,mir3g)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
@@ -169,6 +170,7 @@ ramips_setup_macs()
zbtlink,zbt-wg2626)
wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
;;
+ alfa-network,quad-e4g|\
asus,rt-ac57u|\
d-team,newifi-d2|\
d-team,pbr-m1|\
diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
index 807801a34f..b4d72abafc 100755
--- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
@@ -4,6 +4,10 @@ START=99
boot() {
case $(board_name) in
+ alfa-network,quad-e4g)
+ [ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\
+ echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s -
+ ;;
samknows,whitebox-v8)
fw_setenv bootcount 0
;;
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index f8aa0373a0..d74aba3bfe 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -5,6 +5,9 @@
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
+RAMFS_COPY_BIN='fw_printenv fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
+
platform_check_image() {
return 0
}
@@ -13,6 +16,17 @@ platform_do_upgrade() {
local board=$(board_name)
case "$board" in
+ alfa-network,quad-e4g)
+ [ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\
+ [ -n "$(find_mtd_part backup)" ] && {
+ PART_NAME=backup
+ if [ "$(fw_printenv -n bootactive 2>/dev/null)" = "1" ]; then
+ fw_setenv bootactive 2 || exit 1
+ else
+ fw_setenv bootactive 1 || exit 1
+ fi
+ }
+ ;;
mikrotik,rb750gr3|\
mikrotik,rbm11g|\
mikrotik,rbm33g)