Skip to content

Commit

Permalink
airoha: WIP test for rootfs ubi mount
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel committed Sep 5, 2024
1 parent 4f1eed5 commit fb56449
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 2 deletions.
22 changes: 22 additions & 0 deletions target/linux/airoha/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

. /lib/functions.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh

mediatek_setup_interfaces()
{
local board="$1"

case $board in
*)
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

trigger_fip_scrubbing() {
local vol voltype volname
for vol in /sys/class/ubi/ubi*_*; do
[ -e "$vol" ] || continue
voltype="$(cat "$vol"/type)"
volname="$(cat "$vol"/name)"
if [ "$voltype" = "static" ] && [ "$volname" = "fip" ]; then
cat "/dev/${vol##*/}" > /dev/null
break
fi
done
}

boot_hook_add preinit_main trigger_fip_scrubbing
24 changes: 24 additions & 0 deletions target/linux/airoha/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
platform_do_upgrade() {
local board=$(board_name)

case "$board" in
*)
nand_do_upgrade "$1"
;;
esac
}

PART_NAME=tclinux

platform_check_image() {
local board=$(board_name)

case "$board" in
*)
nand_do_platform_check "$board" "$1"
return $?
;;
esac

return 0
}
2 changes: 1 addition & 1 deletion target/linux/airoha/dts/en7581-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
compatible = "denx,fit";
reg = <0x00080000 0x02800000>;

openwrt,fit-offset = <0x2100>;
// openwrt,fit-offset = <0x2100>;
};
tclinux_slave@2880000 {
label = "tclinux_slave";
Expand Down
11 changes: 10 additions & 1 deletion target/linux/airoha/en7581/config-6.6
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,16 @@ CONFIG_MTD_NAND_MTK_BMT=y
# end of LPDDR & LPDDR2 PCM memory drivers

# CONFIG_MTD_SPI_NOR is not set
# CONFIG_MTD_UBI is not set
CONFIG_MTD_UBI=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_XZ=y
CONFIG_OVERLAY_FS=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_MTD_UBI_BLOCK=y
# CONFIG_MTD_HYPERBUS is not set
CONFIG_DTC=y
CONFIG_OF=y
Expand Down
10 changes: 10 additions & 0 deletions target/linux/airoha/image/en7581.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
define Device/FitImageLzma
KERNEL_SUFFIX := -uImage.itb
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
endef

define Device/airoha_en7581-evb
$(call Device/FitImageLzma)
DEVICE_VENDOR := Airoha
DEVICE_MODEL := EN7581 Evaluation Board (SNAND)
DEVICE_PACKAGES := kmod-leds-pwm kmod-i2c-en7581 kmod-pwm-airoha kmod-input-gpio-keys-polled
DEVICE_DTS := en7581-evb
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_CONFIG := config@1
KERNEL_LOADADDR := 0x80088000
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
endef
TARGET_DEVICES += airoha_en7581-evb

Expand Down

0 comments on commit fb56449

Please sign in to comment.