#!/bin/sh
#################################################################################
# Firmware for the RK3399 SoC.
# Boards using this SoC:
# * RockPro64
# * PineBook Pro
#################################################################################
# References:
# https://gitlab.manjaro.org/manjaro-arm/packages/community/ap6256-firmware/-/blob/master/PKGBUILD
#
# Debian also carry the rockchip firmware but we're only consuming Manjaro's:
# https://packages.debian.org/bookworm/firmware-linux

OUT=assets
rm -rf $OUT
mkdir $OUT
cd $OUT
FILES="BCM4345C5.hcd fw_bcm43456c5_ag.bin brcmfmac43456-sdio.clm_blob brcmfmac43456-sdio.AP6256.txt"

URL="https://gitlab.manjaro.org/manjaro-arm/packages/community/ap6256-firmware/-/raw/master"
for file in $FILES;
do
  rm -fv $file
  wget $URL/$file || exit 1
done
