armbian-build/config/boards/indiedroid-nova.csc
Ricardo Pardini 54c896e029 rk3588: configure UEFI_EDK2_BOARD_ID for all UEFI-supported boards
- From https://github.com/edk2-porting/edk2-rk3588/releases/tag/v0.9.1
  - For example, for `rock-5b_UEFI_Release_v0.9.1.img`
    - `UEFI_EDK2_BOARD_ID` is `rock-5b`
- **Important**: this has no effect unless optional extension is enabled
- to test this out:
  - make sure to read carefully the instructions at https://github.com/edk2-porting/edk2-rk3588/blob/master/README.md
  - suppose you previously built the regular u-boot version with:
    - `./compile.sh BOARD=rock-5b BRANCH=legacy RELEASE=jammy`
  - now you can build the UEFI version with:
    - `./compile.sh BOARD=rock-5b BRANCH=legacy RELEASE=jammy EXT=uefi-edk2-rk3588`
  - write the produced image to SD or eMMC and boot it
  - use normally, or enter "UMS" mode by selecting that option in the grub menu
    - You can write image to eMMC, boot it, enter UMS, write it again to NVMe, reboot, press <ESC> in UEFI and boot from NVMe
    - Also works if .img is written to eg USB stick, and UEFI edk2 is separately deployed to SPI flash
- **Important**: make _absolutely_ sure you are able to force Maskrom mode (by shorting pins, pressing buttons, etc) before writing an UEFI image to eMMC; UEFI has no RockUSB ("Loader mode" support) at all. The new "initramfs-usb-gadget-ums" extension hopes to address this, but it is not guaranteed to work.
2023-11-19 22:31:33 +01:00

93 lines
3.8 KiB
Plaintext

# Rockchip RK3588S octa core 4/8/16GB RAM SoC eMMC USB3 USB-C GbE
declare -g BOARD_NAME="Indiedroid Nova"
declare -g BOARD_MAINTAINER="lanefu"
declare -g BOARDFAMILY="rockchip-rk3588"
declare -g BOOTCONFIG="indiedroid_defconfig" # vendor name, not standard, see hook below, set BOOT_SOC below to compensate
declare -g BOOT_SOC="rk3588"
declare -g KERNEL_TARGET="legacy,collabora,edge"
declare -g FULL_DESKTOP="yes"
declare -g BOOT_LOGO="desktop"
declare -g BOOT_FDT_FILE="rockchip/rk3588s-indiedroid-nova.dtb"
declare -g BOOT_SCENARIO="spl-blobs"
declare -g BOOT_SUPPORT_SPI="no"
declare -g IMAGE_PARTITION_TABLE="gpt"
declare -g SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes
declare -g BOOTFS_TYPE="fat"
declare -g SRC_EXTLINUX="no" # going back to standard uboot for now
declare -g BL31_BLOB='rk35/rk3588_bl31_v1.38.elf'
declare -g DDR_BLOB='rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.11.bin'
declare -g UEFI_EDK2_BOARD_ID="indiedroid-nova" # This _only_ used for uefi-edk2-rk3588 extension
## only applies to extlinux so not used
declare -g SRC_CMDLINE="console=ttyS0,115200n8 console=tty1 console=both net.ifnames=0 rootflags=data=writeback"
# Override family config for this board; let's avoid conditionals in family config.
function post_family_config__indiedroid-nova_use_stvhay_uboot() {
declare -g BOOTSOURCE='https://github.com/stvhay/u-boot.git'
declare -g BOOTBRANCH='branch:rockchip-rk3588-unified'
declare -g BOOTPATCHDIR="legacy"
}
# BSP kernel uses device name from contract manufacturer rather than production name in mainline
function post_family_config_branch_legacy__use_9tripod_dtb() {
declare -g BOOT_FDT_FILE="rockchip/rk3588s-9tripod-linux.dtb"
}
# Add bluetooth packages to the image (not rootfs cache)
function post_family_config__bluetooth_hciattach_add_bluetooth_packages() {
display_alert "${BOARD}" "adding bluetooth packages to image" "info"
add_packages_to_image rfkill bluetooth bluez bluez-tools
}
# setup bluetooth stuff
function pre_customize_image__indiedroid_add_bluetooth() {
display_alert "${BOARD}" "install bluetooth firmware" "info"
local TMPDIR
# Build firmware
TMPDIR=$(mktemp -d)
pushd "${TMPDIR}" || exit 1
git clone https://github.com/stvhay/rkwifibt || exit 1
cd rkwifibt || exit 1
make -C realtek/rtk_hciattach || exit 1
# Install the firmware and utility
mkdir -p "${SDCARD}/lib/firmware/rtl_bt"
cp -fr realtek/RTL8821CS/* "${SDCARD}/lib/firmware/rtl_bt/"
cp -f realtek/rtk_hciattach/rtk_hciattach "${SDCARD}/usr/bin/"
cp -f bt_load_rtk_firmware "${SDCARD}/usr/bin/"
chroot_sdcard chmod +x /usr/bin/{rtk_hciattach,bt_load_rtk_firmware}
echo hci_uart >> "${SDCARD}/etc/modules"
popd || exit 1
#TODO this should probably be replaced with the existing extensions/bluetooth-hciattach.sh
display_alert "${BOARD}" "setup bluetooth service" "info"
# Systemd service
cat > "${SDCARD}/etc/systemd/system/bluetooth-rtl8821cs.service" <<- EOD
[Unit]
Description=RTL8821CS Firmware Service
After=network.target
[Service]
Type=oneshot
Environment=BT_TTY_DEV=/dev/ttyS9
ExecStart=/usr/bin/bt_load_rtk_firmware
RemainAfterExit=true
StandardOutput=journal
[Install]
WantedBy=multi-user.target
EOD
chroot_sdcard systemctl enable bluetooth-rtl8821cs.service
}
function post_family_tweaks__indiedroid_naming_audios() {
display_alert "$BOARD" "Renaming indiedroid audios" "info"
mkdir -p $SDCARD/etc/udev/rules.d/
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' > $SDCARD/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-dp0-sound", ENV{SOUND_DESCRIPTION}="DP0 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules
echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-es8388-sound", ENV{SOUND_DESCRIPTION}="ES8388 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules
return 0
}