Skip to content

Instantly share code, notes, and snippets.

@kadamski
Created February 26, 2016 13:06
Show Gist options
  • Select an option

  • Save kadamski/b3d89fb587eb9da6f2af to your computer and use it in GitHub Desktop.

Select an option

Save kadamski/b3d89fb587eb9da6f2af to your computer and use it in GitHub Desktop.
Script for booting OrangePI PC in FEL mode
g#!/bin/bash
UBOOTDIR=./u-boot/
KERNELDIR=./linux-sunxi/
INITRAMFS=~/Downloads/buildroot-2015.11.1/output/images/rootfs.cpio.uboot
KERNEL_ADDR=0x42000000
RAMDISK_ADDR=0x43300000
FDT_ADDR=0x43000000
SCRIPT_ADDR=0x43100000
cat << _END_ > bootcmd_fel.txt
setenv fdt_high ffffffff
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
bootm $KERNEL_ADDR $RAMDISK_ADDR $FDT_ADDR
_END_
mkimage -C none -A arm -T script -d bootcmd_fel.txt bootfel.scr
sunxi-tools/sunxi-fel uboot ${UBOOTDIR}/u-boot-sunxi-with-spl.bin \
write ${KERNEL_ADDR} ${KERNELDIR}/arch/arm/boot/uImage \
write ${FDT_ADDR} ${KERNELDIR}/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dtb \
write ${SCRIPT_ADDR} ./bootfel.scr \
write ${RAMDISK_ADDR} ${INITRAMFS}
@faddat
Copy link
Copy Markdown

faddat commented Jul 3, 2016

Good one, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment