51 lines
2.5 KiB
Plaintext
51 lines
2.5 KiB
Plaintext
# Amlogic A311D 2/4GB RAM eMMC GBE USB3 M.2
|
|
BOARD_NAME="Khadas VIM3"
|
|
BOARDFAMILY="meson-g12b"
|
|
BOARD_MAINTAINER="rpardini NicoD-SBC"
|
|
BOOTCONFIG="khadas-vim3_defconfig"
|
|
KERNEL_TARGET="current,edge"
|
|
FULL_DESKTOP="yes"
|
|
SERIALCON="ttyAML0"
|
|
BOOT_LOGO="desktop"
|
|
BOOT_FDT_FILE="amlogic/meson-g12b-a311d-khadas-vim3.dtb" # there is also a s922x dtb, but vim3 is a311d only
|
|
ASOUND_STATE="asound.state.khadas-vim3"
|
|
|
|
BOOTBRANCH_BOARD="tag:v2023.07-rc4"
|
|
BOOTPATCHDIR="v2023.07"
|
|
|
|
declare -g KHADAS_OOWOW_BOARD_ID="VIM3" # for use with EXT=output-image-oowow
|
|
|
|
# To enable the SPI NOR the -spi .dtb is required, because eMMC shares a pin with SPI on the VIM3. To use it:
|
|
# fdtfile=amlogic/meson-g12b-a311d-khadas-vim3-spinor.dtb # in armbianEnv.txt and reboot, then run armbian-install
|
|
# After deploying to SPI-NOR/MTD, return back to the normal DTB, otherwise eMMC speed is impaired.
|
|
UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin.sd.bin:u-boot.bin u-boot-dtb.img u-boot-spi.bin:u-boot-spi.bin"
|
|
write_uboot_platform_mtd() {
|
|
dd if=$1/u-boot-spi.bin of=/dev/mtdblock0
|
|
}
|
|
|
|
# Bring in some old FIP blobs for the VIM3, for use exclusively with SPI booting. See https://github.com/LibreELEC/amlogic-boot-fip/pull/10
|
|
function fetch_sources_tools__libreelec_amlogic_fip_pre_vim3_blob_update() {
|
|
fetch_from_repo "https://github.com/LibreELEC/amlogic-boot-fip" "amlogic-boot-fip-vim3-spi" "commit:f49ee39e1c6988b8ddb24f4e5a63286d133864cb" # pre-VIM3/3L DDR update
|
|
}
|
|
|
|
function post_uboot_custom_postprocess__khadas_vim3_uboot_new_and_old_blobs() {
|
|
# Preserve the u-boot produced (unsigned) u-boot.bin
|
|
run_host_command_logged cp -v u-boot.bin u-boot.bin.orig
|
|
|
|
# Sign using the old FIP blobs (amlogic-boot-fip-vim3-spi), for use exclusively with SPI booting.
|
|
display_alert "Signing u-boot for SPI booting with old blobs" "${BOARD}" "info"
|
|
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip-vim3-spi/khadas-vim3 g12b
|
|
|
|
# Once done, store the resulting u-boot.bin as u-boot-spi.bin referenced in the UBOOT_TARGET_MAP above.
|
|
run_host_command_logged cp -v u-boot.bin u-boot-spi.bin
|
|
|
|
# Restore the original, so we can do everything again.
|
|
run_host_command_logged cp -v u-boot.bin.orig u-boot.bin
|
|
|
|
# Do the normal signing, using the regular/updated FIP blobs. This is for eMMC booting.
|
|
display_alert "Signing u-boot for eMMC/SD booting with new blobs" "${BOARD}" "info"
|
|
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/khadas-vim3 g12b
|
|
|
|
display_alert "Done postprocessing u-boot with new/old FIP blobs" "${BOARD}" "info"
|
|
}
|