Yangbo ab8daea73a
ipq40xx: add support for MobiPromo CM520-79F (#28) (#3378)
From LGA1150 dalao (https://github.com/LGA1150/openwrt)

Warning: The compiled firmware only supports flashing under OpBoot.

MobiPromo CM520-79F is an AC1300 dual band router based on IPQ4019

Specification:

SoC/Wireless: QCA IPQ4019
RAM: 512MiB
Flash: 128MiB SLC NAND
Ethernet PHY: QCA8075
Ethernet ports: 1x WAN, 2x LAN
LEDs: 7 LEDs
      2 (USB, CAN) are GPIO
            other 5 (2.4G, 5G, LAN1, LAN2, WAN) are connected to a shift
	    register

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>

ipq40xx: fix build error for cm520-79f (#30)

This commit fix 94a743ea531b4c10e91c17dc17535471e95f308b

Signed-off-by: AmadeusGhost <amadeus@jmu.edu.cn>

CM520-79F: fix wan port (#33)

This commit fix 223124e

Signed-off-by: AmadeusGhost <amadeus@jmu.edu.cn>

CM520-79F: disable vlan

Co-authored-by: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
2020-02-28 23:20:23 +08:00

99 lines
2.0 KiB
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ipq40xx_setup_interfaces()
{
local board="$1"
case "$board" in
8dev,jalapeno)
ucidef_add_switch "switch0" \
"0t@eth0" "4:lan" "5:wan"
;;
p2w,r619ac|\
p2w,r619ac-128m|\
zyxel,nbg6617)
ucidef_add_switch "switch0" \
"0t@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan:5"
;;
asus,map-ac2200|\
openmesh,a42|\
openmesh,a62)
ucidef_add_switch "switch0" \
"0t@eth0" "5:lan" "4:wan"
;;
asus,rt-acrh17|\
asus,rt-ac58u|\
avm,fritzbox-4040|\
linksys,ea6350v3)
ucidef_add_switch "switch0" \
"0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
;;
compex,wpj428)
ucidef_set_interface_lan "eth0 eth1"
;;
engenius,eap1300|\
meraki,mr33|\
netgear,ex6100v2|\
netgear,ex6150v2|\
zyxel,wre6606)
ucidef_set_interface_lan "eth0"
;;
glinet,gl-b1300)
ucidef_add_switch "switch0" \
"0t@eth0" "3:lan" "4:lan" "5:wan"
;;
hugo,ac1200)
ucidef_add_switch "switch0" \
"0t@eth0" "5:wan" "3:lan"
;;
mobipromo,cm520-79f)
ucidef_add_switch "switch0" \
"0t@eth0" "3:lan:2" "4:lan:1" "5:wan"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
ipq40xx_setup_macs()
{
local board="$1"
case "$board" in
asus,rt-acrh17|\
asus,rt-ac58u)
CI_UBIPART=UBI_DEV
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
p2w,r619ac|\
p2w,r619ac-128m)
wan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
linksys,ea6350v3)
wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
}
board_config_update
board=$(board_name)
ipq40xx_setup_interfaces $board
ipq40xx_setup_macs $board
board_config_flush
exit 0