-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d89725e
commit 7c698d0
Showing
6 changed files
with
177 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
|
||
maskrom() { | ||
pushd "$SCRIPT_DIR" | ||
aiot-bootrom | ||
popd | ||
} | ||
|
||
update_bootloader() { | ||
local DEVICE=$1 | ||
|
||
dd conv=notrunc,fsync if="$SCRIPT_DIR/u-boot.bin.sd.bin" of=$DEVICE bs=1 count=444 | ||
dd conv=notrunc,fsync if="$SCRIPT_DIR/u-boot.bin.sd.bin" of=$DEVICE bs=512 skip=1 seek=1 | ||
sync "$DEVICE" | ||
} | ||
|
||
update_emmc_boot() { | ||
if [[ -f "/sys/class/block/$(basename "$1")/force_ro" ]] | ||
then | ||
echo 0 > "/sys/class/block/$(basename "$1")/force_ro" | ||
fi | ||
update_bootloader "$@" | ||
} | ||
|
||
maskrom_update_bootloader() { | ||
fastboot flash mmc0boot1 "$SCRIPT_DIR/u-boot.bin" | ||
fastboot erase mmc0boot2 | ||
} | ||
|
||
maskrom_erase_bootloader() { | ||
fastboot erase mmc0boot1 | ||
fastboot erase mmc0boot2 | ||
} | ||
|
||
# https://stackoverflow.com/a/28776166 | ||
is_sourced() { | ||
if [ -n "$ZSH_VERSION" ] | ||
then | ||
case $ZSH_EVAL_CONTEXT in | ||
*:file:*) | ||
return 0 | ||
;; | ||
esac | ||
else # Add additional POSIX-compatible shell names here, if needed. | ||
case ${0##*/} in | ||
dash|-dash|bash|-bash|ksh|-ksh|sh|-sh) | ||
return 0 | ||
;; | ||
esac | ||
fi | ||
return 1 # NOT sourced. | ||
} | ||
|
||
if ! is_sourced | ||
then | ||
|
||
set -euo pipefail | ||
shopt -s nullglob | ||
|
||
SCRIPT_DIR="$(dirname "$(realpath "$0")")" | ||
|
||
ACTION="$1" | ||
shift | ||
|
||
if [[ $(type -t $ACTION) == function ]] | ||
then | ||
$ACTION "$@" | ||
else | ||
echo "Unsupported action: '$ACTION'" >&2 | ||
exit 100 | ||
fi | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
custom_source_action() { | ||
# mtk-v2.6 | ||
git_source "https://gitlab.com/mediatek/aiot/bsp/trusted-firmware-a.git" "11a3e271252e3f7583046615c1e8b3b33533d636" "mtk-atf" | ||
# mtk-v3.19 | ||
git_source "https://gitlab.com/mediatek/aiot/bsp/optee-os.git" "8b7fb28b69f45208500847af1975da26a225c02a" "mtk-optee" | ||
git_source "https://gitlab.com/mediatek/aiot/rity/lk-prebuilt.git" "c76361b2704e12d41fb9082aae03f9b68aa9e9a4" | ||
git_source "https://gitlab.com/mediatek/aiot/rity/libdram-prebuilt.git" "df294e73ab8064cbb8da3f3987f4d8829dd9fa73" | ||
git_source "https://gitlab.com/mediatek/aiot/bsp/libbase-prebuilt.git" "6a47bf6b96e1f51776ea397703d381e34a1596c4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
BSP_GIT="https://gitlab.com/mediatek/aiot/bsp/u-boot.git" | ||
BSP_BRANCH="mtk-v2022.10" | ||
USE_ATF="true" | ||
SUPPORTED_BOARDS=("radxa-nio-12l" "radxa-nio-12l-ufs") | ||
|
||
bsp_mt8395() { | ||
BSP_SOC="mt8395" | ||
BSP_BL31_OVERRIDE="mt8195" | ||
BSP_OPTEE_DRAM_SIZE="0x200000000" | ||
} | ||
|
||
bsp_radxa-nio-12l() { | ||
bsp_mt8395 | ||
BSP_MTK_LK_PROJECT="mt8395-demo" | ||
BSP_MTK_LIBDRAM_BOARD_NAME="mt8395-demo" | ||
} | ||
|
||
bsp_radxa-nio-12l-ufs() { | ||
bsp_mt8395 | ||
BSP_MTK_LK_PROJECT="mt8395-evk-ufs" | ||
BSP_MTK_LIBDRAM_BOARD_NAME="genio-1200-evk-ufs" | ||
BSP_UFS_BOOT="true" | ||
} |