u-boot-sopine-spi: Add new port

While the u-boot-sopine port can boot from SPI on the Pine64-LTS and Sopine
module the env is saved and read from the eMMC.
This is a modified sopine u-boot that only read and store the env in the spi
flash available on thoses boards.
Additionally there is also a sopine-spi-flasher.img that can be burnt on a sdcard
and when booted it will program the spi flash.
This commit is contained in:
Emmanuel Vadot 2020-11-13 17:13:13 +00:00
parent 05eed369e9
commit 81e238bd9e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=555035
6 changed files with 65 additions and 0 deletions

View file

@ -1392,6 +1392,7 @@
SUBDIR += u-boot-rpi4
SUBDIR += u-boot-sinovoip-bpi-m3
SUBDIR += u-boot-sopine
SUBDIR += u-boot-sopine-spi
SUBDIR += u-boot-tools
SUBDIR += u-boot-utilite
SUBDIR += u-boot-wandboard

View file

@ -173,6 +173,13 @@ PLIST_FILES+= ${UBOOT_DIR}/${i}
.endfor
PLIST_FILES+= ${UBOOT_DIR}/README
.if defined(PLIST_EXTRAS)
.for i in ${PLIST_EXTRAS}
PLIST_FILES+= ${UBOOT_DIR}/${i}
.endfor
.endif
.if !defined(NO_METADATA)
.if defined(UBOOT_METADATA_${FAMILY:tu}_METHOD)
METADATA_METHOD=${UBOOT_METADATA_${FAMILY:tu}_METHOD}
METADATA_FILES=${UBOOT_METADATA_${FAMILY:tu}_FILES}
@ -186,6 +193,7 @@ METADATA_BS=${UBOOT_METADATA_${FAMILY:tu}_RAW_BS}
.error "Unsupported METADATA_METHOD"
.endif
.endif
.endif
post-patch:
@${REINPLACE_CMD} -e "s|make|${MAKE_CMD}|" ${WRKSRC}/scripts/kconfig/merge_config.sh

View file

@ -0,0 +1,25 @@
# $FreeBSD$
MASTERDIR= ${.CURDIR}/../u-boot-master
MODEL= sopine-spi
BOARD_CONFIG= sopine_baseboard_defconfig
FAMILY= allwinner64
CONFIG_FRAGMENT= ${.CURDIR}/../u-boot-sopine-spi/files/spi_fragment
FRAGMENT_NAME= spi_fragment
NO_METADATA= yes
UBOOT_PLIST= u-boot-sunxi-with-spl.bin \
boot.scr
PLIST_EXTRAS= sopine-spi-flasher.img
post-build:
mkimage -C none -A arm64 -T script -d ${.CURDIR}/../u-boot-sopine-spi/files/boot.cmd ${WRKSRC}/boot.scr
post-stage:
makefs -t msdos -s 5m ${WRKDIR}/sopine-spi-flash.msdos ${STAGEDIR}/${INST}
mkimg -v -s mbr -p fat32::5M:1M -o ${STAGEDIR}/${INST}/sopine-spi-flasher.img
dd if=${WRKDIR}/sopine-spi-flash.msdos of=${STAGEDIR}/${INST}/sopine-spi-flasher.img bs=1M oseek=1 conv=notrunc
dd if=${STAGEDIR}/${INST}/u-boot-sunxi-with-spl.bin of=${STAGEDIR}/${INST}/sopine-spi-flasher.img bs=1k oseek=8 conv=notrunc
.include "${MASTERDIR}/Makefile"

View file

@ -0,0 +1,8 @@
sf probe
sf erase 0 0x100000
fatload mmc 0 ${kernel_addr_r} u-boot-sunxi-with-spl.bin
sf write ${kernel_addr_r} 0 0x100000
echo "Flash programmed"
while true; do
sleep 1
done

View file

@ -0,0 +1,5 @@
CONFIG_ENV_SIZE=0x20000
CONFIG_ENV_OFFSET=0x100000
CONFIG_ENV_SECT_SIZE=0x10000
CONFIG_ENV_IS_IN_FAT=n
CONFIG_ENV_IS_IN_SPI_FLASH=y

View file

@ -0,0 +1,18 @@
U-Boot loader and related files for the Sopine SPI Flash.
To install this bootloader on the spi flash just do from a running sopine system:
dd if=/usr/local/share/u-boot/u-boot-sopine-spi/u-boot-sunxi-with-spl.bin of=/dev/flash/spi0 bs=64k conv=sync
U-boot environment variables are save in the flash and not in the fat partition.
You can also use the flasher image
dd if=/usr/local/share/u-boot/u-boot-sopine-spi/sopine-spi-flasher.img of=/path/to/sdcard
Boot the sdcard on the sopine/pine64-lts and it will erase and populate the spi flash
with this u-boot.
Since there is no led that we can flash do indicate that flashing is done the best way to
know it to connect an uart adapter or hdmi monitor.
For information about running FreeBSD on Allwinner boards, see
https://wiki.freebsd.org/FreeBSD/arm/Allwinner
WWW: https://www.denx.de/wiki/U-Boot