diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-07-06 14:06:30 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-08-28 20:33:15 +0100 |
commit | cffc77ae55ed0e5b9e70417d6a1e1d280cea92cf (patch) | |
tree | df102b03b69506a9624ba4de30334f68763f369a /target/linux/mediatek/filogic/base-files | |
parent | dabcaac443d9ac2e05acc4de5e588356dd1f8bfa (diff) | |
download | upstream-cffc77ae55ed0e5b9e70417d6a1e1d280cea92cf.tar.gz upstream-cffc77ae55ed0e5b9e70417d6a1e1d280cea92cf.tar.bz2 upstream-cffc77ae55ed0e5b9e70417d6a1e1d280cea92cf.zip |
mediatek: add filogic subtarget
Initially this covers MT7986 only, but it will later be expanded to cover other
Filogic branded platforms by MediaTek
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/filogic/base-files')
-rw-r--r-- | target/linux/mediatek/filogic/base-files/etc/board.d/02_network | 26 | ||||
-rwxr-xr-x | target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh | 30 |
2 files changed, 56 insertions, 0 deletions
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network new file mode 100644 index 0000000000..9168e4d399 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -0,0 +1,26 @@ + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +mediatek_setup_interfaces() +{ + local board="$1" + + case $board in + mediatek,mt7986a-rfb|\ + mediatek,mt7986b-rfb) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan + ;; + *) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan + ;; + esac +} + +board_config_update +board=$(board_name) +mediatek_setup_interfaces $board +board_config_flush + +exit 0 diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh new file mode 100755 index 0000000000..bdb3309faa --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -0,0 +1,30 @@ +REQUIRE_IMAGE_METADATA=1 + +platform_do_upgrade() { + local board=$(board_name) + local file_type=$(identify $1) + + case "$board" in + *) + nand_do_upgrade "$1" + ;; + esac +} + +PART_NAME=firmware + +platform_check_image() { + local board=$(board_name) + local magic="$(get_magic_long "$1")" + + [ "$#" -gt 1 ] && return 1 + + case "$board" in + *) + nand_do_platform_check "$board" "$1" + return 0 + ;; + esac + + return 0 +} |