diff --git a/config/sources/families/spacemit.conf b/config/sources/families/spacemit.conf index 0d67fd252f..aa89b586f4 100644 --- a/config/sources/families/spacemit.conf +++ b/config/sources/families/spacemit.conf @@ -14,44 +14,27 @@ declare -g GOVERNOR="performance" # Arm Trusted Firmware declare -g ATF_USE_GCC="> 8.0" declare -g ATF_COMPILER="riscv64-linux-gnu-" -declare -g ATFSOURCE="https://github.com/riscv-software-src/opensbi.git" +declare -g ATFSOURCE="https://gitee.com/bianbu-linux/opensbi.git" declare -g ATFDIR="opensbi" -declare -g ATFBRANCH="tag:v1.3" +declare -g ATFBRANCH="tag:v2.0.4" declare -g ATF_TARGET_MAP="PLATFORM_DEFCONFIG=k1_defconfig PLATFORM=generic ;;build/platform/generic/firmware/fw_dynamic.itb" -# declare -g ATFPATCHDIR="atf-spacemit" # U-Boot declare -g BOOTSOURCE="https://gitee.com/bianbu-linux/uboot-2022.10.git" -declare -g BOOTBRANCH="${BOOTBRANCH_BOARD:-"tag:v1.0.15"}" +declare -g BOOTBRANCH="${BOOTBRANCH_BOARD:-"tag:v2.0.4"}" declare -g BOOTDIR='u-boot-spacemit' declare -g BOOTPATCHDIR="${BOOTPATCHDIR:-"legacy/u-boot-spacemit-k1"}" declare -g UBOOT_TARGET_MAP=";;bootinfo_emmc.bin FSBL.bin u-boot.itb fw_dynamic.itb" declare -g BOOTCONFIG="k1_defconfig" # Boot with generic SpacemiT K1 config -# Skip all wifi drivers -declare -g KERNEL_DRIVERS_SKIP+=(driver_generic_bring_back_ipx driver_mt7921u_add_pids driver_rtl8152_rtl8153 driver_rtl8189ES - driver_rtl8189FS driver_rtl8192EU driver_rtl8811_rtl8812_rtl8814_rtl8821 driver_xradio_xr819 driver_rtl8811CU_rtl8821C - driver_rtl8188EU_rtl8188ETV driver_rtl88x2bu driver_rtw88 driver_rtl88x2cs driver_rtl8822cs_bt driver_rtl8723DS driver_rtl8723DU - driver_rtl8822BS driver_uwe5622 driver_rtl8723cs) - +# Linux case "${BRANCH}" in - - legacy) - # Kernel - declare -g KERNELSOURCE='https://gitee.com/bianbu-linux/linux-6.1.git' - declare -g KERNELBRANCH='tag:v1.0.15' - declare -g KERNEL_MAJOR_MINOR="6.1" - declare -g LINUXCONFIG="linux-${LINUXFAMILY}-${BRANCH}" - declare -g KERNELPATCHDIR="${LINUXFAMILY}-legacy-${KERNEL_MAJOR_MINOR}" # Needed as long as both legacy and current are 6.1 kernels - declare -g EXTRAWIFI="no" # WiFi drivers are already included in th legacy kernel - ;; - current) - # Kernel - declare -g KERNEL_MAJOR_MINOR="6.1" - declare -g KERNELBRANCH='tag:v6.1.102' # last known good tag on current patchset - declare -g LINUXCONFIG="linux-${LINUXFAMILY}-${KERNEL_MAJOR_MINOR}" - # No need to set KERNELPATCHDIR, since default is: KERNELPATCHDIR='archive/${LINUXFAMILY}-${KERNEL_MAJOR_MINOR}' + declare -g KERNELSOURCE='https://github.com/jmontleon/linux-bianbu.git' + declare -g KERNELBRANCH='commit:d3300881e2d524fbc4f9a8c7174df910f55ab3d0' + declare -g EXTRAWIFI="no" # WiFi drivers are already included in the kernel + declare -g KERNEL_MAJOR_MINOR="6.6" + declare -g LINUXCONFIG="linux-${LINUXFAMILY}-current" ;; esac @@ -73,34 +56,21 @@ pre_prepare_partitions() { write_uboot_platform() { local device=${2} - - declare -A d - d=( - [${1}/bootinfo_emmc.bin]="0:$(du -b ${1}/bootinfo_emmc.bin | awk '{print $1}')" - [${1}/FSBL.bin]="512:$(du -b ${1}/FSBL.bin | awk '{print $1}')" - ) - if [ -b ${2}boot0 ]; then - device=${2}boot0 - echo 0 > /sys/block/$(basename ${device})/force_ro - sync + echo "eMMC" + DEVICE=`ls /dev/mmcblk*boot0 | sed 's/^.....//'` + echo 0 > /sys/block/${DEVICE}/force_ro + sleep .50 + dd if="$1/bootinfo_emmc.bin" of="/dev/${DEVICE}" bs=512 conv=notrunc + dd if="$1/FSBL.bin" of="/dev/${DEVICE}" bs=512 seek=1 conv=notrunc + dd if="$1/FSBL.bin" of="/dev/${DEVICE}" bs=512 seek=512 conv=notrunc + else + echo "SD card" + dd if="$1/bootinfo_emmc.bin" of=$2 bs=512 conv=notrunc + dd if="$1/FSBL.bin" of="$2" bs=512 seek=1 conv=notrunc + dd if="$1/FSBL.bin" of="$2" bs=512 seek=512 conv=notrunc fi - - for f in "${!d[@]}" - do - if $(dd if=${device} bs=1 skip="${d[$f]%:*}" count="${d[$f]#*:}" \ - conv=notrunc status=noxfer 2>/dev/null | cmp --quiet "${f}") - then - echo "Skip $(basename $f), it is equal to the existing one" - else - echo "# Write =: $(basename $f) to ${device}" - dd if=$f of=${device} bs=1 seek="${d[$f]%:*}" conv=notrunc status=noxfer - sync - fi - done - - dd if=$1/fw_dynamic.itb of=${2} bs=512 seek=1280 conv=notrunc - sync - dd if=$1/u-boot.itb of=${2} bs=512 seek=2048 conv=notrunc + dd if="$1/fw_dynamic.itb" of="$2" bs=512 seek=1280 conv=notrunc + dd if="$1/u-boot.itb" of="$2" bs=512 seek=2048 conv=notrunc sync }