mvebu: split base-files across subtargets

For the mvebu target in particular, there is a lot of files in
base-files that are only relevant for one subtarget. Improve
overview and reduce size per subtarget by moving/splitting
base-files depending on the subtarget they belong to.

While at it, consolidate 01_leds by using the model part of
the board name as variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
master
Adrian Schmutzler 2020-01-18 02:21:13 +01:00
parent e93626f1f4
commit 1fa04b5d9f
17 changed files with 251 additions and 129 deletions

View File

@ -1,55 +0,0 @@
#!/bin/sh
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
linksys,caiman)
ucidef_set_led_netdev "wan" "WAN" "pca963x:caiman:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:caiman:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:caiman:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:caiman:white:usb3_2" "usb3-port1"
;;
linksys,cobra)
ucidef_set_led_netdev "wan" "WAN" "pca963x:cobra:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:cobra:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:cobra:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:cobra:white:usb3_2" "usb3-port1"
;;
linksys,mamba)
ucidef_set_led_netdev "wan" "WAN" "mamba:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "mamba:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "mamba:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "mamba:white:usb3_2" "usb3-port2"
;;
linksys,rango)
ucidef_set_led_netdev "wan" "WAN" "pca963x:rango:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:rango:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:rango:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:rango:white:usb3_2" "usb3-port1"
;;
linksys,shelby)
ucidef_set_led_netdev "wan" "WAN" "pca963x:shelby:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:shelby:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:shelby:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:shelby:white:usb3_2" "usb3-port1"
;;
linksys,venom)
ucidef_set_led_netdev "wan" "WAN" "pca963x:venom:blue:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:venom:blue:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:venom:blue:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:venom:blue:usb3_2" "usb3-port1"
;;
esac
board_config_flush
exit 0

View File

@ -1,52 +0,0 @@
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
case "$(board_name)" in
cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
platform_check_image_sdcard "$1"
;;
*)
return 0
;;
esac
}
platform_do_upgrade() {
case "$(board_name)" in
linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
platform_do_upgrade_linksys "$1"
;;
cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
platform_do_upgrade_sdcard "$1"
;;
methode,udpu)
platform_do_upgrade_uDPU "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}
platform_copy_config() {
case "$(board_name)" in
linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
platform_copy_config_linksys
;;
cznic,turris-omnia|globalscale,espressobin|globalscale,espressobin-emmc|globalscale,espressobin-v7|globalscale,espressobin-v7-emmc|\
marvell,armada8040-mcbin|solidrun,clearfog-base-a1|solidrun,clearfog-pro-a1)
platform_copy_config_sdcard
;;
methode,udpu)
platform_copy_config_uDPU
;;
esac
}

View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc)
ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
;;
marvell,armada-3720-db|\
methode,udpu)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
*)
ucidef_set_interface_lan "eth0"
;;
esac
board_config_flush
exit 0

View File

@ -0,0 +1,52 @@
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
case "$(board_name)" in
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc)
platform_check_image_sdcard "$1"
;;
*)
return 0
;;
esac
}
platform_do_upgrade() {
case "$(board_name)" in
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc)
platform_do_upgrade_sdcard "$1"
;;
methode,udpu)
platform_do_upgrade_uDPU "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}
platform_copy_config() {
case "$(board_name)" in
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc)
platform_copy_config_sdcard
;;
methode,udpu)
platform_copy_config_uDPU
;;
esac
}

View File

@ -0,0 +1,30 @@
#!/bin/sh
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
marvell,armada8040-mcbin)
ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
;;
marvell,armada8040-db)
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
;;
marvell,armada7040-db)
ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
;;
*)
ucidef_set_interface_lan "eth0"
;;
esac
board_config_flush
exit 0

View File

@ -0,0 +1,37 @@
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
case "$(board_name)" in
marvell,armada8040-mcbin)
platform_check_image_sdcard "$1"
;;
*)
return 0
;;
esac
}
platform_do_upgrade() {
case "$(board_name)" in
marvell,armada8040-mcbin)
platform_do_upgrade_sdcard "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}
platform_copy_config() {
case "$(board_name)" in
marvell,armada8040-mcbin)
platform_copy_config_sdcard
;;
esac
}

View File

@ -0,0 +1,40 @@
#!/bin/sh
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
boardname="${board##*,}"
case "$board" in
linksys,caiman|\
linksys,cobra|\
linksys,rango|\
linksys,shelby)
ucidef_set_led_netdev "wan" "WAN" "pca963x:$boardname:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:$boardname:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:$boardname:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:$boardname:white:usb3_2" "usb3-port1"
;;
linksys,mamba)
ucidef_set_led_netdev "wan" "WAN" "mamba:white:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "mamba:white:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "mamba:white:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "mamba:white:usb3_2" "usb3-port2"
;;
linksys,venom)
ucidef_set_led_netdev "wan" "WAN" "pca963x:venom:blue:wan" "eth1"
ucidef_set_led_usbport "usb1" "USB 1" "pca963x:venom:blue:usb2" "usb1-port1"
ucidef_set_led_usbport "usb2" "USB 2" "pca963x:venom:blue:usb3_1" "usb2-port1" "usb3-port1"
ucidef_set_led_usbport "usb2_ss" "USB 2 SS" "pca963x:venom:blue:usb3_2" "usb3-port1"
;;
esac
board_config_flush
exit 0

View File

@ -15,12 +15,6 @@ cznic,turris-omnia)
ucidef_set_interface_lan "lan0 lan1 lan2 lan3 lan4"
ucidef_set_interface_wan "eth2"
;;
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc)
ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
;;
linksys,caiman|\
linksys,cobra|\
linksys,mamba|\
@ -34,25 +28,11 @@ linksys,venom)
marvell,a385-db-ap)
ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
;;
marvell,armada8040-mcbin)
ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
;;
marvell,armada8040-db)
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
;;
marvell,armada7040-db)
ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
;;
marvell,armada-3720-db)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
marvell,axp-gp)
ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
;;
methode,udpu)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
solidrun,clearfog-a1|solidrun,clearfog-pro-a1)
solidrun,clearfog-a1|\
solidrun,clearfog-pro-a1)
# eth0 is standalone ethernet
# eth1 is switch
# eth2 is SFP

View File

@ -0,0 +1,59 @@
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
REQUIRE_IMAGE_METADATA=1
platform_check_image() {
case "$(board_name)" in
cznic,turris-omnia|\
solidrun,clearfog-base-a1|\
solidrun,clearfog-pro-a1)
platform_check_image_sdcard "$1"
;;
*)
return 0
;;
esac
}
platform_do_upgrade() {
case "$(board_name)" in
cznic,turris-omnia|\
solidrun,clearfog-base-a1|\
solidrun,clearfog-pro-a1)
platform_do_upgrade_sdcard "$1"
;;
linksys,caiman|\
linksys,cobra|\
linksys,mamba|\
linksys,rango|\
linksys,shelby|\
linksys,venom)
platform_do_upgrade_linksys "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}
platform_copy_config() {
case "$(board_name)" in
cznic,turris-omnia|\
solidrun,clearfog-base-a1|\
solidrun,clearfog-pro-a1)
platform_copy_config_sdcard
;;
linksys,caiman|\
linksys,cobra|\
linksys,mamba|\
linksys,rango|\
linksys,shelby|\
linksys,venom)
platform_copy_config_linksys
;;
esac
}